CBarcodeSearchFeature.h
Go to the documentation of this file.
1 #ifndef ibarcode_CBarcodeSearchFeature_included
2 #define ibarcode_CBarcodeSearchFeature_included
3 
4 
5 // ACF includes
6 #include <imath/CVarVector.h>
7 #include <i2d/CPolygon.h>
8 #include <iipr/CObjectFeature.h>
9 #include <ibarcode/CBarcode.h>
10 
11 
12 namespace ibarcode
13 {
14 
15 
20 {
21 public:
24 
27  const QString& barcodeData = QString(),
28  const i2d::CPolygon& barcodeArea = i2d::CPolygon(),
29  bool isChecksumValid = false,
30  double weight = 0.0,
31  const i2d::CVector2d& position = i2d::CVector2d(0, 0),
32  double angle = 0.0,
33  const i2d::CVector2d& scale = i2d::CVector2d(1.0, 1.0));
34 
35  virtual bool IsBarcodeValid() const;
36 
37  virtual void ResetBarcode();
38 
39  virtual i2d::CPolygon GetBarcodeArea() const;
40  virtual void SetBarcodeArea(const i2d::CPolygon& barcodeArea);
41 
42  virtual bool IsCheckSumValid() const;
43  virtual void SetCheckSumValid(bool isCheckSumValid = true);
44 
45  virtual int GetValidSymbolCount() const;
46  virtual void SetValidSymbolCount(int validSymbolCount);
47 
48  // reimplemented (IBarcode)
49  virtual void SetData(const QByteArray& barcodeData);
50 
51  // reimplemented (imeas::INumericValue)
52  virtual bool IsValueTypeSupported(ValueTypeId valueTypeId) const;
53  virtual imath::CVarVector GetComponentValue(ValueTypeId valueTypeId) const;
54 
55  // reimplemented (iser::ISerializable)
56  virtual bool Serialize(iser::IArchive& archive);
57 
58 private:
59  void EnsureWeightCalculated();
60 
61 private:
62  bool m_isCheckSumValid;
63  int m_validSymbolCount;
64  i2d::CPolygon m_barcodeArea;
65 };
66 
67 
68 } // namespace ibarcode
69 
70 
71 #endif // !ibarcode_CBarcodeSearchFeature_included
72 
73 
virtual int GetValidSymbolCount() const
Implementation of the barcode feature.
virtual void SetBarcodeArea(const i2d::CPolygon &barcodeArea)
Implementation of the simple barcode data container.
Definition: CBarcode.h:16
BarcodeType
Supported barcode types.
Definition: IBarcode.h:22
virtual i2d::CPolygon GetBarcodeArea() const
Implementation of a general image object feature.
virtual void SetCheckSumValid(bool isCheckSumValid=true)
virtual bool IsValueTypeSupported(ValueTypeId valueTypeId) const
Check if the given value type (or value component) is supported.
virtual bool IsCheckSumValid() const
virtual void SetValidSymbolCount(int validSymbolCount)
virtual imath::CVarVector GetComponentValue(ValueTypeId valueTypeId) const
Get access to component value of the given type.
virtual bool IsBarcodeValid() const
virtual bool Serialize(iser::IArchive &archive)
virtual void SetData(const QByteArray &barcodeData)
ValueTypeId
Define standard numeric value types.
Definition: INumericValue.h:26
CBarcodeSearchFeature(ibarcode::IBarcode::BarcodeType barcodeType=BT_UNKNOWN, const QString &barcodeData=QString(), const i2d::CPolygon &barcodeArea=i2d::CPolygon(), bool isChecksumValid=false, double weight=0.0, const i2d::CVector2d &position=i2d::CVector2d(0, 0), double angle=0.0, const i2d::CVector2d &scale=i2d::CVector2d(1.0, 1.0))

© 2007-2017 Witold Gantzke and Kirill Lepskiy