00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSceneSpatialObject.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/11/03 23:40:51 $ 00007 Version: $Revision: 1.3 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef __SceneSpatialObject_h 00019 #define __SceneSpatialObject_h 00020 00021 #include "itkSpatialObject.h" 00022 00023 #include <list> 00024 00025 namespace itk 00026 { 00027 00037 template <unsigned int SpaceDimension = 3> 00038 class SceneSpatialObject 00039 : public Object 00040 { 00041 00042 public: 00043 00044 typedef SceneSpatialObject<SpaceDimension> Self; 00045 typedef Object Superclass; 00046 typedef Superclass::Pointer SuperclassPointer; 00047 typedef SmartPointer< Self > Pointer; 00048 typedef SmartPointer< const Self > ConstPointer; 00049 00050 typedef SpatialObject<SpaceDimension> ObjectType; 00051 typedef SpatialObject<SpaceDimension> SpatialObjectType; 00052 typedef typename SpatialObjectType::Pointer SpatialObjectPointer; 00053 00054 typedef std::list< SpatialObjectPointer > 00055 ObjectListType; 00056 00057 itkStaticConstMacro(MaximumDepth, unsigned int, 9999999); 00058 00060 itkNewMacro(Self); 00061 itkTypeMacro(Self, Superclass); 00062 00064 void AddSpatialObject( SpatialObject<SpaceDimension> * pointer ); 00065 00070 void RemoveSpatialObject( SpatialObject<SpaceDimension> * object ); 00071 00073 ObjectListType * GetObjects( unsigned int depth=MaximumDepth, 00074 char * name=NULL ); 00075 00077 unsigned int GetNumberOfObjects( unsigned int depth=MaximumDepth, 00078 char * name=NULL ); 00079 00081 void SetObjects( ObjectListType & children ); 00082 00085 unsigned long GetMTime( void ) const; 00086 00088 void SetParentId(int parentid) {m_ParentId=parentid;} 00089 int GetParentId(void) {return m_ParentId;} 00090 00092 SpatialObject<SpaceDimension> * GetObjectById(int Id); 00093 00094 bool FixHierarchy(void); 00095 00096 protected: 00097 00099 ObjectListType m_Objects; 00100 00102 SceneSpatialObject(); 00103 00105 virtual ~SceneSpatialObject(); 00106 00108 virtual void PrintSelf( std::ostream& os, Indent indent ) const; 00109 00111 int m_ParentId; 00112 00113 }; 00114 00115 } // end of namespace itk 00116 00117 00118 #ifndef ITK_MANUAL_INSTANTIATION 00119 #include "itkSceneSpatialObject.txx" 00120 #endif 00121 00122 #endif // __SceneSpatialObject_h