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