1 // File: GEOMAlgo_Gluer.cxx
2 // Created: Sat Dec 04 12:45:53 2004
3 // Author: Peter KURNEV
7 #include <GEOMAlgo_Gluer.ixx>
9 #include <TColStd_ListOfInteger.hxx>
10 #include <TColStd_ListIteratorOfListOfInteger.hxx>
16 #include <Geom_Curve.hxx>
17 #include <Geom_Surface.hxx>
19 #include <Bnd_Box.hxx>
20 #include <Bnd_HArray1OfBox.hxx>
21 #include <Bnd_BoundSortBox.hxx>
23 #include <TopLoc_Location.hxx>
24 #include <TopAbs_ShapeEnum.hxx>
25 #include <TopAbs_Orientation.hxx>
28 #include <TopoDS_Edge.hxx>
29 #include <TopoDS_Vertex.hxx>
30 #include <TopoDS_Shape.hxx>
31 #include <TopoDS_Compound.hxx>
32 #include <TopoDS_Wire.hxx>
33 #include <TopoDS_Shell.hxx>
34 #include <TopoDS_Solid.hxx>
35 #include <TopoDS_Iterator.hxx>
37 #include <TopTools_IndexedMapOfShape.hxx>
38 #include <TopTools_ListOfShape.hxx>
39 #include <TopTools_ListIteratorOfListOfShape.hxx>
40 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
41 #include <TopTools_MapOfShape.hxx>
42 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
45 #include <TopExp_Explorer.hxx>
47 #include <BRep_Tool.hxx>
48 #include <BRep_Builder.hxx>
49 #include <BRepLib.hxx>
50 #include <BRepTools.hxx>
51 #include <BRepBndLib.hxx>
53 #include <IntTools_Context.hxx>
54 #include <BOPTools_Tools.hxx>
55 #include <BOPTools_Tools3D.hxx>
56 #include <BOPTools_Tools2D.hxx>
57 #include <BOP_CorrectTolerances.hxx>
59 #include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
60 #include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
61 #include <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx>
62 #include <GEOMAlgo_PassKey.hxx>
63 #include <GEOMAlgo_Tools.hxx>
67 void GetSubShapes(const TopoDS_Shape& aS,
68 TopTools_IndexedMapOfShape& aMSS);
70 //=======================================================================
71 //function : GEOMAlgo_Gluer
73 //=======================================================================
74 GEOMAlgo_Gluer::GEOMAlgo_Gluer()
80 myCheckGeometry=Standard_True;
83 //=======================================================================
84 //function : ~GEOMAlgo_Gluer
86 //=======================================================================
87 GEOMAlgo_Gluer::~GEOMAlgo_Gluer()
90 //=======================================================================
91 //function : SetCheckGeometry
93 //=======================================================================
94 void GEOMAlgo_Gluer::SetCheckGeometry(const Standard_Boolean aFlag)
96 myCheckGeometry=aFlag;
98 //=======================================================================
99 //function : CheckGeometry
101 //=======================================================================
102 Standard_Boolean GEOMAlgo_Gluer::CheckGeometry() const
104 return myCheckGeometry;
106 //=======================================================================
107 //function : AloneShapes
109 //=======================================================================
110 Standard_Integer GEOMAlgo_Gluer::AloneShapes()const
114 //=======================================================================
117 //=======================================================================
118 const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_Gluer::Images()const
122 //=======================================================================
125 //=======================================================================
126 const TopTools_DataMapOfShapeShape& GEOMAlgo_Gluer::Origins()const
130 //=======================================================================
133 //=======================================================================
134 void GEOMAlgo_Gluer::Perform()
140 const Standard_Integer aNb=8;
141 void (GEOMAlgo_Gluer::* pF[aNb])()={
142 &GEOMAlgo_Gluer::CheckData, &GEOMAlgo_Gluer::InnerTolerance,
143 &GEOMAlgo_Gluer::MakeVertices, &GEOMAlgo_Gluer::MakeEdges,
144 &GEOMAlgo_Gluer::MakeFaces, &GEOMAlgo_Gluer::MakeShells,
145 &GEOMAlgo_Gluer::MakeSolids, &GEOMAlgo_Gluer::CheckResult
148 for (i=0; i<aNb; ++i) {
155 //=======================================================================
156 //function : MakeVertices
158 //=======================================================================
159 void GEOMAlgo_Gluer::MakeVertices()
163 Standard_Integer j, i, aNbV, aIndex, aNbVSD;
164 TColStd_ListIteratorOfListOfInteger aIt;
165 Handle(Bnd_HArray1OfBox) aHAB;
166 Bnd_BoundSortBox aBSB;
167 TopoDS_Shape aSTmp, aVF;
169 TopTools_IndexedMapOfShape aMV, aMVProcessed;
170 TopTools_ListIteratorOfListOfShape aItS;
171 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
172 TopTools_DataMapOfShapeListOfShape aMVV;
173 GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
174 GEOMAlgo_IndexedDataMapOfShapeBox aMSB;
176 TopExp::MapShapes(myShape, TopAbs_VERTEX, aMV);
179 myErrorStatus=2; // no vertices in source shape
183 aHAB=new Bnd_HArray1OfBox(1, aNbV);
185 for (i=1; i<=aNbV; ++i) {
186 const TopoDS_Shape& aV=aMV(i);
190 BRepBndLib::Add(aV, aBox);
191 aHAB->SetValue(i, aBox);
196 aBSB.Initialize(aHAB);
198 for (i=1; i<=aNbV; ++i) {
199 const TopoDS_Shape& aV=aMV(i);
201 if (aMVProcessed.Contains(aV)) {
205 const Bnd_Box& aBoxV=aMSB.FindFromKey(aV);
206 const TColStd_ListOfInteger& aLI=aBSB.Compare(aBoxV);
209 myErrorStatus=3; // it must not be
215 TopTools_ListOfShape aLVSD;
218 for (j=0; aIt.More(); aIt.Next(), ++j) {
220 const TopoDS_Shape& aVx=aMIS.FindFromKey(aIndex);
225 aMVProcessed.Add(aVx);
228 myImages.Bind(aVF, aLVSD);
233 aItIm.Initialize(myImages);
234 for (; aItIm.More(); aItIm.Next()) {
235 const TopoDS_Shape& aV=aItIm.Key();
236 const TopTools_ListOfShape& aLVSD=aItIm.Value();
237 aNbVSD=aLVSD.Extent();
240 MakeVertex(aLVSD, aVnew);
241 aMVV.Bind(aVnew, aLVSD);
245 // UnBind old vertices
247 for (i=1; i<=aNbV; ++i) {
248 const TopoDS_Shape& aV=aMV(i);
253 aItIm.Initialize(aMVV);
254 for (; aItIm.More(); aItIm.Next()) {
255 const TopoDS_Shape& aV=aItIm.Key();
256 const TopTools_ListOfShape& aLVSD=aItIm.Value();
257 myImages.Bind(aV, aLVSD);
261 aItIm.Initialize(myImages);
262 for (; aItIm.More(); aItIm.Next()) {
263 const TopoDS_Shape& aV=aItIm.Key();
264 const TopTools_ListOfShape& aLVSD=aItIm.Value();
266 aItS.Initialize(aLVSD);
267 for (; aItS.More(); aItS.Next()) {
268 const TopoDS_Shape& aVSD=aItS.Value();
269 if (!myOrigins.IsBound(aVSD)) {
270 myOrigins.Bind(aVSD, aV);
275 //=======================================================================
276 //function : MakeSolids
278 //=======================================================================
279 void GEOMAlgo_Gluer::MakeSolids()
283 Standard_Integer aNbS;
284 TopAbs_Orientation anOr;
285 TopoDS_Compound aCmp;
286 TopoDS_Solid aNewSolid;
287 TopTools_IndexedMapOfShape aMS;
288 TopExp_Explorer aExpS, aExp;
291 aBB.MakeCompound(aCmp);
294 aExpS.Init(myShape, TopAbs_SOLID);
295 for (; aExpS.More(); aExpS.Next()) {
296 const TopoDS_Solid& aSolid=TopoDS::Solid(aExpS.Current());
297 if (aMS.Contains(aSolid)) {
302 anOr=aSolid.Orientation();
304 aBB.MakeSolid(aNewSolid);
305 aNewSolid.Orientation(anOr);
307 aExp.Init(aSolid, TopAbs_SHELL);
308 for (; aExp.More(); aExp.Next()) {
309 const TopoDS_Shape& aShell=aExp.Current();
310 const TopoDS_Shape& aShellR=myOrigins.Find(aShell);
311 aBB.Add(aNewSolid, aShellR);
314 TopTools_ListOfShape aLS;
317 myImages.Bind(aNewSolid, aLS);
318 myOrigins.Bind(aSolid, aNewSolid);
320 aBB.Add(aCmp, aNewSolid);
327 //Standard_Real aTol=1.e-7;
328 BOP_CorrectTolerances::CorrectCurveOnSurface(myResult);
331 //=======================================================================
332 //function : MakeShells
334 //=======================================================================
335 void GEOMAlgo_Gluer::MakeShells()
339 Standard_Boolean bIsToReverse;
340 Standard_Integer i, aNbS;
341 TopAbs_Orientation anOr;
342 TopoDS_Shell aNewShell;
344 TopTools_IndexedMapOfShape aMS;
345 TopExp_Explorer aExp;
348 TopExp::MapShapes(myShape, TopAbs_SHELL, aMS);
351 for (i=1; i<=aNbS; ++i) {
352 const TopoDS_Shell& aShell=TopoDS::Shell(aMS(i));
353 anOr=aShell.Orientation();
355 aBB.MakeShell(aNewShell);
356 aNewShell.Orientation(anOr);
357 aExp.Init(aShell, TopAbs_FACE);
358 for (; aExp.More(); aExp.Next()) {
359 const TopoDS_Face& aF=TopoDS::Face(aExp.Current());
360 aFR=TopoDS::Face(myOrigins.Find(aF));
361 if (aFR.IsSame(aF)) {
362 aBB.Add(aNewShell, aF);
365 bIsToReverse=IsToReverse(aFR, aF);
369 aBB.Add(aNewShell, aFR);
372 TopTools_ListOfShape aLS;
375 myImages.Bind(aNewShell, aLS);
376 myOrigins.Bind(aShell, aNewShell);
379 //=======================================================================
380 //function : MakeFaces
382 //=======================================================================
383 void GEOMAlgo_Gluer::MakeFaces()
385 MakeShapes(TopAbs_FACE);
387 //=======================================================================
388 //function : MakeEdges
390 //=======================================================================
391 void GEOMAlgo_Gluer::MakeEdges()
393 MakeShapes(TopAbs_EDGE);
395 //=======================================================================
396 //function : MakeShapes
398 //=======================================================================
399 void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
403 Standard_Boolean bHasNewSubShape;
404 Standard_Integer i, aNbF, aNbSDF, iErr;
405 TopoDS_Shape aNewShape;
406 TopTools_IndexedMapOfShape aMF;
407 TopTools_ListIteratorOfListOfShape aItS;
408 GEOMAlgo_PassKey aPKF;
409 GEOMAlgo_IndexedDataMapOfPassKeyListOfShape aMPKLF;
411 TopExp::MapShapes(myShape, aType, aMF);
414 for (i=1; i<=aNbF; ++i) {
415 const TopoDS_Shape& aS=aMF(i);
418 if (aType==TopAbs_FACE) {
419 const TopoDS_Face& aF=TopoDS::Face(aS);
420 FacePassKey(aF, aPKF);
422 else if (aType==TopAbs_EDGE) {
423 const TopoDS_Edge& aE=TopoDS::Edge(aS);
424 EdgePassKey(aE, aPKF);
431 if (aMPKLF.Contains(aPKF)) {
432 TopTools_ListOfShape& aLSDF=aMPKLF.ChangeFromKey(aPKF);
436 TopTools_ListOfShape aLSDF;
439 aMPKLF.Add(aPKF, aLSDF);
442 // check geometric coincidence
443 if (myCheckGeometry) {
444 iErr=GEOMAlgo_Tools::RefineSDShapes(aMPKLF, myTol, myContext);
453 aNbF=aMPKLF.Extent();
454 for (i=1; i<=aNbF; ++i) {
455 const TopTools_ListOfShape& aLSDF=aMPKLF(i);
456 aNbSDF=aLSDF.Extent();
458 myErrorStatus=4; // it must not be
461 const TopoDS_Shape& aS1=aLSDF.First();
463 //modified by NIZNHY-PKV Fri Jan 21 15:34:00 2005 f
465 bHasNewSubShape=Standard_True;
466 // prevent creation of a new shape if there are not
467 // new subshapes of aSS among the originals
469 bHasNewSubShape=HasNewSubShape(aS1);
470 if (!bHasNewSubShape) {
472 aNewShape.Orientation(TopAbs_FORWARD);
475 //modified by NIZNHY-PKV Fri Jan 21 15:34:05 2005 t
477 if (bHasNewSubShape) {//modified by NIZNHY-PKV Fri Jan 21 15:34:10 2005ft
478 if (aType==TopAbs_FACE) {
479 TopoDS_Face aNewFace;
481 const TopoDS_Face& aF1=TopoDS::Face(aS1);
482 MakeFace(aF1, aNewFace);
485 else if (aType==TopAbs_EDGE) {
486 TopoDS_Edge aNewEdge;
488 const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
489 MakeEdge(aE1, aNewEdge);
494 myImages.Bind(aNewShape, aLSDF);
496 aItS.Initialize(aLSDF);
497 for (; aItS.More(); aItS.Next()) {
498 const TopoDS_Shape& aFSD=aItS.Value();
499 if (!myOrigins.IsBound(aFSD)) {
500 myOrigins.Bind(aFSD, aNewShape);
505 //=======================================================================
506 //function : CheckResult
508 //=======================================================================
509 void GEOMAlgo_Gluer::CheckResult()
513 if (myResult.IsNull()) {
518 Standard_Boolean bFound;
519 Standard_Integer i, j, aNbS, aNbFS, aNbSx;
520 TopTools_IndexedMapOfShape aMS, aMFS;
521 TopTools_IndexedDataMapOfShapeListOfShape aMFR;
523 TopExp::MapShapesAndAncestors(myResult, TopAbs_FACE, TopAbs_SOLID, aMFR);
524 TopExp::MapShapes(myResult, TopAbs_SOLID, aMS);
529 for (i=1; i<=aNbS; ++i) {
530 const TopoDS_Shape& aSolid=aMS(i);
533 TopExp::MapShapes(aSolid, TopAbs_FACE, aMFS);
535 bFound=Standard_False;
537 for (j=1; j<=aNbFS; ++j) {
538 const TopoDS_Shape& aFS=aMFS(j);
539 if (aMFR.Contains(aFS)) {
540 const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
556 //=======================================================================
557 //function : CheckData
559 //=======================================================================
560 void GEOMAlgo_Gluer::CheckData()
564 if (myShape.IsNull()) {
569 //=======================================================================
570 //function : InnerTolerance
572 //=======================================================================
573 void GEOMAlgo_Gluer::InnerTolerance()
579 Standard_Real aX[3][2], dH, dHmin, aCoef, aTolTresh;
582 BRepBndLib::Add(myShape, aBox);
583 aBox.Get(aX[0][0], aX[1][0], aX[2][0], aX[0][1], aX[1][1], aX[2][1]);
585 dHmin=aX[0][1]-aX[0][0];
586 for (i=1; i<3; ++i) {
587 dH=aX[i][1]-aX[i][0];
595 aTolTresh=aCoef*dHmin;
596 if (myTol>aTolTresh) {
602 //=======================================================================
603 //function : FacePassKey
605 //=======================================================================
606 void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
607 GEOMAlgo_PassKey& aPK)
609 Standard_Integer i, aNbE, aNbMax;
610 TopTools_ListOfShape aLE;
611 TopTools_IndexedMapOfShape aME;
613 TopExp::MapShapes(aF, TopAbs_EDGE, aME);
616 if (!aNbE || aNbE>aNbMax) {
617 myErrorStatus=101; // temprorary
621 for (i=1; i<=aNbE; ++i) {
622 const TopoDS_Shape& aE=aME(i);
623 if (!myOrigins.IsBound(aE)) {
627 const TopoDS_Shape& aER=myOrigins.Find(aE);
632 //=======================================================================
633 //function : EdgePassKey
635 //=======================================================================
636 void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
637 GEOMAlgo_PassKey& aPK)
639 TopoDS_Vertex aV1, aV2;
641 TopExp::Vertices(aE, aV1, aV2);
643 if (!myOrigins.IsBound(aV1) || !myOrigins.IsBound(aV2) ) {
647 const TopoDS_Shape& aVR1=myOrigins.Find(aV1);
648 const TopoDS_Shape& aVR2=myOrigins.Find(aV2);
649 aPK.SetIds(aVR1, aVR2);
651 //=======================================================================
652 //function : MakeVertex
654 //=======================================================================
655 void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
656 TopoDS_Vertex& aNewVertex)
658 Standard_Integer aNbV;
659 Standard_Real aTolV, aD, aDmax;
664 TopTools_ListIteratorOfListOfShape aIt;
672 aGC.SetCoord(0.,0.,0.);
674 for (; aIt.More(); aIt.Next()) {
675 aVx=TopoDS::Vertex(aIt.Value());
676 aP3D=BRep_Tool::Pnt(aVx);
679 aGC/=(Standard_Real)aNbV;
685 for (; aIt.More(); aIt.Next()) {
686 aVx=TopoDS::Vertex(aIt.Value());
687 aP3D=BRep_Tool::Pnt(aVx);
688 aTolV=BRep_Tool::Tolerance(aVx);
689 aD=aPGC.Distance(aP3D)+aTolV;
695 aBB.MakeVertex (aNewVertex, aPGC, aDmax);
697 //=======================================================================
698 //function : MakeEdge
700 //=======================================================================
701 void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
702 TopoDS_Edge& aNewEdge)
706 Standard_Boolean bIsDE;
707 Standard_Real aT1, aT2;
708 TopoDS_Vertex aV1, aV2, aVR1, aVR2;
711 bIsDE=BRep_Tool::Degenerated(aE);
714 aEx.Orientation(TopAbs_FORWARD);
716 TopExp::Vertices(aEx, aV1, aV2);
718 aT1=BRep_Tool::Parameter(aV1, aEx);
719 aT2=BRep_Tool::Parameter(aV2, aEx);
721 aVR1=TopoDS::Vertex(myOrigins.Find(aV1));
722 aVR1.Orientation(TopAbs_FORWARD);
723 aVR2=TopoDS::Vertex(myOrigins.Find(aV2));
724 aVR2.Orientation(TopAbs_REVERSED);
730 TopAbs_Orientation anOrE;
732 anOrE=aE.Orientation();
733 aTol=BRep_Tool::Tolerance(aE);
740 aBB.Range(E, aT1, aT2);
741 aBB.Degenerated(E, Standard_True);
742 aBB.UpdateEdge(E, aTol);
748 BOPTools_Tools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
752 //=======================================================================
753 //function : MakeFace
755 //=======================================================================
756 void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
757 TopoDS_Face& aNewFace)
761 Standard_Boolean bIsToReverse, bIsUPeriodic;
762 Standard_Real aTol, aUMin, aUMax, aVMin, aVMax;
765 TopoDS_Face aFFWD, newFace;
766 TopLoc_Location aLoc;
767 Handle(Geom_Surface) aS;
768 Handle(Geom2d_Curve) aC2D;
769 TopExp_Explorer aExpW, aExpE;
773 aFFWD.Orientation(TopAbs_FORWARD);
775 aS=BRep_Tool::Surface(aFFWD, aLoc);
776 bIsUPeriodic=GEOMAlgo_Tools::IsUPeriodic(aS);
777 aTol=BRep_Tool::Tolerance(aFFWD);
778 BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
780 aBB.MakeFace (newFace, aS, aLoc, aTol);
782 aExpW.Init(aFFWD, TopAbs_WIRE);
783 for (; aExpW.More(); aExpW.Next()) {
784 aBB.MakeWire(newWire);
785 const TopoDS_Wire& aW=TopoDS::Wire(aExpW.Current());
786 aExpE.Init(aW, TopAbs_EDGE);
787 for (; aExpE.More(); aExpE.Next()) {
788 const TopoDS_Edge& aE=TopoDS::Edge(aExpE.Current());
789 aER=TopoDS::Edge(myOrigins.Find(aE));
791 aER.Orientation(TopAbs_FORWARD);
792 if (!BRep_Tool::Degenerated(aER)) {
795 GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
797 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
800 bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
806 aER.Orientation(aE.Orientation());
809 aBB.Add(newWire, aER);
811 aBB.Add(newFace, newWire);
815 //=======================================================================
816 //function : IsToReverse
818 //=======================================================================
819 Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
820 const TopoDS_Face& aF)
822 Standard_Boolean bRet;
823 Standard_Real aT, aT1, aT2, aTR, aScPr;
824 TopExp_Explorer aExp;
825 Handle(Geom_Curve)aC3D;
831 aExp.Init(aF, TopAbs_EDGE);
832 for (; aExp.More(); aExp.Next()) {
833 const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current());
835 if (BRep_Tool::Degenerated(aE)) {
839 const TopoDS_Edge& aER=TopoDS::Edge(myOrigins.Find(aE));
841 aC3D=BRep_Tool::Curve(aE, aT1, aT2);
842 aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
844 myContext.ProjectPointOnEdge(aP, aER, aTR);
846 BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
847 if (aF.Orientation()==TopAbs_REVERSED) {
851 BOPTools_Tools3D::GetNormalToFaceOnEdge (aER, aFR, aTR, aDNFR);
852 if (aFR.Orientation()==TopAbs_REVERSED) {
862 //modified by NIZNHY-PKV Fri Jan 21 10:55:42 2005 f
863 //=======================================================================
864 //function : HasNewSubShape
866 //=======================================================================
867 Standard_Boolean GEOMAlgo_Gluer::HasNewSubShape(const TopoDS_Shape& aS)const
869 Standard_Boolean bRet;
870 Standard_Integer i, aNbSS;
871 TopTools_IndexedMapOfShape aMSS;
873 GetSubShapes(aS, aMSS);
877 for (i=1; i<=aNbSS; ++i) {
878 const TopoDS_Shape& aSS=aMSS(i);
879 if (aSS.ShapeType()==TopAbs_WIRE) {
883 bRet=!myOrigins.IsBound(aSS);
888 const TopoDS_Shape& aSSIm=myOrigins.Find(aSS);
889 bRet=!aSSIm.IsSame(aSS);
896 //=======================================================================
897 //function : GetSubShapes
899 //=======================================================================
900 void GetSubShapes(const TopoDS_Shape& aS,
901 TopTools_IndexedMapOfShape& aMSS)
904 TopAbs_ShapeEnum aType;
907 aType=aS.ShapeType();
908 aR=(Standard_Integer)aType+1;
909 if (aR>TopAbs_VERTEX) {
914 for (; aIt.More(); aIt.Next()) {
915 const TopoDS_Shape& aSS=aIt.Value();
917 GetSubShapes(aSS, aMSS);
920 //=======================================================================
921 //function : Modified
923 //=======================================================================
924 const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
926 TopAbs_ShapeEnum aType;
930 aType=aS.ShapeType();
931 if (aType==TopAbs_FACE ||
932 aType==TopAbs_EDGE ||
933 aType==TopAbs_VERTEX) {
934 if(myOrigins.IsBound(aS)) {
935 const TopoDS_Shape& aSnew=myOrigins.Find(aS);
936 if (!aSnew.IsSame(aS)) {
937 myGenerated.Append(aSnew);
944 //=======================================================================
945 //function : Generated
947 //=======================================================================
948 const TopTools_ListOfShape& GEOMAlgo_Gluer::Generated(const TopoDS_Shape& )
953 //=======================================================================
954 //function : IsDeleted
956 //=======================================================================
957 Standard_Boolean GEOMAlgo_Gluer::IsDeleted (const TopoDS_Shape& aS)
959 Standard_Boolean bRet=Standard_False;
961 const TopTools_ListOfShape& aL=Modified(aS);
966 //modified by NIZNHY-PKV Fri Jan 21 10:59:21 2005 t
970 // 1 - the object is just initialized
971 // 2 - no vertices found in source shape
972 // 3 - nb same domain vertices for the vertex Vi =0
973 // 4 - nb same domain edges(faces) for the edge Ei(face Fi) =0
974 // 5 - source shape is Null
975 // 6 - result shape is Null
976 // 101 - nb edges > PassKey.NbMax() in FacesPassKey()
977 // 102 - the edge Ei can not be found in myOrigins Map
978 // 100 - the vertex Vi can not be found in myOrigins Map
982 // 1 - some shapes can not be glued by faces