]> SALOME platform Git repositories - modules/geom.git/blob - src/NMTTools/NMTTools_CheckerSI.cxx
Salome HOME
rollback IPAL8963 3.0.0: "Incorrect input data" message
[modules/geom.git] / src / NMTTools / NMTTools_CheckerSI.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File:        NMTTools_CheckerSI.cxx
23 // Created:     Mon Feb 19 11:32:08 2007
24 // Author:      Peter KURNEV
25 //              <pkv@irinox>
26 //
27 #include <NMTTools_CheckerSI.ixx>
28
29 #include <NMTDS_ShapesDataStructure.hxx>
30 #include <NMTDS_IteratorCheckerSI.hxx>
31 #include <NMTDS_InterfPool.hxx>
32 #include <NMTTools_DEProcessor.hxx>
33
34 //=======================================================================
35 //function : 
36 //purpose  : 
37 //=======================================================================
38   NMTTools_CheckerSI::NMTTools_CheckerSI()
39 :
40   NMTTools_PaveFiller()
41 {
42   myStopStatus=0;
43 }
44 //=======================================================================
45 //function : ~
46 //purpose  : 
47 //=======================================================================
48   NMTTools_CheckerSI::~NMTTools_CheckerSI()
49 {
50 }
51 //=======================================================================
52 //function : Clear
53 //purpose  : 
54 //=======================================================================
55   void NMTTools_CheckerSI::Clear()
56 {
57   NMTTools_PaveFiller::Clear();
58 }
59 //=======================================================================
60 //function : StopStatus
61 //purpose  : 
62 //=======================================================================
63   Standard_Integer NMTTools_CheckerSI::StopStatus()const
64 {
65   return myStopStatus;
66 }
67 //=======================================================================
68 //function : Init
69 //purpose  : 
70 //=======================================================================
71   void NMTTools_CheckerSI::Init()
72 {
73   myIsDone=Standard_False;
74   if (myCompositeShape.IsNull()) {
75     return;
76   }
77   //
78   Clear();
79   // 1.
80   myDS=new NMTDS_ShapesDataStructure;
81   myDS->SetCompositeShape(myCompositeShape);
82   myDS->Init();
83   //
84   // 2.
85   myDSIt=new NMTDS_IteratorCheckerSI;
86   myDSIt->SetDS(myDS);
87   myDSIt->Prepare();
88   //
89   // 4.
90   myNbSources=myDS->NumberOfShapesOfTheObject()+
91               myDS->NumberOfShapesOfTheTool();
92   myNbEdges=myDS->NbEdges();
93   // 5
94   myIP=new NMTDS_InterfPool;
95 }
96 //=======================================================================
97 //function : Perform
98 //purpose  : 
99 //=======================================================================
100   void NMTTools_CheckerSI::Perform()
101 {
102   myIsDone=Standard_False;
103   myStopStatus=0;
104   //
105   Init();
106   //1.VV
107   //
108   PerformVV();
109   //
110   // 2.VE
111   myPavePool.Resize (myNbEdges);
112
113   PrepareEdges();
114   //
115   PerformVE();
116   //
117   // 3.VF
118   PerformVF();
119   //
120   // 4.EE
121   myCommonBlockPool.Resize (myNbEdges);
122   mySplitShapesPool.Resize (myNbEdges);
123   myPavePoolNew    .Resize (myNbEdges);
124   //
125   PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
126   if (myStopStatus) {
127     return;
128   }
129   PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
130   if (myStopStatus) {
131     return;
132   }
133   //
134   PerformEE();
135   //
136   RefinePavePool ();
137   if (myStopStatus) {
138     return;
139   }
140   //
141   myPavePoolNew.Destroy();
142   myPavePoolNew.Resize (myNbEdges);
143   //
144   // 5.EF
145   PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
146   if (myStopStatus) {
147     return;
148   }
149   //
150   PerformEF();
151   //
152   RefinePavePool();
153   if (myStopStatus) {
154     return;
155   }
156   //
157   myPavePoolNew.Destroy();
158   //
159   MakeSplitEdges();
160   //
161   UpdateCommonBlocks();
162   //
163   // 6. FF
164   PerformFF ();
165   //
166   MakeBlocks();
167   //
168   MakePCurves();
169   //
170   // 7. Postprocessing 
171   UpdatePaveBlocks();
172   //
173   NMTTools_DEProcessor aDEP(*this);
174   aDEP.Do();
175   //
176   MakeAloneVertices();
177   //
178   myIsDone=Standard_True;
179 }