42cf5bc1 |
1 | // Created on: 1994-02-23 |
2 | // Created by: model |
3 | // Copyright (c) 1994-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_HCurve_HeaderFile |
18 | #define _Adaptor3d_HCurve_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
25e59720 |
23 | #include <Standard_Transient.hxx> |
42cf5bc1 |
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 <gp_Pnt.hxx> |
30 | #include <gp_Vec.hxx> |
31 | #include <GeomAbs_CurveType.hxx> |
32 | #include <gp_Lin.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; |
41 | class gp_Pnt; |
42 | class gp_Vec; |
43 | class Geom_BezierCurve; |
44 | class Geom_BSplineCurve; |
f4dee9bb |
45 | class Geom_OffsetCurve; |
42cf5bc1 |
46 | |
47 | |
48 | class Adaptor3d_HCurve; |
25e59720 |
49 | DEFINE_STANDARD_HANDLE(Adaptor3d_HCurve, Standard_Transient) |
42cf5bc1 |
50 | |
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. |
25e59720 |
60 | class Adaptor3d_HCurve : public Standard_Transient |
42cf5bc1 |
61 | { |
62 | |
63 | public: |
64 | |
65 | |
66 | //! Returns a pointer to the Curve inside the HCurve. |
67 | Standard_EXPORT virtual const Adaptor3d_Curve& Curve() const = 0; |
68 | |
69 | //! Returns a pointer to the Curve inside the HCurve. |
70 | Standard_EXPORT virtual Adaptor3d_Curve& GetCurve() = 0; |
71 | |
72 | Standard_Real FirstParameter() const; |
73 | |
74 | Standard_Real LastParameter() const; |
75 | |
76 | GeomAbs_Shape Continuity() const; |
77 | |
78 | Standard_Integer NbIntervals (const GeomAbs_Shape S) const; |
79 | |
80 | //! Stores in <T> the parameters bounding the intervals |
81 | //! of continuity <S>. |
82 | //! |
21c7c457 |
83 | //! The array must provide enough room to accommodate |
42cf5bc1 |
84 | //! for the parameters. i.e. T.Length() > NbIntervals() |
85 | void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const; |
86 | |
87 | //! Returns a curve equivalent of <me> between |
88 | //! parameters <First> and <Last>. <Tol> is used to |
89 | //! test for 3d points confusion. |
90 | //! |
91 | //! If <First> >= <Last> |
92 | Handle(Adaptor3d_HCurve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const; |
93 | |
94 | Standard_Boolean IsClosed() const; |
95 | |
96 | Standard_Boolean IsPeriodic() const; |
97 | |
98 | Standard_Real Period() const; |
99 | |
100 | gp_Pnt Value (const Standard_Real U) const; |
101 | |
102 | void D0 (const Standard_Real U, gp_Pnt& P) const; |
103 | |
104 | void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V) const; |
105 | |
106 | void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const; |
107 | |
108 | void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const; |
109 | |
110 | gp_Vec DN (const Standard_Real U, const Standard_Integer N) const; |
111 | |
112 | Standard_Real Resolution (const Standard_Real R3d) const; |
113 | |
114 | GeomAbs_CurveType GetType() const; |
115 | |
116 | gp_Lin Line() const; |
117 | |
118 | gp_Circ Circle() const; |
119 | |
120 | gp_Elips Ellipse() const; |
121 | |
122 | gp_Hypr Hyperbola() const; |
123 | |
124 | gp_Parab Parabola() const; |
125 | |
126 | Standard_Integer Degree() const; |
127 | |
128 | Standard_Boolean IsRational() const; |
129 | |
130 | Standard_Integer NbPoles() const; |
131 | |
132 | Standard_Integer NbKnots() const; |
133 | |
134 | Handle(Geom_BezierCurve) Bezier() const; |
135 | |
136 | Handle(Geom_BSplineCurve) BSpline() const; |
137 | |
f4dee9bb |
138 | Handle(Geom_OffsetCurve) OffsetCurve() const; |
42cf5bc1 |
139 | |
140 | |
25e59720 |
141 | DEFINE_STANDARD_RTTIEXT(Adaptor3d_HCurve,Standard_Transient) |
42cf5bc1 |
142 | |
143 | protected: |
144 | |
145 | |
146 | |
147 | |
148 | private: |
149 | |
150 | |
151 | |
152 | |
153 | }; |
154 | |
155 | |
156 | #include <Adaptor3d_HCurve.lxx> |
157 | |
158 | |
159 | |
160 | |
161 | |
162 | #endif // _Adaptor3d_HCurve_HeaderFile |