1 // Created by: Peter KURNEV
2 // Copyright (c) 2010-2014 OPEN CASCADE SAS
3 // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
5 // EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 // This file is part of Open CASCADE Technology software library.
9 // This library is free software; you can redistribute it and/or modify it under
10 // the terms of the GNU Lesser General Public License version 2.1 as published
11 // by the Free Software Foundation, with special exception defined in the file
12 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13 // distribution for complete text of the license and disclaimer of any warranty.
15 // Alternatively, this file may be used under the terms of Open CASCADE
16 // commercial license or contractual agreement.
19 #include <BOPAlgo_PaveFiller.hxx>
20 #include <BOPAlgo_SectionAttribute.hxx>
21 #include <BOPDS_Curve.hxx>
22 #include <BOPDS_DS.hxx>
23 #include <BOPDS_Iterator.hxx>
24 #include <BOPDS_PaveBlock.hxx>
26 #include <IntTools_Context.hxx>
27 #include <NCollection_BaseAllocator.hxx>
28 #include <Standard_ErrorHandler.hxx>
29 #include <Standard_Failure.hxx>
30 #include <TopoDS_Face.hxx>
31 #include <TopoDS_Vertex.hxx>
32 #include <TopTools_ListIteratorOfListOfShape.hxx>
34 //=======================================================================
37 //=======================================================================
38 BOPAlgo_PaveFiller::BOPAlgo_PaveFiller()
44 myNonDestructive = Standard_False;
45 myIsPrimary = Standard_True;
46 myAvoidBuildPCurve = Standard_False;
47 myGlue = BOPAlgo_GlueOff;
49 //=======================================================================
52 //=======================================================================
53 BOPAlgo_PaveFiller::BOPAlgo_PaveFiller
54 (const Handle(NCollection_BaseAllocator)& theAllocator)
56 BOPAlgo_Algo(theAllocator)
60 myNonDestructive = Standard_False;
61 myIsPrimary = Standard_True;
62 myAvoidBuildPCurve = Standard_False;
63 myGlue = BOPAlgo_GlueOff;
65 //=======================================================================
68 //=======================================================================
69 BOPAlgo_PaveFiller::~BOPAlgo_PaveFiller()
73 //=======================================================================
74 //function : SetNonDestructive
76 //=======================================================================
77 void BOPAlgo_PaveFiller::SetNonDestructive(const Standard_Boolean bFlag)
79 myNonDestructive=bFlag;
81 //=======================================================================
82 //function : NonDestructive
84 //=======================================================================
85 Standard_Boolean BOPAlgo_PaveFiller::NonDestructive()const
87 return myNonDestructive;
89 //=======================================================================
92 //=======================================================================
93 void BOPAlgo_PaveFiller::SetGlue(const BOPAlgo_GlueEnum theGlue)
97 //=======================================================================
100 //=======================================================================
101 BOPAlgo_GlueEnum BOPAlgo_PaveFiller::Glue() const
105 //=======================================================================
106 //function : SetIsPrimary
108 //=======================================================================
109 void BOPAlgo_PaveFiller::SetIsPrimary(const Standard_Boolean bFlag)
113 //=======================================================================
114 //function : IsPrimary
116 //=======================================================================
117 Standard_Boolean BOPAlgo_PaveFiller::IsPrimary()const
121 //=======================================================================
124 //=======================================================================
125 void BOPAlgo_PaveFiller::Clear()
136 //=======================================================================
139 //=======================================================================
140 const BOPDS_DS& BOPAlgo_PaveFiller::DS()
144 //=======================================================================
147 //=======================================================================
148 BOPDS_PDS BOPAlgo_PaveFiller::PDS()
152 //=======================================================================
155 //=======================================================================
156 const Handle(IntTools_Context)& BOPAlgo_PaveFiller::Context()
160 //=======================================================================
161 //function : SectionAttribute
163 //=======================================================================
164 void BOPAlgo_PaveFiller::SetSectionAttribute
165 (const BOPAlgo_SectionAttribute& theSecAttr)
167 mySectionAttribute = theSecAttr;
169 //=======================================================================
170 //function : SetArguments
172 //=======================================================================
173 void BOPAlgo_PaveFiller::SetArguments(const BOPCol_ListOfShape& theLS)
177 //=======================================================================
178 //function : Arguments
180 //=======================================================================
181 const BOPCol_ListOfShape& BOPAlgo_PaveFiller::Arguments()const
185 //=======================================================================
188 //=======================================================================
189 void BOPAlgo_PaveFiller::Init()
193 if (!myArguments.Extent()) {
202 myDS=new BOPDS_DS(myAllocator);
203 myDS->SetArguments(myArguments);
204 myDS->Init(myFuzzyValue);
207 myIterator=new BOPDS_Iterator(myAllocator);
208 myIterator->SetRunParallel(myRunParallel);
209 myIterator->SetDS(myDS);
210 myIterator->Prepare();
213 myContext=new IntTools_Context;
215 // 4 NonDestructive flag
220 //=======================================================================
223 //=======================================================================
224 void BOPAlgo_PaveFiller::Perform()
233 catch (Standard_Failure) {
237 //=======================================================================
238 // function: PerformInternal
240 //=======================================================================
241 void BOPAlgo_PaveFiller::PerformInternal()
265 UpdatePaveBlocksWithSDVertices();
271 UpdatePaveBlocksWithSDVertices();
277 UpdatePaveBlocksWithSDVertices();
283 UpdatePaveBlocksWithSDVertices();
284 UpdateInterfsWithSDVertices();
292 UpdateBlocksWithSharedVertices();
299 UpdatePaveBlocksWithSDVertices();
306 UpdateInterfsWithSDVertices();
307 myDS->ReleasePaveBlocks();
308 myDS->RefineFaceInfoOn();