OTB  6.7.0
Orfeo Toolbox
otbVectorDataProperties.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 
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:
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,
74  TVectorData::Dimension);
75 
77 // itkGetObjectMacro(VectorDataObject, VectorDataType);
78  void SetVectorDataObject(const VectorDataType * v) {m_VectorDataObject = const_cast <VectorDataType *>(v); }
79 //
80  RegionType GetBoundingRegion() {return m_BoundingRegion; }
81  void SetBoundingRegion(RegionType& region) {m_BoundingRegion = region; }
83 
84  void AddRegion(const RegionType& region);
85  void ComputeBoundingRegion();
86 protected:
88  VectorDataProperties() : m_VectorDataObject(nullptr) {};
89 
91  ~VectorDataProperties() override {}
92 
94  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
95 
96  void ProcessNode(InternalTreeNodeType * source);
97  bool IsBoundingRegionNull();
98 private:
99  VectorDataProperties(const Self &) = delete;
100  void operator =(const Self&) = delete;
101 
102  //Pointer to the VectorData
105 
106 }; // end class
107 } // end namespace otb
108 
109 #ifndef OTB_MANUAL_INSTANTIATION
111 #endif
112 
113 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
void SetBoundingRegion(RegionType &region)
Compute public properties of the vectordata.
VectorDataType::ConstPointer InputVectorDataConstPointer
itk::SmartPointer< Self > Pointer
VectorDataType::DataNodeType DataNodeType
InternalTreeNodeType::ChildrenListType ChildrenListType
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
RegionType::Pointer RegionPointerType
VectorDataType::DataTreeType::TreeNodeType InternalTreeNodeType
void SetVectorDataObject(const VectorDataType *v)
VectorDataType::Pointer VectorDataPointerType
DataNodeType::PolygonType PolygonType
RegionType::IndexType IndexType
PolygonType::RegionType RegionType
itk::SmartPointer< const Self > ConstPointer
DataNodeType::Pointer DataNodePointerType