1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: NMTTools_PaveFiller.cxx
21 // Created: Fri Dec 5 14:58:54 2003
22 // Author: Peter KURNEV
25 #include <NMTTools_PaveFiller.ixx>
27 #include <BOPTColStd_Failure.hxx>
28 #include <NMTDS_ShapesDataStructure.hxx>
29 #include <NMTTools_DEProcessor.hxx>
30 #include <NMTDS_Iterator.hxx>
31 #include <NMTDS_InterfPool.hxx>
33 //=======================================================================
34 // function: NMTTools_PaveFiller::NMTTools_PaveFiller
36 //=======================================================================
37 NMTTools_PaveFiller::NMTTools_PaveFiller()
41 myIsDone=Standard_False;
46 //=======================================================================
49 //=======================================================================
50 NMTTools_PaveFiller::~NMTTools_PaveFiller()
54 //=======================================================================
57 //=======================================================================
58 void NMTTools_PaveFiller::Clear()
74 //=======================================================================
75 // function: SetCompositeShape
77 //=======================================================================
78 void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS)
82 //=======================================================================
83 // function: CompositeShape
85 //=======================================================================
86 const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const
88 return myCompositeShape;
90 //=======================================================================
93 //=======================================================================
94 NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
98 //=======================================================================
101 //=======================================================================
102 NMTDS_PIterator NMTTools_PaveFiller::DSIt()
106 //=======================================================================
109 //=======================================================================
110 NMTDS_PInterfPool NMTTools_PaveFiller::IP()
114 //=======================================================================
117 //=======================================================================
118 Standard_Boolean NMTTools_PaveFiller::IsDone() const
122 //=======================================================================
125 //=======================================================================
126 const IntTools_Context& NMTTools_PaveFiller::Context() const
130 //=======================================================================
131 // function: ChangeContext
133 //=======================================================================
134 IntTools_Context& NMTTools_PaveFiller::ChangeContext()
138 //=======================================================================
139 // function: PavePool
141 //=======================================================================
142 const BOPTools_PavePool& NMTTools_PaveFiller::PavePool() const
146 //=======================================================================
147 // function: ChangePavePool
149 //=======================================================================
150 BOPTools_PavePool& NMTTools_PaveFiller::ChangePavePool()
154 //=======================================================================
155 // function: CommonBlockPool
157 //=======================================================================
158 const NMTTools_CommonBlockPool& NMTTools_PaveFiller::CommonBlockPool() const
160 return myCommonBlockPool;
162 //=======================================================================
163 // function: ChangeCommonBlockPool
165 //=======================================================================
166 NMTTools_CommonBlockPool& NMTTools_PaveFiller::ChangeCommonBlockPool()
168 return myCommonBlockPool;
170 //=======================================================================
171 // function: SplitShapesPool
173 //=======================================================================
174 const BOPTools_SplitShapesPool& NMTTools_PaveFiller::SplitShapesPool() const
176 return mySplitShapesPool;
178 //=======================================================================
179 // function: ChangeSplitShapesPool
181 //=======================================================================
182 BOPTools_SplitShapesPool& NMTTools_PaveFiller::ChangeSplitShapesPool()
184 return mySplitShapesPool;
186 //=======================================================================
189 //=======================================================================
190 void NMTTools_PaveFiller::Init()
192 myIsDone=Standard_False;
193 if (myCompositeShape.IsNull()) {
199 myDS=new NMTDS_ShapesDataStructure;
200 myDS->SetCompositeShape(myCompositeShape);
204 myDSIt=new NMTDS_Iterator;
209 myNbSources=myDS->NumberOfShapesOfTheObject()+
210 myDS->NumberOfShapesOfTheTool();
211 myNbEdges=myDS->NbEdges();
214 myIP=new NMTDS_InterfPool;
217 //=======================================================================
220 //=======================================================================
221 void NMTTools_PaveFiller::Perform()
223 myIsDone=Standard_False;
228 // Modified Thu Sep 14 14:35:18 2006
229 // Contribution of Samtech www.samcef.com BEGIN
231 // Contribution of Samtech www.samcef.com END
237 myPavePool.Resize (myNbEdges);
247 myCommonBlockPool.Resize (myNbEdges);
248 mySplitShapesPool.Resize (myNbEdges);
249 myPavePoolNew .Resize (myNbEdges);
251 PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
252 PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
258 myPavePoolNew.Destroy();
259 myPavePoolNew.Resize (myNbEdges);
262 PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
267 myPavePoolNew.Destroy();
271 UpdateCommonBlocks();
283 NMTTools_DEProcessor aDEP(*this);
286 // Modified to treat Alone Vertices Thu Sep 14 14:35:18 2006
287 // Contribution of Samtech www.samcef.com BEGIN
289 // Contribution of Samtech www.samcef.com END
291 myIsDone=Standard_True;
293 catch (BOPTColStd_Failure& ) {