ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkSpatialObjectTreeNode.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkSpatialObjectTreeNode_h
00019 #define __itkSpatialObjectTreeNode_h
00020 
00021 #include "itkTreeNode.h"
00022 #include "itkSpatialObject.h"
00023 
00024 namespace itk
00025 {
00026 template< unsigned int TDimension >
00027 class SpatialObject;
00028 
00033 template< unsigned int TDimension >
00034 class ITK_EXPORT SpatialObjectTreeNode:public TreeNode< SpatialObject< TDimension > * >
00035 {
00036 public:
00037 
00039   typedef SpatialObject< TDimension >                   SpatialObjectType;
00040   typedef TreeNode< SpatialObject< TDimension > * >     Superclass;
00041   typedef SpatialObjectTreeNode< TDimension >           Self;
00042   typedef SmartPointer< Self >                          Pointer;
00043   typedef SmartPointer< const Self >                    ConstPointer;
00044   typedef ScalableAffineTransform< double, TDimension > TransformType;
00045   typedef typename TransformType::Pointer               TransformPointer;
00046   typedef const TransformType *                         TransformConstPointer;
00047   typedef typename Superclass::ChildrenListType         ChildrenListType;
00048 
00050   itkNewMacro(Self);
00051 
00053   itkTypeMacro(SpatialObjectTreeNode, TreeNode);
00054 
00056   virtual void SetData(SpatialObjectType *data);
00057 
00059   itkSetObjectMacro(NodeToParentNodeTransform, TransformType);
00060   itkGetConstReferenceObjectMacro(NodeToParentNodeTransform, TransformType);
00062 
00064   itkSetObjectMacro(NodeToWorldTransform, TransformType);
00065   itkGetConstReferenceObjectMacro(NodeToWorldTransform, TransformType);
00067 
00069   void ComputeNodeToWorldTransform();
00070 
00072 #if !defined( CABLE_CONFIGURATION )
00073   virtual ChildrenListType * GetChildren(unsigned int depth = 0,
00074                                          char *name = NULL) const;
00075 
00076 #endif
00077 protected:
00078 
00080   SpatialObjectTreeNode();
00081   virtual ~SpatialObjectTreeNode(){}
00082   void PrintSelf(std::ostream & os, Indent indent) const;
00084 
00085   TransformPointer m_NodeToParentNodeTransform;
00086   TransformPointer m_NodeToWorldTransform;
00087 private:
00088 
00089   SpatialObjectTreeNode(const Self &); //purposely not implemented
00090   void operator=(const Self &);        //purposely not implemented
00091 };
00092 
00093 } // end namespace itk
00094 
00095 #ifndef ITK_MANUAL_INSTANTIATION
00096 #include "itkSpatialObjectTreeNode.hxx"
00097 #endif
00098 
00099 #endif
00100