1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
--
-- File : BSplineCurve.cdl
-- Created : Sat 9 Jan 1993
-- Author : Kiran
--
---Copyright : MATRA-DATAVISION 1993
--
class BSplineCurve from IGESGeom inherits IGESEntity
---Purpose : defines IGESBSplineCurve, Type <126> Form <0-5>
-- in package IGESGeom
-- A parametric equation obtained by dividing two summations
-- involving weights (which are real numbers), the control
-- points, and B-Spline basis functions
uses
Pnt from gp,
XYZ from gp,
HArray1OfReal from TColStd,
HArray1OfXYZ from TColgp
raises DimensionMismatch, OutOfRange
is
Create returns mutable BSplineCurve;
-- Specific Methods pertaining to the class
Init (me : mutable;
anIndex : Integer;
aDegree : Integer;
aPlanar : Boolean;
aClosed : Boolean;
aPolynom : Boolean;
aPeriodic : Boolean;
allKnots : HArray1OfReal;
allWeights : HArray1OfReal;
allPoles : HArray1OfXYZ;
aUmin, aUmax : Real;
aNorm : XYZ)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- BSplineCurve. Beware about indexation of arrays
-- - anIndex : Upper index of the sum
-- - aDegree : Degree of basis functions
-- - aPlanar : 0 = nonplanar curve, 1 = planar curve
-- - aClosed : 0 = open curve, 1 = closed curve
-- - aPolynom : 0 = rational, 1 = polynomial
-- - aPeriodic : 0 = nonperiodic, 1 = periodic
-- - allKnots : Knot sequence values [-Degree,Index+1]
-- - allWeights : Array of weights [0,Index]
-- - allPoles : X, Y, Z coordinates of all control points
-- [0,Index]
-- - aUmin, aUmax : Starting and ending parameter values
-- - aNorm : Unit normal (if the curve is planar)
-- raises exception if allWeights & allPoles are not of same size.
SetFormNumber (me : mutable; form : Integer) raises OutOfRange;
---Purpose : Changes FormNumber (indicates the Shape of the Curve)
-- Error if not in range [0-5]
UpperIndex(me) returns Integer;
---Purpose : returns the upper index of the sum (see Knots,Poles)
Degree(me) returns Integer;
---Purpose : returns the degree of basis functions
IsPlanar(me) returns Boolean;
---Purpose : returns True if the curve is Planar, False if non-planar
IsClosed(me) returns Boolean;
---Purpose : returns True if the curve is closed, False if open
IsPolynomial(me; flag : Boolean = Standard_False) returns Boolean;
---Purpose : returns True if the curve is polynomial, False if rational
-- <flag> False (D) : computed from the list of weights
-- (all must be equal)
-- <flag> True : as recorded
IsPeriodic(me) returns Boolean;
---Purpose : returns True if the curve is periodic, False otherwise
NbKnots(me) returns Integer;
---Purpose : returns the number of knots (i.e. Degree + UpperIndex + 2)
Knot(me; anIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns the knot referred to by anIndex,
-- inside the range [-Degree,UpperIndex+1]
-- raises exception if
-- anIndex < -Degree() or anIndex > (NbKnots() - Degree())
-- Note : Knots are numbered from -Degree (not from 1)
NbPoles(me) returns Integer;
---Purpose : returns number of poles (i.e. UpperIndex + 1)
Weight(me; anIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns the weight referred to by anIndex, in [0,UpperIndex]
-- raises exception if anIndex < 0 or anIndex > UpperIndex()
Pole(me; anIndex : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the pole referred to by anIndex, in [0,UpperIndex]
-- raises exception if anIndex < 0 or anIndex > UpperIndex()
TransformedPole(me; anIndex : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the anIndex'th pole after applying Transf. Matrix
-- raises exception if an Index < 0 or an Index > UpperIndex()
UMin(me) returns Real;
---Purpose : returns starting parameter value
UMax(me) returns Real;
---Purpose : returns ending parameter value
Normal(me) returns XYZ;
---Purpose : if the curve is nonplanar then (0, 0, 0) is returned
fields
--
-- Class : IGESGeom_BSplineCurve
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class BSplineCurve.
--
-- Reminder : A BSplineCurve instance is defined by :
-- A parametric equation obtained by dividing two summations
-- involving weights (which are real numbers), the control
-- points, and B-Spline basis functions
theIndex : Integer; -- Upper index of the sum
theDegree : Integer;
isPlanar : Boolean;
isClosed : Boolean;
isPolynomial : Boolean;
isPeriodic : Boolean;
theKnots : HArray1OfReal;
theWeights : HArray1OfReal;
thePoles : HArray1OfXYZ;
theUmin : Real; -- Starting parameter value
theUmax : Real; -- Ending parameter value
theNorm : XYZ;
end BSplineCurve;
|