00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 /* 00024 File Unit.hxx 00025 $Header: /home/server/cvs/MED/MED_SRC/src/MEDMEM/MEDMEM_Unit.hxx,v 1.11.20.1.16.1 2011-06-01 16:52:56 vsr Exp $ 00026 */ 00027 00028 #ifndef UNIT_HXX 00029 #define UNIT_HXX 00030 00031 #include <MEDMEM.hxx> 00032 00033 #include <string> 00034 00035 #include "MEDMEM_Utilities.hxx" 00036 #include "MEDMEM_Exception.hxx" 00037 #include "MEDMEM_define.hxx" 00038 00039 namespace MEDMEM { 00040 class MEDMEM_EXPORT UNIT { 00041 protected: 00042 string _name ; 00043 string _description ; 00044 00045 int _masse ; // kilogram (kg) 00046 int _length ; // meter (m) 00047 int _time ; // second (s) 00048 int _temperature ; // Kelvin (K) 00049 int _matterQuantity ; // mole (mol) 00050 int _currentStrength ; // ampere (A) 00051 int _lightIntensity ; // candela (cd) 00052 00053 // Unit in IS ! 00054 // Example : 00055 // J = kg.m^2.s^(-2) 00056 // so : Name="Joule",Masse=1,Length=2 and Time=-2, other are null 00057 00058 public: 00059 UNIT(); 00060 UNIT(string Name, string Description); 00061 ~UNIT(); 00062 UNIT & operator=(const UNIT &unit); 00063 00064 inline void setName(string Name) ; 00065 inline void setDescription(string Description) ; 00066 inline void setMasse(int Masse) ; 00067 inline void setLength(int Length) ; 00068 inline void setTime(int Time) ; 00069 inline void setTemperature(int Temperature) ; 00070 inline void setMatterQuantity(int MatterQuantity) ; 00071 inline void setCurrentStrength(int CurrentStrength) ; 00072 inline void setLightIntensity(int LightIntensity) ; 00073 00074 inline string getName() const ; 00075 inline string getDescription() const ; 00076 inline int getMasse() const ; 00077 inline int getLength() const ; 00078 inline int getTime() const ; 00079 inline int getTemperature() const ; 00080 inline int getMatterQuantity() const ; 00081 inline int getCurrentStrength() const ; 00082 inline int getLightIntensity() const ; 00083 00084 } ; 00085 00086 // inline method : 00087 00088 inline void UNIT::setName(string Name) { 00089 _name = Name ; 00090 } 00091 inline void UNIT::setDescription(string Description) { 00092 _description = Description ; 00093 } 00094 inline void UNIT::setMasse(int Masse) { 00095 _masse=Masse ; 00096 } 00097 inline void UNIT::setLength(int Length) { 00098 _length=Length ; 00099 } 00100 inline void UNIT::setTime(int Time) { 00101 _time=Time ; 00102 } 00103 inline void UNIT::setTemperature(int Temperature) { 00104 _temperature=Temperature ; 00105 } 00106 inline void UNIT::setMatterQuantity(int MatterQuantity) { 00107 _matterQuantity=MatterQuantity ; 00108 } 00109 inline void UNIT::setCurrentStrength(int CurrentStrength) { 00110 _currentStrength=CurrentStrength ; 00111 } 00112 inline void UNIT::setLightIntensity(int LightIntensity) { 00113 _lightIntensity=LightIntensity ; 00114 } 00115 00116 inline string UNIT::getName() const { return _name ; } 00117 inline string UNIT::getDescription() const { return _description ; } 00118 inline int UNIT::getMasse() const { return _masse ; } 00119 inline int UNIT::getLength() const { return _length ; } 00120 inline int UNIT::getTime() const { return _time ; } 00121 inline int UNIT::getTemperature() const { return _temperature ; } 00122 inline int UNIT::getMatterQuantity() const { return _matterQuantity ; } 00123 inline int UNIT::getCurrentStrength() const { return _currentStrength ; } 00124 inline int UNIT::getLightIntensity() const { return _lightIntensity ; } 00125 }//End namespace MEDMEM 00126 00127 #endif /* UNIT_HXX */