17 #ifndef __itkSpatialObjectTreeNode_h
18 #define __itkSpatialObjectTreeNode_h
27 template <
unsigned int TDimension>
class SpatialObject;
32 template <
unsigned int TDimension>
61 itkGetConstReferenceObjectMacro(NodeToParentNodeTransform,
TransformType);
65 itkGetConstReferenceObjectMacro(NodeToWorldTransform,
TransformType);
68 void ComputeNodeToWorldTransform();
71 #if !defined(CABLE_CONFIGURATION)
73 char * name=
NULL)
const;
81 void PrintSelf(std::ostream &os,
Indent indent)
const
83 this->Superclass::PrintSelf(os, indent);
84 os << indent <<
"NodeToParentNodeTransform: "
85 << m_NodeToParentNodeTransform << std::endl;
86 os << indent <<
"NodeToWorldTransform: "
87 << m_NodeToWorldTransform << std::endl;
96 void operator=(
const Self&);
101 template <
unsigned int TDimension>
105 m_NodeToParentNodeTransform = TransformType::New();
106 m_NodeToParentNodeTransform->SetIdentity();
107 m_NodeToWorldTransform = TransformType::New();
108 m_NodeToWorldTransform->SetIdentity();
109 this->m_Parent =
NULL;
114 template <
unsigned int TDimension>
119 Superclass::Set(data);
124 template <
unsigned int TDimension>
128 m_NodeToWorldTransform->SetMatrix(m_NodeToParentNodeTransform->GetMatrix());
129 m_NodeToWorldTransform->SetOffset(m_NodeToParentNodeTransform->GetOffset());
130 if(this->HasParent())
132 static_cast<Self*
>(this->GetParent())->ComputeNodeToWorldTransform();
133 m_NodeToWorldTransform->Compose( static_cast<Self*>(this->GetParent())
134 ->GetNodeToWorldTransform(),
false);
140 #if !defined(CABLE_CONFIGURATION)
141 template <
unsigned int TDimension>
148 typename ChildrenListType::const_iterator childrenListIt =
149 this->m_Children.begin();
150 typename ChildrenListType::const_iterator childrenListEnd =
151 this->m_Children.end();
153 while( childrenListIt != childrenListEnd )
155 if( name ==
NULL || strstr(
typeid(*((*childrenListIt)->Get())).name(),
158 children->push_back(*childrenListIt);
163 (**childrenListIt).GetChildren(depth-1, name);
165 typename ChildrenListType::const_iterator nextIt = nextchildren->begin();
166 while(nextIt != nextchildren->end())
168 children->push_back(*nextIt);