OTB  9.0.0
Orfeo Toolbox
otbVectorDataToVectorDataFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbVectorDataToVectorDataFilter_h
22 #define otbVectorDataToVectorDataFilter_h
23 
24 #include "otbVectorDataSource.h"
25 
26 namespace otb
27 {
28 
42 template <class TInputVectorData, class TOutputVectorData>
43 class ITK_EXPORT VectorDataToVectorDataFilter : public VectorDataSource<TOutputVectorData>
44 {
45 public:
49  typedef itk::SmartPointer<Self> Pointer;
50  typedef itk::SmartPointer<const Self> ConstPointer;
51 
53  itkNewMacro(Self);
54 
57 
59  typedef TInputVectorData InputVectorDataType;
60  typedef TOutputVectorData OutputVectorDataType;
61  typedef typename TInputVectorData::ConstPointer InputVectorDataPointer;
62  typedef typename TOutputVectorData::Pointer OutputVectorDataPointer;
63 
64  typedef typename InputVectorDataType::DataNodeType InputDataNodeType;
65  typedef typename OutputVectorDataType::DataNodeType OutputDataNodeType;
66  typedef typename InputVectorDataType::DataTreeType::TreeNodeType InputInternalTreeNodeType;
67  typedef typename OutputVectorDataType::DataTreeType::TreeNodeType OutputInternalTreeNodeType;
68 
69  typedef typename InputDataNodeType::PointType InputPointType;
70  typedef typename InputDataNodeType::LineType InputLineType;
71  typedef typename InputDataNodeType::PolygonType InputPolygonType;
72  typedef typename InputDataNodeType::PolygonListType InputPolygonListType;
73 
74  typedef typename InputLineType::Pointer InputLinePointerType;
75  typedef typename InputPolygonType::Pointer InputPolygonPointerType;
76  typedef typename InputPolygonListType::Pointer InputPolygonListPointerType;
77 
78  typedef typename OutputDataNodeType::PointType OutputPointType;
79  typedef typename OutputDataNodeType::LineType OutputLineType;
80  typedef typename OutputDataNodeType::PolygonType OutputPolygonType;
81  typedef typename OutputDataNodeType::PolygonListType OutputPolygonListType;
82 
83  typedef typename OutputLineType::Pointer OutputLinePointerType;
84  typedef typename OutputPolygonType::Pointer OutputPolygonPointerType;
85  typedef typename OutputPolygonListType::Pointer OutputPolygonListPointerType;
86 
87  typedef itk::DataObject::Pointer DataObjectPointer;
88 
89  using Superclass::SetInput;
90  virtual void SetInput(const InputVectorDataType* input);
91  const InputVectorDataType* GetInput(void);
92 
93 protected:
96 
99  {
100  }
101 
102  virtual OutputPointType ProcessPoint(InputPointType itkNotUsed(point)) const
103  {
104  itkExceptionMacro(<< "Subclass should reimplement this method");
105  }
107  {
108  itkExceptionMacro(<< "Subclass should reimplement this method");
109  }
111  {
112  itkExceptionMacro(<< "Subclass should reimplement this method");
113  }
115  {
116  itkExceptionMacro(<< "Subclass should reimplement this method");
117  }
118 
119  void GenerateOutputInformation(void) override;
120  void GenerateData(void) override;
121 
123  virtual void ProcessNode(InputInternalTreeNodeType* source, OutputInternalTreeNodeType* destination) const;
124 
126  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
127 
128 private:
129  VectorDataToVectorDataFilter(const Self&) = delete;
130  void operator=(const Self&) = delete;
131 };
132 
133 } // end namespace otb
134 
135 #ifndef OTB_MANUAL_INSTANTIATION
137 #endif
138 
139 #endif
otb::VectorDataToVectorDataFilter::InputVectorDataType
TInputVectorData InputVectorDataType
Definition: otbVectorDataToVectorDataFilter.h:56
otb::VectorDataToVectorDataFilter::OutputLineType
OutputDataNodeType::LineType OutputLineType
Definition: otbVectorDataToVectorDataFilter.h:79
otb::VectorDataToVectorDataFilter::ProcessPolygonList
virtual OutputPolygonListPointerType ProcessPolygonList(InputPolygonListPointerType) const
Definition: otbVectorDataToVectorDataFilter.h:114
otb::VectorDataToVectorDataFilter::ProcessPolygon
virtual OutputPolygonPointerType ProcessPolygon(InputPolygonPointerType) const
Definition: otbVectorDataToVectorDataFilter.h:110
otb::VectorDataToVectorDataFilter::InputVectorDataPointer
TInputVectorData::ConstPointer InputVectorDataPointer
Definition: otbVectorDataToVectorDataFilter.h:61
otb::VectorDataToVectorDataFilter::OutputVectorDataType
TOutputVectorData OutputVectorDataType
Definition: otbVectorDataToVectorDataFilter.h:60
otb::VectorDataToVectorDataFilter::OutputPolygonListPointerType
OutputPolygonListType::Pointer OutputPolygonListPointerType
Definition: otbVectorDataToVectorDataFilter.h:85
otb::VectorDataToVectorDataFilter::DataObjectPointer
itk::DataObject::Pointer DataObjectPointer
Definition: otbVectorDataToVectorDataFilter.h:87
otb::VectorDataToVectorDataFilter::OutputPointType
OutputDataNodeType::PointType OutputPointType
Definition: otbVectorDataToVectorDataFilter.h:78
otb::VectorDataToVectorDataFilter::Superclass
VectorDataSource< TOutputVectorData > Superclass
Definition: otbVectorDataToVectorDataFilter.h:48
otb::VectorDataToVectorDataFilter::InputPolygonType
InputDataNodeType::PolygonType InputPolygonType
Definition: otbVectorDataToVectorDataFilter.h:71
otb::VectorDataToVectorDataFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbVectorDataToVectorDataFilter.h:49
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::VectorDataToVectorDataFilter::InputInternalTreeNodeType
InputVectorDataType::DataTreeType::TreeNodeType InputInternalTreeNodeType
Definition: otbVectorDataToVectorDataFilter.h:66
otb::VectorDataToVectorDataFilter::OutputPolygonListType
OutputDataNodeType::PolygonListType OutputPolygonListType
Definition: otbVectorDataToVectorDataFilter.h:81
otb::VectorDataToVectorDataFilter::OutputInternalTreeNodeType
OutputVectorDataType::DataTreeType::TreeNodeType OutputInternalTreeNodeType
Definition: otbVectorDataToVectorDataFilter.h:67
otb::VectorDataToVectorDataFilter::InputPolygonListPointerType
InputPolygonListType::Pointer InputPolygonListPointerType
Definition: otbVectorDataToVectorDataFilter.h:76
otb::VectorDataToVectorDataFilter
Base class for filters that take an VectorData as input and produce an VectorData as output.
Definition: otbVectorDataToVectorDataFilter.h:43
otb::VectorDataToVectorDataFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbVectorDataToVectorDataFilter.h:50
otb::VectorDataToVectorDataFilter::OutputLinePointerType
OutputLineType::Pointer OutputLinePointerType
Definition: otbVectorDataToVectorDataFilter.h:83
otb::VectorDataToVectorDataFilter::InputPointType
InputDataNodeType::PointType InputPointType
Definition: otbVectorDataToVectorDataFilter.h:69
otb::VectorDataToVectorDataFilter::InputPolygonPointerType
InputPolygonType::Pointer InputPolygonPointerType
Definition: otbVectorDataToVectorDataFilter.h:75
otb::VectorDataToVectorDataFilter::OutputVectorDataPointer
TOutputVectorData::Pointer OutputVectorDataPointer
Definition: otbVectorDataToVectorDataFilter.h:62
otb::VectorDataToVectorDataFilter::OutputPolygonPointerType
OutputPolygonType::Pointer OutputPolygonPointerType
Definition: otbVectorDataToVectorDataFilter.h:84
otbVectorDataSource.h
otb::VectorDataToVectorDataFilter::InputLineType
InputDataNodeType::LineType InputLineType
Definition: otbVectorDataToVectorDataFilter.h:70
otb::VectorDataToVectorDataFilter::Self
VectorDataToVectorDataFilter Self
Definition: otbVectorDataToVectorDataFilter.h:47
otb::VectorDataToVectorDataFilter::OutputDataNodeType
OutputVectorDataType::DataNodeType OutputDataNodeType
Definition: otbVectorDataToVectorDataFilter.h:65
otb::VectorDataToVectorDataFilter::InputPolygonListType
InputDataNodeType::PolygonListType InputPolygonListType
Definition: otbVectorDataToVectorDataFilter.h:72
otb::VectorDataToVectorDataFilter::~VectorDataToVectorDataFilter
~VectorDataToVectorDataFilter() override
Definition: otbVectorDataToVectorDataFilter.h:98
otb::VectorDataToVectorDataFilter::InputLinePointerType
InputLineType::Pointer InputLinePointerType
Definition: otbVectorDataToVectorDataFilter.h:74
otb::VectorDataToVectorDataFilter::InputDataNodeType
InputVectorDataType::DataNodeType InputDataNodeType
Definition: otbVectorDataToVectorDataFilter.h:64
otb::VectorDataToVectorDataFilter::ProcessLine
virtual OutputLinePointerType ProcessLine(InputLinePointerType) const
Definition: otbVectorDataToVectorDataFilter.h:106
otb::VectorDataSource
Filter hierarchy for generating VectorData.
Definition: otbVectorDataSource.h:42
otb::VectorDataToVectorDataFilter::OutputPolygonType
OutputDataNodeType::PolygonType OutputPolygonType
Definition: otbVectorDataToVectorDataFilter.h:80
otb::VectorDataToVectorDataFilter::ProcessPoint
virtual OutputPointType ProcessPoint(InputPointType) const
Definition: otbVectorDataToVectorDataFilter.h:102
otbVectorDataToVectorDataFilter.hxx