1 // Created on: 1997-01-17
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Law_BSplineKnotSplitting_HeaderFile
18 #define _Law_BSplineKnotSplitting_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TColStd_HArray1OfInteger.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TColStd_Array1OfInteger.hxx>
27 class Standard_DimensionError;
28 class Standard_RangeError;
33 //! For a B-spline curve the discontinuities are localised at the
34 //! knot values and between two knots values the B-spline is
35 //! infinitely continuously differentiable.
36 //! At a knot of range index the continuity is equal to :
37 //! Degree - Mult (Index) where Degree is the degree of the
38 //! basis B-spline functions and Mult the multiplicity of the knot
40 //! If for your computation you need to have B-spline curves with a
41 //! minima of continuity it can be interesting to know between which
42 //! knot values, a B-spline curve arc, has a continuity of given order.
43 //! This algorithm computes the indexes of the knots where you should
44 //! split the curve, to obtain arcs with a constant continuity given
45 //! at the construction time. The splitting values are in the range
46 //! [FirstUKnotValue, LastUKnotValue] (See class B-spline curve from
48 //! If you just want to compute the local derivatives on the curve you
49 //! don't need to create the B-spline curve arcs, you can use the
50 //! functions LocalD1, LocalD2, LocalD3, LocalDN of the class
52 class Law_BSplineKnotSplitting
60 //! Locates the knot values which correspond to the segmentation of
61 //! the curve into arcs with a continuity equal to ContinuityRange.
63 //! Raised if ContinuityRange is not greater or equal zero.
64 Standard_EXPORT Law_BSplineKnotSplitting(const Handle(Law_BSpline)& BasisLaw, const Standard_Integer ContinuityRange);
67 //! Returns the number of knots corresponding to the splitting.
68 Standard_EXPORT Standard_Integer NbSplits() const;
71 //! Returns the indexes of the BSpline curve knots corresponding to
74 //! Raised if the length of SplitValues is not equal to NbSPlit.
75 Standard_EXPORT void Splitting (TColStd_Array1OfInteger& SplitValues) const;
78 //! Returns the index of the knot corresponding to the splitting
81 //! Raised if Index < 1 or Index > NbSplits
82 Standard_EXPORT Standard_Integer SplitValue (const Standard_Integer Index) const;
97 Handle(TColStd_HArray1OfInteger) splitIndexes;
108 #endif // _Law_BSplineKnotSplitting_HeaderFile