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 CORBA::Double theTolerance,
332 CORBA::Boolean doKeepNonSolids)
334 GEOM::GEOM_Object_var aGEOMObject;
336 //Set a not done flag
337 GetOperations()->SetNotDone();
339 if (theShape == NULL) return aGEOMObject._retn();
341 //Get the reference objects
342 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
343 (theShape->GetStudyID(), theShape->GetEntry());
345 if (aShape.IsNull()) return aGEOMObject._retn();
348 Handle(GEOM_Object) anObject =
349 GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
350 //if (!GetOperations()->IsDone() || anObject.IsNull())
352 if (anObject.IsNull())
353 return aGEOMObject._retn();
355 return GetObject(anObject);
359 //=============================================================================
363 //=============================================================================
364 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
365 (GEOM::GEOM_Object_ptr theShape,
366 const CORBA::Double theTolerance)
368 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
370 //Set a not done flag
371 GetOperations()->SetNotDone();
373 if (theShape == NULL) return aSeq._retn();
375 //Get the reference objects
376 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
377 (theShape->GetStudyID(), theShape->GetEntry());
378 if (aShape.IsNull()) return aSeq._retn();
380 Handle(TColStd_HSequenceOfTransient) aHSeq =
381 GetOperations()->GetGlueFaces(aShape, theTolerance);
383 //if (!GetOperations()->IsDone() || aHSeq.IsNull())
388 Standard_Integer aLength = aHSeq->Length();
389 aSeq->length(aLength);
390 for (Standard_Integer i = 1; i <= aLength; i++)
391 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
397 //=============================================================================
399 * MakeGlueFacesByList
401 //=============================================================================
402 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
403 (GEOM::GEOM_Object_ptr theShape,
404 CORBA::Double theTolerance,
405 const GEOM::ListOfGO& theFaces,
406 CORBA::Boolean doKeepNonSolids)
408 GEOM::GEOM_Object_var aGEOMObject;
410 //Set a not done flag
411 GetOperations()->SetNotDone();
413 if (theShape == NULL) return aGEOMObject._retn();
415 //Get the reference objects
416 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
417 (theShape->GetStudyID(), theShape->GetEntry());
419 if (aShape.IsNull()) return aGEOMObject._retn();
422 list<Handle(GEOM_Object)> aFaces;
424 aLen = theFaces.length();
425 for (ind = 0; ind < aLen; ind++) {
426 if (theFaces[ind] == NULL) return aGEOMObject._retn();
427 Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
428 (theFaces[ind]->GetStudyID(), theFaces[ind]->GetEntry());
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);
445 //=============================================================================
449 //=============================================================================
450 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
451 const CORBA::Long theShapeType,
452 const CORBA::Boolean isSorted)
454 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
455 if (theShape == NULL) return aSeq._retn();
457 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
458 (theShape->GetStudyID(), theShape->GetEntry());
460 Handle(TColStd_HSequenceOfTransient) aHSeq =
461 GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
462 if (!GetOperations()->IsDone() || aHSeq.IsNull())
465 Standard_Integer aLength = aHSeq->Length();
466 aSeq->length(aLength);
467 for (Standard_Integer i = 1; i <= aLength; i++)
468 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
473 //=============================================================================
477 //=============================================================================
478 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
479 const CORBA::Long theShapeType,
480 const CORBA::Boolean isSorted)
482 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
483 if (theShape == NULL) return aSeq._retn();
485 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
486 (theShape->GetStudyID(), theShape->GetEntry());
488 Handle(TColStd_HSequenceOfInteger) aHSeq =
489 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
490 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
492 Standard_Integer aLength = aHSeq->Length();
493 aSeq->length(aLength);
494 for (Standard_Integer i = 1; i <= aLength; i++)
495 aSeq[i-1] = aHSeq->Value(i);
500 //=============================================================================
504 //=============================================================================
505 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
506 (GEOM::GEOM_Object_ptr theMainShape,
507 const CORBA::Long theID)
509 GEOM::GEOM_Object_var aGEOMObject;
511 //Set a not done flag
512 GetOperations()->SetNotDone();
514 if (theMainShape == NULL) return aGEOMObject._retn();
516 //Get the reference objects
517 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
518 (theMainShape->GetStudyID(), theMainShape->GetEntry());
520 if (aShape.IsNull()) return aGEOMObject._retn();
522 Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
523 if (!GetOperations()->IsDone() || anObject.IsNull())
524 return aGEOMObject._retn();
526 return GetObject(anObject);
529 //=============================================================================
533 //=============================================================================
534 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
535 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
537 if (theMainShape == NULL || theSubShape == NULL) return -1;
539 //Get the reference shapes
540 Handle(GEOM_Object) aMainShapeRef = GetOperations()->GetEngine()->GetObject
541 (theMainShape->GetStudyID(), theMainShape->GetEntry());
542 Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
543 (theSubShape->GetStudyID(), theSubShape->GetEntry());
544 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
546 //Get the unique ID of <theSubShape> inside <theMainShape>
547 CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
548 if (!GetOperations()->IsDone())
554 //=============================================================================
558 //=============================================================================
559 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
560 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
562 if (theMainShape == NULL || theSubShape == NULL) return -1;
564 //Get the reference shapes
565 Handle(GEOM_Object) aMainShapeRef = GetOperations()->GetEngine()->GetObject
566 (theMainShape->GetStudyID(), theMainShape->GetEntry());
567 Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
568 (theSubShape->GetStudyID(), theSubShape->GetEntry());
569 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
571 //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
572 CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
573 if (!GetOperations()->IsDone())
579 //=============================================================================
583 //=============================================================================
584 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
586 if (theShape == NULL) return NULL;
588 //Get the reference shape
589 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
590 (theShape->GetStudyID(), theShape->GetEntry());
592 if (aShape.IsNull()) return NULL;
594 // Get shape parameters
595 TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
596 return CORBA::string_dup(aDescription.ToCString());
599 //=============================================================================
603 //=============================================================================
604 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
606 if (theShape == NULL) return -1;
608 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
609 (theShape->GetStudyID(), theShape->GetEntry());
611 CORBA::Long aNb = GetOperations()->NumberOfFaces(aShape);
612 if (!GetOperations()->IsDone()) return -1;
617 //=============================================================================
621 //=============================================================================
622 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
624 if (theShape == NULL) return -1;
626 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
627 (theShape->GetStudyID(), theShape->GetEntry());
629 CORBA::Long aNb = GetOperations()->NumberOfEdges(aShape);
630 if (!GetOperations()->IsDone()) return -1;
635 //=============================================================================
639 //=============================================================================
640 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
641 (GEOM::GEOM_Object_ptr theShape)
643 GEOM::GEOM_Object_var aGEOMObject;
645 //Set a not done flag
646 GetOperations()->SetNotDone();
648 if (theShape == NULL) return aGEOMObject._retn();
650 //Get the reference objects
651 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
652 (theShape->GetStudyID(), theShape->GetEntry());
654 if (aShape.IsNull()) return aGEOMObject._retn();
657 Handle(GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
658 if (!GetOperations()->IsDone() || anObject.IsNull())
659 return aGEOMObject._retn();
661 return GetObject(anObject);
664 //=============================================================================
668 //=============================================================================
669 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
671 //Set a not done flag
672 GetOperations()->SetNotDone();
674 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
675 if (theShape == NULL) return aSeq._retn();
677 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
678 (theShape->GetStudyID(), theShape->GetEntry());
680 Handle(TColStd_HSequenceOfInteger) aHSeq =
681 GetOperations()->GetFreeFacesIDs(aShape);
682 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
684 Standard_Integer aLength = aHSeq->Length();
685 aSeq->length(aLength);
686 for (Standard_Integer i = 1; i <= aLength; i++)
687 aSeq[i-1] = aHSeq->Value(i);
692 //=============================================================================
696 //=============================================================================
697 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
698 (GEOM::GEOM_Object_ptr theShape1,
699 GEOM::GEOM_Object_ptr theShape2,
700 const CORBA::Long theShapeType)
702 //Set a not done flag
703 GetOperations()->SetNotDone();
705 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
706 if (theShape1 == NULL ||
707 theShape2 == NULL) return aSeq._retn();
709 Handle(GEOM_Object) aShape1 = GetOperations()->GetEngine()->GetObject
710 (theShape1->GetStudyID(), theShape1->GetEntry());
711 Handle(GEOM_Object) aShape2 = GetOperations()->GetEngine()->GetObject
712 (theShape2->GetStudyID(), theShape2->GetEntry());
714 if (aShape1.IsNull() ||
715 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 if (theShape == NULL || theAx1 == NULL) return aSeq._retn();
775 //Get the reference objects
776 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
777 (theShape->GetStudyID(), theShape->GetEntry());
778 Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
779 (theAx1->GetStudyID(), theAx1->GetEntry());
781 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
783 //Get Shapes On Plane
784 Handle(TColStd_HSequenceOfTransient) aHSeq =
785 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
786 if (!GetOperations()->IsDone() || aHSeq.IsNull())
789 Standard_Integer aLength = aHSeq->Length();
790 aSeq->length(aLength);
791 for (Standard_Integer i = 1; i <= aLength; i++)
792 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
797 //=============================================================================
799 * GetShapesOnPlaneWithLocation
801 //=============================================================================
802 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
803 (GEOM::GEOM_Object_ptr theShape,
804 const CORBA::Long theShapeType,
805 GEOM::GEOM_Object_ptr theAx1,
806 GEOM::GEOM_Object_ptr thePnt,
807 const GEOM::shape_state theState)
809 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
811 //Set a not done flag
812 GetOperations()->SetNotDone();
814 if (theShape == NULL || theAx1 == NULL || thePnt == NULL) return aSeq._retn();
816 //Get the reference objects
817 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
818 (theShape->GetStudyID(), theShape->GetEntry());
819 Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
820 (theAx1->GetStudyID(), theAx1->GetEntry());
821 Handle(GEOM_Object) anPnt = GetOperations()->GetEngine()->GetObject
822 (thePnt->GetStudyID(), thePnt->GetEntry());
824 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
826 //Get Shapes On Plane
827 Handle(TColStd_HSequenceOfTransient) aHSeq =
828 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, 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 * GetShapesOnCylinder
844 //=============================================================================
845 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
846 (GEOM::GEOM_Object_ptr theShape,
847 const CORBA::Long theShapeType,
848 GEOM::GEOM_Object_ptr theAxis,
849 const CORBA::Double theRadius,
850 const GEOM::shape_state theState)
852 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
854 //Set a not done flag
855 GetOperations()->SetNotDone();
857 if (theShape == NULL || theAxis == NULL) return aSeq._retn();
859 //Get the reference objects
860 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
861 (theShape->GetStudyID(), theShape->GetEntry());
862 Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
863 (theAxis->GetStudyID(), theAxis->GetEntry());
865 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
867 //Get Shapes On Cylinder
868 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
869 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
870 if (!GetOperations()->IsDone() || aHSeq.IsNull())
873 Standard_Integer aLength = aHSeq->Length();
874 aSeq->length(aLength);
875 for (Standard_Integer i = 1; i <= aLength; i++)
876 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
881 //=============================================================================
885 //=============================================================================
886 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
887 (GEOM::GEOM_Object_ptr theShape,
888 const CORBA::Long theShapeType,
889 GEOM::GEOM_Object_ptr theCenter,
890 const CORBA::Double theRadius,
891 const GEOM::shape_state theState)
893 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
895 //Set a not done flag
896 GetOperations()->SetNotDone();
898 if (theShape == NULL || theCenter == NULL) return aSeq._retn();
900 //Get the reference objects
901 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
902 (theShape->GetStudyID(), theShape->GetEntry());
903 Handle(GEOM_Object) aCenter = GetOperations()->GetEngine()->GetObject
904 (theCenter->GetStudyID(), theCenter->GetEntry());
906 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
908 //Get Shapes On Sphere
909 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
910 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
911 if (!GetOperations()->IsDone() || aHSeq.IsNull())
914 Standard_Integer aLength = aHSeq->Length();
915 aSeq->length(aLength);
916 for (Standard_Integer i = 1; i <= aLength; i++)
917 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
922 //=============================================================================
924 * GetShapesOnQuadrangle
926 //=============================================================================
927 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
928 (GEOM::GEOM_Object_ptr theShape,
929 CORBA::Long theShapeType,
930 GEOM::GEOM_Object_ptr theTopLeftPoint,
931 GEOM::GEOM_Object_ptr theTopRigthPoint,
932 GEOM::GEOM_Object_ptr theBottomLeftPoint,
933 GEOM::GEOM_Object_ptr theBottomRigthPoint,
934 GEOM::shape_state theState)
936 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
938 //Set a not done flag
939 GetOperations()->SetNotDone();
941 if (theShape == NULL ||
942 theTopLeftPoint == NULL ||
943 theTopRigthPoint == NULL ||
944 theBottomLeftPoint == NULL ||
945 theBottomRigthPoint == NULL )
948 //Get the reference objects
949 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
950 (theShape->GetStudyID(), theShape->GetEntry());
951 Handle(GEOM_Object) aTopLeftPoint = GetOperations()->GetEngine()->GetObject
952 (theShape->GetStudyID(), theTopLeftPoint->GetEntry());
953 Handle(GEOM_Object) aTopRigthPoint = GetOperations()->GetEngine()->GetObject
954 (theShape->GetStudyID(), theTopRigthPoint->GetEntry());
955 Handle(GEOM_Object) aBottomLeftPoint = GetOperations()->GetEngine()->GetObject
956 (theShape->GetStudyID(), theBottomLeftPoint->GetEntry());
957 Handle(GEOM_Object) aBottomRigthPoint = GetOperations()->GetEngine()->GetObject
958 (theShape->GetStudyID(), theBottomRigthPoint->GetEntry());
960 if (aShape.IsNull() ||
961 aTopLeftPoint.IsNull() ||
962 aTopRigthPoint.IsNull() ||
963 aBottomLeftPoint.IsNull() ||
964 aBottomRigthPoint.IsNull() )
967 //Get Shapes On Quadrangle
968 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
969 (aShape, theShapeType,
970 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
971 ShapeState(theState));
972 if (!GetOperations()->IsDone() || aHSeq.IsNull())
975 Standard_Integer aLength = aHSeq->Length();
976 aSeq->length(aLength);
977 for (Standard_Integer i = 1; i <= aLength; i++)
978 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
983 //=============================================================================
985 * GetShapesOnPlaneIDs
987 //=============================================================================
988 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
989 (GEOM::GEOM_Object_ptr theShape,
990 const CORBA::Long theShapeType,
991 GEOM::GEOM_Object_ptr theAx1,
992 const GEOM::shape_state theState)
994 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
996 //Set a not done flag
997 GetOperations()->SetNotDone();
999 if (theShape == NULL || theAx1 == NULL) return aSeq._retn();
1001 //Get the reference objects
1002 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1003 (theShape->GetStudyID(), theShape->GetEntry());
1004 Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
1005 (theAx1->GetStudyID(), theAx1->GetEntry());
1007 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
1009 //Get Shapes On Plane
1010 Handle(TColStd_HSequenceOfInteger) aHSeq =
1011 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
1012 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1013 return aSeq._retn();
1015 Standard_Integer aLength = aHSeq->Length();
1016 aSeq->length(aLength);
1017 for (Standard_Integer i = 1; i <= aLength; i++)
1018 aSeq[i-1] = aHSeq->Value(i);
1020 return aSeq._retn();
1023 //=============================================================================
1025 * GetShapesOnPlaneWithLocationIDs
1027 //=============================================================================
1028 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
1029 (GEOM::GEOM_Object_ptr theShape,
1030 const CORBA::Long theShapeType,
1031 GEOM::GEOM_Object_ptr theAx1,
1032 GEOM::GEOM_Object_ptr thePnt,
1033 const GEOM::shape_state theState)
1035 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1037 //Set a not done flag
1038 GetOperations()->SetNotDone();
1040 if (theShape == NULL || theAx1 == NULL || thePnt == NULL) return aSeq._retn();
1042 //Get the reference objects
1043 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1044 (theShape->GetStudyID(), theShape->GetEntry());
1045 Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
1046 (theAx1->GetStudyID(), theAx1->GetEntry());
1047 Handle(GEOM_Object) anPnt = GetOperations()->GetEngine()->GetObject
1048 (thePnt->GetStudyID(), thePnt->GetEntry());
1050 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1052 //Get Shapes On Plane
1053 Handle(TColStd_HSequenceOfInteger) aHSeq =
1054 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
1055 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1056 return aSeq._retn();
1058 Standard_Integer aLength = aHSeq->Length();
1059 aSeq->length(aLength);
1060 for (Standard_Integer i = 1; i <= aLength; i++)
1061 aSeq[i-1] = aHSeq->Value(i);
1063 return aSeq._retn();
1066 //=============================================================================
1068 * GetShapesOnCylinderIDs
1070 //=============================================================================
1071 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1072 (GEOM::GEOM_Object_ptr theShape,
1073 const CORBA::Long theShapeType,
1074 GEOM::GEOM_Object_ptr theAxis,
1075 const CORBA::Double theRadius,
1076 const GEOM::shape_state theState)
1078 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1080 //Set a not done flag
1081 GetOperations()->SetNotDone();
1083 if (theShape == NULL || theAxis == NULL) return aSeq._retn();
1085 //Get the reference objects
1086 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1087 (theShape->GetStudyID(), theShape->GetEntry());
1088 Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
1089 (theAxis->GetStudyID(), theAxis->GetEntry());
1091 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1093 //Get Shapes On Cylinder
1094 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
1095 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1096 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1097 return aSeq._retn();
1099 Standard_Integer aLength = aHSeq->Length();
1100 aSeq->length(aLength);
1101 for (Standard_Integer i = 1; i <= aLength; i++)
1102 aSeq[i-1] = aHSeq->Value(i);
1104 return aSeq._retn();
1107 //=============================================================================
1109 * GetShapesOnSphereIDs
1111 //=============================================================================
1112 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1113 (GEOM::GEOM_Object_ptr theShape,
1114 const CORBA::Long theShapeType,
1115 GEOM::GEOM_Object_ptr theCenter,
1116 const CORBA::Double theRadius,
1117 const GEOM::shape_state theState)
1119 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1121 //Set a not done flag
1122 GetOperations()->SetNotDone();
1124 if (theShape == NULL || theCenter == NULL) return aSeq._retn();
1126 //Get the reference objects
1127 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1128 (theShape->GetStudyID(), theShape->GetEntry());
1129 Handle(GEOM_Object) aCenter = GetOperations()->GetEngine()->GetObject
1130 (theCenter->GetStudyID(), theCenter->GetEntry());
1132 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1134 //Get Shapes On Sphere
1135 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1136 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1137 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1138 return aSeq._retn();
1140 Standard_Integer aLength = aHSeq->Length();
1141 aSeq->length(aLength);
1142 for (Standard_Integer i = 1; i <= aLength; i++)
1143 aSeq[i-1] = aHSeq->Value(i);
1145 return aSeq._retn();
1148 //=============================================================================
1150 * GetShapesOnQuadrangleIDs
1152 //=============================================================================
1153 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1154 (GEOM::GEOM_Object_ptr theShape,
1155 CORBA::Long theShapeType,
1156 GEOM::GEOM_Object_ptr theTopLeftPoint,
1157 GEOM::GEOM_Object_ptr theTopRigthPoint,
1158 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1159 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1160 GEOM::shape_state theState)
1162 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1164 //Set a not done flag
1165 GetOperations()->SetNotDone();
1167 if (theShape == NULL ||
1168 theTopLeftPoint == NULL ||
1169 theTopRigthPoint == NULL ||
1170 theBottomLeftPoint == NULL ||
1171 theBottomRigthPoint == NULL )
1172 return aSeq._retn();
1174 //Get the reference objects
1175 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1176 (theShape->GetStudyID(), theShape->GetEntry());
1177 Handle(GEOM_Object) aTopLeftPoint = GetOperations()->GetEngine()->GetObject
1178 (theShape->GetStudyID(), theTopLeftPoint->GetEntry());
1179 Handle(GEOM_Object) aTopRigthPoint = GetOperations()->GetEngine()->GetObject
1180 (theShape->GetStudyID(), theTopRigthPoint->GetEntry());
1181 Handle(GEOM_Object) aBottomLeftPoint = GetOperations()->GetEngine()->GetObject
1182 (theShape->GetStudyID(), theBottomLeftPoint->GetEntry());
1183 Handle(GEOM_Object) aBottomRigthPoint = GetOperations()->GetEngine()->GetObject
1184 (theShape->GetStudyID(), theBottomRigthPoint->GetEntry());
1186 if (aShape.IsNull() ||
1187 aTopLeftPoint.IsNull() ||
1188 aTopRigthPoint.IsNull() ||
1189 aBottomLeftPoint.IsNull() ||
1190 aBottomRigthPoint.IsNull() )
1191 return aSeq._retn();
1193 //Get Shapes On Quadrangle
1194 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1195 (aShape, theShapeType,
1196 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1197 ShapeState(theState));
1198 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1199 return aSeq._retn();
1201 Standard_Integer aLength = aHSeq->Length();
1202 aSeq->length(aLength);
1203 for (Standard_Integer i = 1; i <= aLength; i++)
1204 aSeq[i-1] = aHSeq->Value(i);
1206 return aSeq._retn();
1209 //=============================================================================
1213 //=============================================================================
1214 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1215 (GEOM::GEOM_Object_ptr theBox,
1216 GEOM::GEOM_Object_ptr theShape,
1217 CORBA::Long theShapeType,
1218 GEOM::shape_state theState)
1220 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1222 //Set a not done flag
1223 GetOperations()->SetNotDone();
1225 if ( theShape == NULL || theBox == NULL )
1226 return aSeq._retn();
1228 //Get the reference objects
1229 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1230 (theShape->GetStudyID(), theShape->GetEntry());
1231 Handle(GEOM_Object) aBox = GetOperations()->GetEngine()->GetObject
1232 (theShape->GetStudyID(), theBox->GetEntry());
1234 if (aShape.IsNull() || aBox.IsNull() )
1235 return aSeq._retn();
1238 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
1239 (aBox,aShape, theShapeType,ShapeState(theState));
1240 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1241 return aSeq._retn();
1243 Standard_Integer aLength = aHSeq->Length();
1244 aSeq->length(aLength);
1245 for (Standard_Integer i = 1; i <= aLength; i++)
1246 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1248 return aSeq._retn();
1251 //=============================================================================
1253 * GetShapesOnQuadrangleIDs
1255 //=============================================================================
1256 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1257 (GEOM::GEOM_Object_ptr theBox,
1258 GEOM::GEOM_Object_ptr theShape,
1259 CORBA::Long theShapeType,
1260 GEOM::shape_state theState)
1262 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1264 //Set a not done flag
1265 GetOperations()->SetNotDone();
1267 if ( theShape == NULL || theBox == NULL )
1268 return aSeq._retn();
1270 //Get the reference objects
1271 Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
1272 (theShape->GetStudyID(), theShape->GetEntry());
1273 Handle(GEOM_Object) aBox = GetOperations()->GetEngine()->GetObject
1274 (theShape->GetStudyID(), theBox->GetEntry());
1276 if (aShape.IsNull() || aBox.IsNull() )
1277 return aSeq._retn();
1280 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1281 (aBox,aShape, theShapeType,ShapeState(theState));
1282 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1283 return aSeq._retn();
1285 Standard_Integer aLength = aHSeq->Length();
1286 aSeq->length(aLength);
1287 for (Standard_Integer i = 1; i <= aLength; i++)
1288 aSeq[i-1] = aHSeq->Value(i);
1290 return aSeq._retn();
1293 //=============================================================================
1297 //=============================================================================
1298 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1299 (GEOM::GEOM_Object_ptr theShapeWhere,
1300 GEOM::GEOM_Object_ptr theShapeWhat)
1302 GEOM::GEOM_Object_var aGEOMObject;
1304 //Set a not done flag
1305 GetOperations()->SetNotDone();
1307 if (theShapeWhere == NULL ||
1308 theShapeWhat == NULL) return aGEOMObject._retn();
1310 //Get the reference objects
1311 Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
1312 (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
1313 Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
1314 (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
1316 if (aShapeWhere.IsNull() ||
1317 aShapeWhat.IsNull()) return aGEOMObject._retn();
1319 //Get Shapes in place of aShapeWhat
1320 Handle(GEOM_Object) anObject =
1321 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1322 if (!GetOperations()->IsDone() || anObject.IsNull())
1323 return aGEOMObject._retn();
1325 return GetObject(anObject);
1328 //=============================================================================
1330 * GetInPlaceByHistory
1332 //=============================================================================
1333 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
1334 (GEOM::GEOM_Object_ptr theShapeWhere,
1335 GEOM::GEOM_Object_ptr theShapeWhat)
1337 GEOM::GEOM_Object_var aGEOMObject;
1339 //Set a not done flag
1340 GetOperations()->SetNotDone();
1342 if (theShapeWhere == NULL ||
1343 theShapeWhat == NULL) return aGEOMObject._retn();
1345 //Get the reference objects
1346 Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
1347 (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
1348 Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
1349 (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
1351 if (aShapeWhere.IsNull() ||
1352 aShapeWhat.IsNull()) return aGEOMObject._retn();
1354 //Get Shapes in place of aShapeWhat
1355 Handle(GEOM_Object) anObject =
1356 GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
1357 if (!GetOperations()->IsDone() || anObject.IsNull())
1358 return aGEOMObject._retn();
1360 return GetObject(anObject);
1363 //=============================================================================
1367 //=============================================================================
1368 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1369 (GEOM::GEOM_Object_ptr theShapeWhere,
1370 GEOM::GEOM_Object_ptr theShapeWhat)
1372 GEOM::GEOM_Object_var aGEOMObject;
1374 //Set a not done flag
1375 GetOperations()->SetNotDone();
1377 if (theShapeWhere == NULL ||
1378 theShapeWhat == NULL) return aGEOMObject._retn();
1380 //Get the reference objects
1381 Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
1382 (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
1383 Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
1384 (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
1386 if (aShapeWhere.IsNull() ||
1387 aShapeWhat.IsNull()) return aGEOMObject._retn();
1389 //Get Shapes in place of aShapeWhat
1390 Handle(GEOM_Object) anObject =
1391 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1392 if (!GetOperations()->IsDone() || anObject.IsNull())
1393 return aGEOMObject._retn();
1395 return GetObject(anObject);