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
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 _Extrema_CurveTool_HeaderFile
18 #define _Extrema_CurveTool_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <GeomAbs_Shape.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 #include <TColStd_HArray1OfReal.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <GeomAbs_CurveType.hxx>
34 #include <gp_Circ.hxx>
35 #include <gp_Elips.hxx>
36 #include <gp_Hypr.hxx>
37 #include <gp_Parab.hxx>
38 class Adaptor3d_Curve;
41 class Geom_BezierCurve;
42 class Geom_BSplineCurve;
46 class Extrema_CurveTool
53 static Standard_Real FirstParameter (const Adaptor3d_Curve& C);
55 static Standard_Real LastParameter (const Adaptor3d_Curve& C);
57 static GeomAbs_Shape Continuity (const Adaptor3d_Curve& C);
59 //! Returns the number of intervals for continuity
60 //! <S>. May be one if Continuity(me) >= <S>
61 static Standard_Integer NbIntervals (Adaptor3d_Curve& C, const GeomAbs_Shape S);
63 //! Stores in <T> the parameters bounding the intervals
64 //! of continuity <S>.
66 //! The array must provide enough room to accomodate
67 //! for the parameters. i.e. T.Length() > NbIntervals()
68 static void Intervals (Adaptor3d_Curve& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);
70 //! Returns the parameters bounding the intervals of subdivision of curve
71 //! according to Curvature deflection. Value of deflection is defined in method.
73 Standard_EXPORT static Handle(TColStd_HArray1OfReal) DeflCurvIntervals(const Adaptor3d_Curve& C);
75 Standard_EXPORT static Standard_Boolean IsPeriodic (const Adaptor3d_Curve& C);
77 static Standard_Real Period (const Adaptor3d_Curve& C);
79 static Standard_Real Resolution (const Adaptor3d_Curve& C, const Standard_Real R3d);
81 static GeomAbs_CurveType GetType (const Adaptor3d_Curve& C);
83 static gp_Pnt Value (const Adaptor3d_Curve& C, const Standard_Real U);
85 static void D0 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P);
87 static void D1 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
89 static void D2 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
91 static void D3 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
93 static gp_Vec DN (const Adaptor3d_Curve& C, const Standard_Real U, const Standard_Integer N);
95 static gp_Lin Line (const Adaptor3d_Curve& C);
97 static gp_Circ Circle (const Adaptor3d_Curve& C);
99 static gp_Elips Ellipse (const Adaptor3d_Curve& C);
101 static gp_Hypr Hyperbola (const Adaptor3d_Curve& C);
103 static gp_Parab Parabola (const Adaptor3d_Curve& C);
105 static Standard_Integer Degree (const Adaptor3d_Curve& C);
107 static Standard_Boolean IsRational (const Adaptor3d_Curve& C);
109 static Standard_Integer NbPoles (const Adaptor3d_Curve& C);
111 static Standard_Integer NbKnots (const Adaptor3d_Curve& C);
113 static Handle(Geom_BezierCurve) Bezier (const Adaptor3d_Curve& C);
115 static Handle(Geom_BSplineCurve) BSpline (const Adaptor3d_Curve& C);
135 #include <Extrema_CurveTool.lxx>
141 #endif // _Extrema_CurveTool_HeaderFile