42cf5bc1 |
1 | // Created on: 1992-05-06 |
2 | // Created by: Jacques GOUSSARD |
3 | // Copyright (c) 1992-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _IntPatch_Point_HeaderFile |
18 | #define _IntPatch_Point_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <IntSurf_PntOn2S.hxx> |
42cf5bc1 |
25 | #include <IntSurf_Transition.hxx> |
c22b52d6 |
26 | #include <Adaptor2d_Curve2d.hxx> |
e8862cf4 |
27 | |
42cf5bc1 |
28 | class Adaptor3d_HVertex; |
42cf5bc1 |
29 | class gp_Pnt; |
42cf5bc1 |
30 | |
31 | |
32 | //! Definition of an intersection point between two surfaces. |
21c7c457 |
33 | //! Such a point is contains geometrical information (see |
34 | //! the Value method) and logical information. |
42cf5bc1 |
35 | class IntPatch_Point |
36 | { |
37 | public: |
38 | |
39 | DEFINE_STANDARD_ALLOC |
40 | |
41 | |
42 | //! Empty constructor. |
0f57ab75 |
43 | IntPatch_Point(); |
42cf5bc1 |
44 | |
45 | //! Sets the values of a point which is on no domain, |
46 | //! when both surfaces are implicit ones. |
47 | //! If Tangent is True, the point is a point of tangency |
48 | //! between the surfaces. |
49 | Standard_EXPORT void SetValue (const gp_Pnt& Pt, const Standard_Real Tol, const Standard_Boolean Tangent); |
50 | |
51 | void SetValue (const gp_Pnt& Pt); |
e2e0498b |
52 | |
53 | //! Sets the value of <pt> member |
54 | void SetValue (const IntSurf_PntOn2S& thePOn2S); |
55 | |
42cf5bc1 |
56 | |
57 | void SetTolerance (const Standard_Real Tol); |
58 | |
59 | //! Sets the values of the parameters of the point |
60 | //! on each surface. |
61 | void SetParameters (const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2); |
62 | |
63 | //! Set the value of the parameter on the intersection line. |
64 | void SetParameter (const Standard_Real Para); |
65 | |
66 | //! Sets the values of a point which is a vertex on |
67 | //! the initial facet of restriction of one |
68 | //! of the surface. |
69 | //! If OnFirst is True, the point is on the domain of the |
70 | //! first patch, otherwise the point is on the domain of the |
71 | //! second surface. |
72 | Standard_EXPORT void SetVertex (const Standard_Boolean OnFirst, const Handle(Adaptor3d_HVertex)& V); |
73 | |
74 | //! Sets the values of a point which is on one of the domain, |
75 | //! when both surfaces are implicit ones. |
76 | //! If OnFirst is True, the point is on the domain of the |
77 | //! first patch, otherwise the point is on the domain of the |
78 | //! second surface. |
c22b52d6 |
79 | Standard_EXPORT void SetArc (const Standard_Boolean OnFirst, const Handle(Adaptor2d_Curve2d)& A, const Standard_Real Param, const IntSurf_Transition& TLine, const IntSurf_Transition& TArc); |
42cf5bc1 |
80 | |
81 | //! Sets (or unsets) the point as a point on several |
82 | //! intersection line. |
83 | void SetMultiple (const Standard_Boolean IsMult); |
84 | |
85 | //! Returns the intersection point (geometric information). |
86 | const gp_Pnt& Value() const; |
87 | |
88 | //! This method returns the parameter of the point |
89 | //! on the intersection line. |
90 | //! If the points does not belong to an intersection line, |
91 | //! the value returned does not have any sens. |
92 | Standard_Real ParameterOnLine() const; |
93 | |
94 | //! This method returns the fuzziness on the point. |
95 | Standard_Real Tolerance() const; |
96 | |
97 | //! Returns True if the Point is a tangency point between |
98 | //! the surfaces. |
99 | //! If the Point is on one of the domain (IsOnDomS1 returns |
100 | //! True or IsOnDomS2 returns True), an exception is raised. |
101 | Standard_Boolean IsTangencyPoint() const; |
102 | |
103 | //! Returns the parameters on the first surface of the point. |
104 | void ParametersOnS1 (Standard_Real& U1, Standard_Real& V1) const; |
105 | |
106 | //! Returns the parameters on the second surface of the point. |
107 | void ParametersOnS2 (Standard_Real& U2, Standard_Real& V2) const; |
108 | |
109 | //! Returns True if the point belongs to several intersection |
110 | //! lines. |
111 | Standard_Boolean IsMultiple() const; |
112 | |
113 | //! Returns TRUE if the point is on a boundary of the domain |
114 | //! of the first patch. |
115 | Standard_Boolean IsOnDomS1() const; |
116 | |
117 | //! Returns TRUE if the point is a vertex on the initial |
118 | //! restriction facet of the first surface. |
119 | Standard_Boolean IsVertexOnS1() const; |
120 | |
121 | //! Returns the information about the point when it is |
122 | //! on the domain of the first patch, i-e when the function |
123 | //! IsVertexOnS1 returns True. |
124 | //! Otherwise, an exception is raised. |
125 | const Handle(Adaptor3d_HVertex)& VertexOnS1() const; |
126 | |
127 | //! Returns the arc of restriction containing the |
128 | //! vertex. |
129 | //! The exception DomainError is raised if |
130 | //! IsOnDomS1 returns False. |
c22b52d6 |
131 | const Handle(Adaptor2d_Curve2d)& ArcOnS1() const; |
42cf5bc1 |
132 | |
133 | //! Returns the transition of the point on the |
134 | //! intersection line with the arc on S1. |
135 | //! The exception DomainError is raised if IsOnDomS1 |
136 | //! returns False. |
137 | const IntSurf_Transition& TransitionLineArc1() const; |
138 | |
139 | //! Returns the transition between the intersection line |
140 | //! returned by the method Line and the arc on S1 returned |
141 | //! by ArcOnS1(). |
142 | //! The exception DomainError is raised if |
143 | //! IsOnDomS1 returns False. |
144 | const IntSurf_Transition& TransitionOnS1() const; |
145 | |
146 | //! Returns the parameter of the point on the |
147 | //! arc returned by the method ArcOnS2. |
148 | //! The exception DomainError is raised if |
149 | //! IsOnDomS1 returns False. |
150 | Standard_Real ParameterOnArc1() const; |
151 | |
152 | //! Returns TRUE if the point is on a boundary of the domain |
153 | //! of the second patch. |
154 | Standard_Boolean IsOnDomS2() const; |
155 | |
156 | //! Returns TRUE if the point is a vertex on the initial |
157 | //! restriction facet of the first surface. |
158 | Standard_Boolean IsVertexOnS2() const; |
159 | |
160 | //! Returns the information about the point when it is |
161 | //! on the domain of the second patch, i-e when the function |
162 | //! IsVertexOnS2 returns True. |
163 | //! Otherwise, an exception is raised. |
164 | const Handle(Adaptor3d_HVertex)& VertexOnS2() const; |
165 | |
166 | //! Returns the arc of restriction containing the |
167 | //! vertex. |
168 | //! The exception DomainError is raised if |
169 | //! IsOnDomS2 returns False. |
c22b52d6 |
170 | const Handle(Adaptor2d_Curve2d)& ArcOnS2() const; |
42cf5bc1 |
171 | |
172 | //! Returns the transition of the point on the |
173 | //! intersection line with the arc on S2. |
174 | //! The exception DomainError is raised if IsOnDomS2 |
175 | //! returns False. |
176 | const IntSurf_Transition& TransitionLineArc2() const; |
177 | |
178 | //! Returns the transition between the intersection line |
179 | //! returned by the method Line and the arc on S2 returned |
180 | //! by ArcOnS2. |
181 | //! The exception DomainError is raised if |
182 | //! IsOnDomS2 returns False. |
183 | const IntSurf_Transition& TransitionOnS2() const; |
184 | |
185 | //! Returns the parameter of the point on the |
186 | //! arc returned by the method ArcOnS2. |
187 | //! The exception DomainError is raised if |
188 | //! IsOnDomS2 returns False. |
189 | Standard_Real ParameterOnArc2() const; |
190 | |
191 | //! Returns the PntOn2S |
192 | //! (geometric Point and the parameters) |
193 | const IntSurf_PntOn2S& PntOn2S() const; |
194 | |
195 | //! Returns the parameters on the first and on the |
196 | //! second surface of the point. |
197 | void Parameters (Standard_Real& U1, Standard_Real& V1, Standard_Real& U2, Standard_Real& V2) const; |
198 | |
199 | Standard_EXPORT void ReverseTransition(); |
200 | |
201 | Standard_EXPORT void Dump() const; |
202 | |
203 | |
204 | |
205 | |
206 | protected: |
207 | |
208 | |
209 | |
210 | |
211 | |
212 | private: |
213 | |
214 | |
215 | |
216 | IntSurf_PntOn2S pt; |
217 | Standard_Real para; |
218 | Standard_Real tol; |
219 | Standard_Boolean tgt; |
3306fdd9 |
220 | |
221 | //TRUE if the point is in several intersection lines |
42cf5bc1 |
222 | Standard_Boolean mult; |
3306fdd9 |
223 | |
42cf5bc1 |
224 | Standard_Boolean onS1; |
225 | Standard_Boolean vtxonS1; |
226 | Handle(Adaptor3d_HVertex) vS1; |
c22b52d6 |
227 | Handle(Adaptor2d_Curve2d) arcS1; |
42cf5bc1 |
228 | IntSurf_Transition traline1; |
229 | IntSurf_Transition tra1; |
230 | Standard_Real prm1; |
231 | Standard_Boolean onS2; |
232 | Standard_Boolean vtxonS2; |
233 | Handle(Adaptor3d_HVertex) vS2; |
c22b52d6 |
234 | Handle(Adaptor2d_Curve2d) arcS2; |
42cf5bc1 |
235 | IntSurf_Transition traline2; |
236 | IntSurf_Transition tra2; |
237 | Standard_Real prm2; |
238 | |
239 | |
240 | }; |
241 | |
242 | |
243 | #include <IntPatch_Point.lxx> |
244 | |
245 | |
246 | |
247 | |
248 | |
249 | #endif // _IntPatch_Point_HeaderFile |