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 #ifndef _Geom2dInt_Geom2dCurveTool_HeaderFile
18 #define _Geom2dInt_Geom2dCurveTool_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <GeomAbs_CurveType.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <gp_Lin2d.hxx>
27 #include <gp_Circ2d.hxx>
28 #include <gp_Elips2d.hxx>
29 #include <gp_Parab2d.hxx>
30 #include <gp_Hypr2d.hxx>
31 #include <Standard_Real.hxx>
32 #include <Standard_Integer.hxx>
33 #include <gp_Pnt2d.hxx>
34 #include <gp_Vec2d.hxx>
35 #include <TColStd_Array1OfReal.hxx>
36 class Adaptor2d_Curve2d;
41 //! This class provides a Geom2dCurveTool as < Geom2dCurveTool from IntCurve >
42 //! from a Tool as < Geom2dCurveTool from Adaptor3d > .
43 class Geom2dInt_Geom2dCurveTool
50 static GeomAbs_CurveType GetType (const Adaptor2d_Curve2d& C);
52 static Standard_Boolean IsComposite (const Adaptor2d_Curve2d& C);
54 //! Returns the Lin2d from gp corresponding to the curve C.
55 //! This method is called only when TheType returns
57 static gp_Lin2d Line (const Adaptor2d_Curve2d& C);
59 //! Returns the Circ2d from gp corresponding to the curve C.
60 //! This method is called only when TheType returns
62 static gp_Circ2d Circle (const Adaptor2d_Curve2d& C);
64 //! Returns the Elips2d from gp corresponding to the curve C.
65 //! This method is called only when TheType returns
67 static gp_Elips2d Ellipse (const Adaptor2d_Curve2d& C);
69 //! Returns the Parab2d from gp corresponding to the curve C.
70 //! This method is called only when TheType returns
72 static gp_Parab2d Parabola (const Adaptor2d_Curve2d& C);
74 //! Returns the Hypr2d from gp corresponding to the curve C.
75 //! This method is called only when TheType returns
76 //! GeomAbs_Hyperbola.
77 static gp_Hypr2d Hyperbola (const Adaptor2d_Curve2d& C);
79 static Standard_Real EpsX (const Adaptor2d_Curve2d& C);
81 static Standard_Real EpsX (const Adaptor2d_Curve2d& C, const Standard_Real Eps_XYZ);
83 Standard_EXPORT static Standard_Integer NbSamples (const Adaptor2d_Curve2d& C);
85 Standard_EXPORT static Standard_Integer NbSamples (const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real U1);
87 static Standard_Real FirstParameter (const Adaptor2d_Curve2d& C);
89 static Standard_Real LastParameter (const Adaptor2d_Curve2d& C);
91 static gp_Pnt2d Value (const Adaptor2d_Curve2d& C, const Standard_Real X);
93 static void D0 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P);
95 static void D1 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T);
97 static void D2 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T, gp_Vec2d& N);
99 static void D3 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T, gp_Vec2d& N, gp_Vec2d& V);
101 static gp_Vec2d DN (const Adaptor2d_Curve2d& C, const Standard_Real U, const Standard_Integer N);
103 //! output the number of interval of continuity C2 of
105 static Standard_Integer NbIntervals (const Adaptor2d_Curve2d& C);
108 static void Intervals (const Adaptor2d_Curve2d& C, TColStd_Array1OfReal& Tab);
110 //! output the bounds of interval of index <Index>
111 //! used if Type == Composite.
112 static void GetInterval (const Adaptor2d_Curve2d& C, const Standard_Integer Index, const TColStd_Array1OfReal& Tab, Standard_Real& U1, Standard_Real& U2);
114 static Standard_Integer Degree (const Adaptor2d_Curve2d& C);
134 #include <Geom2dInt_Geom2dCurveTool.lxx>
140 #endif // _Geom2dInt_Geom2dCurveTool_HeaderFile