1 // Created on: 1995-11-15
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1995-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 _Law_BSpFunc_HeaderFile
18 #define _Law_BSpFunc_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22 
23 #include <Standard_Real.hxx>
24 #include <Law_Function.hxx>
25 #include <GeomAbs_Shape.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 class Law_BSpline;
29 class Standard_OutOfRange;
30 class Law_Function;
31 
32 
33 class Law_BSpFunc;
34 DEFINE_STANDARD_HANDLE(Law_BSpFunc, Law_Function)
35 
36 //! Law Function based on a BSpline curve 1d.  Package
37 //! methods and classes are implemented in package Law
38 //! to    construct  the  basis    curve with  several
39 //! constraints.
40 class Law_BSpFunc : public Law_Function
41 {
42 
43 public:
44 
45   Standard_EXPORT Law_BSpFunc();
46 
47   Standard_EXPORT Law_BSpFunc(const Handle(Law_BSpline)& C, const Standard_Real First, const Standard_Real Last);
48 
49   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
50 
51   //! Returns  the number  of  intervals for  continuity
52   //! <S>. May be one if Continuity(me) >= <S>
53   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
54 
55   //! Stores in <T> the parameters bounding the intervals of continuity <S>.
56   //! The array must provide enough room to accommodate for the parameters, i.e. T.Length() > NbIntervals()
57   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
58 
59   Standard_EXPORT Standard_Real Value (const Standard_Real X) Standard_OVERRIDE;
60 
61   Standard_EXPORT void D1 (const Standard_Real X, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE;
62 
63   Standard_EXPORT void D2 (const Standard_Real X, Standard_Real& F, Standard_Real& D, Standard_Real& D2) Standard_OVERRIDE;
64 
65   //! Returns a  law equivalent of  <me>  between
66   //! parameters <First>  and <Last>. <Tol>  is used  to
67   //! test for 3d points confusion.
68   //! It is usfule to determines the derivatives
69   //! in these values <First> and <Last> if
70   //! the Law is not Cn.
71   Standard_EXPORT Handle(Law_Function) Trim (const Standard_Real PFirst, const Standard_Real PLast, const Standard_Real Tol) const Standard_OVERRIDE;
72 
73   Standard_EXPORT void Bounds (Standard_Real& PFirst, Standard_Real& PLast) Standard_OVERRIDE;
74 
75   Standard_EXPORT Handle(Law_BSpline) Curve() const;
76 
77   Standard_EXPORT void SetCurve (const Handle(Law_BSpline)& C);
78 
79   DEFINE_STANDARD_RTTIEXT(Law_BSpFunc,Law_Function)
80 
81 private:
82 
83   Handle(Law_BSpline) curv;
84   Standard_Real first;
85   Standard_Real last;
86 
87 };
88 
89 #endif // _Law_BSpFunc_HeaderFile
90