Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-04-06
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1992-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 
0022 inline const Handle(Adaptor2d_Curve2d)& IntPatch_RLine::ArcOnS1() const
0023 {
0024   return theArcOnS1;
0025 }
0026 
0027 inline const Handle(Adaptor2d_Curve2d)& IntPatch_RLine::ArcOnS2() const
0028 {
0029   return theArcOnS2;
0030 }
0031 
0032 //-- Il faut mettre cet include ici , car l include fait un define Handle(Adaptor2d_Curve2d) ...
0033 //-- et en fin de fichier un undef Handle(Adaptor2d_Curve2d) ... 
0034 
0035 inline void IntPatch_RLine::AddVertex (const IntPatch_Point& thePnt,
0036                                        const Standard_Boolean theIsPrepend)
0037 {
0038   if(theIsPrepend)
0039     svtx.Prepend(thePnt);
0040   else
0041     svtx.Append(thePnt);
0042 }
0043 
0044 inline void IntPatch_RLine::Replace (const Standard_Integer Index,
0045                                      const IntPatch_Point& Pnt)
0046 {
0047   svtx(Index) = Pnt;
0048 }
0049 
0050 inline void IntPatch_RLine::SetFirstPoint (const Standard_Integer IndFirst)
0051 {
0052   fipt = Standard_True;
0053   indf = IndFirst;
0054 }
0055 
0056 inline void IntPatch_RLine::SetLastPoint (const Standard_Integer IndLast)
0057 {
0058   lapt = Standard_True;
0059   indl = IndLast;
0060 }
0061 
0062 inline void IntPatch_RLine::Add(const Handle(IntSurf_LineOn2S)& L)
0063 {
0064   curv = L;
0065 }
0066 
0067 inline Standard_Boolean IntPatch_RLine::IsArcOnS1() const
0068 {
0069   return onS1;
0070 }
0071 
0072 inline Standard_Boolean IntPatch_RLine::IsArcOnS2() const
0073 {
0074   return onS2;
0075 }
0076 
0077 inline Standard_Boolean IntPatch_RLine::HasFirstPoint () const
0078 {
0079   return fipt;
0080 }
0081 
0082 inline Standard_Boolean IntPatch_RLine::HasLastPoint () const
0083 {
0084   return lapt;
0085 }
0086 
0087 inline const IntPatch_Point& IntPatch_RLine::FirstPoint () const
0088 {
0089   if (!fipt) {throw Standard_DomainError();}
0090   return svtx(indf);
0091 }
0092 
0093 inline const IntPatch_Point& IntPatch_RLine::LastPoint () const
0094 {
0095   if (!lapt) {throw Standard_DomainError();}
0096   return svtx(indl);
0097 }
0098 
0099 inline Standard_Integer IntPatch_RLine::NbVertex () const
0100 {
0101   return svtx.Length();
0102 }
0103 
0104 inline const IntPatch_Point& IntPatch_RLine::Vertex (const Standard_Integer Index) const
0105 {
0106   return svtx(Index);
0107 }
0108 
0109 inline IntPatch_Point& IntPatch_RLine::ChangeVertex (const Standard_Integer Index)
0110 {
0111   return svtx(Index);
0112 }
0113 
0114 inline void IntPatch_RLine::RemoveVertex(const Standard_Integer theIndex)
0115 {
0116   if((theIndex < 1) || (theIndex > NbVertex()))
0117     throw Standard_OutOfRange("Cannot delete not existing vertex");
0118   svtx.Remove(theIndex);
0119 }
0120 
0121 inline Standard_Boolean IntPatch_RLine::HasPolygon () const
0122 {
0123   return (!curv.IsNull());
0124 }
0125 
0126 inline Standard_Integer IntPatch_RLine::NbPnts () const
0127 {
0128   if (curv.IsNull()) {throw Standard_DomainError();}
0129   return curv->NbPoints();
0130 }
0131 
0132 inline const IntSurf_PntOn2S& IntPatch_RLine::Point (const Standard_Integer Index) const
0133 {
0134   if (curv.IsNull()) {throw Standard_DomainError();}
0135   return curv->Value(Index);
0136 }
0137 
0138 inline Handle(IntSurf_LineOn2S) IntPatch_RLine::Curve() const
0139 { 
0140   return(curv);
0141 }