1 // Created on: 1993-03-10
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Geom_CylindricalSurface_HeaderFile
18 #define _Geom_CylindricalSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Real.hxx>
24 #include <Geom_ElementarySurface.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 class Standard_ConstructionError;
28 class Standard_RangeError;
39 class Geom_CylindricalSurface;
40 DEFINE_STANDARD_HANDLE(Geom_CylindricalSurface, Geom_ElementarySurface)
42 //! This class defines the infinite cylindrical surface.
44 //! Every cylindrical surface is set by the following equation:
45 //! S(U,V) = Location + R*cos(U)*XAxis + R*sin(U)*YAxis + V*ZAxis,
46 //! where R is cylinder radius.
48 //! The local coordinate system of the CylindricalSurface is defined
49 //! with an axis placement (see class ElementarySurface).
51 //! The "ZAxis" is the symmetry axis of the CylindricalSurface,
52 //! it gives the direction of increasing parametric value V.
54 //! The parametrization range is :
55 //! U [0, 2*PI], V ]- infinite, + infinite[
57 //! The "XAxis" and the "YAxis" define the placement plane of the
58 //! surface (Z = 0, and parametric value V = 0) perpendicular to
59 //! the symmetry axis. The "XAxis" defines the origin of the
60 //! parameter U = 0. The trigonometric sense gives the positive
61 //! orientation for the parameter U.
63 //! When you create a CylindricalSurface the U and V directions of
64 //! parametrization are such that at each point of the surface the
65 //! normal is oriented towards the "outside region".
67 //! The methods UReverse VReverse change the orientation of the
69 class Geom_CylindricalSurface : public Geom_ElementarySurface
76 //! A3 defines the local coordinate system of the cylindrical surface.
77 //! The "ZDirection" of A3 defines the direction of the surface's
79 //! At the creation the parametrization of the surface is defined
80 //! such that the normal Vector (N = D1U ^ D1V) is oriented towards
81 //! the "outside region" of the surface.
83 //! It is not forbidden to create a cylindrical surface with
85 //! Raised if Radius < 0.0
86 Standard_EXPORT Geom_CylindricalSurface(const gp_Ax3& A3, const Standard_Real Radius);
89 //! Creates a CylindricalSurface from a non transient Cylinder
91 Standard_EXPORT Geom_CylindricalSurface(const gp_Cylinder& C);
94 //! Set <me> so that <me> has the same geometric properties as C.
95 Standard_EXPORT void SetCylinder (const gp_Cylinder& C);
97 //! Changes the radius of the cylinder.
99 Standard_EXPORT void SetRadius (const Standard_Real R);
102 //! returns a non transient cylinder with the same geometric
103 //! properties as <me>.
104 Standard_EXPORT gp_Cylinder Cylinder() const;
106 //! Return the parameter on the Ureversed surface for
107 //! the point of parameter U on <me>.
109 Standard_EXPORT Standard_Real UReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
111 //! Return the parameter on the Vreversed surface for
112 //! the point of parameter V on <me>.
114 Standard_EXPORT Standard_Real VReversedParameter (const Standard_Real V) const Standard_OVERRIDE;
116 //! Computes the parameters on the transformed surface for
117 //! the transform of the point of parameters U,V on <me>.
118 //! me->Transformed(T)->Value(U',V')
119 //! is the same point as
120 //! me->Value(U,V).Transformed(T)
121 //! Where U',V' are the new values of U,V after calling
122 //! me->TranformParameters(U,V,T)
123 //! This methods multiplies V by T.ScaleFactor()
124 Standard_EXPORT virtual void TransformParameters (Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const Standard_OVERRIDE;
126 //! Returns a 2d transformation used to find the new
127 //! parameters of a point on the transformed surface.
128 //! me->Transformed(T)->Value(U',V')
129 //! is the same point as
130 //! me->Value(U,V).Transformed(T)
131 //! Where U',V' are obtained by transforming U,V with
132 //! th 2d transformation returned by
133 //! me->ParametricTransformation(T)
134 //! This methods returns a scale centered on the
135 //! U axis with T.ScaleFactor
136 Standard_EXPORT virtual gp_GTrsf2d ParametricTransformation (const gp_Trsf& T) const Standard_OVERRIDE;
139 //! The CylindricalSurface is infinite in the V direction so
140 //! V1 = Realfirst, V2 = RealLast from package Standard.
141 //! U1 = 0 and U2 = 2*PI.
142 Standard_EXPORT void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const Standard_OVERRIDE;
145 //! Returns the coefficients of the implicit equation of the quadric
146 //! in the absolute cartesian coordinate system :
147 //! These coefficients are normalized.
148 //! A1.X**2 + A2.Y**2 + A3.Z**2 + 2.(B1.X.Y + B2.X.Z + B3.Y.Z) +
149 //! 2.(C1.X + C2.Y + C3.Z) + D = 0.0
150 Standard_EXPORT void Coefficients (Standard_Real& A1, Standard_Real& A2, Standard_Real& A3, Standard_Real& B1, Standard_Real& B2, Standard_Real& B3, Standard_Real& C1, Standard_Real& C2, Standard_Real& C3, Standard_Real& D) const;
152 //! Returns the radius of this cylinder.
153 Standard_EXPORT Standard_Real Radius() const;
156 Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE;
159 Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
162 Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
165 Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
168 //! The UIso curve is a Line. The location point of this line is
169 //! on the placement plane (XAxis, YAxis) of the surface.
170 //! This line is parallel to the axis of symmetry of the surface.
171 Standard_EXPORT Handle(Geom_Curve) UIso (const Standard_Real U) const Standard_OVERRIDE;
174 //! The VIso curve is a circle. The start point of this circle
175 //! (U = 0) is defined with the "XAxis" of the surface.
176 //! The center of the circle is on the symmetry axis.
177 Standard_EXPORT Handle(Geom_Curve) VIso (const Standard_Real V) const Standard_OVERRIDE;
180 //! Computes the point P (U, V) on the surface.
181 //! P (U, V) = Loc + Radius * (cos (U) * XDir + sin (U) * YDir) +
183 //! where Loc is the origin of the placement plane (XAxis, YAxis)
184 //! XDir is the direction of the XAxis and YDir the direction of
186 Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
189 //! Computes the current point and the first derivatives in the
190 //! directions U and V.
191 Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
194 //! Computes the current point, the first and the second derivatives
195 //! in the directions U and V.
196 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;
199 //! Computes the current point, the first, the second and the
200 //! third derivatives in the directions U and V.
201 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;
204 //! Computes the derivative of order Nu in the direction u and Nv
205 //! in the direction v.
206 //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
207 Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const Standard_OVERRIDE;
209 //! Applies the transformation T to this cylinder.
210 Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
212 //! Creates a new object which is a copy of this cylinder.
213 Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE;
218 DEFINE_STANDARD_RTTIEXT(Geom_CylindricalSurface,Geom_ElementarySurface)
228 Standard_Real radius;
239 #endif // _Geom_CylindricalSurface_HeaderFile