1 // Copyright (C) 2007-2012 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::MakePrismVecHWithScaling
503 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theVec,
504 CORBA::Double theH, CORBA::Double theScaleFactor)
506 GEOM::GEOM_Object_var aGEOMObject;
508 //Set a not done flag
509 GetOperations()->SetNotDone();
511 //Get the reference objects
512 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
513 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
515 if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
518 Handle(GEOM_Object) anObject =
519 GetOperations()->MakePrismVecH(aBase, aVec, theH, theScaleFactor);
520 if (!GetOperations()->IsDone() || anObject.IsNull())
521 return aGEOMObject._retn();
523 return GetObject(anObject);
526 //=============================================================================
530 //=============================================================================
531 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt
532 (GEOM::GEOM_Object_ptr theBase,
533 GEOM::GEOM_Object_ptr thePoint1,
534 GEOM::GEOM_Object_ptr thePoint2)
536 GEOM::GEOM_Object_var aGEOMObject;
538 //Set a not done flag
539 GetOperations()->SetNotDone();
541 //Get the reference objects
542 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
543 Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
544 Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
546 if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
547 return aGEOMObject._retn();
550 Handle(GEOM_Object) anObject =
551 GetOperations()->MakePrismTwoPnt(aBase, aPoint1, aPoint2);
552 if (!GetOperations()->IsDone() || anObject.IsNull())
553 return aGEOMObject._retn();
555 return GetObject(anObject);
558 //=============================================================================
560 * MakePrismTwoPnt2Ways
562 //=============================================================================
563 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt2Ways
564 (GEOM::GEOM_Object_ptr theBase,
565 GEOM::GEOM_Object_ptr thePoint1,
566 GEOM::GEOM_Object_ptr thePoint2)
568 GEOM::GEOM_Object_var aGEOMObject;
570 //Set a not done flag
571 GetOperations()->SetNotDone();
573 //Get the reference objects
574 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
575 Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
576 Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
578 if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
579 return aGEOMObject._retn();
582 Handle(GEOM_Object) anObject =
583 GetOperations()->MakePrismTwoPnt2Ways(aBase, aPoint1, aPoint2);
584 if (!GetOperations()->IsDone() || anObject.IsNull())
585 return aGEOMObject._retn();
587 return GetObject(anObject);
590 //=============================================================================
594 //=============================================================================
595 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPntWithScaling
596 (GEOM::GEOM_Object_ptr theBase,
597 GEOM::GEOM_Object_ptr thePoint1,
598 GEOM::GEOM_Object_ptr thePoint2,
599 CORBA::Double theScaleFactor)
601 GEOM::GEOM_Object_var aGEOMObject;
603 //Set a not done flag
604 GetOperations()->SetNotDone();
606 //Get the reference objects
607 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
608 Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
609 Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
611 if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
612 return aGEOMObject._retn();
615 Handle(GEOM_Object) anObject =
616 GetOperations()->MakePrismTwoPnt(aBase, aPoint1, aPoint2, theScaleFactor);
617 if (!GetOperations()->IsDone() || anObject.IsNull())
618 return aGEOMObject._retn();
620 return GetObject(anObject);
623 //=============================================================================
627 //=============================================================================
628 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ
629 (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
630 CORBA::Double theDY, CORBA::Double theDZ)
632 GEOM::GEOM_Object_var aGEOMObject;
634 //Set a not done flag
635 GetOperations()->SetNotDone();
637 //Get the reference objects
638 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
640 if (aBase.IsNull()) return aGEOMObject._retn();
643 Handle(GEOM_Object) anObject =
644 GetOperations()->MakePrismDXDYDZ(aBase, theDX, theDY, theDZ);
645 if (!GetOperations()->IsDone() || anObject.IsNull())
646 return aGEOMObject._retn();
648 return GetObject(anObject);
651 //=============================================================================
653 * MakePrismDXDYDZ2Ways
655 //=============================================================================
656 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ2Ways
657 (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
658 CORBA::Double theDY, CORBA::Double theDZ)
660 GEOM::GEOM_Object_var aGEOMObject;
662 //Set a not done flag
663 GetOperations()->SetNotDone();
665 //Get the reference objects
666 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
668 if (aBase.IsNull()) return aGEOMObject._retn();
671 Handle(GEOM_Object) anObject =
672 GetOperations()->MakePrismDXDYDZ2Ways(aBase, theDX, theDY, theDZ);
673 if (!GetOperations()->IsDone() || anObject.IsNull())
674 return aGEOMObject._retn();
676 return GetObject(anObject);
679 //=============================================================================
683 //=============================================================================
684 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZWithScaling
685 (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
686 CORBA::Double theDY, CORBA::Double theDZ,
687 CORBA::Double theScaleFactor)
689 GEOM::GEOM_Object_var aGEOMObject;
691 //Set a not done flag
692 GetOperations()->SetNotDone();
694 //Get the reference objects
695 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
697 if (aBase.IsNull()) return aGEOMObject._retn();
700 Handle(GEOM_Object) anObject =
701 GetOperations()->MakePrismDXDYDZ(aBase, theDX, theDY, theDZ, theScaleFactor);
702 if (!GetOperations()->IsDone() || anObject.IsNull())
703 return aGEOMObject._retn();
705 return GetObject(anObject);
708 //=============================================================================
712 //=============================================================================
713 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDraftPrism
714 (GEOM::GEOM_Object_ptr theInitShape, GEOM::GEOM_Object_ptr theBase,
715 CORBA::Double theHeight,
716 CORBA::Double theAngle,
717 CORBA::Boolean theFuse)
719 GEOM::GEOM_Object_var aGEOMObject;
721 //Set a not done flag
722 GetOperations()->SetNotDone();
724 //Get the reference objects
725 Handle(GEOM_Object) aInit = GetObjectImpl(theInitShape);
726 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
728 if (aBase.IsNull() || aInit.IsNull()) return aGEOMObject._retn();
731 Handle(GEOM_Object) anObject = GetOperations()->MakeDraftPrism(aInit, aBase, theHeight, theAngle, theFuse);
733 if (!GetOperations()->IsDone() || anObject.IsNull())
734 return aGEOMObject._retn();
736 return GetObject(anObject);
739 //=============================================================================
743 //=============================================================================
744 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipe
745 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr thePath)
747 GEOM::GEOM_Object_var aGEOMObject;
749 //Set a not done flag
750 GetOperations()->SetNotDone();
752 //Get the reference objects
753 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
754 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
756 if (aBase.IsNull() || aPath.IsNull()) return aGEOMObject._retn();
759 Handle(GEOM_Object) anObject =
760 GetOperations()->MakePipe(aBase, aPath);
761 if (!GetOperations()->IsDone() || anObject.IsNull())
762 return aGEOMObject._retn();
764 return GetObject(anObject);
767 //=============================================================================
769 * MakeRevolutionAxisAngle
771 //=============================================================================
772 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle
773 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theAxis,
774 CORBA::Double theAngle)
776 GEOM::GEOM_Object_var aGEOMObject;
778 //Set a not done flag
779 GetOperations()->SetNotDone();
781 //Get the reference objects
782 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
783 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
785 if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
787 //Create the Revolution
788 Handle(GEOM_Object) anObject =
789 GetOperations()->MakeRevolutionAxisAngle(aBase, anAxis, theAngle);
790 if (!GetOperations()->IsDone() || anObject.IsNull())
791 return aGEOMObject._retn();
793 return GetObject(anObject);
796 //=============================================================================
798 * MakeRevolutionAxisAngle2Ways
800 //=============================================================================
801 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle2Ways
802 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theAxis,
803 CORBA::Double theAngle)
805 GEOM::GEOM_Object_var aGEOMObject;
807 //Set a not done flag
808 GetOperations()->SetNotDone();
810 //Get the reference objects
811 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
812 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
814 if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
816 //Create the Revolution
817 Handle(GEOM_Object) anObject =
818 GetOperations()->MakeRevolutionAxisAngle2Ways(aBase, anAxis, theAngle);
819 if (!GetOperations()->IsDone() || anObject.IsNull())
820 return aGEOMObject._retn();
822 return GetObject(anObject);
825 //=============================================================================
829 //=============================================================================
830 GEOM::GEOM_Object_ptr
831 GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_ptr theShape,
832 CORBA::Long theMinDeg,
833 CORBA::Long theMaxDeg,
834 CORBA::Double theTol2D,
835 CORBA::Double theTol3D,
836 CORBA::Long theNbIter,
837 GEOM::filling_oper_method theMethod,
838 CORBA::Boolean theApprox)
840 GEOM::GEOM_Object_var aGEOMObject;
842 //Set a not done flag
843 GetOperations()->SetNotDone();
845 //Get the reference objects
846 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
848 if (aShape.IsNull()) return aGEOMObject._retn();
852 case GEOM::FOM_Default:
854 // Default (standard behaviour)
858 case GEOM::FOM_UseOri:
860 // Use edges orientation
864 case GEOM::FOM_AutoCorrect:
866 // Auto-correct edges orientation
875 Handle(GEOM_Object) anObject = GetOperations()->MakeFilling
876 (aShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter,
878 if (!GetOperations()->IsDone() || anObject.IsNull())
879 return aGEOMObject._retn();
881 return GetObject(anObject);
884 //=============================================================================
888 //=============================================================================
889 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThruSections(const GEOM::ListOfGO& theSeqSections,
890 CORBA::Boolean theModeSolid,
891 CORBA::Double thePreci,
892 CORBA::Boolean theRuled)
894 GEOM::GEOM_Object_var aGEOMObject;
896 //Set a not done flag
897 GetOperations()->SetNotDone();
898 Handle(TColStd_HSequenceOfTransient) aSeqSections = new TColStd_HSequenceOfTransient;
902 aLen = theSeqSections.length();
903 for (ind = 0; ind < aLen; ind++) {
904 Handle(GEOM_Object) aSh = GetObjectImpl(theSeqSections[ind]);
906 aSeqSections->Append(aSh);
908 if (!aSeqSections->Length())
909 return aGEOMObject._retn();
911 // Make shell or solid
912 Handle(GEOM_Object) anObject =
913 GetOperations()->MakeThruSections(aSeqSections,theModeSolid,thePreci,theRuled);
914 if (!GetOperations()->IsDone() || anObject.IsNull())
915 return aGEOMObject._retn();
917 return GetObject(anObject);
920 //=============================================================================
922 * MakePipeWithDifferentSections
924 //=============================================================================
925 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
926 (const GEOM::ListOfGO& theBases,
927 const GEOM::ListOfGO& theLocations,
928 GEOM::GEOM_Object_ptr thePath,
929 CORBA::Boolean theWithContact,
930 CORBA::Boolean theWithCorrections)
932 GEOM::GEOM_Object_var aGEOMObject;
934 //Set a not done flag
935 GetOperations()->SetNotDone();
936 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
937 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
938 int ind=0, aNbBases =0,aNbLocs=0;
941 aNbBases = theBases.length();
942 aNbLocs = theLocations.length();
944 if (aNbLocs && aNbBases != aNbLocs)
945 return aGEOMObject._retn();
947 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
949 return aGEOMObject._retn();
951 for (ind = 0; ind < aNbBases; ind++) {
952 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
957 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
960 aSeqLocations->Append(aLoc);
962 aSeqBases->Append(aBase);
964 if (!aSeqBases->Length())
965 return aGEOMObject._retn();
968 Handle(GEOM_Object) anObject =
969 GetOperations()->MakePipeWithDifferentSections(aSeqBases,aSeqLocations ,aPath,
970 theWithContact,theWithCorrections);
971 if (!GetOperations()->IsDone() || anObject.IsNull())
972 return aGEOMObject._retn();
974 return GetObject(anObject);
978 //=============================================================================
980 * MakePipeWithShellSections
982 //=============================================================================
983 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
984 (const GEOM::ListOfGO& theBases,
985 const GEOM::ListOfGO& theSubBases,
986 const GEOM::ListOfGO& theLocations,
987 GEOM::GEOM_Object_ptr thePath,
988 CORBA::Boolean theWithContact,
989 CORBA::Boolean theWithCorrections)
991 GEOM::GEOM_Object_var aGEOMObject;
993 //Set a not done flag
994 GetOperations()->SetNotDone();
995 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
996 Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient;
997 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
998 int ind=0, aNbBases=0, aNbSubBases=0, aNbLocs=0;
1001 aNbBases = theBases.length();
1002 aNbSubBases = theSubBases.length();
1003 aNbLocs = theLocations.length();
1005 if (aNbLocs && aNbBases != aNbLocs)
1006 return aGEOMObject._retn();
1008 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
1010 return aGEOMObject._retn();
1012 for (ind = 0; ind < aNbBases; ind++) {
1013 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
1017 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
1020 aSeqLocations->Append(aLoc);
1022 aSeqBases->Append(aBase);
1024 if (aNbSubBases >= aNbBases) {
1025 Handle(GEOM_Object) aSubBase = GetObjectImpl(theSubBases[ind]);
1026 if (aSubBase.IsNull()) {
1027 aSeqSubBases->Clear();
1031 aSeqSubBases->Append(aSubBase);
1034 if (!aSeqBases->Length())
1035 return aGEOMObject._retn();
1038 Handle(GEOM_Object) anObject =
1039 GetOperations()->MakePipeWithShellSections(aSeqBases, aSeqSubBases,
1040 aSeqLocations, aPath,
1041 theWithContact, theWithCorrections);
1042 if (!GetOperations()->IsDone() || anObject.IsNull())
1043 return aGEOMObject._retn();
1045 return GetObject(anObject);
1049 //=============================================================================
1051 * MakePipeShellsWithoutPath
1053 //=============================================================================
1054 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
1055 (const GEOM::ListOfGO& theBases,
1056 const GEOM::ListOfGO& theLocations)
1058 GEOM::GEOM_Object_var aGEOMObject;
1060 //Set a not done flag
1061 GetOperations()->SetNotDone();
1062 Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
1063 Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
1064 int ind=0, aNbBases=0, aNbLocs=0;
1067 aNbBases = theBases.length();
1068 aNbLocs = theLocations.length();
1070 if (aNbLocs && aNbBases != aNbLocs)
1071 return aGEOMObject._retn();
1073 for (ind = 0; ind < aNbBases; ind++) {
1074 Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
1078 Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
1081 aSeqLocations->Append(aLoc);
1083 aSeqBases->Append(aBase);
1086 if (!aSeqBases->Length())
1087 return aGEOMObject._retn();
1090 Handle(GEOM_Object) anObject =
1091 GetOperations()->MakePipeShellsWithoutPath(aSeqBases,aSeqLocations);
1093 if (!GetOperations()->IsDone() || anObject.IsNull())
1094 return aGEOMObject._retn();
1096 return GetObject(anObject);
1100 //=============================================================================
1102 * MakePipeBiNormalAlongVector
1104 //=============================================================================
1105 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
1106 (GEOM::GEOM_Object_ptr theBase,
1107 GEOM::GEOM_Object_ptr thePath,
1108 GEOM::GEOM_Object_ptr theVec)
1110 GEOM::GEOM_Object_var aGEOMObject;
1112 //Set a not done flag
1113 GetOperations()->SetNotDone();
1115 //Get the reference objects
1116 Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
1117 Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
1118 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
1120 if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
1123 Handle(GEOM_Object) anObject =
1124 GetOperations()->MakePipeBiNormalAlongVector(aBase, aPath, aVec);
1125 if (!GetOperations()->IsDone() || anObject.IsNull())
1126 return aGEOMObject._retn();
1128 return GetObject(anObject);