]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_Gen.cxx
Salome HOME
Remove unnecessary includes
[modules/geom.git] / src / GEOMImpl / GEOMImpl_Gen.cxx
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifdef WIN32
24 #pragma warning( disable:4786 )
25 #endif
26
27 #include <Standard_Stream.hxx>
28
29 #include <GEOMImpl_Gen.hxx>
30
31 #include "utilities.h"
32 #include <Utils_ExceptHandlers.hxx>
33
34 #include <TFunction_Driver.hxx>
35 #include <TFunction_DriverTable.hxx>
36
37 #include <GEOMImpl_PointDriver.hxx>
38 #include <GEOMImpl_VectorDriver.hxx>
39 #include <GEOMImpl_LineDriver.hxx>
40 #include <GEOMImpl_PlaneDriver.hxx>
41 #include <GEOMImpl_MarkerDriver.hxx>
42 #include <GEOMImpl_ArcDriver.hxx>
43 #include <GEOMImpl_CircleDriver.hxx>
44 #include <GEOMImpl_EllipseDriver.hxx>
45 #include <GEOMImpl_PolylineDriver.hxx>
46 #include <GEOMImpl_SplineDriver.hxx>
47 #include <GEOMImpl_SketcherDriver.hxx>
48 #include <GEOMImpl_3DSketcherDriver.hxx>
49 #include <GEOMImpl_BoxDriver.hxx>
50 #include <GEOMImpl_FaceDriver.hxx>
51 #include <GEOMImpl_DiskDriver.hxx>
52 #include <GEOMImpl_ConeDriver.hxx>
53 #include <GEOMImpl_CylinderDriver.hxx>
54 #include <GEOMImpl_PrismDriver.hxx>
55 #include <GEOMImpl_PipeDriver.hxx>
56 #include <GEOMImpl_PipePathDriver.hxx>
57 #include <GEOMImpl_ThruSectionsDriver.hxx>
58 #include <GEOMImpl_RevolutionDriver.hxx>
59 #include <GEOMImpl_ShapeDriver.hxx>
60 #include <GEOMImpl_BlockDriver.hxx>
61 #include <GEOMImpl_SphereDriver.hxx>
62 #include <GEOMImpl_TorusDriver.hxx>
63 #include <GEOMImpl_BooleanDriver.hxx>
64 #include <GEOMImpl_ChamferDriver.hxx>
65 #include <GEOMImpl_FilletDriver.hxx>
66 #include <GEOMImpl_Fillet1dDriver.hxx>
67 #include <GEOMImpl_Fillet2dDriver.hxx>
68 #include <GEOMImpl_TranslateDriver.hxx>
69 #include <GEOMImpl_RotateDriver.hxx>
70 #include <GEOMImpl_MirrorDriver.hxx>
71 #include <GEOMImpl_ProjectionDriver.hxx>
72 #include <GEOMImpl_OffsetDriver.hxx>
73 #include <GEOMImpl_ScaleDriver.hxx>
74 #include <GEOMImpl_PositionDriver.hxx>
75 #include <GEOMImpl_PartitionDriver.hxx>
76 #include <GEOMImpl_CopyDriver.hxx>
77 #include <GEOMImpl_ExportDriver.hxx>
78 #include <GEOMImpl_ImportDriver.hxx>
79 #include <GEOMImpl_ArchimedeDriver.hxx>
80 #include <GEOMImpl_HealingDriver.hxx>
81 #include <GEOMImpl_FillingDriver.hxx>
82 #include <GEOMImpl_GlueDriver.hxx>
83 #include <GEOMImpl_MeasureDriver.hxx>
84 #include <GEOMImpl_FieldDriver.hxx>
85
86 //=============================================================================
87 /*!
88  *  default constructor:
89  */
90 //=============================================================================
91
92 GEOMImpl_Gen::GEOMImpl_Gen()
93 {
94    MESSAGE("GEOMImpl_Gen::GEOMImpl_Gen");
95
96    // Basic elements
97    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PointDriver::GetID(), new GEOMImpl_PointDriver());
98    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_VectorDriver::GetID(), new GEOMImpl_VectorDriver());
99    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_LineDriver::GetID(), new GEOMImpl_LineDriver());
100    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PlaneDriver::GetID(), new GEOMImpl_PlaneDriver());
101    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MarkerDriver::GetID(), new GEOMImpl_MarkerDriver());
102
103    // Curves
104    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArcDriver::GetID(), new GEOMImpl_ArcDriver());
105    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CircleDriver::GetID(), new GEOMImpl_CircleDriver());
106    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_EllipseDriver::GetID(), new GEOMImpl_EllipseDriver());
107    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PolylineDriver::GetID(), new GEOMImpl_PolylineDriver());
108    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SplineDriver::GetID(), new GEOMImpl_SplineDriver());
109    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SketcherDriver::GetID(), new GEOMImpl_SketcherDriver());
110    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_3DSketcherDriver::GetID(), new GEOMImpl_3DSketcherDriver());
111
112    // 3D Primitives
113    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BoxDriver::GetID(), new GEOMImpl_BoxDriver());
114    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FaceDriver::GetID(), new GEOMImpl_FaceDriver());
115    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_DiskDriver::GetID(), new GEOMImpl_DiskDriver());
116    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ConeDriver::GetID(), new GEOMImpl_ConeDriver());
117    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CylinderDriver::GetID(), new GEOMImpl_CylinderDriver());
118    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PrismDriver::GetID(), new GEOMImpl_PrismDriver());
119    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeDriver::GetID(), new GEOMImpl_PipeDriver());
120    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipePathDriver::GetID(), new GEOMImpl_PipePathDriver());
121    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ThruSectionsDriver::GetID(), new GEOMImpl_ThruSectionsDriver());
122    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RevolutionDriver::GetID(), new GEOMImpl_RevolutionDriver());
123    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SphereDriver::GetID(), new GEOMImpl_SphereDriver());
124    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TorusDriver::GetID(), new GEOMImpl_TorusDriver());
125    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FillingDriver::GetID(), new GEOMImpl_FillingDriver());
126
127    // Shapes Operations
128    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ShapeDriver::GetID(), new GEOMImpl_ShapeDriver());
129    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_GlueDriver::GetID(), new GEOMImpl_GlueDriver());
130
131    // Blocks Operations
132    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BlockDriver::GetID(), new GEOMImpl_BlockDriver());
133
134    // Boolean Operations, Partition
135    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BooleanDriver::GetID(), new GEOMImpl_BooleanDriver());
136    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PartitionDriver::GetID(), new GEOMImpl_PartitionDriver());
137
138    // Local Operations
139    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ChamferDriver::GetID(), new GEOMImpl_ChamferDriver());
140    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FilletDriver::GetID(), new GEOMImpl_FilletDriver());
141    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_Fillet1dDriver::GetID(), new GEOMImpl_Fillet1dDriver());
142    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_Fillet2dDriver::GetID(), new GEOMImpl_Fillet2dDriver());
143    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArchimedeDriver::GetID(), new GEOMImpl_ArchimedeDriver());
144
145    // Geometrical Transformations, Offset, Scale
146    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TranslateDriver::GetID(), new GEOMImpl_TranslateDriver());
147    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RotateDriver::GetID(), new GEOMImpl_RotateDriver());
148    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MirrorDriver::GetID(), new GEOMImpl_MirrorDriver());
149    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ProjectionDriver::GetID(), new GEOMImpl_ProjectionDriver());
150    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_OffsetDriver::GetID(), new GEOMImpl_OffsetDriver());
151    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ScaleDriver::GetID(), new GEOMImpl_ScaleDriver());
152    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PositionDriver::GetID(), new GEOMImpl_PositionDriver());
153
154    // Insert Operations (Copy, Import/Export)
155    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CopyDriver::GetID(), new GEOMImpl_CopyDriver());
156    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ImportDriver::GetID(), new GEOMImpl_ImportDriver());
157    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ExportDriver::GetID(), new GEOMImpl_ExportDriver());
158
159    // Shape Healing
160    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_HealingDriver::GetID(), new GEOMImpl_HealingDriver());
161
162    // Measurements
163    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MeasureDriver::GetID(), new GEOMImpl_MeasureDriver());
164
165    // Field
166    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FieldDriver::GetID(), new GEOMImpl_FieldDriver());
167
168    /*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
169
170    SetEngine(this);
171
172    _BasicOperations = new GEOMImpl_IBasicOperations( this );
173    _TransformOperations = new GEOMImpl_ITransformOperations( this );
174    _3DPrimOperations = new GEOMImpl_I3DPrimOperations( this );
175    _ShapesOperations = new GEOMImpl_IShapesOperations( this );
176    _BlocksOperations = new GEOMImpl_IBlocksOperations( this );
177    _BooleanOperations = new GEOMImpl_IBooleanOperations( this );
178    _HealingOperations = new GEOMImpl_IHealingOperations( this );
179    _CurvesOperations = new GEOMImpl_ICurvesOperations( this );
180    _LocalOperations = new GEOMImpl_ILocalOperations( this );
181    _InsertOperations = new GEOMImpl_IInsertOperations( this );
182    _MeasureOperations = new GEOMImpl_IMeasureOperations( this );
183    _GroupOperations = new GEOMImpl_IGroupOperations( this );
184    _FieldOperations = new GEOMImpl_IFieldOperations( this );
185 }
186
187 //=============================================================================
188 /*!
189  *
190  */
191 //=============================================================================
192
193 GEOMImpl_Gen::~GEOMImpl_Gen()
194 {
195   MESSAGE("GEOMImpl_Gen::~GEOMImpl_Gen");
196
197   delete _BasicOperations;
198   delete _TransformOperations;
199   delete _3DPrimOperations;
200   delete _ShapesOperations;
201   delete _BlocksOperations;
202   delete _BooleanOperations;
203   delete _HealingOperations;
204   delete _CurvesOperations;
205   delete _LocalOperations;
206   delete _InsertOperations;
207   delete _MeasureOperations;
208   delete _GroupOperations;
209   delete _FieldOperations;
210 }
211
212 //=============================================================================
213 /*!
214  * GetIBasicOperations
215  */
216 //=============================================================================
217 GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations()
218 {
219   return _BasicOperations;
220 }
221
222 //=============================================================================
223 /*!
224  * GetITransformOperations
225  */
226 //=============================================================================
227 GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations()
228 {
229   return _TransformOperations;
230 }
231
232 //=============================================================================
233 /*!
234  * GetIBooleanOperations
235  */
236 //=============================================================================
237 GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations()
238 {
239   return _BooleanOperations;
240 }
241
242 //=============================================================================
243 /*!
244  * GetIHealingOperations
245  */
246 //=============================================================================
247 GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations()
248 {
249   return _HealingOperations;
250 }
251
252 //=============================================================================
253 /*!
254  * GetI3DPrimOperations
255  */
256 //=============================================================================
257 GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations()
258 {
259   return _3DPrimOperations;
260 }
261
262 //=============================================================================
263 /*!
264  * GetIShapesOperations
265  */
266 //=============================================================================
267 GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations()
268 {
269   return _ShapesOperations;
270 }
271
272 //=============================================================================
273 /*!
274  * GetIBlocksOperations
275  */
276 //=============================================================================
277 GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations()
278 {
279   return _BlocksOperations;
280 }
281
282 //=============================================================================
283 /*!
284  * GetICurvesOperations
285  */
286 //=============================================================================
287 GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations()
288 {
289   return _CurvesOperations;
290 }
291
292 //=============================================================================
293 /*!
294  * GetILocalOperations
295  */
296 //=============================================================================
297 GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations()
298 {
299   return _LocalOperations;
300 }
301
302 //=============================================================================
303 /*!
304  * GetIInsertOperations
305  */
306 //=============================================================================
307 GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations()
308 {
309   return _InsertOperations;
310 }
311
312 //=============================================================================
313 /*!
314  * GetIMeasureOperations
315  */
316 //=============================================================================
317 GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations()
318 {
319   return _MeasureOperations;
320 }
321
322 //=============================================================================
323 /*!
324  * GetIGroupOperations
325  */
326 //=============================================================================
327 GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations()
328 {
329   return _GroupOperations;
330 }
331
332 //=============================================================================
333 /*!
334  * GetIFieldOperations
335  */
336 //=============================================================================
337 GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations()
338 {
339   return _FieldOperations;
340 }