1 -- Created on: 1992-03-25
2 -- Created by: Isabelle GRIGNON
3 -- Copyright (c) 1992-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 generic class IWLine from IntWalk
18 (TheStartPoint as any)
20 inherits TShared from MMgt
22 ---Purpose: Definition of a polyline resulting of the IWalking algoritm.
23 -- Each point verifies :
24 -- F(x(u,v),y(u,v),z(u,v))=0, F=implicit function.
25 -- (x(u,v),y(u,v),z(u,v)) point on a parametric surface.
26 -- This polyline is computed marching from a starting a point
27 -- located on the surface 's boundary or inside the surface
29 -- a marching status is returned:
30 -- ok --> the polyline starts and ends on a marching
32 -- tangent --> the polyline ends on a tangent point
33 -- outside the boundaries --> the polyline is outside the
34 -- surface 's boundaries .it ends on the natural boundaries
35 -- because no marching points where found to stop
36 -- beware : the directions are not oriented.
38 uses Allocator from IntSurf,
40 SequenceOfCouple from IntSurf,
42 LineOn2S from IntSurf,
46 raises OutOfRange from Standard,
47 DomainError from Standard
52 Create (theAllocator: Allocator from IntSurf = 0)
58 ---Purpose: reverse the points in the line. Hasfirst, HasLast are kept.
61 Cut(me : mutable; Index : Integer from Standard)
62 ---Purpose: Cut the line at the point of rank Index.
66 AddPoint(me : mutable; P : PntOn2S from IntSurf)
67 ---Purpose: Add a point in the line.
71 AddStatusFirst(me : mutable; Closed, HasFirst : Boolean from Standard)
76 AddStatusFirst(me : mutable; Closed, HasLast : Boolean from Standard;
77 Index : Integer from Standard;
84 AddStatusFirstLast(me : mutable;
85 Closed, HasFirst, HasLast: Boolean from Standard)
90 AddStatusLast(me : mutable; HasLast : Boolean from Standard)
95 AddStatusLast(me : mutable; HasLast : Boolean from Standard;
96 Index : Integer from Standard;
102 AddIndexPassing(me : mutable; Index : Integer from Standard)
104 ---Purpose: associer a l 'indice du point sur la ligne l'indice du point
105 -- passant dans l'iterateur de depart
111 SetTangentVector(me: mutable; V: Vec from gp;
112 Index: Integer from Standard)
117 SetTangencyAtBegining(me: mutable; IsTangent: Boolean from Standard)
122 SetTangencyAtEnd(me: mutable; IsTangent: Boolean from Standard)
130 ---Purpose: Returns the number of points of the line (including first
131 -- point and end point : see HasLastPoint and HasFirstPoint).
133 returns Integer from Standard
139 Value(me; Index: Integer from Standard)
141 ---Purpose: Returns the point of range Index.
142 -- If index <= 0 or Index > NbPoints, an exception is raised.
144 returns PntOn2S from IntSurf
145 ---C++: return const&
148 raises OutOfRange from Standard
155 ---Purpose: Returns the LineOn2S contained in the walking line.
157 returns LineOn2S from IntSurf
158 ---C++: return const&
166 ---Purpose: Returns True if the line is closed.
168 returns Boolean from Standard
176 ---Purpose: Returns True if the first point of the line is a
177 -- marching point . when is HasFirstPoint==False ,the line
178 -- begins on the natural bound of the surface.the line can be
181 returns Boolean from Standard
189 ---Purpose: Returns True if the end point of the line is a
190 -- marching point (Point from IntWS).
191 -- when is HasFirstPoint==False ,the line ends
192 -- on the natural bound of the surface.the line can be
195 returns Boolean from Standard
203 ---Purpose: Returns the first point of the line when it is a
205 -- An exception is raised if HasFirstPoint returns False.
207 returns any TheStartPoint
208 ---C++: return const&
211 raises DomainError from Standard
218 ---Purpose: Returns the Index of first point of the line when it is a
219 -- marching point.This index is the index in the
220 -- PointStartIterator.
221 -- An exception is raised if HasFirstPoint returns False.
223 returns Integer from Standard
226 raises DomainError from Standard
233 ---Purpose: Returns the last point of the line when it is a
235 -- An exception is raised if HasLastPoint returns False.
237 returns any TheStartPoint
238 ---C++: return const&
241 raises DomainError from Standard
248 ---Purpose: Returns the index of last point of the line when it is a
249 -- marching point.This index is the index in the
250 -- PointStartIterator.
251 -- An exception is raised if HasLastPoint returns False.
253 returns Integer from Standard
256 raises DomainError from Standard
263 ---Purpose: returns the number of points belonging to Pnts1 which are
266 returns Integer from Standard
272 PassingPoint(me; Index: Integer from Standard;
273 IndexLine, IndexPnts : out Integer from Standard)
275 ---Purpose: returns the index of the point belonging to the line which
276 -- is associated to the passing point belonging to Pnts1
277 -- an exception is raised if Index > NbPassingPoint()
279 raises OutOfRange from Standard
286 TangentVector(me; Index: out Integer from Standard)
289 ---C++: return const&
295 IsTangentAtBegining(me)
297 returns Boolean from Standard
305 returns Boolean from Standard
313 line : LineOn2S from IntSurf;
314 couple : SequenceOfCouple from IntSurf;
315 closed : Boolean from Standard;
316 hasFirst : Boolean from Standard;
317 hasLast : Boolean from Standard;
318 firstIndex : Integer from Standard;
319 lastIndex : Integer from Standard;
320 theFirstPoint : TheStartPoint;
321 theLastPoint : TheStartPoint;
322 indextg : Integer from Standard;
324 istgtbeg : Boolean from Standard;
325 istgtend : Boolean from Standard;