21 #ifndef otbVectorData_hxx
22 #define otbVectorData_hxx
25 #include "itkPreOrderTreeIterator.h"
31 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
34 m_DataTree = DataTreeType::New();
36 root->SetNodeId(
"Root");
37 m_DataTree->SetRoot(root);
42 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
45 itk::MetaDataDictionary& dict = this->GetMetaDataDictionary();
51 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
54 const itk::MetaDataDictionary& dict = this->GetMetaDataDictionary();
56 std::string projectionRef;
62 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
65 itkDebugMacro(
"setting Spacing to " << spacing);
66 if (this->m_Spacing != spacing)
68 this->m_Spacing = spacing;
73 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
80 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
83 itk::Vector<float, 2> sf(spacing);
89 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
96 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
99 itk::Point<float, 2> of(origin);
105 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
108 return m_DataTree->Clear();
111 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
114 return m_DataTree->Count();
117 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
120 Superclass::PrintSelf(os, indent);
123 itk::PreOrderTreeIterator<DataTreeType> it(m_DataTree);
126 while (!it.IsAtEnd())
128 itk::PreOrderTreeIterator<DataTreeType> itParent = it;
130 while (itParent.HasParent() && goesOn)
133 goesOn = itParent.GoToParent();
135 os <<
"+" << it.Get()->GetNodeTypeAsString() << std::endl;
140 template <
class TPrecision,
unsigned int VDimension,
class TValuePrecision>
144 Superclass::Graft(data);
153 vdData =
dynamic_cast<const Self*
>(data);
172 itkExceptionMacro(<<
"otb::VectorData::Graft() cannot cast " <<
typeid(data).name() <<
" to " <<
typeid(
const Self*).name());