Commit | Line | Data |
---|---|---|
42cf5bc1 | 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 | |
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 _Adaptor3d_Curve_HeaderFile | |
18 | #define _Adaptor3d_Curve_HeaderFile | |
19 | ||
c22b52d6 | 20 | #include <gp_Circ.hxx> |
21 | #include <gp_Elips.hxx> | |
22 | #include <gp_Hypr.hxx> | |
23 | #include <gp_Parab.hxx> | |
24 | #include <GeomAbs_Shape.hxx> | |
42cf5bc1 | 25 | #include <Standard.hxx> |
26 | #include <Standard_DefineAlloc.hxx> | |
27 | #include <Standard_Handle.hxx> | |
42cf5bc1 | 28 | #include <TColStd_Array1OfReal.hxx> |
42cf5bc1 | 29 | #include <GeomAbs_CurveType.hxx> |
c22b52d6 | 30 | |
42cf5bc1 | 31 | class gp_Pnt; |
32 | class gp_Vec; | |
42cf5bc1 | 33 | class Geom_BezierCurve; |
34 | class Geom_BSplineCurve; | |
f4dee9bb | 35 | class Geom_OffsetCurve; |
42cf5bc1 | 36 | |
c22b52d6 | 37 | DEFINE_STANDARD_HANDLE(Adaptor3d_Curve, Standard_Transient) |
42cf5bc1 | 38 | |
39 | //! Root class for 3D curves on which geometric | |
40 | //! algorithms work. | |
41 | //! An adapted curve is an interface between the | |
42 | //! services provided by a curve and those required of | |
43 | //! the curve by algorithms which use it. | |
44 | //! Two derived concrete classes are provided: | |
45 | //! - GeomAdaptor_Curve for a curve from the Geom package | |
46 | //! - Adaptor3d_CurveOnSurface for a curve lying on | |
47 | //! a surface from the Geom package. | |
34e4e9f2 BB |
48 | //! |
49 | //! Polynomial coefficients of BSpline curves used for their evaluation are | |
50 | //! cached for better performance. Therefore these evaluations are not | |
51 | //! thread-safe and parallel evaluations need to be prevented. | |
c22b52d6 | 52 | class Adaptor3d_Curve : public Standard_Transient |
42cf5bc1 | 53 | { |
c22b52d6 | 54 | DEFINE_STANDARD_RTTIEXT(Adaptor3d_Curve, Standard_Transient) |
42cf5bc1 | 55 | public: |
56 | ||
872a7e3a | 57 | //! Shallow copy of adaptor |
58 | Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const; | |
59 | ||
42cf5bc1 | 60 | Standard_EXPORT virtual Standard_Real FirstParameter() const; |
61 | ||
62 | Standard_EXPORT virtual Standard_Real LastParameter() const; | |
63 | ||
64 | Standard_EXPORT virtual GeomAbs_Shape Continuity() const; | |
65 | ||
66 | //! Returns the number of intervals for continuity | |
67 | //! <S>. May be one if Continuity(me) >= <S> | |
68 | Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const; | |
69 | ||
70 | //! Stores in <T> the parameters bounding the intervals | |
71 | //! of continuity <S>. | |
72 | //! | |
21c7c457 | 73 | //! The array must provide enough room to accommodate |
42cf5bc1 | 74 | //! for the parameters. i.e. T.Length() > NbIntervals() |
75 | Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const; | |
76 | ||
77 | //! Returns a curve equivalent of <me> between | |
78 | //! parameters <First> and <Last>. <Tol> is used to | |
79 | //! test for 3d points confusion. | |
80 | //! If <First> >= <Last> | |
c22b52d6 | 81 | Standard_EXPORT virtual Handle(Adaptor3d_Curve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const; |
42cf5bc1 | 82 | |
83 | Standard_EXPORT virtual Standard_Boolean IsClosed() const; | |
84 | ||
85 | Standard_EXPORT virtual Standard_Boolean IsPeriodic() const; | |
86 | ||
87 | Standard_EXPORT virtual Standard_Real Period() const; | |
88 | ||
89 | //! Computes the point of parameter U on the curve. | |
90 | Standard_EXPORT virtual gp_Pnt Value (const Standard_Real U) const; | |
91 | ||
92 | //! Computes the point of parameter U on the curve. | |
93 | Standard_EXPORT virtual void D0 (const Standard_Real U, gp_Pnt& P) const; | |
94 | ||
95 | //! Computes the point of parameter U on the curve with its | |
96 | //! first derivative. | |
97 | //! Raised if the continuity of the current interval | |
98 | //! is not C1. | |
99 | Standard_EXPORT virtual void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V) const; | |
100 | ||
101 | ||
102 | //! Returns the point P of parameter U, the first and second | |
103 | //! derivatives V1 and V2. | |
104 | //! Raised if the continuity of the current interval | |
105 | //! is not C2. | |
106 | Standard_EXPORT virtual void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const; | |
107 | ||
108 | ||
109 | //! Returns the point P of parameter U, the first, the second | |
110 | //! and the third derivative. | |
111 | //! Raised if the continuity of the current interval | |
112 | //! is not C3. | |
113 | Standard_EXPORT virtual void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const; | |
114 | ||
115 | ||
116 | //! The returned vector gives the value of the derivative for the | |
117 | //! order of derivation N. | |
118 | //! Raised if the continuity of the current interval | |
119 | //! is not CN. | |
120 | //! Raised if N < 1. | |
121 | Standard_EXPORT virtual gp_Vec DN (const Standard_Real U, const Standard_Integer N) const; | |
122 | ||
123 | //! Returns the parametric resolution corresponding | |
124 | //! to the real space resolution <R3d>. | |
125 | Standard_EXPORT virtual Standard_Real Resolution (const Standard_Real R3d) const; | |
126 | ||
127 | //! Returns the type of the curve in the current | |
128 | //! interval : Line, Circle, Ellipse, Hyperbola, | |
129 | //! Parabola, BezierCurve, BSplineCurve, OtherCurve. | |
130 | Standard_EXPORT virtual GeomAbs_CurveType GetType() const; | |
131 | ||
132 | Standard_EXPORT virtual gp_Lin Line() const; | |
133 | ||
134 | Standard_EXPORT virtual gp_Circ Circle() const; | |
135 | ||
136 | Standard_EXPORT virtual gp_Elips Ellipse() const; | |
137 | ||
138 | Standard_EXPORT virtual gp_Hypr Hyperbola() const; | |
139 | ||
140 | Standard_EXPORT virtual gp_Parab Parabola() const; | |
141 | ||
142 | Standard_EXPORT virtual Standard_Integer Degree() const; | |
143 | ||
144 | Standard_EXPORT virtual Standard_Boolean IsRational() const; | |
145 | ||
146 | Standard_EXPORT virtual Standard_Integer NbPoles() const; | |
147 | ||
148 | Standard_EXPORT virtual Standard_Integer NbKnots() const; | |
149 | ||
150 | Standard_EXPORT virtual Handle(Geom_BezierCurve) Bezier() const; | |
151 | ||
152 | Standard_EXPORT virtual Handle(Geom_BSplineCurve) BSpline() const; | |
f4dee9bb | 153 | |
154 | Standard_EXPORT virtual Handle(Geom_OffsetCurve) OffsetCurve() const; | |
155 | ||
42cf5bc1 | 156 | Standard_EXPORT virtual ~Adaptor3d_Curve(); |
157 | ||
42cf5bc1 | 158 | }; |
159 | ||
42cf5bc1 | 160 | #endif // _Adaptor3d_Curve_HeaderFile |