Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:49:21

0001 // Created on: 1992-11-04
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_ShiftedUnit_HeaderFile
0018 #define _Units_ShiftedUnit_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Units_Unit.hxx>
0024 #include <Standard_Integer.hxx>
0025 class Units_Quantity;
0026 class Units_Token;
0027 
0028 
0029 class Units_ShiftedUnit;
0030 DEFINE_STANDARD_HANDLE(Units_ShiftedUnit, Units_Unit)
0031 
0032 //! This class is useful   to describe  units  with  a
0033 //! shifted origin in relation to another unit. A well
0034 //! known example  is the  Celsius degrees in relation
0035 //! to Kelvin degrees. The shift of the Celsius origin
0036 //! is 273.15 Kelvin degrees.
0037 class Units_ShiftedUnit : public Units_Unit
0038 {
0039 
0040 public:
0041 
0042   
0043   //! Creates  and  returns a  shifted unit.   <aname> is the
0044   //! name of the unit,  <asymbol> is the usual abbreviation
0045   //! of the unit, <avalue> is the  value in relation to the
0046   //! International System of Units, and <amove>  is the gap
0047   //! in relation to another unit.
0048   //!
0049   //! For  example Celsius   degree   of temperature  is  an
0050   //! instance of ShiftedUnit  with <avalue> equal to 1. and
0051   //! <amove> equal to 273.15.
0052   Standard_EXPORT Units_ShiftedUnit(const Standard_CString aname, const Standard_CString asymbol, const Standard_Real avalue, const Standard_Real amove, const Handle(Units_Quantity)& aquantity);
0053   
0054   //! Creates  and returns a  unit.  <aname> is  the name of
0055   //! the  unit, <asymbol> is the  usual abbreviation of the
0056   //! unit.
0057   Standard_EXPORT Units_ShiftedUnit(const Standard_CString aname, const Standard_CString asymbol);
0058   
0059   //! Creates  and returns a  unit.  <aname> is  the name of
0060   //! the  unit.
0061   Standard_EXPORT Units_ShiftedUnit(const Standard_CString aname);
0062   
0063   //! Sets the field <themove> to <amove>
0064   Standard_EXPORT void Move (const Standard_Real amove);
0065   
0066   //! Returns the shifted value <themove>.
0067   Standard_EXPORT Standard_Real Move() const;
0068   
0069   //! This redefined method returns a ShiftedToken object.
0070   Standard_EXPORT virtual Handle(Units_Token) Token() const Standard_OVERRIDE;
0071   
0072   Standard_EXPORT virtual void Dump (const Standard_Integer ashift, const Standard_Integer alevel) const Standard_OVERRIDE;
0073 
0074 
0075 
0076 
0077   DEFINE_STANDARD_RTTIEXT(Units_ShiftedUnit,Units_Unit)
0078 
0079 protected:
0080 
0081 
0082 
0083 
0084 private:
0085 
0086 
0087   Standard_Real themove;
0088 
0089 
0090 };
0091 
0092 
0093 
0094 
0095 
0096 
0097 
0098 #endif // _Units_ShiftedUnit_HeaderFile