1 // File: GEOMAlgo_WireSolid.cxx
2 // Created: Wed Jan 12 10:19:31 2005
3 // Author: Peter KURNEV
7 #include <GEOMAlgo_WireSolid.ixx>
9 #include <Standard_Failure.hxx>
11 #include <TopAbs_ShapeEnum.hxx>
13 #include <TopTools_ListIteratorOfListOfShape.hxx>
15 #include <BOPTColStd_Dump.hxx>
17 #include <BooleanOperations_ShapesDataStructure.hxx>
18 #include <BooleanOperations_StateOfShape.hxx>
20 #include <BOPTools_PaveFiller.hxx>
21 #include <BOPTools_SplitShapesPool.hxx>
22 #include <BOPTools_PaveBlock.hxx>
23 #include <BOPTools_ListOfPaveBlock.hxx>
24 #include <BOPTools_DSFiller.hxx>
25 #include <BOPTools_WireStateFiller.hxx>
27 //=======================================================================
28 //function : GEOMAlgo_WireSolid
30 //=======================================================================
31 GEOMAlgo_WireSolid::GEOMAlgo_WireSolid()
36 //=======================================================================
39 //=======================================================================
40 GEOMAlgo_WireSolid::~GEOMAlgo_WireSolid()
43 //=======================================================================
46 //=======================================================================
47 void GEOMAlgo_WireSolid::Perform()
52 if (myDSFiller==NULL) {
56 if(!myDSFiller->IsDone()) {
61 Standard_Boolean bIsNewFiller;
63 bIsNewFiller=myDSFiller->IsNewFiller();
67 myDSFiller->SetNewFiller(!bIsNewFiller);
72 catch (Standard_Failure) {
76 //=======================================================================
79 //=======================================================================
80 void GEOMAlgo_WireSolid::Prepare()
82 const BOPTools_PaveFiller& aPaveFiller=myDSFiller->PaveFiller();
84 BOPTools_WireStateFiller aStateFiller(aPaveFiller);
88 //=======================================================================
89 // function: BuildResult
91 //=======================================================================
92 void GEOMAlgo_WireSolid::BuildResult()
94 const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
95 const BOPTools_PaveFiller& aPaveFiller=myDSFiller->PaveFiller();
96 const BOPTools_SplitShapesPool& aSplitShapesPool=aPaveFiller.SplitShapesPool();
98 Standard_Integer i, aNbPB, nSp, iBeg, iEnd;
99 TopAbs_ShapeEnum aType;
100 BooleanOperations_StateOfShape aState;
107 iEnd=aDS.NumberOfShapesOfTheObject();
108 if (aDS.Tool().ShapeType()==TopAbs_WIRE) {
110 iEnd=aDS.NumberOfSourceShapes();
113 for (i=iBeg; i<=iEnd; ++i) {
114 aType=aDS.GetShapeType(i);
115 if (aType==TopAbs_EDGE) {
116 const TopoDS_Shape& aE=aDS.Shape(i);
117 const BOPTools_ListOfPaveBlock& aLPB=aSplitShapesPool(aDS.RefEdge(i));
121 aState=aDS.GetState(i);
123 if (aState==BooleanOperations_IN) {
126 else if (aState==BooleanOperations_OUT) {
129 else if (aState==BooleanOperations_ON) {
135 const BOPTools_PaveBlock& aPB=aLPB.First();
137 const TopoDS_Shape& aSp=aDS.Shape(nSp);
138 aState=aDS.GetState(nSp);
140 if (aState==BooleanOperations_IN) {
143 else if (aState==BooleanOperations_OUT) {
146 else if (aState==BooleanOperations_ON) {