summaryrefslogtreecommitdiff
path: root/inc/IntWalk_IWLine.lxx
blob: c1aefadd47003a1d25c9ae586ba68e1e972847f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#ifndef Standard_DomainError_HeaderFile
#include <Standard_DomainError.hxx>
#endif
#ifndef IntSurf_LineOn2S_HeaderFile
#include <IntSurf_LineOn2S.hxx>
#endif
#ifndef IntSurf_Couple_HeaderFile
#include <IntSurf_Couple.hxx>
#endif
#ifndef IntSurf_SequenceOfCouple_HeaderFile
#include <IntSurf_SequenceOfCouple.hxx>
#endif

inline void IntWalk_IWLine::Cut(const Standard_Integer Index)
{
//--   cout<<" split : "<<Index<<endl;
  Handle(IntSurf_LineOn2S) lost = line->Split(Index);
}

inline void IntWalk_IWLine::AddPoint(const IntSurf_PntOn2S& P)
{
  line->Add(P);
}

inline void IntWalk_IWLine::AddStatusFirst(const Standard_Boolean Closed,
					   const Standard_Boolean HasFirst)
{
  closed = Closed;
  hasFirst = HasFirst; 
}

inline void IntWalk_IWLine::AddStatusLast (const Standard_Boolean HasLast)
{
  hasLast = HasLast; 
}

inline void IntWalk_IWLine::AddStatusFirst(const Standard_Boolean Closed,
					   const Standard_Boolean HasFirst,
					   const Standard_Integer Index,
					   const TheStartPoint& P ) {
  closed = Closed;
  hasFirst = HasFirst; 
  firstIndex = Index;
  theFirstPoint = P;
}

inline void IntWalk_IWLine::AddStatusLast(const Standard_Boolean HasLast,
					  const Standard_Integer Index,
					  const TheStartPoint& P ) {
  hasLast = HasLast; 
  lastIndex = Index;
  theLastPoint = P;
}

inline void IntWalk_IWLine::AddStatusFirstLast(const Standard_Boolean Closed,
					       const Standard_Boolean HasFirst,
					       const Standard_Boolean HasLast )
{
  closed = Closed;
  hasFirst = HasFirst; 
  hasLast = HasLast;
}

inline void IntWalk_IWLine::AddIndexPassing(const Standard_Integer Index)

{
  couple.Append(IntSurf_Couple(line->NbPoints()+1, Index));
}

inline Standard_Integer IntWalk_IWLine::NbPoints() const
{
  return line->NbPoints();
}
  
inline const IntSurf_PntOn2S& IntWalk_IWLine::Value
  (const Standard_Integer Index) const
{
  return line->Value(Index);
}

inline const Handle(IntSurf_LineOn2S)& IntWalk_IWLine::Line () const
{
  return line;
}

inline Standard_Boolean IntWalk_IWLine::IsClosed() const
{
  return closed;
}

inline Standard_Boolean IntWalk_IWLine::HasFirstPoint() const
{
  return hasFirst;
}

inline Standard_Integer IntWalk_IWLine::FirstPointIndex() const
{
  if (!hasFirst) Standard_DomainError::Raise();
  return firstIndex;
}

inline const TheStartPoint& IntWalk_IWLine::FirstPoint() const
{
 if (!hasFirst) Standard_DomainError::Raise();
 return theFirstPoint;
}

inline Standard_Boolean IntWalk_IWLine::HasLastPoint() const
{
  return hasLast;
}

inline const TheStartPoint& IntWalk_IWLine::LastPoint() const
{
  if (!hasLast) Standard_DomainError::Raise();
  return theLastPoint;
}

inline Standard_Integer IntWalk_IWLine::LastPointIndex() const
{
  if (!hasLast) Standard_DomainError::Raise();
  return lastIndex;
}

inline Standard_Integer IntWalk_IWLine::NbPassingPoint() const
{ 
  return couple.Length();
}

inline void IntWalk_IWLine::PassingPoint(const Standard_Integer Index,
					 Standard_Integer& IndexLine,
					 Standard_Integer& IndexPnts) const 
{
  IndexLine = couple(Index).First();
  IndexPnts = couple(Index).Second();
}

inline void IntWalk_IWLine::SetTangentVector (const gp_Vec& V,
					      const Standard_Integer Index) {
  indextg = Index;
  vcttg = V;
  
  //-- cout<<"\n IntWalk_IWLine::SetTangentVector : "<<V.X()<<" "<<V.Y()<<" "<<V.Z()<<"   Ind:"<<Index<<"  NbPts:"<<NbPoints()<<endl;
  
}

inline void IntWalk_IWLine::SetTangencyAtBegining
  (const Standard_Boolean IsTangent) {

  istgtend = IsTangent;
}

inline void IntWalk_IWLine::SetTangencyAtEnd
  (const Standard_Boolean IsTangent) {

  istgtend = IsTangent;
}

inline const gp_Vec& IntWalk_IWLine::TangentVector
  (Standard_Integer& Index) const {
//--    if(istgtend == Standard_False && istgtbeg == Standard_False) { 
//--      cout<<" IntWalk_IWLine.lxx : Pb "<<endl;
//--    }
  Index = indextg;
  return vcttg;
}

inline Standard_Boolean IntWalk_IWLine::IsTangentAtBegining () const {

  return istgtbeg;
}

inline Standard_Boolean IntWalk_IWLine::IsTangentAtEnd () const {

  return istgtend;
}