1 // Created by: Peter KURNEV
2 // Copyright (c) 2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <BRepAlgoAPI_BuilderAlgo.ixx>
17 #include <BOPAlgo_PaveFiller.hxx>
18 #include <BOPAlgo_Builder.hxx>
20 //=======================================================================
23 //=======================================================================
24 BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo()
32 //=======================================================================
35 //=======================================================================
36 BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo
37 (const BOPAlgo_PaveFiller& aPF)
44 BOPAlgo_PaveFiller* pPF=(BOPAlgo_PaveFiller*)&aPF;
47 //=======================================================================
50 //=======================================================================
51 BRepAlgoAPI_BuilderAlgo::~BRepAlgoAPI_BuilderAlgo()
55 //=======================================================================
56 //function : SetFuzzyValue
58 //=======================================================================
59 void BRepAlgoAPI_BuilderAlgo::SetFuzzyValue(const Standard_Real theFuzz)
62 myFuzzyValue = theFuzz;
65 //=======================================================================
66 //function : FuzzyValue
68 //=======================================================================
69 Standard_Real BRepAlgoAPI_BuilderAlgo::FuzzyValue() const
73 //=======================================================================
76 //=======================================================================
77 void BRepAlgoAPI_BuilderAlgo::Clear()
79 if (myDSFiller && myEntryType) {
88 //=======================================================================
89 //function : SetArguments
91 //=======================================================================
92 void BRepAlgoAPI_BuilderAlgo::SetArguments
93 (const TopTools_ListOfShape& theLS)
97 //=======================================================================
98 //function : Arguments
100 //=======================================================================
101 const TopTools_ListOfShape& BRepAlgoAPI_BuilderAlgo::Arguments()const
105 //=======================================================================
108 //=======================================================================
109 void BRepAlgoAPI_BuilderAlgo::Build()
111 Standard_Integer iErr;
122 myDSFiller=new BOPAlgo_PaveFiller(myAllocator);
124 myDSFiller->SetArguments(myArguments);
126 myDSFiller->SetRunParallel(myRunParallel);
127 myDSFiller->SetProgressIndicator(myProgressIndicator);
128 myDSFiller->SetFuzzyValue(myFuzzyValue);
130 myDSFiller->Perform();
131 iErr=myDSFiller->ErrorStatus();
133 myErrorStatus=100+iErr;
135 }// if (myEntryType) {
140 myBuilder=new BOPAlgo_Builder(myAllocator);
142 myBuilder->SetArguments(myArguments);
144 myBuilder->SetRunParallel(myRunParallel);
145 myBuilder->SetProgressIndicator(myProgressIndicator);
147 myBuilder->PerformWithFiller(*myDSFiller);
148 iErr=myBuilder->ErrorStatus();
150 myErrorStatus=200+iErr;
154 myShape=myBuilder->Shape();
156 //=======================================================================
157 //function : Generated
159 //=======================================================================
160 const TopTools_ListOfShape& BRepAlgoAPI_BuilderAlgo::Generated
161 (const TopoDS_Shape& aS)
163 if (myBuilder==NULL) {
167 myGenerated = myBuilder->Generated(aS);
170 //=======================================================================
171 //function : Modified
173 //=======================================================================
174 const TopTools_ListOfShape& BRepAlgoAPI_BuilderAlgo::Modified
175 (const TopoDS_Shape& aS)
177 if (myBuilder==NULL) {
181 myGenerated = myBuilder->Modified(aS);
184 //=======================================================================
185 //function : IsDeleted
187 //=======================================================================
188 Standard_Boolean BRepAlgoAPI_BuilderAlgo::IsDeleted
189 (const TopoDS_Shape& aS)
191 Standard_Boolean bDeleted = Standard_True;
192 if (myBuilder != NULL) {
193 bDeleted=myBuilder->IsDeleted(aS);
197 //=======================================================================
198 //function : HasModified
200 //=======================================================================
201 Standard_Boolean BRepAlgoAPI_BuilderAlgo::HasModified() const
203 if (myBuilder==NULL) {
204 return Standard_False;
206 return myBuilder->HasModified();
208 //=======================================================================
209 //function : HasGenerated
211 //=======================================================================
212 Standard_Boolean BRepAlgoAPI_BuilderAlgo::HasGenerated() const
214 if (myBuilder==NULL) {
215 return Standard_False;
217 return myBuilder->HasGenerated();
219 //=======================================================================
220 //function : HasDeleted
222 //=======================================================================
223 Standard_Boolean BRepAlgoAPI_BuilderAlgo::HasDeleted() const
225 if (myBuilder==NULL) {
226 return Standard_False;
228 return myBuilder->HasDeleted();