1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include <Standard_Stream.hxx>
25 #include "GEOM_I3DPrimOperations_i.hh"
27 #include "utilities.h"
29 #include "Utils_ExceptHandlers.hxx"
31 #include "GEOM_Engine.hxx"
32 #include "GEOM_Object.hxx"
34 //=============================================================================
38 //=============================================================================
39 GEOM_I3DPrimOperations_i::GEOM_I3DPrimOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_I3DPrimOperations* theImpl)
40 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
42 MESSAGE("GEOM_I3DPrimOperations_i::GEOM_I3DPrimOperations_i");
45 //=============================================================================
49 //=============================================================================
50 GEOM_I3DPrimOperations_i::~GEOM_I3DPrimOperations_i()
52 MESSAGE("GEOM_I3DPrimOperations_i::~GEOM_I3DPrimOperations_i");
56 //=============================================================================
60 //=============================================================================
61 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeBoxDXDYDZ (CORBA::Double theDX,
65 GEOM::GEOM_Object_var aGEOMObject;
68 GetOperations()->SetNotDone();
71 Handle(GEOM_Object) anObject = GetOperations()->MakeBoxDXDYDZ(theDX, theDY, theDZ);
72 if (!GetOperations()->IsDone() || anObject.IsNull())
73 return aGEOMObject._retn();
75 return GetObject(anObject);
78 //=============================================================================
82 //=============================================================================
83 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeBoxTwoPnt
84 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
86 GEOM::GEOM_Object_var aGEOMObject;
89 GetOperations()->SetNotDone();
91 Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
92 Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
94 if (aPnt1.IsNull() || aPnt2.IsNull()) return aGEOMObject._retn();
97 Handle(GEOM_Object) anObject = GetOperations()->MakeBoxTwoPnt(aPnt1, aPnt2);
98 if (!GetOperations()->IsDone() || anObject.IsNull())
99 return aGEOMObject._retn();
101 return GetObject(anObject);
104 //=============================================================================
108 //=============================================================================
109 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceHW (CORBA::Double theH,
111 CORBA::Short theOrientation)
113 GEOM::GEOM_Object_var aGEOMObject;
115 //Set a not done flag
116 GetOperations()->SetNotDone();
118 if (theH == 0 || theW == 0)
119 return aGEOMObject._retn();
122 Handle(GEOM_Object) anObject = GetOperations()->MakeFaceHW(theH, theW, theOrientation);
123 if (!GetOperations()->IsDone() || anObject.IsNull())
124 return aGEOMObject._retn();
126 return GetObject(anObject);
129 //=============================================================================
133 //=============================================================================
134 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceObjHW
135 (GEOM::GEOM_Object_ptr theObj,
139 GEOM::GEOM_Object_var aGEOMObject;
141 //Set a not done flag
142 GetOperations()->SetNotDone();
144 //Get the reference object
145 Handle(GEOM_Object) anObj = GetObjectImpl(theObj);
148 return aGEOMObject._retn();
151 Handle(GEOM_Object) anObject = GetOperations()->MakeFaceObjHW(anObj, theH, theW);
152 if (!GetOperations()->IsDone() || anObject.IsNull())
153 return aGEOMObject._retn();
155 return GetObject(anObject);
158 //=============================================================================
162 //=============================================================================
163 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskPntVecR
164 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
167 GEOM::GEOM_Object_var aGEOMObject;
169 //Set a not done flag
170 GetOperations()->SetNotDone();
172 //Get the reference points
173 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
174 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
176 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
179 Handle(GEOM_Object) anObject =
180 GetOperations()->MakeDiskPntVecR(aPnt, aVec, theR);
181 if (!GetOperations()->IsDone() || anObject.IsNull())
182 return aGEOMObject._retn();
184 return GetObject(anObject);
187 //=============================================================================
191 //=============================================================================
192 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskThreePnt
193 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
194 GEOM::GEOM_Object_ptr thePnt3)
196 GEOM::GEOM_Object_var aGEOMObject;
198 //Set a not done flag
199 GetOperations()->SetNotDone();
201 //Get the reference points
202 Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
203 Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
204 Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
206 if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
209 Handle(GEOM_Object) anObject =
210 GetOperations()->MakeDiskThreePnt(aPnt1, aPnt2, aPnt3);
211 if (!GetOperations()->IsDone() || anObject.IsNull())
212 return aGEOMObject._retn();
214 return GetObject(anObject);
217 //=============================================================================
221 //=============================================================================
222 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskR (CORBA::Double theR,
223 CORBA::Short theOrientation)
225 GEOM::GEOM_Object_var aGEOMObject;
227 //Set a not done flag
228 GetOperations()->SetNotDone();
231 return aGEOMObject._retn();
234 Handle(GEOM_Object) anObject = GetOperations()->MakeDiskR(theR, theOrientation);
235 if (!GetOperations()->IsDone() || anObject.IsNull())
236 return aGEOMObject._retn();
238 return GetObject(anObject);
241 //=============================================================================
245 //=============================================================================
246 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderRH (CORBA::Double theR,
249 GEOM::GEOM_Object_var aGEOMObject;
251 //Set a not done flag
252 GetOperations()->SetNotDone();
254 //Create the Cylinder
255 Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderRH(theR, theH);
256 if (!GetOperations()->IsDone() || anObject.IsNull())
257 return aGEOMObject._retn();
259 return GetObject(anObject);
262 //=============================================================================
264 * MakeCylinderPntVecRH
266 //=============================================================================
267 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderPntVecRH
268 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
269 CORBA::Double theR, CORBA::Double theH)
271 GEOM::GEOM_Object_var aGEOMObject;
273 //Set a not done flag
274 GetOperations()->SetNotDone();
276 //Get the reference points
277 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
278 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
280 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
282 //Create the Cylinder
283 Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderPntVecRH(aPnt, aVec, theR, theH);
284 if (!GetOperations()->IsDone() || anObject.IsNull())
285 return aGEOMObject._retn();
287 return GetObject(anObject);
290 //=============================================================================
294 //=============================================================================
295 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeConeR1R2H (CORBA::Double theR1,
299 GEOM::GEOM_Object_var aGEOMObject;
301 //Set a not done flag
302 GetOperations()->SetNotDone();
305 Handle(GEOM_Object) anObject = GetOperations()->MakeConeR1R2H(theR1, theR2, theH);
306 if (!GetOperations()->IsDone() || anObject.IsNull())
307 return aGEOMObject._retn();
309 return GetObject(anObject);
312 //=============================================================================
314 * MakeConePntVecR1R2H
316 //=============================================================================
317 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeConePntVecR1R2H
318 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
319 CORBA::Double theR1, CORBA::Double theR2, CORBA::Double theH)
321 GEOM::GEOM_Object_var aGEOMObject;
323 //Set a not done flag
324 GetOperations()->SetNotDone();
326 //Get the reference points
327 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
328 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
330 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
333 Handle(GEOM_Object) anObject =
334 GetOperations()->MakeConePntVecR1R2H(aPnt, aVec, theR1, theR2, theH);
335 if (!GetOperations()->IsDone() || anObject.IsNull())
336 return aGEOMObject._retn();
338 return GetObject(anObject);
341 //=============================================================================
345 //=============================================================================
346 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeSphereR (CORBA::Double theR)
348 GEOM::GEOM_Object_var aGEOMObject;
350 //Set a not done flag
351 GetOperations()->SetNotDone();
354 Handle(GEOM_Object) anObject = GetOperations()->MakeSphereR(theR);
355 if (!GetOperations()->IsDone() || anObject.IsNull())
356 return aGEOMObject._retn();
358 return GetObject(anObject);
361 //=============================================================================
365 //=============================================================================
366 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeSpherePntR
367 (GEOM::GEOM_Object_ptr thePnt, CORBA::Double theR)
369 GEOM::GEOM_Object_var aGEOMObject;
371 //Set a not done flag
372 GetOperations()->SetNotDone();
374 //Get the reference point
375 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
377 if (aPnt.IsNull()) return aGEOMObject._retn();
380 Handle(GEOM_Object) anObject =
381 GetOperations()->MakeSpherePntR(aPnt, theR);
382 if (!GetOperations()->IsDone() || anObject.IsNull())
383 return aGEOMObject._retn();
385 return GetObject(anObject);
388 //=============================================================================
392 //=============================================================================
393 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeTorusRR
394 (CORBA::Double theRMajor, CORBA::Double theRMinor)
396 GEOM::GEOM_Object_var aGEOMObject;
398 //Set a not done flag
399 GetOperations()->SetNotDone();
402 Handle(GEOM_Object) anObject =
403 GetOperations()->MakeTorusRR(theRMajor, theRMinor);
404 if (!GetOperations()->IsDone() || anObject.IsNull())
405 return aGEOMObject._retn();
407 return GetObject(anObject);
410 //=============================================================================
414 //=============================================================================
415 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeTorusPntVecRR
416 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
417 CORBA::Double theRMajor, CORBA::Double theRMinor)
419 GEOM::GEOM_Object_var aGEOMObject;
421 //Set a not done flag
422 GetOperations()->SetNotDone();
424 //Get the reference points
425 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
426 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
428 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
431 Handle(GEOM_Object) anObject =
432 GetOperations()->MakeTorusPntVecRR(aPnt, aVec, theRMajor, theRMinor);
433 if (!GetOperations()->IsDone() || anObject.IsNull())
434 return aGEOMObject._retn();
436 return GetObject(anObject);
439 //=============================================================================
443 //=============================================================================
444 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH
445 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theVec,
448 GEOM::GEOM_Object_var aGEOMObject;
450 //Set a not done flag
451 GetOperations()->SetNotDone();
453 //Get the reference objects
454 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
455 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
457 if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
460 Handle(GEOM_Object) anObject =
461 GetOperations()->MakePrismVecH(aBase, aVec, theH);
462 if (!GetOperations()->IsDone() || anObject.IsNull())
463 return aGEOMObject._retn();
465 return GetObject(anObject);
468 //=============================================================================
472 //=============================================================================
473 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH2Ways
474 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theVec,
477 GEOM::GEOM_Object_var aGEOMObject;
479 //Set a not done flag
480 GetOperations()->SetNotDone();
482 //Get the reference objects
483 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
484 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
486 if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
489 Handle(GEOM_Object) anObject =
490 GetOperations()->MakePrismVecH2Ways(aBase, aVec, theH);
491 if (!GetOperations()->IsDone() || anObject.IsNull())
492 return aGEOMObject._retn();
494 return GetObject(anObject);
497 //=============================================================================
501 //=============================================================================
502 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt
503 (GEOM::GEOM_Object_ptr theBase,
504 GEOM::GEOM_Object_ptr thePoint1,
505 GEOM::GEOM_Object_ptr thePoint2)
507 GEOM::GEOM_Object_var aGEOMObject;
509 //Set a not done flag
510 GetOperations()->SetNotDone();
512 //Get the reference objects
513 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
514 Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
515 Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
517 if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
518 return aGEOMObject._retn();
521 Handle(GEOM_Object) anObject =
522 GetOperations()->MakePrismTwoPnt(aBase, aPoint1, aPoint2);
523 if (!GetOperations()->IsDone() || anObject.IsNull())
524 return aGEOMObject._retn();
526 return GetObject(anObject);
529 //=============================================================================
531 * MakePrismTwoPnt2Ways
533 //=============================================================================
534 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt2Ways
535 (GEOM::GEOM_Object_ptr theBase,
536 GEOM::GEOM_Object_ptr thePoint1,
537 GEOM::GEOM_Object_ptr thePoint2)
539 GEOM::GEOM_Object_var aGEOMObject;
541 //Set a not done flag
542 GetOperations()->SetNotDone();
544 //Get the reference objects
545 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
546 Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
547 Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
549 if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
550 return aGEOMObject._retn();
553 Handle(GEOM_Object) anObject =
554 GetOperations()->MakePrismTwoPnt2Ways(aBase, aPoint1, aPoint2);
555 if (!GetOperations()->IsDone() || anObject.IsNull())
556 return aGEOMObject._retn();
558 return GetObject(anObject);
561 //=============================================================================
565 //=============================================================================
566 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ
567 (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
568 CORBA::Double theDY, CORBA::Double theDZ)
570 GEOM::GEOM_Object_var aGEOMObject;
572 //Set a not done flag
573 GetOperations()->SetNotDone();
575 //Get the reference objects
576 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
578 if (aBase.IsNull()) return aGEOMObject._retn();
581 Handle(GEOM_Object) anObject =
582 GetOperations()->MakePrismDXDYDZ(aBase, theDX, theDY, theDZ);
583 if (!GetOperations()->IsDone() || anObject.IsNull())
584 return aGEOMObject._retn();
586 return GetObject(anObject);
589 //=============================================================================
591 * MakePrismDXDYDZ2Ways
593 //=============================================================================
594 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ2Ways
595 (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
596 CORBA::Double theDY, CORBA::Double theDZ)
598 GEOM::GEOM_Object_var aGEOMObject;
600 //Set a not done flag
601 GetOperations()->SetNotDone();
603 //Get the reference objects
604 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
606 if (aBase.IsNull()) return aGEOMObject._retn();
609 Handle(GEOM_Object) anObject =
610 GetOperations()->MakePrismDXDYDZ2Ways(aBase, theDX, theDY, theDZ);
611 if (!GetOperations()->IsDone() || anObject.IsNull())
612 return aGEOMObject._retn();
614 return GetObject(anObject);
617 //=============================================================================
621 //=============================================================================
622 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipe
623 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr thePath)
625 GEOM::GEOM_Object_var aGEOMObject;
627 //Set a not done flag
628 GetOperations()->SetNotDone();
630 //Get the reference objects
631 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
632 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
634 if (aBase.IsNull() || aPath.IsNull()) return aGEOMObject._retn();
637 Handle(GEOM_Object) anObject =
638 GetOperations()->MakePipe(aBase, aPath);
639 if (!GetOperations()->IsDone() || anObject.IsNull())
640 return aGEOMObject._retn();
642 return GetObject(anObject);
645 //=============================================================================
647 * MakeRevolutionAxisAngle
649 //=============================================================================
650 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle
651 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theAxis,
652 CORBA::Double theAngle)
654 GEOM::GEOM_Object_var aGEOMObject;
656 //Set a not done flag
657 GetOperations()->SetNotDone();
659 //Get the reference objects
660 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
661 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
663 if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
665 //Create the Revolution
666 Handle(GEOM_Object) anObject =
667 GetOperations()->MakeRevolutionAxisAngle(aBase, anAxis, theAngle);
668 if (!GetOperations()->IsDone() || anObject.IsNull())
669 return aGEOMObject._retn();
671 return GetObject(anObject);
674 //=============================================================================
676 * MakeRevolutionAxisAngle2Ways
678 //=============================================================================
679 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle2Ways
680 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theAxis,
681 CORBA::Double theAngle)
683 GEOM::GEOM_Object_var aGEOMObject;
685 //Set a not done flag
686 GetOperations()->SetNotDone();
688 //Get the reference objects
689 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
690 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
692 if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
694 //Create the Revolution
695 Handle(GEOM_Object) anObject =
696 GetOperations()->MakeRevolutionAxisAngle2Ways(aBase, anAxis, theAngle);
697 if (!GetOperations()->IsDone() || anObject.IsNull())
698 return aGEOMObject._retn();
700 return GetObject(anObject);
703 //=============================================================================
707 //=============================================================================
708 GEOM::GEOM_Object_ptr
709 GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_ptr theShape,
710 CORBA::Long theMinDeg,
711 CORBA::Long theMaxDeg,
712 CORBA::Double theTol2D,
713 CORBA::Double theTol3D,
714 CORBA::Long theNbIter,
715 GEOM::filling_oper_method theMethod,
716 CORBA::Boolean theApprox)
718 GEOM::GEOM_Object_var aGEOMObject;
720 //Set a not done flag
721 GetOperations()->SetNotDone();
723 //Get the reference objects
724 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
726 if (aShape.IsNull()) return aGEOMObject._retn();
730 case GEOM::FOM_Default:
732 // Default (standard behaviour)
736 case GEOM::FOM_UseOri:
738 // Use edges orientation
742 case GEOM::FOM_AutoCorrect:
744 // Auto-correct edges orientation
753 Handle(GEOM_Object) anObject = GetOperations()->MakeFilling
754 (aShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter,
756 if (!GetOperations()->IsDone() || anObject.IsNull())
757 return aGEOMObject._retn();
759 return GetObject(anObject);
762 //=============================================================================
766 //=============================================================================
767 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThruSections(const GEOM::ListOfGO& theSeqSections,
768 CORBA::Boolean theModeSolid,
769 CORBA::Double thePreci,
770 CORBA::Boolean theRuled)
772 GEOM::GEOM_Object_var aGEOMObject;
774 //Set a not done flag
775 GetOperations()->SetNotDone();
776 Handle(TColStd_HSequenceOfTransient) aSeqSections = new TColStd_HSequenceOfTransient;
780 aLen = theSeqSections.length();
781 for (ind = 0; ind < aLen; ind++) {
782 Handle(GEOM_Object) aSh = GetObjectImpl(theSeqSections[ind]);
784 aSeqSections->Append(aSh);
786 if (!aSeqSections->Length())
787 return aGEOMObject._retn();
789 // Make shell or solid
790 Handle(GEOM_Object) anObject =
791 GetOperations()->MakeThruSections(aSeqSections,theModeSolid,thePreci,theRuled);
792 if (!GetOperations()->IsDone() || anObject.IsNull())
793 return aGEOMObject._retn();
795 return GetObject(anObject);
798 //=============================================================================
800 * MakePipeWithDifferentSections
802 //=============================================================================
803 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
804 (const GEOM::ListOfGO& theBases,
805 const GEOM::ListOfGO& theLocations,
806 GEOM::GEOM_Object_ptr thePath,
807 CORBA::Boolean theWithContact,
808 CORBA::Boolean theWithCorrections)
810 GEOM::GEOM_Object_var aGEOMObject;
812 //Set a not done flag
813 GetOperations()->SetNotDone();
814 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
815 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
816 int ind=0, aNbBases =0,aNbLocs=0;
819 aNbBases = theBases.length();
820 aNbLocs = theLocations.length();
822 if (aNbLocs && aNbBases != aNbLocs)
823 return aGEOMObject._retn();
825 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
827 return aGEOMObject._retn();
829 for (ind = 0; ind < aNbBases; ind++) {
830 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
835 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
838 aSeqLocations->Append(aLoc);
840 aSeqBases->Append(aBase);
842 if (!aSeqBases->Length())
843 return aGEOMObject._retn();
846 Handle(GEOM_Object) anObject =
847 GetOperations()->MakePipeWithDifferentSections(aSeqBases,aSeqLocations ,aPath,
848 theWithContact,theWithCorrections);
849 if (!GetOperations()->IsDone() || anObject.IsNull())
850 return aGEOMObject._retn();
852 return GetObject(anObject);
856 //=============================================================================
858 * MakePipeWithShellSections
860 //=============================================================================
861 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
862 (const GEOM::ListOfGO& theBases,
863 const GEOM::ListOfGO& theSubBases,
864 const GEOM::ListOfGO& theLocations,
865 GEOM::GEOM_Object_ptr thePath,
866 CORBA::Boolean theWithContact,
867 CORBA::Boolean theWithCorrections)
869 GEOM::GEOM_Object_var aGEOMObject;
871 //Set a not done flag
872 GetOperations()->SetNotDone();
873 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
874 Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient;
875 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
876 int ind=0, aNbBases=0, aNbSubBases=0, aNbLocs=0;
879 aNbBases = theBases.length();
880 aNbSubBases = theSubBases.length();
881 aNbLocs = theLocations.length();
883 if (aNbLocs && aNbBases != aNbLocs)
884 return aGEOMObject._retn();
886 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
888 return aGEOMObject._retn();
890 for (ind = 0; ind < aNbBases; ind++) {
891 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
895 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
898 aSeqLocations->Append(aLoc);
900 aSeqBases->Append(aBase);
902 if (aNbSubBases >= aNbBases) {
903 Handle(GEOM_Object) aSubBase = GetObjectImpl(theSubBases[ind]);
904 if (aSubBase.IsNull()) {
905 aSeqSubBases->Clear();
909 aSeqSubBases->Append(aSubBase);
912 if (!aSeqBases->Length())
913 return aGEOMObject._retn();
916 Handle(GEOM_Object) anObject =
917 GetOperations()->MakePipeWithShellSections(aSeqBases, aSeqSubBases,
918 aSeqLocations, aPath,
919 theWithContact, theWithCorrections);
920 if (!GetOperations()->IsDone() || anObject.IsNull())
921 return aGEOMObject._retn();
923 return GetObject(anObject);
927 //=============================================================================
929 * MakePipeShellsWithoutPath
931 //=============================================================================
932 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
933 (const GEOM::ListOfGO& theBases,
934 const GEOM::ListOfGO& theLocations)
936 GEOM::GEOM_Object_var aGEOMObject;
938 //Set a not done flag
939 GetOperations()->SetNotDone();
940 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
941 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
942 int ind=0, aNbBases=0, aNbLocs=0;
945 aNbBases = theBases.length();
946 aNbLocs = theLocations.length();
948 if (aNbLocs && aNbBases != aNbLocs)
949 return aGEOMObject._retn();
951 for (ind = 0; ind < aNbBases; ind++) {
952 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
956 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
959 aSeqLocations->Append(aLoc);
961 aSeqBases->Append(aBase);
964 if (!aSeqBases->Length())
965 return aGEOMObject._retn();
968 Handle(GEOM_Object) anObject =
969 GetOperations()->MakePipeShellsWithoutPath(aSeqBases,aSeqLocations);
971 if (!GetOperations()->IsDone() || anObject.IsNull())
972 return aGEOMObject._retn();
974 return GetObject(anObject);
978 //=============================================================================
980 * MakePipeBiNormalAlongVector
982 //=============================================================================
983 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
984 (GEOM::GEOM_Object_ptr theBase,
985 GEOM::GEOM_Object_ptr thePath,
986 GEOM::GEOM_Object_ptr theVec)
988 GEOM::GEOM_Object_var aGEOMObject;
990 //Set a not done flag
991 GetOperations()->SetNotDone();
993 //Get the reference objects
994 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
995 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
996 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
998 if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
1001 Handle(GEOM_Object) anObject =
1002 GetOperations()->MakePipeBiNormalAlongVector(aBase, aPath, aVec);
1003 if (!GetOperations()->IsDone() || anObject.IsNull())
1004 return aGEOMObject._retn();
1006 return GetObject(anObject);