CLinearAdjustParamsComp.h
Go to the documentation of this file.
1 #ifndef imeas_CLinearAdjustParamsComp_included
2 #define imeas_CLinearAdjustParamsComp_included
3 
4 
5 // ACF includes
7 #include "iser/ISerializable.h"
8 #include "icomp/CComponentBase.h"
9 
10 // ACF-Solutions includes
13 #include "imeas/INumericValue.h"
15 
16 
17 namespace imeas
18 {
19 
20 
25  public icomp::CComponentBase,
26  virtual public ILinearAdjustParams,
27  virtual public INumericValue,
28  virtual protected INumericConstraints
29 {
30 public:
32 
33  I_BEGIN_COMPONENT(CLinearAdjustParamsComp);
34  I_REGISTER_INTERFACE(ILinearAdjustParams);
35  I_REGISTER_INTERFACE(INumericValue);
36  I_REGISTER_INTERFACE(iser::ISerializable);
37  I_ASSIGN(m_constraintsCompPtr, "Constraints", "Constraints describing allowed value ranges", false, "Constraints");
38  I_ASSIGN(m_defaultScaleAttrPtr, "DefaultScale", "Default value of scale factor", true, 1);
39  I_ASSIGN(m_defaultOffsetAttrPtr, "DefaultOffset", "Default value of offset factor", true, 0);
40  I_END_COMPONENT;
41 
43 
44  // reimplemented (imeas::ILinearAdjustParams)
45  virtual const ILinearAdjustConstraints* GetAdjustConstraints() const;
46  virtual double GetScaleFactor() const;
47  virtual void SetScaleFactor(double scale);
48  virtual double GetOffsetFactor() const;
49  virtual void SetOffsetFactor(double offset);
50 
51  // reimplemented (imeas::INumericValue)
52  virtual bool IsValueTypeSupported(ValueTypeId valueTypeId) const;
53  virtual const INumericConstraints* GetNumericConstraints() const;
54  virtual imath::CVarVector GetComponentValue(ValueTypeId valueTypeId) const;
55  virtual imath::CVarVector GetValues() const;
56  virtual bool SetValues(const imath::CVarVector& values);
57 
58  // reimplemented (iser::ISerializable)
59  virtual bool Serialize(iser::IArchive& archive);
60 
61 protected:
62  // reimplemented (imeas::INumericConstraints)
63  virtual int GetNumericValuesCount() const;
64  virtual QString GetNumericValueName(int index) const;
65  virtual QString GetNumericValueDescription(int index) const;
66  virtual const imath::IUnitInfo& GetNumericValueUnitInfo(int index) const;
67 
68  // reimplemented (icomp::CComponentBase)
69  virtual void OnComponentCreated();
70 
71 private:
72  I_REF(ILinearAdjustConstraints, m_constraintsCompPtr);
73  I_ATTR(double, m_defaultScaleAttrPtr);
74  I_ATTR(double, m_defaultOffsetAttrPtr);
75 
76  double m_scale;
77  double m_offset;
78 
79  imath::CGeneralUnitInfo m_offsetUnitInfo;
80  imath::CGeneralUnitInfo m_scaleUnitInfo;
81 };
82 
83 
84 } // namespace imeas
85 
86 
87 #endif // !imeas_CLinearAdjustParamsComp_included
88 
89 
Get parameter of linear adjust.
virtual int GetNumericValuesCount() const
Get number of expected numeric values.
virtual QString GetNumericValueName(int index) const
Get human readable name of numeric value for specified list index.
virtual QString GetNumericValueDescription(int index) const
Get human readable description of numeric value for specified list index.
virtual imath::CVarVector GetComponentValue(ValueTypeId valueTypeId) const
Get access to component value of the given type.
virtual bool IsValueTypeSupported(ValueTypeId valueTypeId) const
Check if the given value type (or value component) is supported.
virtual imath::CVarVector GetValues() const
Get list of numeric values.
virtual double GetScaleFactor() const
Get value of scale factor.
virtual const imath::IUnitInfo & GetNumericValueUnitInfo(int index) const
Get range of possible numeric values for specified list index.
Describe additional meta information for set of numeric values.
virtual void SetScaleFactor(double scale)
Set value of scale factor.
virtual bool Serialize(iser::IArchive &archive)
General parameter set containing list of numeric values.
Definition: INumericValue.h:19
Basic implementation of component of linear adjust parameters.
virtual const ILinearAdjustConstraints * GetAdjustConstraints() const
Get access to constraints object.
virtual const INumericConstraints * GetNumericConstraints() const
Get parameter constraints describing possible parameter values.
virtual bool SetValues(const imath::CVarVector &values)
Set list of numeric values.
virtual double GetOffsetFactor() const
Get value of offset factor.
virtual void SetOffsetFactor(double offset)
Set value of offset factor.
ValueTypeId
Define standard numeric value types.
Definition: INumericValue.h:25
Describes constraints of possible values of imeas::ILinearAdjust.

© 2007-2011 Witold Gantzke and Kirill Lepskiy