Salome HOME
c3587312fbc380eea48880a365802aa0689715bb
[modules/geom.git] / src / NMTTools / NMTTools_DEProcessor.hxx
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 #ifndef _NMTTools_DEProcessor_HeaderFile
23 #define _NMTTools_DEProcessor_HeaderFile
24
25 #ifndef _NMTTools_PPaveFiller_HeaderFile
26 #include <NMTTools_PPaveFiller.hxx>
27 #endif
28 #ifndef _NMTDS_PShapesDataStructure_HeaderFile
29 #include <NMTDS_PShapesDataStructure.hxx>
30 #endif
31 #ifndef _Standard_Boolean_HeaderFile
32 #include <Standard_Boolean.hxx>
33 #endif
34 #ifndef _BOPTools_IndexedDataMapOfIntegerDEInfo_HeaderFile
35 #include <BOPTools_IndexedDataMapOfIntegerDEInfo.hxx>
36 #endif
37 #ifndef _Standard_Integer_HeaderFile
38 #include <Standard_Integer.hxx>
39 #endif
40 #ifndef _Standard_Real_HeaderFile
41 #include <Standard_Real.hxx>
42 #endif
43 class NMTTools_PaveFiller;
44 class BOPTools_ListOfPaveBlock;
45 class TopoDS_Edge;
46 class TopoDS_Face;
47 class TopoDS_Vertex;
48
49
50 #ifndef _Standard_HeaderFile
51 #include <Standard.hxx>
52 #endif
53 #ifndef _Standard_Macro_HeaderFile
54 #include <Standard_Macro.hxx>
55 #endif
56
57
58 //! <br>
59 //!  The  Algorithm to compute and store in interferences' pool <br>
60 //! and in the Data  Structure  the following values <br>
61 //! for degenerated edges <br>
62 //!         1.  Paves/Pave set(s) <br>
63 //!         2.  Split parts <br>
64 //!         3.  States (3D) for split parts <br>
65 //! <br>
66 class NMTTools_DEProcessor  {
67
68 public:
69
70     void* operator new(size_t,void* anAddress) 
71       {
72         return anAddress;
73       }
74     void* operator new(size_t size) 
75       { 
76         return Standard::Allocate(size); 
77       }
78     void  operator delete(void *anAddress) 
79       { 
80         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
81       }
82  // Methods PUBLIC
83  // 
84
85
86 //! Constructor <br>
87 //! <br>
88 //! Constructor <br>
89 //! <br>
90 Standard_EXPORT NMTTools_DEProcessor(NMTTools_PaveFiller& aFiller);
91
92
93 //! Launches the processor <br>
94 Standard_EXPORT   void Do() ;
95
96
97 //! Returns TRUE if it is Ok <br>
98 Standard_EXPORT   Standard_Boolean IsDone() const;
99
100
101
102
103
104 protected:
105
106  // Methods PROTECTED
107  // 
108
109
110 Standard_EXPORT   void FindDegeneratedEdges() ;
111
112
113 Standard_EXPORT   void DoPaves() ;
114
115
116 Standard_EXPORT   void FindPaveBlocks(const Standard_Integer nED,const Standard_Integer nVD,const Standard_Integer nFD,BOPTools_ListOfPaveBlock& aLPB) ;
117
118
119 Standard_EXPORT   void FillPaveSet(const Standard_Integer nED,const Standard_Integer nVD,const Standard_Integer nFD,const BOPTools_ListOfPaveBlock& aLPB) ;
120
121
122 Standard_EXPORT   void FillSplitEdgesPool(const Standard_Integer nED) ;
123
124
125 Standard_EXPORT   void MakeSplitEdges(const Standard_Integer nED,const Standard_Integer nFD) ;
126
127
128 Standard_EXPORT   void MakeSplitEdge(const TopoDS_Edge& aS1,const TopoDS_Face& aF,const TopoDS_Vertex& aV1,const Standard_Real aP1,const TopoDS_Vertex& aV2,const Standard_Real aP2,TopoDS_Edge& aNewEdge) ;
129
130
131  // Fields PROTECTED
132  //
133 NMTTools_PPaveFiller myFiller;
134 NMTDS_PShapesDataStructure myDS;
135 Standard_Boolean myIsDone;
136 BOPTools_IndexedDataMapOfIntegerDEInfo myDEMap;
137
138
139 private: 
140
141  // Methods PRIVATE
142  // 
143
144
145  // Fields PRIVATE
146  //
147
148
149 };
150
151
152
153
154
155 // other Inline functions and methods (like "C++: function call" methods)
156 //
157
158
159 #endif