|
||||
File indexing completed on 2025-01-18 10:05:30
0001 // Created on: 1992-11-05 0002 // Created by: Gilles DEBARBOUILLE 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 #ifndef _Units_ShiftedToken_HeaderFile 0018 #define _Units_ShiftedToken_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_Type.hxx> 0022 0023 #include <Units_Token.hxx> 0024 #include <Standard_Integer.hxx> 0025 class Units_Dimensions; 0026 0027 0028 class Units_ShiftedToken; 0029 DEFINE_STANDARD_HANDLE(Units_ShiftedToken, Units_Token) 0030 0031 //! The ShiftedToken class inherits from Token and 0032 //! describes tokens which have a gap in addition of 0033 //! the multiplicative factor. This kind of token 0034 //! allows the description of linear functions which 0035 //! do not pass through the origin, of the form : 0036 //! 0037 //! y = ax +b 0038 //! 0039 //! where <x> and <y> are the unknown variables, <a> 0040 //! the mutiplicative factor, and <b> the gap relative 0041 //! to the ordinate axis. 0042 //! 0043 //! An example is the translation between the Celsius 0044 //! and Fahrenheit degree of temperature. 0045 class Units_ShiftedToken : public Units_Token 0046 { 0047 0048 public: 0049 0050 0051 //! Creates and returns a shifted token. <aword> is a 0052 //! string containing the available word, <amean> gives 0053 //! the signification of the token, <avalue> is the 0054 //! numeric value of the dimension, <amove> is the gap, 0055 //! and <adimensions> is the dimension of the given word 0056 //! <aword>. 0057 Standard_EXPORT Units_ShiftedToken(const Standard_CString aword, const Standard_CString amean, const Standard_Real avalue, const Standard_Real amove, const Handle(Units_Dimensions)& adimensions); 0058 0059 //! Creates and returns a token, which is a ShiftedToken. 0060 Standard_EXPORT virtual Handle(Units_Token) Creates() const Standard_OVERRIDE; 0061 0062 //! Returns the gap <themove> 0063 Standard_EXPORT Standard_Real Move() const; 0064 0065 //! This virtual method is called by the Measurement 0066 //! methods, to compute the measurement during a 0067 //! conversion. 0068 Standard_EXPORT virtual Standard_Real Multiplied (const Standard_Real avalue) const Standard_OVERRIDE; 0069 0070 //! This virtual method is called by the Measurement 0071 //! methods, to compute the measurement during a 0072 //! conversion. 0073 Standard_EXPORT virtual Standard_Real Divided (const Standard_Real avalue) const Standard_OVERRIDE; 0074 0075 Standard_EXPORT virtual void Dump (const Standard_Integer ashift, const Standard_Integer alevel) const Standard_OVERRIDE; 0076 0077 0078 0079 DEFINE_STANDARD_RTTIEXT(Units_ShiftedToken,Units_Token) 0080 0081 protected: 0082 0083 0084 0085 0086 private: 0087 0088 0089 Standard_Real themove; 0090 0091 0092 }; 0093 0094 0095 0096 0097 0098 0099 0100 #endif // _Units_ShiftedToken_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |