7fd59977 |
1 | -- File: GeomFill_CurveAndTrihedron.cdl |
2 | -- Created: Tue Dec 2 11:51:44 1997 |
3 | -- Author: Philippe MANGIN |
4 | -- <pmn@sgi29> |
5 | ---Copyright: Matra Datavision 1997 |
6 | |
7 | |
8 | class CurveAndTrihedron from GeomFill |
9 | inherits LocationLaw from GeomFill |
10 | |
11 | ---Purpose: Define location law with an TrihedronLaw and an |
12 | -- curve |
13 | -- Definition Location is : |
14 | -- transformed section coordinates in (Curve(v)), |
15 | -- (Normal(v), BiNormal(v), Tangente(v))) systeme are |
16 | -- the same like section shape coordinates in |
17 | -- (O,(OX, OY, OZ)) systeme. |
18 | |
19 | uses |
20 | TrihedronLaw from GeomFill, |
21 | HCurve from Adaptor3d, |
22 | Mat from gp, |
23 | Vec from gp, |
24 | Pnt from gp, |
25 | Array1OfReal from TColStd, |
26 | Array1OfPnt2d from TColgp, |
27 | Array1OfVec2d from TColgp, |
28 | Shape from GeomAbs |
29 | |
30 | raises OutOfRange |
31 | |
32 | is |
33 | Create(Trihedron : TrihedronLaw from GeomFill) |
34 | returns CurveAndTrihedron from GeomFill; |
35 | |
36 | SetCurve(me : mutable; C : HCurve from Adaptor3d) |
37 | is redefined; |
38 | |
39 | GetCurve(me) |
40 | returns HCurve from Adaptor3d |
41 | ---C++: return const & |
42 | is redefined; |
43 | |
44 | SetTrsf(me : mutable; Transfo : Mat from gp) |
45 | ---Purpose: Set a transformation Matrix like the law M(t) become |
46 | -- Mat * M(t) |
47 | is redefined; |
48 | |
49 | Copy(me) |
50 | returns LocationLaw from GeomFill |
51 | is redefined; |
52 | |
53 | -- |
54 | --========== To compute Location and derivatives Location |
55 | -- |
56 | D0(me : mutable; |
57 | Param: Real; |
58 | M : out Mat from gp; |
59 | V : out Vec from gp) |
60 | ---Purpose: compute Location and 2d points |
61 | returns Boolean is redefined; |
62 | |
63 | |
64 | D0(me : mutable; |
65 | Param: Real; |
66 | M : out Mat from gp; |
67 | V : out Vec from gp; |
68 | Poles2d : out Array1OfPnt2d from TColgp) |
69 | ---Purpose: compute Location and 2d points |
70 | returns Boolean is redefined; |
71 | |
72 | D1(me : mutable; |
73 | Param: Real; |
74 | M : out Mat from gp; |
75 | V : out Vec from gp; |
76 | DM : out Mat from gp; |
77 | DV : out Vec from gp; |
78 | Poles2d : out Array1OfPnt2d from TColgp; |
79 | DPoles2d : out Array1OfVec2d from TColgp) |
80 | ---Purpose: compute location 2d points and associated |
81 | -- first derivatives. |
82 | -- Warning : It used only for C1 or C2 aproximation |
83 | returns Boolean |
84 | is redefined; |
85 | |
86 | D2(me : mutable; |
87 | Param: Real; |
88 | M : out Mat from gp; |
89 | V : out Vec from gp; |
90 | DM : out Mat from gp; |
91 | DV : out Vec from gp; |
92 | D2M : out Mat from gp; |
93 | D2V : out Vec from gp; |
94 | Poles2d : out Array1OfPnt2d from TColgp; |
95 | DPoles2d : out Array1OfVec2d from TColgp; |
96 | D2Poles2d : out Array1OfVec2d from TColgp) |
97 | ---Purpose: compute location 2d points and associated |
98 | -- first and seconde derivatives. |
99 | -- Warning : It used only for C2 aproximation |
100 | returns Boolean |
101 | is redefined; |
102 | |
103 | -- |
104 | -- =================== Management of continuity =================== |
105 | -- |
106 | NbIntervals(me; S : Shape from GeomAbs) |
107 | ---Purpose: Returns the number of intervals for continuity |
108 | -- <S>. |
109 | -- May be one if Continuity(me) >= <S> |
110 | returns Integer is redefined; |
111 | |
112 | Intervals(me; T : in out Array1OfReal from TColStd; |
113 | S : Shape from GeomAbs) |
114 | ---Purpose: Stores in <T> the parameters bounding the intervals |
115 | -- of continuity <S>. |
116 | -- |
117 | -- The array must provide enough room to accomodate |
118 | -- for the parameters. i.e. T.Length() > NbIntervals() |
119 | raises |
120 | OutOfRange from Standard |
121 | is redefined; |
122 | |
123 | |
124 | SetInterval(me: mutable; First, Last: Real from Standard) |
125 | ---Purpose: Sets the bounds of the parametric interval on |
126 | -- the function |
127 | -- This determines the derivatives in these values if the |
128 | -- function is not Cn. |
129 | is redefined; |
130 | |
131 | GetInterval(me; First, Last: out Real from Standard) |
132 | ---Purpose: Gets the bounds of the parametric interval on |
133 | -- the function |
134 | is redefined; |
135 | |
136 | GetDomain(me; First, Last: out Real from Standard) |
137 | ---Purpose: Gets the bounds of the function parametric domain. |
138 | -- Warning: This domain it is not modified by the |
139 | -- SetValue method |
140 | is redefined; |
141 | |
142 | -- =================== To help computation of Tolerance =============== |
143 | -- |
144 | -- Evaluation of error, in 2d space, or on composed function, is |
145 | -- difficult. The following methods can help the approximation to |
146 | -- make good evaluation and use good tolerances. |
147 | -- |
148 | -- It is not necessary for the following informations to be very |
149 | -- precise. A fast evaluation is sufficient. |
150 | |
151 | |
152 | GetMaximalNorm(me : mutable) |
153 | ---Purpose: Get the maximum Norm of the matrix-location part. It |
154 | -- is usful to find an good Tolerance to approx M(t). |
155 | returns Real |
156 | is redefined; |
157 | |
158 | GetAverageLaw(me : mutable; |
159 | AM: out Mat from gp; |
160 | AV: out Vec from gp) |
161 | ---Purpose: Get average value of M(t) and V(t) it is usfull to |
162 | -- make fast approximation of rational surfaces. |
163 | is redefined; |
164 | |
165 | -- |
166 | -- To find elementary sweep |
167 | -- |
168 | IsTranslation(me; Error : out Real) |
169 | ---Purpose: Say if the Location Law, is an translation of Location |
170 | -- The default implementation is " returns False ". |
171 | returns Boolean |
172 | is redefined; |
173 | |
174 | IsRotation(me; Error : out Real ) |
175 | ---Purpose: Say if the Location Law, is a rotation of Location |
176 | -- The default implementation is " returns False ". |
177 | returns Boolean |
178 | is redefined; |
179 | |
180 | Rotation(me; Center : out Pnt from gp) |
181 | is redefined; |
182 | |
183 | fields |
184 | WithTrans: Boolean from Standard; |
185 | myLaw : TrihedronLaw from GeomFill; |
186 | myCurve : HCurve from Adaptor3d; |
187 | myTrimmed: HCurve from Adaptor3d; |
188 | Point : Pnt from gp; |
189 | V1, V2, V3 : Vec from gp; |
190 | Trans : Mat from gp; |
191 | end CurveAndTrihedron; |
192 | |
193 | |
194 | |
195 | |
196 | |
197 | |
198 | |
199 | |
200 | |
201 | |
202 | |
203 | |
204 | |
205 | |