0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / Law / Law_BSpFunc.hxx
CommitLineData
42cf5bc1 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>
28class Law_BSpline;
29class Standard_OutOfRange;
30class Law_Function;
31
32
33class Law_BSpFunc;
34DEFINE_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.
40class Law_BSpFunc : public Law_Function
41{
42
43public:
44
45
46 Standard_EXPORT Law_BSpFunc();
47
48 Standard_EXPORT Law_BSpFunc(const Handle(Law_BSpline)& C, const Standard_Real First, const Standard_Real Last);
49
50 Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
51
52 //! Returns the number of intervals for continuity
53 //! <S>. May be one if Continuity(me) >= <S>
54 Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
55
56 //! Stores in <T> the parameters bounding the intervals
57 //! of continuity <S>.
58 //!
59 //! The array must provide enough room to accomodate
60 //! for the parameters. i.e. T.Length() > NbIntervals()
61 Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
62
79104795 63 Standard_EXPORT Standard_Real Value (const Standard_Real X) Standard_OVERRIDE;
42cf5bc1 64
79104795 65 Standard_EXPORT void D1 (const Standard_Real X, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE;
42cf5bc1 66
79104795 67 Standard_EXPORT void D2 (const Standard_Real X, Standard_Real& F, Standard_Real& D, Standard_Real& D2) Standard_OVERRIDE;
42cf5bc1 68
69 //! Returns a law equivalent of <me> between
70 //! parameters <First> and <Last>. <Tol> is used to
71 //! test for 3d points confusion.
72 //! It is usfule to determines the derivatives
73 //! in these values <First> and <Last> if
74 //! the Law is not Cn.
75 Standard_EXPORT Handle(Law_Function) Trim (const Standard_Real PFirst, const Standard_Real PLast, const Standard_Real Tol) const Standard_OVERRIDE;
76
79104795 77 Standard_EXPORT void Bounds (Standard_Real& PFirst, Standard_Real& PLast) Standard_OVERRIDE;
42cf5bc1 78
79 Standard_EXPORT Handle(Law_BSpline) Curve() const;
80
81 Standard_EXPORT void SetCurve (const Handle(Law_BSpline)& C);
82
83
84
85
92efcf78 86 DEFINE_STANDARD_RTTIEXT(Law_BSpFunc,Law_Function)
42cf5bc1 87
88protected:
89
90
91
92
93private:
94
95
96 Handle(Law_BSpline) curv;
97 Standard_Real first;
98 Standard_Real last;
99
100
101};
102
103
104
105
106
107
108
109#endif // _Law_BSpFunc_HeaderFile