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
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.
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.
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.
25 class Spine from ChFiDS inherits TShared from MMgt
27 ---Purpose: Contains information necessary for construction of
31 -- - guideline composed of edges of the solid, tangents
32 -- between them, and borders by faces tangents
35 -- Tools for construction of the Sp
36 -- by propagation from an edge of solid
37 -- are provided in the Builder of Fil3d.
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 ).
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.
56 HArray1OfReal from TColStd,
57 HArray1OfBoolean from TColStd,
62 CurveType from GeomAbs,
65 SequenceOfShape from TopTools,
66 Curve from BRepAdaptor,
70 ListOfHElSpine from ChFiDS,
71 ErrorStatus from ChFiDS
74 ----------------------------
75 -- methodes de construction.
76 ----------------------------
78 Create returns mutable Spine from ChFiDS;
80 Create(Tol : Real from Standard) returns mutable Spine from ChFiDS;
82 SetEdges(me : mutable; E : Edge from TopoDS) is static;
83 ---Purpose: store edges composing the guideline
86 PutInFirst(me : mutable; E : Edge from TopoDS) is static;
87 ---Purpose: store the edge at the first position before all others
90 NbEdges(me) returns Integer is static;
94 Edges(me; I : Integer) returns Edge from TopoDS is static;
95 ---C++: return const &
99 SetFirstStatus(me : mutable; S : State from ChFiDS) is static;
100 ---Purpose: stores if the start of a set of edges starts on a
101 -- section of free border or forms a closed contour
105 SetLastStatus(me : mutable; S : State from ChFiDS) is static;
106 ---Purpose: stores if the end of a set of edges starts on a
107 -- section of free border or forms a closed contour
110 AppendElSpine(me : mutable; Els : HElSpine from ChFiDS)
113 ElSpine(me; IE : Integer from Standard)
114 returns mutable HElSpine from ChFiDS
117 ElSpine(me; E : Edge from TopoDS)
118 returns mutable HElSpine from ChFiDS
121 ElSpine(me; W : Real from Standard)
122 returns mutable HElSpine from ChFiDS
125 ChangeElSpines(me : mutable)
127 returns ListOfHElSpine from ChFiDS
130 Reset(me : mutable; AllData : Boolean from Standard = Standard_False)
133 SplitDone(me) returns Boolean from Standard is static;
134 SplitDone(me : mutable; B : Boolean from Standard) is static;
136 ----------------------
137 -- methodes de calcul.
138 ----------------------
140 Load(me : mutable) is static;
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
148 Resolution(me; R3d : Real) returns Real
151 IsClosed(me) returns Boolean
154 FirstParameter(me) returns Real
157 LastParameter(me) returns Real
160 SetFirstParameter(me : mutable; Par : Real from Standard)
163 SetLastParameter(me : mutable; Par : Real from Standard)
166 FirstParameter(me; IndexSpine : Integer ) returns Real
167 ---Purpose: gives the total length of all arcs before the
171 LastParameter(me; IndexSpine : Integer ) returns Real
172 ---Purpose: gives the total length till the ark with number
173 -- IndexSpine (inclus)
176 Length(me;IndexSpine : Integer ) returns Real
177 ---Purpose: gives the length of ark with number IndexSp
180 IsPeriodic(me) returns Boolean
183 Period(me) returns Real
186 Absc(me :mutable; U : Real) returns Real from Standard
189 Absc(me :mutable; U : Real; I : Integer from Standard)
190 returns Real from Standard
193 Parameter(me :mutable;
196 Oriented : Boolean from Standard = Standard_True)
199 Parameter(me :mutable;
203 Oriented : Boolean from Standard = Standard_True)
207 L : in out Real from Standard;
208 Index : in out Integer from Standard )
211 Value(me :mutable; AbsC : Real ) returns Pnt from gp
214 D0(me :mutable; AbsC : Real ; P : out Pnt from gp)
217 D1(me :mutable; AbsC : Real ; P : out Pnt from gp; V1 : out Vec from gp)
220 D2(me :mutable; AbsC : Real ; P : out Pnt from gp;
221 V1,V2 : out Vec from gp)
224 SetCurrent (me : mutable; Index : Integer )
227 CurrentElementarySpine (me : mutable; Index : Integer )
228 ---Purpose: sets the current curve and returns it
229 returns Curve from BRepAdaptor is static;
230 ---C++: return const &
232 CurrentIndexOfElementarySpine(me) returns Integer from Standard
236 GetType(me) returns CurveType from GeomAbs
239 Line(me) returns Lin from gp
242 Circle(me) returns Circ from gp
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
251 LastStatus(me) returns State from ChFiDS is static;
252 ---Purpose: returns the state at the end of the set
256 Status(me; IsFirst : Boolean from Standard)
257 returns State from ChFiDS is static;
261 SetStatus(me : mutable;
262 S : State from ChFiDS;
263 IsFirst : Boolean from Standard) is static;
266 IsTangencyExtremity(me; IsFirst : Boolean from Standard)
267 returns Boolean is static;
268 ---Purpose: returns if the set of edges starts (or end) on
273 SetTangencyExtremity(me : mutable;
274 IsTangency : Boolean from Standard;
275 IsFirst : Boolean from Standard) is static;
277 -----------------------------------------------------------
278 -- Methodes d acces aux vertex et a leurs parametres
279 -----------------------------------------------------------
281 Absc(me ; V : Vertex from TopoDS) returns Real from Standard
283 FirstVertex(me) returns Vertex from TopoDS;
284 LastVertex(me) returns Vertex from TopoDS;
286 -----------------------------------------------------------
287 -- Methodes de controle des prolongements aux extremites :
288 -- - prolongement par parmetrage etendu,
289 -- - prolongement par la tangente.
290 -----------------------------------------------------------
292 SetFirstTgt(me : mutable; W : Real from Standard) is static;
294 SetLastTgt(me : mutable; W : Real from Standard) is static;
296 HasFirstTgt(me) returns Boolean from Standard is static;
298 HasLastTgt(me) returns Boolean from Standard is static;
301 ---------------------------------------------------------------------
302 -- Methodes d implementation permettant de positionner un flag pour
303 -- le calcul de D2 aux points singuliers de la ligne guide.
304 ---------------------------------------------------------------------
306 SetReference(me : mutable; W : Real from Standard) is static;
307 ---Purpose: set a parameter reference for the approx.
309 SetReference(me : mutable; I : Integer from Standard) is static;
310 ---Purpose: set a parameter reference for the approx, at the
314 W : Real from Standard;
315 Forward : Boolean from Standard = Standard_True)
316 returns Integer from Standard
319 Index(me; E : Edge from TopoDS)
320 returns Integer from Standard
323 UnsetReference(me : mutable) is static;
325 -----------------------------------------------------------------------
326 -- methodes concernant le statut d'erreur
327 -----------------------------------------------------------------------
328 SetErrorStatus(me : mutable; state : ErrorStatus from ChFiDS) is static;
330 ErrorStatus(me) returns ErrorStatus from ChFiDS is static;
335 -- donnees generales.
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;
348 -- donnees caraterisant les extremites.
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;
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;
366 -- detrompeurs de calcul.
368 valref : Real from Standard;
369 hasref : Boolean from Standard;
372 errorstate : ErrorStatus from ChFiDS;