3 #include "GEOMImpl_Gen.hxx"
7 #include "Utils_ExceptHandlers.hxx"
9 #include <TFunction_Driver.hxx>
10 #include <TFunction_DriverTable.hxx>
12 #include "GEOMImpl_PointDriver.hxx"
13 #include "GEOMImpl_VectorDriver.hxx"
14 #include "GEOMImpl_LineDriver.hxx"
15 #include "GEOMImpl_PlaneDriver.hxx"
16 #include "GEOMImpl_MarkerDriver.hxx"
17 #include "GEOMImpl_ArcDriver.hxx"
18 #include "GEOMImpl_CircleDriver.hxx"
19 #include "GEOMImpl_EllipseDriver.hxx"
20 #include "GEOMImpl_PolylineDriver.hxx"
21 #include "GEOMImpl_SplineDriver.hxx"
22 #include "GEOMImpl_SketcherDriver.hxx"
23 #include "GEOMImpl_BoxDriver.hxx"
24 #include "GEOMImpl_ConeDriver.hxx"
25 #include "GEOMImpl_CylinderDriver.hxx"
26 #include "GEOMImpl_PrismDriver.hxx"
27 #include "GEOMImpl_PipeDriver.hxx"
28 #include "GEOMImpl_RevolutionDriver.hxx"
29 #include "GEOMImpl_ShapeDriver.hxx"
30 #include "GEOMImpl_BlockDriver.hxx"
31 #include "GEOMImpl_SphereDriver.hxx"
32 #include "GEOMImpl_TorusDriver.hxx"
33 #include "GEOMImpl_BooleanDriver.hxx"
34 #include "GEOMImpl_ChamferDriver.hxx"
35 #include "GEOMImpl_FilletDriver.hxx"
36 #include "GEOMImpl_TranslateDriver.hxx"
37 #include "GEOMImpl_RotateDriver.hxx"
38 #include "GEOMImpl_MirrorDriver.hxx"
39 #include "GEOMImpl_OffsetDriver.hxx"
40 #include "GEOMImpl_ScaleDriver.hxx"
41 #include "GEOMImpl_PositionDriver.hxx"
42 #include "GEOMImpl_PartitionDriver.hxx"
43 #include "GEOMImpl_CopyDriver.hxx"
44 #include "GEOMImpl_ExportDriver.hxx"
45 #include "GEOMImpl_ImportDriver.hxx"
46 #include "GEOMImpl_ArchimedeDriver.hxx"
47 #include "GEOMImpl_HealingDriver.hxx"
48 #include "GEOMImpl_FillingDriver.hxx"
49 #include "GEOMImpl_GlueDriver.hxx"
50 #include "GEOMImpl_MeasureDriver.hxx"
52 //=============================================================================
54 * default constructor:
56 //=============================================================================
58 GEOMImpl_Gen::GEOMImpl_Gen()
60 MESSAGE("GEOMImpl_Gen::GEOMImpl_Gen");
61 _mapOfBasicOperations.clear();
64 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PointDriver::GetID(), new GEOMImpl_PointDriver());
65 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_VectorDriver::GetID(), new GEOMImpl_VectorDriver());
66 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_LineDriver::GetID(), new GEOMImpl_LineDriver());
67 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PlaneDriver::GetID(), new GEOMImpl_PlaneDriver());
68 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MarkerDriver::GetID(), new GEOMImpl_MarkerDriver());
71 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArcDriver::GetID(), new GEOMImpl_ArcDriver());
72 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CircleDriver::GetID(), new GEOMImpl_CircleDriver());
73 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_EllipseDriver::GetID(), new GEOMImpl_EllipseDriver());
74 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PolylineDriver::GetID(), new GEOMImpl_PolylineDriver());
75 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SplineDriver::GetID(), new GEOMImpl_SplineDriver());
76 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SketcherDriver::GetID(), new GEOMImpl_SketcherDriver());
79 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BoxDriver::GetID(), new GEOMImpl_BoxDriver());
80 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ConeDriver::GetID(), new GEOMImpl_ConeDriver());
81 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CylinderDriver::GetID(), new GEOMImpl_CylinderDriver());
82 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PrismDriver::GetID(), new GEOMImpl_PrismDriver());
83 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeDriver::GetID(), new GEOMImpl_PipeDriver());
84 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RevolutionDriver::GetID(), new GEOMImpl_RevolutionDriver());
85 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SphereDriver::GetID(), new GEOMImpl_SphereDriver());
86 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TorusDriver::GetID(), new GEOMImpl_TorusDriver());
87 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FillingDriver::GetID(), new GEOMImpl_FillingDriver());
90 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ShapeDriver::GetID(), new GEOMImpl_ShapeDriver());
91 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_GlueDriver::GetID(), new GEOMImpl_GlueDriver());
94 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BlockDriver::GetID(), new GEOMImpl_BlockDriver());
96 // Boolean Operations, Partition
97 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BooleanDriver::GetID(), new GEOMImpl_BooleanDriver());
98 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PartitionDriver::GetID(), new GEOMImpl_PartitionDriver());
101 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ChamferDriver::GetID(), new GEOMImpl_ChamferDriver());
102 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FilletDriver::GetID(), new GEOMImpl_FilletDriver());
103 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArchimedeDriver::GetID(), new GEOMImpl_ArchimedeDriver());
105 // Geometrical Transformations, Offset, Scale
106 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TranslateDriver::GetID(), new GEOMImpl_TranslateDriver());
107 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RotateDriver::GetID(), new GEOMImpl_RotateDriver());
108 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MirrorDriver::GetID(), new GEOMImpl_MirrorDriver());
109 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_OffsetDriver::GetID(), new GEOMImpl_OffsetDriver());
110 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ScaleDriver::GetID(), new GEOMImpl_ScaleDriver());
111 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PositionDriver::GetID(), new GEOMImpl_PositionDriver());
113 // Insert Operations (Copy, Import/Export)
114 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CopyDriver::GetID(), new GEOMImpl_CopyDriver());
115 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ImportDriver::GetID(), new GEOMImpl_ImportDriver());
116 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ExportDriver::GetID(), new GEOMImpl_ExportDriver());
119 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_HealingDriver::GetID(), new GEOMImpl_HealingDriver());
122 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MeasureDriver::GetID(), new GEOMImpl_MeasureDriver());
127 //=============================================================================
131 //=============================================================================
133 GEOMImpl_Gen::~GEOMImpl_Gen()
135 MESSAGE("GEOMImpl_Gen::~GEOMImpl_Gen");
137 std::map<int, GEOMImpl_IBasicOperations*>::iterator aBasicIter = _mapOfBasicOperations.begin();
138 for (; aBasicIter != _mapOfBasicOperations.end(); aBasicIter++)
139 delete (*aBasicIter).second;
141 std::map<int, GEOMImpl_ITransformOperations*>::iterator aTransformIter = _mapOfTransformOperations.begin();
142 for (; aTransformIter != _mapOfTransformOperations.end(); aTransformIter++)
143 delete (*aTransformIter).second;
145 std::map<int, GEOMImpl_I3DPrimOperations*>::iterator a3DPrimIter = _mapOf3DPrimOperations.begin();
146 for (; a3DPrimIter != _mapOf3DPrimOperations.end(); a3DPrimIter++)
147 delete (*a3DPrimIter).second;
149 std::map<int, GEOMImpl_IShapesOperations*>::iterator aShapesIter = _mapOfShapesOperations.begin();
150 for (; aShapesIter != _mapOfShapesOperations.end(); aShapesIter++)
151 delete (*aShapesIter).second;
153 std::map<int, GEOMImpl_IBlocksOperations*>::iterator aBlocksIter = _mapOfBlocksOperations.begin();
154 for (; aBlocksIter != _mapOfBlocksOperations.end(); aBlocksIter++)
155 delete (*aBlocksIter).second;
157 std::map<int, GEOMImpl_IBooleanOperations*>::iterator aBooleanIter = _mapOfBooleanOperations.begin();
158 for (; aBooleanIter != _mapOfBooleanOperations.end(); aBooleanIter++)
159 delete (*aBooleanIter).second;
161 std::map<int, GEOMImpl_IHealingOperations*>::iterator aHealingIter = _mapOfHealingOperations.begin();
162 for (; aHealingIter != _mapOfHealingOperations.end(); aHealingIter++)
163 delete (*aHealingIter).second;
165 std::map<int, GEOMImpl_ICurvesOperations*>::iterator aCurvesIter = _mapOfCurvesOperations.begin();
166 for (; aCurvesIter != _mapOfCurvesOperations.end(); aCurvesIter++)
167 delete (*aCurvesIter).second;
169 std::map<int, GEOMImpl_ILocalOperations*>::iterator aLocalIter = _mapOfLocalOperations.begin();
170 for (; aLocalIter != _mapOfLocalOperations.end(); aLocalIter++)
171 delete (*aLocalIter).second;
173 std::map<int, GEOMImpl_IInsertOperations*>::iterator aInsertIter = _mapOfInsertOperations.begin();
174 for (; aInsertIter != _mapOfInsertOperations.end(); aInsertIter++)
175 delete (*aInsertIter).second;
177 std::map<int, GEOMImpl_IMeasureOperations*>::iterator aMeasureIter = _mapOfMeasureOperations.begin();
178 for (; aMeasureIter != _mapOfMeasureOperations.end(); aMeasureIter++)
179 delete (*aMeasureIter).second;
181 std::map<int, GEOMImpl_IGroupOperations*>::iterator aGroupIter = _mapOfGroupOperations.begin();
182 for (; aGroupIter != _mapOfGroupOperations.end(); aGroupIter++)
183 delete (*aGroupIter).second;
186 //=============================================================================
188 * GetIBasicOperations
190 //=============================================================================
191 GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations(int theDocID)
193 if(_mapOfBasicOperations.find(theDocID) == _mapOfBasicOperations.end()) {
194 _mapOfBasicOperations[theDocID] = new GEOMImpl_IBasicOperations(this, theDocID);
197 return _mapOfBasicOperations[theDocID];
200 //=============================================================================
202 * GetITransformOperations
204 //=============================================================================
205 GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations(int theDocID)
207 if(_mapOfTransformOperations.find(theDocID) == _mapOfTransformOperations.end()) {
208 _mapOfTransformOperations[theDocID] = new GEOMImpl_ITransformOperations(this, theDocID);
211 return _mapOfTransformOperations[theDocID];
214 //=============================================================================
216 * GetIBooleanOperations
218 //=============================================================================
219 GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations(int theDocID)
221 if(_mapOfBooleanOperations.find(theDocID) == _mapOfBooleanOperations.end()) {
222 _mapOfBooleanOperations[theDocID] = new GEOMImpl_IBooleanOperations(this, theDocID);
225 return _mapOfBooleanOperations[theDocID];
228 //=============================================================================
230 * GetIHealingOperations
232 //=============================================================================
233 GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations(int theDocID)
235 if(_mapOfHealingOperations.find(theDocID) == _mapOfHealingOperations.end()) {
236 _mapOfHealingOperations[theDocID] = new GEOMImpl_IHealingOperations(this, theDocID);
239 return _mapOfHealingOperations[theDocID];
242 //=============================================================================
244 * GetI3DPrimOperations
246 //=============================================================================
247 GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations(int theDocID)
249 if(_mapOf3DPrimOperations.find(theDocID) == _mapOf3DPrimOperations.end()) {
250 _mapOf3DPrimOperations[theDocID] = new GEOMImpl_I3DPrimOperations(this, theDocID);
253 return _mapOf3DPrimOperations[theDocID];
256 //=============================================================================
258 * GetIShapesOperations
260 //=============================================================================
261 GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations(int theDocID)
263 if(_mapOfShapesOperations.find(theDocID) == _mapOfShapesOperations.end()) {
264 _mapOfShapesOperations[theDocID] = new GEOMImpl_IShapesOperations(this, theDocID);
267 return _mapOfShapesOperations[theDocID];
270 //=============================================================================
272 * GetIBlocksOperations
274 //=============================================================================
275 GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations(int theDocID)
277 if(_mapOfBlocksOperations.find(theDocID) == _mapOfBlocksOperations.end()) {
278 _mapOfBlocksOperations[theDocID] = new GEOMImpl_IBlocksOperations(this, theDocID);
281 return _mapOfBlocksOperations[theDocID];
284 //=============================================================================
286 * GetICurvesOperations
288 //=============================================================================
289 GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations(int theDocID)
291 if(_mapOfCurvesOperations.find(theDocID) == _mapOfCurvesOperations.end()) {
292 _mapOfCurvesOperations[theDocID] = new GEOMImpl_ICurvesOperations(this, theDocID);
295 return _mapOfCurvesOperations[theDocID];
298 //=============================================================================
300 * GetILocalOperations
302 //=============================================================================
303 GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations(int theDocID)
305 if(_mapOfLocalOperations.find(theDocID) == _mapOfLocalOperations.end()) {
306 _mapOfLocalOperations[theDocID] = new GEOMImpl_ILocalOperations(this, theDocID);
309 return _mapOfLocalOperations[theDocID];
312 //=============================================================================
314 * GetIInsertOperations
316 //=============================================================================
317 GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations(int theDocID)
319 if(_mapOfInsertOperations.find(theDocID) == _mapOfInsertOperations.end()) {
320 _mapOfInsertOperations[theDocID] = new GEOMImpl_IInsertOperations(this, theDocID);
323 return _mapOfInsertOperations[theDocID];
326 //=============================================================================
328 * GetIMeasureOperations
330 //=============================================================================
331 GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations(int theDocID)
333 if(_mapOfMeasureOperations.find(theDocID) == _mapOfMeasureOperations.end()) {
334 _mapOfMeasureOperations[theDocID] = new GEOMImpl_IMeasureOperations(this, theDocID);
337 return _mapOfMeasureOperations[theDocID];
340 //=============================================================================
342 * GetIGroupOperations
344 //=============================================================================
345 GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID)
347 if(_mapOfGroupOperations.find(theDocID) == _mapOfGroupOperations.end()) {
348 _mapOfGroupOperations[theDocID] = new GEOMImpl_IGroupOperations(this, theDocID);
351 return _mapOfGroupOperations[theDocID];