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 <GeomAbs_CurveType.hxx>
18 #include <GeomAbs_Shape.hxx>
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>
26 #include <TColStd_Array1OfReal.hxx>
27 #include <Adaptor2d_Curve2d.hxx>
29 #define IS_C2_COMPOSITE 0
30 //============================================================
31 inline GeomAbs_CurveType Geom2dInt_Geom2dCurveTool::GetType(const Adaptor2d_Curve2d& C) {
34 //============================================================
35 inline gp_Lin2d Geom2dInt_Geom2dCurveTool::Line (const Adaptor2d_Curve2d& C) {
38 //============================================================
39 inline gp_Circ2d Geom2dInt_Geom2dCurveTool::Circle (const Adaptor2d_Curve2d& C) {
42 //============================================================
43 inline gp_Elips2d Geom2dInt_Geom2dCurveTool::Ellipse (const Adaptor2d_Curve2d& C) {
46 //============================================================
47 inline gp_Parab2d Geom2dInt_Geom2dCurveTool::Parabola (const Adaptor2d_Curve2d& C) {
50 //============================================================
51 inline gp_Hypr2d Geom2dInt_Geom2dCurveTool::Hyperbola (const Adaptor2d_Curve2d& C) {
52 return(C.Hyperbola());
54 //============================================================
55 inline gp_Pnt2d Geom2dInt_Geom2dCurveTool::Value (const Adaptor2d_Curve2d& C,
56 const Standard_Real U) {
59 //============================================================
60 inline void Geom2dInt_Geom2dCurveTool::D0(const Adaptor2d_Curve2d& C,
61 const Standard_Real U,
65 //============================================================
66 inline void Geom2dInt_Geom2dCurveTool::D1 (const Adaptor2d_Curve2d& C,
67 const Standard_Real U,
72 //============================================================
73 inline void Geom2dInt_Geom2dCurveTool::D2 (const Adaptor2d_Curve2d& C,
74 const Standard_Real U,
82 //============================================================
83 inline void Geom2dInt_Geom2dCurveTool::D3 (const Adaptor2d_Curve2d& C,
84 const Standard_Real U,
92 //============================================================
93 inline gp_Vec2d Geom2dInt_Geom2dCurveTool::DN(const Adaptor2d_Curve2d& C,
94 const Standard_Real U,
95 const Standard_Integer N)
100 //============================================================
101 inline Standard_Real Geom2dInt_Geom2dCurveTool::FirstParameter (const Adaptor2d_Curve2d& C) {
102 return(C.FirstParameter());
104 //============================================================
105 inline Standard_Real Geom2dInt_Geom2dCurveTool::LastParameter (const Adaptor2d_Curve2d& C) {
106 return(C.LastParameter());
108 //============================================================
109 //== tolerance used by mathemetical algorithms
111 inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX (const Adaptor2d_Curve2d& ) {
114 //------------------------------------------------------------
115 inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX (const Adaptor2d_Curve2d& C,const Standard_Real Eps_XYZ) {
116 return(C.Resolution(Eps_XYZ));
118 //============================================================
119 inline void Geom2dInt_Geom2dCurveTool::Intervals(const Adaptor2d_Curve2d& C,
120 TColStd_Array1OfReal& Tab) {
122 C.Intervals(Tab,GeomAbs_C2);
124 C.Intervals(Tab,GeomAbs_C1);
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,
137 //============================================================
138 inline Standard_Integer Geom2dInt_Geom2dCurveTool::NbIntervals(const Adaptor2d_Curve2d& C) {
139 Standard_Integer N=1;
141 N = C.NbIntervals(GeomAbs_C2);
143 N = C.NbIntervals(GeomAbs_C1);
147 //============================================================
149 inline Standard_Integer Geom2dInt_Geom2dCurveTool::Degree(const Adaptor2d_Curve2d& C)