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 {
0048   closed        = Closed;
0049   hasFirst      = HasFirst;
0050   firstIndex    = Index;
0051   theFirstPoint = P;
0052 }
0053 
0054 inline void IntWalk_IWLine::AddStatusLast(const Standard_Boolean HasLast,
0055                                           const Standard_Integer Index,
0056                                           const TheStartPoint&   P)
0057 {
0058   hasLast      = HasLast;
0059   lastIndex    = Index;
0060   theLastPoint = P;
0061 }
0062 
0063 inline void IntWalk_IWLine::AddStatusFirstLast(const Standard_Boolean Closed,
0064                                                const Standard_Boolean HasFirst,
0065                                                const Standard_Boolean HasLast)
0066 {
0067   closed   = Closed;
0068   hasFirst = HasFirst;
0069   hasLast  = HasLast;
0070 }
0071 
0072 inline void IntWalk_IWLine::AddIndexPassing(const Standard_Integer Index)
0073 
0074 {
0075   couple.Append(IntSurf_Couple(line->NbPoints() + 1, Index));
0076 }
0077 
0078 inline Standard_Integer IntWalk_IWLine::NbPoints() const
0079 {
0080   return line->NbPoints();
0081 }
0082 
0083 inline const IntSurf_PntOn2S& IntWalk_IWLine::Value(const Standard_Integer Index) const
0084 {
0085   return line->Value(Index);
0086 }
0087 
0088 inline const Handle(IntSurf_LineOn2S)& IntWalk_IWLine::Line() const
0089 {
0090   return line;
0091 }
0092 
0093 inline Standard_Boolean IntWalk_IWLine::IsClosed() const
0094 {
0095   return closed;
0096 }
0097 
0098 inline Standard_Boolean IntWalk_IWLine::HasFirstPoint() const
0099 {
0100   return hasFirst;
0101 }
0102 
0103 inline Standard_Integer IntWalk_IWLine::FirstPointIndex() const
0104 {
0105   if (!hasFirst)
0106     throw Standard_DomainError();
0107   return firstIndex;
0108 }
0109 
0110 inline const TheStartPoint& IntWalk_IWLine::FirstPoint() const
0111 {
0112   if (!hasFirst)
0113     throw Standard_DomainError();
0114   return theFirstPoint;
0115 }
0116 
0117 inline Standard_Boolean IntWalk_IWLine::HasLastPoint() const
0118 {
0119   return hasLast;
0120 }
0121 
0122 inline const TheStartPoint& IntWalk_IWLine::LastPoint() const
0123 {
0124   if (!hasLast)
0125     throw Standard_DomainError();
0126   return theLastPoint;
0127 }
0128 
0129 inline Standard_Integer IntWalk_IWLine::LastPointIndex() const
0130 {
0131   if (!hasLast)
0132     throw Standard_DomainError();
0133   return lastIndex;
0134 }
0135 
0136 inline Standard_Integer IntWalk_IWLine::NbPassingPoint() const
0137 {
0138   return couple.Length();
0139 }
0140 
0141 inline void IntWalk_IWLine::PassingPoint(const Standard_Integer Index,
0142                                          Standard_Integer&      IndexLine,
0143                                          Standard_Integer&      IndexPnts) const
0144 {
0145   IndexLine = couple(Index).First();
0146   IndexPnts = couple(Index).Second();
0147 }
0148 
0149 inline void IntWalk_IWLine::SetTangentVector(const gp_Vec& V, const Standard_Integer Index)
0150 {
0151   indextg = Index;
0152   vcttg   = V;
0153 
0154   //-- std::cout<<"\n IntWalk_IWLine::SetTangentVector : "<<V.X()<<" "<<V.Y()<<" "<<V.Z()<<"
0155   // Ind:"<<Index<<"  NbPts:"<<NbPoints()<<std::endl;
0156 }
0157 
0158 inline void IntWalk_IWLine::SetTangencyAtBegining(const Standard_Boolean IsTangent)
0159 {
0160 
0161   istgtend = IsTangent;
0162 }
0163 
0164 inline void IntWalk_IWLine::SetTangencyAtEnd(const Standard_Boolean IsTangent)
0165 {
0166 
0167   istgtend = IsTangent;
0168 }
0169 
0170 inline const gp_Vec& IntWalk_IWLine::TangentVector(Standard_Integer& Index) const
0171 {
0172   //--    if(istgtend == Standard_False && istgtbeg == Standard_False) {
0173   //--      std::cout<<" IntWalk_IWLine.lxx : Pb "<<std::endl;
0174   //--    }
0175   Index = indextg;
0176   return vcttg;
0177 }
0178 
0179 inline Standard_Boolean IntWalk_IWLine::IsTangentAtBegining() const
0180 {
0181 
0182   return istgtbeg;
0183 }
0184 
0185 inline Standard_Boolean IntWalk_IWLine::IsTangentAtEnd() const
0186 {
0187 
0188   return istgtend;
0189 }