0025076: Hidden overloaded virtual functions
[occt.git] / src / Geom2dInt / Geom2dInt_Geom2dCurveTool.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 <GeomAbs_CurveType.hxx>
18 #include <GeomAbs_Shape.hxx>
19
20 #include <gp_Lin2d.hxx>
21 #include <gp_Circ2d.hxx>
22 #include <gp_Elips2d.hxx>
23 #include <gp_Parab2d.hxx>
24 #include <gp_Hypr2d.hxx>
25
26 #include <TColStd_Array1OfReal.hxx>
27 #include <Adaptor2d_Curve2d.hxx>
28
29 #define   IS_C2_COMPOSITE 0
30 //============================================================
31 inline GeomAbs_CurveType Geom2dInt_Geom2dCurveTool::GetType(const Adaptor2d_Curve2d& C) {
32   return(C.GetType());
33 }
34 //============================================================
35 inline gp_Lin2d Geom2dInt_Geom2dCurveTool::Line (const Adaptor2d_Curve2d& C) {
36   return(C.Line());
37 }
38 //============================================================
39 inline gp_Circ2d Geom2dInt_Geom2dCurveTool::Circle (const Adaptor2d_Curve2d& C) {
40   return(C.Circle());
41 }
42 //============================================================
43 inline gp_Elips2d Geom2dInt_Geom2dCurveTool::Ellipse (const Adaptor2d_Curve2d& C) {
44   return(C.Ellipse());
45 }
46 //============================================================
47 inline gp_Parab2d Geom2dInt_Geom2dCurveTool::Parabola (const Adaptor2d_Curve2d& C) {
48   return(C.Parabola());
49 }
50 //============================================================
51 inline gp_Hypr2d Geom2dInt_Geom2dCurveTool::Hyperbola (const Adaptor2d_Curve2d& C) {
52   return(C.Hyperbola());
53 }
54 //============================================================
55 inline gp_Pnt2d Geom2dInt_Geom2dCurveTool::Value (const Adaptor2d_Curve2d& C,
56                                             const Standard_Real U) {
57   return(C.Value(U));
58 }
59 //============================================================
60 inline void Geom2dInt_Geom2dCurveTool::D0(const Adaptor2d_Curve2d& C,
61                                     const Standard_Real U,
62                                     gp_Pnt2d& P) {
63   C.D0(U,P);
64 }
65 //============================================================
66 inline void Geom2dInt_Geom2dCurveTool::D1 (const Adaptor2d_Curve2d& C,
67                                      const Standard_Real U,
68                                      gp_Pnt2d& P,
69                                      gp_Vec2d& T) {
70   C.D1(U,P,T);
71 }
72 //============================================================
73 inline void Geom2dInt_Geom2dCurveTool::D2 (const Adaptor2d_Curve2d& C,
74                                      const Standard_Real U,
75                                      gp_Pnt2d& P,
76                                      gp_Vec2d& T,
77                                      gp_Vec2d& N) {
78   
79  C.D2(U,P,T,N);
80 }
81
82 //============================================================
83 inline void Geom2dInt_Geom2dCurveTool::D3 (const Adaptor2d_Curve2d& C,
84                                      const Standard_Real U,
85                                      gp_Pnt2d& P,
86                                      gp_Vec2d& T,
87                                      gp_Vec2d& N,
88                                      gp_Vec2d& V) {
89   
90  C.D3(U,P,T,N,V);
91 }
92 //============================================================
93 inline gp_Vec2d Geom2dInt_Geom2dCurveTool::DN(const Adaptor2d_Curve2d& C,
94              const Standard_Real U,
95              const Standard_Integer N)
96   {
97   return C.DN(U,N);  
98   }
99
100 //============================================================
101 inline Standard_Real Geom2dInt_Geom2dCurveTool::FirstParameter (const Adaptor2d_Curve2d& C) {
102   return(C.FirstParameter());
103 }
104 //============================================================
105 inline Standard_Real Geom2dInt_Geom2dCurveTool::LastParameter (const Adaptor2d_Curve2d& C) {
106   return(C.LastParameter());
107 }
108 //============================================================
109 //== tolerance used by mathemetical algorithms 
110 //== 
111 inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX (const Adaptor2d_Curve2d& ) {
112   return(1.0e-10);
113 }
114 //------------------------------------------------------------
115 inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX (const Adaptor2d_Curve2d& C,const Standard_Real Eps_XYZ) {
116   return(C.Resolution(Eps_XYZ));
117 }
118 //============================================================
119 inline void Geom2dInt_Geom2dCurveTool::Intervals(const Adaptor2d_Curve2d& C,
120                                            TColStd_Array1OfReal& Tab) { 
121 #if IS_C2_COMPOSITE
122   C.Intervals(Tab,GeomAbs_C2);
123 #else
124   C.Intervals(Tab,GeomAbs_C1);
125 #endif
126 }
127 //============================================================
128 //inline void Geom2dInt_Geom2dCurveTool::GetInterval(const Adaptor2d_Curve2d& C,
129 inline void Geom2dInt_Geom2dCurveTool::GetInterval(const Adaptor2d_Curve2d& ,
130                                              const Standard_Integer i,
131                                              const TColStd_Array1OfReal& Tab,
132                                              Standard_Real& a,
133                                              Standard_Real& b) {
134   a = Tab.Value(i);
135   b = Tab.Value(i+1);
136 }
137 //============================================================
138 inline Standard_Integer Geom2dInt_Geom2dCurveTool::NbIntervals(const Adaptor2d_Curve2d& C) {
139   Standard_Integer N=1;
140 #if IS_C2_COMPOSITE
141   N = C.NbIntervals(GeomAbs_C2);
142 #else
143   N = C.NbIntervals(GeomAbs_C1);
144 #endif
145   return(N);
146 }
147 //============================================================
148
149  inline Standard_Integer Geom2dInt_Geom2dCurveTool::Degree(const Adaptor2d_Curve2d& C)
150 {
151   return C.Degree();
152 }