0025418: Debug output to be limited to OCC development environment
[occt.git] / src / HLRBRep / HLRBRep_CurveTool.lxx
1 // Created on: 1992-10-22
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <HLRBRep_Curve.hxx>
18 #include <GeomAbs_CurveType.hxx>
19 #include <GeomAbs_Shape.hxx>
20 #include <gp_Vec2d.hxx>
21 #include <gp_Lin2d.hxx>
22 #include <gp_Circ2d.hxx>
23 #include <gp_Elips2d.hxx>
24 #include <gp_Parab2d.hxx>
25 #include <gp_Hypr2d.hxx>
26 #include <Geom2d_BezierCurve.hxx>
27 #include <Geom2d_BSplineCurve.hxx>
28 #include <TColStd_Array1OfReal.hxx>
29
30 #define   IS_C2_COMPOSITE 0
31
32 //=======================================================================
33 //function : FirstParameter
34 //purpose  : 
35 //=======================================================================
36
37 inline Standard_Real
38 HLRBRep_CurveTool::FirstParameter (const Standard_Address C)
39 { return(((HLRBRep_Curve *)C)->FirstParameter()); }
40
41 //=======================================================================
42 //function : LastParameter
43 //purpose  : 
44 //=======================================================================
45
46 inline Standard_Real
47 HLRBRep_CurveTool::LastParameter (const Standard_Address C)
48 { return(((HLRBRep_Curve *)C)->LastParameter()); }
49
50 //=======================================================================
51 //function : Continuity
52 //purpose  : 
53 //=======================================================================
54
55 inline GeomAbs_Shape
56 HLRBRep_CurveTool::Continuity (const Standard_Address C)
57 { return(((HLRBRep_Curve *)C)->Continuity()); }
58
59 //=======================================================================
60 //function : NbIntervals
61 //purpose  : 
62 //=======================================================================
63
64 inline Standard_Integer
65 HLRBRep_CurveTool::NbIntervals(const Standard_Address C)
66 {
67 #if IS_C2_COMPOSITE 
68   return(((HLRBRep_Curve *)C)->NbIntervals(GeomAbs_C2));
69 #else 
70   return(((HLRBRep_Curve *)C)->NbIntervals(GeomAbs_C1));
71 #endif
72 }
73
74 //=======================================================================
75 //function : Intervals
76 //purpose  : 
77 //=======================================================================
78
79 inline void
80 HLRBRep_CurveTool::Intervals(const Standard_Address C,
81                              TColStd_Array1OfReal& Tab)
82
83 #if IS_C2_COMPOSITE
84   ((HLRBRep_Curve *)C)->Intervals(Tab,GeomAbs_C2);
85 #else 
86   ((HLRBRep_Curve *)C)->Intervals(Tab,GeomAbs_C1);
87 #endif
88 }
89
90 //=======================================================================
91 //function : GetInterval
92 //purpose  : 
93 //=======================================================================
94
95 inline void
96 HLRBRep_CurveTool::GetInterval(const Standard_Address /*C*/,
97                                const Standard_Integer i,
98                                const TColStd_Array1OfReal& Tab,
99                                Standard_Real& a,
100                                Standard_Real& b)
101 {
102   a = Tab.Value(i);
103   b = Tab.Value(i+1);
104 }
105
106 //=======================================================================
107 //function : IsClosed
108 //purpose  : 
109 //=======================================================================
110
111 inline Standard_Boolean
112 HLRBRep_CurveTool::IsClosed(const Standard_Address C)
113 { return(((HLRBRep_Curve *)C)->IsClosed()); }
114
115 //=======================================================================
116 //function : IsPeriodic
117 //purpose  : 
118 //=======================================================================
119
120 inline Standard_Boolean
121 HLRBRep_CurveTool::IsPeriodic(const Standard_Address C)
122 { return(((HLRBRep_Curve *)C)->IsPeriodic()); }
123
124 //=======================================================================
125 //function : Period
126 //purpose  : 
127 //=======================================================================
128
129 inline Standard_Real
130 HLRBRep_CurveTool::Period(const Standard_Address C)
131 { return(((HLRBRep_Curve *)C)->Period()); }
132
133 //=======================================================================
134 //function : Value
135 //purpose  : 
136 //=======================================================================
137
138 inline gp_Pnt2d
139 HLRBRep_CurveTool::Value (const Standard_Address C,
140                           const Standard_Real U)
141 { return(((HLRBRep_Curve *)C)->Value(U)); }
142
143 //=======================================================================
144 //function : D0
145 //purpose  : 
146 //=======================================================================
147
148 inline void
149 HLRBRep_CurveTool::D0(const Standard_Address C,
150                       const Standard_Real U,
151                       gp_Pnt2d& P)
152 { ((HLRBRep_Curve *)C)->D0(U,P); }
153
154 //=======================================================================
155 //function : D1
156 //purpose  : 
157 //=======================================================================
158
159 inline void
160 HLRBRep_CurveTool::D1 (const Standard_Address C,
161                        const Standard_Real U,
162                        gp_Pnt2d& P,
163                        gp_Vec2d& T)
164 { ((HLRBRep_Curve *)C)->D1(U,P,T); }
165
166 //=======================================================================
167 //function : D2
168 //purpose  : 
169 //=======================================================================
170
171 inline void
172 HLRBRep_CurveTool::D2 (const Standard_Address C,
173                        const Standard_Real U,
174                        gp_Pnt2d& P,
175                        gp_Vec2d& T,
176                        gp_Vec2d& N)
177 { ((HLRBRep_Curve *)C)->D2(U,P,T,N); }
178
179 //=======================================================================
180 //function : D3
181 //purpose  : 
182 //=======================================================================
183
184 inline void
185 HLRBRep_CurveTool::D3 (const Standard_Address C,
186                        const Standard_Real U,
187                        gp_Pnt2d& P,
188                        gp_Vec2d& V1,
189                        gp_Vec2d& V2,
190                        gp_Vec2d& V3)
191 { ((HLRBRep_Curve *)C)->D3(U,P,V1,V2,V3); }
192
193 //=======================================================================
194 //function : DN
195 //purpose  : 
196 //=======================================================================
197
198 inline gp_Vec2d
199 HLRBRep_CurveTool::DN (const Standard_Address C,
200                        const Standard_Real U,
201                        const Standard_Integer N)
202 { return(((HLRBRep_Curve *)C)->DN(U,N)); }
203
204 //=======================================================================
205 //function : Resolution
206 //purpose  : 
207 //=======================================================================
208
209 inline Standard_Real
210 HLRBRep_CurveTool::Resolution(const Standard_Address C,
211                               const Standard_Real R3d)
212 { return(((HLRBRep_Curve *)C)->Resolution(R3d)); }
213
214 //=======================================================================
215 //function : GetType
216 //purpose  : 
217 //=======================================================================
218
219 inline GeomAbs_CurveType
220 HLRBRep_CurveTool::GetType(const Standard_Address C)
221 { return(((HLRBRep_Curve *)C)->GetType()); }
222
223 //=======================================================================
224 //function : TheType
225 //purpose  : 
226 //=======================================================================
227
228 inline GeomAbs_CurveType
229 HLRBRep_CurveTool::TheType(const Standard_Address C)
230 { return(((HLRBRep_Curve *)C)->GetType()); }
231
232 //=======================================================================
233 //function : Line
234 //purpose  : 
235 //=======================================================================
236
237 inline gp_Lin2d
238 HLRBRep_CurveTool::Line (const Standard_Address C)
239 { return(((HLRBRep_Curve *)C)->Line()); }
240
241 //=======================================================================
242 //function : Circle
243 //purpose  : 
244 //=======================================================================
245
246 inline gp_Circ2d
247 HLRBRep_CurveTool::Circle (const Standard_Address C)
248 { return(((HLRBRep_Curve *)C)->Circle()); }
249
250 //=======================================================================
251 //function : Ellipse
252 //purpose  : 
253 //=======================================================================
254
255 inline gp_Elips2d
256 HLRBRep_CurveTool::Ellipse (const Standard_Address C)
257 { return(((HLRBRep_Curve *)C)->Ellipse()); }
258
259 //=======================================================================
260 //function : Parabola
261 //purpose  : 
262 //=======================================================================
263
264 inline gp_Parab2d
265 HLRBRep_CurveTool::Parabola (const Standard_Address C)
266 { return(((HLRBRep_Curve *)C)->Parabola()); }
267
268 //=======================================================================
269 //function : Hyperbola
270 //purpose  : 
271 //=======================================================================
272
273 inline gp_Hypr2d
274 HLRBRep_CurveTool::Hyperbola (const Standard_Address C)
275 { return(((HLRBRep_Curve *)C)->Hyperbola()); }
276
277 //=======================================================================
278 //function : Bezier
279 //purpose  : 
280 //=======================================================================
281
282 inline Handle(Geom2d_BezierCurve)
283      HLRBRep_CurveTool::Bezier (const Standard_Address /*C*/)
284 {
285 #ifdef OCCT_DEBUG
286   cout<<"  HLRBRep_CurveTool::Bezier : Not Implemented "<<endl;
287 #endif
288   //-- return(((HLRBRep_Curve *)C)->Bezier());
289   return(0);
290 }
291
292 //=======================================================================
293 //function : BSpline
294 //purpose  : 
295 //=======================================================================
296
297 inline Handle(Geom2d_BSplineCurve)
298      HLRBRep_CurveTool::BSpline (const Standard_Address /*C*/)
299 {
300 #ifdef OCCT_DEBUG
301   cout<<"  HLRBRep_CurveTool::BSpline : Not Implemented "<<endl;
302 #endif
303   //-- return(((HLRBRep_Curve *)C)->BSpline());
304   return(0);
305 }
306
307 //=======================================================================
308 //function : EpsX
309 //purpose  : 
310 //=======================================================================
311
312 inline Standard_Real
313 HLRBRep_CurveTool::EpsX(const Standard_Address /*C*/)
314 { return(1e-10); }
315
316
317 //=======================================================================
318 //function : Degree
319 //purpose  : 
320 //=======================================================================
321
322 inline Standard_Integer
323      HLRBRep_CurveTool::Degree (const Standard_Address C)
324 {
325   return(((HLRBRep_Curve *)C)->Degree());
326 }