Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_FinderShapeOn1.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 _GEOMAlgo_FinderShapeOn1_HeaderFile
23 #define _GEOMAlgo_FinderShapeOn1_HeaderFile
24
25 #ifndef _Handle_Geom_Surface_HeaderFile
26 #include <Handle_Geom_Surface.hxx>
27 #endif
28 #ifndef _TopAbs_ShapeEnum_HeaderFile
29 #include <TopAbs_ShapeEnum.hxx>
30 #endif
31 #ifndef _GEOMAlgo_State_HeaderFile
32 #include <GEOMAlgo_State.hxx>
33 #endif
34 #ifndef _Standard_Integer_HeaderFile
35 #include <Standard_Integer.hxx>
36 #endif
37 #ifndef _GeomAdaptor_Surface_HeaderFile
38 #include <GeomAdaptor_Surface.hxx>
39 #endif
40 #ifndef _TopTools_ListOfShape_HeaderFile
41 #include <TopTools_ListOfShape.hxx>
42 #endif
43 #ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile
44 #include <GEOMAlgo_IndexedDataMapOfShapeState.hxx>
45 #endif
46 #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
47 #include <GEOMAlgo_ShapeAlgo.hxx>
48 #endif
49 #ifndef _TopAbs_State_HeaderFile
50 #include <TopAbs_State.hxx>
51 #endif
52 class Geom_Surface;
53 class TopTools_ListOfShape;
54 class TopoDS_Face;
55 class GEOMAlgo_ListOfPnt;
56 class TopoDS_Edge;
57 class GEOMAlgo_IndexedDataMapOfShapeState;
58 class gp_Pnt;
59
60
61 #ifndef _Standard_HeaderFile
62 #include <Standard.hxx>
63 #endif
64 #ifndef _Standard_Macro_HeaderFile
65 #include <Standard_Macro.hxx>
66 #endif
67
68
69 class GEOMAlgo_FinderShapeOn1  : public GEOMAlgo_ShapeAlgo {
70
71 public:
72
73     void* operator new(size_t,void* anAddress) 
74       {
75         return anAddress;
76       }
77     void* operator new(size_t size) 
78       { 
79         return Standard::Allocate(size); 
80       }
81     void  operator delete(void *anAddress) 
82       { 
83         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
84       }
85  // Methods PUBLIC
86  // 
87
88
89 Standard_EXPORT GEOMAlgo_FinderShapeOn1();
90 Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn1();
91
92
93 Standard_EXPORT   void SetSurface(const Handle(Geom_Surface)& aS) ;
94
95
96 Standard_EXPORT   void SetShapeType(const TopAbs_ShapeEnum aST) ;
97
98
99 Standard_EXPORT   void SetState(const GEOMAlgo_State aSF) ;
100
101
102 Standard_EXPORT   void SetNbPntsMin(const Standard_Integer aNb) ;
103
104
105 Standard_EXPORT   Standard_Integer NbPntsMin() const;
106
107
108 Standard_EXPORT   void SetNbPntsMax(const Standard_Integer aNb) ;
109
110
111 Standard_EXPORT   Standard_Integer NbPntsMax() const;
112
113
114 Standard_EXPORT  const Handle_Geom_Surface& Surface() const;
115
116
117 Standard_EXPORT   TopAbs_ShapeEnum ShapeType() const;
118
119
120 Standard_EXPORT   GEOMAlgo_State State() const;
121
122
123 Standard_EXPORT virtual  void Perform() ;
124
125
126 Standard_EXPORT  const TopTools_ListOfShape& Shapes() const;
127
128
129 Standard_EXPORT  const GEOMAlgo_IndexedDataMapOfShapeState& MSS() const;
130
131
132
133
134
135 protected:
136
137  // Methods PROTECTED
138  // 
139
140
141 Standard_EXPORT virtual  void CheckData() ;
142
143
144 Standard_EXPORT   void ProcessVertices() ;
145
146
147 Standard_EXPORT   void ProcessEdges() ;
148
149
150 Standard_EXPORT   void ProcessFaces() ;
151
152
153 Standard_EXPORT   void ProcessSolids() ;
154
155
156 Standard_EXPORT   void InnerPoints(const TopoDS_Face& aF,GEOMAlgo_ListOfPnt& aLP) ;
157
158
159 Standard_EXPORT   void InnerPoints(const TopoDS_Edge& aE,GEOMAlgo_ListOfPnt& aLP) ;
160
161
162 Standard_EXPORT   void InnerPoints(const TopoDS_Edge& aE,const Standard_Integer aNbPnts,GEOMAlgo_ListOfPnt& aLP) ;
163
164
165 Standard_EXPORT virtual  TopAbs_State GetPointState(const gp_Pnt& aP) ;
166
167
168  // Fields PROTECTED
169  //
170 Handle_Geom_Surface mySurface;
171 TopAbs_ShapeEnum myShapeType;
172 GEOMAlgo_State myState;
173 Standard_Integer myNbPntsMin;
174 Standard_Integer myNbPntsMax;
175 GeomAdaptor_Surface myGAS;
176 TopTools_ListOfShape myLS;
177 GEOMAlgo_IndexedDataMapOfShapeState myMSS;
178
179
180 private: 
181
182  // Methods PRIVATE
183  // 
184
185
186  // Fields PRIVATE
187  //
188
189
190 };
191
192
193
194
195
196 // other Inline functions and methods (like "C++: function call" methods)
197 //
198
199
200 #endif