1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include <Standard_Stream.hxx>
25 #include "GEOM_IShapesOperations_i.hh"
27 #include "utilities.h"
29 #include "Utils_ExceptHandlers.hxx"
31 #include "GEOM_Engine.hxx"
32 #include "GEOM_Object.hxx"
35 #include <TColStd_HSequenceOfTransient.hxx>
36 #include <TColStd_HArray1OfInteger.hxx>
38 //=============================================================================
42 //=============================================================================
43 GEOM_IShapesOperations_i::GEOM_IShapesOperations_i (PortableServer::POA_ptr thePOA,
44 GEOM::GEOM_Gen_ptr theEngine,
45 ::GEOMImpl_IShapesOperations* theImpl)
46 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
48 MESSAGE("GEOM_IShapesOperations_i::GEOM_IShapesOperations_i");
51 //=============================================================================
55 //=============================================================================
56 GEOM_IShapesOperations_i::~GEOM_IShapesOperations_i()
58 MESSAGE("GEOM_IShapesOperations_i::~GEOM_IShapesOperations_i");
62 //=============================================================================
66 //=============================================================================
67 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdge
68 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
70 GEOM::GEOM_Object_var aGEOMObject;
73 GetOperations()->SetNotDone();
75 //Get the reference points
76 Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
77 Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
79 if (aPnt1.IsNull() || aPnt2.IsNull()) return aGEOMObject._retn();
82 Handle(GEOM_Object) anObject = GetOperations()->MakeEdge(aPnt1, aPnt2);
83 if (!GetOperations()->IsDone() || anObject.IsNull())
84 return aGEOMObject._retn();
86 return GetObject(anObject);
89 //=============================================================================
93 //=============================================================================
94 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire
95 (const GEOM::ListOfGO& theEdgesAndWires,
96 const CORBA::Double theTolerance)
98 GEOM::GEOM_Object_var aGEOMObject;
100 //Set a not done flag
101 GetOperations()->SetNotDone();
104 std::list<Handle(GEOM_Object)> aShapes;
107 aLen = theEdgesAndWires.length();
108 for (ind = 0; ind < aLen; ind++) {
109 Handle(GEOM_Object) aSh = GetObjectImpl(theEdgesAndWires[ind]);
110 if (aSh.IsNull()) return aGEOMObject._retn();
111 aShapes.push_back(aSh);
115 Handle(GEOM_Object) anObject =
116 GetOperations()->MakeWire(aShapes, theTolerance);
117 if (!GetOperations()->IsDone() || anObject.IsNull())
118 return aGEOMObject._retn();
120 return GetObject(anObject);
123 //=============================================================================
127 //=============================================================================
128 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFace
129 (GEOM::GEOM_Object_ptr theWire,
130 const CORBA::Boolean isPlanarWanted)
132 GEOM::GEOM_Object_var aGEOMObject;
134 //Set a not done flag
135 GetOperations()->SetNotDone();
137 //Get the reference wire
138 Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
139 if (aWire.IsNull()) return aGEOMObject._retn();
142 Handle(GEOM_Object) anObject = GetOperations()->MakeFace(aWire, isPlanarWanted);
143 if (!GetOperations()->IsDone() || anObject.IsNull())
144 return aGEOMObject._retn();
146 return GetObject(anObject);
149 //=============================================================================
153 //=============================================================================
154 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWires
155 (const GEOM::ListOfGO& theWires,
156 const CORBA::Boolean isPlanarWanted)
158 GEOM::GEOM_Object_var aGEOMObject;
160 //Set a not done flag
161 GetOperations()->SetNotDone();
164 std::list<Handle(GEOM_Object)> aShapes;
167 aLen = theWires.length();
168 for (ind = 0; ind < aLen; ind++) {
169 Handle(GEOM_Object) aSh = GetObjectImpl(theWires[ind]);
170 if (aSh.IsNull()) return aGEOMObject._retn();
171 aShapes.push_back(aSh);
175 Handle(GEOM_Object) anObject =
176 GetOperations()->MakeFaceWires(aShapes, isPlanarWanted);
177 if (!GetOperations()->IsDone() || anObject.IsNull())
178 return aGEOMObject._retn();
180 return GetObject(anObject);
183 //=============================================================================
187 //=============================================================================
188 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeShell
189 (const GEOM::ListOfGO& theFacesAndShells)
191 GEOM::GEOM_Object_var aGEOMObject;
193 //Set a not done flag
194 GetOperations()->SetNotDone();
197 std::list<Handle(GEOM_Object)> aShapes;
200 aLen = theFacesAndShells.length();
201 for (ind = 0; ind < aLen; ind++) {
202 Handle(GEOM_Object) aSh = GetObjectImpl(theFacesAndShells[ind]);
203 if (aSh.IsNull()) return aGEOMObject._retn();
204 aShapes.push_back(aSh);
208 Handle(GEOM_Object) anObject =
209 GetOperations()->MakeShell(aShapes);
210 if (!GetOperations()->IsDone() || anObject.IsNull())
211 return aGEOMObject._retn();
213 return GetObject(anObject);
216 //=============================================================================
220 //=============================================================================
221 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShell
222 (GEOM::GEOM_Object_ptr theShell)
224 GEOM::GEOM_Object_var aGEOMObject;
226 //Set a not done flag
227 GetOperations()->SetNotDone();
229 //Get the reference objects
230 Handle(GEOM_Object) aShell = GetObjectImpl(theShell);
231 if (aShell.IsNull()) return aGEOMObject._retn();
234 Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShell(aShell);
235 if (!GetOperations()->IsDone() || anObject.IsNull())
236 return aGEOMObject._retn();
238 return GetObject(anObject);
241 //=============================================================================
245 //=============================================================================
246 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShells
247 (const GEOM::ListOfGO& theShells)
249 GEOM::GEOM_Object_var aGEOMObject;
251 //Set a not done flag
252 GetOperations()->SetNotDone();
255 std::list<Handle(GEOM_Object)> aShapes;
258 aLen = theShells.length();
259 for (ind = 0; ind < aLen; ind++) {
260 Handle(GEOM_Object) aSh = GetObjectImpl(theShells[ind]);
261 if (aSh.IsNull()) return aGEOMObject._retn();
262 aShapes.push_back(aSh);
266 Handle(GEOM_Object) anObject =
267 GetOperations()->MakeSolidShells(aShapes);
268 if (!GetOperations()->IsDone() || anObject.IsNull())
269 return aGEOMObject._retn();
271 return GetObject(anObject);
274 //=============================================================================
278 //=============================================================================
279 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
280 (const GEOM::ListOfGO& theShapes)
282 GEOM::GEOM_Object_var aGEOMObject;
284 //Set a not done flag
285 GetOperations()->SetNotDone();
288 std::list<Handle(GEOM_Object)> aShapes;
291 aLen = theShapes.length();
292 for (ind = 0; ind < aLen; ind++) {
293 Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
294 if (aSh.IsNull()) return aGEOMObject._retn();
295 aShapes.push_back(aSh);
299 Handle(GEOM_Object) anObject =
300 GetOperations()->MakeCompound(aShapes);
301 if (!GetOperations()->IsDone() || anObject.IsNull())
302 return aGEOMObject._retn();
304 return GetObject(anObject);
307 //=============================================================================
311 //=============================================================================
312 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
313 (GEOM::GEOM_Object_ptr theShape,
314 CORBA::Double theTolerance,
315 CORBA::Boolean doKeepNonSolids)
317 GEOM::GEOM_Object_var aGEOMObject;
319 //Set a not done flag
320 GetOperations()->SetNotDone();
322 //Get the reference objects
323 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
324 if (aShape.IsNull()) return aGEOMObject._retn();
327 Handle(GEOM_Object) anObject =
328 GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
329 //if (!GetOperations()->IsDone() || anObject.IsNull())
331 if (anObject.IsNull())
332 return aGEOMObject._retn();
334 return GetObject(anObject);
338 //=============================================================================
342 //=============================================================================
343 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
344 (GEOM::GEOM_Object_ptr theShape,
345 const CORBA::Double theTolerance)
347 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
349 //Set a not done flag
350 GetOperations()->SetNotDone();
352 //Get the reference objects
353 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
354 if (aShape.IsNull()) return aSeq._retn();
356 Handle(TColStd_HSequenceOfTransient) aHSeq =
357 GetOperations()->GetGlueFaces(aShape, theTolerance);
359 //if (!GetOperations()->IsDone() || aHSeq.IsNull())
364 Standard_Integer aLength = aHSeq->Length();
365 aSeq->length(aLength);
366 for (Standard_Integer i = 1; i <= aLength; i++)
367 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
373 //=============================================================================
375 * MakeGlueFacesByList
377 //=============================================================================
378 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
379 (GEOM::GEOM_Object_ptr theShape,
380 CORBA::Double theTolerance,
381 const GEOM::ListOfGO& theFaces,
382 CORBA::Boolean doKeepNonSolids)
384 GEOM::GEOM_Object_var aGEOMObject;
386 //Set a not done flag
387 GetOperations()->SetNotDone();
389 //Get the reference objects
390 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
391 if (aShape.IsNull()) return aGEOMObject._retn();
394 std::list<Handle(GEOM_Object)> aFaces;
396 aLen = theFaces.length();
397 for (ind = 0; ind < aLen; ind++) {
398 Handle(GEOM_Object) aSh = GetObjectImpl(theFaces[ind]);
399 if (aSh.IsNull()) return aGEOMObject._retn();
400 aFaces.push_back(aSh);
404 Handle(GEOM_Object) anObject =
405 GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces, doKeepNonSolids);
406 //if (!GetOperations()->IsDone() || anObject.IsNull())
408 if (anObject.IsNull())
409 return aGEOMObject._retn();
411 return GetObject(anObject);
415 //=============================================================================
419 //=============================================================================
420 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
421 const CORBA::Long theShapeType,
422 const CORBA::Boolean isSorted)
424 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
426 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
427 if (aShape.IsNull()) return aSeq._retn();
429 Handle(TColStd_HSequenceOfTransient) aHSeq =
430 GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
431 if (!GetOperations()->IsDone() || aHSeq.IsNull())
434 Standard_Integer aLength = aHSeq->Length();
435 aSeq->length(aLength);
436 for (Standard_Integer i = 1; i <= aLength; i++)
437 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
442 //=============================================================================
446 //=============================================================================
447 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
448 const CORBA::Long theShapeType,
449 const CORBA::Boolean isSorted)
451 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
453 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
454 if (aShape.IsNull()) return aSeq._retn();
456 Handle(TColStd_HSequenceOfInteger) aHSeq =
457 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
458 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
460 Standard_Integer aLength = aHSeq->Length();
461 aSeq->length(aLength);
462 for (Standard_Integer i = 1; i <= aLength; i++)
463 aSeq[i-1] = aHSeq->Value(i);
468 //=============================================================================
472 //=============================================================================
473 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
474 (GEOM::GEOM_Object_ptr theMainShape,
475 const CORBA::Long theID)
477 GEOM::GEOM_Object_var aGEOMObject;
479 //Set a not done flag
480 GetOperations()->SetNotDone();
482 //Get the reference objects
483 Handle(GEOM_Object) aShape = GetObjectImpl(theMainShape);
484 if (aShape.IsNull()) return aGEOMObject._retn();
486 Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
487 if (!GetOperations()->IsDone() || anObject.IsNull())
488 return aGEOMObject._retn();
490 return GetObject(anObject);
493 //=============================================================================
497 //=============================================================================
498 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
499 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
501 //Get the reference shapes
502 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
503 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
505 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
507 //Get the unique ID of <theSubShape> inside <theMainShape>
508 CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
509 if (!GetOperations()->IsDone())
515 //=============================================================================
519 //=============================================================================
520 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
521 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
523 //Get the reference shapes
524 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
525 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
527 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
529 //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
530 CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
531 if (!GetOperations()->IsDone())
537 //=============================================================================
541 //=============================================================================
542 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
544 //Get the reference shape
545 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
546 if (aShape.IsNull()) return NULL;
548 // Get shape parameters
549 TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
550 return CORBA::string_dup(aDescription.ToCString());
553 //=============================================================================
557 //=============================================================================
558 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
560 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_FACE));
563 //=============================================================================
567 //=============================================================================
568 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
570 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_EDGE));
573 //=============================================================================
577 //=============================================================================
578 CORBA::Long GEOM_IShapesOperations_i::NumberOfSubShapes (GEOM::GEOM_Object_ptr theShape,
579 const CORBA::Long theShapeType)
581 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
582 if (aShape.IsNull()) return -1;
584 CORBA::Long aNb = GetOperations()->NumberOfSubShapes(aShape, theShapeType);
585 if (!GetOperations()->IsDone()) return -1;
590 //=============================================================================
594 //=============================================================================
595 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
596 (GEOM::GEOM_Object_ptr theShape)
598 GEOM::GEOM_Object_var aGEOMObject;
600 //Set a not done flag
601 GetOperations()->SetNotDone();
603 //Get the reference objects
604 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
605 if (aShape.IsNull()) return aGEOMObject._retn();
608 Handle(GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
609 if (!GetOperations()->IsDone() || anObject.IsNull())
610 return aGEOMObject._retn();
612 return GetObject(anObject);
615 //=============================================================================
619 //=============================================================================
620 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
622 //Set a not done flag
623 GetOperations()->SetNotDone();
625 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
627 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
628 if (aShape.IsNull()) return aSeq._retn();
630 Handle(TColStd_HSequenceOfInteger) aHSeq =
631 GetOperations()->GetFreeFacesIDs(aShape);
632 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
634 Standard_Integer aLength = aHSeq->Length();
635 aSeq->length(aLength);
636 for (Standard_Integer i = 1; i <= aLength; i++)
637 aSeq[i-1] = aHSeq->Value(i);
642 //=============================================================================
646 //=============================================================================
647 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
648 (GEOM::GEOM_Object_ptr theShape1,
649 GEOM::GEOM_Object_ptr theShape2,
650 const CORBA::Long theShapeType)
652 //Set a not done flag
653 GetOperations()->SetNotDone();
655 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
657 Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
658 Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
660 if (aShape1.IsNull() || aShape2.IsNull()) return aSeq._retn();
662 Handle(TColStd_HSequenceOfTransient) aHSeq =
663 GetOperations()->GetSharedShapes(aShape1, aShape2, theShapeType);
664 if (!GetOperations()->IsDone() || aHSeq.IsNull())
667 Standard_Integer aLength = aHSeq->Length();
668 aSeq->length(aLength);
669 for (Standard_Integer i = 1; i <= aLength; i++)
670 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
675 static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
677 GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
681 aState = GEOMAlgo_ST_ON;
684 aState = GEOMAlgo_ST_OUT;
687 aState = GEOMAlgo_ST_ONOUT;
690 aState = GEOMAlgo_ST_IN;
693 aState = GEOMAlgo_ST_ONIN;
702 //=============================================================================
706 //=============================================================================
707 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
708 (GEOM::GEOM_Object_ptr theShape,
709 const CORBA::Long theShapeType,
710 GEOM::GEOM_Object_ptr theAx1,
711 const GEOM::shape_state theState)
713 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
715 //Set a not done flag
716 GetOperations()->SetNotDone();
718 //Get the reference objects
719 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
720 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
722 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
724 //Get Shapes On Plane
725 Handle(TColStd_HSequenceOfTransient) aHSeq =
726 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
727 if (!GetOperations()->IsDone() || aHSeq.IsNull())
730 Standard_Integer aLength = aHSeq->Length();
731 aSeq->length(aLength);
732 for (Standard_Integer i = 1; i <= aLength; i++)
733 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
738 //=============================================================================
740 * GetShapesOnPlaneWithLocation
742 //=============================================================================
743 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
744 (GEOM::GEOM_Object_ptr theShape,
745 const CORBA::Long theShapeType,
746 GEOM::GEOM_Object_ptr theAx1,
747 GEOM::GEOM_Object_ptr thePnt,
748 const GEOM::shape_state theState)
750 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
752 //Set a not done flag
753 GetOperations()->SetNotDone();
755 //Get the reference objects
756 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
757 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
758 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
760 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
762 //Get Shapes On Plane
763 Handle(TColStd_HSequenceOfTransient) aHSeq =
764 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
765 if (!GetOperations()->IsDone() || aHSeq.IsNull())
768 Standard_Integer aLength = aHSeq->Length();
769 aSeq->length(aLength);
770 for (Standard_Integer i = 1; i <= aLength; i++)
771 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
776 //=============================================================================
778 * GetShapesOnCylinder
780 //=============================================================================
781 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
782 (GEOM::GEOM_Object_ptr theShape,
783 const CORBA::Long theShapeType,
784 GEOM::GEOM_Object_ptr theAxis,
785 const CORBA::Double theRadius,
786 const GEOM::shape_state theState)
788 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
790 //Set a not done flag
791 GetOperations()->SetNotDone();
793 //Get the reference objects
794 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
795 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
797 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
799 //Get Shapes On Cylinder
800 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
801 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
802 if (!GetOperations()->IsDone() || aHSeq.IsNull())
805 Standard_Integer aLength = aHSeq->Length();
806 aSeq->length(aLength);
807 for (Standard_Integer i = 1; i <= aLength; i++)
808 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
813 //=============================================================================
815 * GetShapesOnCylinderWithLocation
817 //=============================================================================
818 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocation
819 (GEOM::GEOM_Object_ptr theShape,
820 const CORBA::Long theShapeType,
821 GEOM::GEOM_Object_ptr theAxis,
822 GEOM::GEOM_Object_ptr thePnt,
823 const CORBA::Double theRadius,
824 const GEOM::shape_state theState)
826 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
828 //Set a not done flag
829 GetOperations()->SetNotDone();
831 //Get the reference objects
832 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
833 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
834 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
836 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
838 //Get Shapes On Cylinder
839 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinderWithLocation
840 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
841 if (!GetOperations()->IsDone() || aHSeq.IsNull())
844 Standard_Integer aLength = aHSeq->Length();
845 aSeq->length(aLength);
846 for (Standard_Integer i = 1; i <= aLength; i++)
847 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
852 //=============================================================================
856 //=============================================================================
857 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
858 (GEOM::GEOM_Object_ptr theShape,
859 const CORBA::Long theShapeType,
860 GEOM::GEOM_Object_ptr theCenter,
861 const CORBA::Double theRadius,
862 const GEOM::shape_state theState)
864 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
866 //Set a not done flag
867 GetOperations()->SetNotDone();
869 //Get the reference objects
870 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
871 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
873 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
875 //Get Shapes On Sphere
876 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
877 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
878 if (!GetOperations()->IsDone() || aHSeq.IsNull())
881 Standard_Integer aLength = aHSeq->Length();
882 aSeq->length(aLength);
883 for (Standard_Integer i = 1; i <= aLength; i++)
884 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
889 //=============================================================================
891 * GetShapesOnQuadrangle
893 //=============================================================================
894 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
895 (GEOM::GEOM_Object_ptr theShape,
896 CORBA::Long theShapeType,
897 GEOM::GEOM_Object_ptr theTopLeftPoint,
898 GEOM::GEOM_Object_ptr theTopRigthPoint,
899 GEOM::GEOM_Object_ptr theBottomLeftPoint,
900 GEOM::GEOM_Object_ptr theBottomRigthPoint,
901 GEOM::shape_state theState)
903 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
905 //Set a not done flag
906 GetOperations()->SetNotDone();
908 //Get the reference objects
909 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
910 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
911 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
912 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
913 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
915 if (aShape.IsNull() ||
916 aTopLeftPoint.IsNull() ||
917 aTopRigthPoint.IsNull() ||
918 aBottomLeftPoint.IsNull() ||
919 aBottomRigthPoint.IsNull())
922 //Get Shapes On Quadrangle
923 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
924 (aShape, theShapeType,
925 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
926 ShapeState(theState));
927 if (!GetOperations()->IsDone() || aHSeq.IsNull())
930 Standard_Integer aLength = aHSeq->Length();
931 aSeq->length(aLength);
932 for (Standard_Integer i = 1; i <= aLength; i++)
933 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
938 //=============================================================================
940 * GetShapesOnPlaneIDs
942 //=============================================================================
943 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
944 (GEOM::GEOM_Object_ptr theShape,
945 const CORBA::Long theShapeType,
946 GEOM::GEOM_Object_ptr theAx1,
947 const GEOM::shape_state theState)
949 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
951 //Set a not done flag
952 GetOperations()->SetNotDone();
954 //Get the reference objects
955 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
956 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
958 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
960 //Get Shapes On Plane
961 Handle(TColStd_HSequenceOfInteger) aHSeq =
962 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
963 if (!GetOperations()->IsDone() || aHSeq.IsNull())
966 Standard_Integer aLength = aHSeq->Length();
967 aSeq->length(aLength);
968 for (Standard_Integer i = 1; i <= aLength; i++)
969 aSeq[i-1] = aHSeq->Value(i);
974 //=============================================================================
976 * GetShapesOnPlaneWithLocationIDs
978 //=============================================================================
979 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
980 (GEOM::GEOM_Object_ptr theShape,
981 const CORBA::Long theShapeType,
982 GEOM::GEOM_Object_ptr theAx1,
983 GEOM::GEOM_Object_ptr thePnt,
984 const GEOM::shape_state theState)
986 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
988 //Set a not done flag
989 GetOperations()->SetNotDone();
991 //Get the reference objects
992 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
993 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
994 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
996 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
998 //Get Shapes On Plane
999 Handle(TColStd_HSequenceOfInteger) aHSeq =
1000 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
1001 anAx1, anPnt, ShapeState(theState));
1002 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1003 return aSeq._retn();
1005 Standard_Integer aLength = aHSeq->Length();
1006 aSeq->length(aLength);
1007 for (Standard_Integer i = 1; i <= aLength; i++)
1008 aSeq[i-1] = aHSeq->Value(i);
1010 return aSeq._retn();
1013 //=============================================================================
1015 * GetShapesOnCylinderIDs
1017 //=============================================================================
1018 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1019 (GEOM::GEOM_Object_ptr theShape,
1020 const CORBA::Long theShapeType,
1021 GEOM::GEOM_Object_ptr theAxis,
1022 const CORBA::Double theRadius,
1023 const GEOM::shape_state theState)
1025 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1027 //Set a not done flag
1028 GetOperations()->SetNotDone();
1030 //Get the reference objects
1031 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1032 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1034 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1036 //Get Shapes On Cylinder
1037 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
1038 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1039 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1040 return aSeq._retn();
1042 Standard_Integer aLength = aHSeq->Length();
1043 aSeq->length(aLength);
1044 for (Standard_Integer i = 1; i <= aLength; i++)
1045 aSeq[i-1] = aHSeq->Value(i);
1047 return aSeq._retn();
1050 //=============================================================================
1052 * GetShapesOnCylinderWithLocationIDs
1054 //=============================================================================
1055 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocationIDs
1056 (GEOM::GEOM_Object_ptr theShape,
1057 const CORBA::Long theShapeType,
1058 GEOM::GEOM_Object_ptr theAxis,
1059 GEOM::GEOM_Object_ptr thePnt,
1060 const CORBA::Double theRadius,
1061 const GEOM::shape_state theState)
1063 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1065 //Set a not done flag
1066 GetOperations()->SetNotDone();
1068 //Get the reference objects
1069 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1070 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1071 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1073 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1075 //Get Shapes On Cylinder
1076 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderWithLocationIDs
1077 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1078 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1079 return aSeq._retn();
1081 Standard_Integer aLength = aHSeq->Length();
1082 aSeq->length(aLength);
1083 for (Standard_Integer i = 1; i <= aLength; i++)
1084 aSeq[i-1] = aHSeq->Value(i);
1086 return aSeq._retn();
1089 //=============================================================================
1091 * GetShapesOnSphereIDs
1093 //=============================================================================
1094 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1095 (GEOM::GEOM_Object_ptr theShape,
1096 const CORBA::Long theShapeType,
1097 GEOM::GEOM_Object_ptr theCenter,
1098 const CORBA::Double theRadius,
1099 const GEOM::shape_state theState)
1101 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1103 //Set a not done flag
1104 GetOperations()->SetNotDone();
1106 //Get the reference objects
1107 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1108 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1110 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1112 //Get Shapes On Sphere
1113 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1114 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1115 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1116 return aSeq._retn();
1118 Standard_Integer aLength = aHSeq->Length();
1119 aSeq->length(aLength);
1120 for (Standard_Integer i = 1; i <= aLength; i++)
1121 aSeq[i-1] = aHSeq->Value(i);
1123 return aSeq._retn();
1126 //=============================================================================
1128 * GetShapesOnQuadrangleIDs
1130 //=============================================================================
1131 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1132 (GEOM::GEOM_Object_ptr theShape,
1133 CORBA::Long theShapeType,
1134 GEOM::GEOM_Object_ptr theTopLeftPoint,
1135 GEOM::GEOM_Object_ptr theTopRigthPoint,
1136 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1137 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1138 GEOM::shape_state theState)
1140 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1142 //Set a not done flag
1143 GetOperations()->SetNotDone();
1145 //Get the reference objects
1146 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1147 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1148 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1149 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1150 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1152 if (aShape.IsNull() ||
1153 aTopLeftPoint.IsNull() ||
1154 aTopRigthPoint.IsNull() ||
1155 aBottomLeftPoint.IsNull() ||
1156 aBottomRigthPoint.IsNull() )
1157 return aSeq._retn();
1159 //Get Shapes On Quadrangle
1160 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1161 (aShape, theShapeType,
1162 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1163 ShapeState(theState));
1164 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1165 return aSeq._retn();
1167 Standard_Integer aLength = aHSeq->Length();
1168 aSeq->length(aLength);
1169 for (Standard_Integer i = 1; i <= aLength; i++)
1170 aSeq[i-1] = aHSeq->Value(i);
1172 return aSeq._retn();
1175 //=============================================================================
1179 //=============================================================================
1180 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1181 (GEOM::GEOM_Object_ptr theBox,
1182 GEOM::GEOM_Object_ptr theShape,
1183 CORBA::Long theShapeType,
1184 GEOM::shape_state theState)
1186 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1188 //Set a not done flag
1189 GetOperations()->SetNotDone();
1191 //Get the reference objects
1192 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1193 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1195 if (aShape.IsNull() || aBox.IsNull() )
1196 return aSeq._retn();
1199 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
1200 (aBox,aShape, theShapeType,ShapeState(theState));
1201 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1202 return aSeq._retn();
1204 Standard_Integer aLength = aHSeq->Length();
1205 aSeq->length(aLength);
1206 for (Standard_Integer i = 1; i <= aLength; i++)
1207 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1209 return aSeq._retn();
1212 //=============================================================================
1214 * GetShapesOnQuadrangleIDs
1216 //=============================================================================
1217 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1218 (GEOM::GEOM_Object_ptr theBox,
1219 GEOM::GEOM_Object_ptr theShape,
1220 CORBA::Long theShapeType,
1221 GEOM::shape_state theState)
1223 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1225 //Set a not done flag
1226 GetOperations()->SetNotDone();
1228 //Get the reference objects
1229 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1230 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1232 if (aShape.IsNull() || aBox.IsNull() )
1233 return aSeq._retn();
1236 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1237 (aBox,aShape, theShapeType,ShapeState(theState));
1238 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1239 return aSeq._retn();
1241 Standard_Integer aLength = aHSeq->Length();
1242 aSeq->length(aLength);
1243 for (Standard_Integer i = 1; i <= aLength; i++)
1244 aSeq[i-1] = aHSeq->Value(i);
1246 return aSeq._retn();
1250 //=============================================================================
1254 //=============================================================================
1255 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
1256 (GEOM::GEOM_Object_ptr theCheckShape,
1257 GEOM::GEOM_Object_ptr theShape,
1258 CORBA::Short theShapeType,
1259 GEOM::shape_state theState)
1261 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1263 //Set a not done flag
1264 GetOperations()->SetNotDone();
1266 //Get the reference objects
1267 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1268 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1270 if (aShape.IsNull() || aCheckShape.IsNull() )
1271 return aSeq._retn();
1273 //Get Shapes On Shape
1274 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape
1275 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1277 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1278 return aSeq._retn();
1280 Standard_Integer aLength = aHSeq->Length();
1281 aSeq->length(aLength);
1282 for (Standard_Integer i = 1; i <= aLength; i++)
1283 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1285 return aSeq._retn();
1289 //=============================================================================
1291 * GetShapesOnShapeAsCompound
1293 //=============================================================================
1294 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
1295 (GEOM::GEOM_Object_ptr theCheckShape,
1296 GEOM::GEOM_Object_ptr theShape,
1297 CORBA::Short theShapeType,
1298 GEOM::shape_state theState)
1300 GEOM::GEOM_Object_var aGEOMObject;
1302 //Set a not done flag
1303 GetOperations()->SetNotDone();
1305 //Get the reference objects
1306 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1307 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1309 if (aShape.IsNull() || aCheckShape.IsNull() )
1310 return aGEOMObject._retn();
1312 //Get Shapes On Shape
1313 Handle(GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound
1314 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1316 if (anObject.IsNull())
1317 return aGEOMObject._retn();
1319 return GetObject(anObject);
1323 //=============================================================================
1325 * GetShapesOnShapeIDs
1327 //=============================================================================
1328 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
1329 (GEOM::GEOM_Object_ptr theCheckShape,
1330 GEOM::GEOM_Object_ptr theShape,
1331 CORBA::Short theShapeType,
1332 GEOM::shape_state theState)
1334 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1336 //Set a not done flag
1337 GetOperations()->SetNotDone();
1339 //Get the reference objects
1340 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1341 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1343 if (aShape.IsNull() || aCheckShape.IsNull() )
1344 return aSeq._retn();
1346 //Get Shapes On Shape
1347 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs
1348 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1349 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1350 return aSeq._retn();
1352 Standard_Integer aLength = aHSeq->Length();
1353 aSeq->length(aLength);
1354 for (Standard_Integer i = 1; i <= aLength; i++)
1355 aSeq[i-1] = aHSeq->Value(i);
1357 return aSeq._retn();
1361 //=============================================================================
1365 //=============================================================================
1366 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1367 (GEOM::GEOM_Object_ptr theShapeWhere,
1368 GEOM::GEOM_Object_ptr theShapeWhat)
1370 GEOM::GEOM_Object_var aGEOMObject;
1372 //Set a not done flag
1373 GetOperations()->SetNotDone();
1375 //Get the reference objects
1376 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1377 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1379 if (aShapeWhere.IsNull() ||
1380 aShapeWhat.IsNull()) return aGEOMObject._retn();
1382 //Get Shapes in place of aShapeWhat
1383 Handle(GEOM_Object) anObject =
1384 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1385 if (!GetOperations()->IsDone() || anObject.IsNull())
1386 return aGEOMObject._retn();
1388 return GetObject(anObject);
1391 //=============================================================================
1393 * GetInPlaceByHistory
1395 //=============================================================================
1396 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
1397 (GEOM::GEOM_Object_ptr theShapeWhere,
1398 GEOM::GEOM_Object_ptr theShapeWhat)
1400 GEOM::GEOM_Object_var aGEOMObject;
1402 //Set a not done flag
1403 GetOperations()->SetNotDone();
1405 //Get the reference objects
1406 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1407 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1409 if (aShapeWhere.IsNull() ||
1410 aShapeWhat.IsNull()) return aGEOMObject._retn();
1412 //Get Shapes in place of aShapeWhat
1413 Handle(GEOM_Object) anObject =
1414 GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
1415 if (!GetOperations()->IsDone() || anObject.IsNull())
1416 return aGEOMObject._retn();
1418 return GetObject(anObject);
1421 //=============================================================================
1425 //=============================================================================
1426 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1427 (GEOM::GEOM_Object_ptr theShapeWhere,
1428 GEOM::GEOM_Object_ptr theShapeWhat)
1430 GEOM::GEOM_Object_var aGEOMObject;
1432 //Set a not done flag
1433 GetOperations()->SetNotDone();
1435 //Get the reference objects
1436 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1437 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1439 if (aShapeWhere.IsNull() ||
1440 aShapeWhat.IsNull()) return aGEOMObject._retn();
1442 //Get Shapes in place of aShapeWhat
1443 Handle(GEOM_Object) anObject =
1444 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1445 if (!GetOperations()->IsDone() || anObject.IsNull())
1446 return aGEOMObject._retn();
1448 return GetObject(anObject);