1 -- Created on: 1993-11-09
2 -- Created by: Laurent BOURESCHE
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Spine from ChFiDS inherits TShared from MMgt
19 ---Purpose: Contains information necessary for construction of
20 -- a 3D fillet or chamfer:
23 -- - guideline composed of edges of the solid, tangents
24 -- between them, and borders by faces tangents
27 -- Tools for construction of the Sp
28 -- by propagation from an edge of solid
29 -- are provided in the Builder of Fil3d.
31 -- The Spine contains among others the
32 -- information about the nature of extremities
33 -- of the fillet ( on free border , on section or closed ).
35 -- IMPORTANT NOTE : the guideline
36 -- represented in this way is not C2, although the path
37 -- claims it. Several palliative workarounds
38 -- (see the methods at the end) are planned,
39 -- but they are not enough. It is necessary to change
40 -- the approach and double the Spine of line C2 with
41 -- the known consequences for management of
42 -- interactions between KPart Blend in Fil3d.
48 HArray1OfReal from TColStd,
49 HArray1OfBoolean from TColStd,
54 CurveType from GeomAbs,
57 SequenceOfShape from TopTools,
58 Curve from BRepAdaptor,
62 ListOfHElSpine from ChFiDS,
63 ErrorStatus from ChFiDS
66 ----------------------------
67 -- methodes de construction.
68 ----------------------------
70 Create returns Spine from ChFiDS;
72 Create(Tol : Real from Standard) returns Spine from ChFiDS;
74 SetEdges(me : mutable; E : Edge from TopoDS) is static;
75 ---Purpose: store edges composing the guideline
78 PutInFirst(me : mutable; E : Edge from TopoDS) is static;
79 ---Purpose: store the edge at the first position before all others
82 NbEdges(me) returns Integer is static;
86 Edges(me; I : Integer) returns Edge from TopoDS is static;
87 ---C++: return const &
91 SetFirstStatus(me : mutable; S : State from ChFiDS) is static;
92 ---Purpose: stores if the start of a set of edges starts on a
93 -- section of free border or forms a closed contour
97 SetLastStatus(me : mutable; S : State from ChFiDS) is static;
98 ---Purpose: stores if the end of a set of edges starts on a
99 -- section of free border or forms a closed contour
102 AppendElSpine(me : mutable; Els : HElSpine from ChFiDS)
105 ElSpine(me; IE : Integer from Standard)
106 returns HElSpine from ChFiDS
109 ElSpine(me; E : Edge from TopoDS)
110 returns HElSpine from ChFiDS
113 ElSpine(me; W : Real from Standard)
114 returns HElSpine from ChFiDS
117 ChangeElSpines(me : mutable)
119 returns ListOfHElSpine from ChFiDS
122 Reset(me : mutable; AllData : Boolean from Standard = Standard_False)
125 SplitDone(me) returns Boolean from Standard is static;
126 SplitDone(me : mutable; B : Boolean from Standard) is static;
128 ----------------------
129 -- methodes de calcul.
130 ----------------------
132 Load(me : mutable) is static;
133 ---Purpose: prepare the guideline depending on the edges that
134 -- are elementary arks (take parameters from
135 -- a single curvilinear abscissa); to be able to call
136 -- methods on the geometry (first,last,value,d1,d2)
137 -- it is necessary to start with preparation otherwise an
138 -- exception will be raised
140 Resolution(me; R3d : Real) returns Real
143 IsClosed(me) returns Boolean
146 FirstParameter(me) returns Real
149 LastParameter(me) returns Real
152 SetFirstParameter(me : mutable; Par : Real from Standard)
155 SetLastParameter(me : mutable; Par : Real from Standard)
158 FirstParameter(me; IndexSpine : Integer ) returns Real
159 ---Purpose: gives the total length of all arcs before the
163 LastParameter(me; IndexSpine : Integer ) returns Real
164 ---Purpose: gives the total length till the ark with number
165 -- IndexSpine (inclus)
168 Length(me;IndexSpine : Integer ) returns Real
169 ---Purpose: gives the length of ark with number IndexSp
172 IsPeriodic(me) returns Boolean
175 Period(me) returns Real
178 Absc(me :mutable; U : Real) returns Real from Standard
181 Absc(me :mutable; U : Real; I : Integer from Standard)
182 returns Real from Standard
185 Parameter(me :mutable;
188 Oriented : Boolean from Standard = Standard_True)
191 Parameter(me :mutable;
195 Oriented : Boolean from Standard = Standard_True)
199 L : in out Real from Standard;
200 Index : in out Integer from Standard )
203 Value(me :mutable; AbsC : Real ) returns Pnt from gp
206 D0(me :mutable; AbsC : Real ; P : out Pnt from gp)
209 D1(me :mutable; AbsC : Real ; P : out Pnt from gp; V1 : out Vec from gp)
212 D2(me :mutable; AbsC : Real ; P : out Pnt from gp;
213 V1,V2 : out Vec from gp)
216 SetCurrent (me : mutable; Index : Integer )
219 CurrentElementarySpine (me : mutable; Index : Integer )
220 ---Purpose: sets the current curve and returns it
221 returns Curve from BRepAdaptor is static;
222 ---C++: return const &
224 CurrentIndexOfElementarySpine(me) returns Integer from Standard
228 GetType(me) returns CurveType from GeomAbs
231 Line(me) returns Lin from gp
234 Circle(me) returns Circ from gp
237 FirstStatus(me) returns State from ChFiDS is static;
238 ---Purpose: returns if the set of edges starts on a free boundary
239 -- or if the first vertex is a breakpoint or if the set is
243 LastStatus(me) returns State from ChFiDS is static;
244 ---Purpose: returns the state at the end of the set
248 Status(me; IsFirst : Boolean from Standard)
249 returns State from ChFiDS is static;
253 SetStatus(me : mutable;
254 S : State from ChFiDS;
255 IsFirst : Boolean from Standard) is static;
258 IsTangencyExtremity(me; IsFirst : Boolean from Standard)
259 returns Boolean is static;
260 ---Purpose: returns if the set of edges starts (or end) on
265 SetTangencyExtremity(me : mutable;
266 IsTangency : Boolean from Standard;
267 IsFirst : Boolean from Standard) is static;
269 -----------------------------------------------------------
270 -- Methodes d acces aux vertex et a leurs parametres
271 -----------------------------------------------------------
273 Absc(me ; V : Vertex from TopoDS) returns Real from Standard
275 FirstVertex(me) returns Vertex from TopoDS;
276 LastVertex(me) returns Vertex from TopoDS;
278 -----------------------------------------------------------
279 -- Methodes de controle des prolongements aux extremites :
280 -- - prolongement par parmetrage etendu,
281 -- - prolongement par la tangente.
282 -----------------------------------------------------------
284 SetFirstTgt(me : mutable; W : Real from Standard) is static;
286 SetLastTgt(me : mutable; W : Real from Standard) is static;
288 HasFirstTgt(me) returns Boolean from Standard is static;
290 HasLastTgt(me) returns Boolean from Standard is static;
293 ---------------------------------------------------------------------
294 -- Methodes d implementation permettant de positionner un flag pour
295 -- le calcul de D2 aux points singuliers de la ligne guide.
296 ---------------------------------------------------------------------
298 SetReference(me : mutable; W : Real from Standard) is static;
299 ---Purpose: set a parameter reference for the approx.
301 SetReference(me : mutable; I : Integer from Standard) is static;
302 ---Purpose: set a parameter reference for the approx, at the
306 W : Real from Standard;
307 Forward : Boolean from Standard = Standard_True)
308 returns Integer from Standard
311 Index(me; E : Edge from TopoDS)
312 returns Integer from Standard
315 UnsetReference(me : mutable) is static;
317 -----------------------------------------------------------------------
318 -- methodes concernant le statut d'erreur
319 -----------------------------------------------------------------------
320 SetErrorStatus(me : mutable; state : ErrorStatus from ChFiDS) is static;
322 ErrorStatus(me) returns ErrorStatus from ChFiDS is static;
327 -- donnees generales.
329 myCurve : Curve from BRepAdaptor;
330 indexofcurve : Integer from Standard;
331 firstState : State from ChFiDS;
332 lastState : State from ChFiDS;
333 spine : SequenceOfShape from TopTools;
334 abscissa : HArray1OfReal from TColStd;
335 --isconstant : HArray1OfBoolean from TColStd is protected;
336 splitdone : Boolean from Standard is protected;
337 elspines : ListOfHElSpine from ChFiDS is protected;
338 tolesp : Real from Standard;
340 -- donnees caraterisant les extremites.
342 firstparam : Real from Standard;
343 lastparam : Real from Standard;
344 firstprolon : Boolean from Standard;
345 lastprolon : Boolean from Standard;
346 firstistgt : Boolean from Standard;
347 lastistgt : Boolean from Standard;
349 firsttgtpar : Real from Standard;
350 lasttgtpar : Real from Standard;
351 hasfirsttgt : Boolean from Standard;
352 haslasttgt : Boolean from Standard;
353 firstori : Pnt from gp;
354 lastori : Pnt from gp;
355 firsttgt : Vec from gp;
356 lasttgt : Vec from gp;
358 -- detrompeurs de calcul.
360 valref : Real from Standard;
361 hasref : Boolean from Standard;
364 errorstate : ErrorStatus from ChFiDS;