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