Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCK / HexDummyCad.hxx
1
2 // Class : Ecriture d'un dump python
3
4 // Copyright (C) 2009-2024  CEA, EDF
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, or (at your option) any later version.
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
23 #ifndef __DUMMY_CASCAD_
24 #define __DUMMY_CASCAD_
25
26 class BRepAdaptor_Curve;
27 class BRepAlgoAPI_Section;
28 class BRepBuilderAPI_MakeEdge;
29 class BRepBuilderAPI_MakeVertex;
30 class BRepBuilderAPI_Transform;
31 class BRepPrimAPI_MakeCylinder;
32 class BRepPrimAPI_MakeSphere;
33 class BRepTools;
34 class BRep_Builder;
35 class BRep_Tool;
36 class GC_MakeCircle;
37 class GeomAdaptor_Curve;
38 class GeomAPI_ProjectPointOnCurve;
39 class Geom_Circle;
40 class TopExp_Explorer;
41 class TopTools_IndexedMapOfShape;
42 class TopoDS;
43 class TopoDS_Compound;
44 class TopoDS_Edge;
45 class TopoDS_Iterator;
46 class TopoDS_Vertex;
47
48 class gp_Circ;
49 class gp_Dir;
50 class gp_Lin;
51 class gp_Pln;
52 class gp_Pnt;
53 class gp_Vec;
54 class gp_Ax2;
55
56 // -----------------------------------------------------------
57 #define Standard_True true
58 #define Handle(x) int
59                         // Extrait de TopAbs_ShapeEnum.hxx 
60 enum TopAbs_ShapeEnum {
61   TopAbs_COMPOUND, TopAbs_COMPSOLID, TopAbs_SOLID, TopAbs_SHELL,
62   TopAbs_FACE, TopAbs_WIRE, TopAbs_EDGE, TopAbs_VERTEX,
63   TopAbs_SHAPE
64 };
65
66 // -----------------------------------------------------------
67 class gp_Pnt
68 {
69 public :
70 gp_Pnt ()              {}
71 gp_Pnt (double, double, double)              {}
72 double X () { return 0;   }
73 double Y () { return 0;   }
74 double Z () { return 0;   }
75 };
76 // -----------------------------------------------------------
77 class gp_Vec
78 {
79 public :
80 gp_Vec (double, double, double)              {}
81 };
82 // -----------------------------------------------------------
83 class gp_Dir
84 {
85 public :
86 gp_Dir (int, int, int)    {}
87 };
88 // -----------------------------------------------------------
89 class gp_Ax2
90 {
91 public :
92 gp_Ax2 (gp_Pnt&, gp_Vec&, gp_Vec&)              {}
93 gp_Ax2 (gp_Pnt&, gp_Dir, gp_Dir)    {}
94 };
95 // -----------------------------------------------------------
96 class gp_Trsf
97 {
98 public :
99 void SetTranslation (gp_Vec) {}
100 void SetValues (double, double, double, double,
101                 double, double, double, double,
102                 double, double, double, double,
103                 double, double) {}
104 gp_Trsf& operator* (gp_Trsf&) { return *this ; }
105 };
106 // -----------------------------------------------------------
107 class TopLoc_Location
108 {
109 public :
110 TopLoc_Location ()         {}
111 TopLoc_Location (gp_Trsf&) {}
112 gp_Trsf  Transformation() { return tra ; }
113 private :
114 gp_Trsf  tra;
115 };
116 // -----------------------------------------------------------
117 class TopoDS_Shape
118 {
119 public :
120    TopLoc_Location Location () { return top_loc ; }
121    TopoDS_Shape    Located (TopLoc_Location& top_loc) { return *this; }
122    int ShapeType () const    { return 0 ; }
123
124    bool IsNull () const    { return true ; }
125    TopoDS_Shape& operator=(const BRepBuilderAPI_MakeVertex&)
126         {  return *this ; }
127
128 private :
129    TopLoc_Location top_loc;
130 };
131 // -----------------------------------------------------------
132 class gp_Circ
133 {
134 public :
135 gp_Circ (gp_Ax2&, double )              {}
136 };
137 // -----------------------------------------------------------
138 class GCPnts_AbscissaPoint
139 {
140 public :
141 GCPnts_AbscissaPoint (BRepAdaptor_Curve&, double, double) {}
142 double Parameter ()                                       {return 1; }
143 static double Length (GeomAdaptor_Curve&, double&, double&)  {return 1; }
144 gp_Pnt Value (double)  { return point ; }
145
146 private :
147 gp_Pnt point;
148
149 };
150 // -----------------------------------------------------------
151 class BRepAdaptor_Curve
152 {
153 public :
154 BRepAdaptor_Curve (TopoDS_Edge&) {}
155 double FirstParameter ()                                  {return 1; }
156 gp_Pnt Value (double)  { return point ; }
157
158 private :
159 gp_Pnt point;
160 };
161 // -----------------------------------------------------------
162 class GeomAdaptor_Curve
163 {
164 public :
165 GeomAdaptor_Curve (int)   {}
166 int GetType ()   { return 0 ;}
167 };
168 // -----------------------------------------------------------
169 class BRepPrimAPI_MakeCylinder
170 {
171 public :
172   BRepPrimAPI_MakeCylinder (gp_Ax2&, double, double) {}
173   void         Build ()   {  }
174   bool         IsDone ()  { return true; }
175   TopoDS_Shape Shape ()   { return forme ; }
176
177 private :
178   TopoDS_Shape forme;
179 };
180 // -----------------------------------------------------------
181 class BRepAlgoAPI_Section
182 {
183 public :
184 BRepAlgoAPI_Section (TopoDS_Shape&, TopoDS_Shape&,  bool) {}
185   void         Build ()   {  }
186   bool         IsDone ()  { return true; }
187   void         Approximation (bool)  { }
188   TopoDS_Shape Shape ()   { return forme ; }
189
190 private :
191   TopoDS_Shape forme;
192 };
193 // -----------------------------------------------------------
194 class TopoDS_Vertex {};
195 // -----------------------------------------------------------
196 class TopoDS_Edge {};
197 // -----------------------------------------------------------
198 class TopoDS
199 {
200 public :
201    static TopoDS_Edge    Edge   (const TopoDS_Shape&) { return edge ; }
202    static TopoDS_Vertex  Vertex (const TopoDS_Shape&) { return vertex ; }
203 private :
204   static TopoDS_Edge   edge;
205   static TopoDS_Vertex vertex;
206 };
207 // -----------------------------------------------------------
208 class BRep_Tool
209 {
210 public :
211    static int Curve (TopoDS_Edge, double, double) { return 0 ; }
212    static int Curve (TopoDS_Edge, TopLoc_Location&, double, double) {return 0;}
213    static gp_Pnt Pnt(TopoDS_Vertex vertex ) { return point; }
214 private :
215    static gp_Pnt  point;
216
217 };
218 // -----------------------------------------------------------
219 class GeomAPI_ProjectPointOnCurve
220 {
221 public :
222 GeomAPI_ProjectPointOnCurve (gp_Pnt&, int) {};
223 int    NbPoints () {return 0 ;};
224 double LowerDistanceParameter () {return 0 ;};
225 };
226 // -----------------------------------------------------------
227 class BRepBuilderAPI_MakeEdge
228 {
229 public :
230 BRepBuilderAPI_MakeEdge (gp_Circ&)  {}
231 TopoDS_Edge  Edge () { return edge ; }
232 private :
233   static TopoDS_Edge edge;
234
235 };
236 // -----------------------------------------------------------
237 class BRep_Builder
238 {
239 public :
240    void MakeCompound (TopoDS_Compound& ) {}
241    void Add (TopoDS_Compound&, TopoDS_Shape& ) {}
242    void Add (TopoDS_Compound&, TopoDS_Edge& ) {}
243 };
244 // -----------------------------------------------------------
245 class BRepTools
246 {
247 public :
248 static void Write (TopoDS_Edge&, ostringstream&) {}
249 static void Write (TopoDS_Shape&, ostringstream&) {}
250 static void Read  (TopoDS_Shape&, istringstream&, BRep_Builder&) {}
251 static void Clean  (TopoDS_Shape&) {}
252 };
253 // -----------------------------------------------------------
254 class BRepPrimAPI_MakeSphere
255 {
256 public :
257 BRepPrimAPI_MakeSphere(gp_Ax2&, double&) {}
258 void         Build ()   {  }
259 TopoDS_Shape  Face () { return forme ; }
260 private :
261   static TopoDS_Shape forme;
262
263 };
264 // -----------------------------------------------------------
265 class BRepBuilderAPI_Transform
266 {
267 public :
268 BRepBuilderAPI_Transform (TopoDS_Shape&, gp_Trsf&, bool)  {}
269 TopoDS_Shape  Shape () { return forme ; }
270
271 private :
272   TopoDS_Shape forme;
273
274 };
275
276 // -----------------------------------------------------------
277 class TopExp_Explorer
278 {
279 public :
280 TopExp_Explorer (TopoDS_Shape&, int)    {}
281 bool More()                             { return false ; }
282 void Next()                             {}
283 TopoDS_Shape& Current()                 { return forme ; }
284 private :
285   TopoDS_Shape forme;
286 };
287 // -----------------------------------------------------------
288 class TopoDS_Iterator
289 {
290 public :
291 TopoDS_Iterator (const TopoDS_Shape&)   {}
292 bool More()                             { return false ; }
293 void Next()                             {}
294 TopoDS_Shape& Value()                   { return forme ; }
295 private :
296   TopoDS_Shape forme;
297 };
298 // -----------------------------------------------------------
299 class BRepBuilderAPI_MakeVertex
300 {
301 public :
302 BRepBuilderAPI_MakeVertex (gp_Pnt&) {}
303 TopoDS_Shape& Shape()    { return forme ; }
304 private :
305   TopoDS_Shape forme;
306 };
307 // -----------------------------------------------------------
308 class TopTools_IndexedMapOfShape
309 {
310 public :
311 void Clear()                  {}
312 int Add (const TopoDS_Shape&)  { return 0 ; }
313 const TopoDS_Shape& FindKey (int id) { return forme ; }
314
315 private :
316   TopoDS_Shape forme;
317 };
318 // -----------------------------------------------------------
319 class GC_MakeCircle {};
320 class Geom_Circle {};
321 class TopoDS_Compound : public TopoDS_Shape {};
322 class gp_Lin {};
323 class gp_Pln {};
324 #endif