Salome HOME
7df117c33a0cf95055e099ae18427c9cd69df65b
[modules/geom.git] / src / GEOMImpl / GEOMImpl_Gen.cxx
1 // Copyright (C) 2007-2022  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_PatchFaceDriver.hxx>
69 #include <GEOMImpl_TranslateDriver.hxx>
70 #include <GEOMImpl_RotateDriver.hxx>
71 #include <GEOMImpl_MirrorDriver.hxx>
72 #include <GEOMImpl_ProjectionDriver.hxx>
73 #include <GEOMImpl_OffsetDriver.hxx>
74 #include <GEOMImpl_ScaleDriver.hxx>
75 #include <GEOMImpl_PositionDriver.hxx>
76 #include <GEOMImpl_PartitionDriver.hxx>
77 #include <GEOMImpl_CopyDriver.hxx>
78 #include <GEOMImpl_ExportDriver.hxx>
79 #include <GEOMImpl_ImportDriver.hxx>
80 #include <GEOMImpl_ArchimedeDriver.hxx>
81 #include <GEOMImpl_HealingDriver.hxx>
82 #include <GEOMImpl_FillingDriver.hxx>
83 #include <GEOMImpl_GlueDriver.hxx>
84 #include <GEOMImpl_MeasureDriver.hxx>
85 #include <GEOMImpl_FieldDriver.hxx>
86 #include <GEOMImpl_ConformityDriver.hxx>
87
88 //=============================================================================
89 /*!
90  *  default constructor:
91  */
92 //=============================================================================
93
94 GEOMImpl_Gen::GEOMImpl_Gen()
95 {
96    MESSAGE("GEOMImpl_Gen::GEOMImpl_Gen");
97
98    // Basic elements
99    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PointDriver::GetID(), new GEOMImpl_PointDriver());
100    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_VectorDriver::GetID(), new GEOMImpl_VectorDriver());
101    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_LineDriver::GetID(), new GEOMImpl_LineDriver());
102    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PlaneDriver::GetID(), new GEOMImpl_PlaneDriver());
103    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MarkerDriver::GetID(), new GEOMImpl_MarkerDriver());
104
105    // Curves
106    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArcDriver::GetID(), new GEOMImpl_ArcDriver());
107    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CircleDriver::GetID(), new GEOMImpl_CircleDriver());
108    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_EllipseDriver::GetID(), new GEOMImpl_EllipseDriver());
109    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PolylineDriver::GetID(), new GEOMImpl_PolylineDriver());
110    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SplineDriver::GetID(), new GEOMImpl_SplineDriver());
111    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SketcherDriver::GetID(), new GEOMImpl_SketcherDriver());
112    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_3DSketcherDriver::GetID(), new GEOMImpl_3DSketcherDriver());
113
114    // 3D Primitives
115    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BoxDriver::GetID(), new GEOMImpl_BoxDriver());
116    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FaceDriver::GetID(), new GEOMImpl_FaceDriver());
117    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_DiskDriver::GetID(), new GEOMImpl_DiskDriver());
118    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ConeDriver::GetID(), new GEOMImpl_ConeDriver());
119    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CylinderDriver::GetID(), new GEOMImpl_CylinderDriver());
120    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PrismDriver::GetID(), new GEOMImpl_PrismDriver());
121    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeDriver::GetID(), new GEOMImpl_PipeDriver());
122    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipePathDriver::GetID(), new GEOMImpl_PipePathDriver());
123    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ThruSectionsDriver::GetID(), new GEOMImpl_ThruSectionsDriver());
124    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RevolutionDriver::GetID(), new GEOMImpl_RevolutionDriver());
125    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SphereDriver::GetID(), new GEOMImpl_SphereDriver());
126    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TorusDriver::GetID(), new GEOMImpl_TorusDriver());
127    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FillingDriver::GetID(), new GEOMImpl_FillingDriver());
128
129    // Shapes Operations
130    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ShapeDriver::GetID(), new GEOMImpl_ShapeDriver());
131    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_GlueDriver::GetID(), new GEOMImpl_GlueDriver());
132
133    // Blocks Operations
134    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BlockDriver::GetID(), new GEOMImpl_BlockDriver());
135
136    // Boolean Operations, Partition
137    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BooleanDriver::GetID(), new GEOMImpl_BooleanDriver());
138    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PartitionDriver::GetID(), new GEOMImpl_PartitionDriver());
139
140    // Local Operations
141    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ChamferDriver::GetID(), new GEOMImpl_ChamferDriver());
142    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FilletDriver::GetID(), new GEOMImpl_FilletDriver());
143    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_Fillet1dDriver::GetID(), new GEOMImpl_Fillet1dDriver());
144    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_Fillet2dDriver::GetID(), new GEOMImpl_Fillet2dDriver());
145    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArchimedeDriver::GetID(), new GEOMImpl_ArchimedeDriver());
146
147    // Geometrical Transformations, Offset, Scale
148    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TranslateDriver::GetID(), new GEOMImpl_TranslateDriver());
149    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RotateDriver::GetID(), new GEOMImpl_RotateDriver());
150    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MirrorDriver::GetID(), new GEOMImpl_MirrorDriver());
151    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ProjectionDriver::GetID(), new GEOMImpl_ProjectionDriver());
152    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_OffsetDriver::GetID(), new GEOMImpl_OffsetDriver());
153    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ScaleDriver::GetID(), new GEOMImpl_ScaleDriver());
154    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PositionDriver::GetID(), new GEOMImpl_PositionDriver());
155
156    // Insert Operations (Copy, Import/Export)
157    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CopyDriver::GetID(), new GEOMImpl_CopyDriver());
158    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ImportDriver::GetID(), new GEOMImpl_ImportDriver());
159    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ExportDriver::GetID(), new GEOMImpl_ExportDriver());
160
161    // Shape Healing
162    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_HealingDriver::GetID(), new GEOMImpl_HealingDriver());
163
164    // Measurements
165    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MeasureDriver::GetID(), new GEOMImpl_MeasureDriver());
166    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PatchFaceDriver::GetID(), new GEOMImpl_PatchFaceDriver());
167    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ConformityDriver::GetID(), new GEOMImpl_ConformityDriver());
168
169    // Field
170    TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FieldDriver::GetID(), new GEOMImpl_FieldDriver());
171
172    /*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
173
174    SetEngine(this);
175
176    _BasicOperations = new GEOMImpl_IBasicOperations( this );
177    _TransformOperations = new GEOMImpl_ITransformOperations( this );
178    _3DPrimOperations = new GEOMImpl_I3DPrimOperations( this );
179    _ShapesOperations = new GEOMImpl_IShapesOperations( this );
180    _BlocksOperations = new GEOMImpl_IBlocksOperations( this );
181    _BooleanOperations = new GEOMImpl_IBooleanOperations( this );
182    _HealingOperations = new GEOMImpl_IHealingOperations( this );
183    _CurvesOperations = new GEOMImpl_ICurvesOperations( this );
184    _LocalOperations = new GEOMImpl_ILocalOperations( this );
185    _InsertOperations = new GEOMImpl_IInsertOperations( this );
186    _MeasureOperations = new GEOMImpl_IMeasureOperations( this );
187    _GroupOperations = new GEOMImpl_IGroupOperations( this );
188    _FieldOperations = new GEOMImpl_IFieldOperations( this );
189    _TestOperations = new GEOMImpl_ITestOperations( this );
190    _CanonicalRecognition = new GEOMImpl_ICanonicalRecognition( this );
191 }
192
193 //=============================================================================
194 /*!
195  *
196  */
197 //=============================================================================
198
199 GEOMImpl_Gen::~GEOMImpl_Gen()
200 {
201   MESSAGE("GEOMImpl_Gen::~GEOMImpl_Gen");
202
203   delete _BasicOperations;
204   delete _TransformOperations;
205   delete _3DPrimOperations;
206   delete _ShapesOperations;
207   delete _BlocksOperations;
208   delete _BooleanOperations;
209   delete _HealingOperations;
210   delete _CurvesOperations;
211   delete _LocalOperations;
212   delete _InsertOperations;
213   delete _MeasureOperations;
214   delete _GroupOperations;
215   delete _FieldOperations;
216   delete _CanonicalRecognition;
217 }
218
219 //=============================================================================
220 /*!
221  * GetIBasicOperations
222  */
223 //=============================================================================
224 GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations()
225 {
226   return _BasicOperations;
227 }
228
229 //=============================================================================
230 /*!
231  * GetITransformOperations
232  */
233 //=============================================================================
234 GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations()
235 {
236   return _TransformOperations;
237 }
238
239 //=============================================================================
240 /*!
241  * GetIBooleanOperations
242  */
243 //=============================================================================
244 GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations()
245 {
246   return _BooleanOperations;
247 }
248
249 //=============================================================================
250 /*!
251  * GetIHealingOperations
252  */
253 //=============================================================================
254 GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations()
255 {
256   return _HealingOperations;
257 }
258
259 //=============================================================================
260 /*!
261  * GetI3DPrimOperations
262  */
263 //=============================================================================
264 GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations()
265 {
266   return _3DPrimOperations;
267 }
268
269 //=============================================================================
270 /*!
271  * GetIShapesOperations
272  */
273 //=============================================================================
274 GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations()
275 {
276   return _ShapesOperations;
277 }
278
279 //=============================================================================
280 /*!
281  * GetIBlocksOperations
282  */
283 //=============================================================================
284 GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations()
285 {
286   return _BlocksOperations;
287 }
288
289 //=============================================================================
290 /*!
291  * GetICurvesOperations
292  */
293 //=============================================================================
294 GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations()
295 {
296   return _CurvesOperations;
297 }
298
299 //=============================================================================
300 /*!
301  * GetILocalOperations
302  */
303 //=============================================================================
304 GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations()
305 {
306   return _LocalOperations;
307 }
308
309 //=============================================================================
310 /*!
311  * GetIInsertOperations
312  */
313 //=============================================================================
314 GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations()
315 {
316   return _InsertOperations;
317 }
318
319 //=============================================================================
320 /*!
321  * GetIMeasureOperations
322  */
323 //=============================================================================
324 GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations()
325 {
326   return _MeasureOperations;
327 }
328
329 //=============================================================================
330 /*!
331  * GetIGroupOperations
332  */
333 //=============================================================================
334 GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations()
335 {
336   return _GroupOperations;
337 }
338
339 //=============================================================================
340 /*!
341  * GetIFieldOperations
342  */
343 //=============================================================================
344 GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations()
345 {
346   return _FieldOperations;
347 }
348
349 //=============================================================================
350 /*!
351  * GetITestOperations
352  */
353 //=============================================================================
354 GEOMImpl_ITestOperations* GEOMImpl_Gen::GetITestOperations()
355 {
356   return _TestOperations;
357 }
358
359 //=============================================================================
360 /*!
361  * GetICanonicalRecognition
362  */
363 //=============================================================================
364 GEOMImpl_ICanonicalRecognition* GEOMImpl_Gen::GetICanonicalRecognition()
365 {
366   return _CanonicalRecognition;
367 }