Test for 0022778: Bug in BRepMesh
[occt.git] / src / Law / Law_BSpline.cdl
1 -- Created on: 1995-10-20
2 -- Created by: Laurent BOURESCHE
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22 class BSpline from Law inherits TShared from MMgt
23
24     ---Purpose : Definition of the 1D B_spline curve.
25     --         
26     --         Uniform  or non-uniform
27     --         Rational or non-rational
28     --         Periodic or non-periodic
29     --  
30     --  a b-spline curve is defined by :
31     --  
32     --         The Degree (up to 25)
33     --  
34     --         The Poles  (and the weights if it is rational)
35     --         
36     --         The Knots and Multiplicities
37     --         
38     --           The knot vector   is an  increasing  sequence  of
39     --           reals without  repetition. The multiplicities are
40     --           the repetition of the knots.
41     --           
42     --           If the knots are regularly spaced (the difference
43     --           of two  consecutive  knots  is a   constant), the
44     --           knots repartition is :
45     --             
46     --              - Uniform if all multiplicities are 1.
47     --              
48     --              -  Quasi-uniform if  all multiplicities are  1
49     --              but the first and the last which are Degree+1.
50     --              
51     --              -   PiecewiseBezier if  all multiplicites  are
52     --              Degree but the   first and the  last which are
53     --              Degree+1. 
54     --              
55     --         The curve may be periodic. 
56     --         
57     --              On a periodic curve if there are k knots and p
58     --              poles. the period is knot(k) - knot(1)
59     --              
60     --              the poles and knots are infinite vectors with :
61     --               
62     --                knot(i+k) = knot(i) + period
63     --                
64     --                pole(i+p) = pole(i)
65     --    
66     --    
67     --- References :
68     --  . A survey of curve and surface methods in CADG Wolfgang BOHM
69     --    CAGD 1 (1984)
70     --  . On de Boor-like algorithms and blossoming Wolfgang BOEHM
71     --    cagd 5 (1988)
72     --  . Blossoming and knot insertion algorithms for B-spline curves
73     --    Ronald N. GOLDMAN
74     --  . Modelisation des surfaces en CAO, Henri GIAUME Peugeot SA   
75     --  . Curves and Surfaces for Computer Aided Geometric Design,
76     --    a practical guide Gerald Farin
77
78 uses  
79     Array1OfInteger      from TColStd,
80     Array1OfReal         from TColStd,
81     HArray1OfInteger     from TColStd,
82     HArray1OfReal        from TColStd,
83     BSplKnotDistribution from GeomAbs,
84     Shape                from GeomAbs
85
86 raises 
87     ConstructionError   from Standard,
88     DimensionError      from Standard,
89     DomainError         from Standard,
90     OutOfRange          from Standard,
91     RangeError          from Standard,
92     NoSuchObject        from Standard
93
94 is
95
96
97     Create (Poles          : Array1OfReal    from TColStd; 
98             Knots          : Array1OfReal    from TColStd; 
99             Multiplicities : Array1OfInteger from TColStd; 
100             Degree         : Integer;
101             Periodic       : Boolean = Standard_False)
102           
103     returns mutable BSpline from Law
104
105     ---Purpose :  Creates a  non-rational B_spline curve   on  the
106     --         basis <Knots, Multiplicities> of degree <Degree>.
107
108     raises ConstructionError;
109
110     -- The following conditions must be verified.
111     
112     --  0 < Degree <= MaxDegree.
113     --  
114     --  Knots.Length() == Mults.Length() >= 2
115     --  
116     --  Knots(i) < Knots(i+1) (Knots are increasing)
117     --  
118     --  1 <= Mults(i) <= Degree
119     --  
120     --   On a non periodic curve the first and last multiplicities
121     --   may be Degree+1 (this is even recommanded if you want the
122     --   curve to start and finish on the first and last pole).
123     --   
124     --   On a periodic  curve the first  and  the last multicities
125     --   must be the same.
126     --   
127     --   on non-periodic curves
128     --   
129     --     Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2
130     --     
131     --   on periodic curves 
132     --   
133     --     Poles.Length() == Sum(Mults(i)) except the first or last
134
135
136     Create (Poles          : Array1OfReal    from TColStd;
137             Weights        : Array1OfReal    from TColStd;
138             Knots          : Array1OfReal    from TColStd; 
139             Multiplicities : Array1OfInteger from TColStd; 
140             Degree         : Integer;
141             Periodic       : Boolean = Standard_False)
142           
143     returns mutable BSpline from Law
144
145     ---Purpose : Creates  a rational B_spline  curve  on the basis
146     --         <Knots, Multiplicities> of degree <Degree>.
147
148     raises ConstructionError;
149
150     -- The following conditions must be verified.
151     
152     --  0 < Degree <= MaxDegree.
153     --  
154     --  Weights.Length() == Poles.Length()
155     --  
156     --  Knots.Length() == Mults.Length() >= 2
157     --  
158     --  Knots(i) < Knots(i+1) (Knots are increasing)
159     --  
160     --  1 <= Mults(i) <= Degree
161     --  
162     --   On a non periodic curve the first and last multiplicities
163     --   may be Degree+1 (this is even recommanded if you want the
164     --   curve to start and finish on the first and last pole).
165     --   
166     --   On a periodic  curve the first  and  the last multicities
167     --   must be the same.
168     --   
169     --   on non-periodic curves
170     --   
171     --     Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2
172     --     
173     --   on periodic curves 
174     --   
175     --     Poles.Length() == Sum(Mults(i)) except the first or last
176
177
178     IncreaseDegree (me : mutable; Degree : Integer)
179   
180     ---Purpose: Increase the degree to  <Degree>. Nothing is  done
181     --          if  <Degree>   is lower or  equal  to the  current
182     --          degree.  
183
184     raises ConstructionError;
185
186     --  Raised if Degree is greater than MaxDegree.
187
188
189     IncreaseMultiplicity (me : mutable; Index : Integer; M : Integer)
190  
191     ---Purpose :Increases the multiplicity  of the knot <Index> to
192     --         <M>.   
193     --         
194     --         If   <M>   is   lower   or  equal   to  the current
195     --         multiplicity nothing is done. If <M> is higher than
196     --         the degree the degree is used.
197
198     raises OutOfRange;
199         
200     ---Purpose: If <Index> is not in [FirstUKnotIndex, LastUKnotIndex]
201
202
203     IncreaseMultiplicity (me : mutable; I1, I2 : Integer; M : Integer) 
204   
205     ---Purpose :Increases  the  multiplicities   of  the knots  in
206     --         [I1,I2] to <M>.
207     --         
208     --         For each knot if  <M>  is  lower  or equal  to  the
209     --         current multiplicity  nothing  is  done. If <M>  is
210     --         higher than the degree the degree is used.
211
212     raises OutOfRange;
213         
214     ---Purpose: If <I1,I2> are not in [FirstUKnotIndex, LastUKnotIndex]
215
216
217     IncrementMultiplicity (me : mutable; I1, I2 : Integer; M : Integer) 
218   
219     ---Purpose :Increment  the  multiplicities   of  the knots  in
220     --         [I1,I2] by <M>.
221     --         
222     --         If <M> is not positive nithing is done.
223     --         
224     --         For   each  knot   the resulting   multiplicity  is
225     --         limited to the Degree.
226
227     raises OutOfRange;
228         
229     ---Purpose: If <I1,I2> are not in [FirstUKnotIndex, LastUKnotIndex]
230
231
232     InsertKnot (me  : mutable; 
233                 U   : Real; 
234                 M   : Integer = 1; 
235                 ParametricTolerance : Real = 0.0;
236                 Add : Boolean = Standard_True); 
237   
238     ---Purpose: Inserts a knot value in the sequence of knots.  If
239     --          <U>  is an  existing knot     the multiplicity  is
240     --          increased by <M>.
241     --          
242     --          If U  is  not  on the parameter  range  nothing is
243     --          done.
244     --          
245     --          If the multiplicity is negative or null nothing is
246     --          done. The  new   multiplicity  is limited  to  the
247     --          degree.
248     --          
249     --          The  tolerance criterion  for  knots  equality  is
250     --          the max of Epsilon(U) and ParametricTolerance.
251     
252     
253     InsertKnots (me : mutable; Knots : Array1OfReal    from TColStd; 
254                                Mults : Array1OfInteger from TColStd;
255                              ParametricTolerance : Real = 0.0;
256                              Add : Boolean = Standard_False);
257                              
258     ---Purpose: Inserts a set of knots  values in  the sequence of
259     --          knots.    
260     --          
261     --          For each U = Knots(i), M = Mults(i)
262     --          
263     --          If <U>  is an existing  knot  the  multiplicity is
264     --          increased by  <M> if  <Add>  is True, increased to
265     --          <M> if <Add> is False.
266     --          
267     --          If U  is  not  on the parameter  range  nothing is
268     --          done.
269     --          
270     --          If the multiplicity is negative or null nothing is
271     --          done. The  new   multiplicity  is limited  to  the
272     --          degree.
273     --          
274     --          The  tolerance criterion  for  knots  equality  is
275     --          the max of Epsilon(U) and ParametricTolerance.
276
277
278     RemoveKnot(me : mutable; Index     : Integer; 
279                              M         : Integer;
280                              Tolerance : Real) returns Boolean
281                            
282     ---Purpose : Decrement the knots multiplicity to <M>. If  M is
283     --         0 the knot   is  removed. The  Poles  sequence   is
284     --         modified.
285     --         
286     --         As there are two ways to  compute the new poles the
287     --         average is  computed if  the distance is lower than
288     --         the <Tolerance>, else False is returned.
289     --         
290     --         A low tolerance is used to prevent the modification
291     --         of the curve.
292     --         
293     --         A high tolerance is used to "smooth" the curve.
294     --         
295     raises OutOfRange;
296     ---Purpose :
297     --  Raised if Index is not in the range
298     --  [FirstUKnotIndex, LastUKnotIndex]
299     
300     
301     ---Purpose : pole insertion and pole removing
302     --  this operation is limited to the Uniform or QuasiUniform
303     --  BSplineCurve. The knot values are modified . If the BSpline is
304     --  NonUniform or Piecewise Bezier an exception Construction error
305     --  is raised.
306     
307     
308     Reverse (me : mutable);
309     ---Purpose :
310     --  Changes the direction of parametrization of <me>. The Knot
311     --  sequence is modified, the FirstParameter and the 
312     --  LastParameter are not modified. The StartPoint of the 
313     --  initial curve becomes the EndPoint of the reversed curve 
314     --  and the EndPoint of the initial curve becomes the StartPoint
315     --  of the reversed curve.
316
317
318     ReversedParameter(me; U : Real) returns Real;
319     ---Purpose: Returns the  parameter on the  reversed  curve for
320     --          the point of parameter U on <me>.
321     --          
322     --          returns UFirst + ULast - U
323
324
325     Segment (me : mutable; U1, U2 : Real)
326     ---Purpose :
327     --  Segments the curve between U1 and U2.
328     --  The control points are modified, the first and the last point
329     --  are not the same.
330     --- Warnings :
331     --  Even if <me> is not closed it can become closed after the 
332     --  segmentation for example if U1 or U2 are out of the bounds 
333     --  of the curve <me> or if the curve makes loop.
334     --  After the segmentation the length of a curve can be null.
335
336     raises DomainError from Standard;
337
338     ---Purpose: raises if U2 < U1.
339
340
341     SetKnot (me : mutable; Index : Integer; K : Real)
342     ---Purpose :  Changes the knot of range Index.
343     --  The multiplicity of the knot is not modified.
344     raises ConstructionError,
345     ---Purpose : Raised if K >= Knots(Index+1) or K <= Knots(Index-1).
346            OutOfRange;
347     ---Purpose : Raised if Index < 1 || Index > NbKnots
348
349
350     SetKnots (me : mutable; K : Array1OfReal from TColStd)
351     ---Purpose :  Changes all the knots of the curve
352     --  The multiplicity of the knots are not modified.
353     raises ConstructionError,
354     ---Purpose : 
355     --  Raised if there is an index such that K (Index+1) <= K (Index).
356            OutOfRange;
357     ---Purpose : 
358     --  Raised if  K.Lower() < 1 or K.Upper() > NbKnots
359
360
361     SetKnot (me : mutable; Index : Integer; K : Real; M : Integer)
362     ---Purpose :
363     --  Changes the knot of range Index with its multiplicity.
364     --  You can increase the multiplicity of a knot but it is
365     --  not allowed to decrease the multiplicity of an existing knot.
366     raises ConstructionError,
367     ---Purpose :
368     --  Raised if K >= Knots(Index+1) or K <= Knots(Index-1).
369     --  Raised if M is greater than Degree or lower than the previous
370     --  multiplicity of knot of range Index. 
371             OutOfRange;
372     ---Purpose : Raised if Index < 1 || Index > NbKnots
373
374
375     PeriodicNormalization(me ;  U : in out Real) ; 
376        
377     ---Purpose : returns the parameter normalized within
378     --         the period if the curve is periodic : otherwise
379     --         does not do anything
380
381
382     SetPeriodic (me : mutable)
383     ---Purpose :
384     --  Makes a closed B-spline into a periodic curve. The curve is
385     --  periodic if the knot sequence is periodic and if the curve is 
386     --  closed (The tolerance criterion is Resolution from gp).
387     --  The period T is equal to Knot(LastUKnotIndex) -
388     --   Knot(FirstUKnotIndex). A periodic B-spline can be uniform 
389     --   or not.
390     raises ConstructionError;
391     ---Purpose : Raised if the curve is not closed.
392
393
394     SetOrigin (me : mutable; Index : Integer)
395     ---Purpose: Set the origin of a periodic curve at Knot(index)
396     --          KnotVector and poles are modified.
397     raises NoSuchObject,
398     ---Purpose: Raised if the curve is not periodic
399            DomainError;
400     ---Purpose: Raised if index not in the range 
401     --          [FirstUKnotIndex , LastUKnotIndex]
402
403
404     SetNotPeriodic (me : mutable);
405     ---Purpose :
406     --  Makes a non periodic curve. If the curve was non periodic
407     --  the curve is not modified.
408                 
409  
410     SetPole (me : mutable; Index : Integer; P : Real)
411     ---Purpose : Substitutes the Pole of range Index with P.
412     raises OutOfRange;
413     ---Purpose:
414     --  Raised if Index < 1 || Index > NbPoles
415
416
417     SetPole (me : mutable; Index : Integer; P : Real; Weight : Real)
418     ---Purpose:
419     --  Substitutes the pole and the weight of range Index.
420     --  If the curve <me> is not rational it can become rational
421     --  If the curve was rational it can become non rational
422     raises OutOfRange,
423     ---Purpose:
424     --  Raised if Index < 1 || Index > NbPoles
425            ConstructionError;
426     ---Purpose : Raised if Weight <= 0.0
427
428
429     SetWeight (me : mutable; Index : Integer; Weight : Real)
430     ---Purpose :
431     --  Changes the weight for the pole of range Index.
432     --  If the curve was non rational it can become rational.
433     --  If the curve was rational it can become non rational.
434     raises OutOfRange,
435     ---Purpose:
436     --  Raised if Index < 1 || Index > NbPoles
437            ConstructionError;
438     ---Purpose : Raised if Weight <= 0.0
439
440
441     IsCN (me; N : Integer)   returns Boolean
442     ---Purpose :
443     --  Returns the continuity of the curve, the curve is at least C0.
444     raises RangeError;
445     ---Purpose : Raised if N < 0.
446
447
448     IsClosed (me)  returns Boolean;
449     ---Purpose :
450     --  Returns true if the distance between the first point and the 
451     --  last point of the curve is lower or equal to Resolution 
452     --  from package gp.
453     --- Warnings :
454     --  The first and the last point can be different from the first
455     --  pole and the last pole of the curve.
456
457
458     IsPeriodic (me)  returns Boolean;
459     ---Purpose : Returns True if the curve is periodic.
460
461
462     IsRational (me)  returns Boolean;
463     ---Purpose :
464     --  Returns True if the weights are not identical.
465     --  The tolerance criterion is Epsilon of the class Real.
466     
467     IsCacheValid(me;  Parameter : Real) returns Boolean
468   
469     ---Purpose :
470     --           Tells whether the Cache is valid for the
471     --           given parameter 
472     -- Warnings : the parameter must be normalized within
473     -- the period if the curve is periodic. Otherwise
474     -- the answer will be false
475     -- 
476     is static private;
477   
478     Continuity (me)  returns Shape from GeomAbs;
479     ---Purpose :
480     --  Returns the global continuity of the curve :
481     --  C0 : only geometric continuity,
482     --  C1 : continuity of the first derivative all along the Curve,
483     --  C2 : continuity of the second derivative all along the Curve,
484     --  C3 : continuity of the third derivative all along the Curve,
485     --  CN : the order of continuity is infinite.
486     --  For a B-spline curve of degree d if a knot Ui has a
487     --  multiplicity p the B-spline curve is only Cd-p continuous 
488     --  at Ui. So the global continuity of the curve can't be greater 
489     --  than Cd-p where p is the maximum multiplicity of the interior
490     --  Knots. In the interior of a knot span the curve is infinitely
491     --  continuously differentiable.
492
493
494     Degree (me)  returns Integer;
495
496
497     -------------------------------------------------
498     ---Purpose : Computation of value and derivatives
499     -------------------------------------------------
500
501     Value(me ; U : Real) returns Real from Standard;
502
503     D0 (me ; U : Real; P : out Real);
504
505     D1 (me; U : Real; P : out Real; V1 : out Real);
506
507     D2 (me; U : Real; P : out Real; V1, V2 : out Real);
508
509     D3 (me; U : Real; P : out Real; V1, V2, V3 : out Real);
510
511     DN (me; U : Real; N : Integer)  returns Real;
512
513
514     ------------------------------------------------------------------
515     ---Purpose  :
516     --  The following functions computes the point  of parameter U and
517     --  the  derivatives at   this  point on  the  B-spline curve  arc
518     --  defined between the knot FromK1  and the knot  ToK2.  U can be
519     --  out of bounds   [Knot  (FromK1), Knot   (ToK2)] but   for  the
520     --  computation we only  use  the definition of the  curve between
521     --  these  two  knots. This  method is  useful  to  compute  local
522     --  derivative,  if the order of  continuity of the whole curve is
523     --  not   greater  enough.   Inside   the parametric   domain Knot
524     --  (FromK1), Knot (ToK2)  the evaluations are the  same as if  we
525     --  consider  the whole  definition of the  curve.   Of course the
526     --  evaluations are different outside this parametric domain.
527     ------------------------------------------------------------------
528     
529     LocalValue (me; U : Real; FromK1, ToK2 : Integer) returns Real;
530
531     LocalD0 (me; U : Real; FromK1, ToK2 : Integer; P : out Real);
532
533     LocalD1 (me; U : Real; FromK1, ToK2 : Integer; P, V1 : out Real);
534
535     LocalD2 (me; U : Real; FromK1, ToK2 : Integer; P, V1, V2 : out Real);
536
537     LocalD3 (me; U : Real; FromK1, ToK2 : Integer; P, V1, V2, V3 : out Real);
538
539     LocalDN (me; U : Real; FromK1, ToK2 : Integer; N : Integer)  returns Real;
540
541
542     EndPoint (me)   returns Real;
543     ---Purpose :
544     --  Returns the last point of the curve.
545     --- Warnings :
546     --  The last point of the curve is different from the last 
547     --  pole of the curve if the multiplicity of the last knot
548     --  is lower than Degree.
549
550
551     FirstUKnotIndex (me)   returns Integer;
552     ---Purpose :
553     --  For a B-spline curve the first parameter (which gives the start
554     --  point of the curve) is a knot value but if the multiplicity of
555     --  the first knot index is lower than Degree + 1 it is not the 
556     --  first knot of the curve. This method computes the index of the
557     --  knot corresponding to the first parameter.
558
559
560     FirstParameter (me)   returns Real;
561     ---Purpose :
562     --  Computes the parametric value of the start point of the curve.
563     --  It is a knot value.
564
565
566     Knot (me; Index : Integer)   returns Real
567     ---Purpose :
568     --  Returns the knot of range Index. When there is a knot 
569     --  with a multiplicity greater than 1 the knot is not repeated.
570     --  The method Multiplicity can be used to get the multiplicity 
571     --  of the Knot.
572     raises OutOfRange;
573     ---Purpose : Raised if Index < 1 or Index > NbKnots
574
575
576     Knots (me; K : out Array1OfReal from TColStd)
577     ---Purpose : returns the knot values of the B-spline curve;
578     raises DimensionError;
579     ---Purpose :
580     --  Raised if the length of K is not equal to the number of knots.
581
582
583     KnotSequence (me; K : out Array1OfReal from TColStd)
584     ---Purpose : Returns the knots sequence.
585     --  In this sequence the knots with a multiplicity greater than 1
586     --  are repeated. 
587     --- Example :
588     --  K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
589     raises DimensionError;
590     ---Purpose :
591     --  Raised if the length of K is not equal to NbPoles + Degree + 1
592     
593
594
595     KnotDistribution (me)   returns BSplKnotDistribution from GeomAbs;
596     ---Purpose :
597     --  Returns NonUniform or Uniform or QuasiUniform or PiecewiseBezier.
598     --  If all the knots differ by a positive constant from the 
599     --  preceding knot the BSpline Curve can be :
600     --  - Uniform if all the knots are of multiplicity 1,
601     --  - QuasiUniform if all the knots are of multiplicity 1 except for
602     --    the first and last knot which are of multiplicity Degree + 1,
603     --  - PiecewiseBezier if the first and last knots have multiplicity
604     --    Degree + 1 and if interior knots have multiplicity Degree
605     --    A piecewise Bezier with only two knots is a BezierCurve. 
606     --  else the curve is non uniform.
607     --  The tolerance criterion is Epsilon from class Real.
608
609
610     LastUKnotIndex (me)  returns Integer;
611     ---Purpose :
612     --  For a BSpline curve the last parameter (which gives the 
613     --  end point of the curve) is a knot value but if the 
614     --  multiplicity of the last knot index is lower than 
615     --  Degree + 1 it is not the last knot of the curve. This
616     --  method computes the index of the knot corresponding to
617     --  the last parameter.
618
619
620     LastParameter (me)   returns Real;
621     ---Purpose :
622     --  Computes the parametric value of the end point of the curve.
623     --  It is a knot value.
624
625
626     LocateU (me;
627              U                   : Real; 
628              ParametricTolerance : Real; 
629              I1, I2              : in out Integer;
630              WithKnotRepetition  : Boolean = Standard_False);
631     ---Purpose :
632     --  Locates the parametric value U in the sequence of knots.
633     --  If "WithKnotRepetition" is True we consider the knot's
634     --  representation with repetition of multiple knot value,
635     --  otherwise  we consider the knot's representation with
636     --  no repetition of multiple knot values.
637     --  Knots (I1) <= U <= Knots (I2)
638     --  . if I1 = I2  U is a knot value (the tolerance criterion 
639     --    ParametricTolerance is used).
640     --  . if I1 < 1  => U < Knots (1) - Abs(ParametricTolerance)
641     --  . if I2 > NbKnots => U > Knots (NbKnots) + Abs(ParametricTolerance)
642
643
644     Multiplicity (me; Index : Integer)   returns Integer
645     ---Purpose :
646     --  Returns the multiplicity of the knots of range Index.
647     raises OutOfRange;
648     ---Purpose : Raised if Index < 1 or Index > NbKnots
649
650
651     Multiplicities (me; M : out Array1OfInteger from TColStd)
652     ---Purpose :
653     --  Returns the multiplicity of the knots of the curve.
654     raises DimensionError;
655     ---Purpose :
656     --  Raised if the length of M is not equal to NbKnots.
657
658
659     NbKnots (me)  returns Integer;
660     ---Purpose :
661     --  Returns the number of knots. This method returns the number of 
662     --  knot without repetition of multiple knots.
663
664
665     NbPoles (me)  returns Integer;
666     ---Purpose : Returns the number of poles
667
668
669     Pole (me; Index : Integer)   returns Real
670     ---Purpose : Returns the pole of range Index.
671     raises OutOfRange;
672     ---Purpose : Raised if Index < 1 or Index > NbPoles.
673
674
675     Poles (me; P : out Array1OfReal from TColStd)
676     ---Purpose : Returns the poles of the B-spline curve;
677     raises DimensionError;
678     ---Purpose : 
679     --  Raised if the length of P is not equal to the number of poles.
680
681
682     StartPoint (me)  returns Real;
683     ---Purpose :
684     --  Returns the start point of the curve.
685     --- Warnings :
686     --  This point is different from the first pole of the curve if the
687     --  multiplicity of the first knot is lower than Degree.
688     
689
690     Weight (me; Index : Integer)  returns Real  
691     ---Purpose : Returns the weight of the pole of range Index .
692     raises OutOfRange;
693     ---Purpose : Raised if Index < 1 or Index > NbPoles.
694
695
696     Weights (me; W : out Array1OfReal from TColStd)
697     ---Purpose : Returns the weights of the B-spline curve;
698     raises DimensionError;
699     ---Purpose :
700     --  Raised if the length of W is not equal to NbPoles.
701
702
703     MaxDegree (myclass)  returns Integer;
704     ---Purpose :
705     --  Returns the value of the maximum degree of the normalized 
706     --  B-spline basis functions in this package.
707
708       MovePointAndTangent (me : mutable; 
709                        U                 : Real ; 
710                        NewValue          : Real ; 
711                        Derivative        : Real ;
712                        Tolerance         : Real ; 
713                        StartingCondition, 
714                        EndingCondition   : Integer; 
715                        ErrorStatus       : out Integer) 
716
717         ---Purpose : 
718         -- Changes the value of the Law at parameter U to NewValue.
719         -- and makes its derivative at U be derivative.
720         -- StartingCondition = -1 means first can move
721         -- EndingCondition   = -1 means last point can move
722         -- StartingCondition = 0 means the first point cannot move
723         -- EndingCondition   = 0 means the last point cannot move
724         -- StartingCondition = 1 means the first point and tangent cannot move
725         -- EndingCondition   = 1 means the last point and tangent cannot move  
726         -- and so forth
727         -- ErrorStatus != 0 means that there are not enought degree of freedom
728         -- with the constrain to deform the curve accordingly
729         -- 
730      raises OutOfRange;
731
732     Resolution(me ; Tolerance3D : Real;
733                     UTolerance  : out Real);
734     ---Purpose:  given Tolerance3D returns UTolerance
735     --           such that if f(t) is the curve we have
736     --           | t1 - t0| < Utolerance ===> 
737     --           |f(t1) - f(t0)| < Tolerance3D
738     
739
740     Copy (me)  returns mutable like me;
741
742
743     UpdateKnots(me : mutable)
744     ---Purpose : Recompute  the  flatknots,  the knotsdistribution, the
745     --          continuity.
746     is static private;
747   
748
749 fields
750
751   rational        : Boolean;
752   periodic        : Boolean;
753   knotSet         : BSplKnotDistribution from GeomAbs; 
754   smooth          : Shape from GeomAbs;
755   deg             : Integer;
756   poles           : HArray1OfReal    from TColStd;
757   weights         : HArray1OfReal    from TColStd;
758   flatknots       : HArray1OfReal    from TColStd;
759   knots           : HArray1OfReal    from TColStd;
760   mults           : HArray1OfInteger from TColStd;
761 end;