Warning, /include/opencascade/IntPatch_ALine.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 <Precision.hxx>
0019 #include <IntPatch_Point.hxx>
0020
0021 inline void IntPatch_ALine::Replace(const int Index, const IntPatch_Point& Pnt)
0022 {
0023 svtx(Index) = Pnt;
0024 }
0025
0026 inline void IntPatch_ALine::SetFirstPoint(const int IndFirst)
0027 {
0028 fipt = true;
0029 indf = IndFirst;
0030 }
0031
0032 inline void IntPatch_ALine::SetLastPoint(const int IndLast)
0033 {
0034 lapt = true;
0035 indl = IndLast;
0036 }
0037
0038 inline double IntPatch_ALine::FirstParameter(bool& IsIncluded) const
0039 {
0040 double bid, first;
0041 curv.Domain(first, bid);
0042 IsIncluded = !curv.IsFirstOpen();
0043 return first;
0044 }
0045
0046 inline double IntPatch_ALine::LastParameter(bool& IsIncluded) const
0047 {
0048 double bid, last;
0049 curv.Domain(bid, last);
0050 IsIncluded = !curv.IsLastOpen();
0051 return last;
0052 }
0053
0054 inline gp_Pnt IntPatch_ALine::Value(const double U)
0055 {
0056 return curv.Value(U); // Value leve l exception DomainError
0057 }
0058
0059 inline bool IntPatch_ALine::D1(const double U, gp_Pnt& P, gp_Vec& Du)
0060 {
0061 return curv.D1u(U, P, Du); // D1u leve l exception DomainError
0062 }
0063
0064 inline void IntPatch_ALine::FindParameter(const gp_Pnt& theP,
0065 NCollection_List<double>& theParams) const
0066 {
0067 curv.FindParameter(theP, theParams);
0068 }
0069
0070 inline bool IntPatch_ALine::HasFirstPoint() const
0071 {
0072 return fipt;
0073 }
0074
0075 inline bool IntPatch_ALine::HasLastPoint() const
0076 {
0077 return lapt;
0078 }
0079
0080 inline const IntPatch_Point& IntPatch_ALine::FirstPoint() const
0081 {
0082 if (!fipt)
0083 {
0084 throw Standard_DomainError();
0085 }
0086 return svtx(indf);
0087 }
0088
0089 inline const IntPatch_Point& IntPatch_ALine::LastPoint() const
0090 {
0091 if (!lapt)
0092 {
0093 throw Standard_DomainError();
0094 }
0095 return svtx(indl);
0096 }
0097
0098 inline int IntPatch_ALine::NbVertex() const
0099 {
0100 return svtx.Length();
0101 }
0102
0103 inline const IntPatch_Point& IntPatch_ALine::Vertex(const int Index) const
0104 {
0105 return svtx(Index);
0106 }