1 // Created on: 1994-02-23
3 // Copyright (c) 1994-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_HCurve_HeaderFile
18 #define _Adaptor3d_HCurve_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Transient.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>
31 #include <GeomAbs_CurveType.hxx>
33 #include <gp_Circ.hxx>
34 #include <gp_Elips.hxx>
35 #include <gp_Hypr.hxx>
36 #include <gp_Parab.hxx>
37 class Standard_OutOfRange;
38 class Standard_NoSuchObject;
39 class Standard_DomainError;
40 class Adaptor3d_Curve;
43 class Geom_BezierCurve;
44 class Geom_BSplineCurve;
45 class Geom_OffsetCurve;
48 class Adaptor3d_HCurve;
49 DEFINE_STANDARD_HANDLE(Adaptor3d_HCurve, Standard_Transient)
51 //! Root class for 3D curves manipulated by handles, on
52 //! which geometric algorithms work.
53 //! An adapted curve is an interface between the
54 //! services provided by a curve and those required of
55 //! the curve by algorithms which use it.
56 //! Two derived concrete classes are provided:
57 //! - GeomAdaptor_HCurve for a curve from the Geom package
58 //! - Adaptor3d_HCurveOnSurface for a curve lying
59 //! on a surface from the Geom package.
60 class Adaptor3d_HCurve : public Standard_Transient
66 //! Returns a pointer to the Curve inside the HCurve.
67 Standard_EXPORT virtual const Adaptor3d_Curve& Curve() const = 0;
69 //! Returns a pointer to the Curve inside the HCurve.
70 Standard_EXPORT virtual Adaptor3d_Curve& GetCurve() = 0;
72 Standard_Real FirstParameter() const;
74 Standard_Real LastParameter() const;
76 GeomAbs_Shape Continuity() const;
78 Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
80 //! Stores in <T> the parameters bounding the intervals
81 //! of continuity <S>.
83 //! The array must provide enough room to accomodate
84 //! for the parameters. i.e. T.Length() > NbIntervals()
85 void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
87 //! Returns a curve equivalent of <me> between
88 //! parameters <First> and <Last>. <Tol> is used to
89 //! test for 3d points confusion.
91 //! If <First> >= <Last>
92 Handle(Adaptor3d_HCurve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const;
94 Standard_Boolean IsClosed() const;
96 Standard_Boolean IsPeriodic() const;
98 Standard_Real Period() const;
100 gp_Pnt Value (const Standard_Real U) const;
102 void D0 (const Standard_Real U, gp_Pnt& P) const;
104 void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V) const;
106 void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const;
108 void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const;
110 gp_Vec DN (const Standard_Real U, const Standard_Integer N) const;
112 Standard_Real Resolution (const Standard_Real R3d) const;
114 GeomAbs_CurveType GetType() const;
118 gp_Circ Circle() const;
120 gp_Elips Ellipse() const;
122 gp_Hypr Hyperbola() const;
124 gp_Parab Parabola() const;
126 Standard_Integer Degree() const;
128 Standard_Boolean IsRational() const;
130 Standard_Integer NbPoles() const;
132 Standard_Integer NbKnots() const;
134 Handle(Geom_BezierCurve) Bezier() const;
136 Handle(Geom_BSplineCurve) BSpline() const;
138 Handle(Geom_OffsetCurve) OffsetCurve() const;
141 DEFINE_STANDARD_RTTIEXT(Adaptor3d_HCurve,Standard_Transient)
156 #include <Adaptor3d_HCurve.lxx>
162 #endif // _Adaptor3d_HCurve_HeaderFile