CBitmapSupplierMultiplexerComp.h
Go to the documentation of this file.
1 #ifndef icam_CBitmapSupplierMultiplexerComp_included
2 #define icam_CBitmapSupplierMultiplexerComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QPair>
7 
8 // ACF includes
9 #include <istd/TDelPtr.h>
10 #include <i2d/ICalibration2d.h>
12 #include <iimg/IBitmap.h>
13 #include <iprm/ISelectionParam.h>
14 
15 // ACF-Solutions includes
16 #include <iinsp/ISupplier.h>
18 #include <iimg/IBitmapProvider.h>
19 
20 
21 namespace icam
22 {
23 
24 
29  public iinsp::TSupplierCompWrap< QPair<istd::TDelPtr<const i2d::ICalibration2d>, istd::TDelPtr<iimg::IBitmap> > >,
30  virtual public iimg::IBitmapProvider,
31  virtual public i2d::ICalibrationProvider
32 {
33 public:
35 
36  I_BEGIN_COMPONENT(CBitmapSupplierMultiplexerComp);
37  I_REGISTER_INTERFACE(iimg::IBitmapProvider);
38  I_REGISTER_INTERFACE(i2d::ICalibrationProvider);
39  I_ASSIGN(m_bitmapCompFact, "BitmapFactory", "Use to create bitmap object", true, "BitmapFactory");
40  I_ASSIGN_MULTI_0(m_bitmapProvidersCompPtr, "BitmapProviders", "List of bitmap providers", true);
41  I_ASSIGN_TO(m_calibProvidersCompPtr, m_bitmapProvidersCompPtr, false);
42  I_ASSIGN_TO(m_bitmapSuppliersCompPtr, m_bitmapProvidersCompPtr, false);
43  I_ASSIGN_TO(m_bitmapProviderModelsCompPtr, m_bitmapProvidersCompPtr, false);
44  I_ASSIGN(m_bitmapSelectionCompPtr, "BitmapSelection", "Index of the bitmap in the list", true, "BitmapSelection");
45  I_ASSIGN_TO(m_bitmapSelectionModelCompPtr, m_bitmapSelectionCompPtr, true);
46  I_END_COMPONENT;
47 
48  // reimplemented (iimg::IBitmapProvider)
49  virtual const iimg::IBitmap* GetBitmap() const;
50 
51  // reimplemented (i2d::ICalibrationProvider)
52  virtual const i2d::ICalibration2d* GetCalibration() const;
53 
54 protected:
55  // reimplemented (iinsp::TSupplierCompWrap)
56  virtual int ProduceObject(ProductType& result) const;
57 
58  // reimplemented (icomp::CComponentBase)
59  virtual void OnComponentCreated();
60  virtual void OnComponentDestroyed();
61 
62 private:
63  I_FACT(iimg::IBitmap, m_bitmapCompFact);
64 
65  I_MULTIREF(iimg::IBitmapProvider, m_bitmapProvidersCompPtr);
66  I_MULTIREF(i2d::ICalibrationProvider, m_calibProvidersCompPtr);
67  I_MULTIREF(iinsp::ISupplier, m_bitmapSuppliersCompPtr);
68  I_MULTIREF(imod::IModel, m_bitmapProviderModelsCompPtr);
69 
70  I_REF(iprm::ISelectionParam, m_bitmapSelectionCompPtr);
71  I_REF(imod::IModel, m_bitmapSelectionModelCompPtr);
72 };
73 
74 
75 } // namespace icam
76 
77 
78 #endif // !icam_CBitmapSupplierMultiplexerComp_included
79 
80 
Implementation of bitmap supplier based on selection of the underlayed bitmap provider.
virtual int ProduceObject(ProductType &result) const
Standard implementation of interface iinsp::ISupplier with preparation for component implementation...
iinsp::TSupplierCompWrap< QPair< istd::TDelPtr< const i2d::ICalibration2d >, istd::TDelPtr< iimg::IBitmap > > > BaseClass
virtual const iimg::IBitmap * GetBitmap() const
virtual const i2d::ICalibration2d * GetCalibration() const
Base interface for suppliers providing calculating of objects on demand ("pull data" model)...
Definition: ISupplier.h:22
QPair< istd::TDelPtr< const i2d::ICalibration2d >, istd::TDelPtr< iimg::IBitmap > > ProductType

© 2007-2017 Witold Gantzke and Kirill Lepskiy