42cf5bc1 |
1 | // Created on: 1996-11-21 |
2 | // Created by: Joelle CHAUVET |
3 | // Copyright (c) 1996-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 _GeomPlate_Surface_HeaderFile |
18 | #define _GeomPlate_Surface_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Plate_Plate.hxx> |
24 | #include <Standard_Real.hxx> |
25 | #include <Geom_Surface.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <GeomAbs_Shape.hxx> |
28 | #include <Standard_Integer.hxx> |
29 | #include <TColgp_SequenceOfXY.hxx> |
30 | class Geom_Surface; |
31 | class Standard_RangeError; |
32 | class Standard_NoSuchObject; |
33 | class Geom_UndefinedDerivative; |
34 | class Geom_UndefinedValue; |
35 | class Plate_Plate; |
36 | class gp_Trsf; |
37 | class gp_GTrsf2d; |
38 | class Geom_Curve; |
39 | class gp_Pnt; |
40 | class gp_Vec; |
41 | class Geom_Geometry; |
42 | |
43 | |
44 | class GeomPlate_Surface; |
45 | DEFINE_STANDARD_HANDLE(GeomPlate_Surface, Geom_Surface) |
46 | |
47 | |
48 | //! Describes the characteristics of plate surface objects |
49 | //! returned by BuildPlateSurface::Surface. These can be |
50 | //! used to verify the quality of the resulting surface before |
51 | //! approximating it to a Geom_BSpline surface generated |
52 | //! by MakeApprox. This proves necessary in cases where |
53 | //! you want to use the resulting surface as the support for |
54 | //! a shape. The algorithmically generated surface cannot |
55 | //! fill this function as is, and as a result must be converted first. |
56 | class GeomPlate_Surface : public Geom_Surface |
57 | { |
58 | |
59 | public: |
60 | |
61 | |
62 | Standard_EXPORT GeomPlate_Surface(const Handle(Geom_Surface)& Surfinit, const Plate_Plate& Surfinter); |
63 | |
64 | |
65 | //! Reverses the U direction of parametrization of <me>. |
66 | //! The bounds of the surface are not modified. |
79104795 |
67 | Standard_EXPORT void UReverse() Standard_OVERRIDE; |
42cf5bc1 |
68 | |
69 | //! Return the parameter on the Ureversed surface for |
70 | //! the point of parameter U on <me>. |
71 | //! |
72 | //! me->UReversed()->Value(me->UReversedParameter(U),V) |
73 | //! |
74 | //! is the same point as |
75 | //! |
76 | //! me->Value(U,V) |
79104795 |
77 | Standard_EXPORT Standard_Real UReversedParameter (const Standard_Real U) const Standard_OVERRIDE; |
42cf5bc1 |
78 | |
79 | |
80 | //! Reverses the V direction of parametrization of <me>. |
81 | //! The bounds of the surface are not modified. |
79104795 |
82 | Standard_EXPORT void VReverse() Standard_OVERRIDE; |
42cf5bc1 |
83 | |
84 | //! Return the parameter on the Vreversed surface for |
85 | //! the point of parameter V on <me>. |
86 | //! |
87 | //! me->VReversed()->Value(U,me->VReversedParameter(V)) |
88 | //! |
89 | //! is the same point as |
90 | //! |
91 | //! me->Value(U,V) |
79104795 |
92 | Standard_EXPORT Standard_Real VReversedParameter (const Standard_Real V) const Standard_OVERRIDE; |
42cf5bc1 |
93 | |
94 | //! Computes the parameters on the transformed surface for |
95 | //! the transform of the point of parameters U,V on <me>. |
96 | //! |
97 | //! me->Transformed(T)->Value(U',V') |
98 | //! |
99 | //! is the same point as |
100 | //! |
101 | //! me->Value(U,V).Transformed(T) |
102 | //! |
103 | //! Where U',V' are the new values of U,V after calling |
104 | //! |
105 | //! me->TranformParameters(U,V,T) |
106 | //! |
107 | //! This methods does not change <U> and <V> |
108 | //! |
109 | //! It can be redefined. For example on the Plane, |
110 | //! Cylinder, Cone, Revolved and Extruded surfaces. |
111 | Standard_EXPORT virtual void TransformParameters (Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const Standard_OVERRIDE; |
112 | |
113 | //! Returns a 2d transformation used to find the new |
114 | //! parameters of a point on the transformed surface. |
115 | //! |
116 | //! me->Transformed(T)->Value(U',V') |
117 | //! |
118 | //! is the same point as |
119 | //! |
120 | //! me->Value(U,V).Transformed(T) |
121 | //! |
122 | //! Where U',V' are obtained by transforming U,V with |
123 | //! th 2d transformation returned by |
124 | //! |
125 | //! me->ParametricTransformation(T) |
126 | //! |
127 | //! This methods returns an identity transformation |
128 | //! |
129 | //! It can be redefined. For example on the Plane, |
130 | //! Cylinder, Cone, Revolved and Extruded surfaces. |
131 | Standard_EXPORT virtual gp_GTrsf2d ParametricTransformation (const gp_Trsf& T) const Standard_OVERRIDE; |
132 | |
79104795 |
133 | Standard_EXPORT void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const Standard_OVERRIDE; |
42cf5bc1 |
134 | |
135 | |
136 | //! Is the surface closed in the parametric direction U ? |
137 | //! Returns True if for each parameter V the distance |
138 | //! between the point P (UFirst, V) and P (ULast, V) is |
139 | //! lower or equal to Resolution from gp. UFirst and ULast |
140 | //! are the parametric bounds in the U direction. |
79104795 |
141 | Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE; |
42cf5bc1 |
142 | |
143 | |
144 | //! Is the surface closed in the parametric direction V ? |
145 | //! Returns True if for each parameter U the distance |
146 | //! between the point P (U, VFirst) and P (U, VLast) is |
147 | //! lower or equal to Resolution from gp. VFirst and VLast |
148 | //! are the parametric bounds in the V direction. |
79104795 |
149 | Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE; |
42cf5bc1 |
150 | |
151 | |
152 | //! Is the parametrization of a surface periodic in the |
153 | //! direction U ? |
154 | //! It is possible only if the surface is closed in this |
155 | //! parametric direction and if the following relation is |
156 | //! satisfied : |
157 | //! for each parameter V the distance between the point |
158 | //! P (U, V) and the point P (U + T, V) is lower or equal |
159 | //! to Resolution from package gp. T is the parametric period |
160 | //! and must be a constant. |
79104795 |
161 | Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE; |
42cf5bc1 |
162 | |
163 | //! returns the Uperiod. |
164 | //! raises if the surface is not uperiodic. |
165 | Standard_EXPORT virtual Standard_Real UPeriod() const Standard_OVERRIDE; |
166 | |
167 | |
168 | //! Is the parametrization of a surface periodic in the |
169 | //! direction U ? |
170 | //! It is possible only if the surface is closed in this |
171 | //! parametric direction and if the following relation is |
172 | //! satisfied : |
173 | //! for each parameter V the distance between the point |
174 | //! P (U, V) and the point P (U + T, V) is lower or equal |
175 | //! to Resolution from package gp. T is the parametric period |
176 | //! and must be a constant. |
79104795 |
177 | Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE; |
42cf5bc1 |
178 | |
179 | //! returns the Vperiod. |
180 | //! raises if the surface is not vperiodic. |
181 | Standard_EXPORT virtual Standard_Real VPeriod() const Standard_OVERRIDE; |
182 | |
183 | //! Computes the U isoparametric curve. |
79104795 |
184 | Standard_EXPORT Handle(Geom_Curve) UIso (const Standard_Real U) const Standard_OVERRIDE; |
42cf5bc1 |
185 | |
186 | //! Computes the V isoparametric curve. |
79104795 |
187 | Standard_EXPORT Handle(Geom_Curve) VIso (const Standard_Real V) const Standard_OVERRIDE; |
42cf5bc1 |
188 | |
189 | |
190 | //! Global Continuity of the surface in direction U and V : |
191 | //! C0 : only geometric continuity, |
192 | //! C1 : continuity of the first derivative all along the surface, |
193 | //! C2 : continuity of the second derivative all along the surface, |
194 | //! C3 : continuity of the third derivative all along the surface, |
195 | //! G1 : tangency continuity all along the surface, |
196 | //! G2 : curvature continuity all along the surface, |
197 | //! CN : the order of continuity is infinite. |
198 | //! Example : |
199 | //! If the surface is C1 in the V parametric direction and C2 |
200 | //! in the U parametric direction Shape = C1. |
79104795 |
201 | Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE; |
42cf5bc1 |
202 | |
203 | |
204 | //! Returns the order of continuity of the surface in the |
205 | //! U parametric direction. |
206 | //! Raised if N < 0. |
79104795 |
207 | Standard_EXPORT Standard_Boolean IsCNu (const Standard_Integer N) const Standard_OVERRIDE; |
42cf5bc1 |
208 | |
209 | |
210 | //! Returns the order of continuity of the surface in the |
211 | //! V parametric direction. |
212 | //! Raised if N < 0. |
79104795 |
213 | Standard_EXPORT Standard_Boolean IsCNv (const Standard_Integer N) const Standard_OVERRIDE; |
42cf5bc1 |
214 | |
215 | |
216 | //! Computes the point of parameter U,V on the surface. |
217 | //! |
218 | //! Raised only for an "OffsetSurface" if it is not possible to |
219 | //! compute the current point. |
79104795 |
220 | Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE; |
42cf5bc1 |
221 | |
222 | |
223 | //! Computes the point P and the first derivatives in the |
224 | //! directions U and V at this point. |
225 | //! Raised if the continuity of the surface is not C1. |
79104795 |
226 | Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE; |
42cf5bc1 |
227 | |
228 | |
229 | //! Computes the point P, the first and the second derivatives in |
230 | //! the directions U and V at this point. |
231 | //! Raised if the continuity of the surface is not C2. |
79104795 |
232 | Standard_EXPORT void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const Standard_OVERRIDE; |
42cf5bc1 |
233 | |
234 | |
235 | //! Computes the point P, the first,the second and the third |
236 | //! derivatives in the directions U and V at this point. |
237 | //! Raised if the continuity of the surface is not C2. |
79104795 |
238 | Standard_EXPORT void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const Standard_OVERRIDE; |
42cf5bc1 |
239 | |
240 | //! ---Purpose ; |
241 | //! Computes the derivative of order Nu in the direction U and Nv |
242 | //! in the direction V at the point P(U, V). |
243 | //! |
244 | //! Raised if the continuity of the surface is not CNu in the U |
245 | //! direction or not CNv in the V direction. |
246 | //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0. |
79104795 |
247 | Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const Standard_OVERRIDE; |
42cf5bc1 |
248 | |
79104795 |
249 | Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE; |
42cf5bc1 |
250 | |
251 | |
252 | //! Transformation of a geometric object. This tansformation |
253 | //! can be a translation, a rotation, a symmetry, a scaling |
254 | //! or a complex transformation obtained by combination of |
255 | //! the previous elementaries transformations. |
256 | //! (see class Transformation of the package Geom). |
79104795 |
257 | Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE; |
42cf5bc1 |
258 | |
259 | Standard_EXPORT Handle(Geom_Surface) CallSurfinit() const; |
260 | |
261 | Standard_EXPORT void SetBounds (const Standard_Real Umin, const Standard_Real Umax, const Standard_Real Vmin, const Standard_Real Vmax); |
262 | |
263 | Standard_EXPORT void RealBounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const; |
264 | |
265 | Standard_EXPORT void Constraints (TColgp_SequenceOfXY& Seq) const; |
266 | |
267 | |
268 | |
269 | |
92efcf78 |
270 | DEFINE_STANDARD_RTTIEXT(GeomPlate_Surface,Geom_Surface) |
42cf5bc1 |
271 | |
272 | protected: |
273 | |
274 | |
275 | |
276 | |
277 | private: |
278 | |
279 | |
280 | Plate_Plate mySurfinter; |
281 | Handle(Geom_Surface) mySurfinit; |
282 | Standard_Real myUmin; |
283 | Standard_Real myUmax; |
284 | Standard_Real myVmin; |
285 | Standard_Real myVmax; |
286 | |
287 | |
288 | }; |
289 | |
290 | |
291 | |
292 | |
293 | |
294 | |
295 | |
296 | #endif // _GeomPlate_Surface_HeaderFile |