1da26832b5cfba93fe5025c856c5132dc5c2444b
[occt.git] / src / GeomFill / GeomFill_SnglrFunc.hxx
1 // Created on: 1998-02-26
2 // Created by: Roman BORISOV
3 // Copyright (c) 1998-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 _GeomFill_SnglrFunc_HeaderFile
18 #define _GeomFill_SnglrFunc_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Real.hxx>
25 #include <Adaptor3d_Curve.hxx>
26 #include <Standard_Integer.hxx>
27 #include <GeomAbs_Shape.hxx>
28 #include <TColStd_Array1OfReal.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <GeomAbs_CurveType.hxx>
31 class Adaptor3d_HCurve;
32 class Standard_OutOfRange;
33 class Standard_DomainError;
34 class gp_Pnt;
35 class gp_Vec;
36
37
38 //! to  represent  function  C'(t)^C''(t)
39 class GeomFill_SnglrFunc  : public Adaptor3d_Curve
40 {
41 public:
42
43   DEFINE_STANDARD_ALLOC
44
45   
46   Standard_EXPORT GeomFill_SnglrFunc(const Handle(Adaptor3d_HCurve)& HC);
47   
48   Standard_EXPORT void SetRatio (const Standard_Real Ratio);
49   
50   Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
51   
52   Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
53   
54   //! Returns  the number  of  intervals for  continuity
55   //! <S>. May be one if Continuity(me) >= <S>
56   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
57   
58   //! Stores in <T> the  parameters bounding the intervals
59   //! of continuity <S>.
60   //!
61   //! The array must provide  enough room to  accommodate
62   //! for the parameters. i.e. T.Length() > NbIntervals()
63   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
64   
65   //! Computes the point of parameter U on the curve.
66   Standard_EXPORT gp_Pnt Value (const Standard_Real U) const Standard_OVERRIDE;
67   
68   Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
69   
70   Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;
71   
72   //! Computes the point of parameter U on the curve.
73   Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE;
74   
75   //! Computes the point of parameter U on the curve with its
76   //! first derivative.
77   //! Raised if the continuity of the current interval
78   //! is not C1.
79   Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V) const Standard_OVERRIDE;
80   
81
82   //! Returns the point P of parameter U, the first and second
83   //! derivatives V1 and V2.
84   //! Raised if the continuity of the current interval
85   //! is not C2.
86   Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const Standard_OVERRIDE;
87   
88
89   //! Returns the point P of parameter U, the first, the second
90   //! and the third derivative.
91   //! Raised if the continuity of the current interval
92   //! is not C1.
93   Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const Standard_OVERRIDE;
94   
95
96   //! The returned vector gives the value of the derivative for the
97   //! order of derivation N.
98   //! Raised if N < 1.
99   Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
100   
101   //! Returns the parametric  resolution corresponding
102   //! to the real space resolution <R3d>.
103   Standard_EXPORT Standard_Real Resolution (const Standard_Real R3d) const Standard_OVERRIDE;
104   
105   //! Returns  the  type of the   curve  in the  current
106   //! interval :   Line,   Circle,   Ellipse, Hyperbola,
107   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
108   Standard_EXPORT GeomAbs_CurveType GetType() const Standard_OVERRIDE;
109
110
111
112
113 protected:
114
115
116
117
118
119 private:
120
121
122
123   Handle(Adaptor3d_HCurve) myHCurve;
124   Standard_Real ratio;
125
126
127 };
128
129
130
131
132
133
134
135 #endif // _GeomFill_SnglrFunc_HeaderFile