1 // Created on: 1991-10-03
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _GeomConvert_BSplineCurveKnotSplitting_HeaderFile
17 #define _GeomConvert_BSplineCurveKnotSplitting_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <TColStd_HArray1OfInteger.hxx>
24 #include <Standard_Integer.hxx>
25 #include <TColStd_Array1OfInteger.hxx>
26 class Geom_BSplineCurve;
29 //! An algorithm to determine points at which a BSpline
30 //! curve should be split in order to obtain arcs of the same continuity.
31 //! If you require curves with a minimum continuity for
32 //! your computation, it is useful to know the points
33 //! between which an arc has a continuity of a given
34 //! order. The continuity order is given at the construction time.
35 //! For a BSpline curve, the discontinuities are
36 //! localized at the knot values. Between two knot values
37 //! the BSpline is infinitely and continuously
38 //! differentiable. At a given knot, the continuity is equal
39 //! to: Degree - Mult, where Degree is the
40 //! degree of the BSpline curve and Mult is the multiplicity of the knot.
41 //! It is possible to compute the arcs which correspond to
42 //! this splitting using the global function
43 //! SplitBSplineCurve provided by the package GeomConvert.
44 //! A BSplineCurveKnotSplitting object provides a framework for:
45 //! - defining the curve to be analyzed and the
46 //! required degree of continuity,
47 //! - implementing the computation algorithm, and
48 //! - consulting the results.
49 class GeomConvert_BSplineCurveKnotSplitting
56 //! Determines points at which the BSpline curve
57 //! BasisCurve should be split in order to obtain arcs
58 //! with a degree of continuity equal to ContinuityRange.
59 //! These points are knot values of BasisCurve. They
60 //! are identified by indices in the knots table of BasisCurve.
61 //! Use the available interrogation functions to access
62 //! computed values, followed by the global function
63 //! SplitBSplineCurve (provided by the package GeomConvert) to split the curve.
65 //! Standard_RangeError if ContinuityRange is less than zero.
66 Standard_EXPORT GeomConvert_BSplineCurveKnotSplitting(const Handle(Geom_BSplineCurve)& BasisCurve, const Standard_Integer ContinuityRange);
68 //! Returns the number of points at which the analyzed
69 //! BSpline curve should be split, in order to obtain arcs
70 //! with the continuity required by this framework.
71 //! All these points correspond to knot values. Note that
72 //! the first and last points of the curve, which bound the
73 //! first and last arcs, are counted among these splitting points.
74 Standard_EXPORT Standard_Integer NbSplits() const;
76 //! Loads the SplitValues table with the split knots
77 //! values computed in this framework. Each value in the
78 //! table is an index in the knots table of the BSpline
79 //! curve analyzed by this algorithm.
80 //! The values in SplitValues are given in ascending
81 //! order and comprise the indices of the knots which
82 //! give the first and last points of the curve. Use two
83 //! consecutive values from the table as arguments of the
84 //! global function SplitBSplineCurve (provided by the
85 //! package GeomConvert) to split the curve.
87 //! Standard_DimensionError if the array SplitValues
88 //! was not created with the following bounds:
90 //! - the number of split points computed in this
91 //! framework (as given by the function NbSplits).
92 Standard_EXPORT void Splitting (TColStd_Array1OfInteger& SplitValues) const;
94 //! Returns the split knot of index Index to the split knots
95 //! table computed in this framework. The returned value
96 //! is an index in the knots table of the BSpline curve
97 //! analyzed by this algorithm.
99 //! - If Index is equal to 1, the corresponding knot
100 //! gives the first point of the curve.
101 //! - If Index is equal to the number of split knots
102 //! computed in this framework, the corresponding
103 //! point is the last point of the curve.
105 //! Standard_RangeError if Index is less than 1 or
106 //! greater than the number of split knots computed in this framework.
107 Standard_EXPORT Standard_Integer SplitValue (const Standard_Integer Index) const;
122 Handle(TColStd_HArray1OfInteger) splitIndexes;
133 #endif // _GeomConvert_BSplineCurveKnotSplitting_HeaderFile