0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / src / Geom / Geom_Surface.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-03-10
2// Created by: JCV
3// Copyright (c) 1993-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 _Geom_Surface_HeaderFile
18#define _Geom_Surface_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
5b111128 23#include <Geom_Curve.hxx>
42cf5bc1 24#include <Standard_Real.hxx>
25#include <Standard_Boolean.hxx>
26#include <GeomAbs_Shape.hxx>
27#include <Standard_Integer.hxx>
28class Standard_RangeError;
29class Standard_NoSuchObject;
30class Geom_UndefinedDerivative;
31class Geom_UndefinedValue;
32class gp_Trsf;
33class gp_GTrsf2d;
42cf5bc1 34class gp_Pnt;
35class gp_Vec;
36
37
38class Geom_Surface;
39DEFINE_STANDARD_HANDLE(Geom_Surface, Geom_Geometry)
40
41//! Describes the common behavior of surfaces in 3D
42//! space. The Geom package provides many
43//! implementations of concrete derived surfaces, such as
44//! planes, cylinders, cones, spheres and tori, surfaces of
45//! linear extrusion, surfaces of revolution, Bezier and
46//! BSpline surfaces, and so on.
47//! The key characteristic of these surfaces is that they
48//! are parameterized. Geom_Surface demonstrates:
49//! - how to work with the parametric equation of a
50//! surface to compute the point of parameters (u,
51//! v), and, at this point, the 1st, 2nd ... Nth derivative,
52//! - how to find global information about a surface in
53//! each parametric direction (for example, level of
54//! continuity, whether the surface is closed, its
55//! periodicity, the bounds of the parameters and so on), and
56//! - how the parameters change when geometric
57//! transformations are applied to the surface, or the
58//! orientation is modified.
59//! Note that all surfaces must have a geometric
60//! continuity, and any surface is at least "C0". Generally,
61//! continuity is checked at construction time or when the
62//! curve is edited. Where this is not the case, the
63//! documentation makes this explicit.
64//! Warning
65//! The Geom package does not prevent the construction of
66//! surfaces with null areas, or surfaces which self-intersect.
67class Geom_Surface : public Geom_Geometry
68{
69
70public:
71
72
73
74 //! Reverses the U direction of parametrization of <me>.
75 //! The bounds of the surface are not modified.
76 Standard_EXPORT virtual void UReverse() = 0;
77
78
79 //! Reverses the U direction of parametrization of <me>.
80 //! The bounds of the surface are not modified.
81 //! A copy of <me> is returned.
82 Standard_EXPORT Handle(Geom_Surface) UReversed() const;
83
84 //! Returns the parameter on the Ureversed surface for
85 //! the point of parameter U on <me>.
86 //!
87 //! me->UReversed()->Value(me->UReversedParameter(U),V)
88 //!
89 //! is the same point as
90 //!
91 //! me->Value(U,V)
92 Standard_EXPORT virtual Standard_Real UReversedParameter (const Standard_Real U) const = 0;
93
94
95 //! Reverses the V direction of parametrization of <me>.
96 //! The bounds of the surface are not modified.
97 Standard_EXPORT virtual void VReverse() = 0;
98
99
100 //! Reverses the V direction of parametrization of <me>.
101 //! The bounds of the surface are not modified.
102 //! A copy of <me> is returned.
103 Standard_EXPORT Handle(Geom_Surface) VReversed() const;
104
105 //! Returns the parameter on the Vreversed surface for
106 //! the point of parameter V on <me>.
107 //!
108 //! me->VReversed()->Value(U,me->VReversedParameter(V))
109 //!
110 //! is the same point as
111 //!
112 //! me->Value(U,V)
113 Standard_EXPORT virtual Standard_Real VReversedParameter (const Standard_Real V) const = 0;
114
115 //! Computes the parameters on the transformed surface for
116 //! the transform of the point of parameters U,V on <me>.
117 //!
118 //! me->Transformed(T)->Value(U',V')
119 //!
120 //! is the same point as
121 //!
122 //! me->Value(U,V).Transformed(T)
123 //!
124 //! Where U',V' are the new values of U,V after calling
125 //!
126 //! me->TranformParameters(U,V,T)
127 //!
128 //! This methods does not change <U> and <V>
129 //!
130 //! It can be redefined. For example on the Plane,
131 //! Cylinder, Cone, Revolved and Extruded surfaces.
132 Standard_EXPORT virtual void TransformParameters (Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const;
133
134 //! Returns a 2d transformation used to find the new
135 //! parameters of a point on the transformed surface.
136 //!
137 //! me->Transformed(T)->Value(U',V')
138 //!
139 //! is the same point as
140 //!
141 //! me->Value(U,V).Transformed(T)
142 //!
143 //! Where U',V' are obtained by transforming U,V with
144 //! th 2d transformation returned by
145 //!
146 //! me->ParametricTransformation(T)
147 //!
148 //! This methods returns an identity transformation
149 //!
150 //! It can be redefined. For example on the Plane,
151 //! Cylinder, Cone, Revolved and Extruded surfaces.
152 Standard_EXPORT virtual gp_GTrsf2d ParametricTransformation (const gp_Trsf& T) const;
153
154 //! Returns the parametric bounds U1, U2, V1 and V2 of this surface.
155 //! If the surface is infinite, this function can return a value
156 //! equal to Precision::Infinite: instead of Standard_Real::LastReal.
157 Standard_EXPORT virtual void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const = 0;
158
159 //! Checks whether this surface is closed in the u
160 //! parametric direction.
161 //! Returns true if, in the u parametric direction: taking
162 //! uFirst and uLast as the parametric bounds in
163 //! the u parametric direction, for each parameter v, the
164 //! distance between the points P(uFirst, v) and
165 //! P(uLast, v) is less than or equal to gp::Resolution().
166 Standard_EXPORT virtual Standard_Boolean IsUClosed() const = 0;
167
168 //! Checks whether this surface is closed in the u
169 //! parametric direction.
170 //! Returns true if, in the v parametric
171 //! direction: taking vFirst and vLast as the
172 //! parametric bounds in the v parametric direction, for
173 //! each parameter u, the distance between the points
174 //! P(u, vFirst) and P(u, vLast) is less than
175 //! or equal to gp::Resolution().
176 Standard_EXPORT virtual Standard_Boolean IsVClosed() const = 0;
177
178 //! Checks if this surface is periodic in the u
179 //! parametric direction. Returns true if:
180 //! - this surface is closed in the u parametric direction, and
181 //! - there is a constant T such that the distance
182 //! between the points P (u, v) and P (u + T,
183 //! v) (or the points P (u, v) and P (u, v +
184 //! T)) is less than or equal to gp::Resolution().
185 //! Note: T is the parametric period in the u parametric direction.
186 Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const = 0;
187
188 //! Returns the period of this surface in the u
189 //! parametric direction.
190 //! raises if the surface is not uperiodic.
191 Standard_EXPORT virtual Standard_Real UPeriod() const;
192
193 //! Checks if this surface is periodic in the v
194 //! parametric direction. Returns true if:
195 //! - this surface is closed in the v parametric direction, and
196 //! - there is a constant T such that the distance
197 //! between the points P (u, v) and P (u + T,
198 //! v) (or the points P (u, v) and P (u, v +
199 //! T)) is less than or equal to gp::Resolution().
200 //! Note: T is the parametric period in the v parametric direction.
201 Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const = 0;
202
203 //! Returns the period of this surface in the v parametric direction.
204 //! raises if the surface is not vperiodic.
205 Standard_EXPORT virtual Standard_Real VPeriod() const;
206
207 //! Computes the U isoparametric curve.
208 Standard_EXPORT virtual Handle(Geom_Curve) UIso (const Standard_Real U) const = 0;
209
210 //! Computes the V isoparametric curve.
211 Standard_EXPORT virtual Handle(Geom_Curve) VIso (const Standard_Real V) const = 0;
212
213
214 //! Returns the Global Continuity of the surface in direction U and V :
215 //! C0 : only geometric continuity,
216 //! C1 : continuity of the first derivative all along the surface,
217 //! C2 : continuity of the second derivative all along the surface,
218 //! C3 : continuity of the third derivative all along the surface,
219 //! G1 : tangency continuity all along the surface,
220 //! G2 : curvature continuity all along the surface,
221 //! CN : the order of continuity is infinite.
222 //! Example :
223 //! If the surface is C1 in the V parametric direction and C2
224 //! in the U parametric direction Shape = C1.
225 Standard_EXPORT virtual GeomAbs_Shape Continuity() const = 0;
226
227 //! Returns the order of continuity of the surface in the
228 //! U parametric direction.
229 //! Raised if N < 0.
230 Standard_EXPORT virtual Standard_Boolean IsCNu (const Standard_Integer N) const = 0;
231
232 //! Returns the order of continuity of the surface in the
233 //! V parametric direction.
234 //! Raised if N < 0.
235 Standard_EXPORT virtual Standard_Boolean IsCNv (const Standard_Integer N) const = 0;
236
237 //! Computes the point of parameter U,V on the surface.
238 //!
239 //! Raised only for an "OffsetSurface" if it is not possible to
240 //! compute the current point.
241 Standard_EXPORT virtual void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const = 0;
242
243
244 //! Computes the point P and the first derivatives in the
245 //! directions U and V at this point.
246 //! Raised if the continuity of the surface is not C1.
247 Standard_EXPORT virtual void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const = 0;
248
249
250 //! Computes the point P, the first and the second derivatives in
251 //! the directions U and V at this point.
252 //! Raised if the continuity of the surface is not C2.
253 Standard_EXPORT virtual 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 = 0;
254
255
256 //! Computes the point P, the first,the second and the third
257 //! derivatives in the directions U and V at this point.
258 //! Raised if the continuity of the surface is not C2.
259 Standard_EXPORT virtual 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 = 0;
260
261 //! ---Purpose ;
262 //! Computes the derivative of order Nu in the direction U and Nv
263 //! in the direction V at the point P(U, V).
264 //!
265 //! Raised if the continuity of the surface is not CNu in the U
266 //! direction or not CNv in the V direction.
267 //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
268 Standard_EXPORT virtual gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const = 0;
269
270
271 //! Computes the point of parameter U on the surface.
272 //!
273 //! It is implemented with D0
274 //!
275 //! Raised only for an "OffsetSurface" if it is not possible to
276 //! compute the current point.
277 Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;
278
279
280
281
92efcf78 282 DEFINE_STANDARD_RTTIEXT(Geom_Surface,Geom_Geometry)
42cf5bc1 283
284protected:
285
286
287
288
289private:
290
291
292
293
294};
295
296
297
298
299
300
301
302#endif // _Geom_Surface_HeaderFile