1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <Standard_Stream.hxx>
22 #include "GEOM_IShapesOperations_i.hh"
24 #include "utilities.h"
26 #include "Utils_ExceptHandlers.hxx"
28 #include "GEOM_Engine.hxx"
29 #include "GEOM_Object.hxx"
31 #include <TColStd_HSequenceOfTransient.hxx>
32 #include <TColStd_HArray1OfInteger.hxx>
34 //=============================================================================
38 //=============================================================================
39 GEOM_IShapesOperations_i::GEOM_IShapesOperations_i (PortableServer::POA_ptr thePOA,
40 GEOM::GEOM_Gen_ptr theEngine,
41 ::GEOMImpl_IShapesOperations* theImpl)
42 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
44 MESSAGE("GEOM_IShapesOperations_i::GEOM_IShapesOperations_i");
47 //=============================================================================
51 //=============================================================================
52 GEOM_IShapesOperations_i::~GEOM_IShapesOperations_i()
54 MESSAGE("GEOM_IShapesOperations_i::~GEOM_IShapesOperations_i");
58 //=============================================================================
62 //=============================================================================
63 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdge
64 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
66 GEOM::GEOM_Object_var aGEOMObject;
69 GetOperations()->SetNotDone();
71 if (thePnt1 == NULL || thePnt2 == NULL) return aGEOMObject._retn();
73 //Get the reference points
74 Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
75 (thePnt1->GetStudyID(), thePnt1->GetEntry());
76 Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
77 (thePnt2->GetStudyID(), thePnt2->GetEntry());
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)
97 GEOM::GEOM_Object_var aGEOMObject;
100 GetOperations()->SetNotDone();
103 list<Handle(GEOM_Object)> aShapes;
106 aLen = theEdgesAndWires.length();
107 for (ind = 0; ind < aLen; ind++) {
108 if (theEdgesAndWires[ind] == NULL) return aGEOMObject._retn();
109 Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
110 (theEdgesAndWires[ind]->GetStudyID(), theEdgesAndWires[ind]->GetEntry());
111 if (aSh.IsNull()) return aGEOMObject._retn();
112 aShapes.push_back(aSh);
116 Handle(GEOM_Object) anObject =
117 GetOperations()->MakeWire(aShapes);
118 if (!GetOperations()->IsDone() || anObject.IsNull())
119 return aGEOMObject._retn();
121 return GetObject(anObject);
124 //=============================================================================
128 //=============================================================================
129 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFace
130 (GEOM::GEOM_Object_ptr theWire,
131 const CORBA::Boolean isPlanarWanted)
133 GEOM::GEOM_Object_var aGEOMObject;
135 //Set a not done flag
136 GetOperations()->SetNotDone();
138 if (theWire == NULL) return aGEOMObject._retn();
140 //Get the reference wire
141 Handle(GEOM_Object) aWire = GetOperations()->GetEngine()->GetObject
142 (theWire->GetStudyID(), theWire->GetEntry());
144 if (aWire.IsNull()) return aGEOMObject._retn();
147 Handle(GEOM_Object) anObject = GetOperations()->MakeFace(aWire, isPlanarWanted);
148 if (!GetOperations()->IsDone() || anObject.IsNull())
149 return aGEOMObject._retn();
151 return GetObject(anObject);
154 //=============================================================================
158 //=============================================================================
159 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWires
160 (const GEOM::ListOfGO& theWires,
161 const CORBA::Boolean isPlanarWanted)
163 GEOM::GEOM_Object_var aGEOMObject;
165 //Set a not done flag
166 GetOperations()->SetNotDone();
169 list<Handle(GEOM_Object)> aShapes;
172 aLen = theWires.length();
173 for (ind = 0; ind < aLen; ind++) {
174 if (theWires[ind] == NULL) return aGEOMObject._retn();
175 Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
176 (theWires[ind]->GetStudyID(), theWires[ind]->GetEntry());
177 if (aSh.IsNull()) return aGEOMObject._retn();
178 aShapes.push_back(aSh);
182 Handle(GEOM_Object) anObject =
183 GetOperations()->MakeFaceWires(aShapes, isPlanarWanted);
184 if (!GetOperations()->IsDone() || anObject.IsNull())
185 return aGEOMObject._retn();
187 return GetObject(anObject);
190 //=============================================================================
194 //=============================================================================
195 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeShell
196 (const GEOM::ListOfGO& theFacesAndShells)
198 GEOM::GEOM_Object_var aGEOMObject;
200 //Set a not done flag
201 GetOperations()->SetNotDone();
204 list<Handle(GEOM_Object)> aShapes;
207 aLen = theFacesAndShells.length();
208 for (ind = 0; ind < aLen; ind++) {
209 if (theFacesAndShells[ind] == NULL) return aGEOMObject._retn();
210 Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
211 (theFacesAndShells[ind]->GetStudyID(), theFacesAndShells[ind]->GetEntry());
212 if (aSh.IsNull()) return aGEOMObject._retn();
213 aShapes.push_back(aSh);
217 Handle(GEOM_Object) anObject =
218 GetOperations()->MakeShell(aShapes);
219 if (!GetOperations()->IsDone() || anObject.IsNull())
220 return aGEOMObject._retn();
222 return GetObject(anObject);
225 //=============================================================================
229 //=============================================================================
230 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShell
231 (GEOM::GEOM_Object_ptr theShell)
233 GEOM::GEOM_Object_var aGEOMObject;
235 //Set a not done flag
236 GetOperations()->SetNotDone();
238 if (theShell == NULL) return aGEOMObject._retn();
240 //Get the reference objects
241 Handle(GEOM_Object) aShell = GetOperations()->GetEngine()->GetObject
242 (theShell->GetStudyID(), theShell->GetEntry());
244 if (aShell.IsNull()) return aGEOMObject._retn();
247 Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShell(aShell);
248 if (!GetOperations()->IsDone() || anObject.IsNull())
249 return aGEOMObject._retn();
251 return GetObject(anObject);
254 //=============================================================================
258 //=============================================================================
259 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShells
260 (const GEOM::ListOfGO& theShells)
262 GEOM::GEOM_Object_var aGEOMObject;
264 //Set a not done flag
265 GetOperations()->SetNotDone();
268 list<Handle(GEOM_Object)> aShapes;
271 aLen = theShells.length();
272 for (ind = 0; ind < aLen; ind++) {
273 if (theShells[ind] == NULL) return aGEOMObject._retn();
274 Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
275 (theShells[ind]->GetStudyID(), theShells[ind]->GetEntry());
276 if (aSh.IsNull()) return aGEOMObject._retn();
277 aShapes.push_back(aSh);
281 Handle(GEOM_Object) anObject =
282 GetOperations()->MakeSolidShells(aShapes);
283 if (!GetOperations()->IsDone() || anObject.IsNull())
284 return aGEOMObject._retn();
286 return GetObject(anObject);
289 //=============================================================================
293 //=============================================================================
294 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
295 (const GEOM::ListOfGO& theShapes)
297 GEOM::GEOM_Object_var aGEOMObject;
299 //Set a not done flag
300 GetOperations()->SetNotDone();
303 list<Handle(GEOM_Object)> aShapes;
306 aLen = theShapes.length();
307 for (ind = 0; ind < aLen; ind++) {
308 if (theShapes[ind] == NULL) return aGEOMObject._retn();
309 Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
310 (theShapes[ind]->GetStudyID(), theShapes[ind]->GetEntry());
311 if (aSh.IsNull()) return aGEOMObject._retn();
312 aShapes.push_back(aSh);
316 Handle(GEOM_Object) anObject =
317 GetOperations()->MakeCompound(aShapes);
318 if (!GetOperations()->IsDone() || anObject.IsNull())
319 return aGEOMObject._retn();
321 return GetObject(anObject);
324 //=============================================================================
328 //=============================================================================
329 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
330 (GEOM::GEOM_Object_ptr theShape,
331 const CORBA::Double theTolerance)
333 GEOM::GEOM_Object_var aGEOMObject;
335 //Set a not done flag
336 GetOperations()->SetNotDone();
338 if (theShape == NULL) return aGEOMObject._retn();
340 //Get the reference objects
341 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
342 (theShape->GetStudyID(), theShape->GetEntry());
344 if (aShape.IsNull()) return aGEOMObject._retn();
347 Handle(GEOM_Object) anObject =
348 GetOperations()->MakeGlueFaces(aShape, theTolerance);
349 //if (!GetOperations()->IsDone() || anObject.IsNull())
351 if (anObject.IsNull())
352 return aGEOMObject._retn();
354 return GetObject(anObject);
358 //=============================================================================
362 //=============================================================================
363 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
364 (GEOM::GEOM_Object_ptr theShape,
365 const CORBA::Double theTolerance)
367 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
369 //Set a not done flag
370 GetOperations()->SetNotDone();
372 if (theShape == NULL) return aSeq._retn();
374 //Get the reference objects
375 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
376 (theShape->GetStudyID(), theShape->GetEntry());
377 if (aShape.IsNull()) return aSeq._retn();
379 Handle(TColStd_HSequenceOfTransient) aHSeq =
380 GetOperations()->GetGlueFaces(aShape, theTolerance);
382 //if (!GetOperations()->IsDone() || aHSeq.IsNull())
387 Standard_Integer aLength = aHSeq->Length();
388 aSeq->length(aLength);
389 for (Standard_Integer i = 1; i <= aLength; i++)
390 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
396 //=============================================================================
398 * MakeGlueFacesByList
400 //=============================================================================
401 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
402 (GEOM::GEOM_Object_ptr theShape,
403 const CORBA::Double theTolerance,
404 const GEOM::ListOfGO& theFaces)
406 GEOM::GEOM_Object_var aGEOMObject;
408 //Set a not done flag
409 GetOperations()->SetNotDone();
411 if (theShape == NULL) return aGEOMObject._retn();
413 //Get the reference objects
414 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
415 (theShape->GetStudyID(), theShape->GetEntry());
417 if (aShape.IsNull()) return aGEOMObject._retn();
420 list<Handle(GEOM_Object)> aFaces;
422 aLen = theFaces.length();
423 for (ind = 0; ind < aLen; ind++) {
424 if (theFaces[ind] == NULL) return aGEOMObject._retn();
425 Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
426 (theFaces[ind]->GetStudyID(), theFaces[ind]->GetEntry());
427 if (aSh.IsNull()) return aGEOMObject._retn();
428 aFaces.push_back(aSh);
432 Handle(GEOM_Object) anObject =
433 GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces);
434 //if (!GetOperations()->IsDone() || anObject.IsNull())
436 if (anObject.IsNull())
437 return aGEOMObject._retn();
439 return GetObject(anObject);
443 //=============================================================================
447 //=============================================================================
448 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
449 const CORBA::Long theShapeType,
450 const CORBA::Boolean isSorted)
452 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
453 if (theShape == NULL) return aSeq._retn();
455 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
456 (theShape->GetStudyID(), theShape->GetEntry());
458 Handle(TColStd_HSequenceOfTransient) aHSeq =
459 GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
460 if (!GetOperations()->IsDone() || aHSeq.IsNull())
463 Standard_Integer aLength = aHSeq->Length();
464 aSeq->length(aLength);
465 for (Standard_Integer i = 1; i <= aLength; i++)
466 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
471 //=============================================================================
475 //=============================================================================
476 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
477 const CORBA::Long theShapeType,
478 const CORBA::Boolean isSorted)
480 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
481 if (theShape == NULL) return aSeq._retn();
483 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
484 (theShape->GetStudyID(), theShape->GetEntry());
486 Handle(TColStd_HSequenceOfInteger) aHSeq =
487 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
488 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
490 Standard_Integer aLength = aHSeq->Length();
491 aSeq->length(aLength);
492 for (Standard_Integer i = 1; i <= aLength; i++)
493 aSeq[i-1] = aHSeq->Value(i);
498 //=============================================================================
502 //=============================================================================
503 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
504 (GEOM::GEOM_Object_ptr theMainShape,
505 const CORBA::Long theID)
507 GEOM::GEOM_Object_var aGEOMObject;
509 //Set a not done flag
510 GetOperations()->SetNotDone();
512 if (theMainShape == NULL) return aGEOMObject._retn();
514 //Get the reference objects
515 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
516 (theMainShape->GetStudyID(), theMainShape->GetEntry());
518 if (aShape.IsNull()) return aGEOMObject._retn();
520 Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
521 if (!GetOperations()->IsDone() || anObject.IsNull())
522 return aGEOMObject._retn();
524 return GetObject(anObject);
527 //=============================================================================
531 //=============================================================================
532 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
533 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
535 if (theMainShape == NULL || theSubShape == NULL) return -1;
537 //Get the reference shapes
538 Handle(GEOM_Object) aMainShapeRef = GetOperations()->GetEngine()->GetObject
539 (theMainShape->GetStudyID(), theMainShape->GetEntry());
540 Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
541 (theSubShape->GetStudyID(), theSubShape->GetEntry());
542 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
544 //Get the unique ID of <theSubShape> inside <theMainShape>
545 CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
546 if (!GetOperations()->IsDone())
552 //=============================================================================
556 //=============================================================================
557 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
558 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
560 if (theMainShape == NULL || theSubShape == NULL) return -1;
562 //Get the reference shapes
563 Handle(GEOM_Object) aMainShapeRef = GetOperations()->GetEngine()->GetObject
564 (theMainShape->GetStudyID(), theMainShape->GetEntry());
565 Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
566 (theSubShape->GetStudyID(), theSubShape->GetEntry());
567 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
569 //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
570 CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
571 if (!GetOperations()->IsDone())
577 //=============================================================================
581 //=============================================================================
582 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
584 if (theShape == NULL) return NULL;
586 //Get the reference shape
587 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
588 (theShape->GetStudyID(), theShape->GetEntry());
590 if (aShape.IsNull()) return NULL;
592 // Get shape parameters
593 TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
594 return CORBA::string_dup(aDescription.ToCString());
597 //=============================================================================
601 //=============================================================================
602 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
604 if (theShape == NULL) return -1;
606 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
607 (theShape->GetStudyID(), theShape->GetEntry());
609 CORBA::Long aNb = GetOperations()->NumberOfFaces(aShape);
610 if (!GetOperations()->IsDone()) return -1;
615 //=============================================================================
619 //=============================================================================
620 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
622 if (theShape == NULL) return -1;
624 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
625 (theShape->GetStudyID(), theShape->GetEntry());
627 CORBA::Long aNb = GetOperations()->NumberOfEdges(aShape);
628 if (!GetOperations()->IsDone()) return -1;
633 //=============================================================================
637 //=============================================================================
638 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
639 (GEOM::GEOM_Object_ptr theShape)
641 GEOM::GEOM_Object_var aGEOMObject;
643 //Set a not done flag
644 GetOperations()->SetNotDone();
646 if (theShape == NULL) return aGEOMObject._retn();
648 //Get the reference objects
649 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
650 (theShape->GetStudyID(), theShape->GetEntry());
652 if (aShape.IsNull()) return aGEOMObject._retn();
655 Handle(GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
656 if (!GetOperations()->IsDone() || anObject.IsNull())
657 return aGEOMObject._retn();
659 return GetObject(anObject);
662 //=============================================================================
666 //=============================================================================
667 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
669 //Set a not done flag
670 GetOperations()->SetNotDone();
672 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
673 if (theShape == NULL) return aSeq._retn();
675 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
676 (theShape->GetStudyID(), theShape->GetEntry());
678 Handle(TColStd_HSequenceOfInteger) aHSeq =
679 GetOperations()->GetFreeFacesIDs(aShape);
680 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
682 Standard_Integer aLength = aHSeq->Length();
683 aSeq->length(aLength);
684 for (Standard_Integer i = 1; i <= aLength; i++)
685 aSeq[i-1] = aHSeq->Value(i);
690 //=============================================================================
694 //=============================================================================
695 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
696 (GEOM::GEOM_Object_ptr theShape1,
697 GEOM::GEOM_Object_ptr theShape2,
698 const CORBA::Long theShapeType)
700 //Set a not done flag
701 GetOperations()->SetNotDone();
703 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
704 if (theShape1 == NULL ||
705 theShape2 == NULL) return aSeq._retn();
707 Handle(GEOM_Object) aShape1 = GetOperations()->GetEngine()->GetObject
708 (theShape1->GetStudyID(), theShape1->GetEntry());
709 Handle(GEOM_Object) aShape2 = GetOperations()->GetEngine()->GetObject
710 (theShape2->GetStudyID(), theShape2->GetEntry());
712 if (aShape1.IsNull() ||
713 aShape2.IsNull()) return aSeq._retn();
715 Handle(TColStd_HSequenceOfTransient) aHSeq =
716 GetOperations()->GetSharedShapes(aShape1, aShape2, theShapeType);
717 if (!GetOperations()->IsDone() || aHSeq.IsNull())
720 Standard_Integer aLength = aHSeq->Length();
721 aSeq->length(aLength);
722 for (Standard_Integer i = 1; i <= aLength; i++)
723 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
728 static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
730 GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
734 aState = GEOMAlgo_ST_ON;
737 aState = GEOMAlgo_ST_OUT;
740 aState = GEOMAlgo_ST_ONOUT;
743 aState = GEOMAlgo_ST_IN;
746 aState = GEOMAlgo_ST_ONIN;
755 //=============================================================================
759 //=============================================================================
760 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
761 (GEOM::GEOM_Object_ptr theShape,
762 const CORBA::Long theShapeType,
763 GEOM::GEOM_Object_ptr theAx1,
764 const GEOM::shape_state theState)
766 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
768 //Set a not done flag
769 GetOperations()->SetNotDone();
771 if (theShape == NULL || theAx1 == NULL) return aSeq._retn();
773 //Get the reference objects
774 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
775 (theShape->GetStudyID(), theShape->GetEntry());
776 Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
777 (theAx1->GetStudyID(), theAx1->GetEntry());
779 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
781 //Get Shapes On Plane
782 Handle(TColStd_HSequenceOfTransient) aHSeq =
783 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
784 if (!GetOperations()->IsDone() || aHSeq.IsNull())
787 Standard_Integer aLength = aHSeq->Length();
788 aSeq->length(aLength);
789 for (Standard_Integer i = 1; i <= aLength; i++)
790 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
795 //=============================================================================
797 * GetShapesOnPlaneWithLocation
799 //=============================================================================
800 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
801 (GEOM::GEOM_Object_ptr theShape,
802 const CORBA::Long theShapeType,
803 GEOM::GEOM_Object_ptr theAx1,
804 GEOM::GEOM_Object_ptr thePnt,
805 const GEOM::shape_state theState)
807 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
809 //Set a not done flag
810 GetOperations()->SetNotDone();
812 if (theShape == NULL || theAx1 == NULL || thePnt == NULL) return aSeq._retn();
814 //Get the reference objects
815 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
816 (theShape->GetStudyID(), theShape->GetEntry());
817 Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
818 (theAx1->GetStudyID(), theAx1->GetEntry());
819 Handle(GEOM_Object) anPnt = GetOperations()->GetEngine()->GetObject
820 (thePnt->GetStudyID(), thePnt->GetEntry());
822 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
824 //Get Shapes On Plane
825 Handle(TColStd_HSequenceOfTransient) aHSeq =
826 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
827 if (!GetOperations()->IsDone() || aHSeq.IsNull())
830 Standard_Integer aLength = aHSeq->Length();
831 aSeq->length(aLength);
832 for (Standard_Integer i = 1; i <= aLength; i++)
833 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
838 //=============================================================================
840 * GetShapesOnCylinder
842 //=============================================================================
843 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
844 (GEOM::GEOM_Object_ptr theShape,
845 const CORBA::Long theShapeType,
846 GEOM::GEOM_Object_ptr theAxis,
847 const CORBA::Double theRadius,
848 const GEOM::shape_state theState)
850 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
852 //Set a not done flag
853 GetOperations()->SetNotDone();
855 if (theShape == NULL || theAxis == NULL) return aSeq._retn();
857 //Get the reference objects
858 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
859 (theShape->GetStudyID(), theShape->GetEntry());
860 Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
861 (theAxis->GetStudyID(), theAxis->GetEntry());
863 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
865 //Get Shapes On Cylinder
866 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
867 (aShape, theShapeType, anAxis, 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 if (theShape == NULL || theCenter == NULL) return aSeq._retn();
898 //Get the reference objects
899 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
900 (theShape->GetStudyID(), theShape->GetEntry());
901 Handle(GEOM_Object) aCenter = GetOperations()->GetEngine()->GetObject
902 (theCenter->GetStudyID(), theCenter->GetEntry());
904 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
906 //Get Shapes On Sphere
907 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
908 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
909 if (!GetOperations()->IsDone() || aHSeq.IsNull())
912 Standard_Integer aLength = aHSeq->Length();
913 aSeq->length(aLength);
914 for (Standard_Integer i = 1; i <= aLength; i++)
915 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
920 //=============================================================================
922 * GetShapesOnQuadrangle
924 //=============================================================================
925 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
926 (GEOM::GEOM_Object_ptr theShape,
927 CORBA::Long theShapeType,
928 GEOM::GEOM_Object_ptr theTopLeftPoint,
929 GEOM::GEOM_Object_ptr theTopRigthPoint,
930 GEOM::GEOM_Object_ptr theBottomLeftPoint,
931 GEOM::GEOM_Object_ptr theBottomRigthPoint,
932 GEOM::shape_state theState)
934 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
936 //Set a not done flag
937 GetOperations()->SetNotDone();
939 if (theShape == NULL ||
940 theTopLeftPoint == NULL ||
941 theTopRigthPoint == NULL ||
942 theBottomLeftPoint == NULL ||
943 theBottomRigthPoint == NULL )
946 //Get the reference objects
947 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
948 (theShape->GetStudyID(), theShape->GetEntry());
949 Handle(GEOM_Object) aTopLeftPoint = GetOperations()->GetEngine()->GetObject
950 (theShape->GetStudyID(), theTopLeftPoint->GetEntry());
951 Handle(GEOM_Object) aTopRigthPoint = GetOperations()->GetEngine()->GetObject
952 (theShape->GetStudyID(), theTopRigthPoint->GetEntry());
953 Handle(GEOM_Object) aBottomLeftPoint = GetOperations()->GetEngine()->GetObject
954 (theShape->GetStudyID(), theBottomLeftPoint->GetEntry());
955 Handle(GEOM_Object) aBottomRigthPoint = GetOperations()->GetEngine()->GetObject
956 (theShape->GetStudyID(), theBottomRigthPoint->GetEntry());
958 if (aShape.IsNull() ||
959 aTopLeftPoint.IsNull() ||
960 aTopRigthPoint.IsNull() ||
961 aBottomLeftPoint.IsNull() ||
962 aBottomRigthPoint.IsNull() )
965 //Get Shapes On Quadrangle
966 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
967 (aShape, theShapeType,
968 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
969 ShapeState(theState));
970 if (!GetOperations()->IsDone() || aHSeq.IsNull())
973 Standard_Integer aLength = aHSeq->Length();
974 aSeq->length(aLength);
975 for (Standard_Integer i = 1; i <= aLength; i++)
976 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
981 //=============================================================================
983 * GetShapesOnPlaneIDs
985 //=============================================================================
986 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
987 (GEOM::GEOM_Object_ptr theShape,
988 const CORBA::Long theShapeType,
989 GEOM::GEOM_Object_ptr theAx1,
990 const GEOM::shape_state theState)
992 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
994 //Set a not done flag
995 GetOperations()->SetNotDone();
997 if (theShape == NULL || theAx1 == NULL) return aSeq._retn();
999 //Get the reference objects
1000 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1001 (theShape->GetStudyID(), theShape->GetEntry());
1002 Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
1003 (theAx1->GetStudyID(), theAx1->GetEntry());
1005 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
1007 //Get Shapes On Plane
1008 Handle(TColStd_HSequenceOfInteger) aHSeq =
1009 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
1010 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1011 return aSeq._retn();
1013 Standard_Integer aLength = aHSeq->Length();
1014 aSeq->length(aLength);
1015 for (Standard_Integer i = 1; i <= aLength; i++)
1016 aSeq[i-1] = aHSeq->Value(i);
1018 return aSeq._retn();
1021 //=============================================================================
1023 * GetShapesOnPlaneWithLocationIDs
1025 //=============================================================================
1026 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
1027 (GEOM::GEOM_Object_ptr theShape,
1028 const CORBA::Long theShapeType,
1029 GEOM::GEOM_Object_ptr theAx1,
1030 GEOM::GEOM_Object_ptr thePnt,
1031 const GEOM::shape_state theState)
1033 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1035 //Set a not done flag
1036 GetOperations()->SetNotDone();
1038 if (theShape == NULL || theAx1 == NULL || thePnt == NULL) return aSeq._retn();
1040 //Get the reference objects
1041 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1042 (theShape->GetStudyID(), theShape->GetEntry());
1043 Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
1044 (theAx1->GetStudyID(), theAx1->GetEntry());
1045 Handle(GEOM_Object) anPnt = GetOperations()->GetEngine()->GetObject
1046 (thePnt->GetStudyID(), thePnt->GetEntry());
1048 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1050 //Get Shapes On Plane
1051 Handle(TColStd_HSequenceOfInteger) aHSeq =
1052 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
1053 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1054 return aSeq._retn();
1056 Standard_Integer aLength = aHSeq->Length();
1057 aSeq->length(aLength);
1058 for (Standard_Integer i = 1; i <= aLength; i++)
1059 aSeq[i-1] = aHSeq->Value(i);
1061 return aSeq._retn();
1064 //=============================================================================
1066 * GetShapesOnCylinderIDs
1068 //=============================================================================
1069 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1070 (GEOM::GEOM_Object_ptr theShape,
1071 const CORBA::Long theShapeType,
1072 GEOM::GEOM_Object_ptr theAxis,
1073 const CORBA::Double theRadius,
1074 const GEOM::shape_state theState)
1076 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1078 //Set a not done flag
1079 GetOperations()->SetNotDone();
1081 if (theShape == NULL || theAxis == NULL) return aSeq._retn();
1083 //Get the reference objects
1084 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1085 (theShape->GetStudyID(), theShape->GetEntry());
1086 Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
1087 (theAxis->GetStudyID(), theAxis->GetEntry());
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 * GetShapesOnSphereIDs
1109 //=============================================================================
1110 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1111 (GEOM::GEOM_Object_ptr theShape,
1112 const CORBA::Long theShapeType,
1113 GEOM::GEOM_Object_ptr theCenter,
1114 const CORBA::Double theRadius,
1115 const GEOM::shape_state theState)
1117 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1119 //Set a not done flag
1120 GetOperations()->SetNotDone();
1122 if (theShape == NULL || theCenter == NULL) return aSeq._retn();
1124 //Get the reference objects
1125 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1126 (theShape->GetStudyID(), theShape->GetEntry());
1127 Handle(GEOM_Object) aCenter = GetOperations()->GetEngine()->GetObject
1128 (theCenter->GetStudyID(), theCenter->GetEntry());
1130 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1132 //Get Shapes On Sphere
1133 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1134 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1135 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1136 return aSeq._retn();
1138 Standard_Integer aLength = aHSeq->Length();
1139 aSeq->length(aLength);
1140 for (Standard_Integer i = 1; i <= aLength; i++)
1141 aSeq[i-1] = aHSeq->Value(i);
1143 return aSeq._retn();
1146 //=============================================================================
1148 * GetShapesOnQuadrangleIDs
1150 //=============================================================================
1151 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1152 (GEOM::GEOM_Object_ptr theShape,
1153 CORBA::Long theShapeType,
1154 GEOM::GEOM_Object_ptr theTopLeftPoint,
1155 GEOM::GEOM_Object_ptr theTopRigthPoint,
1156 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1157 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1158 GEOM::shape_state theState)
1160 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1162 //Set a not done flag
1163 GetOperations()->SetNotDone();
1165 if (theShape == NULL ||
1166 theTopLeftPoint == NULL ||
1167 theTopRigthPoint == NULL ||
1168 theBottomLeftPoint == NULL ||
1169 theBottomRigthPoint == NULL )
1170 return aSeq._retn();
1172 //Get the reference objects
1173 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1174 (theShape->GetStudyID(), theShape->GetEntry());
1175 Handle(GEOM_Object) aTopLeftPoint = GetOperations()->GetEngine()->GetObject
1176 (theShape->GetStudyID(), theTopLeftPoint->GetEntry());
1177 Handle(GEOM_Object) aTopRigthPoint = GetOperations()->GetEngine()->GetObject
1178 (theShape->GetStudyID(), theTopRigthPoint->GetEntry());
1179 Handle(GEOM_Object) aBottomLeftPoint = GetOperations()->GetEngine()->GetObject
1180 (theShape->GetStudyID(), theBottomLeftPoint->GetEntry());
1181 Handle(GEOM_Object) aBottomRigthPoint = GetOperations()->GetEngine()->GetObject
1182 (theShape->GetStudyID(), theBottomRigthPoint->GetEntry());
1184 if (aShape.IsNull() ||
1185 aTopLeftPoint.IsNull() ||
1186 aTopRigthPoint.IsNull() ||
1187 aBottomLeftPoint.IsNull() ||
1188 aBottomRigthPoint.IsNull() )
1189 return aSeq._retn();
1191 //Get Shapes On Quadrangle
1192 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1193 (aShape, theShapeType,
1194 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1195 ShapeState(theState));
1196 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1197 return aSeq._retn();
1199 Standard_Integer aLength = aHSeq->Length();
1200 aSeq->length(aLength);
1201 for (Standard_Integer i = 1; i <= aLength; i++)
1202 aSeq[i-1] = aHSeq->Value(i);
1204 return aSeq._retn();
1207 //=============================================================================
1211 //=============================================================================
1212 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1213 (GEOM::GEOM_Object_ptr theBox,
1214 GEOM::GEOM_Object_ptr theShape,
1215 CORBA::Long theShapeType,
1216 GEOM::shape_state theState)
1218 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1220 //Set a not done flag
1221 GetOperations()->SetNotDone();
1223 if ( theShape == NULL || theBox == NULL )
1224 return aSeq._retn();
1226 //Get the reference objects
1227 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1228 (theShape->GetStudyID(), theShape->GetEntry());
1229 Handle(GEOM_Object) aBox = GetOperations()->GetEngine()->GetObject
1230 (theShape->GetStudyID(), theBox->GetEntry());
1232 if (aShape.IsNull() || aBox.IsNull() )
1233 return aSeq._retn();
1236 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
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] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1246 return aSeq._retn();
1249 //=============================================================================
1251 * GetShapesOnQuadrangleIDs
1253 //=============================================================================
1254 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1255 (GEOM::GEOM_Object_ptr theBox,
1256 GEOM::GEOM_Object_ptr theShape,
1257 CORBA::Long theShapeType,
1258 GEOM::shape_state theState)
1260 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1262 //Set a not done flag
1263 GetOperations()->SetNotDone();
1265 if ( theShape == NULL || theBox == NULL )
1266 return aSeq._retn();
1268 //Get the reference objects
1269 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1270 (theShape->GetStudyID(), theShape->GetEntry());
1271 Handle(GEOM_Object) aBox = GetOperations()->GetEngine()->GetObject
1272 (theShape->GetStudyID(), theBox->GetEntry());
1274 if (aShape.IsNull() || aBox.IsNull() )
1275 return aSeq._retn();
1278 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1279 (aBox,aShape, theShapeType,ShapeState(theState));
1280 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1281 return aSeq._retn();
1283 Standard_Integer aLength = aHSeq->Length();
1284 aSeq->length(aLength);
1285 for (Standard_Integer i = 1; i <= aLength; i++)
1286 aSeq[i-1] = aHSeq->Value(i);
1288 return aSeq._retn();
1291 //=============================================================================
1295 //=============================================================================
1296 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1297 (GEOM::GEOM_Object_ptr theShapeWhere,
1298 GEOM::GEOM_Object_ptr theShapeWhat)
1300 GEOM::GEOM_Object_var aGEOMObject;
1302 //Set a not done flag
1303 GetOperations()->SetNotDone();
1305 if (theShapeWhere == NULL ||
1306 theShapeWhat == NULL) return aGEOMObject._retn();
1308 //Get the reference objects
1309 Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
1310 (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
1311 Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
1312 (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
1314 if (aShapeWhere.IsNull() ||
1315 aShapeWhat.IsNull()) return aGEOMObject._retn();
1317 //Get Shapes in place of aShapeWhat
1318 Handle(GEOM_Object) anObject =
1319 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1320 if (!GetOperations()->IsDone() || anObject.IsNull())
1321 return aGEOMObject._retn();
1323 return GetObject(anObject);
1326 //=============================================================================
1330 //=============================================================================
1331 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1332 (GEOM::GEOM_Object_ptr theShapeWhere,
1333 GEOM::GEOM_Object_ptr theShapeWhat)
1335 GEOM::GEOM_Object_var aGEOMObject;
1337 //Set a not done flag
1338 GetOperations()->SetNotDone();
1340 if (theShapeWhere == NULL ||
1341 theShapeWhat == NULL) return aGEOMObject._retn();
1343 //Get the reference objects
1344 Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
1345 (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
1346 Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
1347 (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
1349 if (aShapeWhere.IsNull() ||
1350 aShapeWhat.IsNull()) return aGEOMObject._retn();
1352 //Get Shapes in place of aShapeWhat
1353 Handle(GEOM_Object) anObject =
1354 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1355 if (!GetOperations()->IsDone() || anObject.IsNull())
1356 return aGEOMObject._retn();
1358 return GetObject(anObject);