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_IShapesOperations_i.hh"
26 #include "utilities.h"
28 #include "Utils_ExceptHandlers.hxx"
30 #include "GEOM_Engine.hxx"
31 #include "GEOM_Object.hxx"
34 #include <TColStd_HSequenceOfTransient.hxx>
35 #include <TColStd_HArray1OfInteger.hxx>
37 //=============================================================================
41 //=============================================================================
42 GEOM_IShapesOperations_i::GEOM_IShapesOperations_i (PortableServer::POA_ptr thePOA,
43 GEOM::GEOM_Gen_ptr theEngine,
44 ::GEOMImpl_IShapesOperations* theImpl)
45 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
47 MESSAGE("GEOM_IShapesOperations_i::GEOM_IShapesOperations_i");
50 //=============================================================================
54 //=============================================================================
55 GEOM_IShapesOperations_i::~GEOM_IShapesOperations_i()
57 MESSAGE("GEOM_IShapesOperations_i::~GEOM_IShapesOperations_i");
61 //=============================================================================
65 //=============================================================================
66 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdge
67 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
69 GEOM::GEOM_Object_var aGEOMObject;
72 GetOperations()->SetNotDone();
74 //Get the reference points
75 Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
76 Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
78 if (aPnt1.IsNull() || aPnt2.IsNull()) return aGEOMObject._retn();
81 Handle(GEOM_Object) anObject = GetOperations()->MakeEdge(aPnt1, aPnt2);
82 if (!GetOperations()->IsDone() || anObject.IsNull())
83 return aGEOMObject._retn();
85 return GetObject(anObject);
88 //=============================================================================
92 //=============================================================================
93 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire
94 (const GEOM::ListOfGO& theEdgesAndWires,
95 const CORBA::Double theTolerance)
97 GEOM::GEOM_Object_var aGEOMObject;
100 GetOperations()->SetNotDone();
103 std::list<Handle(GEOM_Object)> aShapes;
106 aLen = theEdgesAndWires.length();
107 for (ind = 0; ind < aLen; ind++) {
108 Handle(GEOM_Object) aSh = GetObjectImpl(theEdgesAndWires[ind]);
109 if (aSh.IsNull()) return aGEOMObject._retn();
110 aShapes.push_back(aSh);
114 Handle(GEOM_Object) anObject =
115 GetOperations()->MakeWire(aShapes, theTolerance);
116 if (!GetOperations()->IsDone() || anObject.IsNull())
117 return aGEOMObject._retn();
119 return GetObject(anObject);
122 //=============================================================================
126 //=============================================================================
127 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFace
128 (GEOM::GEOM_Object_ptr theWire,
129 const CORBA::Boolean isPlanarWanted)
131 GEOM::GEOM_Object_var aGEOMObject;
133 //Set a not done flag
134 GetOperations()->SetNotDone();
136 //Get the reference wire
137 Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
138 if (aWire.IsNull()) return aGEOMObject._retn();
141 Handle(GEOM_Object) anObject = GetOperations()->MakeFace(aWire, isPlanarWanted);
142 if (!GetOperations()->IsDone() || anObject.IsNull())
143 return aGEOMObject._retn();
145 return GetObject(anObject);
148 //=============================================================================
152 //=============================================================================
153 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWires
154 (const GEOM::ListOfGO& theWires,
155 const CORBA::Boolean isPlanarWanted)
157 GEOM::GEOM_Object_var aGEOMObject;
159 //Set a not done flag
160 GetOperations()->SetNotDone();
163 std::list<Handle(GEOM_Object)> aShapes;
166 aLen = theWires.length();
167 for (ind = 0; ind < aLen; ind++) {
168 Handle(GEOM_Object) aSh = GetObjectImpl(theWires[ind]);
169 if (aSh.IsNull()) return aGEOMObject._retn();
170 aShapes.push_back(aSh);
174 Handle(GEOM_Object) anObject =
175 GetOperations()->MakeFaceWires(aShapes, isPlanarWanted);
176 if (!GetOperations()->IsDone() || anObject.IsNull())
177 return aGEOMObject._retn();
179 return GetObject(anObject);
182 //=============================================================================
186 //=============================================================================
187 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeShell
188 (const GEOM::ListOfGO& theFacesAndShells)
190 GEOM::GEOM_Object_var aGEOMObject;
192 //Set a not done flag
193 GetOperations()->SetNotDone();
196 std::list<Handle(GEOM_Object)> aShapes;
199 aLen = theFacesAndShells.length();
200 for (ind = 0; ind < aLen; ind++) {
201 Handle(GEOM_Object) aSh = GetObjectImpl(theFacesAndShells[ind]);
202 if (aSh.IsNull()) return aGEOMObject._retn();
203 aShapes.push_back(aSh);
207 Handle(GEOM_Object) anObject =
208 GetOperations()->MakeShell(aShapes);
209 if (!GetOperations()->IsDone() || anObject.IsNull())
210 return aGEOMObject._retn();
212 return GetObject(anObject);
215 //=============================================================================
219 //=============================================================================
220 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShell
221 (GEOM::GEOM_Object_ptr theShell)
223 GEOM::GEOM_Object_var aGEOMObject;
225 //Set a not done flag
226 GetOperations()->SetNotDone();
228 //Get the reference objects
229 Handle(GEOM_Object) aShell = GetObjectImpl(theShell);
230 if (aShell.IsNull()) return aGEOMObject._retn();
233 Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShell(aShell);
234 if (!GetOperations()->IsDone() || anObject.IsNull())
235 return aGEOMObject._retn();
237 return GetObject(anObject);
240 //=============================================================================
244 //=============================================================================
245 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShells
246 (const GEOM::ListOfGO& theShells)
248 GEOM::GEOM_Object_var aGEOMObject;
250 //Set a not done flag
251 GetOperations()->SetNotDone();
254 std::list<Handle(GEOM_Object)> aShapes;
257 aLen = theShells.length();
258 for (ind = 0; ind < aLen; ind++) {
259 Handle(GEOM_Object) aSh = GetObjectImpl(theShells[ind]);
260 if (aSh.IsNull()) return aGEOMObject._retn();
261 aShapes.push_back(aSh);
265 Handle(GEOM_Object) anObject =
266 GetOperations()->MakeSolidShells(aShapes);
267 if (!GetOperations()->IsDone() || anObject.IsNull())
268 return aGEOMObject._retn();
270 return GetObject(anObject);
273 //=============================================================================
277 //=============================================================================
278 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
279 (const GEOM::ListOfGO& theShapes)
281 GEOM::GEOM_Object_var aGEOMObject;
283 //Set a not done flag
284 GetOperations()->SetNotDone();
287 std::list<Handle(GEOM_Object)> aShapes;
290 aLen = theShapes.length();
291 for (ind = 0; ind < aLen; ind++) {
292 Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
293 if (aSh.IsNull()) return aGEOMObject._retn();
294 aShapes.push_back(aSh);
298 Handle(GEOM_Object) anObject =
299 GetOperations()->MakeCompound(aShapes);
300 if (!GetOperations()->IsDone() || anObject.IsNull())
301 return aGEOMObject._retn();
303 return GetObject(anObject);
306 //=============================================================================
310 //=============================================================================
311 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
312 (GEOM::GEOM_Object_ptr theShape,
313 CORBA::Double theTolerance,
314 CORBA::Boolean doKeepNonSolids)
316 GEOM::GEOM_Object_var aGEOMObject;
318 //Set a not done flag
319 GetOperations()->SetNotDone();
321 //Get the reference objects
322 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
323 if (aShape.IsNull()) return aGEOMObject._retn();
326 Handle(GEOM_Object) anObject =
327 GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
328 //if (!GetOperations()->IsDone() || anObject.IsNull())
330 if (anObject.IsNull())
331 return aGEOMObject._retn();
333 return GetObject(anObject);
337 //=============================================================================
341 //=============================================================================
342 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
343 (GEOM::GEOM_Object_ptr theShape,
344 const CORBA::Double theTolerance)
346 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
348 //Set a not done flag
349 GetOperations()->SetNotDone();
351 //Get the reference objects
352 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
353 if (aShape.IsNull()) return aSeq._retn();
355 Handle(TColStd_HSequenceOfTransient) aHSeq =
356 GetOperations()->GetGlueFaces(aShape, theTolerance);
358 //if (!GetOperations()->IsDone() || aHSeq.IsNull())
363 Standard_Integer aLength = aHSeq->Length();
364 aSeq->length(aLength);
365 for (Standard_Integer i = 1; i <= aLength; i++)
366 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
372 //=============================================================================
374 * MakeGlueFacesByList
376 //=============================================================================
377 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
378 (GEOM::GEOM_Object_ptr theShape,
379 CORBA::Double theTolerance,
380 const GEOM::ListOfGO& theFaces,
381 CORBA::Boolean doKeepNonSolids)
383 GEOM::GEOM_Object_var aGEOMObject;
385 //Set a not done flag
386 GetOperations()->SetNotDone();
388 //Get the reference objects
389 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
390 if (aShape.IsNull()) return aGEOMObject._retn();
393 std::list<Handle(GEOM_Object)> aFaces;
395 aLen = theFaces.length();
396 for (ind = 0; ind < aLen; ind++) {
397 Handle(GEOM_Object) aSh = GetObjectImpl(theFaces[ind]);
398 if (aSh.IsNull()) return aGEOMObject._retn();
399 aFaces.push_back(aSh);
403 Handle(GEOM_Object) anObject =
404 GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces, doKeepNonSolids);
405 //if (!GetOperations()->IsDone() || anObject.IsNull())
407 if (anObject.IsNull())
408 return aGEOMObject._retn();
410 return GetObject(anObject);
413 //=============================================================================
415 * GetExistingSubObjects
417 //=============================================================================
418 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape,
419 CORBA::Boolean theGroupsOnly)
421 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
423 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
424 if (aShape.IsNull()) return aSeq._retn();
426 Handle(TColStd_HSequenceOfTransient) aHSeq =
427 GetOperations()->GetExistingSubObjects(aShape, theGroupsOnly);
428 if (!GetOperations()->IsDone() || aHSeq.IsNull())
431 Standard_Integer aLength = aHSeq->Length();
432 aSeq->length(aLength);
433 for (Standard_Integer i = 1; i <= aLength; i++)
434 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
439 //=============================================================================
443 //=============================================================================
444 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
445 const CORBA::Long theShapeType,
446 const CORBA::Boolean isSorted)
448 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
450 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
451 if (aShape.IsNull()) return aSeq._retn();
453 Handle(TColStd_HSequenceOfTransient) aHSeq =
454 GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
455 if (!GetOperations()->IsDone() || aHSeq.IsNull())
458 Standard_Integer aLength = aHSeq->Length();
459 aSeq->length(aLength);
460 for (Standard_Integer i = 1; i <= aLength; i++)
461 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
466 //=============================================================================
470 //=============================================================================
471 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
472 const CORBA::Long theShapeType,
473 const CORBA::Boolean isSorted)
475 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
477 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
478 if (aShape.IsNull()) return aSeq._retn();
480 Handle(TColStd_HSequenceOfInteger) aHSeq =
481 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
482 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
484 Standard_Integer aLength = aHSeq->Length();
485 aSeq->length(aLength);
486 for (Standard_Integer i = 1; i <= aLength; i++)
487 aSeq[i-1] = aHSeq->Value(i);
492 //=============================================================================
496 //=============================================================================
497 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
498 (GEOM::GEOM_Object_ptr theMainShape,
499 const CORBA::Long theID)
501 GEOM::GEOM_Object_var aGEOMObject;
503 //Set a not done flag
504 GetOperations()->SetNotDone();
506 //Get the reference objects
507 Handle(GEOM_Object) aShape = GetObjectImpl(theMainShape);
508 if (aShape.IsNull()) return aGEOMObject._retn();
510 Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
511 if (!GetOperations()->IsDone() || anObject.IsNull())
512 return aGEOMObject._retn();
514 return GetObject(anObject);
517 //=============================================================================
521 //=============================================================================
522 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
523 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
525 //Get the reference shapes
526 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
527 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
529 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
531 //Get the unique ID of <theSubShape> inside <theMainShape>
532 CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
533 if (!GetOperations()->IsDone())
539 //=============================================================================
543 //=============================================================================
544 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
545 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
547 //Get the reference shapes
548 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
549 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
551 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
553 //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
554 CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
555 if (!GetOperations()->IsDone())
561 //=============================================================================
565 //=============================================================================
566 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
568 //Get the reference shape
569 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
570 if (aShape.IsNull()) return NULL;
572 // Get shape parameters
573 TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
574 return CORBA::string_dup(aDescription.ToCString());
577 //=============================================================================
581 //=============================================================================
582 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
584 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_FACE));
587 //=============================================================================
591 //=============================================================================
592 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
594 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_EDGE));
597 //=============================================================================
601 //=============================================================================
602 CORBA::Long GEOM_IShapesOperations_i::NumberOfSubShapes (GEOM::GEOM_Object_ptr theShape,
603 const CORBA::Long theShapeType)
605 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
606 if (aShape.IsNull()) return -1;
608 CORBA::Long aNb = GetOperations()->NumberOfSubShapes(aShape, theShapeType);
609 if (!GetOperations()->IsDone()) return -1;
614 //=============================================================================
618 //=============================================================================
619 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
620 (GEOM::GEOM_Object_ptr theShape)
622 GEOM::GEOM_Object_var aGEOMObject;
624 //Set a not done flag
625 GetOperations()->SetNotDone();
627 //Get the reference objects
628 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
629 if (aShape.IsNull()) return aGEOMObject._retn();
632 Handle(GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
633 if (!GetOperations()->IsDone() || anObject.IsNull())
634 return aGEOMObject._retn();
636 return GetObject(anObject);
639 //=============================================================================
643 //=============================================================================
644 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
646 //Set a not done flag
647 GetOperations()->SetNotDone();
649 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
651 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
652 if (aShape.IsNull()) return aSeq._retn();
654 Handle(TColStd_HSequenceOfInteger) aHSeq =
655 GetOperations()->GetFreeFacesIDs(aShape);
656 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
658 Standard_Integer aLength = aHSeq->Length();
659 aSeq->length(aLength);
660 for (Standard_Integer i = 1; i <= aLength; i++)
661 aSeq[i-1] = aHSeq->Value(i);
666 //=============================================================================
670 //=============================================================================
671 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
672 (GEOM::GEOM_Object_ptr theShape1,
673 GEOM::GEOM_Object_ptr theShape2,
674 const CORBA::Long theShapeType)
676 //Set a not done flag
677 GetOperations()->SetNotDone();
679 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
681 Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
682 Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
684 if (aShape1.IsNull() || aShape2.IsNull()) return aSeq._retn();
686 Handle(TColStd_HSequenceOfTransient) aHSeq =
687 GetOperations()->GetSharedShapes(aShape1, aShape2, theShapeType);
688 if (!GetOperations()->IsDone() || aHSeq.IsNull())
691 Standard_Integer aLength = aHSeq->Length();
692 aSeq->length(aLength);
693 for (Standard_Integer i = 1; i <= aLength; i++)
694 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
699 static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
701 GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
705 aState = GEOMAlgo_ST_ON;
708 aState = GEOMAlgo_ST_OUT;
711 aState = GEOMAlgo_ST_ONOUT;
714 aState = GEOMAlgo_ST_IN;
717 aState = GEOMAlgo_ST_ONIN;
726 //=============================================================================
730 //=============================================================================
731 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
732 (GEOM::GEOM_Object_ptr theShape,
733 const CORBA::Long theShapeType,
734 GEOM::GEOM_Object_ptr theAx1,
735 const GEOM::shape_state theState)
737 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
739 //Set a not done flag
740 GetOperations()->SetNotDone();
742 //Get the reference objects
743 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
744 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
746 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
748 //Get Shapes On Plane
749 Handle(TColStd_HSequenceOfTransient) aHSeq =
750 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
751 if (!GetOperations()->IsDone() || aHSeq.IsNull())
754 Standard_Integer aLength = aHSeq->Length();
755 aSeq->length(aLength);
756 for (Standard_Integer i = 1; i <= aLength; i++)
757 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
762 //=============================================================================
764 * GetShapesOnPlaneWithLocation
766 //=============================================================================
767 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
768 (GEOM::GEOM_Object_ptr theShape,
769 const CORBA::Long theShapeType,
770 GEOM::GEOM_Object_ptr theAx1,
771 GEOM::GEOM_Object_ptr thePnt,
772 const GEOM::shape_state theState)
774 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
776 //Set a not done flag
777 GetOperations()->SetNotDone();
779 //Get the reference objects
780 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
781 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
782 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
784 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
786 //Get Shapes On Plane
787 Handle(TColStd_HSequenceOfTransient) aHSeq =
788 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
789 if (!GetOperations()->IsDone() || aHSeq.IsNull())
792 Standard_Integer aLength = aHSeq->Length();
793 aSeq->length(aLength);
794 for (Standard_Integer i = 1; i <= aLength; i++)
795 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
800 //=============================================================================
802 * GetShapesOnCylinder
804 //=============================================================================
805 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
806 (GEOM::GEOM_Object_ptr theShape,
807 const CORBA::Long theShapeType,
808 GEOM::GEOM_Object_ptr theAxis,
809 const CORBA::Double theRadius,
810 const GEOM::shape_state theState)
812 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
814 //Set a not done flag
815 GetOperations()->SetNotDone();
817 //Get the reference objects
818 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
819 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
821 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
823 //Get Shapes On Cylinder
824 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
825 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
826 if (!GetOperations()->IsDone() || aHSeq.IsNull())
829 Standard_Integer aLength = aHSeq->Length();
830 aSeq->length(aLength);
831 for (Standard_Integer i = 1; i <= aLength; i++)
832 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
837 //=============================================================================
839 * GetShapesOnCylinderWithLocation
841 //=============================================================================
842 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocation
843 (GEOM::GEOM_Object_ptr theShape,
844 const CORBA::Long theShapeType,
845 GEOM::GEOM_Object_ptr theAxis,
846 GEOM::GEOM_Object_ptr thePnt,
847 const CORBA::Double theRadius,
848 const GEOM::shape_state theState)
850 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
852 //Set a not done flag
853 GetOperations()->SetNotDone();
855 //Get the reference objects
856 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
857 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
858 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
860 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
862 //Get Shapes On Cylinder
863 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinderWithLocation
864 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
865 if (!GetOperations()->IsDone() || aHSeq.IsNull())
868 Standard_Integer aLength = aHSeq->Length();
869 aSeq->length(aLength);
870 for (Standard_Integer i = 1; i <= aLength; i++)
871 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
876 //=============================================================================
880 //=============================================================================
881 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
882 (GEOM::GEOM_Object_ptr theShape,
883 const CORBA::Long theShapeType,
884 GEOM::GEOM_Object_ptr theCenter,
885 const CORBA::Double theRadius,
886 const GEOM::shape_state theState)
888 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
890 //Set a not done flag
891 GetOperations()->SetNotDone();
893 //Get the reference objects
894 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
895 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
897 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
899 //Get Shapes On Sphere
900 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
901 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
902 if (!GetOperations()->IsDone() || aHSeq.IsNull())
905 Standard_Integer aLength = aHSeq->Length();
906 aSeq->length(aLength);
907 for (Standard_Integer i = 1; i <= aLength; i++)
908 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
913 //=============================================================================
915 * GetShapesOnQuadrangle
917 //=============================================================================
918 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
919 (GEOM::GEOM_Object_ptr theShape,
920 CORBA::Long theShapeType,
921 GEOM::GEOM_Object_ptr theTopLeftPoint,
922 GEOM::GEOM_Object_ptr theTopRigthPoint,
923 GEOM::GEOM_Object_ptr theBottomLeftPoint,
924 GEOM::GEOM_Object_ptr theBottomRigthPoint,
925 GEOM::shape_state theState)
927 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
929 //Set a not done flag
930 GetOperations()->SetNotDone();
932 //Get the reference objects
933 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
934 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
935 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
936 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
937 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
939 if (aShape.IsNull() ||
940 aTopLeftPoint.IsNull() ||
941 aTopRigthPoint.IsNull() ||
942 aBottomLeftPoint.IsNull() ||
943 aBottomRigthPoint.IsNull())
946 //Get Shapes On Quadrangle
947 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
948 (aShape, theShapeType,
949 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
950 ShapeState(theState));
951 if (!GetOperations()->IsDone() || aHSeq.IsNull())
954 Standard_Integer aLength = aHSeq->Length();
955 aSeq->length(aLength);
956 for (Standard_Integer i = 1; i <= aLength; i++)
957 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
962 //=============================================================================
964 * GetShapesOnPlaneIDs
966 //=============================================================================
967 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
968 (GEOM::GEOM_Object_ptr theShape,
969 const CORBA::Long theShapeType,
970 GEOM::GEOM_Object_ptr theAx1,
971 const GEOM::shape_state theState)
973 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
975 //Set a not done flag
976 GetOperations()->SetNotDone();
978 //Get the reference objects
979 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
980 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
982 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
984 //Get Shapes On Plane
985 Handle(TColStd_HSequenceOfInteger) aHSeq =
986 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
987 if (!GetOperations()->IsDone() || aHSeq.IsNull())
990 Standard_Integer aLength = aHSeq->Length();
991 aSeq->length(aLength);
992 for (Standard_Integer i = 1; i <= aLength; i++)
993 aSeq[i-1] = aHSeq->Value(i);
998 //=============================================================================
1000 * GetShapesOnPlaneWithLocationIDs
1002 //=============================================================================
1003 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
1004 (GEOM::GEOM_Object_ptr theShape,
1005 const CORBA::Long theShapeType,
1006 GEOM::GEOM_Object_ptr theAx1,
1007 GEOM::GEOM_Object_ptr thePnt,
1008 const GEOM::shape_state theState)
1010 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1012 //Set a not done flag
1013 GetOperations()->SetNotDone();
1015 //Get the reference objects
1016 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1017 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1018 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
1020 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1022 //Get Shapes On Plane
1023 Handle(TColStd_HSequenceOfInteger) aHSeq =
1024 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
1025 anAx1, anPnt, ShapeState(theState));
1026 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1027 return aSeq._retn();
1029 Standard_Integer aLength = aHSeq->Length();
1030 aSeq->length(aLength);
1031 for (Standard_Integer i = 1; i <= aLength; i++)
1032 aSeq[i-1] = aHSeq->Value(i);
1034 return aSeq._retn();
1037 //=============================================================================
1039 * GetShapesOnCylinderIDs
1041 //=============================================================================
1042 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1043 (GEOM::GEOM_Object_ptr theShape,
1044 const CORBA::Long theShapeType,
1045 GEOM::GEOM_Object_ptr theAxis,
1046 const CORBA::Double theRadius,
1047 const GEOM::shape_state theState)
1049 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1051 //Set a not done flag
1052 GetOperations()->SetNotDone();
1054 //Get the reference objects
1055 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1056 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1058 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1060 //Get Shapes On Cylinder
1061 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
1062 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1063 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1064 return aSeq._retn();
1066 Standard_Integer aLength = aHSeq->Length();
1067 aSeq->length(aLength);
1068 for (Standard_Integer i = 1; i <= aLength; i++)
1069 aSeq[i-1] = aHSeq->Value(i);
1071 return aSeq._retn();
1074 //=============================================================================
1076 * GetShapesOnCylinderWithLocationIDs
1078 //=============================================================================
1079 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocationIDs
1080 (GEOM::GEOM_Object_ptr theShape,
1081 const CORBA::Long theShapeType,
1082 GEOM::GEOM_Object_ptr theAxis,
1083 GEOM::GEOM_Object_ptr thePnt,
1084 const CORBA::Double theRadius,
1085 const GEOM::shape_state theState)
1087 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1089 //Set a not done flag
1090 GetOperations()->SetNotDone();
1092 //Get the reference objects
1093 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1094 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1095 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1097 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1099 //Get Shapes On Cylinder
1100 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderWithLocationIDs
1101 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1102 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1103 return aSeq._retn();
1105 Standard_Integer aLength = aHSeq->Length();
1106 aSeq->length(aLength);
1107 for (Standard_Integer i = 1; i <= aLength; i++)
1108 aSeq[i-1] = aHSeq->Value(i);
1110 return aSeq._retn();
1113 //=============================================================================
1115 * GetShapesOnSphereIDs
1117 //=============================================================================
1118 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1119 (GEOM::GEOM_Object_ptr theShape,
1120 const CORBA::Long theShapeType,
1121 GEOM::GEOM_Object_ptr theCenter,
1122 const CORBA::Double theRadius,
1123 const GEOM::shape_state theState)
1125 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1127 //Set a not done flag
1128 GetOperations()->SetNotDone();
1130 //Get the reference objects
1131 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1132 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1134 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1136 //Get Shapes On Sphere
1137 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1138 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1139 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1140 return aSeq._retn();
1142 Standard_Integer aLength = aHSeq->Length();
1143 aSeq->length(aLength);
1144 for (Standard_Integer i = 1; i <= aLength; i++)
1145 aSeq[i-1] = aHSeq->Value(i);
1147 return aSeq._retn();
1150 //=============================================================================
1152 * GetShapesOnQuadrangleIDs
1154 //=============================================================================
1155 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1156 (GEOM::GEOM_Object_ptr theShape,
1157 CORBA::Long theShapeType,
1158 GEOM::GEOM_Object_ptr theTopLeftPoint,
1159 GEOM::GEOM_Object_ptr theTopRigthPoint,
1160 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1161 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1162 GEOM::shape_state theState)
1164 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1166 //Set a not done flag
1167 GetOperations()->SetNotDone();
1169 //Get the reference objects
1170 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1171 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1172 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1173 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1174 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1176 if (aShape.IsNull() ||
1177 aTopLeftPoint.IsNull() ||
1178 aTopRigthPoint.IsNull() ||
1179 aBottomLeftPoint.IsNull() ||
1180 aBottomRigthPoint.IsNull() )
1181 return aSeq._retn();
1183 //Get Shapes On Quadrangle
1184 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1185 (aShape, theShapeType,
1186 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1187 ShapeState(theState));
1188 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1189 return aSeq._retn();
1191 Standard_Integer aLength = aHSeq->Length();
1192 aSeq->length(aLength);
1193 for (Standard_Integer i = 1; i <= aLength; i++)
1194 aSeq[i-1] = aHSeq->Value(i);
1196 return aSeq._retn();
1199 //=============================================================================
1203 //=============================================================================
1204 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1205 (GEOM::GEOM_Object_ptr theBox,
1206 GEOM::GEOM_Object_ptr theShape,
1207 CORBA::Long theShapeType,
1208 GEOM::shape_state theState)
1210 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1212 //Set a not done flag
1213 GetOperations()->SetNotDone();
1215 //Get the reference objects
1216 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1217 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1219 if (aShape.IsNull() || aBox.IsNull() )
1220 return aSeq._retn();
1223 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
1224 (aBox,aShape, theShapeType,ShapeState(theState));
1225 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1226 return aSeq._retn();
1228 Standard_Integer aLength = aHSeq->Length();
1229 aSeq->length(aLength);
1230 for (Standard_Integer i = 1; i <= aLength; i++)
1231 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1233 return aSeq._retn();
1236 //=============================================================================
1238 * GetShapesOnQuadrangleIDs
1240 //=============================================================================
1241 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1242 (GEOM::GEOM_Object_ptr theBox,
1243 GEOM::GEOM_Object_ptr theShape,
1244 CORBA::Long theShapeType,
1245 GEOM::shape_state theState)
1247 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1249 //Set a not done flag
1250 GetOperations()->SetNotDone();
1252 //Get the reference objects
1253 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1254 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1256 if (aShape.IsNull() || aBox.IsNull() )
1257 return aSeq._retn();
1260 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1261 (aBox,aShape, theShapeType,ShapeState(theState));
1262 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1263 return aSeq._retn();
1265 Standard_Integer aLength = aHSeq->Length();
1266 aSeq->length(aLength);
1267 for (Standard_Integer i = 1; i <= aLength; i++)
1268 aSeq[i-1] = aHSeq->Value(i);
1270 return aSeq._retn();
1274 //=============================================================================
1278 //=============================================================================
1279 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
1280 (GEOM::GEOM_Object_ptr theCheckShape,
1281 GEOM::GEOM_Object_ptr theShape,
1282 CORBA::Short theShapeType,
1283 GEOM::shape_state theState)
1285 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1287 //Set a not done flag
1288 GetOperations()->SetNotDone();
1290 //Get the reference objects
1291 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1292 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1294 if (aShape.IsNull() || aCheckShape.IsNull() )
1295 return aSeq._retn();
1297 //Get Shapes On Shape
1298 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape
1299 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1301 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1302 return aSeq._retn();
1304 Standard_Integer aLength = aHSeq->Length();
1305 aSeq->length(aLength);
1306 for (Standard_Integer i = 1; i <= aLength; i++)
1307 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1309 return aSeq._retn();
1313 //=============================================================================
1315 * GetShapesOnShapeAsCompound
1317 //=============================================================================
1318 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
1319 (GEOM::GEOM_Object_ptr theCheckShape,
1320 GEOM::GEOM_Object_ptr theShape,
1321 CORBA::Short theShapeType,
1322 GEOM::shape_state theState)
1324 GEOM::GEOM_Object_var aGEOMObject;
1326 //Set a not done flag
1327 GetOperations()->SetNotDone();
1329 //Get the reference objects
1330 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1331 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1333 if (aShape.IsNull() || aCheckShape.IsNull() )
1334 return aGEOMObject._retn();
1336 //Get Shapes On Shape
1337 Handle(GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound
1338 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1340 if (anObject.IsNull())
1341 return aGEOMObject._retn();
1343 return GetObject(anObject);
1347 //=============================================================================
1349 * GetShapesOnShapeIDs
1351 //=============================================================================
1352 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
1353 (GEOM::GEOM_Object_ptr theCheckShape,
1354 GEOM::GEOM_Object_ptr theShape,
1355 CORBA::Short theShapeType,
1356 GEOM::shape_state theState)
1358 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1360 //Set a not done flag
1361 GetOperations()->SetNotDone();
1363 //Get the reference objects
1364 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1365 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1367 if (aShape.IsNull() || aCheckShape.IsNull() )
1368 return aSeq._retn();
1370 //Get Shapes On Shape
1371 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs
1372 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1373 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1374 return aSeq._retn();
1376 Standard_Integer aLength = aHSeq->Length();
1377 aSeq->length(aLength);
1378 for (Standard_Integer i = 1; i <= aLength; i++)
1379 aSeq[i-1] = aHSeq->Value(i);
1381 return aSeq._retn();
1385 //=============================================================================
1389 //=============================================================================
1390 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1391 (GEOM::GEOM_Object_ptr theShapeWhere,
1392 GEOM::GEOM_Object_ptr theShapeWhat)
1394 GEOM::GEOM_Object_var aGEOMObject;
1396 //Set a not done flag
1397 GetOperations()->SetNotDone();
1399 //Get the reference objects
1400 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1401 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1403 if (aShapeWhere.IsNull() ||
1404 aShapeWhat.IsNull()) return aGEOMObject._retn();
1406 //Get Shapes in place of aShapeWhat
1407 Handle(GEOM_Object) anObject =
1408 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1409 if (!GetOperations()->IsDone() || anObject.IsNull())
1410 return aGEOMObject._retn();
1412 return GetObject(anObject);
1415 //=============================================================================
1417 * GetInPlaceByHistory
1419 //=============================================================================
1420 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
1421 (GEOM::GEOM_Object_ptr theShapeWhere,
1422 GEOM::GEOM_Object_ptr theShapeWhat)
1424 GEOM::GEOM_Object_var aGEOMObject;
1426 //Set a not done flag
1427 GetOperations()->SetNotDone();
1429 //Get the reference objects
1430 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1431 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1433 if (aShapeWhere.IsNull() ||
1434 aShapeWhat.IsNull()) return aGEOMObject._retn();
1436 //Get Shapes in place of aShapeWhat
1437 Handle(GEOM_Object) anObject =
1438 GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
1439 if (!GetOperations()->IsDone() || anObject.IsNull())
1440 return aGEOMObject._retn();
1442 return GetObject(anObject);
1445 //=============================================================================
1449 //=============================================================================
1450 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1451 (GEOM::GEOM_Object_ptr theShapeWhere,
1452 GEOM::GEOM_Object_ptr theShapeWhat)
1454 GEOM::GEOM_Object_var aGEOMObject;
1456 //Set a not done flag
1457 GetOperations()->SetNotDone();
1459 //Get the reference objects
1460 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1461 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1463 if (aShapeWhere.IsNull() ||
1464 aShapeWhat.IsNull()) return aGEOMObject._retn();
1466 //Get Shapes in place of aShapeWhat
1467 Handle(GEOM_Object) anObject =
1468 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1469 if (!GetOperations()->IsDone() || anObject.IsNull())
1470 return aGEOMObject._retn();
1472 return GetObject(anObject);