1 // Created on: 1997-03-21
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1997-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 <BiTgte_CurveOnVertex.hxx>
18
19 #include <Adaptor3d_Curve.hxx>
20 #include <BRep_Tool.hxx>
21 #include <Geom_BezierCurve.hxx>
22 #include <Geom_BSplineCurve.hxx>
23 #include <gp_Circ.hxx>
24 #include <gp_Elips.hxx>
25 #include <gp_Hypr.hxx>
26 #include <gp_Lin.hxx>
27 #include <gp_Parab.hxx>
28 #include <gp_Pnt.hxx>
29 #include <gp_Vec.hxx>
30 #include <Standard_DomainError.hxx>
31 #include <Standard_NoSuchObject.hxx>
32 #include <Standard_NotImplemented.hxx>
33 #include <Standard_OutOfRange.hxx>
34 #include <TopoDS_Edge.hxx>
35 #include <TopoDS_Vertex.hxx>
36
IMPLEMENT_STANDARD_RTTIEXT(BiTgte_CurveOnVertex,Adaptor3d_Curve)37 IMPLEMENT_STANDARD_RTTIEXT(BiTgte_CurveOnVertex, Adaptor3d_Curve)
38
39 //=======================================================================
40 //function : BiTgte_CurveOnVertex
41 //purpose :
42 //======================================================================
43 BiTgte_CurveOnVertex::BiTgte_CurveOnVertex()
44 : myFirst(0.0), myLast(0.0)
45 {
46 }
47
48
49 //=======================================================================
50 //function : BiTgte_CurveOnVertex
51 //purpose :
52 //=======================================================================
53
BiTgte_CurveOnVertex(const TopoDS_Edge & theEonF,const TopoDS_Vertex & theVertex)54 BiTgte_CurveOnVertex::BiTgte_CurveOnVertex(const TopoDS_Edge& theEonF,
55 const TopoDS_Vertex& theVertex)
56 : myFirst(0.0), myLast(0.0)
57 {
58 Init(theEonF, theVertex);
59 }
60
61
62 //=======================================================================
63 //function : Init
64 //purpose :
65 //=======================================================================
66
Init(const TopoDS_Edge & EonF,const TopoDS_Vertex & V)67 void BiTgte_CurveOnVertex::Init(const TopoDS_Edge& EonF,
68 const TopoDS_Vertex& V)
69 {
70 BRep_Tool::Range(EonF,myFirst,myLast);
71 myPnt = BRep_Tool::Pnt(V);
72 }
73
74
75 //=======================================================================
76 //function : FirstParameter
77 //purpose :
78 //=======================================================================
79
FirstParameter() const80 Standard_Real BiTgte_CurveOnVertex::FirstParameter() const
81 {
82 return myFirst;
83 }
84
85
86 //=======================================================================
87 //function : LastParameter
88 //purpose :
89 //=======================================================================
90
LastParameter() const91 Standard_Real BiTgte_CurveOnVertex::LastParameter() const
92 {
93 return myLast;
94 }
95
96
97 //=======================================================================
98 //function :
99 //purpose :
100 //=======================================================================
101
Continuity() const102 GeomAbs_Shape BiTgte_CurveOnVertex::Continuity() const
103 {
104 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
105 }
106
107
108 //=======================================================================
109 //function :
110 //purpose :
111 //=======================================================================
112
NbIntervals(const GeomAbs_Shape) const113 Standard_Integer BiTgte_CurveOnVertex::NbIntervals(const GeomAbs_Shape) const
114 {
115 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
116 }
117
118
119 //=======================================================================
120 //function :
121 //purpose :
122 //=======================================================================
123
Intervals(TColStd_Array1OfReal &,const GeomAbs_Shape) const124 void BiTgte_CurveOnVertex::Intervals(TColStd_Array1OfReal&,
125 const GeomAbs_Shape) const
126 {
127 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
128 }
129
130
131 //=======================================================================
132 //function :
133 //purpose :
134 //=======================================================================
135
Handle(Adaptor3d_Curve)136 Handle(Adaptor3d_Curve) BiTgte_CurveOnVertex::Trim(const Standard_Real,
137 const Standard_Real,
138 const Standard_Real)
139 const
140 {
141 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
142 }
143
144
145 //=======================================================================
146 //function :
147 //purpose :
148 //=======================================================================
149
IsClosed() const150 Standard_Boolean BiTgte_CurveOnVertex::IsClosed() const
151 {
152 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
153 }
154
155
156 //=======================================================================
157 //function :
158 //purpose :
159 //=======================================================================
160
IsPeriodic() const161 Standard_Boolean BiTgte_CurveOnVertex::IsPeriodic() const
162 {
163 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
164 }
165
166
167 //=======================================================================
168 //function :
169 //purpose :
170 //=======================================================================
171
Period() const172 Standard_Real BiTgte_CurveOnVertex::Period() const
173 {
174 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
175 }
176
177
178 //=======================================================================
179 //function :
180 //purpose :
181 //=======================================================================
182
Value(const Standard_Real) const183 gp_Pnt BiTgte_CurveOnVertex::Value(const Standard_Real) const
184 {
185 return myPnt;
186 }
187
188
189 //=======================================================================
190 //function :
191 //purpose :
192 //=======================================================================
193
D0(const Standard_Real,gp_Pnt & P) const194 void BiTgte_CurveOnVertex::D0(const Standard_Real /*U*/,gp_Pnt& P) const
195 {
196 P = myPnt;
197 }
198
199
200 //=======================================================================
201 //function :
202 //purpose :
203 //=======================================================================
204
D1(const Standard_Real,gp_Pnt &,gp_Vec &) const205 void BiTgte_CurveOnVertex::D1(const Standard_Real ,gp_Pnt& ,gp_Vec&) const
206 {
207 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
208 }
209
210
211 //=======================================================================
212 //function :
213 //purpose :
214 //=======================================================================
215
D2(const Standard_Real,gp_Pnt &,gp_Vec &,gp_Vec &) const216 void BiTgte_CurveOnVertex::D2(const Standard_Real,gp_Pnt&,
217 gp_Vec& ,gp_Vec& ) const
218 {
219 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
220 }
221
222
223 //=======================================================================
224 //function :
225 //purpose :
226 //=======================================================================
227
D3(const Standard_Real,gp_Pnt &,gp_Vec &,gp_Vec &,gp_Vec &) const228 void BiTgte_CurveOnVertex::D3(const Standard_Real,
229 gp_Pnt& ,
230 gp_Vec& ,
231 gp_Vec& ,
232 gp_Vec& ) const
233 {
234 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
235 }
236
237
238 //=======================================================================
239 //function :
240 //purpose :
241 //=======================================================================
242
DN(const Standard_Real,const Standard_Integer) const243 gp_Vec BiTgte_CurveOnVertex::DN(const Standard_Real,
244 const Standard_Integer) const
245 {
246 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
247 }
248
249
250 //=======================================================================
251 //function :
252 //purpose :
253 //=======================================================================
254
Resolution(const Standard_Real) const255 Standard_Real BiTgte_CurveOnVertex::Resolution(const Standard_Real) const
256 {
257 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
258 }
259
260
261 //=======================================================================
262 //function :
263 //purpose :
264 //=======================================================================
265
GetType() const266 GeomAbs_CurveType BiTgte_CurveOnVertex::GetType() const
267 {
268 return GeomAbs_OtherCurve;
269 }
270
271
272 //=======================================================================
273 //function :
274 //purpose :
275 //=======================================================================
276
Line() const277 gp_Lin BiTgte_CurveOnVertex::Line() const
278 {
279 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
280 }
281
282
283 //=======================================================================
284 //function :
285 //purpose :
286 //=======================================================================
287
Circle() const288 gp_Circ BiTgte_CurveOnVertex::Circle() const
289 {
290 throw Standard_NoSuchObject("BiTgte_CurveOnVertex::Circle");
291 }
292
293
294 //=======================================================================
295 //function :
296 //purpose :
297 //=======================================================================
298
Ellipse() const299 gp_Elips BiTgte_CurveOnVertex::Ellipse() const
300 {
301 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
302 }
303
304
305 //=======================================================================
306 //function :
307 //purpose :
308 //=======================================================================
309
Hyperbola() const310 gp_Hypr BiTgte_CurveOnVertex::Hyperbola() const
311 {
312 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
313 }
314
315
316 //=======================================================================
317 //function :
318 //purpose :
319 //=======================================================================
320
Parabola() const321 gp_Parab BiTgte_CurveOnVertex::Parabola() const
322 {
323 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
324 }
325
326
327 //=======================================================================
328 //function :
329 //purpose :
330 //=======================================================================
331
Degree() const332 Standard_Integer BiTgte_CurveOnVertex::Degree() const
333 {
334 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
335 }
336
337
338 //=======================================================================
339 //function :
340 //purpose :
341 //=======================================================================
342
IsRational() const343 Standard_Boolean BiTgte_CurveOnVertex::IsRational() const
344 {
345 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
346 }
347
348
349 //=======================================================================
350 //function :
351 //purpose :
352 //=======================================================================
353
NbPoles() const354 Standard_Integer BiTgte_CurveOnVertex::NbPoles() const
355 {
356 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
357 }
358
359
360 //=======================================================================
361 //function :
362 //purpose :
363 //=======================================================================
364
NbKnots() const365 Standard_Integer BiTgte_CurveOnVertex::NbKnots() const
366 {
367 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
368 }
369
370
371 //=======================================================================
372 //function :
373 //purpose :
374 //=======================================================================
375
Handle(Geom_BezierCurve)376 Handle(Geom_BezierCurve) BiTgte_CurveOnVertex::Bezier() const
377 {
378 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
379 }
380
381
382 //=======================================================================
383 //function :
384 //purpose :
385 //=======================================================================
386
Handle(Geom_BSplineCurve)387 Handle(Geom_BSplineCurve) BiTgte_CurveOnVertex::BSpline() const
388 {
389 throw Standard_NotImplemented("BiTgte_CurveOnVertex");
390 }
391
392
393