1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: NMTTools_PaveFiller.cxx
24 // Created: Fri Dec 5 14:58:54 2003
25 // Author: Peter KURNEV
28 #include <NMTTools_PaveFiller.hxx>
30 #include <BOPTColStd_Failure.hxx>
31 #include <IntTools_Context.hxx>
32 #include <NMTDS_ShapesDataStructure.hxx>
33 #include <NMTTools_DEProcessor.hxx>
34 #include <NMTDS_Iterator.hxx>
35 #include <NMTDS_InterfPool.hxx>
37 //=======================================================================
38 // function: NMTTools_PaveFiller::NMTTools_PaveFiller
40 //=======================================================================
41 NMTTools_PaveFiller::NMTTools_PaveFiller()
45 myIsDone=Standard_False;
50 //=======================================================================
53 //=======================================================================
54 NMTTools_PaveFiller::~NMTTools_PaveFiller()
58 //=======================================================================
61 //=======================================================================
62 void NMTTools_PaveFiller::Clear()
78 //=======================================================================
79 // function: SetCompositeShape
81 //=======================================================================
82 void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS)
86 //=======================================================================
87 // function: CompositeShape
89 //=======================================================================
90 const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const
92 return myCompositeShape;
94 //=======================================================================
97 //=======================================================================
98 NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
102 //=======================================================================
105 //=======================================================================
106 NMTDS_PIterator NMTTools_PaveFiller::DSIt()
110 //=======================================================================
113 //=======================================================================
114 NMTDS_PInterfPool NMTTools_PaveFiller::IP()
118 //=======================================================================
121 //=======================================================================
122 Standard_Boolean NMTTools_PaveFiller::IsDone() const
126 //=======================================================================
129 //=======================================================================
130 const Handle(IntTools_Context)& NMTTools_PaveFiller::Context() const
134 //=======================================================================
135 // function: PavePool
137 //=======================================================================
138 const BOPTools_PavePool& NMTTools_PaveFiller::PavePool() const
142 //=======================================================================
143 // function: ChangePavePool
145 //=======================================================================
146 BOPTools_PavePool& NMTTools_PaveFiller::ChangePavePool()
150 //=======================================================================
151 // function: ChangePavePoolNew
153 //=======================================================================
154 BOPTools_PavePool& NMTTools_PaveFiller::ChangePavePoolNew()
156 return myPavePoolNew;
158 //=======================================================================
159 // function: CommonBlockPool
161 //=======================================================================
162 const NMTTools_CommonBlockPool& NMTTools_PaveFiller::CommonBlockPool() const
164 return myCommonBlockPool;
166 //=======================================================================
167 // function: ChangeCommonBlockPool
169 //=======================================================================
170 NMTTools_CommonBlockPool& NMTTools_PaveFiller::ChangeCommonBlockPool()
172 return myCommonBlockPool;
174 //=======================================================================
175 // function: SplitShapesPool
177 //=======================================================================
178 const BOPTools_SplitShapesPool& NMTTools_PaveFiller::SplitShapesPool() const
180 return mySplitShapesPool;
182 //=======================================================================
183 // function: ChangeSplitShapesPool
185 //=======================================================================
186 BOPTools_SplitShapesPool& NMTTools_PaveFiller::ChangeSplitShapesPool()
188 return mySplitShapesPool;
190 //=======================================================================
193 //=======================================================================
194 void NMTTools_PaveFiller::Init()
196 myIsDone=Standard_False;
197 if (myCompositeShape.IsNull()) {
203 myDS=new NMTDS_ShapesDataStructure;
204 myDS->SetCompositeShape(myCompositeShape);
208 myDSIt=new NMTDS_Iterator;
213 myNbSources=myDS->NumberOfShapesOfTheObject()+
214 myDS->NumberOfShapesOfTheTool();
215 myNbEdges=myDS->NbEdges();
218 myIP=new NMTDS_InterfPool;
221 myContext=new IntTools_Context;
224 //=======================================================================
227 //=======================================================================
228 void NMTTools_PaveFiller::Perform()
230 myIsDone=Standard_False;
241 myPavePool.Resize (myNbEdges);
251 myCommonBlockPool.Resize (myNbEdges);
252 mySplitShapesPool.Resize (myNbEdges);
253 myPavePoolNew .Resize (myNbEdges);
255 PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
256 PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
262 myPavePoolNew.Destroy();
263 myPavePoolNew.Resize (myNbEdges);
265 //modified by NIZNHY-PKV Mon Dec 12 09:13:53 2011f
266 UpdateCommonBlocks(0);
267 //modified by NIZNHY-PKV Mon Dec 12 09:13:56 2011t
270 PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
275 myPavePoolNew.Destroy();
279 UpdateCommonBlocks();
291 NMTTools_DEProcessor aDEP(*this);
296 //modified by NIZNHY-PKV Mon Dec 12 09:14:23 2011f
298 //modified by NIZNHY-PKV Mon Dec 12 09:14:27 2011t
299 myIsDone=Standard_True;
301 catch (BOPTColStd_Failure& ) {