OTB  10.0.0
Orfeo Toolbox
otbVectorDataToVectorDataFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 itk::SmartPointer<InputDataNodeType> InputDataNodePointerType;
66  typedef typename OutputVectorDataType::DataNodeType OutputDataNodeType;
67  typedef typename itk::SmartPointer<OutputDataNodeType> OutputDataNodePointerType;
68  typedef typename InputVectorDataType::TreeNodeType InputInternalTreeNodeType;
69  typedef typename OutputVectorDataType::TreeNodeType OutputInternalTreeNodeType;
70 
71  typedef typename InputDataNodeType::PointType InputPointType;
72  typedef typename InputDataNodeType::LineType InputLineType;
73  typedef typename InputDataNodeType::PolygonType InputPolygonType;
74  typedef typename InputDataNodeType::PolygonListType InputPolygonListType;
75 
76  typedef typename InputLineType::Pointer InputLinePointerType;
77  typedef typename InputPolygonType::Pointer InputPolygonPointerType;
78  typedef typename InputPolygonListType::Pointer InputPolygonListPointerType;
79 
80  typedef typename OutputDataNodeType::PointType OutputPointType;
81  typedef typename OutputDataNodeType::LineType OutputLineType;
82  typedef typename OutputDataNodeType::PolygonType OutputPolygonType;
83  typedef typename OutputDataNodeType::PolygonListType OutputPolygonListType;
84 
85  typedef typename OutputLineType::Pointer OutputLinePointerType;
86  typedef typename OutputPolygonType::Pointer OutputPolygonPointerType;
87  typedef typename OutputPolygonListType::Pointer OutputPolygonListPointerType;
88 
89  typedef itk::DataObject::Pointer DataObjectPointer;
90 
91  using Superclass::SetInput;
92  virtual void SetInput(const InputVectorDataType* input);
93  InputVectorDataType* GetInput(void);
94 
95 protected:
98 
101  {
102  }
103 
104  virtual OutputPointType ProcessPoint(InputPointType itkNotUsed(point)) const
105  {
106  itkExceptionMacro(<< "Subclass should reimplement this method");
107  }
109  {
110  itkExceptionMacro(<< "Subclass should reimplement this method");
111  }
113  {
114  itkExceptionMacro(<< "Subclass should reimplement this method");
115  }
117  {
118  itkExceptionMacro(<< "Subclass should reimplement this method");
119  }
120 
121  void GenerateOutputInformation(void) override;
122  void GenerateData(void) override;
123 
125  virtual void ProcessNode(InputVectorDataPointer inputVdata,InputDataNodePointerType source, OutputVectorDataPointer outputVdata, OutputDataNodePointerType destination) const;
126 
128  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
129 
130 private:
132  void operator=(const Self&) = delete;
133 };
134 
135 } // end namespace otb
136 
137 #ifndef OTB_MANUAL_INSTANTIATION
139 #endif
140 
141 #endif
Filter hierarchy for generating VectorData.
Base class for filters that take an VectorData as input and produce an VectorData as output.
OutputVectorDataType::TreeNodeType OutputInternalTreeNodeType
InputVectorDataType::DataNodeType InputDataNodeType
TInputVectorData::ConstPointer InputVectorDataPointer
OutputDataNodeType::PolygonType OutputPolygonType
VectorDataToVectorDataFilter(const Self &)=delete
virtual OutputLinePointerType ProcessLine(InputLinePointerType) const
VectorDataSource< TOutputVectorData > Superclass
itk::SmartPointer< const Self > ConstPointer
OutputDataNodeType::PolygonListType OutputPolygonListType
InputPolygonListType::Pointer InputPolygonListPointerType
OutputPolygonListType::Pointer OutputPolygonListPointerType
virtual OutputPointType ProcessPoint(InputPointType) const
InputDataNodeType::PolygonListType InputPolygonListType
InputVectorDataType::TreeNodeType InputInternalTreeNodeType
virtual OutputPolygonListPointerType ProcessPolygonList(InputPolygonListPointerType) const
InputDataNodeType::PolygonType InputPolygonType
virtual OutputPolygonPointerType ProcessPolygon(InputPolygonPointerType) const
void operator=(const Self &)=delete
OutputVectorDataType::DataNodeType OutputDataNodeType
itk::SmartPointer< OutputDataNodeType > OutputDataNodePointerType
itk::SmartPointer< InputDataNodeType > InputDataNodePointerType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.