]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Unit.hxx
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / MEDMEM / MEDMEM_Unit.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 /*
23  File Unit.hxx
24  $Header$
25 */
26
27 #ifndef UNIT_HXX
28 #define UNIT_HXX
29
30 #include <MEDMEM.hxx>
31
32 #include <string>
33
34 #include "MEDMEM_Utilities.hxx"
35 #include "MEDMEM_Exception.hxx"
36 #include "MEDMEM_define.hxx"
37
38 namespace MEDMEM {
39 class MEDMEM_EXPORT UNIT { 
40 protected:
41   string _name ;
42   string _description ;
43
44   int    _masse ; // kilogram (kg)
45   int    _length ; // meter (m)
46   int    _time ; // second (s)
47   int    _temperature ; // Kelvin (K)
48   int    _matterQuantity ; // mole (mol)
49   int    _currentStrength ; // ampere (A)
50   int    _lightIntensity ; // candela (cd)
51
52   // Unit in IS !
53   // Example : 
54   //   J = kg.m^2.s^(-2) 
55   //   so : Name="Joule",Masse=1,Length=2 and Time=-2, other are null 
56
57 public:
58   UNIT();
59   UNIT(string Name, string Description);
60   ~UNIT();
61   UNIT & operator=(const UNIT &unit);
62
63   inline void setName(string Name) ;
64   inline void setDescription(string Description) ;
65   inline void setMasse(int Masse) ;
66   inline void setLength(int Length) ;
67   inline void setTime(int Time) ;
68   inline void setTemperature(int Temperature) ;
69   inline void setMatterQuantity(int MatterQuantity) ;
70   inline void setCurrentStrength(int CurrentStrength) ;
71   inline void setLightIntensity(int LightIntensity) ;
72
73   inline string getName() const ;
74   inline string getDescription() const ;
75   inline int    getMasse() const ;
76   inline int    getLength() const ;
77   inline int    getTime() const ;
78   inline int    getTemperature() const ;
79   inline int    getMatterQuantity() const ;
80   inline int    getCurrentStrength() const ;
81   inline int    getLightIntensity() const ;
82
83 } ;
84
85 // inline method :
86
87 inline void UNIT::setName(string Name) {
88   _name = Name ;
89 }
90 inline void UNIT::setDescription(string Description) {
91   _description = Description ;
92 }
93 inline void UNIT::setMasse(int Masse) {
94   _masse=Masse ;
95 }
96 inline void UNIT::setLength(int Length) {
97   _length=Length ;
98 }
99 inline void UNIT::setTime(int Time) {
100   _time=Time ;
101 }
102 inline void UNIT::setTemperature(int Temperature) {
103   _temperature=Temperature ;
104 }
105 inline void UNIT::setMatterQuantity(int MatterQuantity) {
106   _matterQuantity=MatterQuantity ;
107 }
108 inline void UNIT::setCurrentStrength(int CurrentStrength) {
109   _currentStrength=CurrentStrength ;
110 }
111 inline void UNIT::setLightIntensity(int LightIntensity) {
112   _lightIntensity=LightIntensity ;
113 }
114
115 inline string UNIT::getName() const            { return _name ; }
116 inline string UNIT::getDescription() const     { return _description ; }
117 inline int    UNIT::getMasse() const           { return _masse ; }
118 inline int    UNIT::getLength() const          { return _length ; }
119 inline int    UNIT::getTime() const            { return _time ; }
120 inline int    UNIT::getTemperature() const     { return _temperature ; }
121 inline int    UNIT::getMatterQuantity() const  { return _matterQuantity ; }
122 inline int    UNIT::getCurrentStrength() const { return _currentStrength ; }
123 inline int    UNIT::getLightIntensity() const  { return _lightIntensity ; }
124 }//End namespace MEDMEM
125
126 #endif /* UNIT_HXX */