CSearchBasedFeaturesSupplierComp.h
Go to the documentation of this file.
1 #ifndef iipr_CSearchBasedFeaturesSupplierComp_included
2 #define iipr_CSearchBasedFeaturesSupplierComp_included
3 
4 
5 // ACF includes
7 #include <i2d/CVector2d.h>
8 #include <iprm/IParamsSet.h>
10 
11 // ACF-Solutions includes
12 #include <iproc/IProcessor.h>
13 #include <iinsp/ISupplier.h>
15 #include <iimg/IBitmapProvider.h>
17 #include <iipr/IFeaturesProvider.h>
19 
20 
21 namespace iipr
22 {
23 
24 
26  public iinsp::TSupplierCompWrap<CFeaturesContainer>,
27  virtual public IFeaturesProvider,
28  virtual public i2d::IMultiCalibrationProvider,
29  virtual public istd::IInformationProvider
30 {
31 public:
33 
34  I_BEGIN_COMPONENT(CSearchBasedFeaturesSupplierComp);
35  I_REGISTER_INTERFACE(iipr::IFeaturesProvider);
36  I_REGISTER_INTERFACE(i2d::IMultiCalibrationProvider);
37  I_REGISTER_INTERFACE(istd::IInformationProvider);
38  I_ASSIGN(m_bitmapProviderCompPtr, "BitmapProvider", "Provide image to analyse", true, "BitmapProvider");
39  I_ASSIGN_TO(m_bitmapSupplierCompPtr, m_bitmapProviderCompPtr, false);
40  I_ASSIGN_TO(m_bitmapProviderModelCompPtr, m_bitmapProviderCompPtr, false);
41  I_ASSIGN(m_searchProcessorCompPtr, "Processor", "Calculate model positions in the image", true, "Processor");
42  I_ASSIGN(m_slaveInformationProviderCompPtr, "SlaveInformationProvider", "Used to provide the status if set", false, "SlaveInformationProvider");
43  I_ASSIGN(m_globalCalibrationPtr, "GlobalCalibration", "Setup the supplier global calibration", false, "GlobalCalibration");
44  I_ASSIGN(m_searchParamsManagerParamIdAttrPtr, "SearchParamsManagerParameterId", "ID of the parameter manager used for multi search", false, "SearchParamsManagerParamId");
45  I_ASSIGN(m_searchParamsIdAttrPtr, "SearchParamsId", "ID of standard search parameters", true, "SearchParamsId");
46  I_END_COMPONENT;
47 
49 
50  // reimplemented (i2d::IMultiCalibrationProvider)
52  virtual int GetCalibrationsCount() const;
53  virtual const i2d::ICalibration2d* GetCalibration(int calibrationIndex) const;
54 
55  // reimplemented (iipr::IFeaturesProvider)
56  virtual int GetFeaturesCount() const;
57  virtual const imeas::INumericValue& GetFeature(int index) const;
58 
59  // reimplemented (istd::IInformationProvider)
60  virtual QDateTime GetInformationTimeStamp() const;
61  virtual InformationCategory GetInformationCategory() const;
62  virtual int GetInformationId() const;
63  virtual QString GetInformationDescription() const;
64  virtual QString GetInformationSource() const;
65  virtual int GetInformationFlags() const;
66 
67 protected:
68  // reimplemented (iinsp::TSupplierCompWrap)
69  virtual bool InitializeWork();
70  virtual int ProduceObject(CFeaturesContainer& result) const;
71 
72  // reimplemented (icomp::CComponentBase)
73  virtual void OnComponentCreated();
74  virtual void OnComponentDestroyed();
75 
76 private:
77 
78  class CalibrationList : virtual public iprm::IOptionsList
79  {
80  public:
81  CalibrationList();
82 
83  void SetParentPtr(CSearchBasedFeaturesSupplierComp* parentPtr);
84 
85  // reimplemented (iprm::IOptionsList)
86  virtual int GetOptionsFlags() const;
87  virtual int GetOptionsCount() const;
88  virtual QString GetOptionName(int index) const;
89  virtual QString GetOptionDescription(int index) const;
90  virtual QByteArray GetOptionId(int index) const;
91  virtual bool IsOptionEnabled(int index) const;
92 
93  private:
95  };
96 
97 private:
98  I_REF(iimg::IBitmapProvider, m_bitmapProviderCompPtr);
99  I_REF(iinsp::ISupplier, m_bitmapSupplierCompPtr);
100  I_REF(imod::IModel, m_bitmapProviderModelCompPtr);
101  I_REF(iproc::IProcessor, m_searchProcessorCompPtr);
102  I_REF(istd::IInformationProvider, m_slaveInformationProviderCompPtr);
103  I_REF(i2d::ICalibration2d, m_globalCalibrationPtr);
104  I_ATTR(QByteArray, m_searchParamsManagerParamIdAttrPtr);
105  I_ATTR(QByteArray, m_searchParamsIdAttrPtr);
106 
107  struct CalibrationInfo
108  {
109  icalib::CAffineCalibration2d calibration;
110  QByteArray calibrationId;
111  QString calibrationName;
112  };
113 
114  typedef QVector<CalibrationInfo> Calibrations;
115 
116  mutable Calibrations m_calibrations;
117 
118  imod::TModelWrap<CalibrationList> m_calibrationList;
119 
120  mutable istd::IInformationProvider::InformationCategory m_defaultInformationCategory;
121 };
122 
123 
124 } // namespace iipr
125 
126 
127 #endif // !iipr_CSearchBasedFeaturesSupplierComp_included
128 
129 
virtual const iprm::IOptionsList * GetCalibrationSelectionContraints() const
virtual QDateTime GetInformationTimeStamp() const
iinsp::TSupplierCompWrap< CFeaturesContainer > BaseClass
virtual int GetCalibrationsCount() const
virtual QString GetInformationSource() const
virtual bool InitializeWork()
Called if the new work should be initialized.
Standard implementation of interface iinsp::ISupplier with preparation for component implementation...
Basic implementation of a features container.
Container allowing access to features.
virtual int GetFeaturesCount() const
Get number of stored features.
virtual QString GetInformationDescription() const
virtual const imeas::INumericValue & GetFeature(int index) const
Get access to single feature.
General parameter set containing list of numeric values.
Definition: INumericValue.h:20
Definition of an affine transformation for 2D-spaces.
virtual int ProduceObject(CFeaturesContainer &result) const
virtual InformationCategory GetInformationCategory() const
Base interface for suppliers providing calculating of objects on demand ("pull data" model)...
Definition: ISupplier.h:22
Interface for all synchrone and asynchrone processors with "push data" model.
Definition: IProcessor.h:24
virtual int GetInformationFlags() const
virtual const i2d::ICalibration2d * GetCalibration(int calibrationIndex) const

© 2007-2017 Witold Gantzke and Kirill Lepskiy