Orfeo Toolbox  4.0
otbLabelMapToVectorDataFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbLabelMapToVectorDataFilter_h
19 #define __otbLabelMapToVectorDataFilter_h
20 
21 #include "otbVectorDataSource.h"
22 #include "itkLabelMap.h"
26 #include "otbDataNode.h"
27 
28 #include <string>
29 #include <sstream>
30 
31 namespace otb {
32 
47 template<class TLabelMap, class TVectorData,
48  class TFieldsFunctor = Functor::LabelObjectFieldsFunctor<typename TLabelMap::LabelObjectType> >
49 class ITK_EXPORT LabelMapToVectorDataFilter :
50  public VectorDataSource<TVectorData>
51 {
52 public:
59 
61  typedef TLabelMap InputLabelMapType;
62  typedef TVectorData OutputVectorDataType;
63  typedef TFieldsFunctor FieldsFunctorType;
64 
65  typedef typename OutputVectorDataType::Pointer OutputVectorDataPointer;
66  typedef typename OutputVectorDataType::ConstPointer OutputVectorDataConstPointer;
67 
68  typedef typename InputLabelMapType::LabelObjectType LabelObjectType;
69 
70  typedef typename InputLabelMapType::ConstIterator ConstIteratorType;
71  typedef typename OutputVectorDataType::DataNodeType DataNodeType;
72  typedef typename DataNodeType::Pointer DataNodePointerType;
73  typedef typename DataNodeType::PolygonType PolygonType;
74  typedef typename PolygonType::Pointer PolygonPointerType;
75 
79 
81  itkNewMacro(Self);
82 
84  itkTypeMacro(LabelMapToVectorDataFilter,
86 
88  virtual void SetInput(const InputLabelMapType *input);
89  virtual void SetInput(unsigned int idx, const InputLabelMapType *input);
90  const InputLabelMapType * GetInput(void);
91  const InputLabelMapType * GetInput(unsigned int idx);
92 
93  /* Set the functor used to provide additionnal OGR fields */
94  void SetFieldsFunctor(const FieldsFunctorType& functor)
95  {
96  m_FieldsFunctor = functor;
97  this->Modified();
98  }
99 
100  /* Get the functor used to provide additionnal OGR fields */
101  FieldsFunctorType& GetFieldsFunctor()
102  {
103  return m_FieldsFunctor;
104  }
105 
106 protected:
109  void PrintSelf(std::ostream& os, itk::Indent indent) const;
110  void GenerateData();
111 
112 private:
113  LabelMapToVectorDataFilter(const Self &); //purposely not implemented
114  void operator =(const Self&); //purposely not implemented
115 
117 }; // end of class
118 
119 } // end namespace itk
120 
121 #ifndef OTB_MANUAL_INSTANTIATION
123 #endif
124 
125 #endif

Generated at Sat Mar 8 2014 16:04:34 for Orfeo Toolbox with doxygen 1.8.3.1