1 // Copyright (C) 2007-2008 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 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 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 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 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 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 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);
414 //=============================================================================
418 //=============================================================================
419 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
420 const CORBA::Long theShapeType,
421 const CORBA::Boolean isSorted)
423 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
425 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
426 if (aShape.IsNull()) return aSeq._retn();
428 Handle(TColStd_HSequenceOfTransient) aHSeq =
429 GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
430 if (!GetOperations()->IsDone() || aHSeq.IsNull())
433 Standard_Integer aLength = aHSeq->Length();
434 aSeq->length(aLength);
435 for (Standard_Integer i = 1; i <= aLength; i++)
436 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
441 //=============================================================================
445 //=============================================================================
446 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
447 const CORBA::Long theShapeType,
448 const CORBA::Boolean isSorted)
450 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
452 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
453 if (aShape.IsNull()) return aSeq._retn();
455 Handle(TColStd_HSequenceOfInteger) aHSeq =
456 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
457 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
459 Standard_Integer aLength = aHSeq->Length();
460 aSeq->length(aLength);
461 for (Standard_Integer i = 1; i <= aLength; i++)
462 aSeq[i-1] = aHSeq->Value(i);
467 //=============================================================================
471 //=============================================================================
472 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
473 (GEOM::GEOM_Object_ptr theMainShape,
474 const CORBA::Long theID)
476 GEOM::GEOM_Object_var aGEOMObject;
478 //Set a not done flag
479 GetOperations()->SetNotDone();
481 //Get the reference objects
482 Handle(GEOM_Object) aShape = GetObjectImpl(theMainShape);
483 if (aShape.IsNull()) return aGEOMObject._retn();
485 Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
486 if (!GetOperations()->IsDone() || anObject.IsNull())
487 return aGEOMObject._retn();
489 return GetObject(anObject);
492 //=============================================================================
496 //=============================================================================
497 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
498 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
500 //Get the reference shapes
501 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
502 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
504 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
506 //Get the unique ID of <theSubShape> inside <theMainShape>
507 CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
508 if (!GetOperations()->IsDone())
514 //=============================================================================
518 //=============================================================================
519 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
520 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
522 //Get the reference shapes
523 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
524 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
526 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
528 //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
529 CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
530 if (!GetOperations()->IsDone())
536 //=============================================================================
540 //=============================================================================
541 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
543 //Get the reference shape
544 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
545 if (aShape.IsNull()) return NULL;
547 // Get shape parameters
548 TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
549 return CORBA::string_dup(aDescription.ToCString());
552 //=============================================================================
556 //=============================================================================
557 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
559 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_FACE));
562 //=============================================================================
566 //=============================================================================
567 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
569 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_EDGE));
572 //=============================================================================
576 //=============================================================================
577 CORBA::Long GEOM_IShapesOperations_i::NumberOfSubShapes (GEOM::GEOM_Object_ptr theShape,
578 const CORBA::Long theShapeType)
580 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
581 if (aShape.IsNull()) return -1;
583 CORBA::Long aNb = GetOperations()->NumberOfSubShapes(aShape, theShapeType);
584 if (!GetOperations()->IsDone()) return -1;
589 //=============================================================================
593 //=============================================================================
594 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
595 (GEOM::GEOM_Object_ptr theShape)
597 GEOM::GEOM_Object_var aGEOMObject;
599 //Set a not done flag
600 GetOperations()->SetNotDone();
602 //Get the reference objects
603 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
604 if (aShape.IsNull()) return aGEOMObject._retn();
607 Handle(GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
608 if (!GetOperations()->IsDone() || anObject.IsNull())
609 return aGEOMObject._retn();
611 return GetObject(anObject);
614 //=============================================================================
618 //=============================================================================
619 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
621 //Set a not done flag
622 GetOperations()->SetNotDone();
624 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
626 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
627 if (aShape.IsNull()) return aSeq._retn();
629 Handle(TColStd_HSequenceOfInteger) aHSeq =
630 GetOperations()->GetFreeFacesIDs(aShape);
631 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
633 Standard_Integer aLength = aHSeq->Length();
634 aSeq->length(aLength);
635 for (Standard_Integer i = 1; i <= aLength; i++)
636 aSeq[i-1] = aHSeq->Value(i);
641 //=============================================================================
645 //=============================================================================
646 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
647 (GEOM::GEOM_Object_ptr theShape1,
648 GEOM::GEOM_Object_ptr theShape2,
649 const CORBA::Long theShapeType)
651 //Set a not done flag
652 GetOperations()->SetNotDone();
654 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
656 Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
657 Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
659 if (aShape1.IsNull() || aShape2.IsNull()) return aSeq._retn();
661 Handle(TColStd_HSequenceOfTransient) aHSeq =
662 GetOperations()->GetSharedShapes(aShape1, aShape2, theShapeType);
663 if (!GetOperations()->IsDone() || aHSeq.IsNull())
666 Standard_Integer aLength = aHSeq->Length();
667 aSeq->length(aLength);
668 for (Standard_Integer i = 1; i <= aLength; i++)
669 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
674 static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
676 GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
680 aState = GEOMAlgo_ST_ON;
683 aState = GEOMAlgo_ST_OUT;
686 aState = GEOMAlgo_ST_ONOUT;
689 aState = GEOMAlgo_ST_IN;
692 aState = GEOMAlgo_ST_ONIN;
701 //=============================================================================
705 //=============================================================================
706 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
707 (GEOM::GEOM_Object_ptr theShape,
708 const CORBA::Long theShapeType,
709 GEOM::GEOM_Object_ptr theAx1,
710 const GEOM::shape_state theState)
712 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
714 //Set a not done flag
715 GetOperations()->SetNotDone();
717 //Get the reference objects
718 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
719 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
721 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
723 //Get Shapes On Plane
724 Handle(TColStd_HSequenceOfTransient) aHSeq =
725 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
726 if (!GetOperations()->IsDone() || aHSeq.IsNull())
729 Standard_Integer aLength = aHSeq->Length();
730 aSeq->length(aLength);
731 for (Standard_Integer i = 1; i <= aLength; i++)
732 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
737 //=============================================================================
739 * GetShapesOnPlaneWithLocation
741 //=============================================================================
742 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
743 (GEOM::GEOM_Object_ptr theShape,
744 const CORBA::Long theShapeType,
745 GEOM::GEOM_Object_ptr theAx1,
746 GEOM::GEOM_Object_ptr thePnt,
747 const GEOM::shape_state theState)
749 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
751 //Set a not done flag
752 GetOperations()->SetNotDone();
754 //Get the reference objects
755 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
756 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
757 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
759 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
761 //Get Shapes On Plane
762 Handle(TColStd_HSequenceOfTransient) aHSeq =
763 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
764 if (!GetOperations()->IsDone() || aHSeq.IsNull())
767 Standard_Integer aLength = aHSeq->Length();
768 aSeq->length(aLength);
769 for (Standard_Integer i = 1; i <= aLength; i++)
770 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
775 //=============================================================================
777 * GetShapesOnCylinder
779 //=============================================================================
780 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
781 (GEOM::GEOM_Object_ptr theShape,
782 const CORBA::Long theShapeType,
783 GEOM::GEOM_Object_ptr theAxis,
784 const CORBA::Double theRadius,
785 const GEOM::shape_state theState)
787 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
789 //Set a not done flag
790 GetOperations()->SetNotDone();
792 //Get the reference objects
793 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
794 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
796 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
798 //Get Shapes On Cylinder
799 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
800 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
801 if (!GetOperations()->IsDone() || aHSeq.IsNull())
804 Standard_Integer aLength = aHSeq->Length();
805 aSeq->length(aLength);
806 for (Standard_Integer i = 1; i <= aLength; i++)
807 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
812 //=============================================================================
814 * GetShapesOnCylinderWithLocation
816 //=============================================================================
817 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocation
818 (GEOM::GEOM_Object_ptr theShape,
819 const CORBA::Long theShapeType,
820 GEOM::GEOM_Object_ptr theAxis,
821 GEOM::GEOM_Object_ptr thePnt,
822 const CORBA::Double theRadius,
823 const GEOM::shape_state theState)
825 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
827 //Set a not done flag
828 GetOperations()->SetNotDone();
830 //Get the reference objects
831 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
832 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
833 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
835 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
837 //Get Shapes On Cylinder
838 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinderWithLocation
839 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
840 if (!GetOperations()->IsDone() || aHSeq.IsNull())
843 Standard_Integer aLength = aHSeq->Length();
844 aSeq->length(aLength);
845 for (Standard_Integer i = 1; i <= aLength; i++)
846 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
851 //=============================================================================
855 //=============================================================================
856 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
857 (GEOM::GEOM_Object_ptr theShape,
858 const CORBA::Long theShapeType,
859 GEOM::GEOM_Object_ptr theCenter,
860 const CORBA::Double theRadius,
861 const GEOM::shape_state theState)
863 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
865 //Set a not done flag
866 GetOperations()->SetNotDone();
868 //Get the reference objects
869 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
870 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
872 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
874 //Get Shapes On Sphere
875 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
876 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
877 if (!GetOperations()->IsDone() || aHSeq.IsNull())
880 Standard_Integer aLength = aHSeq->Length();
881 aSeq->length(aLength);
882 for (Standard_Integer i = 1; i <= aLength; i++)
883 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
888 //=============================================================================
890 * GetShapesOnQuadrangle
892 //=============================================================================
893 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
894 (GEOM::GEOM_Object_ptr theShape,
895 CORBA::Long theShapeType,
896 GEOM::GEOM_Object_ptr theTopLeftPoint,
897 GEOM::GEOM_Object_ptr theTopRigthPoint,
898 GEOM::GEOM_Object_ptr theBottomLeftPoint,
899 GEOM::GEOM_Object_ptr theBottomRigthPoint,
900 GEOM::shape_state theState)
902 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
904 //Set a not done flag
905 GetOperations()->SetNotDone();
907 //Get the reference objects
908 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
909 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
910 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
911 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
912 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
914 if (aShape.IsNull() ||
915 aTopLeftPoint.IsNull() ||
916 aTopRigthPoint.IsNull() ||
917 aBottomLeftPoint.IsNull() ||
918 aBottomRigthPoint.IsNull())
921 //Get Shapes On Quadrangle
922 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
923 (aShape, theShapeType,
924 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
925 ShapeState(theState));
926 if (!GetOperations()->IsDone() || aHSeq.IsNull())
929 Standard_Integer aLength = aHSeq->Length();
930 aSeq->length(aLength);
931 for (Standard_Integer i = 1; i <= aLength; i++)
932 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
937 //=============================================================================
939 * GetShapesOnPlaneIDs
941 //=============================================================================
942 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
943 (GEOM::GEOM_Object_ptr theShape,
944 const CORBA::Long theShapeType,
945 GEOM::GEOM_Object_ptr theAx1,
946 const GEOM::shape_state theState)
948 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
950 //Set a not done flag
951 GetOperations()->SetNotDone();
953 //Get the reference objects
954 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
955 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
957 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
959 //Get Shapes On Plane
960 Handle(TColStd_HSequenceOfInteger) aHSeq =
961 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
962 if (!GetOperations()->IsDone() || aHSeq.IsNull())
965 Standard_Integer aLength = aHSeq->Length();
966 aSeq->length(aLength);
967 for (Standard_Integer i = 1; i <= aLength; i++)
968 aSeq[i-1] = aHSeq->Value(i);
973 //=============================================================================
975 * GetShapesOnPlaneWithLocationIDs
977 //=============================================================================
978 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
979 (GEOM::GEOM_Object_ptr theShape,
980 const CORBA::Long theShapeType,
981 GEOM::GEOM_Object_ptr theAx1,
982 GEOM::GEOM_Object_ptr thePnt,
983 const GEOM::shape_state theState)
985 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
987 //Set a not done flag
988 GetOperations()->SetNotDone();
990 //Get the reference objects
991 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
992 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
993 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
995 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
997 //Get Shapes On Plane
998 Handle(TColStd_HSequenceOfInteger) aHSeq =
999 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
1000 anAx1, anPnt, ShapeState(theState));
1001 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1002 return aSeq._retn();
1004 Standard_Integer aLength = aHSeq->Length();
1005 aSeq->length(aLength);
1006 for (Standard_Integer i = 1; i <= aLength; i++)
1007 aSeq[i-1] = aHSeq->Value(i);
1009 return aSeq._retn();
1012 //=============================================================================
1014 * GetShapesOnCylinderIDs
1016 //=============================================================================
1017 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1018 (GEOM::GEOM_Object_ptr theShape,
1019 const CORBA::Long theShapeType,
1020 GEOM::GEOM_Object_ptr theAxis,
1021 const CORBA::Double theRadius,
1022 const GEOM::shape_state theState)
1024 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1026 //Set a not done flag
1027 GetOperations()->SetNotDone();
1029 //Get the reference objects
1030 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1031 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1033 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1035 //Get Shapes On Cylinder
1036 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
1037 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1038 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1039 return aSeq._retn();
1041 Standard_Integer aLength = aHSeq->Length();
1042 aSeq->length(aLength);
1043 for (Standard_Integer i = 1; i <= aLength; i++)
1044 aSeq[i-1] = aHSeq->Value(i);
1046 return aSeq._retn();
1049 //=============================================================================
1051 * GetShapesOnCylinderWithLocationIDs
1053 //=============================================================================
1054 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocationIDs
1055 (GEOM::GEOM_Object_ptr theShape,
1056 const CORBA::Long theShapeType,
1057 GEOM::GEOM_Object_ptr theAxis,
1058 GEOM::GEOM_Object_ptr thePnt,
1059 const CORBA::Double theRadius,
1060 const GEOM::shape_state theState)
1062 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1064 //Set a not done flag
1065 GetOperations()->SetNotDone();
1067 //Get the reference objects
1068 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1069 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1070 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1072 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1074 //Get Shapes On Cylinder
1075 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderWithLocationIDs
1076 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1077 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1078 return aSeq._retn();
1080 Standard_Integer aLength = aHSeq->Length();
1081 aSeq->length(aLength);
1082 for (Standard_Integer i = 1; i <= aLength; i++)
1083 aSeq[i-1] = aHSeq->Value(i);
1085 return aSeq._retn();
1088 //=============================================================================
1090 * GetShapesOnSphereIDs
1092 //=============================================================================
1093 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1094 (GEOM::GEOM_Object_ptr theShape,
1095 const CORBA::Long theShapeType,
1096 GEOM::GEOM_Object_ptr theCenter,
1097 const CORBA::Double theRadius,
1098 const GEOM::shape_state theState)
1100 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1102 //Set a not done flag
1103 GetOperations()->SetNotDone();
1105 //Get the reference objects
1106 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1107 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1109 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1111 //Get Shapes On Sphere
1112 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1113 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1114 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1115 return aSeq._retn();
1117 Standard_Integer aLength = aHSeq->Length();
1118 aSeq->length(aLength);
1119 for (Standard_Integer i = 1; i <= aLength; i++)
1120 aSeq[i-1] = aHSeq->Value(i);
1122 return aSeq._retn();
1125 //=============================================================================
1127 * GetShapesOnQuadrangleIDs
1129 //=============================================================================
1130 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1131 (GEOM::GEOM_Object_ptr theShape,
1132 CORBA::Long theShapeType,
1133 GEOM::GEOM_Object_ptr theTopLeftPoint,
1134 GEOM::GEOM_Object_ptr theTopRigthPoint,
1135 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1136 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1137 GEOM::shape_state theState)
1139 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1141 //Set a not done flag
1142 GetOperations()->SetNotDone();
1144 //Get the reference objects
1145 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1146 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1147 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1148 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1149 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1151 if (aShape.IsNull() ||
1152 aTopLeftPoint.IsNull() ||
1153 aTopRigthPoint.IsNull() ||
1154 aBottomLeftPoint.IsNull() ||
1155 aBottomRigthPoint.IsNull() )
1156 return aSeq._retn();
1158 //Get Shapes On Quadrangle
1159 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1160 (aShape, theShapeType,
1161 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1162 ShapeState(theState));
1163 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1164 return aSeq._retn();
1166 Standard_Integer aLength = aHSeq->Length();
1167 aSeq->length(aLength);
1168 for (Standard_Integer i = 1; i <= aLength; i++)
1169 aSeq[i-1] = aHSeq->Value(i);
1171 return aSeq._retn();
1174 //=============================================================================
1178 //=============================================================================
1179 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1180 (GEOM::GEOM_Object_ptr theBox,
1181 GEOM::GEOM_Object_ptr theShape,
1182 CORBA::Long theShapeType,
1183 GEOM::shape_state theState)
1185 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1187 //Set a not done flag
1188 GetOperations()->SetNotDone();
1190 //Get the reference objects
1191 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1192 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1194 if (aShape.IsNull() || aBox.IsNull() )
1195 return aSeq._retn();
1198 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
1199 (aBox,aShape, theShapeType,ShapeState(theState));
1200 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1201 return aSeq._retn();
1203 Standard_Integer aLength = aHSeq->Length();
1204 aSeq->length(aLength);
1205 for (Standard_Integer i = 1; i <= aLength; i++)
1206 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1208 return aSeq._retn();
1211 //=============================================================================
1213 * GetShapesOnQuadrangleIDs
1215 //=============================================================================
1216 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1217 (GEOM::GEOM_Object_ptr theBox,
1218 GEOM::GEOM_Object_ptr theShape,
1219 CORBA::Long theShapeType,
1220 GEOM::shape_state theState)
1222 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1224 //Set a not done flag
1225 GetOperations()->SetNotDone();
1227 //Get the reference objects
1228 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1229 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1231 if (aShape.IsNull() || aBox.IsNull() )
1232 return aSeq._retn();
1235 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1236 (aBox,aShape, theShapeType,ShapeState(theState));
1237 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1238 return aSeq._retn();
1240 Standard_Integer aLength = aHSeq->Length();
1241 aSeq->length(aLength);
1242 for (Standard_Integer i = 1; i <= aLength; i++)
1243 aSeq[i-1] = aHSeq->Value(i);
1245 return aSeq._retn();
1249 //=============================================================================
1253 //=============================================================================
1254 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
1255 (GEOM::GEOM_Object_ptr theCheckShape,
1256 GEOM::GEOM_Object_ptr theShape,
1257 CORBA::Short theShapeType,
1258 GEOM::shape_state theState)
1260 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1262 //Set a not done flag
1263 GetOperations()->SetNotDone();
1265 //Get the reference objects
1266 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1267 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1269 if (aShape.IsNull() || aCheckShape.IsNull() )
1270 return aSeq._retn();
1272 //Get Shapes On Shape
1273 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape
1274 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1276 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1277 return aSeq._retn();
1279 Standard_Integer aLength = aHSeq->Length();
1280 aSeq->length(aLength);
1281 for (Standard_Integer i = 1; i <= aLength; i++)
1282 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1284 return aSeq._retn();
1288 //=============================================================================
1290 * GetShapesOnShapeAsCompound
1292 //=============================================================================
1293 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
1294 (GEOM::GEOM_Object_ptr theCheckShape,
1295 GEOM::GEOM_Object_ptr theShape,
1296 CORBA::Short theShapeType,
1297 GEOM::shape_state theState)
1299 GEOM::GEOM_Object_var aGEOMObject;
1301 //Set a not done flag
1302 GetOperations()->SetNotDone();
1304 //Get the reference objects
1305 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1306 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1308 if (aShape.IsNull() || aCheckShape.IsNull() )
1309 return aGEOMObject._retn();
1311 //Get Shapes On Shape
1312 Handle(GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound
1313 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1315 if (anObject.IsNull())
1316 return aGEOMObject._retn();
1318 return GetObject(anObject);
1322 //=============================================================================
1324 * GetShapesOnShapeIDs
1326 //=============================================================================
1327 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
1328 (GEOM::GEOM_Object_ptr theCheckShape,
1329 GEOM::GEOM_Object_ptr theShape,
1330 CORBA::Short theShapeType,
1331 GEOM::shape_state theState)
1333 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1335 //Set a not done flag
1336 GetOperations()->SetNotDone();
1338 //Get the reference objects
1339 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1340 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1342 if (aShape.IsNull() || aCheckShape.IsNull() )
1343 return aSeq._retn();
1345 //Get Shapes On Shape
1346 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs
1347 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1348 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1349 return aSeq._retn();
1351 Standard_Integer aLength = aHSeq->Length();
1352 aSeq->length(aLength);
1353 for (Standard_Integer i = 1; i <= aLength; i++)
1354 aSeq[i-1] = aHSeq->Value(i);
1356 return aSeq._retn();
1360 //=============================================================================
1364 //=============================================================================
1365 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1366 (GEOM::GEOM_Object_ptr theShapeWhere,
1367 GEOM::GEOM_Object_ptr theShapeWhat)
1369 GEOM::GEOM_Object_var aGEOMObject;
1371 //Set a not done flag
1372 GetOperations()->SetNotDone();
1374 //Get the reference objects
1375 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1376 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1378 if (aShapeWhere.IsNull() ||
1379 aShapeWhat.IsNull()) return aGEOMObject._retn();
1381 //Get Shapes in place of aShapeWhat
1382 Handle(GEOM_Object) anObject =
1383 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1384 if (!GetOperations()->IsDone() || anObject.IsNull())
1385 return aGEOMObject._retn();
1387 return GetObject(anObject);
1390 //=============================================================================
1392 * GetInPlaceByHistory
1394 //=============================================================================
1395 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
1396 (GEOM::GEOM_Object_ptr theShapeWhere,
1397 GEOM::GEOM_Object_ptr theShapeWhat)
1399 GEOM::GEOM_Object_var aGEOMObject;
1401 //Set a not done flag
1402 GetOperations()->SetNotDone();
1404 //Get the reference objects
1405 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1406 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1408 if (aShapeWhere.IsNull() ||
1409 aShapeWhat.IsNull()) return aGEOMObject._retn();
1411 //Get Shapes in place of aShapeWhat
1412 Handle(GEOM_Object) anObject =
1413 GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
1414 if (!GetOperations()->IsDone() || anObject.IsNull())
1415 return aGEOMObject._retn();
1417 return GetObject(anObject);
1420 //=============================================================================
1424 //=============================================================================
1425 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1426 (GEOM::GEOM_Object_ptr theShapeWhere,
1427 GEOM::GEOM_Object_ptr theShapeWhat)
1429 GEOM::GEOM_Object_var aGEOMObject;
1431 //Set a not done flag
1432 GetOperations()->SetNotDone();
1434 //Get the reference objects
1435 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1436 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1438 if (aShapeWhere.IsNull() ||
1439 aShapeWhat.IsNull()) return aGEOMObject._retn();
1441 //Get Shapes in place of aShapeWhat
1442 Handle(GEOM_Object) anObject =
1443 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1444 if (!GetOperations()->IsDone() || anObject.IsNull())
1445 return aGEOMObject._retn();
1447 return GetObject(anObject);