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 <iprm/COptionsManager.h>
9 #include <icomp/CComponentBase.h>
10 
11 // ACF-Solutions includes
14 #include <imeas/INumericValue.h>
16 
17 
18 namespace imeas
19 {
20 
21 
26  public icomp::CComponentBase,
27  virtual public ILinearAdjustParams,
28  virtual public INumericValue,
29  virtual protected INumericConstraints
30 {
31 public:
33 
34  I_BEGIN_COMPONENT(CLinearAdjustParamsComp);
35  I_REGISTER_INTERFACE(ILinearAdjustParams);
36  I_REGISTER_INTERFACE(INumericValue);
37  I_REGISTER_INTERFACE(iser::ISerializable);
38  I_ASSIGN(m_constraintsCompPtr, "Constraints", "Constraints describing allowed value ranges", false, "Constraints");
39  I_ASSIGN(m_defaultScaleAttrPtr, "DefaultScale", "Default value of scale factor", true, 1);
40  I_ASSIGN(m_defaultOffsetAttrPtr, "DefaultOffset", "Default value of offset factor", true, 0);
41  I_END_COMPONENT;
42 
44 
45  // reimplemented (imeas::ILinearAdjustParams)
46  virtual const ILinearAdjustConstraints* GetAdjustConstraints() const;
47  virtual double GetScaleFactor() const;
48  virtual void SetScaleFactor(double scale);
49  virtual double GetOffsetFactor() const;
50  virtual void SetOffsetFactor(double offset);
51 
52  // reimplemented (imeas::INumericValue)
53  virtual bool IsValueTypeSupported(ValueTypeId valueTypeId) const;
54  virtual const INumericConstraints* GetNumericConstraints() const;
55  virtual imath::CVarVector GetComponentValue(ValueTypeId valueTypeId) const;
56  virtual imath::CVarVector GetValues() const;
57  virtual bool SetValues(const imath::CVarVector& values);
58 
59  // reimplemented (iser::ISerializable)
60  virtual bool Serialize(iser::IArchive& archive);
61 
62 protected:
63  // reimplemented (imeas::INumericConstraints)
64  virtual const iprm::IOptionsList& GetValueListInfo() const;
65  virtual const imath::IUnitInfo* GetNumericValueUnitInfo(int index) const;
66 
67  // reimplemented (icomp::CComponentBase)
68  virtual void OnComponentCreated();
69 
70 private:
71  I_REF(ILinearAdjustConstraints, m_constraintsCompPtr);
72  I_ATTR(double, m_defaultScaleAttrPtr);
73  I_ATTR(double, m_defaultOffsetAttrPtr);
74 
75  double m_scale;
76  double m_offset;
77 
78  imath::CGeneralUnitInfo m_offsetUnitInfo;
79  imath::CGeneralUnitInfo m_scaleUnitInfo;
80 
81  iprm::COptionsManager m_valuesInfo;
82 };
83 
84 
85 } // namespace imeas
86 
87 
88 #endif // !imeas_CLinearAdjustParamsComp_included
89 
90 
Get parameter of linear adjust.
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.
Describe additional meta information for set of numeric values.
virtual const imath::IUnitInfo * GetNumericValueUnitInfo(int index) const
Get range of possible numeric values for specified list index.
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:20
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 const iprm::IOptionsList & GetValueListInfo() const
Get general information about the "content" of the numeric value.
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:26
Describes constraints of possible values of imeas::ILinearAdjust.

© 2007-2017 Witold Gantzke and Kirill Lepskiy