b311480e |
1 | -- Created on: 1997-11-20 |
2 | -- Created by: Philippe MANGIN |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | private class SweepFunction from GeomFill |
18 | inherits SweepFunction from Approx |
19 | |
20 | ---Purpose: Function to approximate by SweepApproximation from |
21 | -- Approx. To bulid general sweep Surface. |
22 | |
23 | uses |
24 | SectionLaw from GeomFill, |
25 | LocationLaw from GeomFill, |
26 | |
27 | Mat from gp, |
28 | Vec from gp, |
29 | Pnt from gp, |
30 | Shape from GeomAbs , |
31 | |
32 | Array1OfPnt from TColgp, |
33 | Array1OfVec from TColgp, |
34 | Array1OfPnt2d from TColgp, |
35 | Array1OfVec2d from TColgp, |
36 | Array1OfReal from TColStd, |
37 | Array1OfInteger from TColStd |
38 | |
39 | |
40 | raises |
41 | OutOfRange from Standard |
42 | is |
43 | |
44 | Create(Section : SectionLaw from GeomFill; |
45 | Location : LocationLaw from GeomFill; |
46 | FirstParameter, FirstParameterOnS, RatioParameterOnS : Real) |
47 | returns SweepFunction from GeomFill; |
48 | |
49 | -- |
50 | -- To compute Sections and derivatives Sections |
51 | -- |
52 | -- |
53 | |
54 | D0(me : mutable; |
55 | Param: Real; |
56 | First, Last : Real; |
57 | Poles : out Array1OfPnt from TColgp; |
58 | Poles2d : out Array1OfPnt2d from TColgp; |
59 | Weigths : out Array1OfReal from TColStd) |
60 | ---Purpose: compute the section for v = param |
61 | returns Boolean is redefined; |
62 | |
63 | D1(me : mutable; |
64 | Param: Real; |
65 | First, Last : Real; |
66 | Poles : out Array1OfPnt from TColgp; |
67 | DPoles : out Array1OfVec from TColgp; |
68 | Poles2d : out Array1OfPnt2d from TColgp; |
69 | DPoles2d : out Array1OfVec2d from TColgp; |
70 | Weigths : out Array1OfReal from TColStd; |
71 | DWeigths : out Array1OfReal from TColStd) |
72 | ---Purpose: compute the first derivative in v direction of the |
73 | -- section for v = param |
74 | returns Boolean |
75 | is redefined; |
76 | |
77 | D2(me : mutable; |
78 | Param: Real; |
79 | First, Last : Real; |
80 | Poles : out Array1OfPnt from TColgp; |
81 | DPoles : out Array1OfVec from TColgp; |
82 | D2Poles : out Array1OfVec from TColgp; |
83 | Poles2d : out Array1OfPnt2d from TColgp; |
84 | DPoles2d : out Array1OfVec2d from TColgp; |
85 | D2Poles2d : out Array1OfVec2d from TColgp; |
86 | Weigths : out Array1OfReal from TColStd; |
87 | DWeigths : out Array1OfReal from TColStd; |
88 | D2Weigths : out Array1OfReal from TColStd) |
89 | ---Purpose: compute the second derivative in v direction of the |
90 | -- section for v = param |
91 | returns Boolean |
92 | is redefined; |
93 | |
94 | -- |
95 | -- General Information On The Function |
96 | -- |
97 | |
98 | Nb2dCurves(me) |
99 | ---Purpose: get the number of 2d curves to approximate. |
100 | returns Integer is redefined; |
101 | |
102 | SectionShape(me; NbPoles : out Integer from Standard; |
103 | NbKnots : out Integer from Standard; |
104 | Degree : out Integer from Standard) |
105 | ---Purpose: get the format of an section |
106 | is redefined; |
107 | |
108 | Knots(me; TKnots: out Array1OfReal from TColStd) |
109 | ---Purpose: get the Knots of the section |
110 | is redefined; |
111 | |
112 | |
113 | Mults(me; TMults: out Array1OfInteger from TColStd) |
114 | ---Purpose: get the Multplicities of the section |
115 | is redefined; |
116 | |
117 | |
118 | IsRational(me) |
119 | ---Purpose: Returns if the section is rationnal or not |
120 | returns Boolean is redefined; |
121 | |
122 | |
123 | |
124 | -- |
125 | -- Mangement of continuity |
126 | -- |
127 | |
128 | NbIntervals(me; S : Shape from GeomAbs) |
129 | ---Purpose: Returns the number of intervals for continuity |
130 | -- <S>. May be one if Continuity(me) >= <S> |
131 | returns Integer is redefined; |
132 | |
133 | Intervals(me; T : in out Array1OfReal from TColStd; |
134 | S : Shape from GeomAbs) |
135 | ---Purpose: Stores in <T> the parameters bounding the intervals |
136 | -- of continuity <S>. |
137 | -- |
138 | -- The array must provide enough room to accomodate |
139 | -- for the parameters. i.e. T.Length() > NbIntervals() |
140 | raises |
141 | OutOfRange from Standard |
142 | is redefined; |
143 | |
144 | |
145 | SetInterval(me: mutable; First, Last: Real from Standard) |
146 | ---Purpose: Sets the bounds of the parametric interval on |
147 | -- the function |
148 | -- This determines the derivatives in these values if the |
149 | -- function is not Cn. |
150 | is redefined; |
151 | |
152 | -- |
153 | -- To help computation of Tolerance |
154 | -- |
155 | -- Evaluation of error, in 2d space, or on rational function, is |
156 | -- dificult. The folowing methodes can help |
157 | -- |
158 | -- |
159 | Resolution(me; |
160 | Index : Integer from Standard; |
161 | Tol : Real from Standard; |
162 | TolU, TolV : out Real from Standard) |
163 | ---Purpose: Returns the resolutions in the sub-space 2d <Index> |
164 | -- This information is usfull to find an good tolerance in |
165 | -- 2d approximation. |
166 | -- Warning: Used only if Nb2dCurve > 0 |
167 | is redefined; |
168 | |
169 | GetTolerance(me; |
170 | BoundTol, SurfTol, AngleTol : Real; |
171 | Tol3d : out Array1OfReal) |
172 | ---Purpose: Returns the tolerance to reach in approximation |
173 | -- to respecte |
174 | -- BoundTol error at the Boundary |
175 | -- AngleTol tangent error at the Boundary (in radian) |
176 | -- SurfTol error inside the surface. |
177 | is redefined; |
178 | |
179 | SetTolerance(me : mutable; Tol3d, Tol2d : Real) |
180 | ---Purpose: Is usfull, if (me) have to be run numerical |
181 | -- algorithme to perform D0, D1 or D2 |
182 | is redefined; |
183 | |
184 | BarycentreOfSurf(me) |
185 | ---Purpose: Get the barycentre of Surface. An very poor |
186 | -- estimation is sufficent. This information is usefull |
187 | -- to perform well conditionned rational approximation. |
188 | -- Warning: Used only if <me> IsRational |
189 | returns Pnt from gp |
190 | is redefined; |
191 | |
192 | |
193 | MaximalSection(me) returns Real |
194 | ---Purpose: Returns the length of the maximum section. This |
195 | -- information is usefull to perform well conditionned rational |
196 | -- approximation. |
197 | |
198 | -- Warning: Used only if <me> IsRational |
199 | is redefined; |
200 | |
201 | GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd) |
202 | ---Purpose: Compute the minimal value of weight for each poles |
203 | -- of all sections. This information is usefull to |
204 | -- perform well conditionned rational approximation. |
205 | -- Warning: Used only if <me> IsRational |
206 | is redefined; |
207 | |
208 | fields |
209 | myLoc : LocationLaw from GeomFill; |
210 | mySec : SectionLaw from GeomFill; |
211 | myf : Real; |
212 | myfOnS : Real; |
213 | myRatio: Real; |
214 | M, DM, D2M : Mat from gp; |
215 | V, DV, D2V : Vec from gp; |
216 | end SweepFunction; |