1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include <Standard_Stream.hxx>
25 #include "GEOM_IShapesOperations_i.hh"
27 #include "utilities.h"
29 #include "Utils_ExceptHandlers.hxx"
31 #include "GEOM_Engine.hxx"
32 #include "GEOM_Object.hxx"
35 #include <TColStd_HSequenceOfTransient.hxx>
36 #include <TColStd_HArray1OfInteger.hxx>
38 //=============================================================================
42 //=============================================================================
43 GEOM_IShapesOperations_i::GEOM_IShapesOperations_i (PortableServer::POA_ptr thePOA,
44 GEOM::GEOM_Gen_ptr theEngine,
45 ::GEOMImpl_IShapesOperations* theImpl)
46 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
48 MESSAGE("GEOM_IShapesOperations_i::GEOM_IShapesOperations_i");
51 //=============================================================================
55 //=============================================================================
56 GEOM_IShapesOperations_i::~GEOM_IShapesOperations_i()
58 MESSAGE("GEOM_IShapesOperations_i::~GEOM_IShapesOperations_i");
62 //=============================================================================
66 //=============================================================================
67 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdge
68 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
70 GEOM::GEOM_Object_var aGEOMObject;
73 GetOperations()->SetNotDone();
75 //Get the reference points
76 Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
77 Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
79 if (aPnt1.IsNull() || aPnt2.IsNull()) return aGEOMObject._retn();
82 Handle(GEOM_Object) anObject = GetOperations()->MakeEdge(aPnt1, aPnt2);
83 if (!GetOperations()->IsDone() || anObject.IsNull())
84 return aGEOMObject._retn();
86 return GetObject(anObject);
89 //=============================================================================
91 * MakeEdgeOnCurveByLength
93 //=============================================================================
94 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdgeOnCurveByLength
95 (GEOM::GEOM_Object_ptr theCurve,
96 CORBA::Double theLength,
97 GEOM::GEOM_Object_ptr theStartPoint)
99 GEOM::GEOM_Object_var aGEOMObject;
101 //Set a not done flag
102 GetOperations()->SetNotDone();
104 //Get the reference curve
105 Handle(GEOM_Object) aRefCurve = GetObjectImpl(theCurve);
106 if (aRefCurve.IsNull()) return aGEOMObject._retn();
108 //Get the reference point (can be NULL)
109 Handle(GEOM_Object) aRefPoint;
110 if (!CORBA::is_nil(theStartPoint)) {
111 aRefPoint = GetObjectImpl(theStartPoint);
115 Handle(GEOM_Object) anObject =
116 GetOperations()->MakeEdgeOnCurveByLength(aRefCurve, theLength, aRefPoint);
117 if (!GetOperations()->IsDone() || anObject.IsNull())
118 return aGEOMObject._retn();
120 return GetObject(anObject);
123 //=============================================================================
127 //=============================================================================
128 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdgeWire
129 (GEOM::GEOM_Object_ptr theWire,
130 const CORBA::Double theLinearTolerance,
131 const CORBA::Double theAngularTolerance)
133 GEOM::GEOM_Object_var aGEOMObject;
135 //Set a not done flag
136 GetOperations()->SetNotDone();
138 //Get the source wire
139 Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
141 if (aWire.IsNull()) return aGEOMObject._retn();
144 Handle(GEOM_Object) anObject = GetOperations()->MakeEdgeWire(aWire, theLinearTolerance, theAngularTolerance);
145 if (!GetOperations()->IsDone() || anObject.IsNull())
146 return aGEOMObject._retn();
148 return GetObject(anObject);
151 //=============================================================================
155 //=============================================================================
156 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire
157 (const GEOM::ListOfGO& theEdgesAndWires,
158 const CORBA::Double theTolerance)
160 GEOM::GEOM_Object_var aGEOMObject;
162 //Set a not done flag
163 GetOperations()->SetNotDone();
166 std::list<Handle(GEOM_Object)> aShapes;
169 aLen = theEdgesAndWires.length();
170 for (ind = 0; ind < aLen; ind++) {
171 Handle(GEOM_Object) aSh = GetObjectImpl(theEdgesAndWires[ind]);
172 if (aSh.IsNull()) return aGEOMObject._retn();
173 aShapes.push_back(aSh);
177 Handle(GEOM_Object) anObject =
178 GetOperations()->MakeWire(aShapes, theTolerance);
179 if (!GetOperations()->IsDone() || anObject.IsNull())
180 return aGEOMObject._retn();
182 return GetObject(anObject);
185 //=============================================================================
189 //=============================================================================
190 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFace
191 (GEOM::GEOM_Object_ptr theWire,
192 const CORBA::Boolean isPlanarWanted)
194 GEOM::GEOM_Object_var aGEOMObject;
196 //Set a not done flag
197 GetOperations()->SetNotDone();
199 //Get the reference wire
200 Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
201 if (aWire.IsNull()) return aGEOMObject._retn();
204 Handle(GEOM_Object) anObject = GetOperations()->MakeFace(aWire, isPlanarWanted);
205 //if (!GetOperations()->IsDone() || anObject.IsNull())
206 // enable warning status
207 if (anObject.IsNull())
208 return aGEOMObject._retn();
210 return GetObject(anObject);
213 //=============================================================================
217 //=============================================================================
218 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWires
219 (const GEOM::ListOfGO& theWires,
220 const CORBA::Boolean isPlanarWanted)
222 GEOM::GEOM_Object_var aGEOMObject;
224 //Set a not done flag
225 GetOperations()->SetNotDone();
228 std::list<Handle(GEOM_Object)> aShapes;
231 aLen = theWires.length();
232 for (ind = 0; ind < aLen; ind++) {
233 Handle(GEOM_Object) aSh = GetObjectImpl(theWires[ind]);
234 if (aSh.IsNull()) return aGEOMObject._retn();
235 aShapes.push_back(aSh);
239 Handle(GEOM_Object) anObject =
240 GetOperations()->MakeFaceWires(aShapes, isPlanarWanted);
241 //if (!GetOperations()->IsDone() || anObject.IsNull())
242 // enable warning status
243 if (anObject.IsNull())
244 return aGEOMObject._retn();
246 return GetObject(anObject);
249 //=============================================================================
251 * MakeFaceFromSurface
253 //=============================================================================
254 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceFromSurface
255 (GEOM::GEOM_Object_ptr theFace,
256 GEOM::GEOM_Object_ptr theWire)
258 GEOM::GEOM_Object_var aGEOMObject;
260 //Set a not done flag
261 GetOperations()->SetNotDone();
263 //Get the reference face and wire
264 Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
265 Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
267 if (aFace.IsNull() || aWire.IsNull()) {
268 return aGEOMObject._retn();
272 Handle(GEOM_Object) anObject =
273 GetOperations()->MakeFaceFromSurface(aFace, aWire);
275 if (anObject.IsNull()) {
276 return aGEOMObject._retn();
279 return GetObject(anObject);
282 //=============================================================================
284 * MakeFaceWithConstraints
286 //=============================================================================
287 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWithConstraints
288 (const GEOM::ListOfGO& theConstraints)
290 GEOM::GEOM_Object_var aGEOMObject;
292 //Set a not done flag
293 GetOperations()->SetNotDone();
296 std::list<Handle(GEOM_Object)> aConstraints;
297 for( int ind = 0; ind < theConstraints.length(); ind++ ) {
298 Handle(GEOM_Object) anObject = GetObjectImpl( theConstraints[ind] );
299 aConstraints.push_back(anObject);
303 Handle(GEOM_Object) anObject =
304 GetOperations()->MakeFaceWithConstraints( aConstraints );
306 // enable warning status
307 if (anObject.IsNull())
308 return aGEOMObject._retn();
310 return GetObject(anObject);
313 //=============================================================================
317 //=============================================================================
318 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeShell
319 (const GEOM::ListOfGO& theFacesAndShells)
321 GEOM::GEOM_Object_var aGEOMObject;
323 //Set a not done flag
324 GetOperations()->SetNotDone();
327 std::list<Handle(GEOM_Object)> aShapes;
330 aLen = theFacesAndShells.length();
331 for (ind = 0; ind < aLen; ind++) {
332 Handle(GEOM_Object) aSh = GetObjectImpl(theFacesAndShells[ind]);
333 if (aSh.IsNull()) return aGEOMObject._retn();
334 aShapes.push_back(aSh);
338 Handle(GEOM_Object) anObject =
339 GetOperations()->MakeShell(aShapes);
340 if (!GetOperations()->IsDone() || anObject.IsNull())
341 return aGEOMObject._retn();
343 return GetObject(anObject);
346 //=============================================================================
350 //=============================================================================
351 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShell
352 (GEOM::GEOM_Object_ptr theShell)
354 GEOM::GEOM_Object_var aGEOMObject;
356 //Set a not done flag
357 GetOperations()->SetNotDone();
359 //Get the reference objects
360 Handle(GEOM_Object) aShell = GetObjectImpl(theShell);
361 if (aShell.IsNull()) return aGEOMObject._retn();
363 std::list<Handle(GEOM_Object)> aShapes;
364 aShapes.push_back(aShell);
367 Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShells(aShapes);
368 if (!GetOperations()->IsDone() || anObject.IsNull())
369 return aGEOMObject._retn();
371 return GetObject(anObject);
374 //=============================================================================
378 //=============================================================================
379 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShells
380 (const GEOM::ListOfGO& theShells)
382 GEOM::GEOM_Object_var aGEOMObject;
384 //Set a not done flag
385 GetOperations()->SetNotDone();
388 std::list<Handle(GEOM_Object)> aShapes;
391 aLen = theShells.length();
392 for (ind = 0; ind < aLen; ind++) {
393 Handle(GEOM_Object) aSh = GetObjectImpl(theShells[ind]);
394 if (aSh.IsNull()) return aGEOMObject._retn();
395 aShapes.push_back(aSh);
399 Handle(GEOM_Object) anObject =
400 GetOperations()->MakeSolidShells(aShapes);
401 if (!GetOperations()->IsDone() || anObject.IsNull())
402 return aGEOMObject._retn();
404 return GetObject(anObject);
407 //=============================================================================
411 //=============================================================================
412 GEOM::GEOM_Object_ptr
413 GEOM_IShapesOperations_i::MakeCompound (const GEOM::ListOfGO& theShapes)
415 GEOM::GEOM_Object_var aGEOMObject;
417 //Set a not done flag
418 GetOperations()->SetNotDone();
421 std::list<Handle(GEOM_Object)> aShapes;
424 aLen = theShapes.length();
425 for (ind = 0; ind < aLen; ind++) {
426 Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
427 if (aSh.IsNull()) return aGEOMObject._retn();
428 aShapes.push_back(aSh);
432 Handle(GEOM_Object) anObject =
433 GetOperations()->MakeCompound(aShapes);
434 if (!GetOperations()->IsDone() || anObject.IsNull())
435 return aGEOMObject._retn();
437 return GetObject(anObject);
440 //=============================================================================
442 * MakeSolidFromConnectedFaces
444 //=============================================================================
445 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidFromConnectedFaces
446 (const GEOM::ListOfGO& theFacesOrShells,
447 const CORBA::Boolean isIntersect)
449 GEOM::GEOM_Object_var aGEOMObject;
451 //Set a not done flag
452 GetOperations()->SetNotDone();
455 std::list<Handle(GEOM_Object)> aShapes;
458 aLen = theFacesOrShells.length();
459 for (ind = 0; ind < aLen; ind++) {
460 Handle(GEOM_Object) aSh = GetObjectImpl(theFacesOrShells[ind]);
461 if (aSh.IsNull()) return aGEOMObject._retn();
462 aShapes.push_back(aSh);
466 Handle(GEOM_Object) anObject =
467 GetOperations()->MakeSolidFromConnectedFaces(aShapes, isIntersect);
468 if (!GetOperations()->IsDone() || anObject.IsNull())
469 return aGEOMObject._retn();
471 return GetObject(anObject);
474 //=============================================================================
478 //=============================================================================
479 GEOM::GEOM_Object_ptr
480 GEOM_IShapesOperations_i::MakeGlueFaces (const GEOM::ListOfGO& theShapes,
481 CORBA::Double theTolerance,
482 CORBA::Boolean doKeepNonSolids)
484 GEOM::GEOM_Object_var aGEOMObject;
486 //Set a not done flag
487 GetOperations()->SetNotDone();
489 //Get the reference objects
490 std::list< Handle(GEOM_Object) > aShapes;
491 if (! GetListOfObjectsImpl( theShapes, aShapes ))
492 return aGEOMObject._retn();
495 Handle(GEOM_Object) anObject =
496 GetOperations()->MakeGlueFaces(aShapes, theTolerance, doKeepNonSolids);
497 //if (!GetOperations()->IsDone() || anObject.IsNull())
499 if (anObject.IsNull())
500 return aGEOMObject._retn();
502 return GetObject(anObject);
505 //=============================================================================
509 //=============================================================================
511 GEOM_IShapesOperations_i::GetGlueFaces (const GEOM::ListOfGO& theShapes,
512 const CORBA::Double theTolerance)
514 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
516 //Set a not done flag
517 GetOperations()->SetNotDone();
519 //Get the reference objects
520 std::list< Handle(GEOM_Object) > aShapes;
521 if (! GetListOfObjectsImpl( theShapes, aShapes ))
524 Handle(TColStd_HSequenceOfTransient) aHSeq =
525 GetOperations()->GetGlueShapes(aShapes, theTolerance, TopAbs_FACE);
527 //if (!GetOperations()->IsDone() || aHSeq.IsNull())
532 Standard_Integer aLength = aHSeq->Length();
533 aSeq->length(aLength);
534 for (Standard_Integer i = 1; i <= aLength; i++)
535 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
540 //=============================================================================
542 * MakeGlueFacesByList
544 //=============================================================================
545 GEOM::GEOM_Object_ptr
546 GEOM_IShapesOperations_i::MakeGlueFacesByList (const GEOM::ListOfGO& theShapes,
547 CORBA::Double theTolerance,
548 const GEOM::ListOfGO& theFaces,
549 CORBA::Boolean doKeepNonSolids,
550 CORBA::Boolean doGlueAllEdges)
552 GEOM::GEOM_Object_var aGEOMObject;
554 //Set a not done flag
555 GetOperations()->SetNotDone();
557 //Get the reference objects
558 std::list< Handle(GEOM_Object) > aShapes;
559 if (! GetListOfObjectsImpl( theShapes, aShapes ))
560 return aGEOMObject._retn();
563 std::list<Handle(GEOM_Object)> aFaces;
564 if (! GetListOfObjectsImpl( theFaces, aFaces ))
565 return aGEOMObject._retn();
568 Handle(GEOM_Object) anObject =
569 GetOperations()->MakeGlueFacesByList(aShapes, theTolerance, aFaces,
570 doKeepNonSolids, doGlueAllEdges);
571 //if (!GetOperations()->IsDone() || anObject.IsNull())
573 if (anObject.IsNull())
574 return aGEOMObject._retn();
576 return GetObject(anObject);
579 //=============================================================================
583 //=============================================================================
584 GEOM::GEOM_Object_ptr
585 GEOM_IShapesOperations_i::MakeGlueEdges (const GEOM::ListOfGO& theShapes,
586 CORBA::Double theTolerance)
588 GEOM::GEOM_Object_var aGEOMObject;
590 //Set a not done flag
591 GetOperations()->SetNotDone();
593 //Get the reference objects
594 std::list< Handle(GEOM_Object) > aShapes;
595 if (! GetListOfObjectsImpl( theShapes, aShapes ))
596 return aGEOMObject._retn();
599 Handle(GEOM_Object) anObject =
600 GetOperations()->MakeGlueEdges(aShapes, theTolerance);
601 //if (!GetOperations()->IsDone() || anObject.IsNull())
603 if (anObject.IsNull())
604 return aGEOMObject._retn();
606 return GetObject(anObject);
609 //=============================================================================
613 //=============================================================================
615 GEOM_IShapesOperations_i::GetGlueEdges (const GEOM::ListOfGO& theShapes,
616 const CORBA::Double theTolerance)
618 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
620 //Set a not done flag
621 GetOperations()->SetNotDone();
623 //Get the reference objects
624 std::list< Handle(GEOM_Object) > aShapes;
625 if (! GetListOfObjectsImpl( theShapes, aShapes ))
628 Handle(TColStd_HSequenceOfTransient) aHSeq =
629 GetOperations()->GetGlueShapes(aShapes, theTolerance, TopAbs_EDGE);
631 //if (!GetOperations()->IsDone() || aHSeq.IsNull())
636 Standard_Integer aLength = aHSeq->Length();
637 aSeq->length(aLength);
638 for (Standard_Integer i = 1; i <= aLength; i++)
639 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
644 //=============================================================================
646 * MakeGlueEdgesByList
648 //=============================================================================
649 GEOM::GEOM_Object_ptr
650 GEOM_IShapesOperations_i::MakeGlueEdgesByList (const GEOM::ListOfGO& theShapes,
651 CORBA::Double theTolerance,
652 const GEOM::ListOfGO& theEdges)
654 GEOM::GEOM_Object_var aGEOMObject;
656 //Set a not done flag
657 GetOperations()->SetNotDone();
659 //Get the reference objects
660 std::list< Handle(GEOM_Object) > aShapes;
661 if (! GetListOfObjectsImpl( theShapes, aShapes ))
662 return aGEOMObject._retn();
665 std::list<Handle(GEOM_Object)> anEdges;
666 if (! GetListOfObjectsImpl( theEdges, anEdges ))
667 return aGEOMObject._retn();
670 Handle(GEOM_Object) anObject =
671 GetOperations()->MakeGlueEdgesByList(aShapes, theTolerance, anEdges);
672 //if (!GetOperations()->IsDone() || anObject.IsNull())
674 if (anObject.IsNull())
675 return aGEOMObject._retn();
677 return GetObject(anObject);
680 //=============================================================================
682 * GetExistingSubObjects
684 //=============================================================================
686 GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape,
687 CORBA::Boolean theGroupsOnly)
689 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
691 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
692 if (aShape.IsNull()) return aSeq._retn();
694 Handle(TColStd_HSequenceOfTransient) aHSeq =
695 GetOperations()->GetExistingSubObjects(aShape, theGroupsOnly);
696 if (!GetOperations()->IsDone() || aHSeq.IsNull())
699 Standard_Integer aLength = aHSeq->Length();
700 aSeq->length(aLength);
701 for (Standard_Integer i = 1; i <= aLength; i++)
702 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
707 //=============================================================================
709 * MakeExplode (including theShape itself, bad sorting)
711 //=============================================================================
712 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
713 const CORBA::Long theShapeType,
714 const CORBA::Boolean isSorted)
716 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
718 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
719 if (aShape.IsNull()) return aSeq._retn();
721 Handle(TColStd_HSequenceOfTransient) aHSeq =
722 GetOperations()->MakeExplode(aShape, theShapeType, isSorted,
723 GEOMImpl_IShapesOperations::EXPLODE_OLD_INCLUDE_MAIN);
724 if (!GetOperations()->IsDone() || aHSeq.IsNull())
727 Standard_Integer aLength = aHSeq->Length();
728 aSeq->length(aLength);
729 for (Standard_Integer i = 1; i <= aLength; i++)
730 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
735 //=============================================================================
737 * MakeAllSubShapes (including theShape itself, good sorting)
739 //=============================================================================
740 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeAllSubShapes (GEOM::GEOM_Object_ptr theShape,
741 const CORBA::Long theShapeType,
742 const CORBA::Boolean isSorted)
744 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
746 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
747 if (aShape.IsNull()) return aSeq._retn();
749 Handle(TColStd_HSequenceOfTransient) aHSeq =
750 GetOperations()->MakeExplode(aShape, theShapeType, isSorted,
751 GEOMImpl_IShapesOperations::EXPLODE_NEW_INCLUDE_MAIN);
752 if (!GetOperations()->IsDone() || aHSeq.IsNull())
755 Standard_Integer aLength = aHSeq->Length();
756 aSeq->length(aLength);
757 for (Standard_Integer i = 1; i <= aLength; i++)
758 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
763 //=============================================================================
765 * ExtractSubShapes (excluding theShape itself, good sorting)
767 //=============================================================================
768 GEOM::ListOfGO* GEOM_IShapesOperations_i::ExtractSubShapes (GEOM::GEOM_Object_ptr theShape,
769 const CORBA::Long theShapeType,
770 const CORBA::Boolean isSorted)
772 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
774 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
775 if (aShape.IsNull()) return aSeq._retn();
777 Handle(TColStd_HSequenceOfTransient) aHSeq =
778 // TODO: enum instead of bool for the last argument
779 GetOperations()->MakeExplode(aShape, theShapeType, isSorted,
780 GEOMImpl_IShapesOperations::EXPLODE_NEW_EXCLUDE_MAIN);
781 if (!GetOperations()->IsDone() || aHSeq.IsNull())
784 Standard_Integer aLength = aHSeq->Length();
785 aSeq->length(aLength);
786 for (Standard_Integer i = 1; i <= aLength; i++)
787 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
792 //=============================================================================
796 //=============================================================================
797 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
798 const CORBA::Long theShapeType,
799 const CORBA::Boolean isSorted)
801 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
803 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
804 if (aShape.IsNull()) return aSeq._retn();
806 Handle(TColStd_HSequenceOfInteger) aHSeq =
807 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted,
808 GEOMImpl_IShapesOperations::EXPLODE_OLD_INCLUDE_MAIN);
809 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
811 Standard_Integer aLength = aHSeq->Length();
812 aSeq->length(aLength);
813 for (Standard_Integer i = 1; i <= aLength; i++)
814 aSeq[i-1] = aHSeq->Value(i);
819 //=============================================================================
823 //=============================================================================
824 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetAllSubShapesIDs (GEOM::GEOM_Object_ptr theShape,
825 const CORBA::Long theShapeType,
826 const CORBA::Boolean isSorted)
828 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
830 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
831 if (aShape.IsNull()) return aSeq._retn();
833 Handle(TColStd_HSequenceOfInteger) aHSeq =
834 GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted,
835 GEOMImpl_IShapesOperations::EXPLODE_NEW_INCLUDE_MAIN);
836 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
838 Standard_Integer aLength = aHSeq->Length();
839 aSeq->length(aLength);
840 for (Standard_Integer i = 1; i <= aLength; i++)
841 aSeq[i-1] = aHSeq->Value(i);
846 //=============================================================================
850 //=============================================================================
851 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
852 (GEOM::GEOM_Object_ptr theMainShape,
853 const CORBA::Long theID)
855 GEOM::GEOM_Object_var aGEOMObject;
857 //Set a not done flag
858 GetOperations()->SetNotDone();
860 //Get the reference objects
861 Handle(GEOM_Object) aShape = GetObjectImpl(theMainShape);
862 if (aShape.IsNull()) return aGEOMObject._retn();
864 Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
865 if (!GetOperations()->IsDone() || anObject.IsNull())
866 return aGEOMObject._retn();
868 return GetObject(anObject);
871 //=============================================================================
875 //=============================================================================
876 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeSubShapes (GEOM::GEOM_Object_ptr theMainShape,
877 const GEOM::ListOfLong& theIndices)
879 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
882 //Set a not done flag
883 GetOperations()->SetNotDone();
885 if (theIndices.length() < 1)
888 Handle(GEOM_Object) aShape = GetObjectImpl(theMainShape);
889 if (aShape.IsNull()) return aSeq._retn();
891 Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger (1, theIndices.length());
892 for (i = 0; i < theIndices.length(); i++)
893 anArray->SetValue(i+1, theIndices[i]);
895 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->MakeSubShapes(aShape, anArray);
896 if (!GetOperations()->IsDone() || aHSeq.IsNull())
899 Standard_Integer aLength = aHSeq->Length();
900 aSeq->length(aLength);
901 for (i = 0; i < aLength; i++)
902 aSeq[i] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i+1)));
907 //=============================================================================
911 //=============================================================================
912 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
913 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
915 //Get the reference shapes
916 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
917 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
919 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
921 //Get the unique ID of <theSubShape> inside <theMainShape>
922 CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
923 if (!GetOperations()->IsDone())
929 //=============================================================================
931 * GetSubShapesIndices
933 //=============================================================================
934 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetSubShapesIndices
935 (GEOM::GEOM_Object_ptr theMainShape, const GEOM::ListOfGO& theSubShapes)
937 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
939 //Get the reference main shape
940 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
941 if (aMainShapeRef.IsNull()) return aSeq._retn();
944 std::list<Handle(GEOM_Object)> aShapes;
945 int aLen = theSubShapes.length();
946 for (int ind = 0; ind < aLen; ind++) {
947 Handle(GEOM_Object) aSh = GetObjectImpl(theSubShapes[ind]);
950 MESSAGE("NULL shape")
953 aShapes.push_back(aSh);
956 //Get the IDs of <theSubShapes> inside <theMainShape>
957 Handle(TColStd_HSequenceOfInteger) aHSeq =
958 GetOperations()->GetSubShapesIndices(aMainShapeRef, aShapes);
960 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
962 Standard_Integer aLength = aHSeq->Length();
963 aSeq->length(aLength);
965 for (Standard_Integer i = 1; i <= aLength; i++)
966 aSeq[i-1] = aHSeq->Value(i);
972 //=============================================================================
976 //=============================================================================
977 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
978 (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
980 //Get the reference shapes
981 Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
982 Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
984 if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
986 //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
987 CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
988 if (!GetOperations()->IsDone())
994 //=============================================================================
998 //=============================================================================
999 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
1001 //Get the reference shape
1002 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1003 if (aShape.IsNull()) return NULL;
1005 // Get shape parameters
1006 TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
1007 return CORBA::string_dup(aDescription.ToCString());
1010 //=============================================================================
1012 * IsSubShapeBelongsTo
1014 //=============================================================================
1015 CORBA::Boolean GEOM_IShapesOperations_i::IsSubShapeBelongsTo( GEOM::GEOM_Object_ptr theSubObject,
1016 const CORBA::Long theSubObjectIndex,
1017 GEOM::GEOM_Object_ptr theObject,
1018 const CORBA::Long theObjectIndex)
1020 Handle(GEOM_Object) aSubObject = GetObjectImpl( theSubObject );
1021 Handle(GEOM_Object) anObject = GetObjectImpl( theObject );
1022 if( anObject.IsNull() || aSubObject.IsNull() )
1026 return GetOperations()->IsSubShapeBelongsTo( aSubObject, theSubObjectIndex, anObject, theObjectIndex );
1029 //=============================================================================
1033 //=============================================================================
1034 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
1036 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_FACE));
1039 //=============================================================================
1043 //=============================================================================
1044 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
1046 return NumberOfSubShapes(theShape, Standard_Integer(TopAbs_EDGE));
1049 //=============================================================================
1053 //=============================================================================
1054 CORBA::Long GEOM_IShapesOperations_i::NumberOfSubShapes (GEOM::GEOM_Object_ptr theShape,
1055 const CORBA::Long theShapeType)
1057 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1058 if (aShape.IsNull()) return -1;
1060 CORBA::Long aNb = GetOperations()->NumberOfSubShapes(aShape, theShapeType);
1061 if (!GetOperations()->IsDone()) return -1;
1066 //=============================================================================
1070 //=============================================================================
1071 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
1072 (GEOM::GEOM_Object_ptr theShape)
1074 GEOM::GEOM_Object_var aGEOMObject;
1076 //Set a not done flag
1077 GetOperations()->SetNotDone();
1079 //Get the reference objects
1080 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1081 if (aShape.IsNull()) return aGEOMObject._retn();
1084 Handle(GEOM_Object) anObject = GetOperations()->ReverseShape(aShape);
1085 if (!GetOperations()->IsDone() || anObject.IsNull())
1086 return aGEOMObject._retn();
1088 return GetObject(anObject);
1091 //=============================================================================
1095 //=============================================================================
1096 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_ptr theShape)
1098 //Set a not done flag
1099 GetOperations()->SetNotDone();
1101 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1103 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1104 if (aShape.IsNull()) return aSeq._retn();
1106 Handle(TColStd_HSequenceOfInteger) aHSeq =
1107 GetOperations()->GetFreeFacesIDs(aShape);
1108 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
1110 Standard_Integer aLength = aHSeq->Length();
1111 aSeq->length(aLength);
1112 for (Standard_Integer i = 1; i <= aLength; i++)
1113 aSeq[i-1] = aHSeq->Value(i);
1115 return aSeq._retn();
1118 //=============================================================================
1122 //=============================================================================
1123 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
1124 (GEOM::GEOM_Object_ptr theShape1,
1125 GEOM::GEOM_Object_ptr theShape2,
1126 const CORBA::Long theShapeType)
1128 //Set a not done flag
1129 GetOperations()->SetNotDone();
1131 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1133 Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
1134 Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
1136 if (aShape1.IsNull() || aShape2.IsNull()) return aSeq._retn();
1138 Handle(TColStd_HSequenceOfTransient) aHSeq =
1139 GetOperations()->GetSharedShapes(aShape1, aShape2, theShapeType);
1140 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1141 return aSeq._retn();
1143 Standard_Integer aLength = aHSeq->Length();
1144 aSeq->length(aLength);
1145 for (Standard_Integer i = 1; i <= aLength; i++)
1146 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1148 return aSeq._retn();
1151 //=============================================================================
1153 * GetSharedShapesMulti
1155 //=============================================================================
1156 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapesMulti
1157 (const GEOM::ListOfGO& theShapes,
1158 const CORBA::Long theShapeType,
1159 CORBA::Boolean theMultiShare)
1161 //Set a not done flag
1162 GetOperations()->SetNotDone();
1164 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1167 std::list<Handle(GEOM_Object)> aShapes;
1168 if (! GetListOfObjectsImpl( theShapes, aShapes ))
1169 return aSeq._retn();
1171 Handle(TColStd_HSequenceOfTransient) aHSeq =
1172 GetOperations()->GetSharedShapes(aShapes, theShapeType, theMultiShare);
1173 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1174 return aSeq._retn();
1176 Standard_Integer aLength = aHSeq->Length();
1177 aSeq->length(aLength);
1178 for (Standard_Integer i = 1; i <= aLength; i++)
1179 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1181 return aSeq._retn();
1184 static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
1186 GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
1190 aState = GEOMAlgo_ST_ON;
1193 aState = GEOMAlgo_ST_OUT;
1195 case GEOM::ST_ONOUT:
1196 aState = GEOMAlgo_ST_ONOUT;
1199 aState = GEOMAlgo_ST_IN;
1202 aState = GEOMAlgo_ST_ONIN;
1211 //=============================================================================
1215 //=============================================================================
1216 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
1217 (GEOM::GEOM_Object_ptr theShape,
1218 const CORBA::Long theShapeType,
1219 GEOM::GEOM_Object_ptr theAx1,
1220 const GEOM::shape_state theState)
1222 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1224 //Set a not done flag
1225 GetOperations()->SetNotDone();
1227 //Get the reference objects
1228 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1229 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1231 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
1233 //Get Shapes On Plane
1234 Handle(TColStd_HSequenceOfTransient) aHSeq =
1235 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
1236 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1237 return aSeq._retn();
1239 Standard_Integer aLength = aHSeq->Length();
1240 aSeq->length(aLength);
1241 for (Standard_Integer i = 1; i <= aLength; i++)
1242 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1244 return aSeq._retn();
1247 //=============================================================================
1249 * GetShapesOnPlaneWithLocation
1251 //=============================================================================
1252 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
1253 (GEOM::GEOM_Object_ptr theShape,
1254 const CORBA::Long theShapeType,
1255 GEOM::GEOM_Object_ptr theAx1,
1256 GEOM::GEOM_Object_ptr thePnt,
1257 const GEOM::shape_state theState)
1259 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1261 //Set a not done flag
1262 GetOperations()->SetNotDone();
1264 //Get the reference objects
1265 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1266 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1267 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
1269 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1271 //Get Shapes On Plane
1272 Handle(TColStd_HSequenceOfTransient) aHSeq =
1273 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
1274 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1275 return aSeq._retn();
1277 Standard_Integer aLength = aHSeq->Length();
1278 aSeq->length(aLength);
1279 for (Standard_Integer i = 1; i <= aLength; i++)
1280 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1282 return aSeq._retn();
1285 //=============================================================================
1287 * GetShapesOnCylinder
1289 //=============================================================================
1290 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
1291 (GEOM::GEOM_Object_ptr theShape,
1292 const CORBA::Long theShapeType,
1293 GEOM::GEOM_Object_ptr theAxis,
1294 const CORBA::Double theRadius,
1295 const GEOM::shape_state theState)
1297 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1299 //Set a not done flag
1300 GetOperations()->SetNotDone();
1302 //Get the reference objects
1303 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1304 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1306 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1308 //Get Shapes On Cylinder
1309 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
1310 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1311 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1312 return aSeq._retn();
1314 Standard_Integer aLength = aHSeq->Length();
1315 aSeq->length(aLength);
1316 for (Standard_Integer i = 1; i <= aLength; i++)
1317 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1319 return aSeq._retn();
1322 //=============================================================================
1324 * GetShapesOnCylinderWithLocation
1326 //=============================================================================
1327 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocation
1328 (GEOM::GEOM_Object_ptr theShape,
1329 const CORBA::Long theShapeType,
1330 GEOM::GEOM_Object_ptr theAxis,
1331 GEOM::GEOM_Object_ptr thePnt,
1332 const CORBA::Double theRadius,
1333 const GEOM::shape_state theState)
1335 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1337 //Set a not done flag
1338 GetOperations()->SetNotDone();
1340 //Get the reference objects
1341 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1342 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1343 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1345 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1347 //Get Shapes On Cylinder
1348 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinderWithLocation
1349 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1350 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1351 return aSeq._retn();
1353 Standard_Integer aLength = aHSeq->Length();
1354 aSeq->length(aLength);
1355 for (Standard_Integer i = 1; i <= aLength; i++)
1356 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1358 return aSeq._retn();
1361 //=============================================================================
1365 //=============================================================================
1366 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
1367 (GEOM::GEOM_Object_ptr theShape,
1368 const CORBA::Long theShapeType,
1369 GEOM::GEOM_Object_ptr theCenter,
1370 const CORBA::Double theRadius,
1371 const GEOM::shape_state theState)
1373 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1375 //Set a not done flag
1376 GetOperations()->SetNotDone();
1378 //Get the reference objects
1379 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1380 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1382 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1384 //Get Shapes On Sphere
1385 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
1386 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1387 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1388 return aSeq._retn();
1390 Standard_Integer aLength = aHSeq->Length();
1391 aSeq->length(aLength);
1392 for (Standard_Integer i = 1; i <= aLength; i++)
1393 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1395 return aSeq._retn();
1398 //=============================================================================
1400 * GetShapesOnQuadrangle
1402 //=============================================================================
1403 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
1404 (GEOM::GEOM_Object_ptr theShape,
1405 CORBA::Long theShapeType,
1406 GEOM::GEOM_Object_ptr theTopLeftPoint,
1407 GEOM::GEOM_Object_ptr theTopRigthPoint,
1408 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1409 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1410 GEOM::shape_state theState)
1412 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1414 //Set a not done flag
1415 GetOperations()->SetNotDone();
1417 //Get the reference objects
1418 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1419 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1420 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1421 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1422 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1424 if (aShape.IsNull() ||
1425 aTopLeftPoint.IsNull() ||
1426 aTopRigthPoint.IsNull() ||
1427 aBottomLeftPoint.IsNull() ||
1428 aBottomRigthPoint.IsNull())
1429 return aSeq._retn();
1431 //Get Shapes On Quadrangle
1432 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
1433 (aShape, theShapeType,
1434 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1435 ShapeState(theState));
1436 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1437 return aSeq._retn();
1439 Standard_Integer aLength = aHSeq->Length();
1440 aSeq->length(aLength);
1441 for (Standard_Integer i = 1; i <= aLength; i++)
1442 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1444 return aSeq._retn();
1447 //=============================================================================
1449 * GetShapesOnPlaneIDs
1451 //=============================================================================
1452 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
1453 (GEOM::GEOM_Object_ptr theShape,
1454 const CORBA::Long theShapeType,
1455 GEOM::GEOM_Object_ptr theAx1,
1456 const GEOM::shape_state theState)
1458 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1460 //Set a not done flag
1461 GetOperations()->SetNotDone();
1463 //Get the reference objects
1464 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1465 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1467 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
1469 //Get Shapes On Plane
1470 Handle(TColStd_HSequenceOfInteger) aHSeq =
1471 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
1472 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1473 return aSeq._retn();
1475 Standard_Integer aLength = aHSeq->Length();
1476 aSeq->length(aLength);
1477 for (Standard_Integer i = 1; i <= aLength; i++)
1478 aSeq[i-1] = aHSeq->Value(i);
1480 return aSeq._retn();
1483 //=============================================================================
1485 * GetShapesOnPlaneWithLocationIDs
1487 //=============================================================================
1488 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
1489 (GEOM::GEOM_Object_ptr theShape,
1490 const CORBA::Long theShapeType,
1491 GEOM::GEOM_Object_ptr theAx1,
1492 GEOM::GEOM_Object_ptr thePnt,
1493 const GEOM::shape_state theState)
1495 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1497 //Set a not done flag
1498 GetOperations()->SetNotDone();
1500 //Get the reference objects
1501 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1502 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1503 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
1505 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1507 //Get Shapes On Plane
1508 Handle(TColStd_HSequenceOfInteger) aHSeq =
1509 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
1510 anAx1, anPnt, ShapeState(theState));
1511 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1512 return aSeq._retn();
1514 Standard_Integer aLength = aHSeq->Length();
1515 aSeq->length(aLength);
1516 for (Standard_Integer i = 1; i <= aLength; i++)
1517 aSeq[i-1] = aHSeq->Value(i);
1519 return aSeq._retn();
1522 //=============================================================================
1524 * GetShapesOnCylinderIDs
1526 //=============================================================================
1527 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1528 (GEOM::GEOM_Object_ptr theShape,
1529 const CORBA::Long theShapeType,
1530 GEOM::GEOM_Object_ptr theAxis,
1531 const CORBA::Double theRadius,
1532 const GEOM::shape_state theState)
1534 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1536 //Set a not done flag
1537 GetOperations()->SetNotDone();
1539 //Get the reference objects
1540 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1541 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1543 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1545 //Get Shapes On Cylinder
1546 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
1547 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1548 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1549 return aSeq._retn();
1551 Standard_Integer aLength = aHSeq->Length();
1552 aSeq->length(aLength);
1553 for (Standard_Integer i = 1; i <= aLength; i++)
1554 aSeq[i-1] = aHSeq->Value(i);
1556 return aSeq._retn();
1559 //=============================================================================
1561 * GetShapesOnCylinderWithLocationIDs
1563 //=============================================================================
1564 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocationIDs
1565 (GEOM::GEOM_Object_ptr theShape,
1566 const CORBA::Long theShapeType,
1567 GEOM::GEOM_Object_ptr theAxis,
1568 GEOM::GEOM_Object_ptr thePnt,
1569 const CORBA::Double theRadius,
1570 const GEOM::shape_state theState)
1572 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1574 //Set a not done flag
1575 GetOperations()->SetNotDone();
1577 //Get the reference objects
1578 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1579 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1580 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1582 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1584 //Get Shapes On Cylinder
1585 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderWithLocationIDs
1586 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1587 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1588 return aSeq._retn();
1590 Standard_Integer aLength = aHSeq->Length();
1591 aSeq->length(aLength);
1592 for (Standard_Integer i = 1; i <= aLength; i++)
1593 aSeq[i-1] = aHSeq->Value(i);
1595 return aSeq._retn();
1598 //=============================================================================
1600 * GetShapesOnSphereIDs
1602 //=============================================================================
1603 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1604 (GEOM::GEOM_Object_ptr theShape,
1605 const CORBA::Long theShapeType,
1606 GEOM::GEOM_Object_ptr theCenter,
1607 const CORBA::Double theRadius,
1608 const GEOM::shape_state theState)
1610 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1612 //Set a not done flag
1613 GetOperations()->SetNotDone();
1615 //Get the reference objects
1616 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1617 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1619 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1621 //Get Shapes On Sphere
1622 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1623 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1624 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1625 return aSeq._retn();
1627 Standard_Integer aLength = aHSeq->Length();
1628 aSeq->length(aLength);
1629 for (Standard_Integer i = 1; i <= aLength; i++)
1630 aSeq[i-1] = aHSeq->Value(i);
1632 return aSeq._retn();
1635 //=============================================================================
1637 * GetShapesOnQuadrangleIDs
1639 //=============================================================================
1640 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1641 (GEOM::GEOM_Object_ptr theShape,
1642 CORBA::Long theShapeType,
1643 GEOM::GEOM_Object_ptr theTopLeftPoint,
1644 GEOM::GEOM_Object_ptr theTopRigthPoint,
1645 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1646 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1647 GEOM::shape_state theState)
1649 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1651 //Set a not done flag
1652 GetOperations()->SetNotDone();
1654 //Get the reference objects
1655 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1656 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1657 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1658 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1659 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1661 if (aShape.IsNull() ||
1662 aTopLeftPoint.IsNull() ||
1663 aTopRigthPoint.IsNull() ||
1664 aBottomLeftPoint.IsNull() ||
1665 aBottomRigthPoint.IsNull() )
1666 return aSeq._retn();
1668 //Get Shapes On Quadrangle
1669 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1670 (aShape, theShapeType,
1671 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1672 ShapeState(theState));
1673 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1674 return aSeq._retn();
1676 Standard_Integer aLength = aHSeq->Length();
1677 aSeq->length(aLength);
1678 for (Standard_Integer i = 1; i <= aLength; i++)
1679 aSeq[i-1] = aHSeq->Value(i);
1681 return aSeq._retn();
1684 //=============================================================================
1688 //=============================================================================
1689 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1690 (GEOM::GEOM_Object_ptr theBox,
1691 GEOM::GEOM_Object_ptr theShape,
1692 CORBA::Long theShapeType,
1693 GEOM::shape_state theState)
1695 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1697 //Set a not done flag
1698 GetOperations()->SetNotDone();
1700 //Get the reference objects
1701 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1702 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1704 if (aShape.IsNull() || aBox.IsNull() )
1705 return aSeq._retn();
1708 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
1709 (aBox,aShape, theShapeType,ShapeState(theState));
1710 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1711 return aSeq._retn();
1713 Standard_Integer aLength = aHSeq->Length();
1714 aSeq->length(aLength);
1715 for (Standard_Integer i = 1; i <= aLength; i++)
1716 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1718 return aSeq._retn();
1721 //=============================================================================
1723 * GetShapesOnQuadrangleIDs
1725 //=============================================================================
1726 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1727 (GEOM::GEOM_Object_ptr theBox,
1728 GEOM::GEOM_Object_ptr theShape,
1729 CORBA::Long theShapeType,
1730 GEOM::shape_state theState)
1732 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1734 //Set a not done flag
1735 GetOperations()->SetNotDone();
1737 //Get the reference objects
1738 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1739 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1741 if (aShape.IsNull() || aBox.IsNull() )
1742 return aSeq._retn();
1745 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1746 (aBox,aShape, theShapeType,ShapeState(theState));
1747 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1748 return aSeq._retn();
1750 Standard_Integer aLength = aHSeq->Length();
1751 aSeq->length(aLength);
1752 for (Standard_Integer i = 1; i <= aLength; i++)
1753 aSeq[i-1] = aHSeq->Value(i);
1755 return aSeq._retn();
1759 //=============================================================================
1763 //=============================================================================
1764 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
1765 (GEOM::GEOM_Object_ptr theCheckShape,
1766 GEOM::GEOM_Object_ptr theShape,
1767 CORBA::Short theShapeType,
1768 GEOM::shape_state theState)
1770 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1772 //Set a not done flag
1773 GetOperations()->SetNotDone();
1775 //Get the reference objects
1776 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1777 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1779 if (aShape.IsNull() || aCheckShape.IsNull() )
1780 return aSeq._retn();
1782 //Get Shapes On Shape
1783 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape
1784 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1786 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1787 return aSeq._retn();
1789 Standard_Integer aLength = aHSeq->Length();
1790 aSeq->length(aLength);
1791 for (Standard_Integer i = 1; i <= aLength; i++)
1792 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1794 return aSeq._retn();
1798 //=============================================================================
1800 * GetShapesOnShapeAsCompound
1802 //=============================================================================
1803 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
1804 (GEOM::GEOM_Object_ptr theCheckShape,
1805 GEOM::GEOM_Object_ptr theShape,
1806 CORBA::Short theShapeType,
1807 GEOM::shape_state theState)
1809 GEOM::GEOM_Object_var aGEOMObject;
1811 //Set a not done flag
1812 GetOperations()->SetNotDone();
1814 //Get the reference objects
1815 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1816 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1818 if (aShape.IsNull() || aCheckShape.IsNull() )
1819 return aGEOMObject._retn();
1821 //Get Shapes On Shape
1822 Handle(GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound
1823 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1825 if (anObject.IsNull())
1826 return aGEOMObject._retn();
1828 return GetObject(anObject);
1832 //=============================================================================
1834 * GetShapesOnShapeIDs
1836 //=============================================================================
1837 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
1838 (GEOM::GEOM_Object_ptr theCheckShape,
1839 GEOM::GEOM_Object_ptr theShape,
1840 CORBA::Short theShapeType,
1841 GEOM::shape_state theState)
1843 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1845 //Set a not done flag
1846 GetOperations()->SetNotDone();
1848 //Get the reference objects
1849 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1850 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1852 if (aShape.IsNull() || aCheckShape.IsNull() )
1853 return aSeq._retn();
1855 //Get Shapes On Shape
1856 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs
1857 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1858 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1859 return aSeq._retn();
1861 Standard_Integer aLength = aHSeq->Length();
1862 aSeq->length(aLength);
1863 for (Standard_Integer i = 1; i <= aLength; i++)
1864 aSeq[i-1] = aHSeq->Value(i);
1866 return aSeq._retn();
1870 //=============================================================================
1874 //=============================================================================
1875 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1876 (GEOM::GEOM_Object_ptr theShapeWhere,
1877 GEOM::GEOM_Object_ptr theShapeWhat)
1879 GEOM::GEOM_Object_var aGEOMObject;
1881 //Set a not done flag
1882 GetOperations()->SetNotDone();
1884 //Get the reference objects
1885 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1886 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1888 if (aShapeWhere.IsNull() ||
1889 aShapeWhat.IsNull()) return aGEOMObject._retn();
1891 //Get Shapes in place of aShapeWhat
1892 Handle(GEOM_Object) anObject =
1893 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1894 if (!GetOperations()->IsDone() || anObject.IsNull())
1895 return aGEOMObject._retn();
1897 return GetObject(anObject);
1900 //=============================================================================
1904 //=============================================================================
1905 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceOld
1906 (GEOM::GEOM_Object_ptr theShapeWhere,
1907 GEOM::GEOM_Object_ptr theShapeWhat)
1909 GEOM::GEOM_Object_var aGEOMObject;
1911 //Set a not done flag
1912 GetOperations()->SetNotDone();
1914 //Get the reference objects
1915 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1916 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1918 if (aShapeWhere.IsNull() ||
1919 aShapeWhat.IsNull()) return aGEOMObject._retn();
1921 //Get Shapes in place of aShapeWhat
1922 Handle(GEOM_Object) anObject =
1923 GetOperations()->GetInPlaceOld(aShapeWhere, aShapeWhat);
1924 if (!GetOperations()->IsDone() || anObject.IsNull())
1925 return aGEOMObject._retn();
1927 return GetObject(anObject);
1930 //=============================================================================
1932 * GetInPlaceByHistory
1934 //=============================================================================
1935 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
1936 (GEOM::GEOM_Object_ptr theShapeWhere,
1937 GEOM::GEOM_Object_ptr theShapeWhat)
1939 GEOM::GEOM_Object_var aGEOMObject;
1941 //Set a not done flag
1942 GetOperations()->SetNotDone();
1944 //Get the reference objects
1945 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1946 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1948 if (aShapeWhere.IsNull() ||
1949 aShapeWhat.IsNull()) return aGEOMObject._retn();
1951 //Get Shapes in place of aShapeWhat
1952 Handle(GEOM_Object) anObject =
1953 GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
1954 if (!GetOperations()->IsDone() || anObject.IsNull())
1955 return aGEOMObject._retn();
1957 return GetObject(anObject);
1960 //=============================================================================
1964 //=============================================================================
1965 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1966 (GEOM::GEOM_Object_ptr theShapeWhere,
1967 GEOM::GEOM_Object_ptr theShapeWhat)
1969 GEOM::GEOM_Object_var aGEOMObject;
1971 //Set a not done flag
1972 GetOperations()->SetNotDone();
1974 //Get the reference objects
1975 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1976 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1978 if (aShapeWhere.IsNull() ||
1979 aShapeWhat.IsNull()) return aGEOMObject._retn();
1981 //Get Shapes in place of aShapeWhat
1982 Handle(GEOM_Object) anObject =
1983 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1984 if (!GetOperations()->IsDone() || anObject.IsNull())
1985 return aGEOMObject._retn();
1987 return GetObject(anObject);
1990 //=============================================================================
1994 //=============================================================================
1995 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetSameIDs
1996 (GEOM::GEOM_Object_ptr theShapeWhere,
1997 GEOM::GEOM_Object_ptr theShapeWhat) {
1998 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
2000 //Get the reference objects
2001 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
2002 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
2004 if (aShapeWhere.IsNull() ||
2005 aShapeWhat.IsNull()) return aSeq._retn();
2008 Handle(TColStd_HSequenceOfInteger) aHSeq =
2009 GetOperations()->GetSameIDs(aShapeWhere, aShapeWhat);
2011 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
2013 Standard_Integer aLength = aHSeq->Length();
2014 aSeq->length(aLength);
2015 for (Standard_Integer i = 1; i <= aLength; i++)
2016 aSeq[i-1] = aHSeq->Value(i);
2018 return aSeq._retn();
2021 //=============================================================================
2025 //=============================================================================
2026 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ExtendEdge
2027 (GEOM::GEOM_Object_ptr theEdge,
2028 CORBA::Double theMin,
2029 CORBA::Double theMax)
2031 GEOM::GEOM_Object_var aGEOMObject;
2033 //Set a not done flag
2034 GetOperations()->SetNotDone();
2036 //Get the reference objects
2037 Handle(GEOM_Object) anEdge = GetObjectImpl(theEdge);
2039 if (anEdge.IsNull()) {
2040 return aGEOMObject._retn();
2043 //Get Shapes in place of aShapeWhat
2044 Handle(GEOM_Object) aNewEdge =
2045 GetOperations()->ExtendEdge(anEdge, theMin, theMax);
2047 if (!GetOperations()->IsDone() || aNewEdge.IsNull()) {
2048 return aGEOMObject._retn();
2051 return GetObject(aNewEdge);
2054 //=============================================================================
2058 //=============================================================================
2059 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ExtendFace
2060 (GEOM::GEOM_Object_ptr theFace,
2061 CORBA::Double theUMin,
2062 CORBA::Double theUMax,
2063 CORBA::Double theVMin,
2064 CORBA::Double theVMax)
2066 GEOM::GEOM_Object_var aGEOMObject;
2068 //Set a not done flag
2069 GetOperations()->SetNotDone();
2071 //Get the reference objects
2072 Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
2074 if (aFace.IsNull()) {
2075 return aGEOMObject._retn();
2078 //Get Shapes in place of aShapeWhat
2079 Handle(GEOM_Object) aNewFace =
2080 GetOperations()->ExtendFace(aFace, theUMin, theUMax, theVMin, theVMax);
2082 if (!GetOperations()->IsDone() || aNewFace.IsNull()) {
2083 return aGEOMObject._retn();
2086 return GetObject(aNewFace);
2089 //=============================================================================
2091 * MakeSurfaceFromFace
2093 //=============================================================================
2094 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSurfaceFromFace
2095 (GEOM::GEOM_Object_ptr theFace)
2097 GEOM::GEOM_Object_var aGEOMObject;
2099 //Set a not done flag
2100 GetOperations()->SetNotDone();
2102 //Get the reference object
2103 Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
2105 if (aFace.IsNull()) {
2106 return aGEOMObject._retn();
2109 //Get Shapes in place of aShapeWhat
2110 Handle(GEOM_Object) aNewFace = GetOperations()->MakeSurfaceFromFace(aFace);
2112 if (!GetOperations()->IsDone() || aNewFace.IsNull()) {
2113 return aGEOMObject._retn();
2116 return GetObject(aNewFace);