Commit | Line | Data |
---|---|---|
7fd59977 | 1 | -- File: GeomFill_NSections.cdl |
2 | -- Created: Mon Dec 14 15:37:49 1998 | |
3 | -- Author: Joelle CHAUVET | |
4 | -- <jct@sgi64> | |
5 | ---Copyright: Matra Datavision 1998 | |
6 | ||
7 | ||
8 | class NSections from GeomFill inherits SectionLaw from GeomFill | |
9 | ||
10 | ---Purpose: Define a Section Law by N Sections | |
11 | ||
12 | uses | |
13 | Curve from Geom, | |
14 | SequenceOfCurve from TColGeom, | |
15 | BSplineSurface from Geom, | |
16 | BSplineCurve from Geom, | |
17 | Function from Law, | |
18 | Shape from GeomAbs, | |
19 | Pnt from gp, | |
20 | Array1OfPnt from TColgp, | |
21 | Array1OfVec from TColgp, | |
22 | Array1OfInteger from TColStd, | |
23 | Array1OfReal from TColStd, | |
98dbbeb4 J |
24 | SequenceOfReal from TColStd, |
25 | SequenceOfTrsf from GeomFill | |
7fd59977 | 26 | |
27 | raises | |
28 | OutOfRange | |
29 | ||
30 | is | |
31 | Create(NC : SequenceOfCurve from TColGeom) | |
32 | ---Purpose: Make a SectionLaw with N Curves. | |
33 | ||
34 | returns NSections from GeomFill; | |
35 | ||
36 | Create(NC : SequenceOfCurve from TColGeom; | |
37 | NP : SequenceOfReal from TColStd) | |
38 | ---Purpose: Make a SectionLaw with N Curves and N associated parameters. | |
39 | ||
40 | returns NSections from GeomFill; | |
41 | ||
42 | Create(NC : SequenceOfCurve from TColGeom; | |
43 | NP : SequenceOfReal from TColStd; | |
44 | UF, UL : Real from Standard) | |
45 | ---Purpose: Make a SectionLaw with N Curves and N associated parameters. | |
46 | -- UF and UL are the parametric bounds of the NSections | |
47 | ||
48 | returns NSections from GeomFill; | |
49 | ||
50 | Create(NC : SequenceOfCurve from TColGeom; | |
51 | NP : SequenceOfReal from TColStd; | |
52 | UF, UL, VF, VL : Real from Standard) | |
53 | ---Purpose: Make a SectionLaw with N Curves and N associated parameters. | |
54 | -- UF and UL are the parametric bounds of the NSections | |
55 | -- VF and VL are the parametric bounds of the path | |
56 | ||
57 | returns NSections from GeomFill; | |
58 | ||
98dbbeb4 J |
59 | Create(NC : SequenceOfCurve from TColGeom; |
60 | Trsfs : SequenceOfTrsf from GeomFill; | |
61 | NP : SequenceOfReal from TColStd; | |
7fd59977 | 62 | UF, UL, VF, VL : Real from Standard; |
63 | Surf : BSplineSurface from Geom) | |
64 | ---Purpose: Make a SectionLaw with N Curves and N associated parameters. | |
65 | -- UF and UL are the parametric bounds of the NSections | |
66 | -- VF and VL are the parametric bounds of the path | |
67 | -- UF and UL are the parametric bounds of the NSections | |
68 | -- Surf is a reference surface used by BRepFill_NSections | |
69 | ||
70 | returns NSections from GeomFill; | |
71 | ||
72 | -- | |
73 | --========== To compute Sections and derivatives Sections | |
74 | -- | |
75 | ||
76 | D0(me : mutable; | |
77 | Param: Real; | |
78 | Poles : out Array1OfPnt from TColgp; | |
79 | Weigths : out Array1OfReal from TColStd) | |
80 | ---Purpose: compute the section for v = param | |
81 | returns Boolean is redefined; | |
82 | ||
83 | D1(me : mutable; | |
84 | Param: Real; | |
85 | Poles : out Array1OfPnt from TColgp; | |
86 | DPoles : out Array1OfVec from TColgp; | |
87 | Weigths : out Array1OfReal from TColStd; | |
88 | DWeigths : out Array1OfReal from TColStd) | |
89 | ---Purpose: compute the first derivative in v direction of the | |
90 | -- section for v = param | |
91 | -- Warning : It used only for C1 or C2 aproximation | |
92 | returns Boolean | |
93 | is redefined; | |
94 | ||
95 | D2(me : mutable; | |
96 | Param: Real; | |
97 | Poles : out Array1OfPnt from TColgp; | |
98 | DPoles : out Array1OfVec from TColgp; | |
99 | D2Poles : out Array1OfVec from TColgp; | |
100 | Weigths : out Array1OfReal from TColStd; | |
101 | DWeigths : out Array1OfReal from TColStd; | |
102 | D2Weigths : out Array1OfReal from TColStd) | |
103 | ---Purpose: compute the second derivative in v direction of the | |
104 | -- section for v = param | |
105 | -- Warning : It used only for C2 aproximation | |
106 | returns Boolean | |
107 | is redefined; | |
108 | ||
109 | ||
110 | ||
111 | SetSurface(me: mutable; RefSurf: BSplineSurface from Geom) | |
112 | ---Purpose: Sets the reference surface | |
113 | -- | |
114 | ; | |
115 | ||
116 | ||
117 | ComputeSurface(me: mutable) | |
118 | ---Purpose: Computes the surface | |
119 | -- | |
120 | ; | |
121 | ||
122 | ||
123 | BSplineSurface(me) | |
124 | ---Purpose: give if possible an bspline Surface, like iso-v are the | |
125 | -- section. If it is not possible this methode have to | |
126 | -- get an Null Surface. Is it the default implementation. | |
127 | returns BSplineSurface from Geom | |
128 | is redefined; | |
129 | ||
130 | SectionShape(me; NbPoles : out Integer from Standard; | |
131 | NbKnots : out Integer from Standard; | |
132 | Degree : out Integer from Standard) | |
133 | ---Purpose: get the format of an section | |
134 | is redefined; | |
135 | ||
136 | Knots(me; TKnots: out Array1OfReal from TColStd) | |
137 | ---Purpose: get the Knots of the section | |
138 | is redefined; | |
139 | ||
140 | Mults(me; TMults: out Array1OfInteger from TColStd) | |
141 | ---Purpose: get the Multplicities of the section | |
142 | is redefined; | |
143 | ||
144 | IsRational(me) | |
145 | ---Purpose: Returns if the sections are rationnal or not | |
146 | returns Boolean is redefined; | |
147 | ||
148 | IsUPeriodic(me) | |
149 | ---Purpose: Returns if the sections are periodic or not | |
150 | returns Boolean is redefined; | |
151 | ||
152 | IsVPeriodic(me) | |
153 | ---Purpose: Returns if the law isperiodic or not | |
154 | returns Boolean is redefined; | |
155 | -- | |
156 | -- =================== Management of continuity =================== | |
157 | -- | |
158 | NbIntervals(me; S : Shape from GeomAbs) | |
159 | ---Purpose: Returns the number of intervals for continuity | |
160 | -- <S>. | |
161 | -- May be one if Continuity(me) >= <S> | |
162 | returns Integer is redefined; | |
163 | ||
164 | Intervals(me; T : in out Array1OfReal from TColStd; | |
165 | S : Shape from GeomAbs) | |
166 | ---Purpose: Stores in <T> the parameters bounding the intervals | |
167 | -- of continuity <S>. | |
168 | -- | |
169 | -- The array must provide enough room to accomodate | |
170 | -- for the parameters. i.e. T.Length() > NbIntervals() | |
171 | raises | |
172 | OutOfRange from Standard | |
173 | is redefined; | |
174 | ||
175 | ||
176 | SetInterval(me: mutable; First, Last: Real from Standard) | |
177 | ---Purpose: Sets the bounds of the parametric interval on | |
178 | -- the function | |
179 | -- This determines the derivatives in these values if the | |
180 | -- function is not Cn. | |
181 | is redefined; | |
182 | ||
183 | GetInterval(me; First, Last: out Real from Standard) | |
184 | ---Purpose: Gets the bounds of the parametric interval on | |
185 | -- the function | |
186 | is redefined; | |
187 | ||
188 | GetDomain(me; First, Last: out Real from Standard) | |
189 | ---Purpose: Gets the bounds of the function parametric domain. | |
190 | -- Warning: This domain it is not modified by the | |
191 | -- SetValue method | |
192 | is redefined; | |
193 | ||
194 | -- ===================== To help computation of Tolerance ====== | |
195 | -- Evaluation of error, in 2d space, or on rational function, is | |
196 | -- difficult. The following methods can help the approximation to | |
197 | -- make good evaluation and use good tolerances. | |
198 | -- | |
199 | -- It is not necessary for the following informations to be very | |
200 | -- precise. A fast evaluation is sufficient. | |
201 | ||
202 | GetTolerance(me; | |
203 | BoundTol, SurfTol, AngleTol : Real; | |
204 | Tol3d : out Array1OfReal) | |
205 | ---Purpose: Returns the tolerances associated at each poles to | |
206 | -- reach in approximation, to satisfy: BoundTol error | |
207 | -- at the Boundary AngleTol tangent error at the | |
208 | -- Boundary (in radian) SurfTol error inside the | |
209 | -- surface. | |
210 | is redefined; | |
211 | ||
212 | BarycentreOfSurf(me) | |
213 | ---Purpose: Get the barycentre of Surface. | |
214 | -- An very poor estimation is sufficent. | |
215 | -- This information is usefull to perform well | |
216 | -- conditioned rational approximation. | |
217 | -- Warning: Used only if <me> IsRational | |
218 | returns Pnt from gp | |
219 | is redefined; | |
220 | ||
221 | ||
222 | MaximalSection(me) returns Real | |
223 | ---Purpose: Returns the length of the greater section. This | |
224 | -- information is usefull to G1's control. | |
225 | -- Warning: With an little value, approximation can be slower. | |
226 | is redefined; | |
227 | ||
228 | GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd) | |
229 | ---Purpose: Compute the minimal value of weight for each poles | |
230 | -- in all sections. | |
231 | -- This information is usefull to control error | |
232 | -- in rational approximation. | |
233 | -- Warning: Used only if <me> IsRational | |
234 | is redefined; | |
235 | ||
236 | ||
237 | --- Particular case | |
238 | ||
239 | ||
240 | IsConstant(me; Error : out Real) | |
241 | ---Purpose: return True If the Law isConstant | |
242 | returns Boolean | |
243 | is redefined; | |
244 | ||
245 | ConstantSection(me) | |
246 | ---Purpose: Return the constant Section if <me> IsConstant. | |
247 | -- | |
248 | returns Curve from Geom | |
249 | is redefined; | |
250 | ||
251 | IsConicalLaw(me; Error : out Real) | |
252 | ---Purpose: Returns True if all section are circle, with same | |
253 | -- plane,same center and linear radius evolution | |
254 | -- Return False by Default. | |
255 | returns Boolean | |
256 | is redefined; | |
257 | ||
258 | CirclSection(me; Param : Real) | |
259 | ---Purpose: Return the circle section at parameter <Param>, if | |
260 | -- <me> a IsConicalLaw | |
261 | returns Curve from Geom | |
262 | raises OutOfRange from Standard -- If <me> is not a Conical Law | |
263 | is redefined; | |
264 | ||
265 | fields | |
266 | UFirst, ULast, VFirst, VLast : Real; | |
267 | mySections : SequenceOfCurve from TColGeom; | |
98dbbeb4 J |
268 | myTrsfs : SequenceOfTrsf from GeomFill; |
269 | myParams : SequenceOfReal from TColStd; | |
7fd59977 | 270 | mySurface : BSplineSurface from Geom; |
271 | myRefSurf : BSplineSurface from Geom; | |
272 | end NSections; | |
273 | ||
274 | ||
275 | ||
276 | ||
277 |