b311480e |
1 | // Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
b311480e |
5 | // |
d5f74e42 |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
11 | // |
973c2be1 |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
b311480e |
14 | |
42cf5bc1 |
15 | |
16 | #include <Adaptor2d_Curve2d.hxx> |
17 | #include <Adaptor3d_Curve.hxx> |
18 | #include <GCPnts_UniformDeflection.hxx> |
19 | #include <gp_Pnt.hxx> |
20 | #include <gp_Pnt2d.hxx> |
7fd59977 |
21 | #include <Standard_ConstructionError.hxx> |
42cf5bc1 |
22 | #include <Standard_DomainError.hxx> |
7fd59977 |
23 | #include <Standard_NotImplemented.hxx> |
42cf5bc1 |
24 | #include <Standard_OutOfRange.hxx> |
25 | #include <StdFail_NotDone.hxx> |
26 | |
7fd59977 |
27 | // mask the return of a Adaptor2d_Curve2d as a gp_Pnt |
7fd59977 |
28 | static gp_Pnt Value(const Adaptor3d_Curve & C, |
29 | const Standard_Real Parameter) |
30 | { |
31 | return C.Value(Parameter) ; |
32 | } |
33 | static gp_Pnt Value(const Adaptor2d_Curve2d & C, |
34 | const Standard_Real Parameter) |
35 | { |
36 | gp_Pnt aPoint ; |
37 | gp_Pnt2d a2dPoint = |
38 | C.Value(Parameter) ; |
39 | aPoint.SetX ( a2dPoint.X()) ; |
40 | aPoint.SetY ( a2dPoint.Y()) ; |
41 | aPoint.SetZ ( 0.0e0) ; |
42 | return aPoint ; |
43 | } |
44 | //======================================================================= |
45 | //function : Value |
46 | //purpose : |
47 | //======================================================================= |
48 | |
49 | gp_Pnt GCPnts_UniformDeflection::Value |
50 | (const Standard_Integer Index) const |
51 | { |
52 | StdFail_NotDone_Raise_if(!myDone, |
53 | "GCPnts_UniformAbscissa::Parameter()"); |
54 | return myPoints.Value(Index) ; |
55 | } |
56 | //======================================================================= |
57 | //function : GCPnts_UniformDeflection |
58 | //purpose : |
59 | //======================================================================= |
60 | |
61 | GCPnts_UniformDeflection::GCPnts_UniformDeflection () |
d533dafb |
62 | : myDone(Standard_False), |
63 | myDeflection(0.0) |
7fd59977 |
64 | { |
65 | } |
66 | |
67 | #include <Geom_BezierCurve.hxx> |
68 | #include <Geom_BSplineCurve.hxx> |
9bf3ef83 |
69 | |
7fd59977 |
70 | #define TheCurve Adaptor3d_Curve |
71 | #define Handle_TheBezierCurve Handle(Geom_BezierCurve) |
72 | #define Handle_TheBSplineCurve Handle(Geom_BSplineCurve) |
9bf3ef83 |
73 | #include "GCPnts_UniformDeflection.pxx" |
7fd59977 |
74 | #undef TheCurve |
75 | #undef Handle_TheBezierCurve |
76 | #undef Handle_TheBSplineCurve |
77 | |
78 | #include <Geom2d_BezierCurve.hxx> |
79 | #include <Geom2d_BSplineCurve.hxx> |
80 | #define TheCurve Adaptor2d_Curve2d |
81 | #define Handle_TheBezierCurve Handle(Geom2d_BezierCurve) |
82 | #define Handle_TheBSplineCurve Handle(Geom2d_BSplineCurve) |
9bf3ef83 |
83 | #include "GCPnts_UniformDeflection.pxx" |
7fd59977 |
84 | #undef TheCurve |
85 | #undef Handle_TheBezierCurve |
86 | #undef Handle_TheBSplineCurve |
87 | |
88 | |
89 | |
90 | |
91 | |
92 | |