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_ElementarySurface_HeaderFile
18 #define _Geom_ElementarySurface_HeaderFile
21 #include <Geom_Surface.hxx>
23 class Geom_ElementarySurface;
24 DEFINE_STANDARD_HANDLE(Geom_ElementarySurface, Geom_Surface)
26 //! Describes the common behavior of surfaces which
27 //! have a simple parametric equation in a local
28 //! coordinate system. The Geom package provides
29 //! several implementations of concrete elementary surfaces:
31 //! - four simple surfaces of revolution: the cylinder, the
32 //! cone, the sphere and the torus.
33 //! An elementary surface inherits the common behavior
34 //! of Geom_Surface surfaces. Furthermore, it is located
35 //! in 3D space by a coordinate system (a gp_Ax3
36 //! object) which is also its local coordinate system.
37 //! Any elementary surface is oriented, i.e. the normal
38 //! vector is always defined, and gives the same
39 //! orientation to the surface, at any point on the surface.
40 //! In topology this property is referred to as the "outside
41 //! region of the surface". This orientation is related to
42 //! the two parametric directions of the surface.
43 //! Rotation of a surface around the "main Axis" of its
44 //! coordinate system, in the trigonometric sense given
45 //! by the "X Direction" and the "Y Direction" of the
46 //! coordinate system, defines the u parametric direction
47 //! of that elementary surface of revolution. This is the
48 //! default construction mode.
49 //! It is also possible, however, to change the orientation
50 //! of a surface by reversing one of the two parametric
51 //! directions: use the UReverse or VReverse functions
52 //! to change the orientation of the normal at any point on the surface.
54 //! The local coordinate system of an elementary surface
55 //! is not necessarily direct:
56 //! - if it is direct, the trigonometric sense defined by its
57 //! "main Direction" is the same as the trigonometric
58 //! sense defined by its two vectors "X Direction" and "Y Direction":
59 //! "main Direction" = "X Direction" ^ "Y Direction"
60 //! - if it is indirect, the two definitions of trigonometric
61 //! sense are opposite:
62 //! "main Direction" = - "X Direction" ^ "Y Direction"
63 class Geom_ElementarySurface : public Geom_Surface
67 //! Changes the main axis (ZAxis) of the elementary surface.
69 //! Raised if the direction of A1 is parallel to the XAxis of the
70 //! coordinate system of the surface.
71 void SetAxis (const gp_Ax1& theA1) { pos.SetAxis(theA1); }
73 //! Changes the location of the local coordinates system of the
75 void SetLocation (const gp_Pnt& theLoc) { pos.SetLocation(theLoc); }
77 //! Changes the local coordinates system of the surface.
78 void SetPosition (const gp_Ax3& theAx3) { pos = theAx3; }
80 //! Returns the main axis of the surface (ZAxis).
81 const gp_Ax1& Axis() const { return pos.Axis(); }
83 //! Returns the location point of the local coordinate system of the
85 const gp_Pnt& Location() const { return pos.Location(); }
87 //! Returns the local coordinates system of the surface.
88 const gp_Ax3& Position() const { return pos; }
90 //! Reverses the U parametric direction of the surface.
91 Standard_EXPORT virtual void UReverse() Standard_OVERRIDE;
93 //! Return the parameter on the Ureversed surface for
94 //! the point of parameter U on <me>.
96 //! me->UReversed()->Value(me->UReversedParameter(U),V)
97 //! is the same point as
99 Standard_EXPORT virtual Standard_Real UReversedParameter (const Standard_Real U) const Standard_OVERRIDE = 0;
101 //! Reverses the V parametric direction of the surface.
102 Standard_EXPORT virtual void VReverse() Standard_OVERRIDE;
104 //! Return the parameter on the Vreversed surface for
105 //! the point of parameter V on <me>.
107 //! me->VReversed()->Value(U,me->VReversedParameter(V))
108 //! is the same point as
110 Standard_EXPORT virtual Standard_Real VReversedParameter (const Standard_Real V) const Standard_OVERRIDE = 0;
112 //! Returns GeomAbs_CN, the global continuity of any elementary surface.
113 Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
116 Standard_EXPORT Standard_Boolean IsCNu (const Standard_Integer N) const Standard_OVERRIDE;
119 Standard_EXPORT Standard_Boolean IsCNv (const Standard_Integer N) const Standard_OVERRIDE;
121 DEFINE_STANDARD_RTTIEXT(Geom_ElementarySurface,Geom_Surface)
127 #endif // _Geom_ElementarySurface_HeaderFile