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)
1160 //Set a not done flag
1161 GetOperations()->SetNotDone();
1163 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1166 std::list<Handle(GEOM_Object)> aShapes;
1167 if (! GetListOfObjectsImpl( theShapes, aShapes ))
1168 return aSeq._retn();
1170 Handle(TColStd_HSequenceOfTransient) aHSeq =
1171 GetOperations()->GetSharedShapes(aShapes, theShapeType);
1172 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1173 return aSeq._retn();
1175 Standard_Integer aLength = aHSeq->Length();
1176 aSeq->length(aLength);
1177 for (Standard_Integer i = 1; i <= aLength; i++)
1178 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1180 return aSeq._retn();
1183 static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
1185 GEOMAlgo_State aState = GEOMAlgo_ST_UNKNOWN;
1189 aState = GEOMAlgo_ST_ON;
1192 aState = GEOMAlgo_ST_OUT;
1194 case GEOM::ST_ONOUT:
1195 aState = GEOMAlgo_ST_ONOUT;
1198 aState = GEOMAlgo_ST_IN;
1201 aState = GEOMAlgo_ST_ONIN;
1210 //=============================================================================
1214 //=============================================================================
1215 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
1216 (GEOM::GEOM_Object_ptr theShape,
1217 const CORBA::Long theShapeType,
1218 GEOM::GEOM_Object_ptr theAx1,
1219 const GEOM::shape_state theState)
1221 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1223 //Set a not done flag
1224 GetOperations()->SetNotDone();
1226 //Get the reference objects
1227 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1228 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1230 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
1232 //Get Shapes On Plane
1233 Handle(TColStd_HSequenceOfTransient) aHSeq =
1234 GetOperations()->GetShapesOnPlane(aShape, theShapeType, anAx1, ShapeState(theState));
1235 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1236 return aSeq._retn();
1238 Standard_Integer aLength = aHSeq->Length();
1239 aSeq->length(aLength);
1240 for (Standard_Integer i = 1; i <= aLength; i++)
1241 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1243 return aSeq._retn();
1246 //=============================================================================
1248 * GetShapesOnPlaneWithLocation
1250 //=============================================================================
1251 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
1252 (GEOM::GEOM_Object_ptr theShape,
1253 const CORBA::Long theShapeType,
1254 GEOM::GEOM_Object_ptr theAx1,
1255 GEOM::GEOM_Object_ptr thePnt,
1256 const GEOM::shape_state theState)
1258 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1260 //Set a not done flag
1261 GetOperations()->SetNotDone();
1263 //Get the reference objects
1264 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1265 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1266 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
1268 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1270 //Get Shapes On Plane
1271 Handle(TColStd_HSequenceOfTransient) aHSeq =
1272 GetOperations()->GetShapesOnPlaneWithLocation(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
1273 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1274 return aSeq._retn();
1276 Standard_Integer aLength = aHSeq->Length();
1277 aSeq->length(aLength);
1278 for (Standard_Integer i = 1; i <= aLength; i++)
1279 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1281 return aSeq._retn();
1284 //=============================================================================
1286 * GetShapesOnCylinder
1288 //=============================================================================
1289 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
1290 (GEOM::GEOM_Object_ptr theShape,
1291 const CORBA::Long theShapeType,
1292 GEOM::GEOM_Object_ptr theAxis,
1293 const CORBA::Double theRadius,
1294 const GEOM::shape_state theState)
1296 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1298 //Set a not done flag
1299 GetOperations()->SetNotDone();
1301 //Get the reference objects
1302 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1303 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1305 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1307 //Get Shapes On Cylinder
1308 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinder
1309 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1310 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1311 return aSeq._retn();
1313 Standard_Integer aLength = aHSeq->Length();
1314 aSeq->length(aLength);
1315 for (Standard_Integer i = 1; i <= aLength; i++)
1316 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1318 return aSeq._retn();
1321 //=============================================================================
1323 * GetShapesOnCylinderWithLocation
1325 //=============================================================================
1326 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocation
1327 (GEOM::GEOM_Object_ptr theShape,
1328 const CORBA::Long theShapeType,
1329 GEOM::GEOM_Object_ptr theAxis,
1330 GEOM::GEOM_Object_ptr thePnt,
1331 const CORBA::Double theRadius,
1332 const GEOM::shape_state theState)
1334 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1336 //Set a not done flag
1337 GetOperations()->SetNotDone();
1339 //Get the reference objects
1340 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1341 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1342 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1344 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1346 //Get Shapes On Cylinder
1347 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnCylinderWithLocation
1348 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1349 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1350 return aSeq._retn();
1352 Standard_Integer aLength = aHSeq->Length();
1353 aSeq->length(aLength);
1354 for (Standard_Integer i = 1; i <= aLength; i++)
1355 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1357 return aSeq._retn();
1360 //=============================================================================
1364 //=============================================================================
1365 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
1366 (GEOM::GEOM_Object_ptr theShape,
1367 const CORBA::Long theShapeType,
1368 GEOM::GEOM_Object_ptr theCenter,
1369 const CORBA::Double theRadius,
1370 const GEOM::shape_state theState)
1372 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1374 //Set a not done flag
1375 GetOperations()->SetNotDone();
1377 //Get the reference objects
1378 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1379 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1381 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1383 //Get Shapes On Sphere
1384 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnSphere
1385 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1386 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1387 return aSeq._retn();
1389 Standard_Integer aLength = aHSeq->Length();
1390 aSeq->length(aLength);
1391 for (Standard_Integer i = 1; i <= aLength; i++)
1392 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1394 return aSeq._retn();
1397 //=============================================================================
1399 * GetShapesOnQuadrangle
1401 //=============================================================================
1402 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
1403 (GEOM::GEOM_Object_ptr theShape,
1404 CORBA::Long theShapeType,
1405 GEOM::GEOM_Object_ptr theTopLeftPoint,
1406 GEOM::GEOM_Object_ptr theTopRigthPoint,
1407 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1408 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1409 GEOM::shape_state theState)
1411 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1413 //Set a not done flag
1414 GetOperations()->SetNotDone();
1416 //Get the reference objects
1417 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1418 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1419 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1420 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1421 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1423 if (aShape.IsNull() ||
1424 aTopLeftPoint.IsNull() ||
1425 aTopRigthPoint.IsNull() ||
1426 aBottomLeftPoint.IsNull() ||
1427 aBottomRigthPoint.IsNull())
1428 return aSeq._retn();
1430 //Get Shapes On Quadrangle
1431 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnQuadrangle
1432 (aShape, theShapeType,
1433 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1434 ShapeState(theState));
1435 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1436 return aSeq._retn();
1438 Standard_Integer aLength = aHSeq->Length();
1439 aSeq->length(aLength);
1440 for (Standard_Integer i = 1; i <= aLength; i++)
1441 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1443 return aSeq._retn();
1446 //=============================================================================
1448 * GetShapesOnPlaneIDs
1450 //=============================================================================
1451 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
1452 (GEOM::GEOM_Object_ptr theShape,
1453 const CORBA::Long theShapeType,
1454 GEOM::GEOM_Object_ptr theAx1,
1455 const GEOM::shape_state theState)
1457 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1459 //Set a not done flag
1460 GetOperations()->SetNotDone();
1462 //Get the reference objects
1463 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1464 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1466 if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
1468 //Get Shapes On Plane
1469 Handle(TColStd_HSequenceOfInteger) aHSeq =
1470 GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
1471 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1472 return aSeq._retn();
1474 Standard_Integer aLength = aHSeq->Length();
1475 aSeq->length(aLength);
1476 for (Standard_Integer i = 1; i <= aLength; i++)
1477 aSeq[i-1] = aHSeq->Value(i);
1479 return aSeq._retn();
1482 //=============================================================================
1484 * GetShapesOnPlaneWithLocationIDs
1486 //=============================================================================
1487 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
1488 (GEOM::GEOM_Object_ptr theShape,
1489 const CORBA::Long theShapeType,
1490 GEOM::GEOM_Object_ptr theAx1,
1491 GEOM::GEOM_Object_ptr thePnt,
1492 const GEOM::shape_state theState)
1494 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1496 //Set a not done flag
1497 GetOperations()->SetNotDone();
1499 //Get the reference objects
1500 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1501 Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
1502 Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
1504 if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
1506 //Get Shapes On Plane
1507 Handle(TColStd_HSequenceOfInteger) aHSeq =
1508 GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
1509 anAx1, anPnt, ShapeState(theState));
1510 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1511 return aSeq._retn();
1513 Standard_Integer aLength = aHSeq->Length();
1514 aSeq->length(aLength);
1515 for (Standard_Integer i = 1; i <= aLength; i++)
1516 aSeq[i-1] = aHSeq->Value(i);
1518 return aSeq._retn();
1521 //=============================================================================
1523 * GetShapesOnCylinderIDs
1525 //=============================================================================
1526 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
1527 (GEOM::GEOM_Object_ptr theShape,
1528 const CORBA::Long theShapeType,
1529 GEOM::GEOM_Object_ptr theAxis,
1530 const CORBA::Double theRadius,
1531 const GEOM::shape_state theState)
1533 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1535 //Set a not done flag
1536 GetOperations()->SetNotDone();
1538 //Get the reference objects
1539 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1540 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1542 if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
1544 //Get Shapes On Cylinder
1545 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
1546 (aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
1547 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1548 return aSeq._retn();
1550 Standard_Integer aLength = aHSeq->Length();
1551 aSeq->length(aLength);
1552 for (Standard_Integer i = 1; i <= aLength; i++)
1553 aSeq[i-1] = aHSeq->Value(i);
1555 return aSeq._retn();
1558 //=============================================================================
1560 * GetShapesOnCylinderWithLocationIDs
1562 //=============================================================================
1563 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderWithLocationIDs
1564 (GEOM::GEOM_Object_ptr theShape,
1565 const CORBA::Long theShapeType,
1566 GEOM::GEOM_Object_ptr theAxis,
1567 GEOM::GEOM_Object_ptr thePnt,
1568 const CORBA::Double theRadius,
1569 const GEOM::shape_state theState)
1571 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1573 //Set a not done flag
1574 GetOperations()->SetNotDone();
1576 //Get the reference objects
1577 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1578 Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
1579 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
1581 if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return aSeq._retn();
1583 //Get Shapes On Cylinder
1584 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderWithLocationIDs
1585 (aShape, theShapeType, anAxis, aPnt, theRadius, ShapeState(theState));
1586 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1587 return aSeq._retn();
1589 Standard_Integer aLength = aHSeq->Length();
1590 aSeq->length(aLength);
1591 for (Standard_Integer i = 1; i <= aLength; i++)
1592 aSeq[i-1] = aHSeq->Value(i);
1594 return aSeq._retn();
1597 //=============================================================================
1599 * GetShapesOnSphereIDs
1601 //=============================================================================
1602 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
1603 (GEOM::GEOM_Object_ptr theShape,
1604 const CORBA::Long theShapeType,
1605 GEOM::GEOM_Object_ptr theCenter,
1606 const CORBA::Double theRadius,
1607 const GEOM::shape_state theState)
1609 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1611 //Set a not done flag
1612 GetOperations()->SetNotDone();
1614 //Get the reference objects
1615 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1616 Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
1618 if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
1620 //Get Shapes On Sphere
1621 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
1622 (aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
1623 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1624 return aSeq._retn();
1626 Standard_Integer aLength = aHSeq->Length();
1627 aSeq->length(aLength);
1628 for (Standard_Integer i = 1; i <= aLength; i++)
1629 aSeq[i-1] = aHSeq->Value(i);
1631 return aSeq._retn();
1634 //=============================================================================
1636 * GetShapesOnQuadrangleIDs
1638 //=============================================================================
1639 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
1640 (GEOM::GEOM_Object_ptr theShape,
1641 CORBA::Long theShapeType,
1642 GEOM::GEOM_Object_ptr theTopLeftPoint,
1643 GEOM::GEOM_Object_ptr theTopRigthPoint,
1644 GEOM::GEOM_Object_ptr theBottomLeftPoint,
1645 GEOM::GEOM_Object_ptr theBottomRigthPoint,
1646 GEOM::shape_state theState)
1648 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1650 //Set a not done flag
1651 GetOperations()->SetNotDone();
1653 //Get the reference objects
1654 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1655 Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
1656 Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
1657 Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
1658 Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
1660 if (aShape.IsNull() ||
1661 aTopLeftPoint.IsNull() ||
1662 aTopRigthPoint.IsNull() ||
1663 aBottomLeftPoint.IsNull() ||
1664 aBottomRigthPoint.IsNull() )
1665 return aSeq._retn();
1667 //Get Shapes On Quadrangle
1668 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnQuadrangleIDs
1669 (aShape, theShapeType,
1670 aTopLeftPoint, aTopRigthPoint, aBottomLeftPoint, aBottomRigthPoint,
1671 ShapeState(theState));
1672 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1673 return aSeq._retn();
1675 Standard_Integer aLength = aHSeq->Length();
1676 aSeq->length(aLength);
1677 for (Standard_Integer i = 1; i <= aLength; i++)
1678 aSeq[i-1] = aHSeq->Value(i);
1680 return aSeq._retn();
1683 //=============================================================================
1687 //=============================================================================
1688 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
1689 (GEOM::GEOM_Object_ptr theBox,
1690 GEOM::GEOM_Object_ptr theShape,
1691 CORBA::Long theShapeType,
1692 GEOM::shape_state theState)
1694 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1696 //Set a not done flag
1697 GetOperations()->SetNotDone();
1699 //Get the reference objects
1700 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1701 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1703 if (aShape.IsNull() || aBox.IsNull() )
1704 return aSeq._retn();
1707 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnBox
1708 (aBox,aShape, theShapeType,ShapeState(theState));
1709 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1710 return aSeq._retn();
1712 Standard_Integer aLength = aHSeq->Length();
1713 aSeq->length(aLength);
1714 for (Standard_Integer i = 1; i <= aLength; i++)
1715 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1717 return aSeq._retn();
1720 //=============================================================================
1722 * GetShapesOnQuadrangleIDs
1724 //=============================================================================
1725 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
1726 (GEOM::GEOM_Object_ptr theBox,
1727 GEOM::GEOM_Object_ptr theShape,
1728 CORBA::Long theShapeType,
1729 GEOM::shape_state theState)
1731 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1733 //Set a not done flag
1734 GetOperations()->SetNotDone();
1736 //Get the reference objects
1737 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1738 Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
1740 if (aShape.IsNull() || aBox.IsNull() )
1741 return aSeq._retn();
1744 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnBoxIDs
1745 (aBox,aShape, theShapeType,ShapeState(theState));
1746 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1747 return aSeq._retn();
1749 Standard_Integer aLength = aHSeq->Length();
1750 aSeq->length(aLength);
1751 for (Standard_Integer i = 1; i <= aLength; i++)
1752 aSeq[i-1] = aHSeq->Value(i);
1754 return aSeq._retn();
1758 //=============================================================================
1762 //=============================================================================
1763 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
1764 (GEOM::GEOM_Object_ptr theCheckShape,
1765 GEOM::GEOM_Object_ptr theShape,
1766 CORBA::Short theShapeType,
1767 GEOM::shape_state theState)
1769 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
1771 //Set a not done flag
1772 GetOperations()->SetNotDone();
1774 //Get the reference objects
1775 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1776 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1778 if (aShape.IsNull() || aCheckShape.IsNull() )
1779 return aSeq._retn();
1781 //Get Shapes On Shape
1782 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape
1783 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1785 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1786 return aSeq._retn();
1788 Standard_Integer aLength = aHSeq->Length();
1789 aSeq->length(aLength);
1790 for (Standard_Integer i = 1; i <= aLength; i++)
1791 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
1793 return aSeq._retn();
1797 //=============================================================================
1799 * GetShapesOnShapeAsCompound
1801 //=============================================================================
1802 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
1803 (GEOM::GEOM_Object_ptr theCheckShape,
1804 GEOM::GEOM_Object_ptr theShape,
1805 CORBA::Short theShapeType,
1806 GEOM::shape_state theState)
1808 GEOM::GEOM_Object_var aGEOMObject;
1810 //Set a not done flag
1811 GetOperations()->SetNotDone();
1813 //Get the reference objects
1814 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1815 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1817 if (aShape.IsNull() || aCheckShape.IsNull() )
1818 return aGEOMObject._retn();
1820 //Get Shapes On Shape
1821 Handle(GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound
1822 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1824 if (anObject.IsNull())
1825 return aGEOMObject._retn();
1827 return GetObject(anObject);
1831 //=============================================================================
1833 * GetShapesOnShapeIDs
1835 //=============================================================================
1836 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
1837 (GEOM::GEOM_Object_ptr theCheckShape,
1838 GEOM::GEOM_Object_ptr theShape,
1839 CORBA::Short theShapeType,
1840 GEOM::shape_state theState)
1842 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1844 //Set a not done flag
1845 GetOperations()->SetNotDone();
1847 //Get the reference objects
1848 Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
1849 Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
1851 if (aShape.IsNull() || aCheckShape.IsNull() )
1852 return aSeq._retn();
1854 //Get Shapes On Shape
1855 Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs
1856 (aCheckShape,aShape, theShapeType,ShapeState(theState));
1857 if (!GetOperations()->IsDone() || aHSeq.IsNull())
1858 return aSeq._retn();
1860 Standard_Integer aLength = aHSeq->Length();
1861 aSeq->length(aLength);
1862 for (Standard_Integer i = 1; i <= aLength; i++)
1863 aSeq[i-1] = aHSeq->Value(i);
1865 return aSeq._retn();
1869 //=============================================================================
1873 //=============================================================================
1874 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
1875 (GEOM::GEOM_Object_ptr theShapeWhere,
1876 GEOM::GEOM_Object_ptr theShapeWhat)
1878 GEOM::GEOM_Object_var aGEOMObject;
1880 //Set a not done flag
1881 GetOperations()->SetNotDone();
1883 //Get the reference objects
1884 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1885 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1887 if (aShapeWhere.IsNull() ||
1888 aShapeWhat.IsNull()) return aGEOMObject._retn();
1890 //Get Shapes in place of aShapeWhat
1891 Handle(GEOM_Object) anObject =
1892 GetOperations()->GetInPlace(aShapeWhere, aShapeWhat);
1893 if (!GetOperations()->IsDone() || anObject.IsNull())
1894 return aGEOMObject._retn();
1896 return GetObject(anObject);
1899 //=============================================================================
1903 //=============================================================================
1904 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceOld
1905 (GEOM::GEOM_Object_ptr theShapeWhere,
1906 GEOM::GEOM_Object_ptr theShapeWhat)
1908 GEOM::GEOM_Object_var aGEOMObject;
1910 //Set a not done flag
1911 GetOperations()->SetNotDone();
1913 //Get the reference objects
1914 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1915 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1917 if (aShapeWhere.IsNull() ||
1918 aShapeWhat.IsNull()) return aGEOMObject._retn();
1920 //Get Shapes in place of aShapeWhat
1921 Handle(GEOM_Object) anObject =
1922 GetOperations()->GetInPlaceOld(aShapeWhere, aShapeWhat);
1923 if (!GetOperations()->IsDone() || anObject.IsNull())
1924 return aGEOMObject._retn();
1926 return GetObject(anObject);
1929 //=============================================================================
1931 * GetInPlaceByHistory
1933 //=============================================================================
1934 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
1935 (GEOM::GEOM_Object_ptr theShapeWhere,
1936 GEOM::GEOM_Object_ptr theShapeWhat)
1938 GEOM::GEOM_Object_var aGEOMObject;
1940 //Set a not done flag
1941 GetOperations()->SetNotDone();
1943 //Get the reference objects
1944 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1945 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1947 if (aShapeWhere.IsNull() ||
1948 aShapeWhat.IsNull()) return aGEOMObject._retn();
1950 //Get Shapes in place of aShapeWhat
1951 Handle(GEOM_Object) anObject =
1952 GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
1953 if (!GetOperations()->IsDone() || anObject.IsNull())
1954 return aGEOMObject._retn();
1956 return GetObject(anObject);
1959 //=============================================================================
1963 //=============================================================================
1964 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
1965 (GEOM::GEOM_Object_ptr theShapeWhere,
1966 GEOM::GEOM_Object_ptr theShapeWhat)
1968 GEOM::GEOM_Object_var aGEOMObject;
1970 //Set a not done flag
1971 GetOperations()->SetNotDone();
1973 //Get the reference objects
1974 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
1975 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
1977 if (aShapeWhere.IsNull() ||
1978 aShapeWhat.IsNull()) return aGEOMObject._retn();
1980 //Get Shapes in place of aShapeWhat
1981 Handle(GEOM_Object) anObject =
1982 GetOperations()->GetSame(aShapeWhere, aShapeWhat);
1983 if (!GetOperations()->IsDone() || anObject.IsNull())
1984 return aGEOMObject._retn();
1986 return GetObject(anObject);
1989 //=============================================================================
1993 //=============================================================================
1994 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetSameIDs
1995 (GEOM::GEOM_Object_ptr theShapeWhere,
1996 GEOM::GEOM_Object_ptr theShapeWhat) {
1997 GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
1999 //Get the reference objects
2000 Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
2001 Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
2003 if (aShapeWhere.IsNull() ||
2004 aShapeWhat.IsNull()) return aSeq._retn();
2007 Handle(TColStd_HSequenceOfInteger) aHSeq =
2008 GetOperations()->GetSameIDs(aShapeWhere, aShapeWhat);
2010 if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
2012 Standard_Integer aLength = aHSeq->Length();
2013 aSeq->length(aLength);
2014 for (Standard_Integer i = 1; i <= aLength; i++)
2015 aSeq[i-1] = aHSeq->Value(i);
2017 return aSeq._retn();
2020 //=============================================================================
2024 //=============================================================================
2025 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ExtendEdge
2026 (GEOM::GEOM_Object_ptr theEdge,
2027 CORBA::Double theMin,
2028 CORBA::Double theMax)
2030 GEOM::GEOM_Object_var aGEOMObject;
2032 //Set a not done flag
2033 GetOperations()->SetNotDone();
2035 //Get the reference objects
2036 Handle(GEOM_Object) anEdge = GetObjectImpl(theEdge);
2038 if (anEdge.IsNull()) {
2039 return aGEOMObject._retn();
2042 //Get Shapes in place of aShapeWhat
2043 Handle(GEOM_Object) aNewEdge =
2044 GetOperations()->ExtendEdge(anEdge, theMin, theMax);
2046 if (!GetOperations()->IsDone() || aNewEdge.IsNull()) {
2047 return aGEOMObject._retn();
2050 return GetObject(aNewEdge);
2053 //=============================================================================
2057 //=============================================================================
2058 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ExtendFace
2059 (GEOM::GEOM_Object_ptr theFace,
2060 CORBA::Double theUMin,
2061 CORBA::Double theUMax,
2062 CORBA::Double theVMin,
2063 CORBA::Double theVMax)
2065 GEOM::GEOM_Object_var aGEOMObject;
2067 //Set a not done flag
2068 GetOperations()->SetNotDone();
2070 //Get the reference objects
2071 Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
2073 if (aFace.IsNull()) {
2074 return aGEOMObject._retn();
2077 //Get Shapes in place of aShapeWhat
2078 Handle(GEOM_Object) aNewFace =
2079 GetOperations()->ExtendFace(aFace, theUMin, theUMax, theVMin, theVMax);
2081 if (!GetOperations()->IsDone() || aNewFace.IsNull()) {
2082 return aGEOMObject._retn();
2085 return GetObject(aNewFace);
2088 //=============================================================================
2090 * MakeSurfaceFromFace
2092 //=============================================================================
2093 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSurfaceFromFace
2094 (GEOM::GEOM_Object_ptr theFace)
2096 GEOM::GEOM_Object_var aGEOMObject;
2098 //Set a not done flag
2099 GetOperations()->SetNotDone();
2101 //Get the reference object
2102 Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
2104 if (aFace.IsNull()) {
2105 return aGEOMObject._retn();
2108 //Get Shapes in place of aShapeWhat
2109 Handle(GEOM_Object) aNewFace = GetOperations()->MakeSurfaceFromFace(aFace);
2111 if (!GetOperations()->IsDone() || aNewFace.IsNull()) {
2112 return aGEOMObject._retn();
2115 return GetObject(aNewFace);