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>
32 //=======================================================================
33 // function: NMTTools_PaveFiller::NMTTools_PaveFiller
35 //=======================================================================
36 NMTTools_PaveFiller::NMTTools_PaveFiller()
40 myIsDone=Standard_False;
44 //=======================================================================
45 // function:NMTTools_PaveFiller::NMTTools_PaveFiller
47 //=======================================================================
48 NMTTools_PaveFiller::NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP)
50 SetInterferencePool(aIP);
52 //=======================================================================
55 //=======================================================================
56 void NMTTools_PaveFiller::Destroy()
59 //=======================================================================
60 // function: SetInterferencePool
62 //=======================================================================
63 void NMTTools_PaveFiller::SetInterferencePool(const BOPTools_InterferencePool& aIP)
65 myIsDone=Standard_False;
67 myIntrPool=(BOPTools_InterferencePool*)&aIP;
68 myDS=(NMTDS_ShapesDataStructure*)myIntrPool->DS();
69 myNbSources=myDS->NumberOfShapesOfTheObject()+myDS->NumberOfShapesOfTheTool();
70 myNbEdges=myDS->NbEdges();
72 //=======================================================================
73 // function: InterfPool
75 //=======================================================================
76 BOPTools_PInterferencePool NMTTools_PaveFiller::InterfPool()
80 //=======================================================================
83 //=======================================================================
84 Standard_Boolean NMTTools_PaveFiller::IsDone() const
88 //=======================================================================
91 //=======================================================================
92 NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
96 //=======================================================================
99 //=======================================================================
100 const IntTools_Context& NMTTools_PaveFiller::Context() const
104 //=======================================================================
105 // function: ChangeContext
107 //=======================================================================
108 IntTools_Context& NMTTools_PaveFiller::ChangeContext()
112 //=======================================================================
113 // function: PavePool
115 //=======================================================================
116 const BOPTools_PavePool& NMTTools_PaveFiller::PavePool() const
120 //=======================================================================
121 // function: ChangePavePool
123 //=======================================================================
124 BOPTools_PavePool& NMTTools_PaveFiller::ChangePavePool()
128 //=======================================================================
129 // function: CommonBlockPool
131 //=======================================================================
132 const NMTTools_CommonBlockPool& NMTTools_PaveFiller::CommonBlockPool() const
134 return myCommonBlockPool;
136 //=======================================================================
137 // function: ChangeCommonBlockPool
139 //=======================================================================
140 NMTTools_CommonBlockPool& NMTTools_PaveFiller::ChangeCommonBlockPool()
142 return myCommonBlockPool;
144 //=======================================================================
145 // function: SplitShapesPool
147 //=======================================================================
148 const BOPTools_SplitShapesPool& NMTTools_PaveFiller::SplitShapesPool() const
150 return mySplitShapesPool;
153 //=======================================================================
154 // function: ChangeSplitShapesPool
156 //=======================================================================
157 BOPTools_SplitShapesPool& NMTTools_PaveFiller::ChangeSplitShapesPool()
159 return mySplitShapesPool;
161 //=======================================================================
164 //=======================================================================
165 void NMTTools_PaveFiller::Init()
168 // Modified Thu Sep 14 14:35:18 2006
169 // Contribution of Samtech www.samcef.com BEGIN
171 // Contribution of Samtech www.samcef.com END
174 //=======================================================================
177 //=======================================================================
178 void NMTTools_PaveFiller::Perform()
180 myIsDone=Standard_False;
184 // Modified Thu Sep 14 14:35:18 2006
185 // Contribution of Samtech www.samcef.com BEGIN
187 // Contribution of Samtech www.samcef.com END
191 PerformNewVertices();
194 myPavePool.Resize (myNbEdges);
204 myCommonBlockPool.Resize (myNbEdges);
205 mySplitShapesPool.Resize (myNbEdges);
206 myPavePoolNew .Resize (myNbEdges);
208 PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
209 PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
215 myPavePoolNew.Destroy();
216 myPavePoolNew.Resize (myNbEdges);
219 PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
225 myPavePoolNew.Destroy();
229 UpdateCommonBlocks();
241 NMTTools_DEProcessor aDEP(*this);
244 // Modified to treat Alone Vertices Thu Sep 14 14:35:18 2006
245 // Contribution of Samtech www.samcef.com BEGIN
247 // Contribution of Samtech www.samcef.com END
249 myIsDone=Standard_True;
251 catch (BOPTColStd_Failure& ) {