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 myGlue=BOPAlgo_GlueOff;
48 //=======================================================================
51 //=======================================================================
52 BOPAlgo_PaveFiller::BOPAlgo_PaveFiller
53 (const Handle(NCollection_BaseAllocator)& theAllocator)
55 BOPAlgo_Algo(theAllocator)
59 myNonDestructive=Standard_False;
60 myIsPrimary=Standard_True;
61 myGlue=BOPAlgo_GlueOff;
63 //=======================================================================
66 //=======================================================================
67 BOPAlgo_PaveFiller::~BOPAlgo_PaveFiller()
71 //=======================================================================
72 //function : SetNonDestructive
74 //=======================================================================
75 void BOPAlgo_PaveFiller::SetNonDestructive(const Standard_Boolean bFlag)
77 myNonDestructive=bFlag;
79 //=======================================================================
80 //function : NonDestructive
82 //=======================================================================
83 Standard_Boolean BOPAlgo_PaveFiller::NonDestructive()const
85 return myNonDestructive;
87 //=======================================================================
90 //=======================================================================
91 void BOPAlgo_PaveFiller::SetGlue(const BOPAlgo_GlueEnum theGlue)
95 //=======================================================================
98 //=======================================================================
99 BOPAlgo_GlueEnum BOPAlgo_PaveFiller::Glue() const
103 //=======================================================================
104 //function : SetIsPrimary
106 //=======================================================================
107 void BOPAlgo_PaveFiller::SetIsPrimary(const Standard_Boolean bFlag)
111 //=======================================================================
112 //function : IsPrimary
114 //=======================================================================
115 Standard_Boolean BOPAlgo_PaveFiller::IsPrimary()const
119 //=======================================================================
122 //=======================================================================
123 void BOPAlgo_PaveFiller::Clear()
134 //=======================================================================
137 //=======================================================================
138 const BOPDS_DS& BOPAlgo_PaveFiller::DS()
142 //=======================================================================
145 //=======================================================================
146 BOPDS_PDS BOPAlgo_PaveFiller::PDS()
150 //=======================================================================
153 //=======================================================================
154 const Handle(IntTools_Context)& BOPAlgo_PaveFiller::Context()
158 //=======================================================================
159 //function : SectionAttribute
161 //=======================================================================
162 void BOPAlgo_PaveFiller::SetSectionAttribute
163 (const BOPAlgo_SectionAttribute& theSecAttr)
165 mySectionAttribute = theSecAttr;
167 //=======================================================================
168 //function : SetArguments
170 //=======================================================================
171 void BOPAlgo_PaveFiller::SetArguments(const BOPCol_ListOfShape& theLS)
175 //=======================================================================
176 //function : Arguments
178 //=======================================================================
179 const BOPCol_ListOfShape& BOPAlgo_PaveFiller::Arguments()const
183 //=======================================================================
186 //=======================================================================
187 void BOPAlgo_PaveFiller::Init()
191 if (!myArguments.Extent()) {
200 myDS=new BOPDS_DS(myAllocator);
201 myDS->SetArguments(myArguments);
202 myDS->Init(myFuzzyValue);
205 myIterator=new BOPDS_Iterator(myAllocator);
206 myIterator->SetRunParallel(myRunParallel);
207 myIterator->SetDS(myDS);
208 myIterator->Prepare();
211 myContext=new IntTools_Context;
213 // 4 NonDestructive flag
218 //=======================================================================
221 //=======================================================================
222 void BOPAlgo_PaveFiller::Perform()
231 catch (Standard_Failure) {
235 //=======================================================================
236 // function: PerformInternal
238 //=======================================================================
239 void BOPAlgo_PaveFiller::PerformInternal()
263 UpdatePaveBlocksWithSDVertices();
264 myDS->UpdatePaveBlocks();
270 UpdatePaveBlocksWithSDVertices();
276 UpdatePaveBlocksWithSDVertices();
282 UpdatePaveBlocksWithSDVertices();
290 UpdateBlocksWithSharedVertices();
297 UpdatePaveBlocksWithSDVertices();
316 if (myGlue != BOPAlgo_GlueOff) {