2 #pragma warning( disable:4786 )
5 #include <Standard_Stream.hxx>
7 #include <GEOMImpl_Gen.hxx>
11 #include <Utils_ExceptHandlers.hxx>
13 #include <TFunction_Driver.hxx>
14 #include <TFunction_DriverTable.hxx>
16 #include <GEOMImpl_PointDriver.hxx>
17 #include <GEOMImpl_VectorDriver.hxx>
18 #include <GEOMImpl_LineDriver.hxx>
19 #include <GEOMImpl_PlaneDriver.hxx>
20 #include <GEOMImpl_MarkerDriver.hxx>
21 #include <GEOMImpl_ArcDriver.hxx>
22 #include <GEOMImpl_CircleDriver.hxx>
23 #include <GEOMImpl_EllipseDriver.hxx>
24 #include <GEOMImpl_PolylineDriver.hxx>
25 #include <GEOMImpl_SplineDriver.hxx>
26 #include <GEOMImpl_SketcherDriver.hxx>
27 #include <GEOMImpl_BoxDriver.hxx>
28 #include <GEOMImpl_ConeDriver.hxx>
29 #include <GEOMImpl_CylinderDriver.hxx>
30 #include <GEOMImpl_PrismDriver.hxx>
31 #include <GEOMImpl_PipeDriver.hxx>
32 #include <GEOMImpl_RevolutionDriver.hxx>
33 #include <GEOMImpl_ShapeDriver.hxx>
34 #include <GEOMImpl_BlockDriver.hxx>
35 #include <GEOMImpl_SphereDriver.hxx>
36 #include <GEOMImpl_TorusDriver.hxx>
37 #include <GEOMImpl_BooleanDriver.hxx>
38 #include <GEOMImpl_ChamferDriver.hxx>
39 #include <GEOMImpl_FilletDriver.hxx>
40 #include <GEOMImpl_TranslateDriver.hxx>
41 #include <GEOMImpl_RotateDriver.hxx>
42 #include <GEOMImpl_MirrorDriver.hxx>
43 #include <GEOMImpl_OffsetDriver.hxx>
44 #include <GEOMImpl_ScaleDriver.hxx>
45 #include <GEOMImpl_PositionDriver.hxx>
46 #include <GEOMImpl_PartitionDriver.hxx>
47 #include <GEOMImpl_CopyDriver.hxx>
48 #include <GEOMImpl_ExportDriver.hxx>
49 #include <GEOMImpl_ImportDriver.hxx>
50 #include <GEOMImpl_ArchimedeDriver.hxx>
51 #include <GEOMImpl_HealingDriver.hxx>
52 #include <GEOMImpl_FillingDriver.hxx>
53 #include <GEOMImpl_GlueDriver.hxx>
54 #include <GEOMImpl_MeasureDriver.hxx>
56 //=============================================================================
58 * default constructor:
60 //=============================================================================
62 GEOMImpl_Gen::GEOMImpl_Gen()
64 MESSAGE("GEOMImpl_Gen::GEOMImpl_Gen");
65 _mapOfBasicOperations.clear();
68 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PointDriver::GetID(), new GEOMImpl_PointDriver());
69 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_VectorDriver::GetID(), new GEOMImpl_VectorDriver());
70 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_LineDriver::GetID(), new GEOMImpl_LineDriver());
71 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PlaneDriver::GetID(), new GEOMImpl_PlaneDriver());
72 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MarkerDriver::GetID(), new GEOMImpl_MarkerDriver());
75 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArcDriver::GetID(), new GEOMImpl_ArcDriver());
76 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CircleDriver::GetID(), new GEOMImpl_CircleDriver());
77 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_EllipseDriver::GetID(), new GEOMImpl_EllipseDriver());
78 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PolylineDriver::GetID(), new GEOMImpl_PolylineDriver());
79 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SplineDriver::GetID(), new GEOMImpl_SplineDriver());
80 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SketcherDriver::GetID(), new GEOMImpl_SketcherDriver());
83 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BoxDriver::GetID(), new GEOMImpl_BoxDriver());
84 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ConeDriver::GetID(), new GEOMImpl_ConeDriver());
85 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CylinderDriver::GetID(), new GEOMImpl_CylinderDriver());
86 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PrismDriver::GetID(), new GEOMImpl_PrismDriver());
87 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeDriver::GetID(), new GEOMImpl_PipeDriver());
88 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RevolutionDriver::GetID(), new GEOMImpl_RevolutionDriver());
89 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SphereDriver::GetID(), new GEOMImpl_SphereDriver());
90 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TorusDriver::GetID(), new GEOMImpl_TorusDriver());
91 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FillingDriver::GetID(), new GEOMImpl_FillingDriver());
94 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ShapeDriver::GetID(), new GEOMImpl_ShapeDriver());
95 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_GlueDriver::GetID(), new GEOMImpl_GlueDriver());
98 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BlockDriver::GetID(), new GEOMImpl_BlockDriver());
100 // Boolean Operations, Partition
101 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_BooleanDriver::GetID(), new GEOMImpl_BooleanDriver());
102 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PartitionDriver::GetID(), new GEOMImpl_PartitionDriver());
105 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ChamferDriver::GetID(), new GEOMImpl_ChamferDriver());
106 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FilletDriver::GetID(), new GEOMImpl_FilletDriver());
107 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ArchimedeDriver::GetID(), new GEOMImpl_ArchimedeDriver());
109 // Geometrical Transformations, Offset, Scale
110 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TranslateDriver::GetID(), new GEOMImpl_TranslateDriver());
111 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RotateDriver::GetID(), new GEOMImpl_RotateDriver());
112 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MirrorDriver::GetID(), new GEOMImpl_MirrorDriver());
113 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_OffsetDriver::GetID(), new GEOMImpl_OffsetDriver());
114 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ScaleDriver::GetID(), new GEOMImpl_ScaleDriver());
115 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PositionDriver::GetID(), new GEOMImpl_PositionDriver());
117 // Insert Operations (Copy, Import/Export)
118 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CopyDriver::GetID(), new GEOMImpl_CopyDriver());
119 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ImportDriver::GetID(), new GEOMImpl_ImportDriver());
120 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ExportDriver::GetID(), new GEOMImpl_ExportDriver());
123 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_HealingDriver::GetID(), new GEOMImpl_HealingDriver());
126 TFunction_DriverTable::Get()->AddDriver(GEOMImpl_MeasureDriver::GetID(), new GEOMImpl_MeasureDriver());
131 //=============================================================================
135 //=============================================================================
137 GEOMImpl_Gen::~GEOMImpl_Gen()
139 MESSAGE("GEOMImpl_Gen::~GEOMImpl_Gen");
141 std::map<int, GEOMImpl_IBasicOperations*>::iterator aBasicIter = _mapOfBasicOperations.begin();
142 for (; aBasicIter != _mapOfBasicOperations.end(); aBasicIter++)
143 delete (*aBasicIter).second;
145 std::map<int, GEOMImpl_ITransformOperations*>::iterator aTransformIter = _mapOfTransformOperations.begin();
146 for (; aTransformIter != _mapOfTransformOperations.end(); aTransformIter++)
147 delete (*aTransformIter).second;
149 std::map<int, GEOMImpl_I3DPrimOperations*>::iterator a3DPrimIter = _mapOf3DPrimOperations.begin();
150 for (; a3DPrimIter != _mapOf3DPrimOperations.end(); a3DPrimIter++)
151 delete (*a3DPrimIter).second;
153 std::map<int, GEOMImpl_IShapesOperations*>::iterator aShapesIter = _mapOfShapesOperations.begin();
154 for (; aShapesIter != _mapOfShapesOperations.end(); aShapesIter++)
155 delete (*aShapesIter).second;
157 std::map<int, GEOMImpl_IBlocksOperations*>::iterator aBlocksIter = _mapOfBlocksOperations.begin();
158 for (; aBlocksIter != _mapOfBlocksOperations.end(); aBlocksIter++)
159 delete (*aBlocksIter).second;
161 std::map<int, GEOMImpl_IBooleanOperations*>::iterator aBooleanIter = _mapOfBooleanOperations.begin();
162 for (; aBooleanIter != _mapOfBooleanOperations.end(); aBooleanIter++)
163 delete (*aBooleanIter).second;
165 std::map<int, GEOMImpl_IHealingOperations*>::iterator aHealingIter = _mapOfHealingOperations.begin();
166 for (; aHealingIter != _mapOfHealingOperations.end(); aHealingIter++)
167 delete (*aHealingIter).second;
169 std::map<int, GEOMImpl_ICurvesOperations*>::iterator aCurvesIter = _mapOfCurvesOperations.begin();
170 for (; aCurvesIter != _mapOfCurvesOperations.end(); aCurvesIter++)
171 delete (*aCurvesIter).second;
173 std::map<int, GEOMImpl_ILocalOperations*>::iterator aLocalIter = _mapOfLocalOperations.begin();
174 for (; aLocalIter != _mapOfLocalOperations.end(); aLocalIter++)
175 delete (*aLocalIter).second;
177 std::map<int, GEOMImpl_IInsertOperations*>::iterator aInsertIter = _mapOfInsertOperations.begin();
178 for (; aInsertIter != _mapOfInsertOperations.end(); aInsertIter++)
179 delete (*aInsertIter).second;
181 std::map<int, GEOMImpl_IMeasureOperations*>::iterator aMeasureIter = _mapOfMeasureOperations.begin();
182 for (; aMeasureIter != _mapOfMeasureOperations.end(); aMeasureIter++)
183 delete (*aMeasureIter).second;
185 std::map<int, GEOMImpl_IGroupOperations*>::iterator aGroupIter = _mapOfGroupOperations.begin();
186 for (; aGroupIter != _mapOfGroupOperations.end(); aGroupIter++)
187 delete (*aGroupIter).second;
190 //=============================================================================
192 * GetIBasicOperations
194 //=============================================================================
195 GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations(int theDocID)
197 if(_mapOfBasicOperations.find(theDocID) == _mapOfBasicOperations.end()) {
198 _mapOfBasicOperations[theDocID] = new GEOMImpl_IBasicOperations(this, theDocID);
201 return _mapOfBasicOperations[theDocID];
204 //=============================================================================
206 * GetITransformOperations
208 //=============================================================================
209 GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations(int theDocID)
211 if(_mapOfTransformOperations.find(theDocID) == _mapOfTransformOperations.end()) {
212 _mapOfTransformOperations[theDocID] = new GEOMImpl_ITransformOperations(this, theDocID);
215 return _mapOfTransformOperations[theDocID];
218 //=============================================================================
220 * GetIBooleanOperations
222 //=============================================================================
223 GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations(int theDocID)
225 if(_mapOfBooleanOperations.find(theDocID) == _mapOfBooleanOperations.end()) {
226 _mapOfBooleanOperations[theDocID] = new GEOMImpl_IBooleanOperations(this, theDocID);
229 return _mapOfBooleanOperations[theDocID];
232 //=============================================================================
234 * GetIHealingOperations
236 //=============================================================================
237 GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations(int theDocID)
239 if(_mapOfHealingOperations.find(theDocID) == _mapOfHealingOperations.end()) {
240 _mapOfHealingOperations[theDocID] = new GEOMImpl_IHealingOperations(this, theDocID);
243 return _mapOfHealingOperations[theDocID];
246 //=============================================================================
248 * GetI3DPrimOperations
250 //=============================================================================
251 GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations(int theDocID)
253 if(_mapOf3DPrimOperations.find(theDocID) == _mapOf3DPrimOperations.end()) {
254 _mapOf3DPrimOperations[theDocID] = new GEOMImpl_I3DPrimOperations(this, theDocID);
257 return _mapOf3DPrimOperations[theDocID];
260 //=============================================================================
262 * GetIShapesOperations
264 //=============================================================================
265 GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations(int theDocID)
267 if(_mapOfShapesOperations.find(theDocID) == _mapOfShapesOperations.end()) {
268 _mapOfShapesOperations[theDocID] = new GEOMImpl_IShapesOperations(this, theDocID);
271 return _mapOfShapesOperations[theDocID];
274 //=============================================================================
276 * GetIBlocksOperations
278 //=============================================================================
279 GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations(int theDocID)
281 if(_mapOfBlocksOperations.find(theDocID) == _mapOfBlocksOperations.end()) {
282 _mapOfBlocksOperations[theDocID] = new GEOMImpl_IBlocksOperations(this, theDocID);
285 return _mapOfBlocksOperations[theDocID];
288 //=============================================================================
290 * GetICurvesOperations
292 //=============================================================================
293 GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations(int theDocID)
295 if(_mapOfCurvesOperations.find(theDocID) == _mapOfCurvesOperations.end()) {
296 _mapOfCurvesOperations[theDocID] = new GEOMImpl_ICurvesOperations(this, theDocID);
299 return _mapOfCurvesOperations[theDocID];
302 //=============================================================================
304 * GetILocalOperations
306 //=============================================================================
307 GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations(int theDocID)
309 if(_mapOfLocalOperations.find(theDocID) == _mapOfLocalOperations.end()) {
310 _mapOfLocalOperations[theDocID] = new GEOMImpl_ILocalOperations(this, theDocID);
313 return _mapOfLocalOperations[theDocID];
316 //=============================================================================
318 * GetIInsertOperations
320 //=============================================================================
321 GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations(int theDocID)
323 if(_mapOfInsertOperations.find(theDocID) == _mapOfInsertOperations.end()) {
324 _mapOfInsertOperations[theDocID] = new GEOMImpl_IInsertOperations(this, theDocID);
327 return _mapOfInsertOperations[theDocID];
330 //=============================================================================
332 * GetIMeasureOperations
334 //=============================================================================
335 GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations(int theDocID)
337 if(_mapOfMeasureOperations.find(theDocID) == _mapOfMeasureOperations.end()) {
338 _mapOfMeasureOperations[theDocID] = new GEOMImpl_IMeasureOperations(this, theDocID);
341 return _mapOfMeasureOperations[theDocID];
344 //=============================================================================
346 * GetIGroupOperations
348 //=============================================================================
349 GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID)
351 if(_mapOfGroupOperations.find(theDocID) == _mapOfGroupOperations.end()) {
352 _mapOfGroupOperations[theDocID] = new GEOMImpl_IGroupOperations(this, theDocID);
355 return _mapOfGroupOperations[theDocID];