CMultiBitmapCacheComp.h
Go to the documentation of this file.
1 #ifndef iipr_CMultiBitmapCacheComp_included
2 #define iipr_CMultiBitmapCacheComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QStringList>
7 
8 // ACF includes
9 #include <istd/TPointerVector.h>
10 #include <icomp/CComponentBase.h>
11 #include <i2d/ICalibration2d.h>
13 
14 // ACF-Solutions includes
16 
17 
18 namespace iipr
19 {
20 
21 
28  public icomp::CComponentBase,
29  virtual public iimg::IMultiBitmapProvider,
30  virtual public i2d::IMultiCalibrationProvider,
31  virtual public iser::ISerializable
32 {
33 public:
35 
36  I_BEGIN_COMPONENT(CMultiBitmapCacheComp);
37  I_REGISTER_INTERFACE(iimg::IMultiBitmapProvider);
38  I_REGISTER_INTERFACE(iser::ISerializable);
39  I_ASSIGN(m_copyConstraintsAttrPtr, "CopyConstraints", "Copy bitmap constraints from provider", true, false);
40  I_END_COMPONENT;
41 
43 
44  // reimplemented (iimg::IMultiBitmapProvider)
45  virtual const iprm::IOptionsList* GetBitmapListInfo() const;
46  virtual int GetBitmapsCount() const;
47  virtual const iimg::IBitmap* GetBitmap(int bitmapIndex) const;
48 
49  // reimplemented (i2d::IMultiCalibrationProvider)
51  virtual int GetCalibrationsCount() const;
52  virtual const i2d::ICalibration2d* GetCalibration(int calibrationIndex) const;
53 
54  // reimplemented (istd::IChangeable)
55  virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
56 
57  // reimplemented (iser::ISerializable)
58  virtual bool Serialize(iser::IArchive& archive);
59 
60 protected:
61  // reimplemented (icomp::CComponentBase)
62  virtual void OnComponentCreated();
63 
64 private:
65  class CBitmapConstraints: virtual public iprm::IOptionsList
66  {
67  friend class CMultiBitmapCacheComp;
68 
69  public:
70  CBitmapConstraints()
71  {
72  Reset();
73  }
74 
75  void Reset()
76  {
77  m_flags = 0;
78  m_count = 0;
79  m_names.clear();
80  m_descriptions.clear();
81  m_ids.clear();
82  m_enabled.clear();
83  }
84 
85  virtual int GetOptionsFlags() const
86  {
87  return m_flags;
88  }
89 
90  virtual int GetOptionsCount() const
91  {
92  return m_count;
93  }
94 
95  virtual QString GetOptionName(int index) const
96  {
97  return m_names.at(index);
98  }
99 
100  virtual QString GetOptionDescription(int index) const
101  {
102  return m_descriptions.at(index);
103  }
104 
105  virtual QByteArray GetOptionId(int index) const
106  {
107  return m_ids.at(index);
108  }
109 
110  virtual bool IsOptionEnabled(int index) const
111  {
112  return m_enabled.at(index);
113  }
114 
115  private:
116  int m_flags;
117  int m_count;
118  QStringList m_names;
119  QStringList m_descriptions;
120  QList<QByteArray> m_ids;
121  QList<bool> m_enabled;
122  };
123 
124  CBitmapConstraints m_bitmapConstraints;
125  bool m_copyConstraints;
126 
129 
130  I_ATTR(bool, m_copyConstraintsAttrPtr);
131 };
132 
133 
134 } // namespace iipr
135 
136 
137 #endif // !iipr_CMultiBitmapCacheComp_included
138 
139 
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
virtual int GetBitmapsCount() const
virtual const i2d::ICalibration2d * GetCalibration(int calibrationIndex) const
icomp::CComponentBase BaseClass
virtual const iimg::IBitmap * GetBitmap(int bitmapIndex) const
Multi bitmap provider returning always stored bitmaps.
virtual const iprm::IOptionsList * GetCalibrationSelectionContraints() const
virtual bool Serialize(iser::IArchive &archive)
virtual int GetCalibrationsCount() const
virtual const iprm::IOptionsList * GetBitmapListInfo() const
virtual void OnComponentCreated()

© 2007-2017 Witold Gantzke and Kirill Lepskiy