IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
StripShape2dCollSplit.h
1 // StripShape2dCollSplit.h:
3 // ------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_STRIPSHAPE2DCOLLSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_STRIPSHAPE2DCOLLSPLIT_H__
18 
19 #include <IPSDKImageProcessing/DataSplit/Shape2dColl/BaseStripShape2dCollSplit.h>
20 
21 namespace ipsdk {
22 namespace imaproc {
23 
26 
27 template <typename TProcessor, typename InputStorageType, typename TAttribute>
28 class StripShape2dCollSplit : public BaseStripShape2dCollSplit<typename InputStorageType::element_type>
29 {
30 // predefined public types
31 public:
33  typedef TProcessor ProcessorType;
34 
36  typedef TAttribute AttributeType;
37 
39  typedef typename TAttribute::ValueType OutputType;
40 
42  typedef typename InputStorageType::element_type InputDataType;
43 
44 public:
50 
51 // methods
52 public:
54  const std::string& getAttributeName() const;
55 
57  const std::string& getAttributeToolTip() const;
58 
62  void init(const InputStorageType& pShape2dColl);
63 
64 protected:
66  bool checkProcessorType(const processor::BaseProcessor& processor);
67 
72  const InputStorageType& pSubShape2dColl);
73 
74 // attributes
75 protected:
76 
77 };
78 
81 
82 template <typename TProcessor, typename InputStorageType, typename TAttribute>
83 inline const std::string&
85 {
86  return TAttribute::getObjectNameStr();
87 }
88 
89 template <typename TProcessor, typename InputStorageType, typename TAttribute>
90 inline const std::string&
92 {
93  return TAttribute::getToolTipStr();
94 }
95 
96 template <typename TProcessor, typename InputStorageType, typename TAttribute>
97 inline void
99 {
100  // call of base class initialization method
101  this->initBase(pShape2dColl);
102 }
103 
104 template <typename TProcessor, typename InputStorageType, typename TAttribute>
105 inline bool
107 {
108  // check for consistency between processor and attribute
110  "This attribute is not part of processor class");
111 
112  return dynamic_cast<const TProcessor*>(&processor) != 0;
113 }
114 
115 template <typename TProcessor, typename InputStorageType, typename TAttribute>
116 inline BoolResult
118  const InputStorageType& pSubShape2dColl)
119 {
120  // cast of input processor object
121  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
122 
123  // update of processor attribute value
124  tProcessor.TProcessor::template set<TAttribute>(pSubShape2dColl);
125 
126  return true;
127 }
128 
131 
132 } // end of namespace imaproc
133 } // end of namespace ipsdk
134 
135 #endif // __IPSDKIMAGEPROCESSING_STRIPSHAPE2DCOLLSPLIT_H__
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: StripShape2dCollSplit.h:106
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
TAttribute AttributeType
attribute type associated to object
Definition: StripShape2dCollSplit.h:36
Base class for by strip split operation generating sub shape 2d collection.
Definition: BaseStripShape2dCollSplit.h:28
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: StripShape2dCollSplit.h:91
BoolResult processAttribute(processor::BaseProcessor &processor, const InputStorageType &pSubShape2dColl)
initialize processor attribute associate to split operation for a given sub shape 2d collection ...
Definition: StripShape2dCollSplit.h:117
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: StripShape2dCollSplit.h:84
Base class for processor class.
Definition: BaseProcessor.h:43
structure allowing to check whether a given attribute exists in attribute collection information ...
Definition: AttributeCollInfoCheckMacros.h:131
InputStorageType::element_type InputDataType
input data type for split operation
Definition: StripShape2dCollSplit.h:42
TProcessor ProcessorType
processor type associated to object
Definition: StripShape2dCollSplit.h:33
Concrete class for by strip split operation generating sub shape 2d collection.
Definition: StripShape2dCollSplit.h:28
void init(const InputStorageType &pShape2dColl)
initialization method for splitted objects
Definition: StripShape2dCollSplit.h:98
TAttribute::ValueType OutputType
output data type for split operation
Definition: StripShape2dCollSplit.h:39