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> |
25 | #include <Standard_Real.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <IntSurf_Transition.hxx> |
e8862cf4 |
28 | #include <Adaptor2d_HCurve2d.hxx> |
29 | |
42cf5bc1 |
30 | class Adaptor3d_HVertex; |
42cf5bc1 |
31 | class Standard_DomainError; |
32 | class gp_Pnt; |
33 | class IntSurf_Transition; |
34 | class IntSurf_PntOn2S; |
35 | |
36 | |
37 | //! Definition of an intersection point between two surfaces. |
38 | //! Such a point is contains geometrical informations (see |
39 | //! the Value method) and logical informations. |
40 | class IntPatch_Point |
41 | { |
42 | public: |
43 | |
44 | DEFINE_STANDARD_ALLOC |
45 | |
46 | |
47 | //! Empty constructor. |
48 | Standard_EXPORT IntPatch_Point(); |
49 | |
50 | //! Sets the values of a point which is on no domain, |
51 | //! when both surfaces are implicit ones. |
52 | //! If Tangent is True, the point is a point of tangency |
53 | //! between the surfaces. |
54 | Standard_EXPORT void SetValue (const gp_Pnt& Pt, const Standard_Real Tol, const Standard_Boolean Tangent); |
55 | |
56 | void SetValue (const gp_Pnt& Pt); |
57 | |
58 | void SetTolerance (const Standard_Real Tol); |
59 | |
60 | //! Sets the values of the parameters of the point |
61 | //! on each surface. |
62 | void SetParameters (const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2); |
63 | |
64 | //! Set the value of the parameter on the intersection line. |
65 | void SetParameter (const Standard_Real Para); |
66 | |
67 | //! Sets the values of a point which is a vertex on |
68 | //! the initial facet of restriction of one |
69 | //! of the surface. |
70 | //! If OnFirst is True, the point is on the domain of the |
71 | //! first patch, otherwise the point is on the domain of the |
72 | //! second surface. |
73 | Standard_EXPORT void SetVertex (const Standard_Boolean OnFirst, const Handle(Adaptor3d_HVertex)& V); |
74 | |
75 | //! Sets the values of a point which is on one of the domain, |
76 | //! when both surfaces are implicit ones. |
77 | //! If OnFirst is True, the point is on the domain of the |
78 | //! first patch, otherwise the point is on the domain of the |
79 | //! second surface. |
80 | Standard_EXPORT void SetArc (const Standard_Boolean OnFirst, const Handle(Adaptor2d_HCurve2d)& A, const Standard_Real Param, const IntSurf_Transition& TLine, const IntSurf_Transition& TArc); |
81 | |
82 | //! Sets (or unsets) the point as a point on several |
83 | //! intersection line. |
84 | void SetMultiple (const Standard_Boolean IsMult); |
85 | |
86 | //! Returns the intersection point (geometric information). |
87 | const gp_Pnt& Value() const; |
88 | |
89 | //! This method returns the parameter of the point |
90 | //! on the intersection line. |
91 | //! If the points does not belong to an intersection line, |
92 | //! the value returned does not have any sens. |
93 | Standard_Real ParameterOnLine() const; |
94 | |
95 | //! This method returns the fuzziness on the point. |
96 | Standard_Real Tolerance() const; |
97 | |
98 | //! Returns True if the Point is a tangency point between |
99 | //! the surfaces. |
100 | //! If the Point is on one of the domain (IsOnDomS1 returns |
101 | //! True or IsOnDomS2 returns True), an exception is raised. |
102 | Standard_Boolean IsTangencyPoint() const; |
103 | |
104 | //! Returns the parameters on the first surface of the point. |
105 | void ParametersOnS1 (Standard_Real& U1, Standard_Real& V1) const; |
106 | |
107 | //! Returns the parameters on the second surface of the point. |
108 | void ParametersOnS2 (Standard_Real& U2, Standard_Real& V2) const; |
109 | |
110 | //! Returns True if the point belongs to several intersection |
111 | //! lines. |
112 | Standard_Boolean IsMultiple() const; |
113 | |
114 | //! Returns TRUE if the point is on a boundary of the domain |
115 | //! of the first patch. |
116 | Standard_Boolean IsOnDomS1() const; |
117 | |
118 | //! Returns TRUE if the point is a vertex on the initial |
119 | //! restriction facet of the first surface. |
120 | Standard_Boolean IsVertexOnS1() const; |
121 | |
122 | //! Returns the information about the point when it is |
123 | //! on the domain of the first patch, i-e when the function |
124 | //! IsVertexOnS1 returns True. |
125 | //! Otherwise, an exception is raised. |
126 | const Handle(Adaptor3d_HVertex)& VertexOnS1() const; |
127 | |
128 | //! Returns the arc of restriction containing the |
129 | //! vertex. |
130 | //! The exception DomainError is raised if |
131 | //! IsOnDomS1 returns False. |
132 | const Handle(Adaptor2d_HCurve2d)& ArcOnS1() const; |
133 | |
134 | //! Returns the transition of the point on the |
135 | //! intersection line with the arc on S1. |
136 | //! The exception DomainError is raised if IsOnDomS1 |
137 | //! returns False. |
138 | const IntSurf_Transition& TransitionLineArc1() const; |
139 | |
140 | //! Returns the transition between the intersection line |
141 | //! returned by the method Line and the arc on S1 returned |
142 | //! by ArcOnS1(). |
143 | //! The exception DomainError is raised if |
144 | //! IsOnDomS1 returns False. |
145 | const IntSurf_Transition& TransitionOnS1() const; |
146 | |
147 | //! Returns the parameter of the point on the |
148 | //! arc returned by the method ArcOnS2. |
149 | //! The exception DomainError is raised if |
150 | //! IsOnDomS1 returns False. |
151 | Standard_Real ParameterOnArc1() const; |
152 | |
153 | //! Returns TRUE if the point is on a boundary of the domain |
154 | //! of the second patch. |
155 | Standard_Boolean IsOnDomS2() const; |
156 | |
157 | //! Returns TRUE if the point is a vertex on the initial |
158 | //! restriction facet of the first surface. |
159 | Standard_Boolean IsVertexOnS2() const; |
160 | |
161 | //! Returns the information about the point when it is |
162 | //! on the domain of the second patch, i-e when the function |
163 | //! IsVertexOnS2 returns True. |
164 | //! Otherwise, an exception is raised. |
165 | const Handle(Adaptor3d_HVertex)& VertexOnS2() const; |
166 | |
167 | //! Returns the arc of restriction containing the |
168 | //! vertex. |
169 | //! The exception DomainError is raised if |
170 | //! IsOnDomS2 returns False. |
171 | const Handle(Adaptor2d_HCurve2d)& ArcOnS2() const; |
172 | |
173 | //! Returns the transition of the point on the |
174 | //! intersection line with the arc on S2. |
175 | //! The exception DomainError is raised if IsOnDomS2 |
176 | //! returns False. |
177 | const IntSurf_Transition& TransitionLineArc2() const; |
178 | |
179 | //! Returns the transition between the intersection line |
180 | //! returned by the method Line and the arc on S2 returned |
181 | //! by ArcOnS2. |
182 | //! The exception DomainError is raised if |
183 | //! IsOnDomS2 returns False. |
184 | const IntSurf_Transition& TransitionOnS2() const; |
185 | |
186 | //! Returns the parameter of the point on the |
187 | //! arc returned by the method ArcOnS2. |
188 | //! The exception DomainError is raised if |
189 | //! IsOnDomS2 returns False. |
190 | Standard_Real ParameterOnArc2() const; |
191 | |
192 | //! Returns the PntOn2S |
193 | //! (geometric Point and the parameters) |
194 | const IntSurf_PntOn2S& PntOn2S() const; |
195 | |
196 | //! Returns the parameters on the first and on the |
197 | //! second surface of the point. |
198 | void Parameters (Standard_Real& U1, Standard_Real& V1, Standard_Real& U2, Standard_Real& V2) const; |
199 | |
200 | Standard_EXPORT void ReverseTransition(); |
201 | |
202 | Standard_EXPORT void Dump() const; |
203 | |
204 | |
205 | |
206 | |
207 | protected: |
208 | |
209 | |
210 | |
211 | |
212 | |
213 | private: |
214 | |
215 | |
216 | |
217 | IntSurf_PntOn2S pt; |
218 | Standard_Real para; |
219 | Standard_Real tol; |
220 | Standard_Boolean tgt; |
221 | Standard_Boolean mult; |
222 | Standard_Boolean onS1; |
223 | Standard_Boolean vtxonS1; |
224 | Handle(Adaptor3d_HVertex) vS1; |
225 | Handle(Adaptor2d_HCurve2d) arcS1; |
226 | IntSurf_Transition traline1; |
227 | IntSurf_Transition tra1; |
228 | Standard_Real prm1; |
229 | Standard_Boolean onS2; |
230 | Standard_Boolean vtxonS2; |
231 | Handle(Adaptor3d_HVertex) vS2; |
232 | Handle(Adaptor2d_HCurve2d) arcS2; |
233 | IntSurf_Transition traline2; |
234 | IntSurf_Transition tra2; |
235 | Standard_Real prm2; |
236 | |
237 | |
238 | }; |
239 | |
240 | |
241 | #include <IntPatch_Point.lxx> |
242 | |
243 | |
244 | |
245 | |
246 | |
247 | #endif // _IntPatch_Point_HeaderFile |