OTB  6.7.0
Orfeo Toolbox
otbVectorDataAdapter.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 otbVectorDataAdapter_h
22 #define otbVectorDataAdapter_h
23 
25 
26 namespace otb
27 {
28 
36 template <class TInputVectorData, class TOutputVectorData>
37 class ITK_EXPORT VectorDataAdapter :
38  public otb::VectorDataToVectorDataFilter<TInputVectorData, TOutputVectorData>
39 {
40 
41 public:
47 
49  itkNewMacro(Self);
50 
53 
54  typedef TInputVectorData InputVectorDataType;
55  typedef TOutputVectorData OutputVectorDataType;
56 
57  typedef typename OutputVectorDataType::DataNodeType OutputDataNodeType;
58  typedef typename InputVectorDataType::DataNodeType InputDataNodeType;
59 
61  typedef typename InputDataNodeType::LineType InputLineType;
62  typedef typename InputDataNodeType::PolygonType InputPolygonType;
63  typedef typename InputDataNodeType::PolygonListType InputPolygonListType;
64 
65  typedef typename InputLineType::Pointer InputLinePointerType;
66  typedef typename InputPolygonType::Pointer InputPolygonPointerType;
67  typedef typename InputPolygonListType::Pointer InputPolygonListPointerType;
68 
70  typedef typename OutputDataNodeType::LineType OutputLineType;
71  typedef typename OutputDataNodeType::PolygonType OutputPolygonType;
72  typedef typename OutputDataNodeType::PolygonListType OutputPolygonListType;
73 
74  typedef typename OutputLineType::Pointer OutputLinePointerType;
75  typedef typename OutputPolygonType::Pointer OutputPolygonPointerType;
76  typedef typename OutputPolygonListType::Pointer OutputPolygonListPointerType;
77 
78 
79 protected:
81  ~VectorDataAdapter() override {}
82 
83  OutputPointType ProcessPoint(InputPointType point) const override;
84  OutputLinePointerType ProcessLine(InputLinePointerType line) const override;
85  OutputPolygonPointerType ProcessPolygon(InputPolygonPointerType polygon) const override;
86  OutputPolygonListPointerType ProcessPolygonList(InputPolygonListPointerType polygonList) const override;
87 
88 private:
89  VectorDataAdapter(const Self &) = delete;
90  void operator =(const Self&) = delete;
91 
92 };
93 
94 } // end namespace otb
95 
96 #ifndef OTB_MANUAL_INSTANTIATION
97 #include "otbVectorDataAdapter.hxx"
98 #endif
99 
100 #endif
TOutputVectorData OutputVectorDataType
InputVectorDataType::DataNodeType InputDataNodeType
InputPolygonListType::Pointer InputPolygonListPointerType
InputDataNodeType::LineType InputLineType
InputPolygonType::Pointer InputPolygonPointerType
Helper class to convert the vector data to generic type.
OutputVectorDataType::DataNodeType OutputDataNodeType
OutputDataNodeType::PolygonType OutputPolygonType
InputDataNodeType::PointType InputPointType
OutputDataNodeType::PointType OutputPointType
OutputPolygonType::Pointer OutputPolygonPointerType
OutputLineType::Pointer OutputLinePointerType
InputDataNodeType::PolygonListType InputPolygonListType
OutputPolygonListType::Pointer OutputPolygonListPointerType
OutputDataNodeType::LineType OutputLineType
itk::SmartPointer< Self > Pointer
Base class for filters that take an VectorData as input and produce an VectorData as output...
OutputDataNodeType::PolygonListType OutputPolygonListType
InputDataNodeType::PolygonType InputPolygonType
VectorImageType::PointType PointType
Definition: mvdTypes.h:189
itk::SmartPointer< const Self > ConstPointer
TInputVectorData InputVectorDataType
InputLineType::Pointer InputLinePointerType
otb::VectorDataToVectorDataFilter< TInputVectorData, TOutputVectorData > Superclass