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_DSFiller.cxx
23 // Created: Fri Dec 5 14:06:34 2003
24 // Author: Peter KURNEV
27 #include <NMTTools_DSFiller.ixx>
28 #include <NMTTools_PaveFiller.hxx>
30 //=======================================================================
31 // function: NMTTools_DSFiller::NMTTools_DSFiller
33 //=======================================================================
34 NMTTools_DSFiller::NMTTools_DSFiller()
39 myIsNewFiller=Standard_True;
40 myIsDone=Standard_False;
42 //=======================================================================
45 //=======================================================================
46 void NMTTools_DSFiller::Destroy()
50 //=======================================================================
53 //=======================================================================
54 void NMTTools_DSFiller::Clear()
56 if (myPaveFiller!=NULL) {
59 if (myInterfPool!=NULL) {
69 //=======================================================================
70 // function: SetCompositeShape
72 //=======================================================================
73 void NMTTools_DSFiller::SetCompositeShape(const TopoDS_Shape& aS)
77 //=======================================================================
78 // function: CompositeShape
80 //=======================================================================
81 const TopoDS_Shape& NMTTools_DSFiller::CompositeShape()const
83 return myCompositeShape;
85 //=======================================================================
86 // function: SetNewFiller
88 //=======================================================================
89 void NMTTools_DSFiller::SetNewFiller(const Standard_Boolean aFlag) const
91 NMTTools_DSFiller* pDSFiller=(NMTTools_DSFiller*)this;
92 pDSFiller->myIsNewFiller=aFlag;
94 //=======================================================================
95 // function: IsNewFiller
97 //=======================================================================
98 Standard_Boolean NMTTools_DSFiller::IsNewFiller() const
100 return myIsNewFiller;
102 //=======================================================================
105 //=======================================================================
106 const NMTDS_ShapesDataStructure& NMTTools_DSFiller::DS () const
110 //=======================================================================
111 // function: InterfPool
113 //=======================================================================
114 const BOPTools_InterferencePool& NMTTools_DSFiller::InterfPool () const
116 return *myInterfPool;
118 //=======================================================================
121 //=======================================================================
122 Standard_Boolean NMTTools_DSFiller::IsDone()const
126 //=======================================================================
127 // function: PaveFiller
129 //=======================================================================
130 const NMTTools_PaveFiller& NMTTools_DSFiller::PaveFiller()const
132 return *myPaveFiller;
134 //=======================================================================
135 // function: ChangePaveFiller
137 //=======================================================================
138 NMTTools_PaveFiller& NMTTools_DSFiller::ChangePaveFiller()
140 return *myPaveFiller;
142 //=======================================================================
145 //=======================================================================
146 void NMTTools_DSFiller::Perform()
148 myIsDone=Standard_False;
150 if (myCompositeShape.IsNull()) {
155 // Clear contents of the DS if it was before
158 myIsNewFiller=Standard_True;
160 myDS = new NMTDS_ShapesDataStructure;
161 myDS->SetCompositeShape(myCompositeShape);
164 myInterfPool= new BOPTools_InterferencePool (*myDS);
166 myPaveFiller = new NMTTools_PaveFiller(*myInterfPool);
167 myPaveFiller->Perform();
168 myIsDone=myPaveFiller->IsDone();