Orfeo Toolbox  3.16
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> >
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 OutputVectorDataType::DataNodeType DataNodeType;
71  typedef typename DataNodeType::Pointer DataNodePointerType;
72  typedef typename DataNodeType::PolygonType PolygonType;
73  typedef typename PolygonType::Pointer PolygonPointerType;
74 
78 
80  itkNewMacro(Self);
81 
83  itkTypeMacro(LabelMapToVectorDataFilter,
85 
87  virtual void SetInput(const InputLabelMapType *input);
88  virtual void SetInput(unsigned int idx, const InputLabelMapType *input);
89  const InputLabelMapType * GetInput(void);
90  const InputLabelMapType * GetInput(unsigned int idx);
91 
92  /* Set the functor used to provide additionnal OGR fields */
93  void SetFieldsFunctor(const FieldsFunctorType& functor)
94  {
95  m_FieldsFunctor = functor;
96  this->Modified();
97  }
98 
99  /* Get the functor used to provide additionnal OGR fields */
100  FieldsFunctorType& GetFieldsFunctor()
101  {
102  return m_FieldsFunctor;
103  }
104 
105 protected:
108  void PrintSelf(std::ostream& os, itk::Indent indent) const;
109  void GenerateData();
110 
111 private:
112  LabelMapToVectorDataFilter(const Self &); //purposely not implemented
113  void operator =(const Self&); //purposely not implemented
114 
116 }; // end of class
117 
118 } // end namespace itk
119 
120 #ifndef OTB_MANUAL_INSTANTIATION
122 #endif
123 
124 #endif

Generated at Sun Feb 3 2013 00:33:19 for Orfeo Toolbox with doxygen 1.8.1.1