CSnapBitmapSupplierCompBase.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 // Qt includes
5 #include <QtCore/QPair>
6 
7 // ACF includes
8 #include <istd/TDelPtr.h>
9 #include <i2d/ICalibration2d.h>
11 #include <iimg/IBitmap.h>
13 
14 // ACF-Solutions includes
16 #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_BASE_COMPONENT(CSnapBitmapSupplierCompBase);
37  I_REGISTER_INTERFACE(iimg::IBitmapProvider);
38  I_REGISTER_INTERFACE(i2d::ICalibrationProvider);
39  I_ASSIGN(m_bitmapAcquisitionCompPtr, "BitmapAcquisition", "Bitmap acquisition object for image snap", true, "BitmapAcquisition");
40  I_ASSIGN(m_calibrationIdAttrPtr, "CalibrationParamId", "ID of calibration in parameter set", false, "Calibration");
41  I_ASSIGN(m_defaultCalibrationCompPtr, "Calibration", "Optional calibration object", false, "Calibration");
42  I_ASSIGN(m_scaleParamIdAttrPtr, "ScaleParamId", "ID of resolution parameter (pixel/mm) in parameter set", false, "Scale");
43  I_ASSIGN(m_defaultScaleValueCompPtr, "DefaultScaleParam", "Default resolution in pixel/mm", false, "DefaultScaleParam");
44  I_END_COMPONENT;
45 
46  // reimplemented (iimg::IBitmapProvider)
47  virtual const iimg::IBitmap* GetBitmap() const;
48 
49  // reimplemented (i2d::ICalibrationProvider)
50  virtual const i2d::ICalibration2d* GetCalibration() const;
51 
52 protected:
53  // abstract methods
54  virtual iimg::IBitmap* CreateBitmap() const = 0;
55 
56  // reimplemented (iinsp::TSupplierCompWrap)
57  virtual bool InitializeWork();
58  virtual int ProduceObject(ProductType& result) const;
59 
60  // reimplemented (icomp::CComponentBase)
61  virtual void OnComponentCreated();
62 
63 private:
64  I_REF(IBitmapAcquisition, m_bitmapAcquisitionCompPtr);
65  I_ATTR(QByteArray, m_calibrationIdAttrPtr);
66  I_REF(i2d::ICalibration2d, m_defaultCalibrationCompPtr);
67  I_ATTR(QByteArray, m_scaleParamIdAttrPtr);
68  I_REF(imeas::INumericValue, m_defaultScaleValueCompPtr);
69 };
70 
71 
72 } // namespace icam
73 
74 
Bitmap acquisition processor.
iinsp::TSupplierCompWrap< QPair< istd::TDelPtr< const i2d::ICalibration2d >, istd::TDelPtr< iimg::IBitmap > > > BaseClass
Basic implementation of bitmap supplier based on image acquisition.
Standard implementation of interface iinsp::ISupplier with preparation for component implementation...
virtual const iimg::IBitmap * GetBitmap() const
General parameter set containing list of numeric values.
Definition: INumericValue.h:20
virtual iimg::IBitmap * CreateBitmap() const =0
virtual const i2d::ICalibration2d * GetCalibration() const
virtual bool InitializeWork()
Called if the new work should be initialized.
virtual int ProduceObject(ProductType &result) const
QPair< istd::TDelPtr< const i2d::ICalibration2d >, istd::TDelPtr< iimg::IBitmap > > ProductType

© 2007-2017 Witold Gantzke and Kirill Lepskiy