CPositionFromImageSupplierComp.h
Go to the documentation of this file.
1 #ifndef iipr_CPositionFromImageSupplierComp_included
2 #define iipr_CPositionFromImageSupplierComp_included
3 
4 
5 // ACF includes
6 #include "i2d/ICalibration2d.h"
8 #include "i2d/CVector2d.h"
10 
11 // ACF-Solutions includes
12 #include "iproc/IProcessor.h"
13 #include "iproc/ISupplier.h"
17 #include "iimg/IBitmapProvider.h"
18 
19 
20 namespace iipr
21 {
22 
23 
31  public iproc::TSupplierCompWrap< istd::TDelPtr<imeas::INumericValue> >,
32  virtual public imeas::INumericValueProvider,
33  virtual public i2d::ICalibrationProvider
34 {
35 public:
37 
38  I_BEGIN_COMPONENT(CPositionFromImageSupplierComp);
39  I_REGISTER_INTERFACE(imeas::INumericValueProvider);
40  I_REGISTER_INTERFACE(i2d::ICalibrationProvider);
41  I_ASSIGN(m_bitmapProviderCompPtr, "BitmapProvider", "Provide image to analyse", true, "BitmapProvider");
42  I_ASSIGN_TO(m_bitmapSupplierCompPtr, m_bitmapProviderCompPtr, false);
43  I_ASSIGN_TO(m_bitmapProviderModelCompPtr, m_bitmapProviderCompPtr, false);
44  I_ASSIGN(m_calibrationProviderCompPtr, "CalibrationProvider", "Provide 2D-calibration object", false, "CalibrationProvider");
45  I_ASSIGN(m_processorCompPtr, "Processor", "Processor calculating set of positions from image", true, "Processor");
46  I_END_COMPONENT;
47 
48  // reimplemented (imeas::INumericValueProvider)
49  virtual int GetValuesCount() const;
50  virtual const imeas::INumericValue& GetNumericValue(int index) const;
51 
52  // reimplemented (i2d::ICalibrationProvider)
53  virtual const i2d::ICalibration2d* GetCalibration() const;
54 
55 protected:
56  // reimplemented (iproc::TSupplierCompWrap)
57  virtual int ProduceObject(ProductType& result) const;
58 
59  // reimplemented (icomp::CComponentBase)
60  virtual void OnComponentCreated();
61 
62 private:
63  I_REF(iimg::IBitmapProvider, m_bitmapProviderCompPtr);
64  I_REF(iproc::ISupplier, m_bitmapSupplierCompPtr);
65  I_REF(imod::IModel, m_bitmapProviderModelCompPtr);
66  I_REF(i2d::ICalibrationProvider, m_calibrationProviderCompPtr);
67  I_REF(iproc::IProcessor, m_processorCompPtr);
68 
69  mutable istd::TDelPtr<const i2d::ICalibration2d> m_outputCalibrationPtr;
70 
71  class Position: public imeas::CSimpleNumericValue
72  {
73  public:
74  Position(){}
75  Position(const imath::CVarVector& positionVector);
76 
77  // reimplemented (imeas::INumericValue)
78  virtual bool IsValueTypeSupported(ValueTypeId valueTypeId) const;
79  virtual imath::CVarVector GetComponentValue(ValueTypeId valueTypeId) const;
80  };
81 };
82 
83 
84 } // namespace iipr
85 
86 
87 #endif // !iipr_CPositionFromImageSupplierComp_included
88 
89 
I_ASSIGN_TO(m_bitmapSupplierCompPtr, m_bitmapProviderCompPtr, false)
virtual int ProduceObject(ProductType &result) const
virtual const i2d::ICalibration2d * GetCalibration() const
virtual const imeas::INumericValue & GetNumericValue(int index) const
Returns a single numeric value from the list.
Basic implementation of imeas::INumericValue interface.
Base interface for suppliers providing synchrone processing of single object with "pull data" model...
Definition: ISupplier.h:22
Provide access to the list of the numeric values.
Implementation of value supplier returning position on the image.
General parameter set containing list of numeric values.
Definition: INumericValue.h:19
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
iproc::TSupplierCompWrap< istd::TDelPtr< imeas::INumericValue > > BaseClass
virtual int GetValuesCount() const
Get number of numeric values in the list.
Standard implementation of interface iproc::ISupplier with preparation for component implementation...

© 2007-2011 Witold Gantzke and Kirill Lepskiy