OTB  9.0.0
Orfeo Toolbox
otbVectorDataProperties.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 
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 
58  typedef typename VectorDataType::DataTreeType::TreeNodeType InternalTreeNodeType;
59  typedef typename InternalTreeNodeType::ChildrenListType ChildrenListType;
60 
61  typedef typename PolygonType::RegionType RegionType;
62  typedef typename RegionType::Pointer RegionPointerType;
63  typedef typename RegionType::IndexType IndexType;
64  typedef typename RegionType::SizeType SizeType;
65  typedef typename RegionType::Type Type;
67  itkNewMacro(Self);
68 
70  itkTypeMacro(VectorDataProperties, LightObject);
71 
73  itkStaticConstMacro(VectorDataDimension, unsigned int, TVectorData::Dimension);
74 
76  // itkGetObjectMacro(VectorDataObject, VectorDataType);
78  {
79  m_VectorDataObject = const_cast<VectorDataType*>(v);
80  }
81  //
83  {
84  return m_BoundingRegion;
85  }
87  {
88  m_BoundingRegion = region;
89  }
91 
92  void AddRegion(const RegionType& region);
93  void ComputeBoundingRegion();
94 
95 protected:
97  VectorDataProperties() : m_VectorDataObject(nullptr){};
98 
101  {
102  }
103 
105  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
106 
107  void ProcessNode(InternalTreeNodeType* source);
108  bool IsBoundingRegionNull();
109 
110 private:
111  VectorDataProperties(const Self&) = delete;
112  void operator=(const Self&) = delete;
113 
114  // Pointer to the VectorData
117 
118 }; // end class
119 } // end namespace otb
120 
121 #ifndef OTB_MANUAL_INSTANTIATION
123 #endif
124 
125 #endif
otb::VectorDataProperties::PolygonType
DataNodeType::PolygonType PolygonType
Definition: otbVectorDataProperties.h:56
otb::VectorDataProperties::ChildrenListType
InternalTreeNodeType::ChildrenListType ChildrenListType
Definition: otbVectorDataProperties.h:59
otb::VectorDataProperties::VectorDataProperties
VectorDataProperties()
Definition: otbVectorDataProperties.h:97
otb::VectorDataProperties::m_BoundingRegion
RegionType m_BoundingRegion
Definition: otbVectorDataProperties.h:116
otb::VectorDataProperties::RegionType
PolygonType::RegionType RegionType
Definition: otbVectorDataProperties.h:61
otb::VectorDataProperties::SetBoundingRegion
void SetBoundingRegion(RegionType &region)
Definition: otbVectorDataProperties.h:86
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::VectorDataProperties::SizeType
RegionType::SizeType SizeType
Definition: otbVectorDataProperties.h:64
otb::VectorDataProperties::IndexType
RegionType::IndexType IndexType
Definition: otbVectorDataProperties.h:63
otb::VectorDataProperties::m_VectorDataObject
VectorDataType * m_VectorDataObject
Definition: otbVectorDataProperties.h:115
otb::VectorDataProperties::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbVectorDataProperties.h:48
otb::VectorDataProperties::Self
VectorDataProperties Self
Definition: otbVectorDataProperties.h:45
otb::VectorDataProperties::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbVectorDataProperties.h:47
otb::VectorDataProperties::InternalTreeNodeType
VectorDataType::DataTreeType::TreeNodeType InternalTreeNodeType
Definition: otbVectorDataProperties.h:58
otb::VectorDataProperties::SetVectorDataObject
void SetVectorDataObject(const VectorDataType *v)
Definition: otbVectorDataProperties.h:77
otbVectorData.h
otb::VectorDataProperties::VectorDataPointerType
VectorDataType::Pointer VectorDataPointerType
Definition: otbVectorDataProperties.h:52
otb::VectorDataProperties::InputVectorDataConstPointer
VectorDataType::ConstPointer InputVectorDataConstPointer
Definition: otbVectorDataProperties.h:53
otb::VectorDataProperties
Compute public properties of the vectordata.
Definition: otbVectorDataProperties.h:41
otb::VectorDataProperties::RegionPointerType
RegionType::Pointer RegionPointerType
Definition: otbVectorDataProperties.h:62
otb::VectorDataProperties::DataNodeType
VectorDataType::DataNodeType DataNodeType
Definition: otbVectorDataProperties.h:54
otb::VectorDataProperties::Superclass
itk::LightObject Superclass
Definition: otbVectorDataProperties.h:46
otbVectorDataProperties.hxx
otb::VectorDataProperties::DataNodePointerType
DataNodeType::Pointer DataNodePointerType
Definition: otbVectorDataProperties.h:55
otb::VectorDataProperties::VectorDataType
TVectorData VectorDataType
Definition: otbVectorDataProperties.h:51
otb::VectorDataProperties::~VectorDataProperties
~VectorDataProperties() override
Definition: otbVectorDataProperties.h:100
otb::VectorDataProperties::Type
RegionType::Type Type
Definition: otbVectorDataProperties.h:65
otb::VectorDataProperties::GetBoundingRegion
RegionType GetBoundingRegion()
Definition: otbVectorDataProperties.h:82