0024157: Parallelization of assembly part of BO
[occt.git] / src / GeomConvert / GeomConvert_BSplineSurfaceKnotSplitting.cdl
1 -- Created on: 1991-10-04
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 class BSplineSurfaceKnotSplitting   from GeomConvert
25
26         --- Purpose : An algorithm to determine isoparametric curves along
27         -- which a BSpline surface should be split in order to
28         -- obtain patches of the same continuity.
29         --  For a B-spline surface the discontinuities are localised at
30         --  the knot values. Between two knots values the B-spline is
31         --  infinitely continuously differentiable.  For each parametric 
32         --  direction at a knot of range index the continuity in this
33         --  direction is equal to :  Degree - Mult (Index)   where  Degree
34         --  is the degree of the basis B-spline functions and Mult the
35         --  multiplicity of the knot of range Index in the given direction.
36         --  If for your computation you need to have B-spline surface with a 
37         --  minima of continuity it can be interesting to know between which
38         --  knot values, a B-spline patch, has a continuity of given order.
39         --  This algorithm computes the indexes of the knots where you should
40         --  split the surface, to obtain patches with a constant continuity
41         --  given at the construction time. If you just want to compute the
42         --  local derivatives on the surface you don't need to create the
43         --  BSpline patches, you can use the functions LocalD1, LocalD2, 
44         --  LocalD3, LocalDN of the class BSplineSurface from package Geom.
45
46
47
48
49 uses  BSplineSurface       from Geom,
50       Array1OfInteger      from TColStd,
51       HArray1OfInteger      from TColStd
52
53 raises  DimensionError  from Standard,
54         RangeError      from Standard
55   
56 is
57
58
59   Create (BasisSurface : BSplineSurface; 
60           UContinuityRange, VContinuityRange : Integer)
61      returns BSplineSurfaceKnotSplitting;
62         --- Purpose : Determines the u- and v-isoparametric curves
63         --  along which the BSpline surface BasisSurface
64         -- should be split in order to obtain patches with a
65         -- degree of continuity equal to UContinuityRange in
66         -- the u parametric direction, and to
67         -- VContinuityRange in the v parametric direction.
68         -- These isoparametric curves are defined by
69         -- parameters, which are BasisSurface knot values in
70         -- the u or v parametric direction. They are identified
71         -- by indices in the BasisSurface knots table in the
72         -- corresponding parametric direction.
73         -- Use the available interrogation functions to access
74         -- computed values, followed by the global function
75         -- SplitBSplineSurface (provided by the package
76         -- GeomConvert) to split the surface.
77         -- Exceptions
78         -- Standard_RangeError if UContinuityRange or
79         -- VContinuityRange is less than zero.
80
81   NbUSplits (me)   returns Integer  is static;
82         --- Purpose : Returns the number of u-isoparametric curves
83         -- along which the analysed BSpline surface should be
84         -- split in order to obtain patches with the continuity
85         -- required by this framework.
86         -- The parameters which define these curves are knot
87         -- values in the corresponding parametric direction.
88         -- Note that the four curves which bound the surface are
89         -- counted among these splitting curves.
90         
91   NbVSplits (me)  returns Integer   is static;
92         --- Purpose : Returns the number of v-isoparametric curves
93         -- along which the analysed BSpline surface should be
94         -- split in order to obtain patches with the continuity
95         -- required by this framework.
96         -- The parameters which define these curves are knot
97         -- values in the corresponding parametric direction.
98         -- Note that the four curves which bound the surface are
99         -- counted among these splitting curves.
100
101
102   Splitting (me; USplit, VSplit : in out Array1OfInteger)
103         --- Purpose: Loads the USplit and VSplit tables with the split
104         -- knots values computed in this framework. Each value
105         -- in these tables is an index in the knots table
106         -- corresponding to the u or v parametric direction of
107         -- the BSpline surface analysed by this algorithm.
108         -- The USplit and VSplit values are given in ascending
109         -- order and comprise the indices of the knots which
110         -- give the first and last isoparametric curves of the
111         -- surface in the corresponding parametric direction.
112         -- Use two consecutive values from the USplit table and
113         -- two consecutive values from the VSplit table as
114         -- arguments of the global function
115         -- SplitBSplineSurface (provided by the package
116         -- GeomConvert) to split the surface.
117         -- Exceptions
118         -- Standard_DimensionError if:
119         -- -   the array USplit was not created with the following bounds:
120         --   -   1 , and
121         --   -   the number of split knots in the u parametric
122         --    direction computed in this framework (as given
123         --    by the function NbUSplits); or
124         -- -   the array VSplit was not created with the following bounds:
125         --   -   1 , and
126         --   -   the number of split knots in the v parametric
127         --    direction computed in this framework (as given
128         --    by the function NbVSplits).
129         raises DimensionError
130             is static;
131            
132
133   USplitValue (me; UIndex : Integer)   returns Integer
134         --- Purpose : Returns the split knot of index UIndex
135         -- to the split knots table for the u  parametric direction
136         -- computed in this framework. The returned value is
137         -- an index in the knots table relative to the u
138         --  parametric direction of the BSpline surface analysed by this algorithm.
139         -- Note: If UIndex is equal to 1, or to the number of split knots for the u
140         --  parametric direction computed in
141         -- this framework, the corresponding knot gives the
142         -- parameter of one of the bounding curves of the surface.
143         -- Exceptions
144         -- Standard_RangeError if UIndex  is less than 1 or greater than the number
145         -- of split knots for the u parametric direction computed in this framework.
146      raises RangeError
147      is static;
148
149
150   VSplitValue (me; VIndex : Integer)   returns Integer
151         --- Purpose :  Returns the split knot of index VIndex
152         -- to the split knots table for the v  parametric direction
153         -- computed in this framework. The returned value is
154         -- an index in the knots table relative to the v
155         --  parametric direction of the BSpline surface analysed by this algorithm.
156         -- Note: If UIndex is equal to 1, or to the number of split knots for the v
157         --  parametric direction computed in
158         -- this framework, the corresponding knot gives the
159         -- parameter of one of the bounding curves of the surface.
160         -- Exceptions
161         -- Standard_RangeError if VIndex  is less than 1 or greater than the number
162         -- of split knots for the v parametric direction computed in this framework.
163             raises RangeError
164      is static;
165
166        
167               
168 fields  
169
170   usplitIndexes : HArray1OfInteger;
171   vsplitIndexes : HArray1OfInteger;
172   
173 end BSplineSurfaceKnotSplitting;