Warning, /include/opencascade/IntPatch_GLine.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
0019 #include <gp_Lin.hxx>
0020 #include <gp_Circ.hxx>
0021 #include <gp_Elips.hxx>
0022 #include <gp_Parab.hxx>
0023 #include <gp_Hypr.hxx>
0024
0025 #include <Precision.hxx>
0026
0027 inline void IntPatch_GLine::SetFirstPoint(const int IndFirst)
0028 {
0029 fipt = true;
0030 indf = IndFirst;
0031 }
0032
0033 inline void IntPatch_GLine::SetLastPoint(const int IndLast)
0034 {
0035 lapt = true;
0036 indl = IndLast;
0037 }
0038
0039 inline gp_Lin IntPatch_GLine::Line() const
0040 {
0041 if (typ != IntPatch_Lin)
0042 {
0043 throw Standard_DomainError();
0044 }
0045 return gp_Lin(pos.Axis());
0046 }
0047
0048 inline gp_Circ IntPatch_GLine::Circle() const
0049 {
0050 if (typ != IntPatch_Circle)
0051 {
0052 throw Standard_DomainError();
0053 }
0054 return gp_Circ(pos, par1);
0055 }
0056
0057 inline gp_Elips IntPatch_GLine::Ellipse() const
0058 {
0059 if (typ != IntPatch_Ellipse)
0060 {
0061 throw Standard_DomainError();
0062 }
0063 return gp_Elips(pos, par1, par2);
0064 }
0065
0066 inline gp_Parab IntPatch_GLine::Parabola() const
0067 {
0068 if (typ != IntPatch_Parabola)
0069 {
0070 throw Standard_DomainError();
0071 }
0072 return gp_Parab(pos, par1);
0073 }
0074
0075 inline gp_Hypr IntPatch_GLine::Hyperbola() const
0076 {
0077 if (typ != IntPatch_Hyperbola)
0078 {
0079 throw Standard_DomainError();
0080 }
0081 return gp_Hypr(pos, par1, par2);
0082 }
0083
0084 inline bool IntPatch_GLine::HasFirstPoint() const
0085 {
0086 return fipt;
0087 }
0088
0089 inline bool IntPatch_GLine::HasLastPoint() const
0090 {
0091 return lapt;
0092 }
0093
0094 inline const IntPatch_Point& IntPatch_GLine::FirstPoint() const
0095 {
0096 if (!fipt)
0097 {
0098 throw Standard_DomainError();
0099 }
0100 return svtx(indf);
0101 }
0102
0103 inline const IntPatch_Point& IntPatch_GLine::LastPoint() const
0104 {
0105 if (!lapt)
0106 {
0107 throw Standard_DomainError();
0108 }
0109 return svtx(indl);
0110 }
0111
0112 inline int IntPatch_GLine::NbVertex() const
0113 {
0114 return svtx.Length();
0115 }
0116
0117 inline const IntPatch_Point& IntPatch_GLine::Vertex(const int Index) const
0118 {
0119 return svtx(Index);
0120 }