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::MakeEdgeWire
94 (GEOM::GEOM_Object_ptr theWire,
95 const CORBA::Double theLinearTolerance,
96 const CORBA::Double theAngularTolerance)
98 GEOM::GEOM_Object_var aGEOMObject;
100 //Set a not done flag
101 GetOperations()->SetNotDone();
103 //Get the source wire
104 Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
106 if (aWire.IsNull()) return aGEOMObject._retn();
109 Handle(GEOM_Object) anObject = GetOperations()->MakeEdgeWire(aWire, theLinearTolerance, theAngularTolerance);
110 if (!GetOperations()->IsDone() || anObject.IsNull())
111 return aGEOMObject._retn();
113 return GetObject(anObject);
116 //=============================================================================
120 //=============================================================================
121 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire
122 (const GEOM::ListOfGO& theEdgesAndWires,
123 const CORBA::Double theTolerance)
125 GEOM::GEOM_Object_var aGEOMObject;
127 //Set a not done flag
128 GetOperations()->SetNotDone();
131 std::list<Handle(GEOM_Object)> aShapes;
134 aLen = theEdgesAndWires.length();
135 for (ind = 0; ind < aLen; ind++) {
136 Handle(GEOM_Object) aSh = GetObjectImpl(theEdgesAndWires[ind]);
137 if (aSh.IsNull()) return aGEOMObject._retn();
138 aShapes.push_back(aSh);
142 Handle(GEOM_Object) anObject =
143 GetOperations()->MakeWire(aShapes, theTolerance);
144 if (!GetOperations()->IsDone() || anObject.IsNull())
145 return aGEOMObject._retn();
147 return GetObject(anObject);
150 //=============================================================================
154 //=============================================================================
155 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFace
156 (GEOM::GEOM_Object_ptr theWire,
157 const CORBA::Boolean isPlanarWanted)
159 GEOM::GEOM_Object_var aGEOMObject;
161 //Set a not done flag
162 GetOperations()->SetNotDone();
164 //Get the reference wire
165 Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
166 if (aWire.IsNull()) return aGEOMObject._retn();
169 Handle(GEOM_Object) anObject = GetOperations()->MakeFace(aWire, isPlanarWanted);
170 if (!GetOperations()->IsDone() || anObject.IsNull())
171 return aGEOMObject._retn();
173 return GetObject(anObject);
176 //=============================================================================
180 //=============================================================================
181 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWires
182 (const GEOM::ListOfGO& theWires,
183 const CORBA::Boolean isPlanarWanted)
185 GEOM::GEOM_Object_var aGEOMObject;
187 //Set a not done flag
188 GetOperations()->SetNotDone();
191 std::list<Handle(GEOM_Object)> aShapes;
194 aLen = theWires.length();
195 for (ind = 0; ind < aLen; ind++) {
196 Handle(GEOM_Object) aSh = GetObjectImpl(theWires[ind]);
197 if (aSh.IsNull()) return aGEOMObject._retn();
198 aShapes.push_back(aSh);
202 Handle(GEOM_Object) anObject =
203 GetOperations()->MakeFaceWires(aShapes, isPlanarWanted);
204 if (!GetOperations()->IsDone() || anObject.IsNull())
205 return aGEOMObject._retn();
207 return GetObject(anObject);
210 //=============================================================================
214 //=============================================================================
215 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeShell
216 (const GEOM::ListOfGO& theFacesAndShells)
218 GEOM::GEOM_Object_var aGEOMObject;
220 //Set a not done flag
221 GetOperations()->SetNotDone();
224 std::list<Handle(GEOM_Object)> aShapes;
227 aLen = theFacesAndShells.length();
228 for (ind = 0; ind < aLen; ind++) {
229 Handle(GEOM_Object) aSh = GetObjectImpl(theFacesAndShells[ind]);
230 if (aSh.IsNull()) return aGEOMObject._retn();
231 aShapes.push_back(aSh);
235 Handle(GEOM_Object) anObject =
236 GetOperations()->MakeShell(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::MakeSolidShell
249 (GEOM::GEOM_Object_ptr theShell)
251 GEOM::GEOM_Object_var aGEOMObject;
253 //Set a not done flag
254 GetOperations()->SetNotDone();
256 //Get the reference objects
257 Handle(GEOM_Object) aShell = GetObjectImpl(theShell);
258 if (aShell.IsNull()) return aGEOMObject._retn();
260 std::list<Handle(GEOM_Object)> aShapes;
261 aShapes.push_back(aShell);
264 Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShells(aShapes);
265 if (!GetOperations()->IsDone() || anObject.IsNull())
266 return aGEOMObject._retn();
268 return GetObject(anObject);
271 //=============================================================================
275 //=============================================================================
276 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShells
277 (const GEOM::ListOfGO& theShells)
279 GEOM::GEOM_Object_var aGEOMObject;
281 //Set a not done flag
282 GetOperations()->SetNotDone();
285 std::list<Handle(GEOM_Object)> aShapes;
288 aLen = theShells.length();
289 for (ind = 0; ind < aLen; ind++) {
290 Handle(GEOM_Object) aSh = GetObjectImpl(theShells[ind]);
291 if (aSh.IsNull()) return aGEOMObject._retn();
292 aShapes.push_back(aSh);
296 Handle(GEOM_Object) anObject =
297 GetOperations()->MakeSolidShells(aShapes);
298 if (!GetOperations()->IsDone() || anObject.IsNull())
299 return aGEOMObject._retn();
301 return GetObject(anObject);
304 //=============================================================================
308 //=============================================================================
309 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
310 (const GEOM::ListOfGO& theShapes)
312 GEOM::GEOM_Object_var aGEOMObject;
314 //Set a not done flag
315 GetOperations()->SetNotDone();
318 std::list<Handle(GEOM_Object)> aShapes;
321 aLen = theShapes.length();
322 for (ind = 0; ind < aLen; ind++) {
323 Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
324 if (aSh.IsNull()) return aGEOMObject._retn();
325 aShapes.push_back(aSh);
329 Handle(GEOM_Object) anObject =
330 GetOperations()->MakeCompound(aShapes);
331 if (!GetOperations()->IsDone() || anObject.IsNull())
332 return aGEOMObject._retn();
334 return GetObject(anObject);
337 //=============================================================================
341 //=============================================================================
342 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
343 (GEOM::GEOM_Object_ptr theShape,
344 CORBA::Double theTolerance,
345 CORBA::Boolean doKeepNonSolids)
347 GEOM::GEOM_Object_var aGEOMObject;
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 aGEOMObject._retn();
357 Handle(GEOM_Object) anObject =
358 GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
359 //if (!GetOperations()->IsDone() || anObject.IsNull())
361 if (anObject.IsNull())
362 return aGEOMObject._retn();
364 return GetObject(anObject);
368 //=============================================================================
372 //=============================================================================
373 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
374 (GEOM::GEOM_Object_ptr theShape,
375 const CORBA::Double theTolerance)
377 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
379 //Set a not done flag
380 GetOperations()->SetNotDone();
382 //Get the reference objects
383 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
384 if (aShape.IsNull()) return aSeq._retn();
386 Handle(TColStd_HSequenceOfTransient) aHSeq =
387 GetOperations()->GetGlueFaces(aShape, theTolerance);
389 //if (!GetOperations()->IsDone() || aHSeq.IsNull())
394 Standard_Integer aLength = aHSeq->Length();
395 aSeq->length(aLength);
396 for (Standard_Integer i = 1; i <= aLength; i++)
397 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
403 //=============================================================================
405 * MakeGlueFacesByList
407 //=============================================================================
408 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
409 (GEOM::GEOM_Object_ptr theShape,
410 CORBA::Double theTolerance,
411 const GEOM::ListOfGO& theFaces,
412 CORBA::Boolean doKeepNonSolids)
414 GEOM::GEOM_Object_var aGEOMObject;
416 //Set a not done flag
417 GetOperations()->SetNotDone();
419 //Get the reference objects
420 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
421 if (aShape.IsNull()) return aGEOMObject._retn();
424 std::list<Handle(GEOM_Object)> aFaces;
426 aLen = theFaces.length();
427 for (ind = 0; ind < aLen; ind++) {
428 Handle(GEOM_Object) aSh = GetObjectImpl(theFaces[ind]);
429 if (aSh.IsNull()) return aGEOMObject._retn();
430 aFaces.push_back(aSh);
434 Handle(GEOM_Object) anObject =
435 GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces, doKeepNonSolids);
436 //if (!GetOperations()->IsDone() || anObject.IsNull())
438 if (anObject.IsNull())
439 return aGEOMObject._retn();
441 return GetObject(anObject);
444 //=============================================================================
446 * GetExistingSubObjects
448 //=============================================================================
449 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape,
450 CORBA::Boolean theGroupsOnly)
452 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
454 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
455 if (aShape.IsNull()) return aSeq._retn();
457 Handle(TColStd_HSequenceOfTransient) aHSeq =
458 GetOperations()->GetExistingSubObjects(aShape, theGroupsOnly);
459 if (!GetOperations()->IsDone() || aHSeq.IsNull())
462 Standard_Integer aLength = aHSeq->Length();
463 aSeq->length(aLength);
464 for (Standard_Integer i = 1; i <= aLength; i++)
465 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
470 //=============================================================================
474 //=============================================================================
475 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
476 const CORBA::Long theShapeType,
477 const CORBA::Boolean isSorted)
479 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
481 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
482 if (aShape.IsNull()) return aSeq._retn();
484 Handle(TColStd_HSequenceOfTransient) aHSeq =
485 GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
486 if (!GetOperations()->IsDone() || aHSeq.IsNull())
489 Standard_Integer aLength = aHSeq->Length();
490 aSeq->length(aLength);
491 for (Standard_Integer i = 1; i <= aLength; i++)
492 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
497 //=============================================================================
501 //=============================================================================
502 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
503 const CORBA::Long theShapeType,
504 const CORBA::Boolean isSorted)
506 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
508 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
509 if (aShape.IsNull()) return aSeq._retn();
511 Handle(TColStd_HSequenceOfInteger) aHSeq =
512 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
513 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
515 Standard_Integer aLength = aHSeq->Length();
516 aSeq->length(aLength);
517 for (Standard_Integer i = 1; i <= aLength; i++)
518 aSeq[i-1] = aHSeq->Value(i);
523 //=============================================================================
527 //=============================================================================
528 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
529 (GEOM::GEOM_Object_ptr theMainShape,
530 const CORBA::Long theID)
532 GEOM::GEOM_Object_var aGEOMObject;
534 //Set a not done flag
535 GetOperations()->SetNotDone();
537 //Get the reference objects
538 Handle(GEOM_Object) aShape = GetObjectImpl(theMainShape);
539 if (aShape.IsNull()) return aGEOMObject._retn();
541 Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
542 if (!GetOperations()->IsDone() || anObject.IsNull())
543 return aGEOMObject._retn();
545 return GetObject(anObject);
548 //=============================================================================
552 //=============================================================================
553 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
554 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
556 //Get the reference shapes
557 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
558 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
560 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
562 //Get the unique ID of <theSubShape> inside <theMainShape>
563 CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
564 if (!GetOperations()->IsDone())
570 //=============================================================================
574 //=============================================================================
575 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
576 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
578 //Get the reference shapes
579 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
580 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
582 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
584 //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
585 CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
586 if (!GetOperations()->IsDone())
592 //=============================================================================
596 //=============================================================================
597 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
599 //Get the reference shape
600 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
601 if (aShape.IsNull()) return NULL;
603 // Get shape parameters
604 TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
605 return CORBA::string_dup(aDescription.ToCString());
608 //=============================================================================
612 //=============================================================================
613 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
615 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_FACE));
618 //=============================================================================
622 //=============================================================================
623 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
625 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_EDGE));
628 //=============================================================================
632 //=============================================================================
633 CORBA::Long GEOM_IShapesOperations_i::NumberOfSubShapes (GEOM::GEOM_Object_ptr theShape,
634 const CORBA::Long theShapeType)
636 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
637 if (aShape.IsNull()) return -1;
639 CORBA::Long aNb = GetOperations()->NumberOfSubShapes(aShape, theShapeType);
640 if (!GetOperations()->IsDone()) return -1;
645 //=============================================================================
649 //=============================================================================
650 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
651 (GEOM::GEOM_Object_ptr theShape)
653 GEOM::GEOM_Object_var aGEOMObject;
655 //Set a not done flag
656 GetOperations()->SetNotDone();
658 //Get the reference objects
659 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
660 if (aShape.IsNull()) return aGEOMObject._retn();
663 Handle(GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
664 if (!GetOperations()->IsDone() || anObject.IsNull())
665 return aGEOMObject._retn();
667 return GetObject(anObject);
670 //=============================================================================
674 //=============================================================================
675 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
677 //Set a not done flag
678 GetOperations()->SetNotDone();
680 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
682 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
683 if (aShape.IsNull()) return aSeq._retn();
685 Handle(TColStd_HSequenceOfInteger) aHSeq =
686 GetOperations()->GetFreeFacesIDs(aShape);
687 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
689 Standard_Integer aLength = aHSeq->Length();
690 aSeq->length(aLength);
691 for (Standard_Integer i = 1; i <= aLength; i++)
692 aSeq[i-1] = aHSeq->Value(i);
697 //=============================================================================
701 //=============================================================================
702 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
703 (GEOM::GEOM_Object_ptr theShape1,
704 GEOM::GEOM_Object_ptr theShape2,
705 const CORBA::Long theShapeType)
707 //Set a not done flag
708 GetOperations()->SetNotDone();
710 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
712 Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
713 Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
715 if (aShape1.IsNull() || aShape2.IsNull()) return aSeq._retn();
717 Handle(TColStd_HSequenceOfTransient) aHSeq =
718 GetOperations()->GetSharedShapes(aShape1, aShape2, theShapeType);
719 if (!GetOperations()->IsDone() || aHSeq.IsNull())
722 Standard_Integer aLength = aHSeq->Length();
723 aSeq->length(aLength);
724 for (Standard_Integer i = 1; i <= aLength; i++)
725 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
730 static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
732 GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
736 aState = GEOMAlgo_ST_ON;
739 aState = GEOMAlgo_ST_OUT;
742 aState = GEOMAlgo_ST_ONOUT;
745 aState = GEOMAlgo_ST_IN;
748 aState = GEOMAlgo_ST_ONIN;
757 //=============================================================================
761 //=============================================================================
762 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
763 (GEOM::GEOM_Object_ptr theShape,
764 const CORBA::Long theShapeType,
765 GEOM::GEOM_Object_ptr theAx1,
766 const GEOM::shape_state theState)
768 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
770 //Set a not done flag
771 GetOperations()->SetNotDone();
773 //Get the reference objects
774 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
775 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
777 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
779 //Get Shapes On Plane
780 Handle(TColStd_HSequenceOfTransient) aHSeq =
781 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
782 if (!GetOperations()->IsDone() || aHSeq.IsNull())
785 Standard_Integer aLength = aHSeq->Length();
786 aSeq->length(aLength);
787 for (Standard_Integer i = 1; i <= aLength; i++)
788 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
793 //=============================================================================
795 * GetShapesOnPlaneWithLocation
797 //=============================================================================
798 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
799 (GEOM::GEOM_Object_ptr theShape,
800 const CORBA::Long theShapeType,
801 GEOM::GEOM_Object_ptr theAx1,
802 GEOM::GEOM_Object_ptr thePnt,
803 const GEOM::shape_state theState)
805 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
807 //Set a not done flag
808 GetOperations()->SetNotDone();
810 //Get the reference objects
811 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
812 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
813 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
815 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
817 //Get Shapes On Plane
818 Handle(TColStd_HSequenceOfTransient) aHSeq =
819 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
820 if (!GetOperations()->IsDone() || aHSeq.IsNull())
823 Standard_Integer aLength = aHSeq->Length();
824 aSeq->length(aLength);
825 for (Standard_Integer i = 1; i <= aLength; i++)
826 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
831 //=============================================================================
833 * GetShapesOnCylinder
835 //=============================================================================
836 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
837 (GEOM::GEOM_Object_ptr theShape,
838 const CORBA::Long theShapeType,
839 GEOM::GEOM_Object_ptr theAxis,
840 const CORBA::Double theRadius,
841 const GEOM::shape_state theState)
843 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
845 //Set a not done flag
846 GetOperations()->SetNotDone();
848 //Get the reference objects
849 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
850 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
852 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
854 //Get Shapes On Cylinder
855 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
856 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
857 if (!GetOperations()->IsDone() || aHSeq.IsNull())
860 Standard_Integer aLength = aHSeq->Length();
861 aSeq->length(aLength);
862 for (Standard_Integer i = 1; i <= aLength; i++)
863 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
868 //=============================================================================
870 * GetShapesOnCylinderWithLocation
872 //=============================================================================
873 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocation
874 (GEOM::GEOM_Object_ptr theShape,
875 const CORBA::Long theShapeType,
876 GEOM::GEOM_Object_ptr theAxis,
877 GEOM::GEOM_Object_ptr thePnt,
878 const CORBA::Double theRadius,
879 const GEOM::shape_state theState)
881 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
883 //Set a not done flag
884 GetOperations()->SetNotDone();
886 //Get the reference objects
887 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
888 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
889 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
891 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
893 //Get Shapes On Cylinder
894 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinderWithLocation
895 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
896 if (!GetOperations()->IsDone() || aHSeq.IsNull())
899 Standard_Integer aLength = aHSeq->Length();
900 aSeq->length(aLength);
901 for (Standard_Integer i = 1; i <= aLength; i++)
902 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
907 //=============================================================================
911 //=============================================================================
912 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
913 (GEOM::GEOM_Object_ptr theShape,
914 const CORBA::Long theShapeType,
915 GEOM::GEOM_Object_ptr theCenter,
916 const CORBA::Double theRadius,
917 const GEOM::shape_state theState)
919 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
921 //Set a not done flag
922 GetOperations()->SetNotDone();
924 //Get the reference objects
925 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
926 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
928 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
930 //Get Shapes On Sphere
931 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
932 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
933 if (!GetOperations()->IsDone() || aHSeq.IsNull())
936 Standard_Integer aLength = aHSeq->Length();
937 aSeq->length(aLength);
938 for (Standard_Integer i = 1; i <= aLength; i++)
939 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
944 //=============================================================================
946 * GetShapesOnQuadrangle
948 //=============================================================================
949 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
950 (GEOM::GEOM_Object_ptr theShape,
951 CORBA::Long theShapeType,
952 GEOM::GEOM_Object_ptr theTopLeftPoint,
953 GEOM::GEOM_Object_ptr theTopRigthPoint,
954 GEOM::GEOM_Object_ptr theBottomLeftPoint,
955 GEOM::GEOM_Object_ptr theBottomRigthPoint,
956 GEOM::shape_state theState)
958 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
960 //Set a not done flag
961 GetOperations()->SetNotDone();
963 //Get the reference objects
964 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
965 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
966 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
967 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
968 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
970 if (aShape.IsNull() ||
971 aTopLeftPoint.IsNull() ||
972 aTopRigthPoint.IsNull() ||
973 aBottomLeftPoint.IsNull() ||
974 aBottomRigthPoint.IsNull())
977 //Get Shapes On Quadrangle
978 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
979 (aShape, theShapeType,
980 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
981 ShapeState(theState));
982 if (!GetOperations()->IsDone() || aHSeq.IsNull())
985 Standard_Integer aLength = aHSeq->Length();
986 aSeq->length(aLength);
987 for (Standard_Integer i = 1; i <= aLength; i++)
988 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
993 //=============================================================================
995 * GetShapesOnPlaneIDs
997 //=============================================================================
998 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
999 (GEOM::GEOM_Object_ptr theShape,
1000 const CORBA::Long theShapeType,
1001 GEOM::GEOM_Object_ptr theAx1,
1002 const GEOM::shape_state theState)
1004 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1006 //Set a not done flag
1007 GetOperations()->SetNotDone();
1009 //Get the reference objects
1010 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1011 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1013 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
1015 //Get Shapes On Plane
1016 Handle(TColStd_HSequenceOfInteger) aHSeq =
1017 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
1018 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1019 return aSeq._retn();
1021 Standard_Integer aLength = aHSeq->Length();
1022 aSeq->length(aLength);
1023 for (Standard_Integer i = 1; i <= aLength; i++)
1024 aSeq[i-1] = aHSeq->Value(i);
1026 return aSeq._retn();
1029 //=============================================================================
1031 * GetShapesOnPlaneWithLocationIDs
1033 //=============================================================================
1034 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
1035 (GEOM::GEOM_Object_ptr theShape,
1036 const CORBA::Long theShapeType,
1037 GEOM::GEOM_Object_ptr theAx1,
1038 GEOM::GEOM_Object_ptr thePnt,
1039 const GEOM::shape_state theState)
1041 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1043 //Set a not done flag
1044 GetOperations()->SetNotDone();
1046 //Get the reference objects
1047 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1048 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1049 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
1051 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1053 //Get Shapes On Plane
1054 Handle(TColStd_HSequenceOfInteger) aHSeq =
1055 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
1056 anAx1, anPnt, ShapeState(theState));
1057 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1058 return aSeq._retn();
1060 Standard_Integer aLength = aHSeq->Length();
1061 aSeq->length(aLength);
1062 for (Standard_Integer i = 1; i <= aLength; i++)
1063 aSeq[i-1] = aHSeq->Value(i);
1065 return aSeq._retn();
1068 //=============================================================================
1070 * GetShapesOnCylinderIDs
1072 //=============================================================================
1073 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1074 (GEOM::GEOM_Object_ptr theShape,
1075 const CORBA::Long theShapeType,
1076 GEOM::GEOM_Object_ptr theAxis,
1077 const CORBA::Double theRadius,
1078 const GEOM::shape_state theState)
1080 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1082 //Set a not done flag
1083 GetOperations()->SetNotDone();
1085 //Get the reference objects
1086 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1087 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1089 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1091 //Get Shapes On Cylinder
1092 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
1093 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1094 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1095 return aSeq._retn();
1097 Standard_Integer aLength = aHSeq->Length();
1098 aSeq->length(aLength);
1099 for (Standard_Integer i = 1; i <= aLength; i++)
1100 aSeq[i-1] = aHSeq->Value(i);
1102 return aSeq._retn();
1105 //=============================================================================
1107 * GetShapesOnCylinderWithLocationIDs
1109 //=============================================================================
1110 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocationIDs
1111 (GEOM::GEOM_Object_ptr theShape,
1112 const CORBA::Long theShapeType,
1113 GEOM::GEOM_Object_ptr theAxis,
1114 GEOM::GEOM_Object_ptr thePnt,
1115 const CORBA::Double theRadius,
1116 const GEOM::shape_state theState)
1118 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1120 //Set a not done flag
1121 GetOperations()->SetNotDone();
1123 //Get the reference objects
1124 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1125 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1126 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1128 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1130 //Get Shapes On Cylinder
1131 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderWithLocationIDs
1132 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1133 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1134 return aSeq._retn();
1136 Standard_Integer aLength = aHSeq->Length();
1137 aSeq->length(aLength);
1138 for (Standard_Integer i = 1; i <= aLength; i++)
1139 aSeq[i-1] = aHSeq->Value(i);
1141 return aSeq._retn();
1144 //=============================================================================
1146 * GetShapesOnSphereIDs
1148 //=============================================================================
1149 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1150 (GEOM::GEOM_Object_ptr theShape,
1151 const CORBA::Long theShapeType,
1152 GEOM::GEOM_Object_ptr theCenter,
1153 const CORBA::Double theRadius,
1154 const GEOM::shape_state theState)
1156 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1158 //Set a not done flag
1159 GetOperations()->SetNotDone();
1161 //Get the reference objects
1162 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1163 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1165 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1167 //Get Shapes On Sphere
1168 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1169 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1170 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1171 return aSeq._retn();
1173 Standard_Integer aLength = aHSeq->Length();
1174 aSeq->length(aLength);
1175 for (Standard_Integer i = 1; i <= aLength; i++)
1176 aSeq[i-1] = aHSeq->Value(i);
1178 return aSeq._retn();
1181 //=============================================================================
1183 * GetShapesOnQuadrangleIDs
1185 //=============================================================================
1186 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1187 (GEOM::GEOM_Object_ptr theShape,
1188 CORBA::Long theShapeType,
1189 GEOM::GEOM_Object_ptr theTopLeftPoint,
1190 GEOM::GEOM_Object_ptr theTopRigthPoint,
1191 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1192 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1193 GEOM::shape_state theState)
1195 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1197 //Set a not done flag
1198 GetOperations()->SetNotDone();
1200 //Get the reference objects
1201 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1202 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1203 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1204 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1205 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1207 if (aShape.IsNull() ||
1208 aTopLeftPoint.IsNull() ||
1209 aTopRigthPoint.IsNull() ||
1210 aBottomLeftPoint.IsNull() ||
1211 aBottomRigthPoint.IsNull() )
1212 return aSeq._retn();
1214 //Get Shapes On Quadrangle
1215 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1216 (aShape, theShapeType,
1217 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1218 ShapeState(theState));
1219 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1220 return aSeq._retn();
1222 Standard_Integer aLength = aHSeq->Length();
1223 aSeq->length(aLength);
1224 for (Standard_Integer i = 1; i <= aLength; i++)
1225 aSeq[i-1] = aHSeq->Value(i);
1227 return aSeq._retn();
1230 //=============================================================================
1234 //=============================================================================
1235 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1236 (GEOM::GEOM_Object_ptr theBox,
1237 GEOM::GEOM_Object_ptr theShape,
1238 CORBA::Long theShapeType,
1239 GEOM::shape_state theState)
1241 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1243 //Set a not done flag
1244 GetOperations()->SetNotDone();
1246 //Get the reference objects
1247 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1248 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1250 if (aShape.IsNull() || aBox.IsNull() )
1251 return aSeq._retn();
1254 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
1255 (aBox,aShape, theShapeType,ShapeState(theState));
1256 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1257 return aSeq._retn();
1259 Standard_Integer aLength = aHSeq->Length();
1260 aSeq->length(aLength);
1261 for (Standard_Integer i = 1; i <= aLength; i++)
1262 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1264 return aSeq._retn();
1267 //=============================================================================
1269 * GetShapesOnQuadrangleIDs
1271 //=============================================================================
1272 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1273 (GEOM::GEOM_Object_ptr theBox,
1274 GEOM::GEOM_Object_ptr theShape,
1275 CORBA::Long theShapeType,
1276 GEOM::shape_state theState)
1278 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1280 //Set a not done flag
1281 GetOperations()->SetNotDone();
1283 //Get the reference objects
1284 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1285 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1287 if (aShape.IsNull() || aBox.IsNull() )
1288 return aSeq._retn();
1291 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1292 (aBox,aShape, theShapeType,ShapeState(theState));
1293 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1294 return aSeq._retn();
1296 Standard_Integer aLength = aHSeq->Length();
1297 aSeq->length(aLength);
1298 for (Standard_Integer i = 1; i <= aLength; i++)
1299 aSeq[i-1] = aHSeq->Value(i);
1301 return aSeq._retn();
1305 //=============================================================================
1309 //=============================================================================
1310 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
1311 (GEOM::GEOM_Object_ptr theCheckShape,
1312 GEOM::GEOM_Object_ptr theShape,
1313 CORBA::Short theShapeType,
1314 GEOM::shape_state theState)
1316 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1318 //Set a not done flag
1319 GetOperations()->SetNotDone();
1321 //Get the reference objects
1322 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1323 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1325 if (aShape.IsNull() || aCheckShape.IsNull() )
1326 return aSeq._retn();
1328 //Get Shapes On Shape
1329 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape
1330 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1332 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1333 return aSeq._retn();
1335 Standard_Integer aLength = aHSeq->Length();
1336 aSeq->length(aLength);
1337 for (Standard_Integer i = 1; i <= aLength; i++)
1338 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1340 return aSeq._retn();
1344 //=============================================================================
1346 * GetShapesOnShapeAsCompound
1348 //=============================================================================
1349 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
1350 (GEOM::GEOM_Object_ptr theCheckShape,
1351 GEOM::GEOM_Object_ptr theShape,
1352 CORBA::Short theShapeType,
1353 GEOM::shape_state theState)
1355 GEOM::GEOM_Object_var aGEOMObject;
1357 //Set a not done flag
1358 GetOperations()->SetNotDone();
1360 //Get the reference objects
1361 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1362 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1364 if (aShape.IsNull() || aCheckShape.IsNull() )
1365 return aGEOMObject._retn();
1367 //Get Shapes On Shape
1368 Handle(GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound
1369 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1371 if (anObject.IsNull())
1372 return aGEOMObject._retn();
1374 return GetObject(anObject);
1378 //=============================================================================
1380 * GetShapesOnShapeIDs
1382 //=============================================================================
1383 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
1384 (GEOM::GEOM_Object_ptr theCheckShape,
1385 GEOM::GEOM_Object_ptr theShape,
1386 CORBA::Short theShapeType,
1387 GEOM::shape_state theState)
1389 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1391 //Set a not done flag
1392 GetOperations()->SetNotDone();
1394 //Get the reference objects
1395 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1396 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1398 if (aShape.IsNull() || aCheckShape.IsNull() )
1399 return aSeq._retn();
1401 //Get Shapes On Shape
1402 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs
1403 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1404 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1405 return aSeq._retn();
1407 Standard_Integer aLength = aHSeq->Length();
1408 aSeq->length(aLength);
1409 for (Standard_Integer i = 1; i <= aLength; i++)
1410 aSeq[i-1] = aHSeq->Value(i);
1412 return aSeq._retn();
1416 //=============================================================================
1420 //=============================================================================
1421 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1422 (GEOM::GEOM_Object_ptr theShapeWhere,
1423 GEOM::GEOM_Object_ptr theShapeWhat)
1425 GEOM::GEOM_Object_var aGEOMObject;
1427 //Set a not done flag
1428 GetOperations()->SetNotDone();
1430 //Get the reference objects
1431 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1432 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1434 if (aShapeWhere.IsNull() ||
1435 aShapeWhat.IsNull()) return aGEOMObject._retn();
1437 //Get Shapes in place of aShapeWhat
1438 Handle(GEOM_Object) anObject =
1439 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1440 if (!GetOperations()->IsDone() || anObject.IsNull())
1441 return aGEOMObject._retn();
1443 return GetObject(anObject);
1446 //=============================================================================
1448 * GetInPlaceByHistory
1450 //=============================================================================
1451 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
1452 (GEOM::GEOM_Object_ptr theShapeWhere,
1453 GEOM::GEOM_Object_ptr theShapeWhat)
1455 GEOM::GEOM_Object_var aGEOMObject;
1457 //Set a not done flag
1458 GetOperations()->SetNotDone();
1460 //Get the reference objects
1461 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1462 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1464 if (aShapeWhere.IsNull() ||
1465 aShapeWhat.IsNull()) return aGEOMObject._retn();
1467 //Get Shapes in place of aShapeWhat
1468 Handle(GEOM_Object) anObject =
1469 GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
1470 if (!GetOperations()->IsDone() || anObject.IsNull())
1471 return aGEOMObject._retn();
1473 return GetObject(anObject);
1476 //=============================================================================
1480 //=============================================================================
1481 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1482 (GEOM::GEOM_Object_ptr theShapeWhere,
1483 GEOM::GEOM_Object_ptr theShapeWhat)
1485 GEOM::GEOM_Object_var aGEOMObject;
1487 //Set a not done flag
1488 GetOperations()->SetNotDone();
1490 //Get the reference objects
1491 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1492 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1494 if (aShapeWhere.IsNull() ||
1495 aShapeWhat.IsNull()) return aGEOMObject._retn();
1497 //Get Shapes in place of aShapeWhat
1498 Handle(GEOM_Object) anObject =
1499 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1500 if (!GetOperations()->IsDone() || anObject.IsNull())
1501 return aGEOMObject._retn();
1503 return GetObject(anObject);