1 // Created on: 1993-03-31
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1993-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 _Adaptor3d_Curve_HeaderFile
18 #define _Adaptor3d_Curve_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 <Standard_Boolean.hxx>
29 #include <GeomAbs_CurveType.hxx>
30 class Standard_OutOfRange;
31 class Standard_NoSuchObject;
32 class Standard_DomainError;
33 class Adaptor3d_HCurve;
41 class Geom_BezierCurve;
42 class Geom_BSplineCurve;
45 //! Root class for 3D curves on which geometric
47 //! An adapted curve is an interface between the
48 //! services provided by a curve and those required of
49 //! the curve by algorithms which use it.
50 //! Two derived concrete classes are provided:
51 //! - GeomAdaptor_Curve for a curve from the Geom package
52 //! - Adaptor3d_CurveOnSurface for a curve lying on
53 //! a surface from the Geom package.
61 Standard_EXPORT virtual Standard_Real FirstParameter() const;
63 Standard_EXPORT virtual Standard_Real LastParameter() const;
65 Standard_EXPORT virtual GeomAbs_Shape Continuity() const;
67 //! Returns the number of intervals for continuity
68 //! <S>. May be one if Continuity(me) >= <S>
69 Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
71 //! Stores in <T> the parameters bounding the intervals
72 //! of continuity <S>.
74 //! The array must provide enough room to accomodate
75 //! for the parameters. i.e. T.Length() > NbIntervals()
76 Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
78 //! Returns a curve equivalent of <me> between
79 //! parameters <First> and <Last>. <Tol> is used to
80 //! test for 3d points confusion.
81 //! If <First> >= <Last>
82 Standard_EXPORT virtual Handle(Adaptor3d_HCurve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const;
84 Standard_EXPORT virtual Standard_Boolean IsClosed() const;
86 Standard_EXPORT virtual Standard_Boolean IsPeriodic() const;
88 Standard_EXPORT virtual Standard_Real Period() const;
90 //! Computes the point of parameter U on the curve.
91 Standard_EXPORT virtual gp_Pnt Value (const Standard_Real U) const;
93 //! Computes the point of parameter U on the curve.
94 Standard_EXPORT virtual void D0 (const Standard_Real U, gp_Pnt& P) const;
96 //! Computes the point of parameter U on the curve with its
98 //! Raised if the continuity of the current interval
100 Standard_EXPORT virtual void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V) const;
103 //! Returns the point P of parameter U, the first and second
104 //! derivatives V1 and V2.
105 //! Raised if the continuity of the current interval
107 Standard_EXPORT virtual void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const;
110 //! Returns the point P of parameter U, the first, the second
111 //! and the third derivative.
112 //! Raised if the continuity of the current interval
114 Standard_EXPORT virtual void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const;
117 //! The returned vector gives the value of the derivative for the
118 //! order of derivation N.
119 //! Raised if the continuity of the current interval
122 Standard_EXPORT virtual gp_Vec DN (const Standard_Real U, const Standard_Integer N) const;
124 //! Returns the parametric resolution corresponding
125 //! to the real space resolution <R3d>.
126 Standard_EXPORT virtual Standard_Real Resolution (const Standard_Real R3d) const;
128 //! Returns the type of the curve in the current
129 //! interval : Line, Circle, Ellipse, Hyperbola,
130 //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
131 Standard_EXPORT virtual GeomAbs_CurveType GetType() const;
133 Standard_EXPORT virtual gp_Lin Line() const;
135 Standard_EXPORT virtual gp_Circ Circle() const;
137 Standard_EXPORT virtual gp_Elips Ellipse() const;
139 Standard_EXPORT virtual gp_Hypr Hyperbola() const;
141 Standard_EXPORT virtual gp_Parab Parabola() const;
143 Standard_EXPORT virtual Standard_Integer Degree() const;
145 Standard_EXPORT virtual Standard_Boolean IsRational() const;
147 Standard_EXPORT virtual Standard_Integer NbPoles() const;
149 Standard_EXPORT virtual Standard_Integer NbKnots() const;
151 Standard_EXPORT virtual Handle(Geom_BezierCurve) Bezier() const;
153 Standard_EXPORT virtual Handle(Geom_BSplineCurve) BSpline() const;
154 Standard_EXPORT virtual ~Adaptor3d_Curve();
179 #endif // _Adaptor3d_Curve_HeaderFile