0026850: Replace nested instantiations of TCollection generic classes by NCollection...
[occt.git] / src / Contap / Contap_TheIWLineOfTheIWalking.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-02-05
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _Contap_TheIWLineOfTheIWalking_HeaderFile
18#define _Contap_TheIWLineOfTheIWalking_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <IntSurf_SequenceOfCouple.hxx>
24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26#include <IntSurf_PathPoint.hxx>
27#include <gp_Vec.hxx>
28#include <MMgt_TShared.hxx>
29#include <IntSurf_Allocator.hxx>
30class IntSurf_LineOn2S;
31class Standard_OutOfRange;
32class Standard_DomainError;
33class IntSurf_PathPoint;
34class IntSurf_PntOn2S;
35class gp_Vec;
36
37
38class Contap_TheIWLineOfTheIWalking;
39DEFINE_STANDARD_HANDLE(Contap_TheIWLineOfTheIWalking, MMgt_TShared)
40
41
42class Contap_TheIWLineOfTheIWalking : public MMgt_TShared
43{
44
45public:
46
47
48 Standard_EXPORT Contap_TheIWLineOfTheIWalking(const IntSurf_Allocator& theAllocator = 0);
49
36b9ff75 50 //! reverse the points in the line. Hasfirst, HasLast are kept.
42cf5bc1 51 Standard_EXPORT void Reverse();
52
36b9ff75 53 //! Cut the line at the point of rank Index.
42cf5bc1 54 void Cut (const Standard_Integer Index);
55
36b9ff75 56 //! Add a point in the line.
42cf5bc1 57 void AddPoint (const IntSurf_PntOn2S& P);
58
59 void AddStatusFirst (const Standard_Boolean Closed, const Standard_Boolean HasFirst);
60
61 void AddStatusFirst (const Standard_Boolean Closed, const Standard_Boolean HasLast, const Standard_Integer Index, const IntSurf_PathPoint& P);
62
63 void AddStatusFirstLast (const Standard_Boolean Closed, const Standard_Boolean HasFirst, const Standard_Boolean HasLast);
64
65 void AddStatusLast (const Standard_Boolean HasLast);
66
67 void AddStatusLast (const Standard_Boolean HasLast, const Standard_Integer Index, const IntSurf_PathPoint& P);
68
36b9ff75 69 //! associer a l 'indice du point sur la ligne l'indice du point
70 //! passant dans l'iterateur de depart
42cf5bc1 71 void AddIndexPassing (const Standard_Integer Index);
72
73 void SetTangentVector (const gp_Vec& V, const Standard_Integer Index);
74
75 void SetTangencyAtBegining (const Standard_Boolean IsTangent);
76
77 void SetTangencyAtEnd (const Standard_Boolean IsTangent);
78
36b9ff75 79 //! Returns the number of points of the line (including first
80 //! point and end point : see HasLastPoint and HasFirstPoint).
42cf5bc1 81 Standard_Integer NbPoints() const;
82
36b9ff75 83 //! Returns the point of range Index.
84 //! If index <= 0 or Index > NbPoints, an exception is raised.
42cf5bc1 85 const IntSurf_PntOn2S& Value (const Standard_Integer Index) const;
86
36b9ff75 87 //! Returns the LineOn2S contained in the walking line.
42cf5bc1 88 const Handle(IntSurf_LineOn2S)& Line() const;
89
36b9ff75 90 //! Returns True if the line is closed.
42cf5bc1 91 Standard_Boolean IsClosed() const;
92
36b9ff75 93 //! Returns True if the first point of the line is a
94 //! marching point . when is HasFirstPoint==False ,the line
95 //! begins on the natural bound of the surface.the line can be
96 //! too long
42cf5bc1 97 Standard_Boolean HasFirstPoint() const;
98
36b9ff75 99 //! Returns True if the end point of the line is a
100 //! marching point (Point from IntWS).
101 //! when is HasFirstPoint==False ,the line ends
102 //! on the natural bound of the surface.the line can be
103 //! too long.
42cf5bc1 104 Standard_Boolean HasLastPoint() const;
105
36b9ff75 106 //! Returns the first point of the line when it is a
107 //! marching point.
108 //! An exception is raised if HasFirstPoint returns False.
42cf5bc1 109 const IntSurf_PathPoint& FirstPoint() const;
110
36b9ff75 111 //! Returns the Index of first point of the line when it is a
112 //! marching point.This index is the index in the
113 //! PointStartIterator.
114 //! An exception is raised if HasFirstPoint returns False.
42cf5bc1 115 Standard_Integer FirstPointIndex() const;
116
36b9ff75 117 //! Returns the last point of the line when it is a
118 //! marching point.
119 //! An exception is raised if HasLastPoint returns False.
42cf5bc1 120 const IntSurf_PathPoint& LastPoint() const;
121
36b9ff75 122 //! Returns the index of last point of the line when it is a
123 //! marching point.This index is the index in the
124 //! PointStartIterator.
125 //! An exception is raised if HasLastPoint returns False.
42cf5bc1 126 Standard_Integer LastPointIndex() const;
127
36b9ff75 128 //! returns the number of points belonging to Pnts1 which are
129 //! passing point.
42cf5bc1 130 Standard_Integer NbPassingPoint() const;
131
36b9ff75 132 //! returns the index of the point belonging to the line which
133 //! is associated to the passing point belonging to Pnts1
134 //! an exception is raised if Index > NbPassingPoint()
42cf5bc1 135 void PassingPoint (const Standard_Integer Index, Standard_Integer& IndexLine, Standard_Integer& IndexPnts) const;
136
137 const gp_Vec& TangentVector (Standard_Integer& Index) const;
138
139 Standard_Boolean IsTangentAtBegining() const;
140
141 Standard_Boolean IsTangentAtEnd() const;
142
143
144
145
146 DEFINE_STANDARD_RTTI(Contap_TheIWLineOfTheIWalking,MMgt_TShared)
147
148protected:
149
150
151
152
153private:
154
155
156 Handle(IntSurf_LineOn2S) line;
157 IntSurf_SequenceOfCouple couple;
158 Standard_Boolean closed;
159 Standard_Boolean hasFirst;
160 Standard_Boolean hasLast;
161 Standard_Integer firstIndex;
162 Standard_Integer lastIndex;
163 IntSurf_PathPoint theFirstPoint;
164 IntSurf_PathPoint theLastPoint;
165 Standard_Integer indextg;
166 gp_Vec vcttg;
167 Standard_Boolean istgtbeg;
168 Standard_Boolean istgtend;
169
170
171};
172
173#define TheStartPoint IntSurf_PathPoint
174#define TheStartPoint_hxx <IntSurf_PathPoint.hxx>
175#define IntWalk_IWLine Contap_TheIWLineOfTheIWalking
176#define IntWalk_IWLine_hxx <Contap_TheIWLineOfTheIWalking.hxx>
177#define Handle_IntWalk_IWLine Handle(Contap_TheIWLineOfTheIWalking)
178
179#include <IntWalk_IWLine.lxx>
180
181#undef TheStartPoint
182#undef TheStartPoint_hxx
183#undef IntWalk_IWLine
184#undef IntWalk_IWLine_hxx
185#undef Handle_IntWalk_IWLine
186
187
188
189
190#endif // _Contap_TheIWLineOfTheIWalking_HeaderFile