Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/IntWalk_IWLine.lxx is written in an unsupported language. File is not indexed.

0001 // Copyright (c) 1995-1999 Matra Datavision
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #include <Standard_DomainError.hxx>
0016 #include <IntSurf_LineOn2S.hxx>
0017 #include <IntSurf_Couple.hxx>
0018 #include <IntSurf_SequenceOfCouple.hxx>
0019 
0020 inline void IntWalk_IWLine::Cut(const Standard_Integer Index)
0021 {
0022 //--   std::cout<<" split : "<<Index<<std::endl;
0023   Handle(IntSurf_LineOn2S) lost = line->Split(Index);
0024 }
0025 
0026 inline void IntWalk_IWLine::AddPoint(const IntSurf_PntOn2S& P)
0027 {
0028   line->Add(P);
0029 }
0030 
0031 inline void IntWalk_IWLine::AddStatusFirst(const Standard_Boolean Closed,
0032                                            const Standard_Boolean HasFirst)
0033 {
0034   closed = Closed;
0035   hasFirst = HasFirst; 
0036 }
0037 
0038 inline void IntWalk_IWLine::AddStatusLast (const Standard_Boolean HasLast)
0039 {
0040   hasLast = HasLast; 
0041 }
0042 
0043 inline void IntWalk_IWLine::AddStatusFirst(const Standard_Boolean Closed,
0044                                            const Standard_Boolean HasFirst,
0045                                            const Standard_Integer Index,
0046                                            const TheStartPoint& P ) {
0047   closed = Closed;
0048   hasFirst = HasFirst; 
0049   firstIndex = Index;
0050   theFirstPoint = P;
0051 }
0052 
0053 inline void IntWalk_IWLine::AddStatusLast(const Standard_Boolean HasLast,
0054                                           const Standard_Integer Index,
0055                                           const TheStartPoint& P ) {
0056   hasLast = HasLast; 
0057   lastIndex = Index;
0058   theLastPoint = P;
0059 }
0060 
0061 inline void IntWalk_IWLine::AddStatusFirstLast(const Standard_Boolean Closed,
0062                                                const Standard_Boolean HasFirst,
0063                                                const Standard_Boolean HasLast )
0064 {
0065   closed = Closed;
0066   hasFirst = HasFirst; 
0067   hasLast = HasLast;
0068 }
0069 
0070 inline void IntWalk_IWLine::AddIndexPassing(const Standard_Integer Index)
0071 
0072 {
0073   couple.Append(IntSurf_Couple(line->NbPoints()+1, Index));
0074 }
0075 
0076 inline Standard_Integer IntWalk_IWLine::NbPoints() const
0077 {
0078   return line->NbPoints();
0079 }
0080   
0081 inline const IntSurf_PntOn2S& IntWalk_IWLine::Value
0082   (const Standard_Integer Index) const
0083 {
0084   return line->Value(Index);
0085 }
0086 
0087 inline const Handle(IntSurf_LineOn2S)& IntWalk_IWLine::Line () const
0088 {
0089   return line;
0090 }
0091 
0092 inline Standard_Boolean IntWalk_IWLine::IsClosed() const
0093 {
0094   return closed;
0095 }
0096 
0097 inline Standard_Boolean IntWalk_IWLine::HasFirstPoint() const
0098 {
0099   return hasFirst;
0100 }
0101 
0102 inline Standard_Integer IntWalk_IWLine::FirstPointIndex() const
0103 {
0104   if (!hasFirst) throw Standard_DomainError();
0105   return firstIndex;
0106 }
0107 
0108 inline const TheStartPoint& IntWalk_IWLine::FirstPoint() const
0109 {
0110  if (!hasFirst) throw Standard_DomainError();
0111  return theFirstPoint;
0112 }
0113 
0114 inline Standard_Boolean IntWalk_IWLine::HasLastPoint() const
0115 {
0116   return hasLast;
0117 }
0118 
0119 inline const TheStartPoint& IntWalk_IWLine::LastPoint() const
0120 {
0121   if (!hasLast) throw Standard_DomainError();
0122   return theLastPoint;
0123 }
0124 
0125 inline Standard_Integer IntWalk_IWLine::LastPointIndex() const
0126 {
0127   if (!hasLast) throw Standard_DomainError();
0128   return lastIndex;
0129 }
0130 
0131 inline Standard_Integer IntWalk_IWLine::NbPassingPoint() const
0132 { 
0133   return couple.Length();
0134 }
0135 
0136 inline void IntWalk_IWLine::PassingPoint(const Standard_Integer Index,
0137                                          Standard_Integer& IndexLine,
0138                                          Standard_Integer& IndexPnts) const 
0139 {
0140   IndexLine = couple(Index).First();
0141   IndexPnts = couple(Index).Second();
0142 }
0143 
0144 inline void IntWalk_IWLine::SetTangentVector (const gp_Vec& V,
0145                                               const Standard_Integer Index) {
0146   indextg = Index;
0147   vcttg = V;
0148   
0149   //-- std::cout<<"\n IntWalk_IWLine::SetTangentVector : "<<V.X()<<" "<<V.Y()<<" "<<V.Z()<<"   Ind:"<<Index<<"  NbPts:"<<NbPoints()<<std::endl;
0150   
0151 }
0152 
0153 inline void IntWalk_IWLine::SetTangencyAtBegining
0154   (const Standard_Boolean IsTangent) {
0155 
0156   istgtend = IsTangent;
0157 }
0158 
0159 inline void IntWalk_IWLine::SetTangencyAtEnd
0160   (const Standard_Boolean IsTangent) {
0161 
0162   istgtend = IsTangent;
0163 }
0164 
0165 inline const gp_Vec& IntWalk_IWLine::TangentVector
0166   (Standard_Integer& Index) const {
0167 //--    if(istgtend == Standard_False && istgtbeg == Standard_False) { 
0168 //--      std::cout<<" IntWalk_IWLine.lxx : Pb "<<std::endl;
0169 //--    }
0170   Index = indextg;
0171   return vcttg;
0172 }
0173 
0174 inline Standard_Boolean IntWalk_IWLine::IsTangentAtBegining () const {
0175 
0176   return istgtbeg;
0177 }
0178 
0179 inline Standard_Boolean IntWalk_IWLine::IsTangentAtEnd () const {
0180 
0181   return istgtend;
0182 }
0183 
0184