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,
0034 const Standard_Real Angle)
0035 {
0036 myType = Contap_DraftStd; // Contour vu
0037 myDir = Direction;
0038 myAng = Angle;
0039 myCosAng = Cos(M_PI/2.+Angle);
0040 }
0041
0042 inline void Contap_SurfFunction::Set(const gp_Pnt& Eye,
0043 const Standard_Real Angle)
0044 {
0045 myType = Contap_DraftPrs; // Contour vu "conique"...
0046 myEye = Eye;
0047 myAng = Angle;
0048 myCosAng = Cos(M_PI/2.+Angle);
0049 }
0050
0051 inline void Contap_SurfFunction::Set(const Standard_Real Tolerance)
0052 {
0053 tol = Max(Tolerance, 1.e-12);
0054 }
0055
0056 inline const gp_Pnt& Contap_SurfFunction::Point () const
0057 {
0058 return solpt;
0059 }
0060
0061 inline Standard_Real Contap_SurfFunction::Root () const
0062 {
0063 return valf;
0064 }
0065
0066 inline Standard_Real Contap_SurfFunction::Tolerance () const
0067 {
0068 return tol;
0069 }
0070
0071 inline const gp_Vec& Contap_SurfFunction::Direction3d()
0072 {
0073 if (IsTangent()) throw StdFail_UndefinedDerivative();
0074 return d3d;
0075 }
0076
0077 inline const gp_Dir2d& Contap_SurfFunction::Direction2d()
0078 {
0079 if (IsTangent()) throw StdFail_UndefinedDerivative();
0080 return d2d;
0081 }
0082
0083 inline const 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 Standard_Real Contap_SurfFunction::Angle () const
0099 {
0100 return myAng;
0101 }
0102
0103 inline Contap_TFunction Contap_SurfFunction::FunctionType () const
0104 {
0105 return myType;
0106 }