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
22 #include <Standard_Stream.hxx>
24 #include "GEOM_I3DPrimOperations_i.hh"
26 #include "utilities.h"
28 #include "Utils_ExceptHandlers.hxx"
30 #include "GEOM_Engine.hxx"
31 #include "GEOM_Object.hxx"
33 //=============================================================================
37 //=============================================================================
38 GEOM_I3DPrimOperations_i::GEOM_I3DPrimOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_I3DPrimOperations* theImpl)
39 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
41 MESSAGE("GEOM_I3DPrimOperations_i::GEOM_I3DPrimOperations_i");
44 //=============================================================================
48 //=============================================================================
49 GEOM_I3DPrimOperations_i::~GEOM_I3DPrimOperations_i()
51 MESSAGE("GEOM_I3DPrimOperations_i::~GEOM_I3DPrimOperations_i");
55 //=============================================================================
59 //=============================================================================
60 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeBoxDXDYDZ (CORBA::Double theDX,
64 GEOM::GEOM_Object_var aGEOMObject;
67 GetOperations()->SetNotDone();
70 Handle(GEOM_Object) anObject = GetOperations()->MakeBoxDXDYDZ(theDX, theDY, theDZ);
71 if (!GetOperations()->IsDone() || anObject.IsNull())
72 return aGEOMObject._retn();
74 return GetObject(anObject);
77 //=============================================================================
81 //=============================================================================
82 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeBoxTwoPnt
83 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
85 GEOM::GEOM_Object_var aGEOMObject;
88 GetOperations()->SetNotDone();
90 Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
91 Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
93 if (aPnt1.IsNull() || aPnt2.IsNull()) return aGEOMObject._retn();
96 Handle(GEOM_Object) anObject = GetOperations()->MakeBoxTwoPnt(aPnt1, aPnt2);
97 if (!GetOperations()->IsDone() || anObject.IsNull())
98 return aGEOMObject._retn();
100 return GetObject(anObject);
103 //=============================================================================
107 //=============================================================================
108 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceHW (CORBA::Double theH,
110 CORBA::Short theOrientation)
112 GEOM::GEOM_Object_var aGEOMObject;
114 //Set a not done flag
115 GetOperations()->SetNotDone();
117 if (theH == 0 || theW == 0)
118 return aGEOMObject._retn();
121 Handle(GEOM_Object) anObject = GetOperations()->MakeFaceHW(theH, theW, theOrientation);
122 if (!GetOperations()->IsDone() || anObject.IsNull())
123 return aGEOMObject._retn();
125 return GetObject(anObject);
128 //=============================================================================
132 //=============================================================================
133 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceObjHW
134 (GEOM::GEOM_Object_ptr theObj,
138 GEOM::GEOM_Object_var aGEOMObject;
140 //Set a not done flag
141 GetOperations()->SetNotDone();
143 //Get the reference object
144 Handle(GEOM_Object) anObj = GetObjectImpl(theObj);
147 return aGEOMObject._retn();
150 Handle(GEOM_Object) anObject = GetOperations()->MakeFaceObjHW(anObj, theH, theW);
151 if (!GetOperations()->IsDone() || anObject.IsNull())
152 return aGEOMObject._retn();
154 return GetObject(anObject);
157 //=============================================================================
161 //=============================================================================
162 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskPntVecR
163 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
166 GEOM::GEOM_Object_var aGEOMObject;
168 //Set a not done flag
169 GetOperations()->SetNotDone();
171 //Get the reference points
172 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
173 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
175 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
178 Handle(GEOM_Object) anObject =
179 GetOperations()->MakeDiskPntVecR(aPnt, aVec, theR);
180 if (!GetOperations()->IsDone() || anObject.IsNull())
181 return aGEOMObject._retn();
183 return GetObject(anObject);
186 //=============================================================================
190 //=============================================================================
191 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskThreePnt
192 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
193 GEOM::GEOM_Object_ptr thePnt3)
195 GEOM::GEOM_Object_var aGEOMObject;
197 //Set a not done flag
198 GetOperations()->SetNotDone();
200 //Get the reference points
201 Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
202 Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
203 Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
205 if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
208 Handle(GEOM_Object) anObject =
209 GetOperations()->MakeDiskThreePnt(aPnt1, aPnt2, aPnt3);
210 if (!GetOperations()->IsDone() || anObject.IsNull())
211 return aGEOMObject._retn();
213 return GetObject(anObject);
216 //=============================================================================
220 //=============================================================================
221 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskR (CORBA::Double theR,
222 CORBA::Short theOrientation)
224 GEOM::GEOM_Object_var aGEOMObject;
226 //Set a not done flag
227 GetOperations()->SetNotDone();
230 return aGEOMObject._retn();
233 Handle(GEOM_Object) anObject = GetOperations()->MakeDiskR(theR, theOrientation);
234 if (!GetOperations()->IsDone() || anObject.IsNull())
235 return aGEOMObject._retn();
237 return GetObject(anObject);
240 //=============================================================================
244 //=============================================================================
245 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderRH (CORBA::Double theR,
248 GEOM::GEOM_Object_var aGEOMObject;
250 //Set a not done flag
251 GetOperations()->SetNotDone();
253 //Create the Cylinder
254 Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderRH(theR, theH);
255 if (!GetOperations()->IsDone() || anObject.IsNull())
256 return aGEOMObject._retn();
258 return GetObject(anObject);
261 //=============================================================================
263 * MakeCylinderPntVecRH
265 //=============================================================================
266 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderPntVecRH
267 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
268 CORBA::Double theR, CORBA::Double theH)
270 GEOM::GEOM_Object_var aGEOMObject;
272 //Set a not done flag
273 GetOperations()->SetNotDone();
275 //Get the reference points
276 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
277 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
279 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
281 //Create the Cylinder
282 Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderPntVecRH(aPnt, aVec, theR, theH);
283 if (!GetOperations()->IsDone() || anObject.IsNull())
284 return aGEOMObject._retn();
286 return GetObject(anObject);
289 //=============================================================================
293 //=============================================================================
294 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeConeR1R2H (CORBA::Double theR1,
298 GEOM::GEOM_Object_var aGEOMObject;
300 //Set a not done flag
301 GetOperations()->SetNotDone();
304 Handle(GEOM_Object) anObject = GetOperations()->MakeConeR1R2H(theR1, theR2, theH);
305 if (!GetOperations()->IsDone() || anObject.IsNull())
306 return aGEOMObject._retn();
308 return GetObject(anObject);
311 //=============================================================================
313 * MakeConePntVecR1R2H
315 //=============================================================================
316 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeConePntVecR1R2H
317 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
318 CORBA::Double theR1, CORBA::Double theR2, CORBA::Double theH)
320 GEOM::GEOM_Object_var aGEOMObject;
322 //Set a not done flag
323 GetOperations()->SetNotDone();
325 //Get the reference points
326 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
327 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
329 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
332 Handle(GEOM_Object) anObject =
333 GetOperations()->MakeConePntVecR1R2H(aPnt, aVec, theR1, theR2, theH);
334 if (!GetOperations()->IsDone() || anObject.IsNull())
335 return aGEOMObject._retn();
337 return GetObject(anObject);
340 //=============================================================================
344 //=============================================================================
345 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeSphereR (CORBA::Double theR)
347 GEOM::GEOM_Object_var aGEOMObject;
349 //Set a not done flag
350 GetOperations()->SetNotDone();
353 Handle(GEOM_Object) anObject = GetOperations()->MakeSphereR(theR);
354 if (!GetOperations()->IsDone() || anObject.IsNull())
355 return aGEOMObject._retn();
357 return GetObject(anObject);
360 //=============================================================================
364 //=============================================================================
365 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeSpherePntR
366 (GEOM::GEOM_Object_ptr thePnt, CORBA::Double theR)
368 GEOM::GEOM_Object_var aGEOMObject;
370 //Set a not done flag
371 GetOperations()->SetNotDone();
373 //Get the reference point
374 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
376 if (aPnt.IsNull()) return aGEOMObject._retn();
379 Handle(GEOM_Object) anObject =
380 GetOperations()->MakeSpherePntR(aPnt, theR);
381 if (!GetOperations()->IsDone() || anObject.IsNull())
382 return aGEOMObject._retn();
384 return GetObject(anObject);
387 //=============================================================================
391 //=============================================================================
392 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeTorusRR
393 (CORBA::Double theRMajor, CORBA::Double theRMinor)
395 GEOM::GEOM_Object_var aGEOMObject;
397 //Set a not done flag
398 GetOperations()->SetNotDone();
401 Handle(GEOM_Object) anObject =
402 GetOperations()->MakeTorusRR(theRMajor, theRMinor);
403 if (!GetOperations()->IsDone() || anObject.IsNull())
404 return aGEOMObject._retn();
406 return GetObject(anObject);
409 //=============================================================================
413 //=============================================================================
414 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeTorusPntVecRR
415 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
416 CORBA::Double theRMajor, CORBA::Double theRMinor)
418 GEOM::GEOM_Object_var aGEOMObject;
420 //Set a not done flag
421 GetOperations()->SetNotDone();
423 //Get the reference points
424 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
425 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
427 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
430 Handle(GEOM_Object) anObject =
431 GetOperations()->MakeTorusPntVecRR(aPnt, aVec, theRMajor, theRMinor);
432 if (!GetOperations()->IsDone() || anObject.IsNull())
433 return aGEOMObject._retn();
435 return GetObject(anObject);
438 //=============================================================================
442 //=============================================================================
443 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH
444 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theVec,
447 GEOM::GEOM_Object_var aGEOMObject;
449 //Set a not done flag
450 GetOperations()->SetNotDone();
452 //Get the reference objects
453 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
454 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
456 if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
459 Handle(GEOM_Object) anObject =
460 GetOperations()->MakePrismVecH(aBase, aVec, theH);
461 if (!GetOperations()->IsDone() || anObject.IsNull())
462 return aGEOMObject._retn();
464 return GetObject(anObject);
467 //=============================================================================
471 //=============================================================================
472 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH2Ways
473 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theVec,
476 GEOM::GEOM_Object_var aGEOMObject;
478 //Set a not done flag
479 GetOperations()->SetNotDone();
481 //Get the reference objects
482 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
483 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
485 if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
488 Handle(GEOM_Object) anObject =
489 GetOperations()->MakePrismVecH2Ways(aBase, aVec, theH);
490 if (!GetOperations()->IsDone() || anObject.IsNull())
491 return aGEOMObject._retn();
493 return GetObject(anObject);
496 //=============================================================================
500 //=============================================================================
501 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecHWithScaling
502 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theVec,
503 CORBA::Double theH, CORBA::Double theScaleFactor)
505 GEOM::GEOM_Object_var aGEOMObject;
507 //Set a not done flag
508 GetOperations()->SetNotDone();
510 //Get the reference objects
511 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
512 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
514 if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
517 Handle(GEOM_Object) anObject =
518 GetOperations()->MakePrismVecH(aBase, aVec, theH, theScaleFactor);
519 if (!GetOperations()->IsDone() || anObject.IsNull())
520 return aGEOMObject._retn();
522 return GetObject(anObject);
525 //=============================================================================
529 //=============================================================================
530 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt
531 (GEOM::GEOM_Object_ptr theBase,
532 GEOM::GEOM_Object_ptr thePoint1,
533 GEOM::GEOM_Object_ptr thePoint2)
535 GEOM::GEOM_Object_var aGEOMObject;
537 //Set a not done flag
538 GetOperations()->SetNotDone();
540 //Get the reference objects
541 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
542 Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
543 Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
545 if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
546 return aGEOMObject._retn();
549 Handle(GEOM_Object) anObject =
550 GetOperations()->MakePrismTwoPnt(aBase, aPoint1, aPoint2);
551 if (!GetOperations()->IsDone() || anObject.IsNull())
552 return aGEOMObject._retn();
554 return GetObject(anObject);
557 //=============================================================================
559 * MakePrismTwoPnt2Ways
561 //=============================================================================
562 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt2Ways
563 (GEOM::GEOM_Object_ptr theBase,
564 GEOM::GEOM_Object_ptr thePoint1,
565 GEOM::GEOM_Object_ptr thePoint2)
567 GEOM::GEOM_Object_var aGEOMObject;
569 //Set a not done flag
570 GetOperations()->SetNotDone();
572 //Get the reference objects
573 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
574 Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
575 Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
577 if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
578 return aGEOMObject._retn();
581 Handle(GEOM_Object) anObject =
582 GetOperations()->MakePrismTwoPnt2Ways(aBase, aPoint1, aPoint2);
583 if (!GetOperations()->IsDone() || anObject.IsNull())
584 return aGEOMObject._retn();
586 return GetObject(anObject);
589 //=============================================================================
593 //=============================================================================
594 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPntWithScaling
595 (GEOM::GEOM_Object_ptr theBase,
596 GEOM::GEOM_Object_ptr thePoint1,
597 GEOM::GEOM_Object_ptr thePoint2,
598 CORBA::Double theScaleFactor)
600 GEOM::GEOM_Object_var aGEOMObject;
602 //Set a not done flag
603 GetOperations()->SetNotDone();
605 //Get the reference objects
606 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
607 Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
608 Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
610 if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
611 return aGEOMObject._retn();
614 Handle(GEOM_Object) anObject =
615 GetOperations()->MakePrismTwoPnt(aBase, aPoint1, aPoint2, theScaleFactor);
616 if (!GetOperations()->IsDone() || anObject.IsNull())
617 return aGEOMObject._retn();
619 return GetObject(anObject);
622 //=============================================================================
626 //=============================================================================
627 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ
628 (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
629 CORBA::Double theDY, CORBA::Double theDZ)
631 GEOM::GEOM_Object_var aGEOMObject;
633 //Set a not done flag
634 GetOperations()->SetNotDone();
636 //Get the reference objects
637 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
639 if (aBase.IsNull()) return aGEOMObject._retn();
642 Handle(GEOM_Object) anObject =
643 GetOperations()->MakePrismDXDYDZ(aBase, theDX, theDY, theDZ);
644 if (!GetOperations()->IsDone() || anObject.IsNull())
645 return aGEOMObject._retn();
647 return GetObject(anObject);
650 //=============================================================================
652 * MakePrismDXDYDZ2Ways
654 //=============================================================================
655 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ2Ways
656 (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
657 CORBA::Double theDY, CORBA::Double theDZ)
659 GEOM::GEOM_Object_var aGEOMObject;
661 //Set a not done flag
662 GetOperations()->SetNotDone();
664 //Get the reference objects
665 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
667 if (aBase.IsNull()) return aGEOMObject._retn();
670 Handle(GEOM_Object) anObject =
671 GetOperations()->MakePrismDXDYDZ2Ways(aBase, theDX, theDY, theDZ);
672 if (!GetOperations()->IsDone() || anObject.IsNull())
673 return aGEOMObject._retn();
675 return GetObject(anObject);
678 //=============================================================================
682 //=============================================================================
683 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZWithScaling
684 (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
685 CORBA::Double theDY, CORBA::Double theDZ,
686 CORBA::Double theScaleFactor)
688 GEOM::GEOM_Object_var aGEOMObject;
690 //Set a not done flag
691 GetOperations()->SetNotDone();
693 //Get the reference objects
694 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
696 if (aBase.IsNull()) return aGEOMObject._retn();
699 Handle(GEOM_Object) anObject =
700 GetOperations()->MakePrismDXDYDZ(aBase, theDX, theDY, theDZ, theScaleFactor);
701 if (!GetOperations()->IsDone() || anObject.IsNull())
702 return aGEOMObject._retn();
704 return GetObject(anObject);
707 //=============================================================================
711 //=============================================================================
712 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipe
713 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr thePath)
715 GEOM::GEOM_Object_var aGEOMObject;
717 //Set a not done flag
718 GetOperations()->SetNotDone();
720 //Get the reference objects
721 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
722 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
724 if (aBase.IsNull() || aPath.IsNull()) return aGEOMObject._retn();
727 Handle(GEOM_Object) anObject =
728 GetOperations()->MakePipe(aBase, aPath);
729 if (!GetOperations()->IsDone() || anObject.IsNull())
730 return aGEOMObject._retn();
732 return GetObject(anObject);
735 //=============================================================================
737 * MakeRevolutionAxisAngle
739 //=============================================================================
740 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle
741 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theAxis,
742 CORBA::Double theAngle)
744 GEOM::GEOM_Object_var aGEOMObject;
746 //Set a not done flag
747 GetOperations()->SetNotDone();
749 //Get the reference objects
750 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
751 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
753 if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
755 //Create the Revolution
756 Handle(GEOM_Object) anObject =
757 GetOperations()->MakeRevolutionAxisAngle(aBase, anAxis, theAngle);
758 if (!GetOperations()->IsDone() || anObject.IsNull())
759 return aGEOMObject._retn();
761 return GetObject(anObject);
764 //=============================================================================
766 * MakeRevolutionAxisAngle2Ways
768 //=============================================================================
769 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle2Ways
770 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theAxis,
771 CORBA::Double theAngle)
773 GEOM::GEOM_Object_var aGEOMObject;
775 //Set a not done flag
776 GetOperations()->SetNotDone();
778 //Get the reference objects
779 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
780 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
782 if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
784 //Create the Revolution
785 Handle(GEOM_Object) anObject =
786 GetOperations()->MakeRevolutionAxisAngle2Ways(aBase, anAxis, theAngle);
787 if (!GetOperations()->IsDone() || anObject.IsNull())
788 return aGEOMObject._retn();
790 return GetObject(anObject);
793 //=============================================================================
797 //=============================================================================
798 GEOM::GEOM_Object_ptr
799 GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_ptr theShape,
800 CORBA::Long theMinDeg,
801 CORBA::Long theMaxDeg,
802 CORBA::Double theTol2D,
803 CORBA::Double theTol3D,
804 CORBA::Long theNbIter,
805 GEOM::filling_oper_method theMethod,
806 CORBA::Boolean theApprox)
808 GEOM::GEOM_Object_var aGEOMObject;
810 //Set a not done flag
811 GetOperations()->SetNotDone();
813 //Get the reference objects
814 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
816 if (aShape.IsNull()) return aGEOMObject._retn();
820 case GEOM::FOM_Default:
822 // Default (standard behaviour)
826 case GEOM::FOM_UseOri:
828 // Use edges orientation
832 case GEOM::FOM_AutoCorrect:
834 // Auto-correct edges orientation
843 Handle(GEOM_Object) anObject = GetOperations()->MakeFilling
844 (aShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter,
846 if (!GetOperations()->IsDone() || anObject.IsNull())
847 return aGEOMObject._retn();
849 return GetObject(anObject);
852 //=============================================================================
856 //=============================================================================
857 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThruSections(const GEOM::ListOfGO& theSeqSections,
858 CORBA::Boolean theModeSolid,
859 CORBA::Double thePreci,
860 CORBA::Boolean theRuled)
862 GEOM::GEOM_Object_var aGEOMObject;
864 //Set a not done flag
865 GetOperations()->SetNotDone();
866 Handle(TColStd_HSequenceOfTransient) aSeqSections = new TColStd_HSequenceOfTransient;
870 aLen = theSeqSections.length();
871 for (ind = 0; ind < aLen; ind++) {
872 Handle(GEOM_Object) aSh = GetObjectImpl(theSeqSections[ind]);
874 aSeqSections->Append(aSh);
876 if (!aSeqSections->Length())
877 return aGEOMObject._retn();
879 // Make shell or solid
880 Handle(GEOM_Object) anObject =
881 GetOperations()->MakeThruSections(aSeqSections,theModeSolid,thePreci,theRuled);
882 if (!GetOperations()->IsDone() || anObject.IsNull())
883 return aGEOMObject._retn();
885 return GetObject(anObject);
888 //=============================================================================
890 * MakePipeWithDifferentSections
892 //=============================================================================
893 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
894 (const GEOM::ListOfGO& theBases,
895 const GEOM::ListOfGO& theLocations,
896 GEOM::GEOM_Object_ptr thePath,
897 CORBA::Boolean theWithContact,
898 CORBA::Boolean theWithCorrections)
900 GEOM::GEOM_Object_var aGEOMObject;
902 //Set a not done flag
903 GetOperations()->SetNotDone();
904 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
905 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
906 int ind=0, aNbBases =0,aNbLocs=0;
909 aNbBases = theBases.length();
910 aNbLocs = theLocations.length();
912 if (aNbLocs && aNbBases != aNbLocs)
913 return aGEOMObject._retn();
915 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
917 return aGEOMObject._retn();
919 for (ind = 0; ind < aNbBases; ind++) {
920 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
925 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
928 aSeqLocations->Append(aLoc);
930 aSeqBases->Append(aBase);
932 if (!aSeqBases->Length())
933 return aGEOMObject._retn();
936 Handle(GEOM_Object) anObject =
937 GetOperations()->MakePipeWithDifferentSections(aSeqBases,aSeqLocations ,aPath,
938 theWithContact,theWithCorrections);
939 if (!GetOperations()->IsDone() || anObject.IsNull())
940 return aGEOMObject._retn();
942 return GetObject(anObject);
946 //=============================================================================
948 * MakePipeWithShellSections
950 //=============================================================================
951 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
952 (const GEOM::ListOfGO& theBases,
953 const GEOM::ListOfGO& theSubBases,
954 const GEOM::ListOfGO& theLocations,
955 GEOM::GEOM_Object_ptr thePath,
956 CORBA::Boolean theWithContact,
957 CORBA::Boolean theWithCorrections)
959 GEOM::GEOM_Object_var aGEOMObject;
961 //Set a not done flag
962 GetOperations()->SetNotDone();
963 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
964 Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient;
965 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
966 int ind=0, aNbBases=0, aNbSubBases=0, aNbLocs=0;
969 aNbBases = theBases.length();
970 aNbSubBases = theSubBases.length();
971 aNbLocs = theLocations.length();
973 if (aNbLocs && aNbBases != aNbLocs)
974 return aGEOMObject._retn();
976 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
978 return aGEOMObject._retn();
980 for (ind = 0; ind < aNbBases; ind++) {
981 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
985 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
988 aSeqLocations->Append(aLoc);
990 aSeqBases->Append(aBase);
992 if (aNbSubBases >= aNbBases) {
993 Handle(GEOM_Object) aSubBase = GetObjectImpl(theSubBases[ind]);
994 if (aSubBase.IsNull()) {
995 aSeqSubBases->Clear();
999 aSeqSubBases->Append(aSubBase);
1002 if (!aSeqBases->Length())
1003 return aGEOMObject._retn();
1006 Handle(GEOM_Object) anObject =
1007 GetOperations()->MakePipeWithShellSections(aSeqBases, aSeqSubBases,
1008 aSeqLocations, aPath,
1009 theWithContact, theWithCorrections);
1010 if (!GetOperations()->IsDone() || anObject.IsNull())
1011 return aGEOMObject._retn();
1013 return GetObject(anObject);
1017 //=============================================================================
1019 * MakePipeShellsWithoutPath
1021 //=============================================================================
1022 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
1023 (const GEOM::ListOfGO& theBases,
1024 const GEOM::ListOfGO& theLocations)
1026 GEOM::GEOM_Object_var aGEOMObject;
1028 //Set a not done flag
1029 GetOperations()->SetNotDone();
1030 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
1031 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
1032 int ind=0, aNbBases=0, aNbLocs=0;
1035 aNbBases = theBases.length();
1036 aNbLocs = theLocations.length();
1038 if (aNbLocs && aNbBases != aNbLocs)
1039 return aGEOMObject._retn();
1041 for (ind = 0; ind < aNbBases; ind++) {
1042 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
1046 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
1049 aSeqLocations->Append(aLoc);
1051 aSeqBases->Append(aBase);
1054 if (!aSeqBases->Length())
1055 return aGEOMObject._retn();
1058 Handle(GEOM_Object) anObject =
1059 GetOperations()->MakePipeShellsWithoutPath(aSeqBases,aSeqLocations);
1061 if (!GetOperations()->IsDone() || anObject.IsNull())
1062 return aGEOMObject._retn();
1064 return GetObject(anObject);
1068 //=============================================================================
1070 * MakePipeBiNormalAlongVector
1072 //=============================================================================
1073 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
1074 (GEOM::GEOM_Object_ptr theBase,
1075 GEOM::GEOM_Object_ptr thePath,
1076 GEOM::GEOM_Object_ptr theVec)
1078 GEOM::GEOM_Object_var aGEOMObject;
1080 //Set a not done flag
1081 GetOperations()->SetNotDone();
1083 //Get the reference objects
1084 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
1085 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
1086 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
1088 if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
1091 Handle(GEOM_Object) anObject =
1092 GetOperations()->MakePipeBiNormalAlongVector(aBase, aPath, aVec);
1093 if (!GetOperations()->IsDone() || anObject.IsNull())
1094 return aGEOMObject._retn();
1096 return GetObject(anObject);