CMultiSourceSnapBitmapSupplierComp.h
Go to the documentation of this file.
1 #ifndef icam_CMultiSourceSnapBitmapSupplierComp_included
2 #define icam_CMultiSourceSnapBitmapSupplierComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QPair>
7 
8 // ACF includes
9 #include <istd/TDelPtr.h>
10 #include <iimg/IBitmapProvider.h>
11 #include <iprm/IOptionsList.h>
14 
15 
16 namespace icam
17 {
18 
19 
26  public iinsp::TSupplierCompWrap< QPair<istd::TDelPtr<const i2d::ICalibration2d>, istd::TDelPtr<iimg::IBitmap> > >,
27  virtual public iimg::IBitmapProvider,
28  virtual public i2d::ICalibrationProvider
29 {
30 public:
32 
33  I_BEGIN_COMPONENT(CMultiSourceSnapBitmapSupplierComp);
34  I_REGISTER_INTERFACE(iimg::IBitmapProvider);
35  I_REGISTER_INTERFACE(i2d::ICalibrationProvider);
36  I_REGISTER_SUBELEMENT(CameraList);
37  I_REGISTER_SUBELEMENT_INTERFACE(CameraList, iprm::IOptionsList, ExtractCameraList);
38  I_REGISTER_SUBELEMENT_INTERFACE(CameraList, istd::IChangeable, ExtractCameraList);
39  I_REGISTER_SUBELEMENT_INTERFACE(CameraList, imod::IModel, ExtractCameraList);
40  I_ASSIGN(m_bitmapCompFact, "BitmapFactory", "Use to create bitmap object", true, "BitmapFactory");
41  I_ASSIGN_MULTI_0(m_cameraListCompPtr, "Cameras", "List of cameras used for snap", true);
42  I_ASSIGN_MULTI_0(m_cameraIdsAttrPtr, "CameraIds", "List of camera IDs", true);
43  I_ASSIGN_MULTI_0(m_cameraNamesAttrPtr, "CameraNames", "List of camera names", true);
44  I_ASSIGN(m_sourceSelectionParamIdAttrPtr, "CameraSelectorId", "ID of the source camera selector parameter in the supplier's parameter set", true, "CameraSelectorId");
45  I_ASSIGN(m_cameraManagerParamIdAttrPtr, "CameraManagerParamId", "ID of the camera parameter manager in the supplier's parameter set", true, "CameraManagerParamId");
46  I_END_COMPONENT;
47 
49 
50  // reimplemented (iimg::IBitmapProvider)
51  virtual const iimg::IBitmap* GetBitmap() const;
52 
53  // reimplemented (i2d::ICalibrationProvider)
54  virtual const i2d::ICalibration2d* GetCalibration() const;
55 
56 protected:
57  // reimplemented (iinsp::TSupplierCompWrap)
58  virtual bool InitializeWork();
59  virtual int ProduceObject(ProductType& result) const;
60 
61 private:
62  class CameraList: virtual public iprm::IOptionsList
63  {
64  public:
65  CameraList();
66 
67  void SetParent(CMultiSourceSnapBitmapSupplierComp* parentPtr);
68 
69  // reimplemented (iprm::IOptionsList)
70  virtual int GetOptionsFlags() const;
71  virtual int GetOptionsCount() const;
72  virtual QString GetOptionName(int index) const;
73  virtual QString GetOptionDescription(int index) const;
74  virtual QByteArray GetOptionId(int index) const;
75  virtual bool IsOptionEnabled(int index) const;
76 
77  private:
79  };
80 
81  template <class InterfaceType>
82  static InterfaceType* ExtractCameraList(CMultiSourceSnapBitmapSupplierComp& component)
83  {
84  return &component.m_cameraList;
85  }
86 
87  IBitmapAcquisition* GetSelectedCamera(int* slectedIndexPtr = NULL) const;
88 
89 private:
90  I_FACT(iimg::IBitmap, m_bitmapCompFact);
91  I_MULTIREF(IBitmapAcquisition, m_cameraListCompPtr);
92  I_MULTIATTR(QByteArray, m_cameraIdsAttrPtr);
93  I_MULTITEXTATTR(m_cameraNamesAttrPtr);
94  I_ATTR(QByteArray, m_sourceSelectionParamIdAttrPtr);
95  I_ATTR(QByteArray, m_cameraManagerParamIdAttrPtr);
96 
97  imod::TModelWrap<CameraList> m_cameraList;
98 };
99 
100 
101 } // namespace icam
102 
103 
104 #endif // !icam_CMultiSourceSnapBitmapSupplierComp_included
105 
106 
virtual const i2d::ICalibration2d * GetCalibration() const
iinsp::TSupplierCompWrap< QPair< istd::TDelPtr< const i2d::ICalibration2d >, istd::TDelPtr< iimg::IBitmap > > > BaseClass
Standard implementation of interface iinsp::ISupplier with preparation for component implementation...
This component allows image acquisition based on a camera selection.
virtual bool InitializeWork()
Called if the new work should be initialized.
virtual int ProduceObject(ProductType &result) const
virtual const iimg::IBitmap * GetBitmap() const
QPair< istd::TDelPtr< const i2d::ICalibration2d >, istd::TDelPtr< iimg::IBitmap > > ProductType

© 2007-2017 Witold Gantzke and Kirill Lepskiy