Salome HOME
32b1589deabf4e6cb2b4f892063c6e62e5b3800d
[modules/geom.git] / src / GEOM_I_Superv / GEOM_Superv_i.cc
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/
19 //
20
21 #include "GEOM_Superv_i.hh"
22 #include "SALOME_LifeCycleCORBA.hxx"
23 using namespace std;
24 //=============================================================================
25 //  constructor:
26 //=============================================================================
27 GEOM_Superv_i::GEOM_Superv_i(CORBA::ORB_ptr orb,
28                              PortableServer::POA_ptr poa,
29                              PortableServer::ObjectId * contId, 
30                              const char *instanceName, 
31                              const char *interfaceName) :
32   Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
33 {
34   MESSAGE("GEOM_Superv_i::GEOM_Superv_i");
35
36   _thisObj = this ;
37   _id = _poa->activate_object(_thisObj);
38   name_service = new SALOME_NamingService(_orb);
39   //get RootPOA (the default)
40   //myPOA = PortableServer::RefCountServantBase::_default_POA();
41   CORBA::Object_var anObj = _orb->resolve_initial_references("RootPOA");
42   myPOA = PortableServer::POA::_narrow(anObj);
43
44   setGeomEngine();
45
46   myStudyID = -1;
47
48   myBasicOp = GEOM::GEOM_IBasicOperations::_nil();
49   my3DPrimOp = GEOM::GEOM_I3DPrimOperations::_nil();
50   myBoolOp = GEOM::GEOM_IBooleanOperations::_nil();
51   myInsOp = GEOM::GEOM_IInsertOperations::_nil();
52   myTransfOp = GEOM::GEOM_ITransformOperations::_nil();
53   myShapesOp = GEOM::GEOM_IShapesOperations::_nil();
54   myBlocksOp = GEOM::GEOM_IBlocksOperations::_nil();
55   myCurvesOp = GEOM::GEOM_ICurvesOperations::_nil();
56   myLocalOp = GEOM::GEOM_ILocalOperations::_nil();
57   myGroupOp = GEOM::GEOM_IGroupOperations::_nil();
58 }
59
60 //=============================================================================
61 //  destructor
62 //=============================================================================
63 GEOM_Superv_i::~GEOM_Superv_i()
64 {
65   MESSAGE("GEOM_Superv_i::~GEOM_Superv_i");
66   delete name_service;
67 }
68
69 //============================================================================
70 // function : register() 
71 // purpose  : register 'name' in 'name_service'
72 //============================================================================
73 void GEOM_Superv_i::register_name(char * name)
74 {
75   GEOM::GEOM_Superv_ptr g = GEOM::GEOM_Superv::_narrow(POA_GEOM::GEOM_Superv::_this());
76   name_service->Register(g, strdup(name)); 
77 }
78
79 //=============================================================================
80 //  setGEOMEngine:
81 //=============================================================================
82 void GEOM_Superv_i::setGeomEngine()
83 {
84   // get GEOM_Gen engine
85   SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
86   Engines::Component_var comp = lcc->FindOrLoad_Component( "FactoryServer", "GEOM" );
87
88   myGeomEngine = GEOM::GEOM_Gen::_narrow(comp);
89 }
90
91 //=============================================================================
92 //  SetStudyID:
93 //=============================================================================
94 void GEOM_Superv_i::SetStudyID( CORBA::Long theId )
95 {
96   myStudyID = theId;
97 }
98
99 //=============================================================================
100 //  CreateListOfGO:
101 //=============================================================================
102 GEOM::GEOM_List_ptr GEOM_Superv_i::CreateListOfGO()
103 {
104   MESSAGE("GEOM_Superv_i::CreateListOfGO()");
105   GEOM_List_i<GEOM::ListOfGO>* aListPtr = new GEOM_List_i<GEOM::ListOfGO>();
106   return aListPtr->_this();
107 }
108
109 //=============================================================================
110 //  AddItemToListOfGO:
111 //=============================================================================
112 void GEOM_Superv_i::AddItemToListOfGO(GEOM::GEOM_List_ptr& theList, 
113                                       GEOM::GEOM_Object_ptr    theObject)
114 {
115   MESSAGE("GEOM_Superv_i::AddItemToListOfGO(...)");
116   if (GEOM_List_i<GEOM::ListOfGO>* aList = 
117       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theList, myPOA).in())) {
118     aList->AddObject(theObject);
119     MESSAGE(" NewLength = "<<aList->GetList().length());
120   }
121 }
122
123 //=============================================================================
124 //  CreateListOfLong:
125 //=============================================================================
126 GEOM::GEOM_List_ptr GEOM_Superv_i::CreateListOfLong()
127 {
128   MESSAGE("GEOM_Superv_i::CreateListOfLong()");
129   GEOM_List_i<GEOM::ListOfLong>* aListPtr = new GEOM_List_i<GEOM::ListOfLong>();
130   return aListPtr->_this();
131 }
132
133 //=============================================================================
134 //  AddItemToListOfLong:
135 //=============================================================================
136 void GEOM_Superv_i::AddItemToListOfLong(GEOM::GEOM_List_ptr& theList, 
137                                         long                     theObject)
138 {
139   MESSAGE("GEOM_Superv_i::AddItemToListOfLong(...)");
140   if (GEOM_List_i<GEOM::ListOfLong>* aList = 
141       dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theList, myPOA).in())) {
142     aList->AddObject(theObject);
143     MESSAGE(" NewLength = "<<aList->GetList().length());
144   }
145 }
146
147 //=============================================================================
148 //  CreateListOfDouble:
149 //=============================================================================
150 GEOM::GEOM_List_ptr GEOM_Superv_i::CreateListOfDouble()
151 {
152   MESSAGE("GEOM_Superv_i::CreateListOfDouble()");
153   GEOM_List_i<GEOM::ListOfDouble>* aListPtr = new GEOM_List_i<GEOM::ListOfDouble>();
154   return aListPtr->_this();
155 }
156
157 //=============================================================================
158 //  AddItemToListOfDouble:
159 //=============================================================================
160 void GEOM_Superv_i::AddItemToListOfDouble(GEOM::GEOM_List_ptr& theList, 
161                                           double                   theObject)
162 {
163   MESSAGE("GEOM_Superv_i::AddItemToListOfDouble(...)");
164   if (GEOM_List_i<GEOM::ListOfDouble>* aList = 
165       dynamic_cast<GEOM_List_i<GEOM::ListOfDouble>*>(GetServant(theList, myPOA).in())) {
166     aList->AddObject(theObject);
167     MESSAGE(" NewLength = "<<aList->GetList().length());
168   }
169 }
170
171 //=============================================================================
172 //  getBasicOp:
173 //=============================================================================
174 void GEOM_Superv_i::getBasicOp()
175 {
176   if (CORBA::is_nil(myGeomEngine))
177     setGeomEngine();
178   // get GEOM_IBasicOperations interface
179   myBasicOp = myGeomEngine->GetIBasicOperations(myStudyID);
180 }
181
182 //=============================================================================
183 //  get3DPrimOp:
184 //=============================================================================
185 void GEOM_Superv_i::get3DPrimOp()
186 {
187   if (CORBA::is_nil(myGeomEngine))
188     setGeomEngine();
189   // get GEOM_I3DPrimOperations interface
190   my3DPrimOp = myGeomEngine->GetI3DPrimOperations(myStudyID);
191 }
192
193 //=============================================================================
194 //  getBoolOp:
195 //=============================================================================
196 void GEOM_Superv_i::getBoolOp()
197 {
198   if (CORBA::is_nil(myGeomEngine))
199     setGeomEngine();
200   // get GEOM_IBooleanOperations interface
201   myBoolOp = myGeomEngine->GetIBooleanOperations(myStudyID);
202 }
203
204 //=============================================================================
205 //  getInsOp:
206 //=============================================================================
207 void GEOM_Superv_i::getInsOp()
208 {
209   if (CORBA::is_nil(myGeomEngine))
210     setGeomEngine();
211   // get GEOM_IInsertOperations interface
212   myInsOp = myGeomEngine->GetIInsertOperations(myStudyID);
213 }
214
215 //=============================================================================
216 //  getTransfOp:
217 //=============================================================================
218 void GEOM_Superv_i::getTransfOp()
219 {
220   if (CORBA::is_nil(myGeomEngine))
221     setGeomEngine();
222   // get GEOM_ITransformOperations interface
223   myTransfOp = myGeomEngine->GetITransformOperations(myStudyID);
224 }
225
226 //=============================================================================
227 //  getShapesOp:
228 //=============================================================================
229 void GEOM_Superv_i::getShapesOp()
230 {
231   if (CORBA::is_nil(myGeomEngine))
232     setGeomEngine();
233   // get GEOM_IShapesOperations interface
234   myShapesOp = myGeomEngine->GetIShapesOperations(myStudyID);
235 }
236
237 //=============================================================================
238 //  getBlocksOp:
239 //=============================================================================
240 void GEOM_Superv_i::getBlocksOp()
241 {
242   if (CORBA::is_nil(myGeomEngine))
243     setGeomEngine();
244   // get GEOM_IBlocksOperations interface
245   myBlocksOp = myGeomEngine->GetIBlocksOperations(myStudyID);
246 }
247
248 //=============================================================================
249 //  getCurvesOp:
250 //=============================================================================
251 void GEOM_Superv_i::getCurvesOp()
252 {
253   if (CORBA::is_nil(myGeomEngine))
254     setGeomEngine();
255   // get GEOM_ICurvesOperations interface
256   myCurvesOp = myGeomEngine->GetICurvesOperations(myStudyID);
257 }
258
259 //=============================================================================
260 //  getLocalOp:
261 //=============================================================================
262 void GEOM_Superv_i::getLocalOp()
263 {
264   if (CORBA::is_nil(myGeomEngine))
265     setGeomEngine();
266   // get GEOM_ILocalOperations interface
267   myLocalOp = myGeomEngine->GetILocalOperations(myStudyID);
268 }
269
270 //=============================================================================
271 //  getGroupOp:
272 //=============================================================================
273 void GEOM_Superv_i::getGroupOp()
274 {
275   if (CORBA::is_nil(myGeomEngine))
276     setGeomEngine();
277   // get GEOM_IGroupOperations interface
278   myGroupOp = myGeomEngine->GetIGroupOperations(myStudyID);
279 }
280
281 //=============================================================================
282 //  GetServant:
283 //=============================================================================
284 PortableServer::ServantBase_var GEOM_Superv_i::GetServant(CORBA::Object_ptr       theObject,
285                                                           PortableServer::POA_ptr thePOA)
286 {
287   if(CORBA::is_nil(theObject))  return NULL;
288   PortableServer::Servant aServant = thePOA->reference_to_servant(theObject);
289   return aServant;
290 }
291
292 //============================================================================
293 // function : Save()
294 // purpose  : save OCAF/Geom document
295 //============================================================================
296 SALOMEDS::TMPFile* GEOM_Superv_i::Save(SALOMEDS::SComponent_ptr theComponent,
297                                        const char* theURL,
298                                        bool isMultiFile)
299 {
300   SALOMEDS::TMPFile_var aStreamFile;
301   return aStreamFile._retn();
302 }
303
304 //============================================================================
305 // function : SaveASCII()
306 // purpose  :
307 //============================================================================ 
308 SALOMEDS::TMPFile* GEOM_Superv_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
309                                             const char* theURL,
310                                             bool isMultiFile)
311 {
312   SALOMEDS::TMPFile_var aStreamFile;
313   return aStreamFile._retn();
314 }
315
316 //============================================================================
317 // function : Load()
318 // purpose  :
319 //============================================================================ 
320 CORBA::Boolean GEOM_Superv_i::Load(SALOMEDS::SComponent_ptr theComponent,
321                                    const SALOMEDS::TMPFile& theStream,
322                                    const char* theURL,
323                                    bool isMultiFile)
324 {
325   return false;
326 }
327
328 //============================================================================
329 // function : LoadASCII()
330 // purpose  :
331 //============================================================================ 
332 CORBA::Boolean GEOM_Superv_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
333                                         const SALOMEDS::TMPFile& theStream,
334                                         const char* theURL,
335                                         bool isMultiFile)
336 {
337   return false;
338 }
339
340 //============================================================================
341 // function : Close()
342 // purpose  :
343 //============================================================================
344 void GEOM_Superv_i::Close(SALOMEDS::SComponent_ptr theComponent)
345 {}
346
347 //============================================================================
348 // function : ComponentDataType()
349 // purpose  :
350 //============================================================================
351 char* GEOM_Superv_i::ComponentDataType()
352 {
353   return 0;
354 }
355
356 //============================================================================
357 // function : IORToLocalPersistentID()
358 // purpose  :
359 //============================================================================
360 char* GEOM_Superv_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
361                                             const char* IORString,
362                                             CORBA::Boolean isMultiFile,
363                                             CORBA::Boolean isASCII)
364 {
365   return 0;
366 }
367
368 //============================================================================
369 // function : LocalPersistentIDToIOR()
370 // purpose  : Create/Load CORBA object from a persistent ref (an entry)
371 //          : Used when a study is loaded
372 //          : The IOR (IORName) of object created is returned
373 //============================================================================
374 char* GEOM_Superv_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
375                                             const char* aLocalPersistentID,
376                                             CORBA::Boolean isMultiFile,
377                                             CORBA::Boolean isASCII)
378 {
379   return 0;
380 }
381
382 //============================================================================
383 // function : CanPublishInStudy
384 // purpose  : 
385 //============================================================================
386 bool GEOM_Superv_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
387 {
388   if (CORBA::is_nil(myGeomEngine))
389     setGeomEngine();
390   return myGeomEngine->CanPublishInStudy(theIOR);
391 }
392
393 //============================================================================
394 // function : PublishInStudy
395 // purpose  : 
396 //============================================================================
397 SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
398                                                     SALOMEDS::SObject_ptr theSObject,
399                                                     CORBA::Object_ptr theObject,
400                                                     const char* theName) throw (SALOME::SALOME_Exception)
401 {
402   if (CORBA::is_nil(myGeomEngine))
403     setGeomEngine();
404   return myGeomEngine->PublishInStudy(theStudy, theSObject, theObject, theName);
405 }
406
407 //============================================================================
408 // function : CanCopy()
409 // purpose  :
410 //============================================================================
411 CORBA::Boolean GEOM_Superv_i::CanCopy(SALOMEDS::SObject_ptr theObject)
412 {
413   return false;
414 }
415
416 //============================================================================
417 // function : CopyFrom()
418 // purpose  :
419 //============================================================================
420 SALOMEDS::TMPFile* GEOM_Superv_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID)
421 {
422   SALOMEDS::TMPFile_var aStreamFile;
423   return aStreamFile._retn();
424 }
425
426 //============================================================================
427 // function : CanPaste()
428 // purpose  :
429 //============================================================================
430 CORBA::Boolean GEOM_Superv_i::CanPaste(const char* theComponentName, CORBA::Long theObjectID)
431 {
432   return false;
433 }
434
435 //============================================================================
436 // function : PasteInto()
437 // purpose  :
438 //============================================================================
439 SALOMEDS::SObject_ptr GEOM_Superv_i::PasteInto(const SALOMEDS::TMPFile& theStream,
440                                                CORBA::Long theObjectID,
441                                                SALOMEDS::SObject_ptr theObject)
442 {
443   SALOMEDS::SObject_var aNewSO;
444   return aNewSO._retn();
445 }
446
447 //================= Primitives Construction : BasicOperations =================
448 //=============================================================================
449 //  MakePointXYZ:
450 //=============================================================================
451 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointXYZ(CORBA::Double theX,
452                                                   CORBA::Double theY,
453                                                   CORBA::Double theZ)
454 {
455   MESSAGE("GEOM_Superv_i::MakePointXYZ");
456   if (CORBA::is_nil(myBasicOp)) getBasicOp();
457   // make vertex and return
458   return myBasicOp->MakePointXYZ(theX, theY, theZ);
459 }
460
461 //=============================================================================
462 //  MakePointWithReference:
463 //=============================================================================
464 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointWithReference (GEOM::GEOM_Object_ptr theReference,
465                                                              CORBA::Double theX, 
466                                                              CORBA::Double theY, 
467                                                              CORBA::Double theZ)
468 {
469   MESSAGE("GEOM_Superv_i::MakePointWithReference");
470   if (CORBA::is_nil(myBasicOp)) getBasicOp();
471   return myBasicOp->MakePointWithReference(theReference, theX, theY, theZ);
472 }
473
474 //=============================================================================
475 //  MakePointOnCurve:
476 //=============================================================================
477 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurve (GEOM::GEOM_Object_ptr theRefCurve,
478                                                        CORBA::Double theParameter)
479 {
480   MESSAGE("GEOM_Superv_i::MakePointOnCurve");
481   if (CORBA::is_nil(myBasicOp)) getBasicOp();
482   return myBasicOp->MakePointOnCurve(theRefCurve, theParameter);
483 }
484
485 //=============================================================================
486 //  MakeVectorDXDYDZ:
487 //=============================================================================
488 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeVectorDXDYDZ (CORBA::Double theDX,
489                                                        CORBA::Double theDY,
490                                                        CORBA::Double theDZ)
491 {
492   MESSAGE("GEOM_Superv_i::MakeVectorDXDYDZ");
493   if (CORBA::is_nil(myBasicOp)) getBasicOp();
494   return myBasicOp->MakeVectorDXDYDZ(theDX, theDY, theDZ);
495 }
496
497 //=============================================================================
498 //  MakeVectorTwoPnt:
499 //=============================================================================
500 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeVectorTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
501                                                        GEOM::GEOM_Object_ptr thePnt2)
502 {
503   MESSAGE("GEOM_Superv_i::MakeVector");
504   if (CORBA::is_nil(myBasicOp)) getBasicOp();
505   return myBasicOp->MakeVectorTwoPnt(thePnt1, thePnt2);
506 }
507
508 //=============================================================================
509 //  MakeLineTwoPnt:
510 //=============================================================================
511 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeLineTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
512                                                      GEOM::GEOM_Object_ptr thePnt2)
513 {
514   MESSAGE("GEOM_Superv_i::MakeLineTwoPnt");
515   if (CORBA::is_nil(myBasicOp)) getBasicOp();
516   return myBasicOp->MakeLineTwoPnt(thePnt1, thePnt2);
517 }
518
519 //=============================================================================
520 //  MakePlaneThreePnt:
521 //=============================================================================
522 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePlaneThreePnt (GEOM::GEOM_Object_ptr thePnt1,
523                                                         GEOM::GEOM_Object_ptr thePnt2,
524                                                         GEOM::GEOM_Object_ptr thePnt3,
525                                                         CORBA::Double theTrimSize)
526 {
527   MESSAGE("GEOM_Superv_i::MakePlaneThreePnt");
528   if (CORBA::is_nil(myBasicOp)) getBasicOp();
529   return myBasicOp->MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize);
530 }
531
532 //=============================================================================
533 //  MakePlanePntVec:
534 //=============================================================================
535 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePlanePntVec (GEOM::GEOM_Object_ptr thePnt,
536                                                       GEOM::GEOM_Object_ptr theVec,
537                                                       CORBA::Double theTrimSize)
538 {
539   MESSAGE("GEOM_Superv_i::MakePlanePntVec");
540   if (CORBA::is_nil(myBasicOp)) getBasicOp();
541   return myBasicOp->MakePlanePntVec(thePnt, theVec, theTrimSize);
542 }
543
544 //=============================================================================
545 //  MakePlaneFace:
546 //=============================================================================
547 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePlaneFace (GEOM::GEOM_Object_ptr theFace,
548                                                     CORBA::Double theTrimSize)
549 {
550   MESSAGE("GEOM_Superv_i::MakePlaneFace");
551   if (CORBA::is_nil(myBasicOp)) getBasicOp();
552   return myBasicOp->MakePlaneFace(theFace, theTrimSize);
553 }
554
555 //=============================================================================
556 //  MakeMarker:
557 //=============================================================================
558 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeMarker 
559 (CORBA::Double theOX , CORBA::Double theOY , CORBA::Double theOZ,
560  CORBA::Double theXDX, CORBA::Double theXDY, CORBA::Double theXDZ,
561  CORBA::Double theYDX, CORBA::Double theYDY, CORBA::Double theYDZ)
562 {
563   MESSAGE("GEOM_Superv_i::MakeMarker");
564   if (CORBA::is_nil(myBasicOp)) getBasicOp();
565   return myBasicOp->MakeMarker(theOX, theOY, theOZ, theXDX, theXDY, theXDZ, theYDX, theYDY, theYDZ);
566 }
567
568 //================= Primitives Construction : 3DPrimOperations ================
569 //=============================================================================
570 //  MakeBox:
571 //=============================================================================
572 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBox (CORBA::Double theX1,
573                                               CORBA::Double theY1,
574                                               CORBA::Double theZ1,
575                                               CORBA::Double theX2,
576                                               CORBA::Double theY2,
577                                               CORBA::Double theZ2)
578 {
579   MESSAGE("GEOM_Superv_i::MakeBox");
580   if (CORBA::is_nil(myBasicOp)) getBasicOp();
581   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
582   return my3DPrimOp->MakeBoxTwoPnt(myBasicOp->MakePointXYZ(theX1, theY1, theZ1),
583                                    myBasicOp->MakePointXYZ(theX2, theY2, theZ2));
584 }
585
586 //=============================================================================
587 //  MakeBoxDXDYDZ:
588 //=============================================================================
589 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoxDXDYDZ (CORBA::Double theDX, 
590                                                     CORBA::Double theDY, 
591                                                     CORBA::Double theDZ)
592 {
593   MESSAGE("GEOM_Superv_i::MakeBoxDXDYDZ");
594   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
595   return my3DPrimOp->MakeBoxDXDYDZ(theDX, theDY, theDZ);
596 }
597
598 //=============================================================================
599 //  MakeBoxTwoPnt:
600 //=============================================================================
601 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt1, 
602                                                     GEOM::GEOM_Object_ptr thePnt2)
603 {
604   MESSAGE("GEOM_Superv_i::MakeBoxTwoPnt");
605   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
606   return my3DPrimOp->MakeBoxTwoPnt(thePnt1, thePnt2);
607 }
608
609 //=============================================================================
610 //  MakeCylinderPntVecRH:
611 //=============================================================================
612 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr thePnt,
613                                                            GEOM::GEOM_Object_ptr theAxis,
614                                                            CORBA::Double theRadius,
615                                                            CORBA::Double theHeight)
616 {
617   MESSAGE("GEOM_Superv_i::MakeCylinderPntVecRH");
618   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
619   return my3DPrimOp->MakeCylinderPntVecRH(thePnt, theAxis, theRadius, theHeight); 
620 }
621
622 //=============================================================================
623 //  MakeCylinderRH:
624 //=============================================================================
625 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderRH (CORBA::Double theR, 
626                                                      CORBA::Double theH)
627 {
628   MESSAGE("GEOM_Superv_i::MakeCylinderRH");
629   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
630   return my3DPrimOp->MakeCylinderRH(theR, theH); 
631 }
632
633 //=============================================================================
634 //  MakeSphere:
635 //=============================================================================
636 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSphere  (CORBA::Double theX,
637                                                   CORBA::Double theY,
638                                                   CORBA::Double theZ,
639                                                   CORBA::Double theRadius)
640 {
641   MESSAGE("GEOM_Superv_i::MakeSphepe");
642   if (CORBA::is_nil(myBasicOp)) getBasicOp();
643   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
644   return my3DPrimOp->MakeSpherePntR(myBasicOp->MakePointXYZ(theX, theY, theZ), theRadius);
645 }
646
647 //=============================================================================
648 //  MakeSphereR:
649 //=============================================================================
650 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSphereR (CORBA::Double theR)
651 {
652   MESSAGE("GEOM_Superv_i::MakeSphereR");
653   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
654   return my3DPrimOp->MakeSphereR(theR);
655 }
656
657 //=============================================================================
658 //  MakeSpherePntR:
659 //=============================================================================
660 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSpherePntR (GEOM::GEOM_Object_ptr thePnt, 
661                                                      CORBA::Double theR)
662 {
663   MESSAGE("GEOM_Superv_i::MakeSpherePntR");
664   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
665   return my3DPrimOp->MakeSpherePntR(thePnt, theR);
666 }
667
668 //=============================================================================
669 //  MakeTorusPntVecRR:
670 //=============================================================================
671 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeTorusPntVecRR (GEOM::GEOM_Object_ptr thePnt,
672                                                         GEOM::GEOM_Object_ptr theVec,
673                                                         CORBA::Double theRMajor,
674                                                         CORBA::Double theRMinor)
675 {
676   MESSAGE("GEOM_Superv_i::MakeTorusPntVecRR");
677   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
678   return my3DPrimOp->MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor);
679 }
680
681 //=============================================================================
682 //  MakeTorusRR:
683 //=============================================================================
684 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeTorusRR (CORBA::Double theRMajor,
685                                                   CORBA::Double theRMinor)
686 {
687   MESSAGE("GEOM_Superv_i::MakeTorusRR");
688   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
689   return my3DPrimOp->MakeTorusRR(theRMajor, theRMinor);
690 }
691
692 //=============================================================================
693 //  MakeConePntVecR1R2H:
694 //=============================================================================
695 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeConePntVecR1R2H (GEOM::GEOM_Object_ptr thePnt,
696                                                           GEOM::GEOM_Object_ptr theAxis,
697                                                           CORBA::Double theR1,
698                                                           CORBA::Double theR2,
699                                                           CORBA::Double theHeight)
700 {
701   MESSAGE("GEOM_Superv_i::MakeConePntVecR1R2H");
702   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
703   return my3DPrimOp->MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theHeight);
704 }
705
706 //=============================================================================
707 //  MakeConeR1R2H:
708 //=============================================================================
709 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeConeR1R2H (CORBA::Double theR1, 
710                                                     CORBA::Double theR2, 
711                                                     CORBA::Double theHeight)
712 {
713   MESSAGE("GEOM_Superv_i::MakeConeR1R2H");
714   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
715   return my3DPrimOp->MakeConeR1R2H(theR1, theR2, theHeight);
716 }
717
718 //=============================================================================
719 //  MakePrismVecH:
720 //=============================================================================
721 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismVecH (GEOM::GEOM_Object_ptr theBase,
722                                                     GEOM::GEOM_Object_ptr theVec,
723                                                     CORBA::Double         theH)
724 {
725   MESSAGE("GEOM_Superv_i::MakePrismVecH");
726   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
727   return my3DPrimOp->MakePrismVecH(theBase, theVec, theH);
728 }
729
730
731 //=============================================================================
732 //  MakePrismTwoPnt:
733 //=============================================================================
734 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismTwoPnt (GEOM::GEOM_Object_ptr theBase,
735                                                       GEOM::GEOM_Object_ptr thePoint1,
736                                                       GEOM::GEOM_Object_ptr thePoint2)
737 {
738   MESSAGE("GEOM_Superv_i::MakePrismTwoPnt");
739   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
740   return my3DPrimOp->MakePrismTwoPnt(theBase, thePoint1, thePoint2);
741 }
742
743 //=============================================================================
744 //  MakePipe:
745 //=============================================================================
746 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipe (GEOM::GEOM_Object_ptr theBase, 
747                                                GEOM::GEOM_Object_ptr thePath)
748 {
749   MESSAGE("GEOM_Superv_i::MakePipe");
750   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
751   return my3DPrimOp->MakePipe(theBase, thePath);
752 }
753
754 //=============================================================================
755 //  MakeRevolutionAxisAngle:
756 //=============================================================================
757 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeRevolutionAxisAngle (GEOM::GEOM_Object_ptr theBase,
758                                                               GEOM::GEOM_Object_ptr theAxis,
759                                                               CORBA::Double theAngle)
760 {
761   MESSAGE("GEOM_Superv_i::MakeRevolutionAxisAngle");
762   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
763   return my3DPrimOp->MakeRevolutionAxisAngle(theBase, theAxis, theAngle);
764 }
765
766 //=============================================================================
767 //  MakeFilling:
768 //=============================================================================
769 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilling (GEOM::GEOM_Object_ptr theShape,
770                                                   CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
771                                                   CORBA::Double theTol2D, CORBA::Double theTol3D,
772                                                   CORBA::Long theNbIter)
773 {
774   MESSAGE("GEOM_Superv_i::MakeFilling");
775   if (CORBA::is_nil(my3DPrimOp)) get3DPrimOp();
776   return my3DPrimOp->MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter);
777 }
778
779 //============================= BooleanOperations =============================
780 //=============================================================================
781 //  MakeBoolean:
782 //=============================================================================
783 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoolean (GEOM::GEOM_Object_ptr theShape1,
784                                                   GEOM::GEOM_Object_ptr theShape2,
785                                                   CORBA::Long theOperation)
786 {
787   // theOperation indicates the operation to be done:
788   // 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section
789   MESSAGE("GEOM_Superv_i::MakeBoolean");
790   if (CORBA::is_nil(myBoolOp)) getBoolOp();
791   return myBoolOp->MakeBoolean(theShape1, theShape2, theOperation);
792 }
793
794 //=============================================================================
795 //  MakeFuse:
796 //=============================================================================
797 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFuse (GEOM::GEOM_Object_ptr theShape1,
798                                                GEOM::GEOM_Object_ptr theShape2)
799 {
800   MESSAGE("GEOM_Superv_i::MakeFuse");
801   if (CORBA::is_nil(myBoolOp)) getBoolOp();
802   return myBoolOp->MakeBoolean(theShape1, theShape2, 3);
803 }
804
805 //=============================================================================
806 //  MakePartition:
807 //=============================================================================
808 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr   theShapes,
809                                                     GEOM::GEOM_List_ptr   theTools,
810                                                     GEOM::GEOM_List_ptr   theKeepInside,
811                                                     GEOM::GEOM_List_ptr   theRemoveInside,
812                                                     CORBA::Short      theLimit,
813                                                     CORBA::Boolean    theRemoveWebs,
814                                                     GEOM::GEOM_List_ptr theMaterials)
815 {
816   MESSAGE("GEOM_Superv_i::MakePartition");
817   GEOM_List_i<GEOM::ListOfGO>* aListImplS = 
818     dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theShapes, myPOA).in());
819   GEOM_List_i<GEOM::ListOfGO>* aListImplT = 
820     dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theTools, myPOA).in());
821   GEOM_List_i<GEOM::ListOfGO>* aListImplKI = 
822     dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theKeepInside, myPOA).in());
823   GEOM_List_i<GEOM::ListOfGO>* aListImplRI = 
824     dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theRemoveInside, myPOA).in());
825   GEOM_List_i<GEOM::ListOfLong>* aListImplM = 
826     dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theMaterials, myPOA).in());
827   if (aListImplS && aListImplT && aListImplKI && aListImplRI && aListImplM) {
828     if (CORBA::is_nil(myBoolOp)) getBoolOp();
829     return myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(), 
830                                    aListImplKI->GetList(), aListImplRI->GetList(),
831                                    theLimit, theRemoveWebs, aListImplM->GetList());
832   }
833   return NULL;
834 }
835
836 //=============================================================================
837 //  MakeHalfPartition:
838 //=============================================================================
839 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
840                                                         GEOM::GEOM_Object_ptr thePlane)
841 {
842   MESSAGE("GEOM_Superv_i::MakeHalfPartition");
843   if (CORBA::is_nil(myBoolOp)) getBoolOp();
844   return myBoolOp->MakeHalfPartition(theShape, thePlane);
845 }
846
847 //============================== InsertOperations =============================
848 //=============================================================================
849 //  MakeCopy:
850 //=============================================================================
851 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCopy (GEOM::GEOM_Object_ptr theOriginal)
852 {
853   MESSAGE("GEOM_Superv_i::MakeCopy");
854   if (CORBA::is_nil(myInsOp)) getInsOp();
855   return myInsOp->MakeCopy(theOriginal);
856 }
857
858 //=============================================================================
859 //  Export:
860 //=============================================================================
861 void GEOM_Superv_i::Export (GEOM::GEOM_Object_ptr theObject, 
862                             const char*           theFileName, 
863                             const char*           theFormatName)
864 {
865   MESSAGE("GEOM_Superv_i::Export");
866   if (CORBA::is_nil(myInsOp)) getInsOp();
867   myInsOp->Export(theObject, theFileName, theFormatName);
868 }
869
870 //=============================================================================
871 //  Import:
872 //=============================================================================
873 GEOM::GEOM_Object_ptr GEOM_Superv_i::Import (const char* theFileName, 
874                                              const char* theFormatName)
875 {
876   MESSAGE("GEOM_Superv_i::Import");
877   if (CORBA::is_nil(myInsOp)) getInsOp();
878   return myInsOp->Import(theFileName, theFormatName);
879 }
880
881 //=============================================================================
882 //  ImportTranslators:
883 //=============================================================================
884 void GEOM_Superv_i::ImportTranslators (GEOM::string_array_out theFormats,
885                                        GEOM::string_array_out thePatterns)
886 {
887   MESSAGE("GEOM_Superv_i::ImportTranslators");
888   if (CORBA::is_nil(myInsOp)) getInsOp();
889   myInsOp->ImportTranslators(theFormats, thePatterns);
890 }
891
892 //=============================================================================
893 //  ExportTranslators:
894 //=============================================================================
895 void GEOM_Superv_i::ExportTranslators (GEOM::string_array_out theFormats,
896                                        GEOM::string_array_out thePatterns)
897 {
898   MESSAGE("GEOM_Superv_i::ExportTranslators");
899   if (CORBA::is_nil(myInsOp)) getInsOp();
900   myInsOp->ExportTranslators(theFormats, thePatterns);
901 }
902
903 //============================= TransformOperations ===========================
904 //=============================================================================
905 //  TranslateTwoPoints:
906 //=============================================================================
907 GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateTwoPoints (GEOM::GEOM_Object_ptr theObject,
908                                                          GEOM::GEOM_Object_ptr thePoint1,
909                                                          GEOM::GEOM_Object_ptr thePoint2)
910 {
911   MESSAGE("GEOM_Superv_i::TranslateTwoPoints");
912   if (CORBA::is_nil(myTransfOp)) getTransfOp();
913   return myTransfOp->TranslateTwoPoints(theObject, thePoint1, thePoint2);
914 }
915
916 //=============================================================================
917 //  TranslateTwoPointsCopy:
918 //=============================================================================
919 GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateTwoPointsCopy (GEOM::GEOM_Object_ptr theObject,
920                                                              GEOM::GEOM_Object_ptr thePoint1,
921                                                              GEOM::GEOM_Object_ptr thePoint2)
922 {
923   MESSAGE("GEOM_Superv_i::TranslateTwoPointsCopy");
924   if (CORBA::is_nil(myTransfOp)) getTransfOp();
925   return myTransfOp->TranslateTwoPointsCopy(theObject, thePoint1, thePoint2);
926 }
927
928 //=============================================================================
929 //  TranslateDXDYDZ:
930 //=============================================================================
931 GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateDXDYDZ (GEOM::GEOM_Object_ptr theObject,
932                                                       CORBA::Double theDX, 
933                                                       CORBA::Double theDY, 
934                                                       CORBA::Double theDZ)
935 {
936   MESSAGE("GEOM_Superv_i::TranslateDXDYDZ");
937   if (CORBA::is_nil(myTransfOp)) getTransfOp();
938   return myTransfOp->TranslateDXDYDZ(theObject, theDX, theDY, theDZ);
939 }
940
941 //=============================================================================
942 //  TranslateDXDYDZCopy:
943 //=============================================================================
944 GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateDXDYDZCopy (GEOM::GEOM_Object_ptr theObject,
945                                                           CORBA::Double theDX, 
946                                                           CORBA::Double theDY, 
947                                                           CORBA::Double theDZ)
948 {
949   MESSAGE("GEOM_Superv_i::TranslateDXDYDZCopy");
950   if (CORBA::is_nil(myTransfOp)) getTransfOp();
951   return myTransfOp->TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ);
952 }
953
954 //=============================================================================
955 //  TranslateVector:
956 //=============================================================================
957 GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateVector (GEOM::GEOM_Object_ptr theObject,
958                                                       GEOM::GEOM_Object_ptr theVector)
959 {
960   MESSAGE("GEOM_Superv_i::TranslateVector");
961   if (CORBA::is_nil(myTransfOp)) getTransfOp();
962   return myTransfOp->TranslateVector(theObject, theVector);
963 }
964
965 //=============================================================================
966 //  TranslateVectorCopy:
967 //=============================================================================
968 GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateVectorCopy (GEOM::GEOM_Object_ptr theObject,
969                                                           GEOM::GEOM_Object_ptr theVector)
970 {
971   MESSAGE("GEOM_Superv_i::TranslateVectorCopy");
972   if (CORBA::is_nil(myTransfOp)) getTransfOp();
973   return myTransfOp->TranslateVectorCopy(theObject, theVector);
974 }
975
976 //=============================================================================
977 //  MultiTranslate1D:
978 //=============================================================================
979 GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiTranslate1D (GEOM::GEOM_Object_ptr theObject,
980                                                        GEOM::GEOM_Object_ptr theVector,
981                                                        CORBA::Double theStep,
982                                                        CORBA::Long theNbTimes)
983 {
984   MESSAGE("GEOM_Superv_i::MultiTranslate1D");
985   if (CORBA::is_nil(myTransfOp)) getTransfOp();
986   return myTransfOp->MultiTranslate1D(theObject, theVector, theStep, theNbTimes);
987 }
988
989 //=============================================================================
990 //  MultiTranslate2D:
991 //=============================================================================
992 GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
993                                                        GEOM::GEOM_Object_ptr theVector1,
994                                                        CORBA::Double theStep1,
995                                                        CORBA::Long theNbTimes1,
996                                                        GEOM::GEOM_Object_ptr theVector2,
997                                                        CORBA::Double theStep2,
998                                                        CORBA::Long theNbTimes2)
999 {
1000   MESSAGE("GEOM_Superv_i::MultiTranslate2D");
1001   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1002   return myTransfOp->MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
1003                                       theVector2, theStep2, theNbTimes2);
1004 }
1005
1006 //=============================================================================
1007 //  Rotate:
1008 //=============================================================================
1009 GEOM::GEOM_Object_ptr GEOM_Superv_i::Rotate (GEOM::GEOM_Object_ptr theObject,
1010                                              GEOM::GEOM_Object_ptr theAxis,
1011                                              CORBA::Double theAngle)
1012 {
1013   MESSAGE("GEOM_Superv_i::Rotate");
1014   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1015   return myTransfOp->Rotate(theObject, theAxis, theAngle);
1016 }
1017
1018 //=============================================================================
1019 //  RotateCopy:
1020 //=============================================================================
1021 GEOM::GEOM_Object_ptr GEOM_Superv_i::RotateCopy (GEOM::GEOM_Object_ptr theObject,
1022                                                  GEOM::GEOM_Object_ptr theAxis,
1023                                                  CORBA::Double theAngle)
1024 {
1025   MESSAGE("GEOM_Superv_i::RotateCopy");
1026   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1027   return myTransfOp->RotateCopy(theObject, theAxis, theAngle);
1028 }
1029
1030 //=============================================================================
1031 //  MultiRotate1D:
1032 //=============================================================================
1033 GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiRotate1D (GEOM::GEOM_Object_ptr theObject,
1034                                                     GEOM::GEOM_Object_ptr theAxis,
1035                                                     CORBA::Long theNbTimes)
1036 {
1037   MESSAGE("GEOM_Superv_i::MultiRotate1D");
1038   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1039   return myTransfOp->MultiRotate1D(theObject, theAxis, theNbTimes);
1040 }
1041
1042 //=============================================================================
1043 //  MultiRotate2D:
1044 //=============================================================================
1045 GEOM::GEOM_Object_ptr GEOM_Superv_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObject,
1046                                                     GEOM::GEOM_Object_ptr theAxis,
1047                                                     CORBA::Double theAngle,
1048                                                     CORBA::Long theNbTimes1,
1049                                                     CORBA::Double theStep,
1050                                                     CORBA::Long theNbTimes2)
1051 {
1052   MESSAGE("GEOM_Superv_i::MultiRotate2D");
1053   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1054   return myTransfOp->MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2);
1055 }
1056
1057 //=============================================================================
1058 //  MirrorPlane:
1059 //=============================================================================
1060 GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPlane (GEOM::GEOM_Object_ptr theObject, 
1061                                                   GEOM::GEOM_Object_ptr thePlane)
1062 {
1063   MESSAGE("GEOM_Superv_i::MirrorPlane");
1064   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1065   return myTransfOp->MirrorPlane(theObject, thePlane);
1066 }
1067
1068 //=============================================================================
1069 //  MirrorPlaneCopy:
1070 //=============================================================================
1071 GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPlaneCopy (GEOM::GEOM_Object_ptr theObject, 
1072                                                       GEOM::GEOM_Object_ptr thePlane)
1073 {
1074   MESSAGE("GEOM_Superv_i::MirrorPlaneCopy");
1075   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1076   return myTransfOp->MirrorPlaneCopy(theObject, thePlane);
1077 }
1078
1079 //=============================================================================
1080 //  MirrorAxis:
1081 //=============================================================================
1082 GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorAxis (GEOM::GEOM_Object_ptr theObject, 
1083                                                  GEOM::GEOM_Object_ptr theAxis)
1084 {
1085   MESSAGE("GEOM_Superv_i::MirrorAxis");
1086   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1087   return myTransfOp->MirrorAxis(theObject, theAxis);
1088 }
1089
1090 //=============================================================================
1091 //  MirrorAxisCopy:
1092 //=============================================================================
1093 GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorAxisCopy (GEOM::GEOM_Object_ptr theObject, 
1094                                                      GEOM::GEOM_Object_ptr theAxis)
1095 {
1096   MESSAGE("GEOM_Superv_i::MirrorAxisCopy");
1097   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1098   return myTransfOp->MirrorAxisCopy(theObject, theAxis);
1099 }
1100
1101 //=============================================================================
1102 //  MirrorPoint:
1103 //=============================================================================
1104 GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPoint (GEOM::GEOM_Object_ptr theObject, 
1105                                                   GEOM::GEOM_Object_ptr thePoint)
1106 {
1107   MESSAGE("GEOM_Superv_i::MirrorPoint");
1108   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1109   return myTransfOp->MirrorPoint(theObject, thePoint);
1110 }
1111
1112 //=============================================================================
1113 //  MirrorPointCopy:
1114 //=============================================================================
1115 GEOM::GEOM_Object_ptr GEOM_Superv_i::MirrorPointCopy (GEOM::GEOM_Object_ptr theObject, 
1116                                                       GEOM::GEOM_Object_ptr thePoint)
1117 {
1118   MESSAGE("GEOM_Superv_i::MirrorPointCopy");
1119   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1120   return myTransfOp->MirrorPointCopy(theObject, thePoint);
1121 }
1122
1123 //=============================================================================
1124 //  OffsetShape:
1125 //=============================================================================
1126 GEOM::GEOM_Object_ptr GEOM_Superv_i::OffsetShape (GEOM::GEOM_Object_ptr theObject, 
1127                                                   CORBA::Double theOffset)
1128 {
1129   MESSAGE("GEOM_Superv_i::OffsetShape");
1130   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1131   return myTransfOp->OffsetShape(theObject, theOffset);
1132 }
1133
1134 //=============================================================================
1135 //  OffsetShapeCopy:
1136 //=============================================================================
1137 GEOM::GEOM_Object_ptr GEOM_Superv_i::OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject, 
1138                                                       CORBA::Double theOffset)
1139 {
1140   MESSAGE("GEOM_Superv_i::OffsetShapeCopy");
1141   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1142   return myTransfOp->OffsetShapeCopy(theObject, theOffset);
1143 }
1144
1145 //=============================================================================
1146 //  ScaleShape:
1147 //=============================================================================
1148 GEOM::GEOM_Object_ptr GEOM_Superv_i::ScaleShape (GEOM::GEOM_Object_ptr theObject, 
1149                                                  GEOM::GEOM_Object_ptr thePoint,
1150                                                  CORBA::Double theFactor)
1151 {
1152   MESSAGE("GEOM_Superv_i::ScaleShape");
1153   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1154   return myTransfOp->ScaleShape(theObject, thePoint, theFactor);
1155 }
1156
1157 //=============================================================================
1158 //  ScaleShapeCopy:
1159 //=============================================================================
1160 GEOM::GEOM_Object_ptr GEOM_Superv_i::ScaleShapeCopy (GEOM::GEOM_Object_ptr theObject, 
1161                                                      GEOM::GEOM_Object_ptr thePoint,
1162                                                      CORBA::Double theFactor)
1163 {
1164   MESSAGE("GEOM_Superv_i::ScaleShapeCopy");
1165   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1166   return myTransfOp->ScaleShapeCopy(theObject, thePoint, theFactor);
1167 }
1168
1169 //=============================================================================
1170 //  PositionShape:
1171 //=============================================================================
1172 GEOM::GEOM_Object_ptr GEOM_Superv_i::PositionShape (GEOM::GEOM_Object_ptr theObject,
1173                                                     GEOM::GEOM_Object_ptr theStartLCS,
1174                                                     GEOM::GEOM_Object_ptr theEndLCS)
1175 {
1176   MESSAGE("GEOM_Superv_i::PositionShape");
1177   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1178   return myTransfOp->PositionShape(theObject, theStartLCS, theEndLCS);
1179 }
1180
1181 //=============================================================================
1182 //  PositionShapeCopy:
1183 //=============================================================================
1184 GEOM::GEOM_Object_ptr GEOM_Superv_i::PositionShapeCopy (GEOM::GEOM_Object_ptr theObject,
1185                                                         GEOM::GEOM_Object_ptr theStartLCS,
1186                                                         GEOM::GEOM_Object_ptr theEndLCS)
1187 {
1188   MESSAGE("GEOM_Superv_i::PositionShapeCopy");
1189   if (CORBA::is_nil(myTransfOp)) getTransfOp();
1190   return myTransfOp->PositionShapeCopy(theObject, theStartLCS, theEndLCS);
1191 }
1192
1193 //=============================== ShapesOperations ============================
1194 //=============================================================================
1195 //  Make:
1196 //=============================================================================
1197 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEdge (GEOM::GEOM_Object_ptr thePnt1,
1198                                                GEOM::GEOM_Object_ptr thePnt2)
1199 {
1200   MESSAGE("GEOM_Superv_i::MakeEdge");
1201   if (CORBA::is_nil(myShapesOp)) getShapesOp();
1202   return myShapesOp->MakeEdge(thePnt1, thePnt2);
1203 }
1204
1205 //=============================================================================
1206 //  MakeWire:
1207 //=============================================================================
1208 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeWire (GEOM::GEOM_List_ptr theEdgesAndWires)
1209 {
1210   MESSAGE("GEOM_Superv_i::MakeWire");
1211   if (GEOM_List_i<GEOM::ListOfGO>* aListImplEW = 
1212       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theEdgesAndWires, myPOA).in())) {
1213     if (CORBA::is_nil(myShapesOp)) getShapesOp();
1214     return myShapesOp->MakeWire(aListImplEW->GetList());
1215   }
1216   return NULL;
1217 }
1218
1219 //=============================================================================
1220 //  MakeFace:
1221 //=============================================================================
1222 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFace (GEOM::GEOM_Object_ptr theWire,
1223                                                CORBA::Boolean isPlanarWanted)
1224 {
1225   MESSAGE("GEOM_Superv_i::MakeFace");
1226   if (CORBA::is_nil(myShapesOp)) getShapesOp();
1227   return myShapesOp->MakeFace(theWire, isPlanarWanted);
1228 }
1229
1230 //=============================================================================
1231 //  MakeFaceWires:
1232 //=============================================================================
1233 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceWires (GEOM::GEOM_List_ptr theWires,
1234                                                     CORBA::Boolean isPlanarWanted)
1235 {
1236   MESSAGE("GEOM_Superv_i::MakeFaceWires");
1237   if (GEOM_List_i<GEOM::ListOfGO>* aListImplW = 
1238       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theWires, myPOA).in())) {
1239     if (CORBA::is_nil(myShapesOp)) getShapesOp();
1240     return myShapesOp->MakeFaceWires(aListImplW->GetList(), isPlanarWanted);
1241   }
1242   return NULL;
1243 }
1244
1245 //=============================================================================
1246 //  MakeShell:
1247 //=============================================================================
1248 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeShell (GEOM::GEOM_List_ptr theFacesAndShells)
1249 {
1250   MESSAGE("GEOM_Superv_i::MakeShell");
1251   if (GEOM_List_i<GEOM::ListOfGO>* aListImplFS = 
1252       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theFacesAndShells, myPOA).in())) {
1253     if (CORBA::is_nil(myShapesOp)) getShapesOp();
1254     return myShapesOp->MakeShell(aListImplFS->GetList());
1255   }
1256   return NULL;
1257 }
1258
1259 //=============================================================================
1260 //  MakeSolidShell:
1261 //=============================================================================
1262 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSolidShell (GEOM::GEOM_Object_ptr theShell)
1263 {
1264   MESSAGE("GEOM_Superv_i::MakeSolidShell");
1265   if (CORBA::is_nil(myShapesOp)) getShapesOp();
1266   return myShapesOp->MakeSolidShell(theShell);
1267 }
1268
1269 //=============================================================================
1270 //  MakeSolidShells:
1271 //=============================================================================
1272 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSolidShells (GEOM::GEOM_List_ptr theShells)
1273 {
1274   MESSAGE("GEOM_Superv_i::MakeSolidShells");
1275   if (GEOM_List_i<GEOM::ListOfGO>* aListImplS = 
1276       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theShells, myPOA).in())) {
1277     if (CORBA::is_nil(myShapesOp)) getShapesOp();
1278     return myShapesOp->MakeSolidShells(aListImplS->GetList());
1279   }
1280   return NULL;
1281 }
1282
1283 //=============================================================================
1284 //  MakeCompound:
1285 //=============================================================================
1286 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCompound (GEOM::GEOM_List_ptr theShapes)
1287 {
1288   MESSAGE("GEOM_Superv_i::MakeCompound");
1289   if (GEOM_List_i<GEOM::ListOfGO>* aListImpl = 
1290       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theShapes, myPOA).in())) {
1291     if (CORBA::is_nil(myShapesOp)) getShapesOp();
1292     return myShapesOp->MakeCompound(aListImpl->GetList());
1293   }
1294   return NULL;
1295 }
1296
1297 //=============================================================================
1298 //  MakeGlueFaces:
1299 //=============================================================================
1300 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
1301                                                                 CORBA::Double   theTolerance)
1302 {
1303   MESSAGE("GEOM_Superv_i::MakeGlueFaces");
1304   if (CORBA::is_nil(myShapesOp)) getShapesOp();
1305   return myShapesOp->MakeGlueFaces(theShape, theTolerance);
1306 }
1307
1308 //=============================================================================
1309 //  MakeExplode:
1310 //=============================================================================
1311 GEOM::GEOM_List_ptr GEOM_Superv_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
1312                                                     CORBA::Long theShapeType,
1313                                                     CORBA::Boolean isSorted)
1314 {
1315   MESSAGE("GEOM_Superv_i::MakeExplode");
1316   if (CORBA::is_nil(myShapesOp)) getShapesOp();
1317
1318   GEOM::ListOfGO* aList = myShapesOp->MakeExplode(theShape, theShapeType, isSorted);
1319   GEOM_List_i<GEOM::ListOfGO>* aListPtr = new GEOM_List_i<GEOM::ListOfGO>(*(aList));
1320   MESSAGE(" List of "<<aListPtr->GetList().length()<<" element(s)");
1321   return aListPtr->_this();
1322 }
1323
1324 //=============================================================================
1325 //  NumberOfFaces:
1326 //=============================================================================
1327 CORBA::Long GEOM_Superv_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
1328 {
1329   MESSAGE("GEOM_Superv_i::NumberOfFaces");
1330   if (CORBA::is_nil(myShapesOp)) getShapesOp();
1331   return myShapesOp->NumberOfFaces(theShape);
1332 }
1333
1334 //=============================================================================
1335 //  NumberOfEdges:
1336 //=============================================================================
1337 CORBA::Long GEOM_Superv_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
1338 {
1339   MESSAGE("GEOM_Superv_i::NumberOfEdges");
1340   if (CORBA::is_nil(myShapesOp)) getShapesOp();
1341   return myShapesOp->NumberOfEdges(theShape);
1342 }
1343
1344 //=============================================================================
1345 //  ChangeOrientation:
1346 //=============================================================================
1347 GEOM::GEOM_Object_ptr GEOM_Superv_i::ChangeOrientation (GEOM::GEOM_Object_ptr theShape)
1348 {
1349   MESSAGE("GEOM_Superv_i::ChangeOrientation");
1350   if (CORBA::is_nil(myShapesOp)) getShapesOp();
1351   return myShapesOp->ChangeOrientation(theShape);
1352 }
1353
1354
1355 //=============================== BlocksOperations ============================
1356 //=============================================================================
1357 //  MakeQuad4Vertices:
1358 //=============================================================================
1359 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeQuad4Vertices (GEOM::GEOM_Object_ptr thePnt1,
1360                                                         GEOM::GEOM_Object_ptr thePnt2,
1361                                                         GEOM::GEOM_Object_ptr thePnt3,
1362                                                         GEOM::GEOM_Object_ptr thePnt4)
1363 {
1364   MESSAGE("GEOM_Superv_i::MakeQuad4Vertices");
1365   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1366   return myBlocksOp->MakeQuad4Vertices(thePnt1, thePnt2, thePnt3, thePnt4);
1367 }
1368
1369 //=============================================================================
1370 //  MakeQuad:
1371 //=============================================================================
1372 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeQuad (GEOM::GEOM_Object_ptr theEdge1,
1373                                                GEOM::GEOM_Object_ptr theEdge2,
1374                                                GEOM::GEOM_Object_ptr theEdge3,
1375                                                GEOM::GEOM_Object_ptr theEdge4)
1376 {
1377   MESSAGE("GEOM_Superv_i::MakeQuad");
1378   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1379   return myBlocksOp->MakeQuad(theEdge1, theEdge2, theEdge3, theEdge4);
1380 }
1381
1382 //=============================================================================
1383 //  MakeQuad2Edges:
1384 //=============================================================================
1385 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeQuad2Edges (GEOM::GEOM_Object_ptr theEdge1,
1386                                                      GEOM::GEOM_Object_ptr theEdge2)
1387 {
1388   MESSAGE("GEOM_Superv_i::MakeQuad2Edges");
1389   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1390   return myBlocksOp->MakeQuad2Edges(theEdge1, theEdge2);
1391 }
1392
1393 //=============================================================================
1394 //  MakeHexa:
1395 //=============================================================================
1396 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeHexa (GEOM::GEOM_Object_ptr theFace1,
1397                                                GEOM::GEOM_Object_ptr theFace2,
1398                                                GEOM::GEOM_Object_ptr theFace3,
1399                                                GEOM::GEOM_Object_ptr theFace4,
1400                                                GEOM::GEOM_Object_ptr theFace5,
1401                                                GEOM::GEOM_Object_ptr theFace6)
1402 {
1403   MESSAGE("GEOM_Superv_i::MakeHexa");
1404   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1405   return myBlocksOp->MakeHexa(theFace1, theFace2, theFace3, theFace4, theFace5, theFace6);
1406 }
1407
1408 //=============================================================================
1409 //  MakeHexa2Faces:
1410 //=============================================================================
1411 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeHexa2Faces (GEOM::GEOM_Object_ptr theFace1,
1412                                                      GEOM::GEOM_Object_ptr theFace2)
1413 {
1414   MESSAGE("GEOM_Superv_i::MakeHexa2Faces");
1415   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1416   return myBlocksOp->MakeHexa2Faces(theFace1, theFace2);
1417 }
1418
1419 //=============================================================================
1420 //  GetPoint:
1421 //=============================================================================
1422 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetPoint (GEOM::GEOM_Object_ptr theShape,
1423                                                CORBA::Double   theX,
1424                                                CORBA::Double   theY,
1425                                                CORBA::Double   theZ,
1426                                                CORBA::Double   theEpsilon)
1427 {
1428   MESSAGE("GEOM_Superv_i::GetPoint");
1429   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1430   return myBlocksOp->GetPoint(theShape, theX, theY, theZ, theEpsilon);
1431 }
1432
1433 //=============================================================================
1434 //  GetEdge:
1435 //=============================================================================
1436 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetEdge (GEOM::GEOM_Object_ptr theShape,
1437                                               GEOM::GEOM_Object_ptr thePoint1,
1438                                               GEOM::GEOM_Object_ptr thePoint2)
1439 {
1440   MESSAGE("GEOM_Superv_i::GetEdge");
1441   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1442   return myBlocksOp->GetEdge(theShape, thePoint1, thePoint2);
1443 }
1444
1445 //=============================================================================
1446 //  GetEdgeNearPoint:
1447 //=============================================================================
1448 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
1449                                                        GEOM::GEOM_Object_ptr thePoint)
1450 {
1451   MESSAGE("GEOM_Superv_i::GetEdgeNearPoint");
1452   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1453   return myBlocksOp->GetEdgeNearPoint(theShape, thePoint);
1454 }
1455
1456 //=============================================================================
1457 //  GetFaceByPoints:
1458 //=============================================================================
1459 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceByPoints (GEOM::GEOM_Object_ptr theShape,
1460                                                       GEOM::GEOM_Object_ptr thePoint1,
1461                                                       GEOM::GEOM_Object_ptr thePoint2,
1462                                                       GEOM::GEOM_Object_ptr thePoint3,
1463                                                       GEOM::GEOM_Object_ptr thePoint4)
1464 {
1465   MESSAGE("GEOM_Superv_i::GetFaceByPoints");
1466   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1467   return myBlocksOp->GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4);
1468 }
1469
1470 //=============================================================================
1471 //  GetFaceByEdges:
1472 //=============================================================================
1473 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceByEdges (GEOM::GEOM_Object_ptr theShape,
1474                                                      GEOM::GEOM_Object_ptr theEdge1,
1475                                                      GEOM::GEOM_Object_ptr theEdge2)
1476 {
1477   MESSAGE("GEOM_Superv_i::GetFaceByEdges");
1478   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1479   return myBlocksOp->GetFaceByEdges(theShape, theEdge1, theEdge2);
1480 }
1481
1482 //=============================================================================
1483 //  GetOppositeFace:
1484 //=============================================================================
1485 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetOppositeFace (GEOM::GEOM_Object_ptr theBlock,
1486                                                       GEOM::GEOM_Object_ptr theFace)
1487 {
1488   MESSAGE("GEOM_Superv_i::GetOppositeFace");
1489   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1490   return myBlocksOp->GetOppositeFace(theBlock, theFace);
1491 }
1492
1493 //=============================================================================
1494 //  GetFaceNearPoint:
1495 //=============================================================================
1496 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
1497                                                        GEOM::GEOM_Object_ptr thePoint)
1498 {
1499   MESSAGE("GEOM_Superv_i::GetFaceNearPoint");
1500   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1501   return myBlocksOp->GetFaceNearPoint(theShape, thePoint);
1502 }
1503
1504 //=============================================================================
1505 //  GetFaceByNormale:
1506 //=============================================================================
1507 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock,
1508                                                        GEOM::GEOM_Object_ptr theVector)
1509 {
1510   MESSAGE("GEOM_Superv_i::GetFaceByNormale");
1511   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1512   return myBlocksOp->GetFaceByNormale(theBlock, theVector);
1513 }
1514
1515 //=============================================================================
1516 //  IsCompoundOfBlocks:
1517 //=============================================================================
1518 CORBA::Boolean GEOM_Superv_i::IsCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
1519                                                   CORBA::Long     theMinNbFaces,
1520                                                   CORBA::Long     theMaxNbFaces,
1521                                                   CORBA::Long&          theNbBlocks)
1522 {
1523   MESSAGE("GEOM_Superv_i::IsCompoundOfBlocks");
1524   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1525   return myBlocksOp->IsCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces, theNbBlocks);
1526 }
1527
1528 //=============================================================================
1529 //  CheckCompoundOfBlocks:
1530 //=============================================================================
1531 CORBA::Boolean GEOM_Superv_i::CheckCompoundOfBlocks 
1532 (GEOM::GEOM_Object_ptr theCompound,
1533  GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors)
1534 {
1535   MESSAGE("GEOM_Superv_i::CheckCompoundOfBlocks");
1536   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1537   return myBlocksOp->CheckCompoundOfBlocks(theCompound, theErrors);
1538 }
1539
1540 //=============================================================================
1541 //  PrintBCErrors:
1542 //=============================================================================
1543 char* GEOM_Superv_i::PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
1544                                     const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors)
1545 {
1546   MESSAGE("GEOM_Superv_i::PrintBCErrors");
1547   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1548   return myBlocksOp->PrintBCErrors(theCompound, theErrors);
1549 }
1550
1551 //=============================================================================
1552 //  ExplodeCompoundOfBlocks:
1553 //=============================================================================
1554 GEOM::GEOM_List_ptr GEOM_Superv_i::ExplodeCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
1555                                                                 CORBA::Long     theMinNbFaces,
1556                                                                 CORBA::Long     theMaxNbFaces)
1557 {
1558   MESSAGE("GEOM_Superv_i::ExplodeCompoundOfBlocks");
1559   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1560   GEOM::ListOfGO* aBlocks = myBlocksOp->ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces);
1561   GEOM_List_i<GEOM::ListOfGO>* aListPtr = new GEOM_List_i<GEOM::ListOfGO>(*(aBlocks));
1562   return aListPtr->_this();
1563 }
1564
1565 //=============================================================================
1566 //  GetBlockNearPoint:
1567 //=============================================================================
1568 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
1569                                                         GEOM::GEOM_Object_ptr thePoint)
1570 {
1571   MESSAGE("GEOM_Superv_i::GetBlockNearPoint");
1572   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1573   return myBlocksOp->GetBlockNearPoint(theCompound, thePoint);
1574 }
1575
1576 //=============================================================================
1577 //  GetBlockByParts:
1578 //=============================================================================
1579 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
1580                                                       GEOM::GEOM_List_ptr theParts)
1581 {
1582   MESSAGE("GEOM_Superv_i::GetBlockByParts");
1583   if (GEOM_List_i<GEOM::ListOfGO>* aListImplP = 
1584       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theParts, myPOA).in())) {
1585     if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1586     return myBlocksOp->GetBlockByParts(theCompound, aListImplP->GetList());
1587   }
1588   return NULL;
1589 }
1590
1591 //=============================================================================
1592 //  GetBlocksByParts:
1593 //=============================================================================
1594 GEOM::GEOM_List_ptr GEOM_Superv_i::GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
1595                                                          GEOM::GEOM_List_ptr theParts)
1596 {
1597   MESSAGE("GEOM_Superv_i::GetBlocksByParts");
1598   if (GEOM_List_i<GEOM::ListOfGO>* aListImplP = 
1599       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theParts, myPOA).in())) {
1600     if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1601     
1602     GEOM::ListOfGO* aBlocks = myBlocksOp->GetBlocksByParts(theCompound, aListImplP->GetList());
1603     GEOM_List_i<GEOM::ListOfGO>* aListPtr = new GEOM_List_i<GEOM::ListOfGO>(*(aBlocks));
1604     return aListPtr->_this();
1605   }
1606   return NULL;
1607 }
1608
1609 //=============================================================================
1610 //  MakeMultiTransformation1D:
1611 //=============================================================================
1612 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeMultiTransformation1D (GEOM::GEOM_Object_ptr theBlock,
1613                                                                 CORBA::Long     theDirFace1,
1614                                                                 CORBA::Long     theDirFace2,
1615                                                                 CORBA::Long     theNbTimes)
1616 {
1617   MESSAGE("GEOM_Superv_i::MakeMultiTransformation1D");
1618   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1619   return myBlocksOp->MakeMultiTransformation1D(theBlock, theDirFace1, theDirFace2, theNbTimes);
1620 }
1621
1622 //=============================================================================
1623 //  MakeMultiTransformation2D:
1624 //=============================================================================
1625 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeMultiTransformation2D 
1626 (GEOM::GEOM_Object_ptr theBlock,
1627  CORBA::Long     theDirFace1U,
1628  CORBA::Long     theDirFace2U,
1629  CORBA::Long     theNbTimesU,
1630  CORBA::Long     theDirFace1V,
1631  CORBA::Long     theDirFace2V,
1632  CORBA::Long     theNbTimesV)
1633 {
1634   MESSAGE("GEOM_Superv_i::MakeMultiTransformation2D");
1635   if (CORBA::is_nil(myBlocksOp)) getBlocksOp();
1636   return myBlocksOp->MakeMultiTransformation2D(theBlock, 
1637                                                theDirFace1U, theDirFace2U, theNbTimesU,
1638                                                theDirFace1V, theDirFace2V, theNbTimesV);
1639 }
1640
1641 //=============================== CurvesOperations ============================
1642 //=============================================================================
1643 //  MakeCirclePntVecR:
1644 //=============================================================================
1645 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCirclePntVecR (GEOM::GEOM_Object_ptr theCenter,
1646                                                         GEOM::GEOM_Object_ptr theVector,
1647                                                         CORBA::Double theR)
1648 {
1649   MESSAGE("GEOM_Superv_i::MakeCirclePntVecR");
1650   if (CORBA::is_nil(myCurvesOp)) getCurvesOp();
1651   return myCurvesOp->MakeCirclePntVecR(theCenter, theVector, theR);
1652 }
1653
1654 //=============================================================================
1655 //  MakeCircleThreePnt:
1656 //=============================================================================
1657 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCircleThreePnt (GEOM::GEOM_Object_ptr thePnt1,
1658                                                          GEOM::GEOM_Object_ptr thePnt2,
1659                                                          GEOM::GEOM_Object_ptr thePnt3)
1660 {
1661   MESSAGE("GEOM_Superv_i::MakeCircleThreePnt");
1662   if (CORBA::is_nil(myCurvesOp)) getCurvesOp();
1663   return myCurvesOp->MakeCircleThreePnt(thePnt1, thePnt2, thePnt3);
1664 }
1665
1666 //=============================================================================
1667 //  MakeEllipse:
1668 //=============================================================================
1669 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEllipse (GEOM::GEOM_Object_ptr theCenter,
1670                                                   GEOM::GEOM_Object_ptr theVector,
1671                                                   CORBA::Double theRMajor, 
1672                                                   CORBA::Double theRMinor)
1673 {
1674   MESSAGE("GEOM_Superv_i::MakeEllipse");
1675   if (CORBA::is_nil(myCurvesOp)) getCurvesOp();
1676   return myCurvesOp->MakeEllipse(theCenter, theVector, theRMajor, theRMinor);
1677 }
1678
1679 //=============================================================================
1680 //  MakeArc:
1681 //=============================================================================
1682 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeArc (GEOM::GEOM_Object_ptr thePnt1,
1683                                               GEOM::GEOM_Object_ptr thePnt2,
1684                                               GEOM::GEOM_Object_ptr thePnt3)
1685 {
1686   MESSAGE("GEOM_Superv_i::MakeArc");
1687   if (CORBA::is_nil(myCurvesOp)) getCurvesOp();
1688   return myCurvesOp->MakeArc(thePnt1, thePnt2, thePnt3);
1689 }
1690
1691 //=============================================================================
1692 //  MakePolyline:
1693 //=============================================================================
1694 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePolyline (GEOM::GEOM_List_ptr thePoints)
1695 {
1696   MESSAGE("GEOM_Superv_i::MakePolyline");
1697   if (GEOM_List_i<GEOM::ListOfGO>* aListImplP = 
1698       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(thePoints, myPOA).in())) {
1699     if (CORBA::is_nil(myCurvesOp)) getCurvesOp();
1700     return myCurvesOp->MakePolyline(aListImplP->GetList());
1701   }
1702   return NULL;
1703 }
1704
1705 //=============================================================================
1706 //  MakeSplineBezier:
1707 //=============================================================================
1708 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineBezier (GEOM::GEOM_List_ptr thePoints)
1709 {
1710   MESSAGE("GEOM_Superv_i::MakeSplineBezier");
1711   if (GEOM_List_i<GEOM::ListOfGO>* aListImplP = 
1712       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(thePoints, myPOA).in())) {
1713     if (CORBA::is_nil(myCurvesOp)) getCurvesOp();
1714     return myCurvesOp->MakeSplineBezier(aListImplP->GetList());
1715   }
1716   return NULL;
1717 }
1718
1719 //=============================================================================
1720 //  MakeSplineInterpolation:
1721 //=============================================================================
1722 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints)
1723 {
1724   MESSAGE("GEOM_Superv_i::MakeSplineInterpolation");
1725   if (GEOM_List_i<GEOM::ListOfGO>* aListImplP = 
1726       dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(thePoints, myPOA).in())) {
1727     if (CORBA::is_nil(myCurvesOp)) getCurvesOp();
1728     return myCurvesOp->MakeSplineInterpolation(aListImplP->GetList());
1729   }
1730   return NULL;
1731 }
1732
1733 //=============================================================================
1734 //  MakeSketcher:
1735 //=============================================================================
1736 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSketcher (const char* theCommand, 
1737                                                    GEOM::GEOM_List_ptr theWorkingPlane)
1738 {
1739   MESSAGE("GEOM_Superv_i::MakeSketcher");
1740   if (GEOM_List_i<GEOM::ListOfDouble>* aListImplWP = 
1741       dynamic_cast<GEOM_List_i<GEOM::ListOfDouble>*>(GetServant(theWorkingPlane, myPOA).in())) {
1742     if (CORBA::is_nil(myCurvesOp)) getCurvesOp();
1743     return myCurvesOp->MakeSketcher(theCommand, aListImplWP->GetList());
1744   }
1745   return NULL;
1746 }
1747
1748 //=============================== LocalOperations =============================
1749 //=============================================================================
1750 //  MakeFilletAll:
1751 //=============================================================================
1752 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilletAll (GEOM::GEOM_Object_ptr theShape,
1753                                                     CORBA::Double theR)
1754 {
1755   MESSAGE("GEOM_Superv_i::MakeFilletAllMakeSketcher");
1756   if (CORBA::is_nil(myLocalOp)) getLocalOp();
1757   return myLocalOp->MakeFilletAll(theShape, theR);
1758 }
1759
1760 //=============================================================================
1761 //  MakeFilletEdges:
1762 //=============================================================================
1763 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilletEdges (GEOM::GEOM_Object_ptr theShape, 
1764                                                       CORBA::Double theR,
1765                                                       GEOM::GEOM_List_ptr theEdges)
1766 {
1767   MESSAGE("GEOM_Superv_i::MakeFilletEdges");
1768   if (GEOM_List_i<GEOM::ListOfLong>* aListImplE = 
1769       dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theEdges, myPOA).in())) {
1770     if (CORBA::is_nil(myLocalOp)) getLocalOp();
1771     return myLocalOp->MakeFilletEdges(theShape, theR, aListImplE->GetList());
1772   }
1773   return NULL;
1774 }
1775
1776 //=============================================================================
1777 //  MakeFilletFaces:
1778 //=============================================================================
1779 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilletFaces (GEOM::GEOM_Object_ptr theShape, 
1780                                                       CORBA::Double theR,
1781                                                       GEOM::GEOM_List_ptr theFaces)
1782 {
1783   MESSAGE("GEOM_Superv_i::MakeFilletFaces");
1784   if (GEOM_List_i<GEOM::ListOfLong>* aListImplF = 
1785       dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theFaces, myPOA).in())) {
1786     if (CORBA::is_nil(myLocalOp)) getLocalOp();
1787     return myLocalOp->MakeFilletFaces(theShape, theR, aListImplF->GetList());
1788   }
1789   return NULL;
1790 }
1791
1792 //=============================================================================
1793 //  MakeChamferAll:
1794 //=============================================================================
1795 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeChamferAll (GEOM::GEOM_Object_ptr theShape, CORBA::Double theD)
1796 {
1797   MESSAGE("GEOM_Superv_i::MakeChamferAll");
1798   if (CORBA::is_nil(myLocalOp)) getLocalOp();
1799   return myLocalOp->MakeChamferAll(theShape, theD);
1800 }
1801   
1802 //=============================================================================
1803 //  MakeChamferEdge:
1804 //=============================================================================
1805 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeChamferEdge (GEOM::GEOM_Object_ptr theShape,
1806                                                       CORBA::Double theD1, CORBA::Double theD2,
1807                                                       CORBA::Long theFace1, CORBA::Long theFace2)
1808 {
1809   MESSAGE("GEOM_Superv_i::MakeChamferEdge");
1810   if (CORBA::is_nil(myLocalOp)) getLocalOp();
1811   return myLocalOp->MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2);
1812 }
1813
1814 //=============================================================================
1815 //  MakeChamferFaces:
1816 //=============================================================================
1817 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeChamferFaces (GEOM::GEOM_Object_ptr theShape,
1818                                                        CORBA::Double theD1, CORBA::Double theD2,
1819                                                        GEOM::GEOM_List_ptr theFaces)
1820 {
1821   MESSAGE("GEOM_Superv_i::MakeChamferFaces");
1822   if (GEOM_List_i<GEOM::ListOfLong>* aListImplF = 
1823       dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theFaces, myPOA).in())) {
1824     if (CORBA::is_nil(myLocalOp)) getLocalOp();
1825     return myLocalOp->MakeChamferFaces(theShape, theD1, theD2, aListImplF->GetList());
1826   }
1827   return NULL;
1828 }
1829
1830 //=============================================================================
1831 //  MakeArchimede:
1832 //=============================================================================
1833 GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeArchimede (GEOM::GEOM_Object_ptr theShape,
1834                                                     CORBA::Double theWeight,
1835                                                     CORBA::Double theWaterDensity,
1836                                                     CORBA::Double theMeshingDeflection)
1837 {
1838   MESSAGE("GEOM_Superv_i::MakeArchimede");
1839   if (CORBA::is_nil(myLocalOp)) getLocalOp();
1840   return myLocalOp->MakeArchimede(theShape, theWeight, theWaterDensity, theMeshingDeflection);
1841 }
1842
1843 //=============================================================================
1844 //  GetSubShapeIndexMakeFilletAll:
1845 //=============================================================================
1846 CORBA::Long GEOM_Superv_i::GetSubShapeIndex (GEOM::GEOM_Object_ptr theShape,
1847                                              GEOM::GEOM_Object_ptr theSubShape)
1848 {
1849   MESSAGE("GEOM_Superv_i::GetSubShapeIndexMakeArchimede");
1850   if (CORBA::is_nil(myLocalOp)) getLocalOp();
1851   return myLocalOp->GetSubShapeIndex(theShape, theSubShape);
1852 }
1853
1854 //=============================== GroupOperations =============================
1855 //=============================================================================
1856 //  CreateGroup:
1857 //=============================================================================
1858 GEOM::GEOM_Object_ptr GEOM_Superv_i::CreateGroup (GEOM::GEOM_Object_ptr theMainShape, 
1859                                                   CORBA::Long theShapeType)
1860 {
1861   MESSAGE("GEOM_Superv_i::CreateGroup");
1862   if (CORBA::is_nil(myGroupOp)) getGroupOp();
1863   return myGroupOp->CreateGroup(theMainShape, theShapeType);
1864 }
1865
1866 //=============================================================================
1867 //  AddObject:
1868 //=============================================================================
1869 void GEOM_Superv_i::AddObject (GEOM::GEOM_Object_ptr theGroup, 
1870                                CORBA::Long theSubShapeId)
1871 {
1872   MESSAGE("GEOM_Superv_i::AddObject");
1873   if (CORBA::is_nil(myGroupOp)) getGroupOp();
1874   myGroupOp->AddObject(theGroup, theSubShapeId);
1875 }
1876
1877 //=============================================================================
1878 //  RemoveObject:
1879 //=============================================================================
1880 void GEOM_Superv_i::RemoveObject (GEOM::GEOM_Object_ptr theGroup, 
1881                                   CORBA::Long theSubShapeId)
1882 {
1883   MESSAGE("GEOM_Superv_i::RemoveObject");
1884   if (CORBA::is_nil(myGroupOp)) getGroupOp();
1885   myGroupOp->RemoveObject(theGroup, theSubShapeId);
1886 }
1887
1888 //=============================================================================
1889 //  GetType:
1890 //=============================================================================
1891 CORBA::Long GEOM_Superv_i::GetType (GEOM::GEOM_Object_ptr theGroup)
1892 {
1893   MESSAGE("GEOM_Superv_i::GetType");
1894   if (CORBA::is_nil(myGroupOp)) getGroupOp();
1895   return myGroupOp->GetType(theGroup);
1896 }
1897
1898 //=============================================================================
1899 //  GetMainShape:
1900 //=============================================================================
1901 GEOM::GEOM_Object_ptr GEOM_Superv_i::GetMainShape (GEOM::GEOM_Object_ptr theGroup)
1902 {
1903   MESSAGE("GEOM_Superv_i::GetMainShape");
1904   if (CORBA::is_nil(myGroupOp)) getGroupOp();
1905   return myGroupOp->GetMainShape(theGroup);
1906 }
1907
1908 //=============================================================================
1909 //  GetObjects:
1910 //=============================================================================
1911 GEOM::GEOM_List_ptr GEOM_Superv_i::GetObjects (GEOM::GEOM_Object_ptr theGroup)
1912 {
1913   MESSAGE("GEOM_Superv_i::GetObjects");
1914   if (CORBA::is_nil(myGroupOp)) getGroupOp();
1915
1916   GEOM::ListOfLong* aList = myGroupOp->GetObjects(theGroup);
1917   GEOM_List_i<GEOM::ListOfLong>* aListPtr = new GEOM_List_i<GEOM::ListOfLong>(*(aList));
1918   MESSAGE(" List of "<<aListPtr->GetList().length()<<" element(s)");
1919   return aListPtr->_this();
1920 }
1921
1922 //=====================================================================================
1923 // EXPORTED METHODS
1924 //=====================================================================================
1925 extern "C"
1926 {
1927   PortableServer::ObjectId * GEOM_SupervEngine_factory(CORBA::ORB_ptr orb,
1928                                                       PortableServer::POA_ptr poa, 
1929                                                       PortableServer::ObjectId * contId,
1930                                                       const char *instanceName, 
1931                                                       const char * interfaceName)
1932   {
1933     GEOM_Superv_i * myGEOM_Superv_i = new GEOM_Superv_i(orb, poa, contId, instanceName, interfaceName);
1934     myGEOM_Superv_i->register_name("/myGEOM_Superv");
1935     return myGEOM_Superv_i->getId() ;
1936   }
1937 }