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_DSFiller.cxx
21 // Created: Fri Dec 5 14:06:34 2003
22 // Author: Peter KURNEV
26 #include <NMTTools_DSFiller.ixx>
27 #include <NMTTools_PaveFiller.hxx>
29 //=======================================================================
30 // function: NMTTools_DSFiller::NMTTools_DSFiller
32 //=======================================================================
33 NMTTools_DSFiller::NMTTools_DSFiller()
38 myIsNewFiller=Standard_True;
39 myIsDone=Standard_False;
41 //=======================================================================
44 //=======================================================================
45 void NMTTools_DSFiller::Destroy()
49 //=======================================================================
52 //=======================================================================
53 void NMTTools_DSFiller::Clear()
55 if (myPaveFiller!=NULL) {
58 if (myInterfPool!=NULL) {
68 //=======================================================================
69 // function: SetCompositeShape
71 //=======================================================================
72 void NMTTools_DSFiller::SetCompositeShape(const TopoDS_Shape& aS)
76 //=======================================================================
77 // function: CompositeShape
79 //=======================================================================
80 const TopoDS_Shape& NMTTools_DSFiller::CompositeShape()const
82 return myCompositeShape;
84 //=======================================================================
85 // function: SetNewFiller
87 //=======================================================================
88 void NMTTools_DSFiller::SetNewFiller(const Standard_Boolean aFlag) const
90 NMTTools_DSFiller* pDSFiller=(NMTTools_DSFiller*)this;
91 pDSFiller->myIsNewFiller=aFlag;
93 //=======================================================================
94 // function: IsNewFiller
96 //=======================================================================
97 Standard_Boolean NMTTools_DSFiller::IsNewFiller() const
101 //=======================================================================
104 //=======================================================================
105 const NMTDS_ShapesDataStructure& NMTTools_DSFiller::DS () const
109 //=======================================================================
110 // function: InterfPool
112 //=======================================================================
113 const BOPTools_InterferencePool& NMTTools_DSFiller::InterfPool () const
115 return *myInterfPool;
117 //=======================================================================
120 //=======================================================================
121 Standard_Boolean NMTTools_DSFiller::IsDone()const
125 //=======================================================================
126 // function: PaveFiller
128 //=======================================================================
129 const NMTTools_PaveFiller& NMTTools_DSFiller::PaveFiller()const
131 return *myPaveFiller;
133 //=======================================================================
134 // function: ChangePaveFiller
136 //=======================================================================
137 NMTTools_PaveFiller& NMTTools_DSFiller::ChangePaveFiller()
139 return *myPaveFiller;
141 //=======================================================================
144 //=======================================================================
145 void NMTTools_DSFiller::Perform()
147 myIsDone=Standard_False;
149 if (myCompositeShape.IsNull()) {
154 // Clear contents of the DS if it was before
157 myIsNewFiller=Standard_True;
159 myDS = new NMTDS_ShapesDataStructure;
160 myDS->SetCompositeShape(myCompositeShape);
163 myInterfPool= new BOPTools_InterferencePool (*myDS);
165 myPaveFiller = new NMTTools_PaveFiller(*myInterfPool);
166 myPaveFiller->Perform();
167 myIsDone=myPaveFiller->IsDone();