1 -- Created on: 1991-10-10
2 -- Created by: Jean Claude VAUTHIER
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
26 deferred class ElementarySurfaceToBSplineSurface from Convert
28 --- Purpose :Root class for algorithms which convert an elementary
29 -- surface (cylinder, cone, sphere or torus) into a BSpline
30 -- surface (CylinderToBSplineSurface, ConeToBSplineSurface,
31 -- SphereToBSplineSurface, TorusToBSplineSurface).
32 -- These algorithms all work on elementary surfaces from
33 -- the gp package and compute all the data needed to
34 -- construct a BSpline surface equivalent to the cylinder,
35 -- cone, sphere or torus. This data consists of the following:
36 -- - degrees in the u and v parametric directions,
37 -- - periodic characteristics in the u and v parametric directions,
38 -- - a poles table with associated weights,
39 -- - a knots table (for the u and v parametric directions)
40 -- with associated multiplicities.
42 -- ElementarySurfaceToBSplineSurface provides a
43 -- framework for storing and consulting this computed data.
44 -- This data may then be used to construct a
45 -- Geom_BSplineSurface surface, for example.
46 -- All those classes define algorithmes to convert an
47 -- ElementarySurface into a B-spline surface.
48 -- This abstract class implements the methods to get
49 -- the geometric representation of the B-spline surface.
50 -- The B-spline representation is computed at the creation
51 -- time in the sub classes.
52 -- The B-spline surface is defined with its degree in the
53 -- parametric U and V directions, its control points (Poles),
54 -- its weights, its knots and their multiplicity.
56 -- Convert, ElementarySurface, BSplineSurface.
59 uses Array1OfInteger from TColStd,
60 Array1OfReal from TColStd,
61 Array2OfReal from TColStd,
62 Array2OfPnt from TColgp,
66 raises OutOfRange from Standard
70 UDegree (me) returns Integer is static;
73 VDegree (me) returns Integer is static;
75 ---Purpose: Returns the degree for the u or v parametric direction of
76 -- the BSpline surface whose data is computed in this framework.
78 NbUPoles (me) returns Integer is static;
81 NbVPoles (me) returns Integer is static;
82 ---Purpose: Returns the number of poles for the u or v parametric
83 -- direction of the BSpline surface whose data is computed in this framework.
85 NbUKnots (me) returns Integer is static;
88 NbVKnots (me) returns Integer is static;
89 ---Purpose: Returns the number of knots for the u or v parametric
90 -- direction of the BSpline surface whose data is computed in this framework .
92 IsUPeriodic(me) returns Boolean is static;
95 IsVPeriodic(me) returns Boolean is static;
96 ---Purpose: Returns true if the BSpline surface whose data is computed
97 -- in this framework is periodic in the u or v parametric direction.
99 Pole (me; UIndex, VIndex : Integer) returns Pnt
100 --- Purpose : Returns the pole of index (UIndex,VIndex) to the poles
101 -- table of the BSpline surface whose data is computed in this framework.
103 -- Standard_OutOfRange if, for the BSpline surface whose
104 -- data is computed in this framework:
105 -- - UIndex is outside the bounds of the poles table in the u
106 -- parametric direction, or
107 -- - VIndex is outside the bounds of the poles table in the v
108 -- parametric direction.
113 Weight (me; UIndex, VIndex : Integer) returns Real
114 --- Purpose : Returns the weight of the pole of index (UIndex,VIndex) to
115 -- the poles table of the BSpline surface whose data is computed in this framework.
117 -- Standard_OutOfRange if, for the BSpline surface whose
118 -- data is computed in this framework:
119 -- - UIndex is outside the bounds of the poles table in the u
120 -- parametric direction, or
121 -- - VIndex is outside the bounds of the poles table in the v
122 -- parametric direction.
127 UKnot (me; UIndex : Integer) returns Real
128 --- Purpose : Returns the U-knot of range UIndex.
130 --- Purpose : Raised if UIndex < 1 or UIndex > NbUKnots.
134 VKnot (me; UIndex : Integer) returns Real
135 --- Purpose : Returns the V-knot of range VIndex.
137 --- Purpose : Raised if VIndex < 1 or VIndex > NbVKnots.
141 UMultiplicity (me; UIndex : Integer) returns Integer
142 --- Purpose : Returns the multiplicity of the U-knot of range UIndex.
144 --- Purpose : Raised if UIndex < 1 or UIndex > NbUKnots.
148 VMultiplicity (me; VIndex : Integer) returns Integer
149 --- Purpose : Returns the multiplicity of the V-knot of range VIndex.
151 --- Purpose : Raised if VIndex < 1 or VIndex > NbVKnots.
155 Initialize (NumberOfUPoles, NumberOfVPoles, NumberOfUKnots,
156 NumberOfVKnots, UDegree, VDegree : Integer);
161 poles : Array2OfPnt is protected;
162 weights : Array2OfReal is protected;
163 uknots : Array1OfReal is protected;
164 umults : Array1OfInteger is protected;
165 vknots : Array1OfReal is protected;
166 vmults : Array1OfInteger is protected;
167 udegree : Integer is protected;
168 vdegree : Integer is protected;
169 nbUPoles : Integer is protected;
170 nbVPoles : Integer is protected;
171 nbUKnots : Integer is protected;
172 nbVKnots : Integer is protected;
173 isuperiodic : Boolean is protected;
174 isvperiodic : Boolean is protected;
177 end ElementarySurfaceToBSplineSurface;