1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <Standard_DomainError.hxx>
16 #include <IntSurf_LineOn2S.hxx>
17 #include <IntSurf_Couple.hxx>
18 #include <IntSurf_SequenceOfCouple.hxx>
20 inline void IntWalk_IWLine::Cut(const Standard_Integer Index)
22 //-- std::cout<<" split : "<<Index<<std::endl;
23 Handle(IntSurf_LineOn2S) lost = line->Split(Index);
26 inline void IntWalk_IWLine::AddPoint(const IntSurf_PntOn2S& P)
31 inline void IntWalk_IWLine::AddStatusFirst(const Standard_Boolean Closed,
32 const Standard_Boolean HasFirst)
38 inline void IntWalk_IWLine::AddStatusLast (const Standard_Boolean HasLast)
43 inline void IntWalk_IWLine::AddStatusFirst(const Standard_Boolean Closed,
44 const Standard_Boolean HasFirst,
45 const Standard_Integer Index,
46 const TheStartPoint& P ) {
53 inline void IntWalk_IWLine::AddStatusLast(const Standard_Boolean HasLast,
54 const Standard_Integer Index,
55 const TheStartPoint& P ) {
61 inline void IntWalk_IWLine::AddStatusFirstLast(const Standard_Boolean Closed,
62 const Standard_Boolean HasFirst,
63 const Standard_Boolean HasLast )
70 inline void IntWalk_IWLine::AddIndexPassing(const Standard_Integer Index)
73 couple.Append(IntSurf_Couple(line->NbPoints()+1, Index));
76 inline Standard_Integer IntWalk_IWLine::NbPoints() const
78 return line->NbPoints();
81 inline const IntSurf_PntOn2S& IntWalk_IWLine::Value
82 (const Standard_Integer Index) const
84 return line->Value(Index);
87 inline const Handle(IntSurf_LineOn2S)& IntWalk_IWLine::Line () const
92 inline Standard_Boolean IntWalk_IWLine::IsClosed() const
97 inline Standard_Boolean IntWalk_IWLine::HasFirstPoint() const
102 inline Standard_Integer IntWalk_IWLine::FirstPointIndex() const
104 if (!hasFirst) throw Standard_DomainError();
108 inline const TheStartPoint& IntWalk_IWLine::FirstPoint() const
110 if (!hasFirst) throw Standard_DomainError();
111 return theFirstPoint;
114 inline Standard_Boolean IntWalk_IWLine::HasLastPoint() const
119 inline const TheStartPoint& IntWalk_IWLine::LastPoint() const
121 if (!hasLast) throw Standard_DomainError();
125 inline Standard_Integer IntWalk_IWLine::LastPointIndex() const
127 if (!hasLast) throw Standard_DomainError();
131 inline Standard_Integer IntWalk_IWLine::NbPassingPoint() const
133 return couple.Length();
136 inline void IntWalk_IWLine::PassingPoint(const Standard_Integer Index,
137 Standard_Integer& IndexLine,
138 Standard_Integer& IndexPnts) const
140 IndexLine = couple(Index).First();
141 IndexPnts = couple(Index).Second();
144 inline void IntWalk_IWLine::SetTangentVector (const gp_Vec& V,
145 const Standard_Integer Index) {
149 //-- std::cout<<"\n IntWalk_IWLine::SetTangentVector : "<<V.X()<<" "<<V.Y()<<" "<<V.Z()<<" Ind:"<<Index<<" NbPts:"<<NbPoints()<<std::endl;
153 inline void IntWalk_IWLine::SetTangencyAtBegining
154 (const Standard_Boolean IsTangent) {
156 istgtend = IsTangent;
159 inline void IntWalk_IWLine::SetTangencyAtEnd
160 (const Standard_Boolean IsTangent) {
162 istgtend = IsTangent;
165 inline const gp_Vec& IntWalk_IWLine::TangentVector
166 (Standard_Integer& Index) const {
167 //-- if(istgtend == Standard_False && istgtbeg == Standard_False) {
168 //-- std::cout<<" IntWalk_IWLine.lxx : Pb "<<std::endl;
174 inline Standard_Boolean IntWalk_IWLine::IsTangentAtBegining () const {
179 inline Standard_Boolean IntWalk_IWLine::IsTangentAtEnd () const {