Warning, /include/opencascade/Contap_SurfFunction.lxx is written in an unsupported language. File is not indexed.
0001 // Created on: 1993-06-03
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1993-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 <StdFail_UndefinedDerivative.hxx>
0018
0019 inline void Contap_SurfFunction::Set(const gp_Pnt& Eye)
0020 {
0021 myType = Contap_ContourPrs; // pers
0022 myEye = Eye;
0023 myAng = 0.;
0024 }
0025
0026 inline void Contap_SurfFunction::Set(const gp_Dir& Direction)
0027 {
0028 myType = Contap_ContourStd; // Contour app
0029 myDir = Direction;
0030 myAng = 0.;
0031 }
0032
0033 inline void Contap_SurfFunction::Set(const gp_Dir& Direction, const double Angle)
0034 {
0035 myType = Contap_DraftStd; // Contour vu
0036 myDir = Direction;
0037 myAng = Angle;
0038 myCosAng = std::cos(M_PI / 2. + Angle);
0039 }
0040
0041 inline void Contap_SurfFunction::Set(const gp_Pnt& Eye, const double Angle)
0042 {
0043 myType = Contap_DraftPrs; // Contour vu "conique"...
0044 myEye = Eye;
0045 myAng = Angle;
0046 myCosAng = std::cos(M_PI / 2. + Angle);
0047 }
0048
0049 inline void Contap_SurfFunction::Set(const double Tolerance)
0050 {
0051 tol = std::max(Tolerance, 1.e-12);
0052 }
0053
0054 inline const gp_Pnt& Contap_SurfFunction::Point() const
0055 {
0056 return solpt;
0057 }
0058
0059 inline double Contap_SurfFunction::Root() const
0060 {
0061 return valf;
0062 }
0063
0064 inline double Contap_SurfFunction::Tolerance() const
0065 {
0066 return tol;
0067 }
0068
0069 inline const gp_Vec& Contap_SurfFunction::Direction3d()
0070 {
0071 if (IsTangent())
0072 throw StdFail_UndefinedDerivative();
0073 return d3d;
0074 }
0075
0076 inline const gp_Dir2d& Contap_SurfFunction::Direction2d()
0077 {
0078 if (IsTangent())
0079 throw StdFail_UndefinedDerivative();
0080 return d2d;
0081 }
0082
0083 inline const occ::handle<Adaptor3d_Surface>& Contap_SurfFunction::Surface() const
0084 {
0085 return mySurf;
0086 }
0087
0088 inline const gp_Pnt& Contap_SurfFunction::Eye() const
0089 {
0090 return myEye;
0091 }
0092
0093 inline const gp_Dir& Contap_SurfFunction::Direction() const
0094 {
0095 return myDir;
0096 }
0097
0098 inline double Contap_SurfFunction::Angle() const
0099 {
0100 return myAng;
0101 }
0102
0103 inline Contap_TFunction Contap_SurfFunction::FunctionType() const
0104 {
0105 return myType;
0106 }