Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-05-27
0002 // Created by: Isabelle GRIGNON
0003 // Copyright (c) 1991-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #include <Standard_DomainError.hxx>
0018 #include <IntSurf_LineOn2S.hxx>
0019 #include <IntPatch_Point.hxx>
0020 
0021 inline void IntPatch_WLine::AddVertex(const IntPatch_Point&  thePnt,
0022                                       const Standard_Boolean theIsPrepend)
0023 {
0024   if (theIsPrepend)
0025     svtx.Prepend(thePnt);
0026   else
0027     svtx.Append(thePnt);
0028 }
0029 
0030 inline void IntPatch_WLine::Replace(const Standard_Integer Index, const IntPatch_Point& Pnt)
0031 {
0032   svtx(Index) = Pnt;
0033 }
0034 
0035 inline void IntPatch_WLine::SetFirstPoint(const Standard_Integer IndFirst)
0036 {
0037   fipt = Standard_True;
0038   indf = IndFirst;
0039 }
0040 
0041 inline void IntPatch_WLine::SetLastPoint(const Standard_Integer IndLast)
0042 {
0043   lapt = Standard_True;
0044   indl = IndLast;
0045 }
0046 
0047 inline Standard_Integer IntPatch_WLine::NbPnts() const
0048 {
0049   return curv->NbPoints();
0050 }
0051 
0052 inline const IntSurf_PntOn2S& IntPatch_WLine::Point(const Standard_Integer Index) const
0053 {
0054   return curv->Value(Index);
0055 }
0056 
0057 inline Standard_Boolean IntPatch_WLine::HasFirstPoint() const
0058 {
0059   return fipt;
0060 }
0061 
0062 inline Standard_Boolean IntPatch_WLine::HasLastPoint() const
0063 {
0064   return lapt;
0065 }
0066 
0067 inline const IntPatch_Point& IntPatch_WLine::FirstPoint() const
0068 {
0069   if (!fipt)
0070   {
0071     throw Standard_DomainError();
0072   }
0073   return svtx(indf);
0074 }
0075 
0076 inline const IntPatch_Point& IntPatch_WLine::LastPoint() const
0077 {
0078   if (!lapt)
0079   {
0080     throw Standard_DomainError();
0081   }
0082   return svtx(indl);
0083 }
0084 
0085 inline const IntPatch_Point& IntPatch_WLine::FirstPoint(Standard_Integer& Indfirst) const
0086 {
0087   if (!fipt)
0088   {
0089     throw Standard_DomainError();
0090   }
0091   Indfirst = indf;
0092   return svtx(indf);
0093 }
0094 
0095 inline const IntPatch_Point& IntPatch_WLine::LastPoint(Standard_Integer& Indlast) const
0096 {
0097   if (!lapt)
0098   {
0099     throw Standard_DomainError();
0100   }
0101   Indlast = indl;
0102   return svtx(indl);
0103 }
0104 
0105 inline Standard_Integer IntPatch_WLine::NbVertex() const
0106 {
0107   return svtx.Length();
0108 }
0109 
0110 inline const IntPatch_Point& IntPatch_WLine::Vertex(const Standard_Integer Index) const
0111 {
0112   return svtx(Index);
0113 }
0114 
0115 inline IntPatch_Point& IntPatch_WLine::ChangeVertex(const Standard_Integer Index)
0116 {
0117   return svtx(Index);
0118 }
0119 
0120 inline void IntPatch_WLine::ClearVertexes()
0121 {
0122   svtx.Clear();
0123 }
0124 
0125 inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex)
0126 {
0127   if ((theIndex < 1) || (theIndex > NbVertex()))
0128     throw Standard_OutOfRange("Cannot delete not existing vertex");
0129   svtx.Remove(theIndex);
0130 }
0131 
0132 inline void IntPatch_WLine::InsertVertexBefore(const Standard_Integer theIndex,
0133                                                const IntPatch_Point&  thePnt)
0134 {
0135   const Standard_Integer aNbVertexes = NbVertex();
0136   Standard_Integer       anIndex     = Max(theIndex, 1);
0137 
0138   if (anIndex > aNbVertexes)
0139     svtx.Append(thePnt);
0140   else
0141     svtx.InsertBefore(theIndex, thePnt);
0142 }