Ignore:
Timestamp:
Apr 27, 2012, 12:26:07 AM (13 years ago)
Author:
ansari
Message:

Petites ameliorations classes Units et PhysQty, documentation doxygen, ajout fichiers pqnumber.h et sunitpcst.h ds basetools.h, passage numero de version a 2.30, Reza 27/04/2012

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/sunitpcst.h

    r4056 r4062  
    3232
    3333public:
     34  //! Default constructor - creates a dimensionless object = 1
    3435  Units();
     36  //! Copy constructor
    3537  Units(Units const& un);
     38  //! Base constructor 
    3639  Units(const char* nom, const char* snom, int m, int kg, int s, r_8 val=1., int A=0, int K=0, int mol=0, int cd=0);
     40  //! Constructor from an existing unit, but with a scaling factor and new name   
     41  Units(Units const& un, r_8 scale, const char* nom, const char* snom);
     42
    3743  virtual ~Units();
    3844
     
    8894
    8995  // Les unites usuelles - Voir definition et convention sur
     96  //  http://www.bipm.org/fr/si/   et  http://physics.nist.gov/cuu/Units/
    9097  inline static Units meter()
    9198  { return Units("meter","m",1,0,0); }
     
    153160  inline static Units radian()
    154161  { return Units("radian","rad",0,0,0,1);  }
     162  inline static Units degree()
     163  { return Units("degree","deg",0,0,0,M_PI/180.);  }
    155164  inline static Units steradian()
    156165  { return Units("steradian","sr",0,0,0,1);  }
     
    219228  //! Return the physical quantity value in SI units
    220229  inline r_8 SIValue()  const { return val_*unit_.SIValue(); }
     230  //! Return the associated unit
    221231  inline Units getUnit()  {return unit_; }
     232  //! Return the associated value
    222233  inline r_8 Value()  const { return val_; }
     234  //! Change the value of the physical quantity
    223235  inline void setValue(r_8 val)  { val_=val; }
     236  //! Return the relative precision
    224237  inline r_8 RelativePrecision()  const { return prec_; }
     238  //! Change the relative precision
    225239  inline void setRelativePrecision(r_8 prec) { prec_=prec; }
     240  //! Return the absolute precision
    226241  inline r_8 AbsolutePrecision() const { return prec_*val_; }
    227   //! return the unit name
     242  //! Return the associoated name
    228243  inline string const& Name() const { return name_; }
    229244
Note: See TracChangeset for help on using the changeset viewer.