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 private:
61  class CBitmapConstraints: virtual public iprm::IOptionsList
62  {
63  friend class CMultiBitmapCacheComp;
64 
65  public:
66  CBitmapConstraints()
67  {
68  Reset();
69  }
70 
71  void Reset()
72  {
73  m_flags = 0;
74  m_count = -1;
75  m_names.clear();
76  m_descriptions.clear();
77  m_ids.clear();
78  m_enabled.clear();
79  }
80 
81  virtual int GetOptionsFlags() const
82  {
83  return m_flags;
84  }
85 
86  virtual int GetOptionsCount() const
87  {
88  return m_count;
89  }
90 
91  virtual QString GetOptionName(int index) const
92  {
93  return m_names.at(index);
94  }
95 
96  virtual QString GetOptionDescription(int index) const
97  {
98  return m_descriptions.at(index);
99  }
100 
101  virtual QByteArray GetOptionId(int index) const
102  {
103  return m_ids.at(index);
104  }
105 
106  virtual bool IsOptionEnabled(int index) const
107  {
108  return m_enabled.at(index);
109  }
110 
111  private:
112  int m_flags;
113  int m_count;
114  QStringList m_names;
115  QStringList m_descriptions;
116  QList<QByteArray> m_ids;
117  QList<bool> m_enabled;
118  };
119 
120  CBitmapConstraints m_bitmapConstraints;
121  bool m_copyConstraints;
122 
125 
126  I_ATTR(bool, m_copyConstraintsAttrPtr);
127 };
128 
129 
130 } // namespace iipr
131 
132 
133 #endif // !iipr_CMultiBitmapCacheComp_included
134 
135 
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

© 2007-2011 Witold Gantzke and Kirill Lepskiy