Test for 0022778: Bug in BRepMesh
[occt.git] / src / Geom2dConvert / Geom2dConvert_BSplineCurveKnotSplitting.cdl
1 -- Created on: 1991-10-03
2 -- Copyright (c) 1991-1999 Matra Datavision
3 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19
20
21
22
23
24
25 class BSplineCurveKnotSplitting   from Geom2dConvert
26
27
28
29         --- Purpose : 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. For a BSpline curve, the discontinuities are
35         -- localized at the knot values. Between two knot values
36         -- the BSpline is infinitely and continuously
37         -- differentiable. At a given knot, the continuity is equal
38         -- to: Degree - Mult, where Degree is the
39         -- degree of the BSpline curve and Mult is the multiplicity of the knot.
40         -- It is possible to compute the arcs which correspond to
41         -- this splitting using the global function
42         -- SplitBSplineCurve provided by the package Geom2dConvert.
43         -- A BSplineCurveKnotSplitting object provides a framework for:
44         -- -   defining the curve to be analysed and the required degree of continuity,
45         -- -   implementing the computation algorithm, and
46         -- -   consulting the results.
47
48 uses  Array1OfInteger      from TColStd,
49       HArray1OfInteger     from TColStd,
50       BSplineCurve         from Geom2d
51
52 raises DimensionError from Standard, 
53        RangeError     from Standard
54   
55 is
56
57
58   Create (BasisCurve : BSplineCurve from Geom2d; ContinuityRange : Integer)
59      returns BSplineCurveKnotSplitting
60         --- Purpose : Determines points at which the BSpline curve
61         --  BasisCurve should be split in order to obtain arcs
62         --  with a degree of continuity equal to ContinuityRange.
63         -- These points are knot values of BasisCurve. They
64         -- are identified by indices in the knots table of BasisCurve.
65         -- Use the available interrogation functions to access
66         -- computed values, followed by the global function
67         -- SplitBSplineCurve (provided by the package
68         -- Geom2dConvert) to split the curve.
69         -- Exceptions
70         -- Standard_RangeError if ContinuityRange is less than zero.
71             raises RangeError;
72       
73   
74   NbSplits (me)    returns Integer   is static;
75         --- Purpose :Returns the number of points at which the analysed
76         -- BSpline curve should be split, in order to obtain arcs
77         -- with the continuity required by this framework.
78         -- All these points correspond to knot values. Note that
79         -- the first and last points of the curve, which bound the
80         -- first and last arcs, are counted among these splitting points.
81
82
83   Splitting (me; SplitValues : in out Array1OfInteger)
84         --- Purpose : Loads the SplitValues table with the split knots
85         -- values computed in this framework. Each value in the
86         -- table is an index in the knots table of the BSpline
87         -- curve analysed by this algorithm.
88         -- The values in SplitValues are given in ascending
89         -- order and comprise the indices of the knots which
90         -- give the first and last points of the curve. Use two
91         -- consecutive values from the table as arguments of the
92         -- global function SplitBSplineCurve (provided by the
93         -- package Geom2dConvert) to split the curve.
94         -- Exceptions
95         -- Standard_DimensionError if the array SplitValues
96         -- was not created with the following bounds:
97         -- -   1, and
98         -- -   the number of split points computed in this
99         --   framework (as given by the function NbSplits).
100              raises DimensionError
101              is static;
102
103
104   SplitValue (me; Index : Integer)   returns Integer 
105         --- Purpose :Returns the split knot of index Index to the split knots
106         -- table computed in this framework. The returned value
107         -- is an index in the knots table of the BSpline curve
108         -- analysed by this algorithm.
109         -- Notes:
110         -- -   If Index is equal to 1, the corresponding knot
111         --   gives the first point of the curve.
112         -- -   If Index is equal to the number of split knots
113         --   computed in this framework, the corresponding
114         --   point is the last point of the curve.
115         -- Exceptions
116         -- Standard_RangeError if Index is less than 1 or
117         -- greater than the number of split knots computed in this framework.
118      raises RangeError
119         is static;
120               
121
122
123 fields  
124
125   splitIndexes : HArray1OfInteger;
126
127 end BSplineCurveKnotSplitting;
128