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