3 #include "GEOMImpl_IShapesOperations.hxx"
5 #include "GEOMImpl_Types.hxx"
7 #include "GEOMImpl_VectorDriver.hxx"
8 #include "GEOMImpl_ShapeDriver.hxx"
9 #include "GEOMImpl_CopyDriver.hxx"
10 #include "GEOMImpl_GlueDriver.hxx"
12 #include "GEOMImpl_IVector.hxx"
13 #include "GEOMImpl_IShapes.hxx"
14 #include "GEOMImpl_IGlue.hxx"
16 #include "GEOM_Function.hxx"
18 #include "utilities.h"
20 #include "Utils_ExceptHandlers.hxx"
22 #include <TFunction_DriverTable.hxx>
23 #include <TFunction_Driver.hxx>
24 #include <TFunction_Logbook.hxx>
25 #include <TDF_Tool.hxx>
27 #include <BRep_Tool.hxx>
28 #include <BRepGProp.hxx>
33 #include <TopoDS_Shape.hxx>
34 #include <TopoDS_Iterator.hxx>
35 #include <TopExp_Explorer.hxx>
36 #include <TopTools_MapOfShape.hxx>
37 #include <TopTools_Array1OfShape.hxx>
38 #include <TopTools_ListIteratorOfListOfShape.hxx>
39 #include <TopTools_IndexedMapOfShape.hxx>
41 #include <GProp_GProps.hxx>
43 #include <TColStd_Array1OfReal.hxx>
44 #include <TColStd_HArray1OfInteger.hxx>
46 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
48 //=============================================================================
52 //=============================================================================
53 GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine, int theDocID)
54 : GEOM_IOperations(theEngine, theDocID)
56 MESSAGE("GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations");
59 //=============================================================================
63 //=============================================================================
64 GEOMImpl_IShapesOperations::~GEOMImpl_IShapesOperations()
66 MESSAGE("GEOMImpl_IShapesOperations::~GEOMImpl_IShapesOperations");
70 //=============================================================================
74 //=============================================================================
75 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdge
76 (Handle(GEOM_Object) thePnt1, Handle(GEOM_Object) thePnt2)
80 if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
82 //Add a new Edge object
83 Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
85 //Add a new Vector function
86 Handle(GEOM_Function) aFunction =
87 anEdge->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TWO_PNT);
89 //Check if the function is set correctly
90 if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL;
92 GEOMImpl_IVector aPI (aFunction);
94 Handle(GEOM_Function) aRef1 = thePnt1->GetLastFunction();
95 Handle(GEOM_Function) aRef2 = thePnt2->GetLastFunction();
96 if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
101 //Compute the Edge value
103 if (!GetSolver()->ComputeFunction(aFunction)) {
104 SetErrorCode("Vector driver failed");
108 catch (Standard_Failure) {
109 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
110 SetErrorCode(aFail->GetMessageString());
114 //Make a Python command
115 TCollection_AsciiString anEntry, aDescr;
116 TDF_Tool::Entry(anEdge->GetEntry(), anEntry);
117 aDescr += (anEntry+" = IShapesOperations.MakeEdge(");
118 TDF_Tool::Entry(thePnt1->GetEntry(), anEntry);
119 aDescr += (anEntry+", ");
120 TDF_Tool::Entry(thePnt2->GetEntry(), anEntry);
121 aDescr += (anEntry+")");
123 aFunction->SetDescription(aDescr);
129 //=============================================================================
133 //=============================================================================
134 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeWire
135 (list<Handle(GEOM_Object)> theShapes)
137 return MakeShape(theShapes, GEOM_WIRE, WIRE_EDGES, "MakeWire");
140 //=============================================================================
144 //=============================================================================
145 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFace (Handle(GEOM_Object) theWire,
146 const bool isPlanarWanted)
150 if (theWire.IsNull()) return NULL;
152 //Add a new Face object
153 Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
155 //Add a new Shape function for creation of a face from a wire
156 Handle(GEOM_Function) aFunction =
157 aFace->AddFunction(GEOMImpl_ShapeDriver::GetID(), FACE_WIRE);
158 if (aFunction.IsNull()) return NULL;
160 //Check if the function is set correctly
161 if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
163 GEOMImpl_IShapes aCI (aFunction);
165 Handle(GEOM_Function) aRefWire = theWire->GetLastFunction();
167 if (aRefWire.IsNull()) return NULL;
169 aCI.SetBase(aRefWire);
170 aCI.SetIsPlanar(isPlanarWanted);
172 //Compute the Face value
174 if (!GetSolver()->ComputeFunction(aFunction)) {
175 SetErrorCode("Shape driver failed to compute a face");
179 catch (Standard_Failure) {
180 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
181 SetErrorCode(aFail->GetMessageString());
185 //Make a Python command
186 TCollection_AsciiString anEntry, aDescr;
187 TDF_Tool::Entry(aFace->GetEntry(), anEntry);
189 aDescr += " = IShapesOperations.MakeFace(";
190 TDF_Tool::Entry(theWire->GetEntry(), anEntry);
198 aFunction->SetDescription(aDescr);
204 //=============================================================================
208 //=============================================================================
209 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWires
210 (list<Handle(GEOM_Object)> theShapes, bool isPlanarWanted)
215 Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
218 Handle(GEOM_Function) aFunction =
219 aShape->AddFunction(GEOMImpl_ShapeDriver::GetID(), FACE_WIRES);
220 if (aFunction.IsNull()) return NULL;
222 //Check if the function is set correctly
223 if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
225 GEOMImpl_IShapes aCI (aFunction);
227 Handle(TColStd_HSequenceOfTransient) aShapesSeq = new TColStd_HSequenceOfTransient;
230 list<Handle(GEOM_Object)>::iterator it = theShapes.begin();
231 for (; it != theShapes.end(); it++) {
232 Handle(GEOM_Function) aRefSh = (*it)->GetLastFunction();
233 if (aRefSh.IsNull()) {
234 SetErrorCode("NULL argument shape for the face construction");
237 aShapesSeq->Append(aRefSh);
239 aCI.SetShapes(aShapesSeq);
241 aCI.SetIsPlanar(isPlanarWanted);
245 if (!GetSolver()->ComputeFunction(aFunction)) {
246 SetErrorCode("Shape driver failed");
250 catch (Standard_Failure) {
251 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
252 SetErrorCode(aFail->GetMessageString());
256 //Make a Python command
257 TCollection_AsciiString anEntry, aDescr;
258 TDF_Tool::Entry(aShape->GetEntry(), anEntry);
259 aDescr += (anEntry + " = IShapesOperations.MakeFaceWires([");
261 it = theShapes.begin();
262 if (it != theShapes.end()) {
263 TDF_Tool::Entry((*it)->GetEntry(), anEntry);
265 aDescr += (anEntry+", ");
266 for (; it != theShapes.end(); it++) {
268 TDF_Tool::Entry((*it)->GetEntry(), anEntry);
278 aFunction->SetDescription(aDescr);
284 //=============================================================================
288 //=============================================================================
289 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShell
290 (list<Handle(GEOM_Object)> theShapes)
292 return MakeShape(theShapes, GEOM_SHELL, SHELL_FACES, "MakeShell");
295 //=============================================================================
299 //=============================================================================
300 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShells
301 (list<Handle(GEOM_Object)> theShapes)
303 return MakeShape(theShapes, GEOM_SOLID, SOLID_SHELLS, "MakeSolidShells");
306 //=============================================================================
310 //=============================================================================
311 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShell (Handle(GEOM_Object) theShell)
315 if (theShell.IsNull()) return NULL;
317 //Add a new Solid object
318 Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID);
320 //Add a new Solid function for creation of a solid from a shell
321 Handle(GEOM_Function) aFunction =
322 aSolid->AddFunction(GEOMImpl_ShapeDriver::GetID(), SOLID_SHELL);
323 if (aFunction.IsNull()) return NULL;
325 //Check if the function is set correctly
326 if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
328 GEOMImpl_IShapes aCI (aFunction);
330 Handle(GEOM_Function) aRefShell = theShell->GetLastFunction();
332 if (aRefShell.IsNull()) return NULL;
334 aCI.SetBase(aRefShell);
336 //Compute the Solid value
338 if (!GetSolver()->ComputeFunction(aFunction)) {
339 SetErrorCode("Solid driver failed");
343 catch (Standard_Failure) {
344 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
345 SetErrorCode(aFail->GetMessageString());
349 //Make a Python command
350 TCollection_AsciiString anEntry, aDescr("");
351 TDF_Tool::Entry(aSolid->GetEntry(), anEntry);
353 aDescr += " = IShapesOperations.MakeSolidShell(";
354 TDF_Tool::Entry(theShell->GetEntry(), anEntry);
355 aDescr += (anEntry+")");
357 aFunction->SetDescription(aDescr);
363 //=============================================================================
367 //=============================================================================
368 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeCompound
369 (list<Handle(GEOM_Object)> theShapes)
371 return MakeShape(theShapes, GEOM_COMPOUND, COMPOUND_SHAPES, "MakeCompound");
374 //=============================================================================
378 //=============================================================================
379 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShape
380 (list<Handle(GEOM_Object)> theShapes,
381 const Standard_Integer theObjectType,
382 const Standard_Integer theFunctionType,
383 const TCollection_AsciiString theMethodName)
388 Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), theObjectType);
391 Handle(GEOM_Function) aFunction =
392 aShape->AddFunction(GEOMImpl_ShapeDriver::GetID(), theFunctionType);
393 if (aFunction.IsNull()) return NULL;
395 //Check if the function is set correctly
396 if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
398 GEOMImpl_IShapes aCI (aFunction);
400 Handle(TColStd_HSequenceOfTransient) aShapesSeq = new TColStd_HSequenceOfTransient;
403 list<Handle(GEOM_Object)>::iterator it = theShapes.begin();
404 for (; it != theShapes.end(); it++) {
405 Handle(GEOM_Function) aRefSh = (*it)->GetLastFunction();
406 if (aRefSh.IsNull()) {
407 SetErrorCode("NULL argument shape for the shape construction");
410 aShapesSeq->Append(aRefSh);
412 aCI.SetShapes(aShapesSeq);
416 if (!GetSolver()->ComputeFunction(aFunction)) {
417 SetErrorCode("Shape driver failed");
421 catch (Standard_Failure) {
422 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
423 SetErrorCode(aFail->GetMessageString());
427 //Make a Python command
428 TCollection_AsciiString anEntry, aDescr("");
429 TDF_Tool::Entry(aShape->GetEntry(), anEntry);
430 aDescr += (anEntry + " = IShapesOperations.");
431 aDescr += (theMethodName + "([");
433 it = theShapes.begin();
434 if (it != theShapes.end()) {
435 TDF_Tool::Entry((*it)->GetEntry(), anEntry);
437 aDescr += (anEntry+", ");
438 for (; it != theShapes.end(); it++) {
440 TDF_Tool::Entry((*it)->GetEntry(), anEntry);
446 aFunction->SetDescription(aDescr);
452 //=============================================================================
456 //=============================================================================
457 Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
458 (Handle(GEOM_Object) theShape,
459 const Standard_Real theTolerance)
463 if (theShape.IsNull()) return NULL;
465 //Add a new Glued object
466 Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
468 //Add a new Glue function
469 Handle(GEOM_Function) aFunction;
470 aFunction = aGlued->AddFunction(GEOMImpl_GlueDriver::GetID(), GLUE_FACES);
471 if (aFunction.IsNull()) return NULL;
473 //Check if the function is set correctly
474 if (aFunction->GetDriverGUID() != GEOMImpl_GlueDriver::GetID()) return NULL;
476 GEOMImpl_IGlue aCI (aFunction);
478 Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
479 if (aRefShape.IsNull()) return NULL;
481 aCI.SetBase(aRefShape);
482 aCI.SetTolerance(theTolerance);
484 //Compute the sub-shape value
486 if (!GetSolver()->ComputeFunction(aFunction)) {
487 SetErrorCode("Shape driver failed to glue faces");
491 catch (Standard_Failure) {
492 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
493 SetErrorCode(aFail->GetMessageString());
497 //Make a Python command
498 TCollection_AsciiString anEntry, aDescr;
499 TDF_Tool::Entry(aGlued->GetEntry(), anEntry);
501 aDescr += " = IShapesOperations.MakeGlueFaces(";
502 TDF_Tool::Entry(theShape->GetEntry(), anEntry);
503 aDescr += anEntry + ", ";
504 aDescr += TCollection_AsciiString(theTolerance) + ")";
506 aFunction->SetDescription(aDescr);
512 //=============================================================================
516 //=============================================================================
517 Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode
518 (Handle(GEOM_Object) theShape,
519 const Standard_Integer theShapeType,
520 const Standard_Boolean isSorted)
524 if (theShape.IsNull()) return NULL;
525 TopoDS_Shape aShape = theShape->GetValue();
526 if (aShape.IsNull()) return NULL;
528 Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
529 Handle(GEOM_Object) anObj;
530 Handle(GEOM_Function) aFunction;
531 TopTools_MapOfShape mapShape;
532 TopTools_ListOfShape listShape;
534 if (aShape.ShapeType() == TopAbs_COMPOUND &&
535 (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE ||
536 TopAbs_ShapeEnum(theShapeType) == TopAbs_COMPSOLID ||
537 TopAbs_ShapeEnum(theShapeType) == TopAbs_COMPOUND)) {
538 TopoDS_Iterator It (aShape, Standard_True, Standard_True);
539 for (; It.More(); It.Next()) {
540 if (mapShape.Add(It.Value())) {
541 if (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE ||
542 TopAbs_ShapeEnum(theShapeType) == It.Value().ShapeType()) {
543 listShape.Append(It.Value());
548 TopExp_Explorer exp (aShape, TopAbs_ShapeEnum(theShapeType));
549 for (; exp.More(); exp.Next())
550 if (mapShape.Add(exp.Current()))
551 listShape.Append(exp.Current());
554 if (listShape.IsEmpty()) {
555 SetErrorCode("The given shape has no sub-shapes of the requested type");
560 SortShapes(listShape);
562 TopTools_IndexedMapOfShape anIndices;
563 TopExp::MapShapes(aShape, anIndices);
564 Handle(TColStd_HArray1OfInteger) anArray;
566 TopTools_ListIteratorOfListOfShape itSub (listShape);
567 TCollection_AsciiString anAsciiList = "[", anEntry;
568 for (int index = 1; itSub.More(); itSub.Next(), ++index) {
569 TopoDS_Shape aValue = itSub.Value();
570 anArray = new TColStd_HArray1OfInteger(1,1);
571 anArray->SetValue(1, anIndices.FindIndex(aValue));
572 anObj = GetEngine()->AddSubShape(theShape, anArray);
575 TDF_Tool::Entry(anObj->GetEntry(), anEntry);
576 anAsciiList += anEntry;
580 anAsciiList.Trunc(anAsciiList.Length() - 1);
583 anAsciiList = TCollection_AsciiString("\n") + anAsciiList;
585 //The explode doesn't change object so no new function is requiered.
586 aFunction = theShape->GetLastFunction();
588 //Make a Python command
589 TCollection_AsciiString aDescr(anAsciiList);
590 TDF_Tool::Entry(theShape->GetEntry(), anEntry);
591 aDescr += " = IShapesOperations.MakeExplode(";
592 aDescr += (anEntry + ",");
594 aDescr += (TCollection_AsciiString(theShapeType) + ", 1)");
596 aDescr += (TCollection_AsciiString(theShapeType) + ", 0)");
598 TCollection_AsciiString anOldDescr = aFunction->GetDescription();
599 anOldDescr = anOldDescr + aDescr;
600 aFunction->SetDescription(anOldDescr);
607 //=============================================================================
611 //=============================================================================
612 Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSubShape
613 (Handle(GEOM_Object) theMainShape,
614 const Standard_Integer theID)
618 if (theMainShape.IsNull()) return NULL;
620 Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1,1);
621 anArray->SetValue(1, theID);
622 Handle(GEOM_Object) anObj = GetEngine()->AddSubShape(theMainShape, anArray);
623 if (anObj.IsNull()) {
624 SetErrorCode("Can not get a sub-shape with the given ID");
628 //The GetSubShape() doesn't change object so no new function is requiered.
629 Handle(GEOM_Function) aFunction = theMainShape->GetLastFunction();
631 //Make a Python command
632 TCollection_AsciiString aDescr ("\n");
633 TCollection_AsciiString anEntry;
634 TDF_Tool::Entry(anObj->GetEntry(), anEntry);
635 aDescr += anEntry + " = IShapesOperations.GetSubShape(";
636 TDF_Tool::Entry(theMainShape->GetEntry(), anEntry);
637 aDescr += anEntry + ", ";
638 aDescr += TCollection_AsciiString(theID) + ")";
640 TCollection_AsciiString anOldDescr = aFunction->GetDescription();
641 anOldDescr = anOldDescr + aDescr;
642 aFunction->SetDescription(anOldDescr);
649 //=============================================================================
653 //=============================================================================
654 Standard_Integer GEOMImpl_IShapesOperations::NumberOfFaces (Handle(GEOM_Object) theShape)
658 Standard_Integer nb = 0;
660 if (theShape.IsNull()) return -1;
661 TopoDS_Shape aShape = theShape->GetValue();
662 if (aShape.IsNull()) return -1;
664 TopTools_MapOfShape mapShape;
666 TopExp_Explorer exp (aShape, TopAbs_FACE);
667 for (; exp.More(); exp.Next())
668 if (mapShape.Add(exp.Current()))
675 //=============================================================================
679 //=============================================================================
680 Standard_Integer GEOMImpl_IShapesOperations::NumberOfEdges (Handle(GEOM_Object) theShape)
684 Standard_Integer nb = 0;
686 if (theShape.IsNull()) return -1;
687 TopoDS_Shape aShape = theShape->GetValue();
688 if (aShape.IsNull()) return -1;
690 TopTools_MapOfShape mapShape;
692 TopExp_Explorer exp (aShape, TopAbs_EDGE);
693 for (; exp.More(); exp.Next())
694 if (mapShape.Add(exp.Current()))
701 //=============================================================================
705 //=============================================================================
706 Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object) theShape)
710 if (theShape.IsNull()) return NULL;
712 //Add a new reversed object
713 Handle(GEOM_Object) aReversed = GetEngine()->AddObject(GetDocID(), theShape->GetType());
715 //Add a new Revese function
716 Handle(GEOM_Function) aFunction;
717 aFunction = aReversed->AddFunction(GEOMImpl_ShapeDriver::GetID(), REVERSE_ORIENTATION);
718 if (aFunction.IsNull()) return NULL;
720 //Check if the function is set correctly
721 if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
723 GEOMImpl_IShapes aSI (aFunction);
725 Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
726 if (aRefShape.IsNull()) return NULL;
728 aSI.SetBase(aRefShape);
730 //Compute the sub-shape value
732 if (!GetSolver()->ComputeFunction(aFunction)) {
733 SetErrorCode("Shape driver failed to reverse shape");
737 catch (Standard_Failure) {
738 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
739 SetErrorCode(aFail->GetMessageString());
743 //Make a Python command
744 TCollection_AsciiString anEntry, aDescr;
745 TDF_Tool::Entry(aReversed->GetEntry(), anEntry);
747 aDescr += " = IShapesOperations.ReverseShape(";
748 TDF_Tool::Entry(theShape->GetEntry(), anEntry);
749 aDescr += anEntry + ")";
751 aFunction->SetDescription(aDescr);
758 //=======================================================================
759 //function : SortShapes
761 //=======================================================================
762 void GEOMImpl_IShapesOperations::SortShapes(TopTools_ListOfShape& SL)
764 Standard_Integer MaxShapes = SL.Extent();
765 TopTools_Array1OfShape aShapes (1,MaxShapes);
766 TColStd_Array1OfInteger OrderInd(1,MaxShapes);
767 TColStd_Array1OfReal MidXYZ (1,MaxShapes); //X,Y,Z;
768 TColStd_Array1OfReal Length (1,MaxShapes); //X,Y,Z;
770 // Computing of CentreOfMass
771 Standard_Integer Index;
774 TopTools_ListIteratorOfListOfShape it(SL);
775 for (Index=1; it.More(); Index++)
777 TopoDS_Shape S = it.Value();
778 SL.Remove( it ); // == it.Next()
780 OrderInd.SetValue (Index, Index);
781 if (S.ShapeType() == TopAbs_VERTEX)
783 GPoint = BRep_Tool::Pnt( TopoDS::Vertex( S ));
784 Length.SetValue( Index, (Standard_Real) S.Orientation());
788 BRepGProp::LinearProperties (S, GPr);
789 GPoint = GPr.CentreOfMass();
790 Length.SetValue( Index, GPr.Mass() );
792 MidXYZ.SetValue(Index,
793 GPoint.X()*999 + GPoint.Y()*99 + GPoint.Z()*0.9);
796 Standard_Integer aTemp;
797 Standard_Boolean exchange, Sort = Standard_True;
800 Sort = Standard_False;
801 for (Index=1; Index < MaxShapes; Index++)
803 if (MidXYZ(OrderInd(Index)) > MidXYZ(OrderInd(Index+1)))
804 exchange = Standard_True;
805 else if (MidXYZ(OrderInd(Index)) == MidXYZ(OrderInd(Index+1)) &&
806 Length(OrderInd(Index)) > Length(OrderInd(Index+1)) )
807 exchange = Standard_True;
809 exchange = Standard_False;
812 aTemp = OrderInd(Index);
813 OrderInd(Index) = OrderInd(Index+1);
814 OrderInd(Index+1) = aTemp;
815 Sort = Standard_True;
819 for (Index=1; Index <= MaxShapes; Index++)
820 SL.Append( aShapes( OrderInd(Index) ));