CGeneralUnitInfo.h
Go to the documentation of this file.
1 #ifndef imath_CGeneralUnitInfo_included
2 #define imath_CGeneralUnitInfo_included
3 
4 
5 // ACF includes
6 #include <iser/IArchive.h>
7 #include <imath/IUnitInfo.h>
8 
9 
10 namespace imath
11 {
12 
13 
17 class CGeneralUnitInfo: virtual public IUnitInfo
18 {
19 public:
21  int type = UT_UNKNOWN,
22  const QString& name = "",
23  double displayMultFactor = 1.0,
24  const istd::CRange& range = istd::CRange::GetInvalid(),
25  const imath::IDoubleManip* valueManipPtr = NULL);
26 
27  void SetUnitType(int type);
28  void SetUnitName(const QString& name);
29  void SetDisplayMultiplicationFactor(double factor);
30  void SetValueRange(const istd::CRange& range);
31 
32  virtual bool Serialize(iser::IArchive& archive);
33 
34  // reimplemented (imath::IUnitInfo)
35  virtual int GetUnitType() const;
36  virtual QString GetUnitName() const;
37  virtual double GetDisplayMultiplicationFactor() const;
38  virtual istd::CRange GetValueRange() const;
39  virtual const imath::IDoubleManip& GetValueManip() const;
40 
41 private:
42  int m_type;
43  QString m_name;
44  double m_displayMultFactor;
45  istd::CRange m_range;
46  const imath::IDoubleManip* m_valueManipPtr;
47 };
48 
49 
50 } // namespace imath
51 
52 
53 #endif // !imath_CGeneralUnitInfo_included
54 
55 
static const TRange & GetInvalid()
Return invalid range.
General implementation of the IUnitInfo interface.
virtual QString GetUnitName() const
Get name of unit.
Common interface to get information about a measurement unit.
Definition: IUnitInfo.h:21
virtual double GetDisplayMultiplicationFactor() const
Get multiplication factor used to calculate user input values.
CGeneralUnitInfo(int type=UT_UNKNOWN, const QString &name="", double displayMultFactor=1.0, const istd::CRange &range=istd::CRange::GetInvalid(), const imath::IDoubleManip *valueManipPtr=NULL)
Interface for all manipulation using values represent as double.
Definition: IDoubleManip.h:20
void SetValueRange(const istd::CRange &range)
void SetUnitType(int type)
Represent input/output persistence archive.
Definition: IArchive.h:30
Unit type is unknown.
Definition: IUnitInfo.h:32
virtual bool Serialize(iser::IArchive &archive)
#define NULL
Definition: istd.h:64
void SetDisplayMultiplicationFactor(double factor)
void SetUnitName(const QString &name)
virtual istd::CRange GetValueRange() const
Get range of possible values.
virtual const imath::IDoubleManip & GetValueManip() const
Return number manipulator object for numeric value.
virtual int GetUnitType() const
Get type of unit.

© 2007-2017 Witold Gantzke and Kirill Lepskiy