OTB  6.7.0
Orfeo Toolbox
otbVectorDataToVectorDataFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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:
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 
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 
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 
88 
89  using Superclass::SetInput;
90  virtual void SetInput(const InputVectorDataType *input);
91  const InputVectorDataType * GetInput(void);
92 
93 protected:
96 
99 
100  virtual OutputPointType ProcessPoint(InputPointType itkNotUsed(point)) const
101  {
102  itkExceptionMacro( << "Subclass should reimplement this method");
103  }
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  }
116 
117  void GenerateOutputInformation(void) override;
118  void GenerateData(void) override;
119 
121  virtual void ProcessNode(InputInternalTreeNodeType * source, OutputInternalTreeNodeType * destination) const;
122 
124  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
125 
126 private:
127  VectorDataToVectorDataFilter(const Self &) = delete;
128  void operator =(const Self&) = delete;
129 
130 };
131 
132 } // end namespace otb
133 
134 #ifndef OTB_MANUAL_INSTANTIATION
136 #endif
137 
138 #endif
itk::SmartPointer< const Self > ConstPointer
virtual OutputPolygonPointerType ProcessPolygon(InputPolygonPointerType) const
virtual OutputLinePointerType ProcessLine(InputLinePointerType) const
InputDataNodeType::PolygonType InputPolygonType
Filter hierarchy for generating VectorData.
virtual OutputPolygonListPointerType ProcessPolygonList(InputPolygonListPointerType) const
virtual OutputPointType ProcessPoint(InputPointType) const
OutputVectorDataType::DataTreeType::TreeNodeType OutputInternalTreeNodeType
OutputDataNodeType::PolygonType OutputPolygonType
InputVectorDataType::DataTreeType::TreeNodeType InputInternalTreeNodeType
OutputDataNodeType::PolygonListType OutputPolygonListType
OutputPolygonListType::Pointer OutputPolygonListPointerType
InputPolygonListType::Pointer InputPolygonListPointerType
Base class for filters that take an VectorData as input and produce an VectorData as output...
VectorDataSource< TOutputVectorData > Superclass
TInputVectorData::ConstPointer InputVectorDataPointer
VectorImageType::PointType PointType
Definition: mvdTypes.h:189
InputVectorDataType::DataNodeType InputDataNodeType
OutputVectorDataType::DataNodeType OutputDataNodeType
InputDataNodeType::PolygonListType InputPolygonListType