IGSTK
|
00001 /*========================================================================= 00002 00003 Program: Image Guided Surgery Software Toolkit 00004 Module: $RCSfile: igstkGroupObject.h,v $ 00005 Language: C++ 00006 Date: $Date: 2008-02-11 01:41:50 $ 00007 Version: $Revision: 1.7 $ 00008 00009 Copyright (c) ISC Insight Software Consortium. All rights reserved. 00010 See IGSTKCopyright.txt or http://www.igstk.org/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 __igstkGroupObject_h 00019 #define __igstkGroupObject_h 00020 00021 #include "igstkMacros.h" 00022 #include "igstkSpatialObject.h" 00023 #include "itkGroupSpatialObject.h" 00024 00025 namespace igstk 00026 { 00027 00039 class GroupObject 00040 : public SpatialObject 00041 { 00042 00043 public: 00044 00046 igstkStandardClassTraitsMacro( GroupObject, SpatialObject ) 00047 00048 public: 00049 00051 typedef itk::GroupSpatialObject<3> GroupSpatialObjectType; 00052 00054 unsigned long GetNumberOfChildren() const; 00055 00059 void RequestAddChild( const Transform & transform, SpatialObject * child ); 00060 00062 void RequestGetChild( unsigned long childId ); 00063 00064 protected: 00065 00067 GroupObject( void ); 00068 00070 ~GroupObject( void ); 00071 00073 virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const; 00074 00075 private: 00076 00078 GroupSpatialObjectType::Pointer m_GroupSpatialObject; 00079 00080 typedef std::vector< SpatialObject::Pointer > ChildrenContainerType; 00081 00082 ChildrenContainerType m_ChildrenArray; 00083 00085 igstkDeclareInputMacro( AddChildValid ); 00086 igstkDeclareInputMacro( AddChildInvalid ); 00087 igstkDeclareInputMacro( GetChildValid ); 00088 igstkDeclareInputMacro( GetChildInvalid ); 00089 00091 igstkDeclareStateMacro( EmptyGroup ); 00092 igstkDeclareStateMacro( NonEmptyGroup ); 00093 00095 void AddChildProcessing(); 00096 void GetChildProcessing(); 00097 void ReportNoChildAvailableProcessing(); 00098 00100 void NoProcessing(); 00101 00103 void ReportInvalidRequestProcessing(); 00104 00105 SpatialObject * m_ChildToAdd; 00106 Transform m_TransformToAdd; 00107 unsigned long m_ChildIdToGet; 00108 }; 00109 00110 } // end namespace igstk 00111 00112 #endif // __igstkGroupObject_h