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_ElementarySurface_HeaderFile |
18 | #define _Geom_ElementarySurface_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <gp_Ax3.hxx> |
24 | #include <Geom_Surface.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <GeomAbs_Shape.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <Standard_Integer.hxx> |
29 | class Standard_ConstructionError; |
30 | class gp_Ax1; |
31 | class gp_Pnt; |
32 | class gp_Ax3; |
33 | |
34 | |
35 | class Geom_ElementarySurface; |
36 | DEFINE_STANDARD_HANDLE(Geom_ElementarySurface, Geom_Surface) |
37 | |
38 | //! Describes the common behavior of surfaces which |
39 | //! have a simple parametric equation in a local |
40 | //! coordinate system. The Geom package provides |
41 | //! several implementations of concrete elementary surfaces: |
42 | //! - the plane, and |
43 | //! - four simple surfaces of revolution: the cylinder, the |
44 | //! cone, the sphere and the torus. |
45 | //! An elementary surface inherits the common behavior |
46 | //! of Geom_Surface surfaces. Furthermore, it is located |
47 | //! in 3D space by a coordinate system (a gp_Ax3 |
48 | //! object) which is also its local coordinate system. |
49 | //! Any elementary surface is oriented, i.e. the normal |
50 | //! vector is always defined, and gives the same |
51 | //! orientation to the surface, at any point on the surface. |
52 | //! In topology this property is referred to as the "outside |
53 | //! region of the surface". This orientation is related to |
54 | //! the two parametric directions of the surface. |
55 | //! Rotation of a surface around the "main Axis" of its |
56 | //! coordinate system, in the trigonometric sense given |
57 | //! by the "X Direction" and the "Y Direction" of the |
58 | //! coordinate system, defines the u parametric direction |
59 | //! of that elementary surface of revolution. This is the |
60 | //! default construction mode. |
61 | //! It is also possible, however, to change the orientation |
62 | //! of a surface by reversing one of the two parametric |
63 | //! directions: use the UReverse or VReverse functions |
64 | //! to change the orientation of the normal at any point on the surface. |
65 | //! Warning |
66 | //! The local coordinate system of an elementary surface |
67 | //! is not necessarily direct: |
68 | //! - if it is direct, the trigonometric sense defined by its |
69 | //! "main Direction" is the same as the trigonometric |
70 | //! sense defined by its two vectors "X Direction" and "Y Direction": |
71 | //! "main Direction" = "X Direction" ^ "Y Direction" |
72 | //! - if it is indirect, the two definitions of trigonometric |
73 | //! sense are opposite: |
74 | //! "main Direction" = - "X Direction" ^ "Y Direction" |
75 | class Geom_ElementarySurface : public Geom_Surface |
76 | { |
77 | |
78 | public: |
79 | |
80 | |
81 | |
82 | //! Changes the main axis (ZAxis) of the elementary surface. |
83 | //! |
84 | //! Raised if the direction of A1 is parallel to the XAxis of the |
85 | //! coordinate system of the surface. |
86 | Standard_EXPORT void SetAxis (const gp_Ax1& A1); |
87 | |
88 | |
89 | //! Changes the location of the local coordinates system of the |
90 | //! surface. |
91 | Standard_EXPORT void SetLocation (const gp_Pnt& Loc); |
92 | |
93 | |
94 | //! Changes the local coordinates system of the surface. |
95 | Standard_EXPORT void SetPosition (const gp_Ax3& A3); |
96 | |
97 | |
98 | //! Returns the main axis of the surface (ZAxis). |
99 | Standard_EXPORT gp_Ax1 Axis() const; |
100 | |
101 | |
102 | //! Returns the location point of the local coordinate system of the |
103 | //! surface. |
104 | Standard_EXPORT gp_Pnt Location() const; |
105 | |
106 | //! Returns the local coordinates system of the surface. |
107 | Standard_EXPORT const gp_Ax3& Position() const; |
108 | |
109 | |
110 | //! Reverses the U parametric direction of the surface. |
79104795 |
111 | Standard_EXPORT virtual void UReverse() Standard_OVERRIDE; |
42cf5bc1 |
112 | |
113 | //! Return the parameter on the Ureversed surface for |
114 | //! the point of parameter U on <me>. |
115 | //! |
116 | //! me->UReversed()->Value(me->UReversedParameter(U),V) |
117 | //! is the same point as |
118 | //! me->Value(U,V) |
79104795 |
119 | Standard_EXPORT virtual Standard_Real UReversedParameter (const Standard_Real U) const Standard_OVERRIDE = 0; |
42cf5bc1 |
120 | |
121 | |
122 | //! Reverses the V parametric direction of the surface. |
79104795 |
123 | Standard_EXPORT virtual void VReverse() Standard_OVERRIDE; |
42cf5bc1 |
124 | |
125 | //! Return the parameter on the Vreversed surface for |
126 | //! the point of parameter V on <me>. |
127 | //! |
128 | //! me->VReversed()->Value(U,me->VReversedParameter(V)) |
129 | //! is the same point as |
130 | //! me->Value(U,V) |
79104795 |
131 | Standard_EXPORT virtual Standard_Real VReversedParameter (const Standard_Real V) const Standard_OVERRIDE = 0; |
42cf5bc1 |
132 | |
133 | //! Returns GeomAbs_CN, the global continuity of any elementary surface. |
79104795 |
134 | Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE; |
42cf5bc1 |
135 | |
136 | //! Returns True. |
79104795 |
137 | Standard_EXPORT Standard_Boolean IsCNu (const Standard_Integer N) const Standard_OVERRIDE; |
42cf5bc1 |
138 | |
139 | //! Returns True. |
79104795 |
140 | Standard_EXPORT Standard_Boolean IsCNv (const Standard_Integer N) const Standard_OVERRIDE; |
42cf5bc1 |
141 | |
142 | |
143 | |
144 | |
92efcf78 |
145 | DEFINE_STANDARD_RTTIEXT(Geom_ElementarySurface,Geom_Surface) |
42cf5bc1 |
146 | |
147 | protected: |
148 | |
149 | |
150 | gp_Ax3 pos; |
151 | |
152 | |
153 | private: |
154 | |
155 | |
156 | |
157 | |
158 | }; |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | |
165 | |
166 | #endif // _Geom_ElementarySurface_HeaderFile |