42cf5bc1 |
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 |
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_BSplineKnotSplitting_HeaderFile |
18 | #define _Law_BSplineKnotSplitting_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TColStd_HArray1OfInteger.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <TColStd_Array1OfInteger.hxx> |
27 | class Standard_DimensionError; |
28 | class Standard_RangeError; |
29 | class Law_BSpline; |
30 | |
31 | |
32 | |
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 |
39 | //! of range Index. |
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 |
47 | //! package Geom). |
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 |
51 | //! BSplineCurve. |
52 | class Law_BSplineKnotSplitting |
53 | { |
54 | public: |
55 | |
56 | DEFINE_STANDARD_ALLOC |
57 | |
58 | |
59 | |
60 | //! Locates the knot values which correspond to the segmentation of |
61 | //! the curve into arcs with a continuity equal to ContinuityRange. |
62 | //! |
63 | //! Raised if ContinuityRange is not greater or equal zero. |
64 | Standard_EXPORT Law_BSplineKnotSplitting(const Handle(Law_BSpline)& BasisLaw, const Standard_Integer ContinuityRange); |
65 | |
66 | |
67 | //! Returns the number of knots corresponding to the splitting. |
68 | Standard_EXPORT Standard_Integer NbSplits() const; |
69 | |
70 | |
71 | //! Returns the indexes of the BSpline curve knots corresponding to |
72 | //! the splitting. |
73 | //! |
74 | //! Raised if the length of SplitValues is not equal to NbSPlit. |
75 | Standard_EXPORT void Splitting (TColStd_Array1OfInteger& SplitValues) const; |
76 | |
77 | |
78 | //! Returns the index of the knot corresponding to the splitting |
79 | //! of range Index. |
80 | //! |
81 | //! Raised if Index < 1 or Index > NbSplits |
82 | Standard_EXPORT Standard_Integer SplitValue (const Standard_Integer Index) const; |
83 | |
84 | |
85 | |
86 | |
87 | protected: |
88 | |
89 | |
90 | |
91 | |
92 | |
93 | private: |
94 | |
95 | |
96 | |
97 | Handle(TColStd_HArray1OfInteger) splitIndexes; |
98 | |
99 | |
100 | }; |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | |
107 | |
108 | #endif // _Law_BSplineKnotSplitting_HeaderFile |