42cf5bc1 |
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 | #ifndef _Geom2dInt_Geom2dCurveTool_HeaderFile |
18 | #define _Geom2dInt_Geom2dCurveTool_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
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; |
37 | class gp_Pnt2d; |
38 | class gp_Vec2d; |
39 | |
40 | |
41 | //! This class provides a Geom2dCurveTool as < Geom2dCurveTool from IntCurve > |
42 | //! from a Tool as < Geom2dCurveTool from Adaptor3d > . |
43 | class Geom2dInt_Geom2dCurveTool |
44 | { |
45 | public: |
46 | |
47 | DEFINE_STANDARD_ALLOC |
48 | |
49 | |
50 | static GeomAbs_CurveType GetType (const Adaptor2d_Curve2d& C); |
51 | |
52 | static Standard_Boolean IsComposite (const Adaptor2d_Curve2d& C); |
53 | |
54 | //! Returns the Lin2d from gp corresponding to the curve C. |
55 | //! This method is called only when TheType returns |
56 | //! GeomAbs_Line. |
57 | static gp_Lin2d Line (const Adaptor2d_Curve2d& C); |
58 | |
59 | //! Returns the Circ2d from gp corresponding to the curve C. |
60 | //! This method is called only when TheType returns |
61 | //! GeomAbs_Circle. |
62 | static gp_Circ2d Circle (const Adaptor2d_Curve2d& C); |
63 | |
64 | //! Returns the Elips2d from gp corresponding to the curve C. |
65 | //! This method is called only when TheType returns |
66 | //! GeomAbs_Ellipse. |
67 | static gp_Elips2d Ellipse (const Adaptor2d_Curve2d& C); |
68 | |
69 | //! Returns the Parab2d from gp corresponding to the curve C. |
70 | //! This method is called only when TheType returns |
71 | //! GeomAbs_Parabola. |
72 | static gp_Parab2d Parabola (const Adaptor2d_Curve2d& C); |
73 | |
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); |
78 | |
79 | static Standard_Real EpsX (const Adaptor2d_Curve2d& C); |
80 | |
81 | static Standard_Real EpsX (const Adaptor2d_Curve2d& C, const Standard_Real Eps_XYZ); |
82 | |
83 | Standard_EXPORT static Standard_Integer NbSamples (const Adaptor2d_Curve2d& C); |
84 | |
85 | Standard_EXPORT static Standard_Integer NbSamples (const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real U1); |
86 | |
87 | static Standard_Real FirstParameter (const Adaptor2d_Curve2d& C); |
88 | |
89 | static Standard_Real LastParameter (const Adaptor2d_Curve2d& C); |
90 | |
91 | static gp_Pnt2d Value (const Adaptor2d_Curve2d& C, const Standard_Real X); |
92 | |
93 | static void D0 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P); |
94 | |
95 | static void D1 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T); |
96 | |
97 | static void D2 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T, gp_Vec2d& N); |
98 | |
99 | static void D3 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T, gp_Vec2d& N, gp_Vec2d& V); |
100 | |
101 | static gp_Vec2d DN (const Adaptor2d_Curve2d& C, const Standard_Real U, const Standard_Integer N); |
102 | |
103 | //! output the number of interval of continuity C2 of |
104 | //! the curve |
105 | static Standard_Integer NbIntervals (const Adaptor2d_Curve2d& C); |
106 | |
107 | //! compute Tab. |
108 | static void Intervals (const Adaptor2d_Curve2d& C, TColStd_Array1OfReal& Tab); |
109 | |
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); |
113 | |
114 | static Standard_Integer Degree (const Adaptor2d_Curve2d& C); |
115 | |
116 | |
117 | |
118 | |
119 | protected: |
120 | |
121 | |
122 | |
123 | |
124 | |
125 | private: |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | }; |
132 | |
133 | |
134 | #include <Geom2dInt_Geom2dCurveTool.lxx> |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | #endif // _Geom2dInt_Geom2dCurveTool_HeaderFile |