IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ValueMeasureResult.h
1 // ValueMeasureResult.h:
3 // ---------------------
4 //
16 
17 #ifndef __IPSDKBASESHAPEANALYSIS_VALUEMEASURERESULT_H__
18 #define __IPSDKBASESHAPEANALYSIS_VALUEMEASURERESULT_H__
19 
20 // suppression warnings
21 // warning C4251: 'ipsdk::shape::analysis::ValueMeasureResult<T>::_coll' : class 'std::vector<T>' needs to have dll-interface to be used by clients of class 'ipsdk::shape::analysis::ValueMeasureResult<T>'
22 #pragma warning (push)
23 #pragma warning (disable : 4251)
24 
25 #include <IPSDKBaseShapeAnalysis/Measure/Result/BaseValueMeasureResult.h>
27 
28 namespace ipsdk {
29 namespace shape {
30 namespace analysis {
31 
34 
35 template <typename T>
36 class IPSDKBASESHAPEANALYSIS_API ValueMeasureResult : public BaseValueMeasureResult
37 {
38  // declare serial class
39  IPSDK_DECLARE_SERIAL_WITH_COPY(IPSDKBaseShapeAnalysis, ValueMeasureResult)
40 
41 // predefined public type
42 public:
44  typedef T ValueType;
45 
47  typedef std::vector<ValueType> CollType;
48 
50  typedef std::vector<CollType> ColorCollType;
51 
52 public:
58 
59 // methods
60 public:
62  inline eDataType getMsrResultDataType() const;
63 
68  const ColorCollType& getColorColl() const;
69  ColorCollType& getColorColl();
71 
76  const CollType& getColl(const ipUInt64 cPlanIdx = 0) const;
77  CollType& getColl(const ipUInt64 cPlanIdx = 0);
79 
85  math::HistogramPtr extractHistogram(const ipUInt64 nbClasses,
86  const ipUInt64 cPlanIdx = 0) const;
87 
88 protected:
90  void initDerived(const ipUInt64 nbColorPlans,
91  const ipUInt64 nbEntities);
92 
95  void collectResultsDerived(const ipUInt64 resultStartIndex,
96  const BaseMeasureResult& baseSubResults);
97  void collectResultsDerived(const UInt64Vector& subDataIdxColl,
98  const BaseMeasureResult& baseSubResults);
100 
103  void extractResultsDerived(const ipUInt64 resultStartIndex,
104  const BaseMeasureResult& baseMainResults);
105  void extractResultsDerived(const UInt64Vector& mainDataIdxColl,
106  const BaseMeasureResult& baseMainResults);
108 
110  void clearDerived();
111 
112 // attributes
113 protected:
116 };
117 
120 
121 template <typename T>
122 inline eDataType
124 {
125  return DataType2Enum<T>::getEnum();
126 }
127 
130 
131 } // end of namespace analysis
132 } // end of namespace shape
133 } // end of namespace ipsdk
134 
135 #pragma warning (pop)
136 
137 #endif // __IPSDKBASESHAPEANALYSIS_VALUEMEASURERESULT_H__
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
std::vector< ValueType > CollType
collection type associated to object
Definition: ValueMeasureResult.h:47
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
T ValueType
measure type associated to object
Definition: ValueMeasureResult.h:44
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
eDataType getMsrResultDataType() const
retrieve underlying data type associated to object
Definition: ValueMeasureResult.h:123
std::vector< ipUInt64 > UInt64Vector
stl vector collections
Definition: BaseCollections.h:35
static eDataType getEnum()
retrieve enum value associated to base type
Definition: BaseTypes.h:113
#define IPSDKBASESHAPEANALYSIS_API
Import/Export macro for library IPSDKBaseShapeAnalysis.
Definition: IPSDKBaseShapeAnalysisExports.h:25
Class associated to measure results agregating a single value for each shape.
Definition: MeasureResultTypes.h:28
std::vector< CollType > ColorCollType
color (by color plan) collection type associated to object
Definition: ValueMeasureResult.h:50
eDataType
Enumerate describing a base type.
Definition: BaseTypes.h:77
Base class for measure results.
Definition: BaseMeasureResult.h:29
Predefined types for histogram management.
ColorCollType _coll
result collection associated to object
Definition: ValueMeasureResult.h:115
boost::shared_ptr< ipsdk::math::BaseHistogram > HistogramPtr
shared pointer to ipsdk::math::BaseHistogram
Definition: HistogramTypes.h:119