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_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
62 #include <GEOMAlgo_PassKeyShape.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_PassKeyShape aPKF;
409 GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape 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 bHasNewSubShape=Standard_True;
464 // prevent creation of a new shape if there are not
465 // new subshapes of aSS among the originals
467 bHasNewSubShape=HasNewSubShape(aS1);
468 if (!bHasNewSubShape) {
470 aNewShape.Orientation(TopAbs_FORWARD);
474 if (bHasNewSubShape) {
475 if (aType==TopAbs_FACE) {
476 TopoDS_Face aNewFace;
478 const TopoDS_Face& aF1=TopoDS::Face(aS1);
479 MakeFace(aF1, aNewFace);
482 else if (aType==TopAbs_EDGE) {
483 TopoDS_Edge aNewEdge;
485 const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
486 MakeEdge(aE1, aNewEdge);
491 myImages.Bind(aNewShape, aLSDF);
493 aItS.Initialize(aLSDF);
494 for (; aItS.More(); aItS.Next()) {
495 const TopoDS_Shape& aFSD=aItS.Value();
496 if (!myOrigins.IsBound(aFSD)) {
497 myOrigins.Bind(aFSD, aNewShape);
502 //=======================================================================
503 //function : CheckResult
505 //=======================================================================
506 void GEOMAlgo_Gluer::CheckResult()
510 if (myResult.IsNull()) {
515 Standard_Boolean bFound;
516 Standard_Integer i, j, aNbS, aNbFS, aNbSx;
517 TopTools_IndexedMapOfShape aMS, aMFS;
518 TopTools_IndexedDataMapOfShapeListOfShape aMFR;
520 TopExp::MapShapesAndAncestors(myResult, TopAbs_FACE, TopAbs_SOLID, aMFR);
521 TopExp::MapShapes(myResult, TopAbs_SOLID, aMS);
526 for (i=1; i<=aNbS; ++i) {
527 const TopoDS_Shape& aSolid=aMS(i);
530 TopExp::MapShapes(aSolid, TopAbs_FACE, aMFS);
532 bFound=Standard_False;
534 for (j=1; j<=aNbFS; ++j) {
535 const TopoDS_Shape& aFS=aMFS(j);
536 if (aMFR.Contains(aFS)) {
537 const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
553 //=======================================================================
554 //function : CheckData
556 //=======================================================================
557 void GEOMAlgo_Gluer::CheckData()
561 if (myShape.IsNull()) {
566 //=======================================================================
567 //function : InnerTolerance
569 //=======================================================================
570 void GEOMAlgo_Gluer::InnerTolerance()
576 Standard_Real aX[3][2], dH, dHmin, aCoef, aTolTresh;
579 BRepBndLib::Add(myShape, aBox);
580 aBox.Get(aX[0][0], aX[1][0], aX[2][0], aX[0][1], aX[1][1], aX[2][1]);
582 dHmin=aX[0][1]-aX[0][0];
583 for (i=1; i<3; ++i) {
584 dH=aX[i][1]-aX[i][0];
592 aTolTresh=aCoef*dHmin;
593 if (myTol>aTolTresh) {
599 //=======================================================================
600 //function : FacePassKey
602 //=======================================================================
603 void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
604 GEOMAlgo_PassKeyShape& aPK)
606 Standard_Integer i, aNbE, aNbMax;
607 TopTools_ListOfShape aLE;
608 TopTools_IndexedMapOfShape aME;
610 TopExp::MapShapes(aF, TopAbs_EDGE, aME);
613 if (!aNbE || aNbE>aNbMax) {
614 myErrorStatus=101; // temprorary
618 for (i=1; i<=aNbE; ++i) {
619 const TopoDS_Shape& aE=aME(i);
620 if (!myOrigins.IsBound(aE)) {
624 const TopoDS_Shape& aER=myOrigins.Find(aE);
629 //=======================================================================
630 //function : EdgePassKey
632 //=======================================================================
633 void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
634 GEOMAlgo_PassKeyShape& aPK)
636 TopoDS_Vertex aV1, aV2;
638 TopExp::Vertices(aE, aV1, aV2);
640 if (!myOrigins.IsBound(aV1) || !myOrigins.IsBound(aV2) ) {
644 const TopoDS_Shape& aVR1=myOrigins.Find(aV1);
645 const TopoDS_Shape& aVR2=myOrigins.Find(aV2);
646 aPK.SetIds(aVR1, aVR2);
648 //=======================================================================
649 //function : MakeVertex
651 //=======================================================================
652 void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
653 TopoDS_Vertex& aNewVertex)
655 Standard_Integer aNbV;
656 Standard_Real aTolV, aD, aDmax;
661 TopTools_ListIteratorOfListOfShape aIt;
669 aGC.SetCoord(0.,0.,0.);
671 for (; aIt.More(); aIt.Next()) {
672 aVx=TopoDS::Vertex(aIt.Value());
673 aP3D=BRep_Tool::Pnt(aVx);
676 aGC/=(Standard_Real)aNbV;
682 for (; aIt.More(); aIt.Next()) {
683 aVx=TopoDS::Vertex(aIt.Value());
684 aP3D=BRep_Tool::Pnt(aVx);
685 aTolV=BRep_Tool::Tolerance(aVx);
686 aD=aPGC.Distance(aP3D)+aTolV;
692 aBB.MakeVertex (aNewVertex, aPGC, aDmax);
694 //=======================================================================
695 //function : MakeEdge
697 //=======================================================================
698 void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
699 TopoDS_Edge& aNewEdge)
703 Standard_Boolean bIsDE;
704 Standard_Real aT1, aT2;
705 TopoDS_Vertex aV1, aV2, aVR1, aVR2;
708 bIsDE=BRep_Tool::Degenerated(aE);
711 aEx.Orientation(TopAbs_FORWARD);
713 TopExp::Vertices(aEx, aV1, aV2);
715 aT1=BRep_Tool::Parameter(aV1, aEx);
716 aT2=BRep_Tool::Parameter(aV2, aEx);
718 aVR1=TopoDS::Vertex(myOrigins.Find(aV1));
719 aVR1.Orientation(TopAbs_FORWARD);
720 aVR2=TopoDS::Vertex(myOrigins.Find(aV2));
721 aVR2.Orientation(TopAbs_REVERSED);
727 TopAbs_Orientation anOrE;
729 anOrE=aE.Orientation();
730 aTol=BRep_Tool::Tolerance(aE);
737 aBB.Range(E, aT1, aT2);
738 aBB.Degenerated(E, Standard_True);
739 aBB.UpdateEdge(E, aTol);
745 BOPTools_Tools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
749 //=======================================================================
750 //function : MakeFace
752 //=======================================================================
753 void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
754 TopoDS_Face& aNewFace)
758 Standard_Boolean bIsToReverse, bIsUPeriodic;
759 Standard_Real aTol, aUMin, aUMax, aVMin, aVMax;
762 TopoDS_Face aFFWD, newFace;
763 TopLoc_Location aLoc;
764 Handle(Geom_Surface) aS;
765 Handle(Geom2d_Curve) aC2D;
766 TopExp_Explorer aExpW, aExpE;
770 aFFWD.Orientation(TopAbs_FORWARD);
772 aS=BRep_Tool::Surface(aFFWD, aLoc);
773 bIsUPeriodic=GEOMAlgo_Tools::IsUPeriodic(aS);
774 aTol=BRep_Tool::Tolerance(aFFWD);
775 BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
777 aBB.MakeFace (newFace, aS, aLoc, aTol);
779 aExpW.Init(aFFWD, TopAbs_WIRE);
780 for (; aExpW.More(); aExpW.Next()) {
781 aBB.MakeWire(newWire);
782 const TopoDS_Wire& aW=TopoDS::Wire(aExpW.Current());
783 aExpE.Init(aW, TopAbs_EDGE);
784 for (; aExpE.More(); aExpE.Next()) {
785 const TopoDS_Edge& aE=TopoDS::Edge(aExpE.Current());
786 aER=TopoDS::Edge(myOrigins.Find(aE));
788 aER.Orientation(TopAbs_FORWARD);
789 if (!BRep_Tool::Degenerated(aER)) {
792 GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
794 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
797 bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
803 aER.Orientation(aE.Orientation());
806 aBB.Add(newWire, aER);
808 //modified by NIZNHY-PKV Mon Jan 31 17:26:36 2005f
810 TopTools_ListOfShape aLW;
813 myImages.Bind(newWire, aLW);
814 myOrigins.Bind(aW, newWire);
816 //modified by NIZNHY-PKV Mon Jan 31 17:26:41 2005 t
817 aBB.Add(newFace, newWire);
821 //=======================================================================
822 //function : IsToReverse
824 //=======================================================================
825 Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
826 const TopoDS_Face& aF)
828 Standard_Boolean bRet;
829 Standard_Real aT, aT1, aT2, aTR, aScPr;
830 TopExp_Explorer aExp;
831 Handle(Geom_Curve)aC3D;
837 aExp.Init(aF, TopAbs_EDGE);
838 for (; aExp.More(); aExp.Next()) {
839 const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current());
841 if (BRep_Tool::Degenerated(aE)) {
845 const TopoDS_Edge& aER=TopoDS::Edge(myOrigins.Find(aE));
847 aC3D=BRep_Tool::Curve(aE, aT1, aT2);
848 aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
850 myContext.ProjectPointOnEdge(aP, aER, aTR);
852 BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
853 if (aF.Orientation()==TopAbs_REVERSED) {
857 BOPTools_Tools3D::GetNormalToFaceOnEdge (aER, aFR, aTR, aDNFR);
858 if (aFR.Orientation()==TopAbs_REVERSED) {
867 //=======================================================================
868 //function : HasNewSubShape
870 //=======================================================================
871 Standard_Boolean GEOMAlgo_Gluer::HasNewSubShape(const TopoDS_Shape& aS)const
873 Standard_Boolean bRet;
874 Standard_Integer i, aNbSS;
875 TopTools_IndexedMapOfShape aMSS;
877 GetSubShapes(aS, aMSS);
881 for (i=1; i<=aNbSS; ++i) {
882 const TopoDS_Shape& aSS=aMSS(i);
883 if (aSS.ShapeType()==TopAbs_WIRE) {
887 bRet=!myOrigins.IsBound(aSS);
892 const TopoDS_Shape& aSSIm=myOrigins.Find(aSS);
893 bRet=!aSSIm.IsSame(aSS);
900 //=======================================================================
901 //function : GetSubShapes
903 //=======================================================================
904 void GetSubShapes(const TopoDS_Shape& aS,
905 TopTools_IndexedMapOfShape& aMSS)
908 TopAbs_ShapeEnum aType;
911 aType=aS.ShapeType();
912 aR=(Standard_Integer)aType+1;
913 if (aR>TopAbs_VERTEX) {
918 for (; aIt.More(); aIt.Next()) {
919 const TopoDS_Shape& aSS=aIt.Value();
921 GetSubShapes(aSS, aMSS);
924 //=======================================================================
925 //function : Modified
927 //=======================================================================
928 const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
930 TopAbs_ShapeEnum aType;
934 aType=aS.ShapeType();
935 if (aType==TopAbs_VERTEX ||
936 aType==TopAbs_EDGE ||
937 aType==TopAbs_WIRE || //modified by NIZNHY-PKV Mon Jan 31 17:18:36 2005ft
938 aType==TopAbs_FACE ||
939 aType==TopAbs_SHELL || //modified by NIZNHY-PKV Mon Jan 31 17:18:36 2005ft
940 aType==TopAbs_SOLID) { //modified by NIZNHY-PKV Mon Jan 31 17:18:36 2005ft
941 if(myOrigins.IsBound(aS)) {
942 const TopoDS_Shape& aSnew=myOrigins.Find(aS);
943 if (!aSnew.IsSame(aS)) {
944 myGenerated.Append(aSnew);
951 //=======================================================================
952 //function : Generated
954 //=======================================================================
955 const TopTools_ListOfShape& GEOMAlgo_Gluer::Generated(const TopoDS_Shape& )
960 //=======================================================================
961 //function : IsDeleted
963 //=======================================================================
964 Standard_Boolean GEOMAlgo_Gluer::IsDeleted (const TopoDS_Shape& aS)
966 Standard_Boolean bRet=Standard_False;
968 const TopTools_ListOfShape& aL=Modified(aS);
976 // 1 - the object is just initialized
977 // 2 - no vertices found in source shape
978 // 3 - nb same domain vertices for the vertex Vi =0
979 // 4 - nb same domain edges(faces) for the edge Ei(face Fi) =0
980 // 5 - source shape is Null
981 // 6 - result shape is Null
982 // 101 - nb edges > PassKey.NbMax() in FacesPassKey()
983 // 102 - the edge Ei can not be found in myOrigins Map
984 // 100 - the vertex Vi can not be found in myOrigins Map
988 // 1 - some shapes can not be glued by faces