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();
232 std::list<Handle(GEOM_Object)> aShapes;
233 aShapes.push_back(aShell);
236 Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShells(aShapes);
237 if (!GetOperations()->IsDone() || anObject.IsNull())
238 return aGEOMObject._retn();
240 return GetObject(anObject);
243 //=============================================================================
247 //=============================================================================
248 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShells
249 (const GEOM::ListOfGO& theShells)
251 GEOM::GEOM_Object_var aGEOMObject;
253 //Set a not done flag
254 GetOperations()->SetNotDone();
257 std::list<Handle(GEOM_Object)> aShapes;
260 aLen = theShells.length();
261 for (ind = 0; ind < aLen; ind++) {
262 Handle(GEOM_Object) aSh = GetObjectImpl(theShells[ind]);
263 if (aSh.IsNull()) return aGEOMObject._retn();
264 aShapes.push_back(aSh);
268 Handle(GEOM_Object) anObject =
269 GetOperations()->MakeSolidShells(aShapes);
270 if (!GetOperations()->IsDone() || anObject.IsNull())
271 return aGEOMObject._retn();
273 return GetObject(anObject);
276 //=============================================================================
280 //=============================================================================
281 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
282 (const GEOM::ListOfGO& theShapes)
284 GEOM::GEOM_Object_var aGEOMObject;
286 //Set a not done flag
287 GetOperations()->SetNotDone();
290 std::list<Handle(GEOM_Object)> aShapes;
293 aLen = theShapes.length();
294 for (ind = 0; ind < aLen; ind++) {
295 Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
296 if (aSh.IsNull()) return aGEOMObject._retn();
297 aShapes.push_back(aSh);
301 Handle(GEOM_Object) anObject =
302 GetOperations()->MakeCompound(aShapes);
303 if (!GetOperations()->IsDone() || anObject.IsNull())
304 return aGEOMObject._retn();
306 return GetObject(anObject);
309 //=============================================================================
313 //=============================================================================
314 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
315 (GEOM::GEOM_Object_ptr theShape,
316 CORBA::Double theTolerance,
317 CORBA::Boolean doKeepNonSolids)
319 GEOM::GEOM_Object_var aGEOMObject;
321 //Set a not done flag
322 GetOperations()->SetNotDone();
324 //Get the reference objects
325 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
326 if (aShape.IsNull()) return aGEOMObject._retn();
329 Handle(GEOM_Object) anObject =
330 GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
331 //if (!GetOperations()->IsDone() || anObject.IsNull())
333 if (anObject.IsNull())
334 return aGEOMObject._retn();
336 return GetObject(anObject);
340 //=============================================================================
344 //=============================================================================
345 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
346 (GEOM::GEOM_Object_ptr theShape,
347 const CORBA::Double theTolerance)
349 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
351 //Set a not done flag
352 GetOperations()->SetNotDone();
354 //Get the reference objects
355 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
356 if (aShape.IsNull()) return aSeq._retn();
358 Handle(TColStd_HSequenceOfTransient) aHSeq =
359 GetOperations()->GetGlueFaces(aShape, theTolerance);
361 //if (!GetOperations()->IsDone() || aHSeq.IsNull())
366 Standard_Integer aLength = aHSeq->Length();
367 aSeq->length(aLength);
368 for (Standard_Integer i = 1; i <= aLength; i++)
369 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
375 //=============================================================================
377 * MakeGlueFacesByList
379 //=============================================================================
380 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
381 (GEOM::GEOM_Object_ptr theShape,
382 CORBA::Double theTolerance,
383 const GEOM::ListOfGO& theFaces,
384 CORBA::Boolean doKeepNonSolids)
386 GEOM::GEOM_Object_var aGEOMObject;
388 //Set a not done flag
389 GetOperations()->SetNotDone();
391 //Get the reference objects
392 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
393 if (aShape.IsNull()) return aGEOMObject._retn();
396 std::list<Handle(GEOM_Object)> aFaces;
398 aLen = theFaces.length();
399 for (ind = 0; ind < aLen; ind++) {
400 Handle(GEOM_Object) aSh = GetObjectImpl(theFaces[ind]);
401 if (aSh.IsNull()) return aGEOMObject._retn();
402 aFaces.push_back(aSh);
406 Handle(GEOM_Object) anObject =
407 GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces, doKeepNonSolids);
408 //if (!GetOperations()->IsDone() || anObject.IsNull())
410 if (anObject.IsNull())
411 return aGEOMObject._retn();
413 return GetObject(anObject);
416 //=============================================================================
418 * GetExistingSubObjects
420 //=============================================================================
421 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape,
422 CORBA::Boolean theGroupsOnly)
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()->GetExistingSubObjects(aShape, theGroupsOnly);
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::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
448 const CORBA::Long theShapeType,
449 const CORBA::Boolean isSorted)
451 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
453 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
454 if (aShape.IsNull()) return aSeq._retn();
456 Handle(TColStd_HSequenceOfTransient) aHSeq =
457 GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
458 if (!GetOperations()->IsDone() || aHSeq.IsNull())
461 Standard_Integer aLength = aHSeq->Length();
462 aSeq->length(aLength);
463 for (Standard_Integer i = 1; i <= aLength; i++)
464 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
469 //=============================================================================
473 //=============================================================================
474 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
475 const CORBA::Long theShapeType,
476 const CORBA::Boolean isSorted)
478 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
480 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
481 if (aShape.IsNull()) return aSeq._retn();
483 Handle(TColStd_HSequenceOfInteger) aHSeq =
484 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
485 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
487 Standard_Integer aLength = aHSeq->Length();
488 aSeq->length(aLength);
489 for (Standard_Integer i = 1; i <= aLength; i++)
490 aSeq[i-1] = aHSeq->Value(i);
495 //=============================================================================
499 //=============================================================================
500 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
501 (GEOM::GEOM_Object_ptr theMainShape,
502 const CORBA::Long theID)
504 GEOM::GEOM_Object_var aGEOMObject;
506 //Set a not done flag
507 GetOperations()->SetNotDone();
509 //Get the reference objects
510 Handle(GEOM_Object) aShape = GetObjectImpl(theMainShape);
511 if (aShape.IsNull()) return aGEOMObject._retn();
513 Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
514 if (!GetOperations()->IsDone() || anObject.IsNull())
515 return aGEOMObject._retn();
517 return GetObject(anObject);
520 //=============================================================================
524 //=============================================================================
525 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
526 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
528 //Get the reference shapes
529 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
530 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
532 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
534 //Get the unique ID of <theSubShape> inside <theMainShape>
535 CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
536 if (!GetOperations()->IsDone())
542 //=============================================================================
546 //=============================================================================
547 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
548 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
550 //Get the reference shapes
551 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
552 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
554 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
556 //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
557 CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
558 if (!GetOperations()->IsDone())
564 //=============================================================================
568 //=============================================================================
569 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
571 //Get the reference shape
572 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
573 if (aShape.IsNull()) return NULL;
575 // Get shape parameters
576 TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
577 return CORBA::string_dup(aDescription.ToCString());
580 //=============================================================================
584 //=============================================================================
585 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
587 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_FACE));
590 //=============================================================================
594 //=============================================================================
595 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
597 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_EDGE));
600 //=============================================================================
604 //=============================================================================
605 CORBA::Long GEOM_IShapesOperations_i::NumberOfSubShapes (GEOM::GEOM_Object_ptr theShape,
606 const CORBA::Long theShapeType)
608 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
609 if (aShape.IsNull()) return -1;
611 CORBA::Long aNb = GetOperations()->NumberOfSubShapes(aShape, theShapeType);
612 if (!GetOperations()->IsDone()) return -1;
617 //=============================================================================
621 //=============================================================================
622 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
623 (GEOM::GEOM_Object_ptr theShape)
625 GEOM::GEOM_Object_var aGEOMObject;
627 //Set a not done flag
628 GetOperations()->SetNotDone();
630 //Get the reference objects
631 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
632 if (aShape.IsNull()) return aGEOMObject._retn();
635 Handle(GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
636 if (!GetOperations()->IsDone() || anObject.IsNull())
637 return aGEOMObject._retn();
639 return GetObject(anObject);
642 //=============================================================================
646 //=============================================================================
647 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
649 //Set a not done flag
650 GetOperations()->SetNotDone();
652 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
654 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
655 if (aShape.IsNull()) return aSeq._retn();
657 Handle(TColStd_HSequenceOfInteger) aHSeq =
658 GetOperations()->GetFreeFacesIDs(aShape);
659 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
661 Standard_Integer aLength = aHSeq->Length();
662 aSeq->length(aLength);
663 for (Standard_Integer i = 1; i <= aLength; i++)
664 aSeq[i-1] = aHSeq->Value(i);
669 //=============================================================================
673 //=============================================================================
674 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
675 (GEOM::GEOM_Object_ptr theShape1,
676 GEOM::GEOM_Object_ptr theShape2,
677 const CORBA::Long theShapeType)
679 //Set a not done flag
680 GetOperations()->SetNotDone();
682 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
684 Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
685 Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
687 if (aShape1.IsNull() || aShape2.IsNull()) return aSeq._retn();
689 Handle(TColStd_HSequenceOfTransient) aHSeq =
690 GetOperations()->GetSharedShapes(aShape1, aShape2, theShapeType);
691 if (!GetOperations()->IsDone() || aHSeq.IsNull())
694 Standard_Integer aLength = aHSeq->Length();
695 aSeq->length(aLength);
696 for (Standard_Integer i = 1; i <= aLength; i++)
697 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
702 static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
704 GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
708 aState = GEOMAlgo_ST_ON;
711 aState = GEOMAlgo_ST_OUT;
714 aState = GEOMAlgo_ST_ONOUT;
717 aState = GEOMAlgo_ST_IN;
720 aState = GEOMAlgo_ST_ONIN;
729 //=============================================================================
733 //=============================================================================
734 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
735 (GEOM::GEOM_Object_ptr theShape,
736 const CORBA::Long theShapeType,
737 GEOM::GEOM_Object_ptr theAx1,
738 const GEOM::shape_state theState)
740 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
742 //Set a not done flag
743 GetOperations()->SetNotDone();
745 //Get the reference objects
746 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
747 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
749 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
751 //Get Shapes On Plane
752 Handle(TColStd_HSequenceOfTransient) aHSeq =
753 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
754 if (!GetOperations()->IsDone() || aHSeq.IsNull())
757 Standard_Integer aLength = aHSeq->Length();
758 aSeq->length(aLength);
759 for (Standard_Integer i = 1; i <= aLength; i++)
760 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
765 //=============================================================================
767 * GetShapesOnPlaneWithLocation
769 //=============================================================================
770 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
771 (GEOM::GEOM_Object_ptr theShape,
772 const CORBA::Long theShapeType,
773 GEOM::GEOM_Object_ptr theAx1,
774 GEOM::GEOM_Object_ptr thePnt,
775 const GEOM::shape_state theState)
777 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
779 //Set a not done flag
780 GetOperations()->SetNotDone();
782 //Get the reference objects
783 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
784 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
785 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
787 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
789 //Get Shapes On Plane
790 Handle(TColStd_HSequenceOfTransient) aHSeq =
791 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
792 if (!GetOperations()->IsDone() || aHSeq.IsNull())
795 Standard_Integer aLength = aHSeq->Length();
796 aSeq->length(aLength);
797 for (Standard_Integer i = 1; i <= aLength; i++)
798 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
803 //=============================================================================
805 * GetShapesOnCylinder
807 //=============================================================================
808 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
809 (GEOM::GEOM_Object_ptr theShape,
810 const CORBA::Long theShapeType,
811 GEOM::GEOM_Object_ptr theAxis,
812 const CORBA::Double theRadius,
813 const GEOM::shape_state theState)
815 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
817 //Set a not done flag
818 GetOperations()->SetNotDone();
820 //Get the reference objects
821 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
822 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
824 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
826 //Get Shapes On Cylinder
827 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
828 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
829 if (!GetOperations()->IsDone() || aHSeq.IsNull())
832 Standard_Integer aLength = aHSeq->Length();
833 aSeq->length(aLength);
834 for (Standard_Integer i = 1; i <= aLength; i++)
835 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
840 //=============================================================================
842 * GetShapesOnCylinderWithLocation
844 //=============================================================================
845 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocation
846 (GEOM::GEOM_Object_ptr theShape,
847 const CORBA::Long theShapeType,
848 GEOM::GEOM_Object_ptr theAxis,
849 GEOM::GEOM_Object_ptr thePnt,
850 const CORBA::Double theRadius,
851 const GEOM::shape_state theState)
853 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
855 //Set a not done flag
856 GetOperations()->SetNotDone();
858 //Get the reference objects
859 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
860 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
861 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
863 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
865 //Get Shapes On Cylinder
866 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinderWithLocation
867 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
868 if (!GetOperations()->IsDone() || aHSeq.IsNull())
871 Standard_Integer aLength = aHSeq->Length();
872 aSeq->length(aLength);
873 for (Standard_Integer i = 1; i <= aLength; i++)
874 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
879 //=============================================================================
883 //=============================================================================
884 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
885 (GEOM::GEOM_Object_ptr theShape,
886 const CORBA::Long theShapeType,
887 GEOM::GEOM_Object_ptr theCenter,
888 const CORBA::Double theRadius,
889 const GEOM::shape_state theState)
891 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
893 //Set a not done flag
894 GetOperations()->SetNotDone();
896 //Get the reference objects
897 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
898 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
900 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
902 //Get Shapes On Sphere
903 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
904 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
905 if (!GetOperations()->IsDone() || aHSeq.IsNull())
908 Standard_Integer aLength = aHSeq->Length();
909 aSeq->length(aLength);
910 for (Standard_Integer i = 1; i <= aLength; i++)
911 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
916 //=============================================================================
918 * GetShapesOnQuadrangle
920 //=============================================================================
921 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
922 (GEOM::GEOM_Object_ptr theShape,
923 CORBA::Long theShapeType,
924 GEOM::GEOM_Object_ptr theTopLeftPoint,
925 GEOM::GEOM_Object_ptr theTopRigthPoint,
926 GEOM::GEOM_Object_ptr theBottomLeftPoint,
927 GEOM::GEOM_Object_ptr theBottomRigthPoint,
928 GEOM::shape_state theState)
930 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
932 //Set a not done flag
933 GetOperations()->SetNotDone();
935 //Get the reference objects
936 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
937 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
938 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
939 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
940 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
942 if (aShape.IsNull() ||
943 aTopLeftPoint.IsNull() ||
944 aTopRigthPoint.IsNull() ||
945 aBottomLeftPoint.IsNull() ||
946 aBottomRigthPoint.IsNull())
949 //Get Shapes On Quadrangle
950 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
951 (aShape, theShapeType,
952 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
953 ShapeState(theState));
954 if (!GetOperations()->IsDone() || aHSeq.IsNull())
957 Standard_Integer aLength = aHSeq->Length();
958 aSeq->length(aLength);
959 for (Standard_Integer i = 1; i <= aLength; i++)
960 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
965 //=============================================================================
967 * GetShapesOnPlaneIDs
969 //=============================================================================
970 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
971 (GEOM::GEOM_Object_ptr theShape,
972 const CORBA::Long theShapeType,
973 GEOM::GEOM_Object_ptr theAx1,
974 const GEOM::shape_state theState)
976 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
978 //Set a not done flag
979 GetOperations()->SetNotDone();
981 //Get the reference objects
982 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
983 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
985 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
987 //Get Shapes On Plane
988 Handle(TColStd_HSequenceOfInteger) aHSeq =
989 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
990 if (!GetOperations()->IsDone() || aHSeq.IsNull())
993 Standard_Integer aLength = aHSeq->Length();
994 aSeq->length(aLength);
995 for (Standard_Integer i = 1; i <= aLength; i++)
996 aSeq[i-1] = aHSeq->Value(i);
1001 //=============================================================================
1003 * GetShapesOnPlaneWithLocationIDs
1005 //=============================================================================
1006 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
1007 (GEOM::GEOM_Object_ptr theShape,
1008 const CORBA::Long theShapeType,
1009 GEOM::GEOM_Object_ptr theAx1,
1010 GEOM::GEOM_Object_ptr thePnt,
1011 const GEOM::shape_state theState)
1013 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1015 //Set a not done flag
1016 GetOperations()->SetNotDone();
1018 //Get the reference objects
1019 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1020 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1021 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
1023 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1025 //Get Shapes On Plane
1026 Handle(TColStd_HSequenceOfInteger) aHSeq =
1027 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
1028 anAx1, anPnt, ShapeState(theState));
1029 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1030 return aSeq._retn();
1032 Standard_Integer aLength = aHSeq->Length();
1033 aSeq->length(aLength);
1034 for (Standard_Integer i = 1; i <= aLength; i++)
1035 aSeq[i-1] = aHSeq->Value(i);
1037 return aSeq._retn();
1040 //=============================================================================
1042 * GetShapesOnCylinderIDs
1044 //=============================================================================
1045 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1046 (GEOM::GEOM_Object_ptr theShape,
1047 const CORBA::Long theShapeType,
1048 GEOM::GEOM_Object_ptr theAxis,
1049 const CORBA::Double theRadius,
1050 const GEOM::shape_state theState)
1052 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1054 //Set a not done flag
1055 GetOperations()->SetNotDone();
1057 //Get the reference objects
1058 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1059 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1061 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1063 //Get Shapes On Cylinder
1064 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
1065 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1066 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1067 return aSeq._retn();
1069 Standard_Integer aLength = aHSeq->Length();
1070 aSeq->length(aLength);
1071 for (Standard_Integer i = 1; i <= aLength; i++)
1072 aSeq[i-1] = aHSeq->Value(i);
1074 return aSeq._retn();
1077 //=============================================================================
1079 * GetShapesOnCylinderWithLocationIDs
1081 //=============================================================================
1082 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocationIDs
1083 (GEOM::GEOM_Object_ptr theShape,
1084 const CORBA::Long theShapeType,
1085 GEOM::GEOM_Object_ptr theAxis,
1086 GEOM::GEOM_Object_ptr thePnt,
1087 const CORBA::Double theRadius,
1088 const GEOM::shape_state theState)
1090 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1092 //Set a not done flag
1093 GetOperations()->SetNotDone();
1095 //Get the reference objects
1096 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1097 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1098 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1100 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1102 //Get Shapes On Cylinder
1103 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderWithLocationIDs
1104 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1105 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1106 return aSeq._retn();
1108 Standard_Integer aLength = aHSeq->Length();
1109 aSeq->length(aLength);
1110 for (Standard_Integer i = 1; i <= aLength; i++)
1111 aSeq[i-1] = aHSeq->Value(i);
1113 return aSeq._retn();
1116 //=============================================================================
1118 * GetShapesOnSphereIDs
1120 //=============================================================================
1121 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1122 (GEOM::GEOM_Object_ptr theShape,
1123 const CORBA::Long theShapeType,
1124 GEOM::GEOM_Object_ptr theCenter,
1125 const CORBA::Double theRadius,
1126 const GEOM::shape_state theState)
1128 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1130 //Set a not done flag
1131 GetOperations()->SetNotDone();
1133 //Get the reference objects
1134 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1135 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1137 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1139 //Get Shapes On Sphere
1140 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1141 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1142 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1143 return aSeq._retn();
1145 Standard_Integer aLength = aHSeq->Length();
1146 aSeq->length(aLength);
1147 for (Standard_Integer i = 1; i <= aLength; i++)
1148 aSeq[i-1] = aHSeq->Value(i);
1150 return aSeq._retn();
1153 //=============================================================================
1155 * GetShapesOnQuadrangleIDs
1157 //=============================================================================
1158 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1159 (GEOM::GEOM_Object_ptr theShape,
1160 CORBA::Long theShapeType,
1161 GEOM::GEOM_Object_ptr theTopLeftPoint,
1162 GEOM::GEOM_Object_ptr theTopRigthPoint,
1163 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1164 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1165 GEOM::shape_state theState)
1167 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1169 //Set a not done flag
1170 GetOperations()->SetNotDone();
1172 //Get the reference objects
1173 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1174 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1175 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1176 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1177 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1179 if (aShape.IsNull() ||
1180 aTopLeftPoint.IsNull() ||
1181 aTopRigthPoint.IsNull() ||
1182 aBottomLeftPoint.IsNull() ||
1183 aBottomRigthPoint.IsNull() )
1184 return aSeq._retn();
1186 //Get Shapes On Quadrangle
1187 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1188 (aShape, theShapeType,
1189 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1190 ShapeState(theState));
1191 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1192 return aSeq._retn();
1194 Standard_Integer aLength = aHSeq->Length();
1195 aSeq->length(aLength);
1196 for (Standard_Integer i = 1; i <= aLength; i++)
1197 aSeq[i-1] = aHSeq->Value(i);
1199 return aSeq._retn();
1202 //=============================================================================
1206 //=============================================================================
1207 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1208 (GEOM::GEOM_Object_ptr theBox,
1209 GEOM::GEOM_Object_ptr theShape,
1210 CORBA::Long theShapeType,
1211 GEOM::shape_state theState)
1213 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1215 //Set a not done flag
1216 GetOperations()->SetNotDone();
1218 //Get the reference objects
1219 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1220 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1222 if (aShape.IsNull() || aBox.IsNull() )
1223 return aSeq._retn();
1226 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
1227 (aBox,aShape, theShapeType,ShapeState(theState));
1228 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1229 return aSeq._retn();
1231 Standard_Integer aLength = aHSeq->Length();
1232 aSeq->length(aLength);
1233 for (Standard_Integer i = 1; i <= aLength; i++)
1234 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1236 return aSeq._retn();
1239 //=============================================================================
1241 * GetShapesOnQuadrangleIDs
1243 //=============================================================================
1244 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1245 (GEOM::GEOM_Object_ptr theBox,
1246 GEOM::GEOM_Object_ptr theShape,
1247 CORBA::Long theShapeType,
1248 GEOM::shape_state theState)
1250 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1252 //Set a not done flag
1253 GetOperations()->SetNotDone();
1255 //Get the reference objects
1256 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1257 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1259 if (aShape.IsNull() || aBox.IsNull() )
1260 return aSeq._retn();
1263 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1264 (aBox,aShape, theShapeType,ShapeState(theState));
1265 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1266 return aSeq._retn();
1268 Standard_Integer aLength = aHSeq->Length();
1269 aSeq->length(aLength);
1270 for (Standard_Integer i = 1; i <= aLength; i++)
1271 aSeq[i-1] = aHSeq->Value(i);
1273 return aSeq._retn();
1277 //=============================================================================
1281 //=============================================================================
1282 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
1283 (GEOM::GEOM_Object_ptr theCheckShape,
1284 GEOM::GEOM_Object_ptr theShape,
1285 CORBA::Short theShapeType,
1286 GEOM::shape_state theState)
1288 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1290 //Set a not done flag
1291 GetOperations()->SetNotDone();
1293 //Get the reference objects
1294 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1295 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1297 if (aShape.IsNull() || aCheckShape.IsNull() )
1298 return aSeq._retn();
1300 //Get Shapes On Shape
1301 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape
1302 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1304 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1305 return aSeq._retn();
1307 Standard_Integer aLength = aHSeq->Length();
1308 aSeq->length(aLength);
1309 for (Standard_Integer i = 1; i <= aLength; i++)
1310 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1312 return aSeq._retn();
1316 //=============================================================================
1318 * GetShapesOnShapeAsCompound
1320 //=============================================================================
1321 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
1322 (GEOM::GEOM_Object_ptr theCheckShape,
1323 GEOM::GEOM_Object_ptr theShape,
1324 CORBA::Short theShapeType,
1325 GEOM::shape_state theState)
1327 GEOM::GEOM_Object_var aGEOMObject;
1329 //Set a not done flag
1330 GetOperations()->SetNotDone();
1332 //Get the reference objects
1333 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1334 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1336 if (aShape.IsNull() || aCheckShape.IsNull() )
1337 return aGEOMObject._retn();
1339 //Get Shapes On Shape
1340 Handle(GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound
1341 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1343 if (anObject.IsNull())
1344 return aGEOMObject._retn();
1346 return GetObject(anObject);
1350 //=============================================================================
1352 * GetShapesOnShapeIDs
1354 //=============================================================================
1355 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
1356 (GEOM::GEOM_Object_ptr theCheckShape,
1357 GEOM::GEOM_Object_ptr theShape,
1358 CORBA::Short theShapeType,
1359 GEOM::shape_state theState)
1361 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1363 //Set a not done flag
1364 GetOperations()->SetNotDone();
1366 //Get the reference objects
1367 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1368 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1370 if (aShape.IsNull() || aCheckShape.IsNull() )
1371 return aSeq._retn();
1373 //Get Shapes On Shape
1374 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs
1375 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1376 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1377 return aSeq._retn();
1379 Standard_Integer aLength = aHSeq->Length();
1380 aSeq->length(aLength);
1381 for (Standard_Integer i = 1; i <= aLength; i++)
1382 aSeq[i-1] = aHSeq->Value(i);
1384 return aSeq._retn();
1388 //=============================================================================
1392 //=============================================================================
1393 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1394 (GEOM::GEOM_Object_ptr theShapeWhere,
1395 GEOM::GEOM_Object_ptr theShapeWhat)
1397 GEOM::GEOM_Object_var aGEOMObject;
1399 //Set a not done flag
1400 GetOperations()->SetNotDone();
1402 //Get the reference objects
1403 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1404 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1406 if (aShapeWhere.IsNull() ||
1407 aShapeWhat.IsNull()) return aGEOMObject._retn();
1409 //Get Shapes in place of aShapeWhat
1410 Handle(GEOM_Object) anObject =
1411 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1412 if (!GetOperations()->IsDone() || anObject.IsNull())
1413 return aGEOMObject._retn();
1415 return GetObject(anObject);
1418 //=============================================================================
1420 * GetInPlaceByHistory
1422 //=============================================================================
1423 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
1424 (GEOM::GEOM_Object_ptr theShapeWhere,
1425 GEOM::GEOM_Object_ptr theShapeWhat)
1427 GEOM::GEOM_Object_var aGEOMObject;
1429 //Set a not done flag
1430 GetOperations()->SetNotDone();
1432 //Get the reference objects
1433 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1434 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1436 if (aShapeWhere.IsNull() ||
1437 aShapeWhat.IsNull()) return aGEOMObject._retn();
1439 //Get Shapes in place of aShapeWhat
1440 Handle(GEOM_Object) anObject =
1441 GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
1442 if (!GetOperations()->IsDone() || anObject.IsNull())
1443 return aGEOMObject._retn();
1445 return GetObject(anObject);
1448 //=============================================================================
1452 //=============================================================================
1453 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1454 (GEOM::GEOM_Object_ptr theShapeWhere,
1455 GEOM::GEOM_Object_ptr theShapeWhat)
1457 GEOM::GEOM_Object_var aGEOMObject;
1459 //Set a not done flag
1460 GetOperations()->SetNotDone();
1462 //Get the reference objects
1463 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1464 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1466 if (aShapeWhere.IsNull() ||
1467 aShapeWhat.IsNull()) return aGEOMObject._retn();
1469 //Get Shapes in place of aShapeWhat
1470 Handle(GEOM_Object) anObject =
1471 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1472 if (!GetOperations()->IsDone() || anObject.IsNull())
1473 return aGEOMObject._retn();
1475 return GetObject(anObject);