1 // File: NMTTools_PaveFiller_9.cxx
2 // Created: Fri Dec 19 11:15:53 2003
3 // Author: Peter KURNEV
6 #include <NMTTools_PaveFiller.ixx>
8 #include <Geom_Surface.hxx>
10 #include <TopLoc_Location.hxx>
11 #include <TopAbs_Orientation.hxx>
14 #include <TopoDS_Face.hxx>
15 #include <TopoDS_Wire.hxx>
16 #include <TopoDS_Edge.hxx>
17 #include <TopoDS_Shape.hxx>
19 #include <BRep_Builder.hxx>
20 #include <BRep_Tool.hxx>
22 #include <TopExp_Explorer.hxx>
24 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
25 #include <BOPTools_ListOfPaveBlock.hxx>
26 #include <BOPTools_PaveBlock.hxx>
27 #include <BOPTools_Tools3D.hxx>
29 #include <NMTDS_ShapesDataStructure.hxx>
31 #include <NMTTools_CommonBlockAPI.hxx>
32 #include <NMTTools_CommonBlock.hxx>
35 //=======================================================================
36 // function: PrepareFace
38 //=======================================================================
39 void NMTTools_PaveFiller::PrepareFace(const Standard_Integer nF,
42 Standard_Boolean bToReverse, bIsDegenerated;
43 Standard_Integer iRankF, nE, nSp, aNbPB;
49 TopAbs_Orientation anOrF, anOrE;
51 TopExp_Explorer aExpW, aExpE;
52 BOPTools_ListIteratorOfListOfPaveBlock aItPB;
54 iRankF=myDS->Rank(nF);
55 aF=TopoDS::Face(myDS->Shape(nF));
56 anOrF=aF.Orientation();
57 aF.Orientation(TopAbs_FORWARD);
59 Handle(Geom_Surface) aS=BRep_Tool::Surface(aF, aLoc);
60 aTol=BRep_Tool::Tolerance(aF);
62 aBB.MakeFace (newFace, aS, aLoc, aTol);
64 aExpW.Init(aF, TopAbs_WIRE);
65 for (; aExpW.More(); aExpW.Next()) {
66 const TopoDS_Shape& aW=aExpW.Current();
67 aBB.MakeWire(newWire);
69 aExpE.Init(aW, TopAbs_EDGE);
70 for (; aExpE.More(); aExpE.Next()) {
71 const TopoDS_Edge& aE=TopoDS::Edge(aExpE.Current());
72 bIsDegenerated=BRep_Tool::Degenerated(aE);
73 anOrE=aE.Orientation();
75 nE=myDS->ShapeIndex(aE, iRankF);
76 const BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
83 aItPB.Initialize(aLPB);
84 for (; aItPB.More(); aItPB.Next()) {
85 const BOPTools_PaveBlock& aPB=aItPB.Value();
86 const BOPTools_PaveBlock& aPBR=RealPaveBlock(aPB);
89 aSp=TopoDS::Edge(myDS->Shape(nSp));
90 if (!bIsDegenerated) {
91 bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, myContext);
97 aSp.Orientation(anOrE);
99 aBB.Add(newWire, aSp);
102 aBB.Add(newFace, newWire);
104 newFace.Orientation(anOrF);