0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / Adaptor3d / Adaptor3d_IsoCurve.hxx
1 // Created on: 1993-03-11
2 // Created by: Isabelle GRIGNON
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_IsoCurve_HeaderFile
18 #define _Adaptor3d_IsoCurve_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <GeomAbs_IsoType.hxx>
25 #include <Standard_Real.hxx>
26 #include <Adaptor3d_Curve.hxx>
27 #include <GeomAbs_Shape.hxx>
28 #include <Standard_Integer.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 #include <Standard_Boolean.hxx>
31 #include <GeomAbs_CurveType.hxx>
32 class Adaptor3d_HSurface;
33 class Standard_NoSuchObject;
34 class Standard_OutOfRange;
35 class Standard_DomainError;
36 class Adaptor3d_HCurve;
37 class gp_Pnt;
38 class gp_Vec;
39 class gp_Lin;
40 class gp_Circ;
41 class gp_Elips;
42 class gp_Hypr;
43 class gp_Parab;
44 class Geom_BezierCurve;
45 class Geom_BSplineCurve;
46
47
48 //! Defines an isoparametric curve on  a surface.  The
49 //! type  of isoparametric curve  (U  or V) is defined
50 //! with the   enumeration  IsoType from   GeomAbs  if
51 //! NoneIso is given an error is raised.
52 class Adaptor3d_IsoCurve  : public Adaptor3d_Curve
53 {
54 public:
55
56   DEFINE_STANDARD_ALLOC
57
58   
59   //! The iso is set to NoneIso.
60   Standard_EXPORT Adaptor3d_IsoCurve();
61   
62   //! The surface is loaded. The iso is set to NoneIso.
63   Standard_EXPORT Adaptor3d_IsoCurve(const Handle(Adaptor3d_HSurface)& S);
64   
65   //! Creates  an  IsoCurve curve.   Iso  defines the
66   //! type (isoU or  isoU) Param defines the value of
67   //! the iso. The bounds  of  the iso are the bounds
68   //! of the surface.
69   Standard_EXPORT Adaptor3d_IsoCurve(const Handle(Adaptor3d_HSurface)& S, const GeomAbs_IsoType Iso, const Standard_Real Param);
70   
71   //! Create an IsoCurve curve.  Iso defines the type
72   //! (isoU or isov).  Param defines the value of the
73   //! iso. WFirst,WLast define the bounds of the iso.
74   Standard_EXPORT Adaptor3d_IsoCurve(const Handle(Adaptor3d_HSurface)& S, const GeomAbs_IsoType Iso, const Standard_Real Param, const Standard_Real WFirst, const Standard_Real WLast);
75   
76   //! Changes  the surface.  The  iso  is  reset  to
77   //! NoneIso.
78   Standard_EXPORT void Load (const Handle(Adaptor3d_HSurface)& S);
79   
80   //! Changes the iso on the current surface.
81   Standard_EXPORT void Load (const GeomAbs_IsoType Iso, const Standard_Real Param);
82   
83   //! Changes the iso on the current surface.
84   Standard_EXPORT void Load (const GeomAbs_IsoType Iso, const Standard_Real Param, const Standard_Real WFirst, const Standard_Real WLast);
85   
86     const Handle(Adaptor3d_HSurface)& Surface() const;
87   
88     GeomAbs_IsoType Iso() const;
89   
90     Standard_Real Parameter() const;
91   
92     Standard_Real FirstParameter() const Standard_OVERRIDE;
93   
94     Standard_Real LastParameter() const Standard_OVERRIDE;
95   
96   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
97   
98   //! Returns  the number  of  intervals for  continuity
99   //! <S>. May be one if Continuity(me) >= <S>
100   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
101   
102   //! Stores in <T> the  parameters bounding the intervals
103   //! of continuity <S>.
104   //!
105   //! The array must provide  enough room to  accomodate
106   //! for the parameters. i.e. T.Length() > NbIntervals()
107   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
108   
109   //! Returns    a  curve equivalent   of  <me>  between
110   //! parameters <First>  and <Last>. <Tol>  is used  to
111   //! test for 3d points confusion.
112   //! If <First> >= <Last>
113   Standard_EXPORT Handle(Adaptor3d_HCurve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
114   
115   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
116   
117   Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
118   
119   Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;
120   
121   //! Computes the point of parameter U on the curve.
122   Standard_EXPORT gp_Pnt Value (const Standard_Real U) const Standard_OVERRIDE;
123   
124   //! Computes the point of parameter U on the curve.
125   Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE;
126   
127   //! Computes the point of parameter U on the curve with its
128   //! first derivative.
129   //! Raised if the continuity of the current interval
130   //! is not C1.
131   Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V) const Standard_OVERRIDE;
132   
133
134   //! Returns the point P of parameter U, the first and second
135   //! derivatives V1 and V2.
136   //! Raised if the continuity of the current interval
137   //! is not C2.
138   Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const Standard_OVERRIDE;
139   
140
141   //! Returns the point P of parameter U, the first, the second
142   //! and the third derivative.
143   //! Raised if the continuity of the current interval
144   //! is not C3.
145   Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const Standard_OVERRIDE;
146   
147
148   //! The returned vector gives the value of the derivative for the
149   //! order of derivation N.
150   //! Raised if the continuity of the current interval
151   //! is not CN.
152   //! Raised if N < 1.
153   Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
154   
155   //! Returns the parametric  resolution corresponding
156   //! to the real space resolution <R3d>.
157   Standard_EXPORT Standard_Real Resolution (const Standard_Real R3d) const Standard_OVERRIDE;
158   
159   //! Returns  the  type of the   curve  in the  current
160   //! interval :   Line,   Circle,   Ellipse, Hyperbola,
161   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
162   Standard_EXPORT GeomAbs_CurveType GetType() const Standard_OVERRIDE;
163   
164   Standard_EXPORT gp_Lin Line() const Standard_OVERRIDE;
165   
166   Standard_EXPORT gp_Circ Circle() const Standard_OVERRIDE;
167   
168   Standard_EXPORT gp_Elips Ellipse() const Standard_OVERRIDE;
169   
170   Standard_EXPORT gp_Hypr Hyperbola() const Standard_OVERRIDE;
171   
172   Standard_EXPORT gp_Parab Parabola() const Standard_OVERRIDE;
173   
174   Standard_EXPORT Standard_Integer Degree() const Standard_OVERRIDE;
175   
176   Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
177   
178   Standard_EXPORT Standard_Integer NbPoles() const Standard_OVERRIDE;
179   
180   Standard_EXPORT Standard_Integer NbKnots() const Standard_OVERRIDE;
181   
182   Standard_EXPORT Handle(Geom_BezierCurve) Bezier() const Standard_OVERRIDE;
183   
184   Standard_EXPORT Handle(Geom_BSplineCurve) BSpline() const Standard_OVERRIDE;
185
186
187
188
189 protected:
190
191
192
193
194
195 private:
196
197
198
199   Handle(Adaptor3d_HSurface) mySurface;
200   GeomAbs_IsoType myIso;
201   Standard_Real myFirst;
202   Standard_Real myLast;
203   Standard_Real myParameter;
204
205
206 };
207
208
209 #include <Adaptor3d_IsoCurve.lxx>
210
211
212
213
214
215 #endif // _Adaptor3d_IsoCurve_HeaderFile