b311480e |
1 | -- Created on: 1993-11-09 |
2 | -- Created by: Laurent BOURESCHE |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
22 | |
23 | |
24 | |
25 | class Spine from ChFiDS inherits TShared from MMgt |
26 | |
81bba717 |
27 | ---Purpose: Contains information necessary for construction of |
28 | -- a 3D fillet : |
7fd59977 |
29 | -- |
30 | -- |
81bba717 |
31 | -- - guideline composed of edges of the solid, tangents |
32 | -- between them, and borders by faces tangents |
33 | -- between them. |
7fd59977 |
34 | -- |
81bba717 |
35 | -- Tools for construction of the Sp |
36 | -- by propagation from an edge of solid |
37 | -- are provided in the Builder of Fil3d. |
7fd59977 |
38 | -- |
81bba717 |
39 | -- The Spine contains among others the |
40 | -- information about the nature of extremities |
41 | -- of the fillet ( on free border , on section or closed ). |
7fd59977 |
42 | -- |
81bba717 |
43 | -- IMPORTANT NOTE : the guideline |
44 | -- represented in this way is not C2, although the path |
45 | -- claims it. Several palliative workarounds |
46 | -- (see the methods at the end) are planned, |
47 | -- but they are not enough. It is necessary to change |
48 | -- the approach and double the Spine of line C2 with |
49 | -- the known consequences for management of |
50 | -- interactions between KPart Blend in Fil3d. |
7fd59977 |
51 | |
52 | |
53 | |
54 | uses |
55 | |
56 | HArray1OfReal from TColStd, |
57 | HArray1OfBoolean from TColStd, |
58 | Pnt from gp, |
59 | Vec from gp, |
60 | Lin from gp, |
61 | Circ from gp, |
62 | CurveType from GeomAbs, |
63 | Vertex from TopoDS, |
64 | Edge from TopoDS, |
65 | SequenceOfShape from TopTools, |
66 | Curve from BRepAdaptor, |
67 | SurfData from ChFiDS, |
68 | State from ChFiDS, |
69 | HElSpine from ChFiDS, |
70 | ListOfHElSpine from ChFiDS, |
71 | ErrorStatus from ChFiDS |
72 | is |
73 | |
74 | ---------------------------- |
75 | -- methodes de construction. |
76 | ---------------------------- |
77 | |
78 | Create returns mutable Spine from ChFiDS; |
79 | |
80 | Create(Tol : Real from Standard) returns mutable Spine from ChFiDS; |
81 | |
82 | SetEdges(me : mutable; E : Edge from TopoDS) is static; |
81bba717 |
83 | ---Purpose: store edges composing the guideline |
7fd59977 |
84 | ---C++: inline |
85 | |
86 | PutInFirst(me : mutable; E : Edge from TopoDS) is static; |
81bba717 |
87 | ---Purpose: store the edge at the first position before all others |
7fd59977 |
88 | ---C++: inline |
89 | |
90 | NbEdges(me) returns Integer is static; |
91 | ---C++: inline |
92 | |
93 | |
94 | Edges(me; I : Integer) returns Edge from TopoDS is static; |
95 | ---C++: return const & |
96 | ---C++: inline |
97 | |
98 | |
99 | SetFirstStatus(me : mutable; S : State from ChFiDS) is static; |
81bba717 |
100 | ---Purpose: stores if the start of a set of edges starts on a |
101 | -- section of free border or forms a closed contour |
7fd59977 |
102 | ---C++: inline |
103 | |
104 | |
105 | SetLastStatus(me : mutable; S : State from ChFiDS) is static; |
81bba717 |
106 | ---Purpose: stores if the end of a set of edges starts on a |
107 | -- section of free border or forms a closed contour |
7fd59977 |
108 | ---C++: inline |
109 | |
110 | AppendElSpine(me : mutable; Els : HElSpine from ChFiDS) |
111 | is virtual; |
112 | |
113 | ElSpine(me; IE : Integer from Standard) |
114 | returns mutable HElSpine from ChFiDS |
115 | is static; |
116 | |
117 | ElSpine(me; E : Edge from TopoDS) |
118 | returns mutable HElSpine from ChFiDS |
119 | is static; |
120 | |
121 | ElSpine(me; W : Real from Standard) |
122 | returns mutable HElSpine from ChFiDS |
123 | is static; |
124 | |
125 | ChangeElSpines(me : mutable) |
126 | ---C++: return & |
127 | returns ListOfHElSpine from ChFiDS |
128 | is static; |
129 | |
130 | Reset(me : mutable; AllData : Boolean from Standard = Standard_False) |
131 | is virtual; |
132 | |
133 | SplitDone(me) returns Boolean from Standard is static; |
134 | SplitDone(me : mutable; B : Boolean from Standard) is static; |
135 | |
136 | ---------------------- |
137 | -- methodes de calcul. |
138 | ---------------------- |
139 | |
140 | Load(me : mutable) is static; |
81bba717 |
141 | ---Purpose: prepare the guideline depending on the edges that |
142 | -- are elementary arks (take parameters from |
143 | -- a single curvilinear abscissa); to be able to call |
144 | -- methods on the geometry (first,last,value,d1,d2) |
145 | -- it is necessary to start with preparation otherwise an |
146 | -- exception will be raised |
7fd59977 |
147 | |
148 | Resolution(me; R3d : Real) returns Real |
149 | is static; |
150 | |
151 | IsClosed(me) returns Boolean |
152 | is static; |
153 | |
154 | FirstParameter(me) returns Real |
155 | is static; |
156 | |
157 | LastParameter(me) returns Real |
158 | is static; |
159 | |
160 | SetFirstParameter(me : mutable; Par : Real from Standard) |
161 | is static; |
162 | |
163 | SetLastParameter(me : mutable; Par : Real from Standard) |
164 | is static; |
165 | |
166 | FirstParameter(me; IndexSpine : Integer ) returns Real |
81bba717 |
167 | ---Purpose: gives the total length of all arcs before the |
168 | -- number IndexSp |
7fd59977 |
169 | is static; |
170 | |
171 | LastParameter(me; IndexSpine : Integer ) returns Real |
81bba717 |
172 | ---Purpose: gives the total length till the ark with number |
7fd59977 |
173 | -- IndexSpine (inclus) |
174 | is static; |
175 | |
176 | Length(me;IndexSpine : Integer ) returns Real |
81bba717 |
177 | ---Purpose: gives the length of ark with number IndexSp |
7fd59977 |
178 | is static; |
179 | |
180 | IsPeriodic(me) returns Boolean |
181 | is static; |
182 | |
183 | Period(me) returns Real |
184 | is static; |
185 | |
186 | Absc(me :mutable; U : Real) returns Real from Standard |
187 | is static; |
188 | |
189 | Absc(me :mutable; U : Real; I : Integer from Standard) |
190 | returns Real from Standard |
191 | is static; |
192 | |
193 | Parameter(me :mutable; |
194 | AbsC : Real; |
195 | U : out Real; |
196 | Oriented : Boolean from Standard = Standard_True) |
197 | is static; |
198 | |
199 | Parameter(me :mutable; |
200 | Index : Integer; |
201 | AbsC : Real; |
202 | U : out Real; |
203 | Oriented : Boolean from Standard = Standard_True) |
204 | is static; |
205 | |
206 | Prepare(me; |
207 | L : in out Real from Standard; |
208 | Index : in out Integer from Standard ) |
209 | is static private; |
210 | |
211 | Value(me :mutable; AbsC : Real ) returns Pnt from gp |
212 | is static; |
213 | |
214 | D0(me :mutable; AbsC : Real ; P : out Pnt from gp) |
215 | is static; |
216 | |
217 | D1(me :mutable; AbsC : Real ; P : out Pnt from gp; V1 : out Vec from gp) |
218 | is static; |
219 | |
220 | D2(me :mutable; AbsC : Real ; P : out Pnt from gp; |
221 | V1,V2 : out Vec from gp) |
222 | is static; |
223 | |
224 | SetCurrent (me : mutable; Index : Integer ) |
225 | is static; |
226 | |
227 | CurrentElementarySpine (me : mutable; Index : Integer ) |
81bba717 |
228 | ---Purpose: sets the current curve and returns it |
7fd59977 |
229 | returns Curve from BRepAdaptor is static; |
230 | ---C++: return const & |
231 | |
232 | CurrentIndexOfElementarySpine(me) returns Integer from Standard |
233 | ---C++: inline |
234 | is static; |
235 | |
236 | GetType(me) returns CurveType from GeomAbs |
237 | is static; |
238 | |
239 | Line(me) returns Lin from gp |
240 | is static; |
241 | |
242 | Circle(me) returns Circ from gp |
243 | is static; |
244 | |
245 | FirstStatus(me) returns State from ChFiDS is static; |
246 | ---Purpose: returns if the set of edges starts on a free boundary |
247 | -- or if the first vertex is a breakpoint or if the set is |
248 | -- closed |
249 | ---C++: inline |
250 | |
251 | LastStatus(me) returns State from ChFiDS is static; |
252 | ---Purpose: returns the state at the end of the set |
253 | ---C++: inline |
254 | |
255 | |
256 | Status(me; IsFirst : Boolean from Standard) |
257 | returns State from ChFiDS is static; |
258 | ---C++: inline |
259 | |
260 | |
261 | SetStatus(me : mutable; |
262 | S : State from ChFiDS; |
263 | IsFirst : Boolean from Standard) is static; |
264 | ---C++: inline |
265 | |
266 | IsTangencyExtremity(me; IsFirst : Boolean from Standard) |
267 | returns Boolean is static; |
268 | ---Purpose: returns if the set of edges starts (or end) on |
269 | -- Tangency point. |
270 | ---C++: inline |
271 | |
272 | |
273 | SetTangencyExtremity(me : mutable; |
274 | IsTangency : Boolean from Standard; |
275 | IsFirst : Boolean from Standard) is static; |
276 | ---C++: inline |
277 | ----------------------------------------------------------- |
278 | -- Methodes d acces aux vertex et a leurs parametres |
279 | ----------------------------------------------------------- |
280 | |
281 | Absc(me ; V : Vertex from TopoDS) returns Real from Standard |
282 | is static; |
283 | FirstVertex(me) returns Vertex from TopoDS; |
284 | LastVertex(me) returns Vertex from TopoDS; |
285 | |
286 | ----------------------------------------------------------- |
287 | -- Methodes de controle des prolongements aux extremites : |
288 | -- - prolongement par parmetrage etendu, |
289 | -- - prolongement par la tangente. |
290 | ----------------------------------------------------------- |
291 | |
292 | SetFirstTgt(me : mutable; W : Real from Standard) is static; |
293 | |
294 | SetLastTgt(me : mutable; W : Real from Standard) is static; |
295 | |
296 | HasFirstTgt(me) returns Boolean from Standard is static; |
297 | |
298 | HasLastTgt(me) returns Boolean from Standard is static; |
299 | |
300 | |
301 | --------------------------------------------------------------------- |
302 | -- Methodes d implementation permettant de positionner un flag pour |
303 | -- le calcul de D2 aux points singuliers de la ligne guide. |
304 | --------------------------------------------------------------------- |
305 | |
306 | SetReference(me : mutable; W : Real from Standard) is static; |
307 | ---Purpose: set a parameter reference for the approx. |
308 | |
309 | SetReference(me : mutable; I : Integer from Standard) is static; |
310 | ---Purpose: set a parameter reference for the approx, at the |
311 | -- middle of edge I. |
312 | |
313 | Index(me; |
314 | W : Real from Standard; |
315 | Forward : Boolean from Standard = Standard_True) |
316 | returns Integer from Standard |
317 | is static; |
318 | |
319 | Index(me; E : Edge from TopoDS) |
320 | returns Integer from Standard |
321 | is static; |
322 | |
323 | UnsetReference(me : mutable) is static; |
324 | |
325 | ----------------------------------------------------------------------- |
326 | -- methodes concernant le statut d'erreur |
327 | ----------------------------------------------------------------------- |
328 | SetErrorStatus(me : mutable; state : ErrorStatus from ChFiDS) is static; |
329 | |
330 | ErrorStatus(me) returns ErrorStatus from ChFiDS is static; |
331 | |
332 | |
333 | fields |
334 | |
335 | -- donnees generales. |
336 | |
337 | myCurve : Curve from BRepAdaptor; |
338 | indexofcurve : Integer from Standard; |
339 | firstState : State from ChFiDS; |
340 | lastState : State from ChFiDS; |
341 | spine : SequenceOfShape from TopTools; |
342 | abscissa : HArray1OfReal from TColStd; |
343 | --isconstant : HArray1OfBoolean from TColStd is protected; |
344 | splitdone : Boolean from Standard is protected; |
345 | elspines : ListOfHElSpine from ChFiDS is protected; |
346 | tolesp : Real from Standard; |
347 | |
348 | -- donnees caraterisant les extremites. |
349 | |
350 | firstparam : Real from Standard; |
351 | lastparam : Real from Standard; |
352 | firstprolon : Boolean from Standard; |
353 | lastprolon : Boolean from Standard; |
354 | firstistgt : Boolean from Standard; |
355 | lastistgt : Boolean from Standard; |
356 | |
357 | firsttgtpar : Real from Standard; |
358 | lasttgtpar : Real from Standard; |
359 | hasfirsttgt : Boolean from Standard; |
360 | haslasttgt : Boolean from Standard; |
361 | firstori : Pnt from gp; |
362 | lastori : Pnt from gp; |
363 | firsttgt : Vec from gp; |
364 | lasttgt : Vec from gp; |
365 | |
366 | -- detrompeurs de calcul. |
367 | |
368 | valref : Real from Standard; |
369 | hasref : Boolean from Standard; |
370 | |
371 | -- statut d'erreur |
372 | errorstate : ErrorStatus from ChFiDS; |
373 | |
374 | end Spine; |