IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageZStrip3dSplit.h
1 // ImageZStrip3dSplit.h:
3 // ---------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_IMAGEZSTRIP3DSPLIT_H__
16 #define __IPSDKIMAGEPROCESSING_IMAGEZSTRIP3DSPLIT_H__
17 
18 #include <IPSDKImageProcessing/DataSplit/Strip/ZStrip3d/BaseImageZStrip3dSplit.h>
19 
20 namespace ipsdk {
21 namespace imaproc {
22 
25 
26 template <typename TProcessor, typename InputDataType, typename TAttribute>
27 class ImageZStrip3dSplit : public BaseImageZStrip3dSplit<InputDataType,
28  typename TAttribute::ValueType>
29 {
30 // predefined public types
31 public:
33  typedef TProcessor ProcessorType;
34 
36  typedef TAttribute AttributeType;
37 
39  typedef typename TAttribute::ValueType OutputType;
40 
41 public:
45  ~ImageZStrip3dSplit() {}
47 
48 // methods
49 public:
51  const std::string& getAttributeName() const;
52 
54  const std::string& getAttributeToolTip() const;
55 
61  void init(const boost::shared_ptr<InputDataType>& pImage,
62  const image::eStripAllocationType& stripAllocationType,
63  const image::eStripParsingDirection& stripParsingDirection);
64 
65 protected:
67  bool checkProcessorType(const processor::BaseProcessor& processor);
68 
73  const boost::shared_ptr<OutputType>& pImageZStrip3d);
74 
75 // attributes
76 protected:
77 
78 };
79 
82 
83 template <typename TProcessor, typename InputDataType, typename TAttribute>
84 inline const std::string&
86 {
87  return TAttribute::getObjectNameStr();
88 }
89 
90 template <typename TProcessor, typename InputDataType, typename TAttribute>
91 inline const std::string&
93 {
94  return TAttribute::getToolTipStr();
95 }
96 
97 template <typename TProcessor, typename InputDataType, typename TAttribute>
98 inline void
99 ImageZStrip3dSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pImage,
100  const image::eStripAllocationType& stripAllocationType,
101  const image::eStripParsingDirection& stripParsingDirection)
102 {
103  // call of base class initialization method
104  this->initBase(pImage, stripAllocationType, stripParsingDirection);
105 }
106 
107 template <typename TProcessor, typename InputDataType, typename TAttribute>
108 inline bool
110 {
111  // check for consistency between processor and attribute
113  "This attribute is not part of processor class");
114 
115  return dynamic_cast<const TProcessor*>(&processor) != 0;
116 }
117 
118 template <typename TProcessor, typename InputDataType, typename TAttribute>
119 inline BoolResult
121  const boost::shared_ptr<OutputType>& pImageZStrip3d)
122 {
123  // cast of input processor object
124  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
125 
126  // update of processor attribute value
127  tProcessor.TProcessor::template set<TAttribute>(pImageZStrip3d);
128 
129  return true;
130 }
131 
134 
135 } // end of namespace imaproc
136 } // end of namespace ipsdk
137 
138 #endif // __IPSDKIMAGEPROCESSING_IMAGEZSTRIP3DSPLIT_H__
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
void init(const boost::shared_ptr< InputDataType > &pImage, const image::eStripAllocationType &stripAllocationType, const image::eStripParsingDirection &stripParsingDirection)
initialization method for splitted objects
Definition: ImageZStrip3dSplit.h:99
TAttribute AttributeType
attribute type associated to object
Definition: ImageZStrip3dSplit.h:36
Concrete class for split operation generating image z strips 3d.
Definition: ImageZStrip3dSplit.h:27
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
eStripAllocationType
Enumerate describing image strip allocation policy.
Definition: ImageStripTypes.h:88
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: ImageZStrip3dSplit.h:85
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< OutputType > &pImageZStrip3d)
initialize processor attribute associate to split operation for a given element index ...
Definition: ImageZStrip3dSplit.h:120
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: ImageZStrip3dSplit.h:109
Base class for split operation generating image z strips 3d.
Definition: BaseImageZStrip3dSplit.h:32
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: ImageZStrip3dSplit.h:92
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
TProcessor ProcessorType
processor type associated to object
Definition: ImageZStrip3dSplit.h:33
TAttribute::ValueType OutputType
output data type for split operation
Definition: ImageZStrip3dSplit.h:39