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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
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>
30 #define IS_C2_COMPOSITE 0
32 //=======================================================================
33 //function : FirstParameter
35 //=======================================================================
38 HLRBRep_CurveTool::FirstParameter (const Standard_Address C)
39 { return(((HLRBRep_Curve *)C)->FirstParameter()); }
41 //=======================================================================
42 //function : LastParameter
44 //=======================================================================
47 HLRBRep_CurveTool::LastParameter (const Standard_Address C)
48 { return(((HLRBRep_Curve *)C)->LastParameter()); }
50 //=======================================================================
51 //function : Continuity
53 //=======================================================================
56 HLRBRep_CurveTool::Continuity (const Standard_Address C)
57 { return(((HLRBRep_Curve *)C)->Continuity()); }
59 //=======================================================================
60 //function : NbIntervals
62 //=======================================================================
64 inline Standard_Integer
65 HLRBRep_CurveTool::NbIntervals(const Standard_Address C)
68 return(((HLRBRep_Curve *)C)->NbIntervals(GeomAbs_C2));
70 return(((HLRBRep_Curve *)C)->NbIntervals(GeomAbs_C1));
74 //=======================================================================
75 //function : Intervals
77 //=======================================================================
80 HLRBRep_CurveTool::Intervals(const Standard_Address C,
81 TColStd_Array1OfReal& Tab)
84 ((HLRBRep_Curve *)C)->Intervals(Tab,GeomAbs_C2);
86 ((HLRBRep_Curve *)C)->Intervals(Tab,GeomAbs_C1);
90 //=======================================================================
91 //function : GetInterval
93 //=======================================================================
96 HLRBRep_CurveTool::GetInterval(const Standard_Address /*C*/,
97 const Standard_Integer i,
98 const TColStd_Array1OfReal& Tab,
106 //=======================================================================
107 //function : IsClosed
109 //=======================================================================
111 inline Standard_Boolean
112 HLRBRep_CurveTool::IsClosed(const Standard_Address C)
113 { return(((HLRBRep_Curve *)C)->IsClosed()); }
115 //=======================================================================
116 //function : IsPeriodic
118 //=======================================================================
120 inline Standard_Boolean
121 HLRBRep_CurveTool::IsPeriodic(const Standard_Address C)
122 { return(((HLRBRep_Curve *)C)->IsPeriodic()); }
124 //=======================================================================
127 //=======================================================================
130 HLRBRep_CurveTool::Period(const Standard_Address C)
131 { return(((HLRBRep_Curve *)C)->Period()); }
133 //=======================================================================
136 //=======================================================================
139 HLRBRep_CurveTool::Value (const Standard_Address C,
140 const Standard_Real U)
141 { return(((HLRBRep_Curve *)C)->Value(U)); }
143 //=======================================================================
146 //=======================================================================
149 HLRBRep_CurveTool::D0(const Standard_Address C,
150 const Standard_Real U,
152 { ((HLRBRep_Curve *)C)->D0(U,P); }
154 //=======================================================================
157 //=======================================================================
160 HLRBRep_CurveTool::D1 (const Standard_Address C,
161 const Standard_Real U,
164 { ((HLRBRep_Curve *)C)->D1(U,P,T); }
166 //=======================================================================
169 //=======================================================================
172 HLRBRep_CurveTool::D2 (const Standard_Address C,
173 const Standard_Real U,
177 { ((HLRBRep_Curve *)C)->D2(U,P,T,N); }
179 //=======================================================================
182 //=======================================================================
185 HLRBRep_CurveTool::D3 (const Standard_Address C,
186 const Standard_Real U,
191 { ((HLRBRep_Curve *)C)->D3(U,P,V1,V2,V3); }
193 //=======================================================================
196 //=======================================================================
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)); }
204 //=======================================================================
205 //function : Resolution
207 //=======================================================================
210 HLRBRep_CurveTool::Resolution(const Standard_Address C,
211 const Standard_Real R3d)
212 { return(((HLRBRep_Curve *)C)->Resolution(R3d)); }
214 //=======================================================================
217 //=======================================================================
219 inline GeomAbs_CurveType
220 HLRBRep_CurveTool::GetType(const Standard_Address C)
221 { return(((HLRBRep_Curve *)C)->GetType()); }
223 //=======================================================================
226 //=======================================================================
228 inline GeomAbs_CurveType
229 HLRBRep_CurveTool::TheType(const Standard_Address C)
230 { return(((HLRBRep_Curve *)C)->GetType()); }
232 //=======================================================================
235 //=======================================================================
238 HLRBRep_CurveTool::Line (const Standard_Address C)
239 { return(((HLRBRep_Curve *)C)->Line()); }
241 //=======================================================================
244 //=======================================================================
247 HLRBRep_CurveTool::Circle (const Standard_Address C)
248 { return(((HLRBRep_Curve *)C)->Circle()); }
250 //=======================================================================
253 //=======================================================================
256 HLRBRep_CurveTool::Ellipse (const Standard_Address C)
257 { return(((HLRBRep_Curve *)C)->Ellipse()); }
259 //=======================================================================
260 //function : Parabola
262 //=======================================================================
265 HLRBRep_CurveTool::Parabola (const Standard_Address C)
266 { return(((HLRBRep_Curve *)C)->Parabola()); }
268 //=======================================================================
269 //function : Hyperbola
271 //=======================================================================
274 HLRBRep_CurveTool::Hyperbola (const Standard_Address C)
275 { return(((HLRBRep_Curve *)C)->Hyperbola()); }
277 //=======================================================================
280 //=======================================================================
282 inline Handle(Geom2d_BezierCurve)
283 HLRBRep_CurveTool::Bezier (const Standard_Address /*C*/)
286 cout<<" HLRBRep_CurveTool::Bezier : Not Implemented "<<endl;
288 //-- return(((HLRBRep_Curve *)C)->Bezier());
292 //=======================================================================
295 //=======================================================================
297 inline Handle(Geom2d_BSplineCurve)
298 HLRBRep_CurveTool::BSpline (const Standard_Address /*C*/)
301 cout<<" HLRBRep_CurveTool::BSpline : Not Implemented "<<endl;
303 //-- return(((HLRBRep_Curve *)C)->BSpline());
307 //=======================================================================
310 //=======================================================================
313 HLRBRep_CurveTool::EpsX(const Standard_Address /*C*/)
317 //=======================================================================
320 //=======================================================================
322 inline Standard_Integer
323 HLRBRep_CurveTool::Degree (const Standard_Address C)
325 return(((HLRBRep_Curve *)C)->Degree());