OTB  10.0.0
Orfeo Toolbox
otbVectorDataProperties.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 
22 #ifndef otbVectorDataProperties_h
23 #define otbVectorDataProperties_h
24 
25 #include "itkObjectFactory.h"
26 
27 // #include "itkNumericTraits.h"
28 
29 #include "otbVectorData.h"
30 namespace otb
31 {
40 template <class TVectorData>
41 class ITK_EXPORT VectorDataProperties : public itk::DataObject
42 {
43 public:
46  typedef itk::LightObject Superclass;
47  typedef itk::SmartPointer<Self> Pointer;
48  typedef itk::SmartPointer<const Self> ConstPointer;
49 
51  typedef TVectorData VectorDataType;
52  typedef typename VectorDataType::Pointer VectorDataPointerType;
53  typedef typename VectorDataType::ConstPointer InputVectorDataConstPointer;
54  typedef typename VectorDataType::DataNodeType DataNodeType;
55  typedef typename DataNodeType::Pointer DataNodePointerType;
56  typedef typename DataNodeType::PolygonType PolygonType;
57  typedef typename VectorDataType::ChildrenListType ChildrenListType;
58 
59  typedef typename PolygonType::RegionType RegionType;
60  typedef typename RegionType::Pointer RegionPointerType;
61  typedef typename RegionType::IndexType IndexType;
62  typedef typename RegionType::SizeType SizeType;
63  typedef typename RegionType::Type Type;
65  itkNewMacro(Self);
66 
68  itkTypeMacro(VectorDataProperties, LightObject);
69 
71  itkStaticConstMacro(VectorDataDimension, unsigned int, TVectorData::Dimension);
72 
74  // itkGetObjectMacro(VectorDataObject, VectorDataType);
76  {
77  m_VectorDataObject = const_cast<VectorDataType*>(v);
78  }
79  //
81  {
82  return m_BoundingRegion;
83  }
85  {
86  m_BoundingRegion = region;
87  }
89 
90  void AddRegion(const RegionType& region);
91  void ComputeBoundingRegion();
92 
93 protected:
95  VectorDataProperties() : m_VectorDataObject(nullptr){};
96 
99  {
100  }
101 
103  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
104 
105  void ProcessNode(VectorDataType* inputVdata,DataNodePointerType source);
106  bool IsBoundingRegionNull();
107 
108 private:
109  VectorDataProperties(const Self&) = delete;
110  void operator=(const Self&) = delete;
111 
112  // Pointer to the VectorData
115 
116 }; // end class
117 } // end namespace otb
118 
119 #ifndef OTB_MANUAL_INSTANTIATION
121 #endif
122 
123 #endif
Compute public properties of the vectordata.
VectorDataType::Pointer VectorDataPointerType
void SetBoundingRegion(RegionType &region)
VectorDataType::DataNodeType DataNodeType
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
VectorDataType::ChildrenListType ChildrenListType
VectorDataProperties(const Self &)=delete
PolygonType::RegionType RegionType
VectorDataType::ConstPointer InputVectorDataConstPointer
void SetVectorDataObject(const VectorDataType *v)
RegionType::Pointer RegionPointerType
DataNodeType::PolygonType PolygonType
RegionType::IndexType IndexType
void operator=(const Self &)=delete
DataNodeType::Pointer DataNodePointerType
otb::VectorData< VectorDataCoordinatePrecisionType, 2, VectorDataValuePrecisionType > VectorDataType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.