Salome HOME
RNC: EDF 1618 Modified sketcher to allow creation of arcs of circle with the destinat...
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_ShapeInfo.hxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _GEOMAlgo_ShapeInfo_HeaderFile
21 #define _GEOMAlgo_ShapeInfo_HeaderFile
22
23 #ifndef _TopAbs_ShapeEnum_HeaderFile
24 #include <TopAbs_ShapeEnum.hxx>
25 #endif
26 #ifndef _Standard_Integer_HeaderFile
27 #include <Standard_Integer.hxx>
28 #endif
29 #ifndef _GEOMAlgo_KindOfShape_HeaderFile
30 #include <GEOMAlgo_KindOfShape.hxx>
31 #endif
32 #ifndef _GEOMAlgo_KindOfName_HeaderFile
33 #include <GEOMAlgo_KindOfName.hxx>
34 #endif
35 #ifndef _GEOMAlgo_KindOfBounds_HeaderFile
36 #include <GEOMAlgo_KindOfBounds.hxx>
37 #endif
38 #ifndef _GEOMAlgo_KindOfClosed_HeaderFile
39 #include <GEOMAlgo_KindOfClosed.hxx>
40 #endif
41 #ifndef _gp_Pnt_HeaderFile
42 #include <gp_Pnt.hxx>
43 #endif
44 #ifndef _gp_Dir_HeaderFile
45 #include <gp_Dir.hxx>
46 #endif
47 #ifndef _gp_Ax3_HeaderFile
48 #include <gp_Ax3.hxx>
49 #endif
50 #ifndef _Standard_Real_HeaderFile
51 #include <Standard_Real.hxx>
52 #endif
53 class gp_Pnt;
54 class gp_Dir;
55 class gp_Ax2;
56 class gp_Ax3;
57
58
59 #ifndef _Standard_HeaderFile
60 #include <Standard.hxx>
61 #endif
62 #ifndef _Standard_Macro_HeaderFile
63 #include <Standard_Macro.hxx>
64 #endif
65
66
67 class GEOMAlgo_ShapeInfo  {
68
69 public:
70
71     void* operator new(size_t,void* anAddress) 
72       {
73         return anAddress;
74       }
75     void* operator new(size_t size) 
76       { 
77         return Standard::Allocate(size); 
78       }
79     void  operator delete(void *anAddress) 
80       { 
81         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
82       }
83  // Methods PUBLIC
84  // 
85
86
87 Standard_EXPORT GEOMAlgo_ShapeInfo();
88 Standard_EXPORT virtual ~GEOMAlgo_ShapeInfo();
89
90
91 Standard_EXPORT   void Reset() ;
92
93
94 Standard_EXPORT   void SetType(const TopAbs_ShapeEnum aType) ;
95
96
97 Standard_EXPORT   TopAbs_ShapeEnum Type() const;
98
99
100 Standard_EXPORT   void SetNbSubShapes(const TopAbs_ShapeEnum aType,const Standard_Integer aNb) ;
101
102
103 Standard_EXPORT   Standard_Integer NbSubShapes(const TopAbs_ShapeEnum aType) const;
104
105
106 Standard_EXPORT   void SetKindOfShape(const GEOMAlgo_KindOfShape aT) ;
107
108
109 Standard_EXPORT   GEOMAlgo_KindOfShape KindOfShape() const;
110
111
112 Standard_EXPORT   void SetKindOfName(const GEOMAlgo_KindOfName aT) ;
113
114
115 Standard_EXPORT   GEOMAlgo_KindOfName KindOfName() const;
116
117
118 Standard_EXPORT   void SetKindOfBounds(const GEOMAlgo_KindOfBounds aT) ;
119
120
121 Standard_EXPORT   GEOMAlgo_KindOfBounds KindOfBounds() const;
122
123
124 Standard_EXPORT   void SetKindOfClosed(const GEOMAlgo_KindOfClosed aT) ;
125
126
127 Standard_EXPORT   GEOMAlgo_KindOfClosed KindOfClosed() const;
128
129
130 Standard_EXPORT   void SetLocation(const gp_Pnt& aP) ;
131
132
133 Standard_EXPORT  const gp_Pnt& Location() const;
134
135
136 Standard_EXPORT   void SetDirection(const gp_Dir& aD) ;
137
138
139 Standard_EXPORT  const gp_Dir& Direction() const;
140
141
142 Standard_EXPORT   void SetPosition(const gp_Ax2& aAx2) ;
143
144
145 Standard_EXPORT   void SetPosition(const gp_Ax3& aAx3) ;
146
147
148 Standard_EXPORT  const gp_Ax3& Position() const;
149
150
151 Standard_EXPORT   void SetPnt1(const gp_Pnt& aP) ;
152
153
154 Standard_EXPORT  const gp_Pnt& Pnt1() const;
155
156
157 Standard_EXPORT   void SetPnt2(const gp_Pnt& aP) ;
158
159
160 Standard_EXPORT  const gp_Pnt& Pnt2() const;
161
162
163 Standard_EXPORT   void SetRadius1(const Standard_Real aR) ;
164
165
166 Standard_EXPORT   Standard_Real Radius1() const;
167
168
169 Standard_EXPORT   void SetRadius2(const Standard_Real aR) ;
170
171
172 Standard_EXPORT   Standard_Real Radius2() const;
173
174
175 Standard_EXPORT   void SetLength(const Standard_Real aL) ;
176
177
178 Standard_EXPORT   Standard_Real Length() const;
179
180
181 Standard_EXPORT   void SetWidth(const Standard_Real aW) ;
182
183
184 Standard_EXPORT   Standard_Real Width() const;
185
186
187 Standard_EXPORT   void SetHeight(const Standard_Real aH) ;
188
189
190 Standard_EXPORT   Standard_Real Height() const;
191
192
193 Standard_EXPORT   void Dump() const;
194
195
196
197
198
199 protected:
200
201  // Methods PROTECTED
202  // 
203
204
205 Standard_EXPORT   void DumpVertex() const;
206
207
208 Standard_EXPORT   void DumpEdge() const;
209
210
211 Standard_EXPORT   void DumpWire() const;
212
213
214 Standard_EXPORT   void DumpFace() const;
215
216
217 Standard_EXPORT   void DumpShell() const;
218
219
220 Standard_EXPORT   void DumpSolid() const;
221
222
223 Standard_EXPORT   void DumpCompSolid() const;
224
225
226 Standard_EXPORT   void DumpCompound() const;
227
228
229  // Fields PROTECTED
230  //
231 TopAbs_ShapeEnum myType;
232 Standard_Integer myNbSubShapes[9];
233 GEOMAlgo_KindOfShape myKindOfShape;
234 GEOMAlgo_KindOfName myKindOfName;
235 GEOMAlgo_KindOfBounds myKindOfBounds;
236 GEOMAlgo_KindOfClosed myKindOfClosed;
237 gp_Pnt myLocation;
238 gp_Dir myDirection;
239 gp_Ax3 myPosition;
240 Standard_Real myRadius1;
241 Standard_Real myRadius2;
242 Standard_Real myLength;
243 Standard_Real myWidth;
244 Standard_Real myHeight;
245 gp_Pnt myPnt1;
246 gp_Pnt myPnt2;
247 Standard_Integer myNbTypes;
248
249
250 private: 
251
252  // Methods PRIVATE
253  // 
254
255
256  // Fields PRIVATE
257  //
258
259
260 };
261
262
263
264
265
266 // other Inline functions and methods (like "C++: function call" methods)
267 //
268
269
270 #endif