1 // Copyright (C) 2007-2008 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
27 #include <NMTTools_PaveFiller.ixx>
29 #include <BOPTColStd_Failure.hxx>
30 #include <NMTDS_ShapesDataStructure.hxx>
31 #include <NMTTools_DEProcessor.hxx>
32 #include <NMTDS_Iterator.hxx>
33 #include <NMTDS_InterfPool.hxx>
35 //=======================================================================
36 // function: NMTTools_PaveFiller::NMTTools_PaveFiller
38 //=======================================================================
39 NMTTools_PaveFiller::NMTTools_PaveFiller()
43 myIsDone=Standard_False;
48 //=======================================================================
51 //=======================================================================
52 NMTTools_PaveFiller::~NMTTools_PaveFiller()
56 //=======================================================================
59 //=======================================================================
60 void NMTTools_PaveFiller::Clear()
76 //=======================================================================
77 // function: SetCompositeShape
79 //=======================================================================
80 void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS)
84 //=======================================================================
85 // function: CompositeShape
87 //=======================================================================
88 const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const
90 return myCompositeShape;
92 //=======================================================================
95 //=======================================================================
96 NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
100 //=======================================================================
103 //=======================================================================
104 NMTDS_PIterator NMTTools_PaveFiller::DSIt()
108 //=======================================================================
111 //=======================================================================
112 NMTDS_PInterfPool NMTTools_PaveFiller::IP()
116 //=======================================================================
119 //=======================================================================
120 Standard_Boolean NMTTools_PaveFiller::IsDone() const
124 //=======================================================================
127 //=======================================================================
128 const IntTools_Context& NMTTools_PaveFiller::Context() const
132 //=======================================================================
133 // function: ChangeContext
135 //=======================================================================
136 IntTools_Context& NMTTools_PaveFiller::ChangeContext()
140 //=======================================================================
141 // function: PavePool
143 //=======================================================================
144 const BOPTools_PavePool& NMTTools_PaveFiller::PavePool() const
148 //=======================================================================
149 // function: ChangePavePool
151 //=======================================================================
152 BOPTools_PavePool& NMTTools_PaveFiller::ChangePavePool()
156 //=======================================================================
157 // function: CommonBlockPool
159 //=======================================================================
160 const NMTTools_CommonBlockPool& NMTTools_PaveFiller::CommonBlockPool() const
162 return myCommonBlockPool;
164 //=======================================================================
165 // function: ChangeCommonBlockPool
167 //=======================================================================
168 NMTTools_CommonBlockPool& NMTTools_PaveFiller::ChangeCommonBlockPool()
170 return myCommonBlockPool;
172 //=======================================================================
173 // function: SplitShapesPool
175 //=======================================================================
176 const BOPTools_SplitShapesPool& NMTTools_PaveFiller::SplitShapesPool() const
178 return mySplitShapesPool;
180 //=======================================================================
181 // function: ChangeSplitShapesPool
183 //=======================================================================
184 BOPTools_SplitShapesPool& NMTTools_PaveFiller::ChangeSplitShapesPool()
186 return mySplitShapesPool;
188 //=======================================================================
191 //=======================================================================
192 void NMTTools_PaveFiller::Init()
194 myIsDone=Standard_False;
195 if (myCompositeShape.IsNull()) {
201 myDS=new NMTDS_ShapesDataStructure;
202 myDS->SetCompositeShape(myCompositeShape);
206 myDSIt=new NMTDS_Iterator;
211 myNbSources=myDS->NumberOfShapesOfTheObject()+
212 myDS->NumberOfShapesOfTheTool();
213 myNbEdges=myDS->NbEdges();
216 myIP=new NMTDS_InterfPool;
219 //=======================================================================
222 //=======================================================================
223 void NMTTools_PaveFiller::Perform()
225 myIsDone=Standard_False;
230 // Modified Thu Sep 14 14:35:18 2006
231 // Contribution of Samtech www.samcef.com BEGIN
233 // Contribution of Samtech www.samcef.com END
239 myPavePool.Resize (myNbEdges);
249 myCommonBlockPool.Resize (myNbEdges);
250 mySplitShapesPool.Resize (myNbEdges);
251 myPavePoolNew .Resize (myNbEdges);
253 PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
254 PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
260 myPavePoolNew.Destroy();
261 myPavePoolNew.Resize (myNbEdges);
264 PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
269 myPavePoolNew.Destroy();
273 UpdateCommonBlocks();
285 NMTTools_DEProcessor aDEP(*this);
288 // Modified to treat Alone Vertices Thu Sep 14 14:35:18 2006
289 // Contribution of Samtech www.samcef.com BEGIN
291 // Contribution of Samtech www.samcef.com END
293 myIsDone=Standard_True;
295 catch (BOPTColStd_Failure& ) {