1 // Copyright (C) 2007-2010 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
23 // File: NMTTools_DSFiller.cxx
24 // Created: Fri Dec 5 14:06:34 2003
25 // Author: Peter KURNEV
28 #include <NMTTools_DSFiller.ixx>
29 #include <NMTTools_PaveFiller.hxx>
31 //=======================================================================
32 // function: NMTTools_DSFiller::NMTTools_DSFiller
34 //=======================================================================
35 NMTTools_DSFiller::NMTTools_DSFiller()
40 myIsNewFiller=Standard_True;
41 myIsDone=Standard_False;
43 //=======================================================================
46 //=======================================================================
47 void NMTTools_DSFiller::Destroy()
51 //=======================================================================
54 //=======================================================================
55 void NMTTools_DSFiller::Clear()
57 if (myPaveFiller!=NULL) {
60 if (myInterfPool!=NULL) {
70 //=======================================================================
71 // function: SetCompositeShape
73 //=======================================================================
74 void NMTTools_DSFiller::SetCompositeShape(const TopoDS_Shape& aS)
78 //=======================================================================
79 // function: CompositeShape
81 //=======================================================================
82 const TopoDS_Shape& NMTTools_DSFiller::CompositeShape()const
84 return myCompositeShape;
86 //=======================================================================
87 // function: SetNewFiller
89 //=======================================================================
90 void NMTTools_DSFiller::SetNewFiller(const Standard_Boolean aFlag) const
92 NMTTools_DSFiller* pDSFiller=(NMTTools_DSFiller*)this;
93 pDSFiller->myIsNewFiller=aFlag;
95 //=======================================================================
96 // function: IsNewFiller
98 //=======================================================================
99 Standard_Boolean NMTTools_DSFiller::IsNewFiller() const
101 return myIsNewFiller;
103 //=======================================================================
106 //=======================================================================
107 const NMTDS_ShapesDataStructure& NMTTools_DSFiller::DS () const
111 //=======================================================================
112 // function: InterfPool
114 //=======================================================================
115 const BOPTools_InterferencePool& NMTTools_DSFiller::InterfPool () const
117 return *myInterfPool;
119 //=======================================================================
122 //=======================================================================
123 Standard_Boolean NMTTools_DSFiller::IsDone()const
127 //=======================================================================
128 // function: PaveFiller
130 //=======================================================================
131 const NMTTools_PaveFiller& NMTTools_DSFiller::PaveFiller()const
133 return *myPaveFiller;
135 //=======================================================================
136 // function: ChangePaveFiller
138 //=======================================================================
139 NMTTools_PaveFiller& NMTTools_DSFiller::ChangePaveFiller()
141 return *myPaveFiller;
143 //=======================================================================
146 //=======================================================================
147 void NMTTools_DSFiller::Perform()
149 myIsDone=Standard_False;
151 if (myCompositeShape.IsNull()) {
156 // Clear contents of the DS if it was before
159 myIsNewFiller=Standard_True;
161 myDS = new NMTDS_ShapesDataStructure;
162 myDS->SetCompositeShape(myCompositeShape);
165 myInterfPool= new BOPTools_InterferencePool (*myDS);
167 myPaveFiller = new NMTTools_PaveFiller(*myInterfPool);
168 myPaveFiller->Perform();
169 myIsDone=myPaveFiller->IsDone();