42cf5bc1 |
1 | // Created on: 1995-07-18 |
2 | // Created by: Modelistation |
3 | // Copyright (c) 1995-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 _Extrema_CurveTool_HeaderFile |
18 | #define _Extrema_CurveTool_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Real.hxx> |
25 | #include <GeomAbs_Shape.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <TColStd_Array1OfReal.hxx> |
28 | #include <Standard_Boolean.hxx> |
29 | #include <GeomAbs_CurveType.hxx> |
30 | #include <gp_Pnt.hxx> |
31 | #include <gp_Vec.hxx> |
32 | #include <gp_Lin.hxx> |
33 | #include <gp_Circ.hxx> |
34 | #include <gp_Elips.hxx> |
35 | #include <gp_Hypr.hxx> |
36 | #include <gp_Parab.hxx> |
37 | class Adaptor3d_Curve; |
38 | class gp_Pnt; |
39 | class gp_Vec; |
40 | class Geom_BezierCurve; |
41 | class Geom_BSplineCurve; |
42 | |
43 | |
44 | |
45 | class Extrema_CurveTool |
46 | { |
47 | public: |
48 | |
49 | DEFINE_STANDARD_ALLOC |
50 | |
51 | |
52 | static Standard_Real FirstParameter (const Adaptor3d_Curve& C); |
53 | |
54 | static Standard_Real LastParameter (const Adaptor3d_Curve& C); |
55 | |
56 | static GeomAbs_Shape Continuity (const Adaptor3d_Curve& C); |
57 | |
58 | //! Returns the number of intervals for continuity |
59 | //! <S>. May be one if Continuity(me) >= <S> |
60 | static Standard_Integer NbIntervals (Adaptor3d_Curve& C, const GeomAbs_Shape S); |
61 | |
62 | //! Stores in <T> the parameters bounding the intervals |
63 | //! of continuity <S>. |
64 | //! |
65 | //! The array must provide enough room to accomodate |
66 | //! for the parameters. i.e. T.Length() > NbIntervals() |
67 | static void Intervals (Adaptor3d_Curve& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S); |
68 | |
69 | Standard_EXPORT static Standard_Boolean IsPeriodic (const Adaptor3d_Curve& C); |
70 | |
71 | static Standard_Real Period (const Adaptor3d_Curve& C); |
72 | |
73 | static Standard_Real Resolution (const Adaptor3d_Curve& C, const Standard_Real R3d); |
74 | |
75 | static GeomAbs_CurveType GetType (const Adaptor3d_Curve& C); |
76 | |
77 | static gp_Pnt Value (const Adaptor3d_Curve& C, const Standard_Real U); |
78 | |
79 | static void D0 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P); |
80 | |
81 | static void D1 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V); |
82 | |
83 | static void D2 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2); |
84 | |
85 | static void D3 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3); |
86 | |
87 | static gp_Vec DN (const Adaptor3d_Curve& C, const Standard_Real U, const Standard_Integer N); |
88 | |
89 | static gp_Lin Line (const Adaptor3d_Curve& C); |
90 | |
91 | static gp_Circ Circle (const Adaptor3d_Curve& C); |
92 | |
93 | static gp_Elips Ellipse (const Adaptor3d_Curve& C); |
94 | |
95 | static gp_Hypr Hyperbola (const Adaptor3d_Curve& C); |
96 | |
97 | static gp_Parab Parabola (const Adaptor3d_Curve& C); |
98 | |
99 | static Standard_Integer Degree (const Adaptor3d_Curve& C); |
100 | |
101 | static Standard_Boolean IsRational (const Adaptor3d_Curve& C); |
102 | |
103 | static Standard_Integer NbPoles (const Adaptor3d_Curve& C); |
104 | |
105 | static Standard_Integer NbKnots (const Adaptor3d_Curve& C); |
106 | |
107 | static Handle(Geom_BezierCurve) Bezier (const Adaptor3d_Curve& C); |
108 | |
109 | static Handle(Geom_BSplineCurve) BSpline (const Adaptor3d_Curve& C); |
110 | |
111 | |
112 | |
113 | |
114 | protected: |
115 | |
116 | |
117 | |
118 | |
119 | |
120 | private: |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | }; |
127 | |
128 | |
129 | #include <Extrema_CurveTool.lxx> |
130 | |
131 | |
132 | |
133 | |
134 | |
135 | #endif // _Extrema_CurveTool_HeaderFile |