b311480e |
1 | // Created on: 1992-10-22 |
2 | // Created by: Laurent BUCHARD |
3 | // Copyright (c) 1992-1999 Matra Datavision |
4 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | // |
6 | // The content of this file is subject to the Open CASCADE Technology Public |
7 | // License Version 6.5 (the "License"). You may not use the content of this file |
8 | // except in compliance with the License. Please obtain a copy of the License |
9 | // at http://www.opencascade.org and read it completely before using this file. |
10 | // |
11 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | // |
14 | // The Original Code and all software distributed under the License is |
15 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | // Initial Developer hereby disclaims all such warranties, including without |
17 | // limitation, any warranties of merchantability, fitness for a particular |
18 | // purpose or non-infringement. Please see the License for the specific terms |
19 | // and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | #include CurveGen_hxx |
23 | |
24 | #include <GeomAbs_CurveType.hxx> |
25 | #include <GeomAbs_Shape.hxx> |
26 | |
27 | #include <gp_Vec2d.hxx> |
28 | #include <gp_Lin2d.hxx> |
29 | #include <gp_Circ2d.hxx> |
30 | #include <gp_Elips2d.hxx> |
31 | #include <gp_Parab2d.hxx> |
32 | #include <gp_Hypr2d.hxx> |
33 | |
34 | |
35 | #include <Handle_Geom2d_BezierCurve.hxx> |
36 | #include <Handle_Geom2d_BSplineCurve.hxx> |
37 | |
38 | #include <TColStd_Array1OfReal.hxx> |
39 | |
40 | //============================================================ |
41 | inline Standard_Real Contap_HCurve2dToolGen::FirstParameter (const CurveGen& C) { |
42 | return(C->FirstParameter()); |
43 | } |
44 | //============================================================ |
45 | inline Standard_Real Contap_HCurve2dToolGen::LastParameter (const CurveGen& C) { |
46 | return(C->LastParameter()); |
47 | } |
48 | //============================================================ |
49 | inline GeomAbs_Shape Contap_HCurve2dToolGen::Continuity (const CurveGen& C) { |
50 | return(C->Continuity()); |
51 | } |
52 | //============================================================ |
53 | inline Standard_Integer Contap_HCurve2dToolGen::NbIntervals(const CurveGen& C,const GeomAbs_Shape Sh) { |
54 | return(C->NbIntervals(Sh)); |
55 | } |
56 | //============================================================ |
57 | inline void Contap_HCurve2dToolGen::Intervals(const CurveGen& C, |
58 | TColStd_Array1OfReal& Tab, |
59 | const GeomAbs_Shape Sh) { |
60 | C->Intervals(Tab,Sh); |
61 | } |
62 | //============================================================ |
63 | inline Standard_Boolean Contap_HCurve2dToolGen::IsClosed(const CurveGen& C) { |
64 | return(C->IsClosed()); |
65 | } |
66 | //============================================================ |
67 | inline Standard_Boolean Contap_HCurve2dToolGen::IsPeriodic(const CurveGen& C) { |
68 | return(C->IsPeriodic()); |
69 | } |
70 | //============================================================ |
71 | inline Standard_Real Contap_HCurve2dToolGen::Period(const CurveGen& C) { |
72 | return(C->Period()); |
73 | } |
74 | //============================================================ |
75 | inline gp_Pnt2d Contap_HCurve2dToolGen::Value (const CurveGen& C, |
76 | const Standard_Real U) { |
77 | return(C->Value(U)); |
78 | } |
79 | //============================================================ |
80 | inline void Contap_HCurve2dToolGen::D0(const CurveGen& C, |
81 | const Standard_Real U, |
82 | gp_Pnt2d& P) { |
83 | C->D0(U,P); |
84 | } |
85 | //============================================================ |
86 | inline void Contap_HCurve2dToolGen::D1 (const CurveGen& C, |
87 | const Standard_Real U, |
88 | gp_Pnt2d& P, |
89 | gp_Vec2d& T) { |
90 | C->D1(U,P,T); |
91 | } |
92 | //============================================================ |
93 | inline void Contap_HCurve2dToolGen::D2 (const CurveGen& C, |
94 | const Standard_Real U, |
95 | gp_Pnt2d& P, |
96 | gp_Vec2d& T, |
97 | gp_Vec2d& N) { |
98 | |
99 | C->D2(U,P,T,N); |
100 | } |
101 | //============================================================ |
102 | inline void Contap_HCurve2dToolGen::D3 (const CurveGen& C, |
103 | const Standard_Real U, |
104 | gp_Pnt2d& P, |
105 | gp_Vec2d& V1, |
106 | gp_Vec2d& V2, |
107 | gp_Vec2d& V3) { |
108 | |
109 | C->D3(U,P,V1,V2,V3); |
110 | } |
111 | //============================================================ |
112 | inline gp_Vec2d Contap_HCurve2dToolGen::DN (const CurveGen& C, |
113 | const Standard_Real U, |
114 | const Standard_Integer N) { |
115 | |
116 | return(C->DN(U,N)); |
117 | } |
118 | //============================================================ |
119 | inline Standard_Real Contap_HCurve2dToolGen::Resolution(const CurveGen& C, |
120 | const Standard_Real R3d) { |
121 | return(C->Resolution(R3d)); |
122 | } |
123 | //============================================================ |
124 | inline GeomAbs_CurveType Contap_HCurve2dToolGen::GetType(const CurveGen& C) { |
125 | return(C->GetType()); |
126 | } |
127 | //============================================================ |
128 | inline gp_Lin2d Contap_HCurve2dToolGen::Line (const CurveGen& C) { |
129 | return(C->Line()); |
130 | } |
131 | //============================================================ |
132 | inline gp_Circ2d Contap_HCurve2dToolGen::Circle (const CurveGen& C) { |
133 | return(C->Circle()); |
134 | } |
135 | //============================================================ |
136 | inline gp_Elips2d Contap_HCurve2dToolGen::Ellipse (const CurveGen& C) { |
137 | return(C->Ellipse()); |
138 | } |
139 | //============================================================ |
140 | inline gp_Parab2d Contap_HCurve2dToolGen::Parabola (const CurveGen& C) { |
141 | return(C->Parabola()); |
142 | } |
143 | //============================================================ |
144 | inline gp_Hypr2d Contap_HCurve2dToolGen::Hyperbola (const CurveGen& C) { |
145 | return(C->Hyperbola()); |
146 | } |
147 | //============================================================ |
148 | inline Handle(Geom2d_BezierCurve) Contap_HCurve2dToolGen::Bezier (const CurveGen& C) { |
149 | return(C->Bezier()); |
150 | } |
151 | //============================================================ |
152 | inline Handle(Geom2d_BSplineCurve) Contap_HCurve2dToolGen::BSpline (const CurveGen& C) { |
153 | return(C->BSpline()); |
154 | } |
155 | //============================================================ |