1 // Copyright (C) 2007-2011 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
22 // File: NMTTools_PaveFiller.cxx
23 // Created: Fri Dec 5 14:58:54 2003
24 // Author: Peter KURNEV
26 #include <NMTTools_PaveFiller.ixx>
28 #include <Basics_OCCTVersion.hxx>
30 #include <NMTTools_DEProcessor.hxx>
32 #include <NMTDS_ShapesDataStructure.hxx>
33 #include <NMTDS_Iterator.hxx>
34 #include <NMTDS_InterfPool.hxx>
36 #include <BOPTColStd_Failure.hxx>
38 //=======================================================================
39 // function: NMTTools_PaveFiller::NMTTools_PaveFiller
41 //=======================================================================
42 NMTTools_PaveFiller::NMTTools_PaveFiller()
46 myIsDone=Standard_False;
51 //=======================================================================
54 //=======================================================================
55 NMTTools_PaveFiller::~NMTTools_PaveFiller()
59 //=======================================================================
62 //=======================================================================
63 void NMTTools_PaveFiller::Clear()
79 //=======================================================================
80 // function: SetCompositeShape
82 //=======================================================================
83 void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS)
87 //=======================================================================
88 // function: CompositeShape
90 //=======================================================================
91 const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const
93 return myCompositeShape;
95 //=======================================================================
98 //=======================================================================
99 NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
103 //=======================================================================
106 //=======================================================================
107 NMTDS_PIterator NMTTools_PaveFiller::DSIt()
111 //=======================================================================
114 //=======================================================================
115 NMTDS_PInterfPool NMTTools_PaveFiller::IP()
119 //=======================================================================
122 //=======================================================================
123 Standard_Boolean NMTTools_PaveFiller::IsDone() const
127 //=======================================================================
130 //=======================================================================
131 #if OCC_VERSION_LARGE > 0x06050200
132 const Handle(IntTools_Context)& NMTTools_PaveFiller::Context() const
134 const IntTools_Context& NMTTools_PaveFiller::Context() const
140 #if OCC_VERSION_LARGE <= 0x06050200
141 //=======================================================================
142 // function: ChangeContext
144 //=======================================================================
145 IntTools_Context& NMTTools_PaveFiller::ChangeContext()
151 //=======================================================================
152 // function: PavePool
154 //=======================================================================
155 const BOPTools_PavePool& NMTTools_PaveFiller::PavePool() const
159 //=======================================================================
160 // function: ChangePavePool
162 //=======================================================================
163 BOPTools_PavePool& NMTTools_PaveFiller::ChangePavePool()
167 //=======================================================================
168 // function: ChangePavePoolNew
170 //=======================================================================
171 BOPTools_PavePool& NMTTools_PaveFiller::ChangePavePoolNew()
173 return myPavePoolNew;
175 //=======================================================================
176 // function: CommonBlockPool
178 //=======================================================================
179 const NMTTools_CommonBlockPool& NMTTools_PaveFiller::CommonBlockPool() const
181 return myCommonBlockPool;
183 //=======================================================================
184 // function: ChangeCommonBlockPool
186 //=======================================================================
187 NMTTools_CommonBlockPool& NMTTools_PaveFiller::ChangeCommonBlockPool()
189 return myCommonBlockPool;
191 //=======================================================================
192 // function: SplitShapesPool
194 //=======================================================================
195 const BOPTools_SplitShapesPool& NMTTools_PaveFiller::SplitShapesPool() const
197 return mySplitShapesPool;
199 //=======================================================================
200 // function: ChangeSplitShapesPool
202 //=======================================================================
203 BOPTools_SplitShapesPool& NMTTools_PaveFiller::ChangeSplitShapesPool()
205 return mySplitShapesPool;
207 //=======================================================================
210 //=======================================================================
211 void NMTTools_PaveFiller::Init()
213 myIsDone=Standard_False;
214 if (myCompositeShape.IsNull()) {
220 myDS=new NMTDS_ShapesDataStructure;
221 myDS->SetCompositeShape(myCompositeShape);
225 myDSIt=new NMTDS_Iterator;
230 myNbSources=myDS->NumberOfShapesOfTheObject()+
231 myDS->NumberOfShapesOfTheTool();
232 myNbEdges=myDS->NbEdges();
235 myIP=new NMTDS_InterfPool;
236 #if OCC_VERSION_LARGE > 0x06050200
239 myContext=new IntTools_Context;
243 //=======================================================================
246 //=======================================================================
247 void NMTTools_PaveFiller::Perform()
249 myIsDone=Standard_False;
260 myPavePool.Resize (myNbEdges);
270 myCommonBlockPool.Resize (myNbEdges);
271 mySplitShapesPool.Resize (myNbEdges);
272 myPavePoolNew .Resize (myNbEdges);
274 PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
275 PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
281 myPavePoolNew.Destroy();
282 myPavePoolNew.Resize (myNbEdges);
284 //modified by NIZNHY-PKV Mon Dec 12 09:13:53 2011f
285 UpdateCommonBlocks(0);
286 //modified by NIZNHY-PKV Mon Dec 12 09:13:56 2011t
289 PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
294 myPavePoolNew.Destroy();
298 UpdateCommonBlocks();
310 NMTTools_DEProcessor aDEP(*this);
315 //modified by NIZNHY-PKV Mon Dec 12 09:14:23 2011f
317 //modified by NIZNHY-PKV Mon Dec 12 09:14:27 2011t
318 myIsDone=Standard_True;
320 catch (BOPTColStd_Failure& ) {