22 #ifndef otbVectorDataProperties_hxx
23 #define otbVectorDataProperties_hxx
31 template <
class TVectorData>
34 for (
unsigned int i = 0; i < VectorDataDimension; ++i)
36 if ((m_BoundingRegion.GetOrigin(i) != itk::NumericTraits<Type>::ZeroValue()) || (m_BoundingRegion.GetSize(i) != itk::NumericTraits<Type>::ZeroValue()))
44 template <
class TVectorData>
48 if (this->IsBoundingRegionNull())
50 m_BoundingRegion = region;
55 for (
unsigned int i = 0; i < VectorDataDimension; ++i)
57 index = std::min(m_BoundingRegion.GetOrigin(i), region.GetOrigin(i));
58 m_BoundingRegion.SetSize(i, std::max(m_BoundingRegion.GetOrigin(i) + m_BoundingRegion.GetSize(i), region.GetOrigin(i) + region.GetSize(i)) - index);
59 m_BoundingRegion.SetOrigin(i, index);
67 template <
class TVectorData>
74 index.Fill(itk::NumericTraits<Type>::ZeroValue());
75 size.Fill(itk::NumericTraits<Type>::ZeroValue());
76 m_BoundingRegion.SetIndex(index);
77 m_BoundingRegion.SetSize(size);
82 ProcessNode(inputRoot);
86 template <
class TVectorData>
93 for (
typename ChildrenListType::iterator it = children.begin(); it != children.end(); ++it)
98 switch (dataNode->GetNodeType())
119 for (
unsigned int i = 0; i < VectorDataDimension; ++i)
121 start[i] = dataNode->GetPoint()[i];
125 size.Fill(itk::NumericTraits<Type>::ZeroValue());
127 region.SetSize(size);
128 region.SetIndex(start);
129 this->AddRegion(region);
134 this->AddRegion(dataNode->GetLine()->GetBoundingRegion());
140 this->AddRegion(dataNode->GetPolygonExteriorRing()->GetBoundingRegion());
145 itkExceptionMacro(<<
"This type (FEATURE_MULTIPOINT) is not handle (yet), please request for it");
150 itkExceptionMacro(<<
"This type (FEATURE_MULTILINE) is not handle (yet), please request for it");
155 itkExceptionMacro(<<
"This type (FEATURE_MULTIPOLYGON) is not handle (yet), please request for it");
160 itkExceptionMacro(<<
"This type (FEATURE_COLLECTION) is not handle (yet), please request for it");
167 template <
class TVectorData>
170 Superclass::PrintSelf(os, indent);
171 os << indent <<
"Properties VectorData: " << m_VectorDataObject << std::endl;
172 os << indent <<
"Properties Bounding Region: " << m_BoundingRegion << std::endl;