IGSTK
igstkGroupObject.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkGroupObject.h,v $
5  Language: C++
6  Date: $Date: 2008-02-11 01:41:50 $
7  Version: $Revision: 1.7 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkGroupObject_h
19 #define __igstkGroupObject_h
20 
21 #include "igstkMacros.h"
22 #include "igstkSpatialObject.h"
23 #include "itkGroupSpatialObject.h"
24 
25 namespace igstk
26 {
27 
40 : public SpatialObject
41 {
42 
43 public:
44 
47 
48 public:
49 
51  typedef itk::GroupSpatialObject<3> GroupSpatialObjectType;
52 
54  unsigned long GetNumberOfChildren() const;
55 
59  void RequestAddChild( const Transform & transform, SpatialObject * child );
60 
62  void RequestGetChild( unsigned long childId );
63 
64 protected:
65 
67  GroupObject( void );
68 
70  ~GroupObject( void );
71 
73  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
74 
75 private:
76 
78  GroupSpatialObjectType::Pointer m_GroupSpatialObject;
79 
80  typedef std::vector< SpatialObject::Pointer > ChildrenContainerType;
81 
82  ChildrenContainerType m_ChildrenArray;
83 
85  igstkDeclareInputMacro( AddChildValid );
86  igstkDeclareInputMacro( AddChildInvalid );
87  igstkDeclareInputMacro( GetChildValid );
88  igstkDeclareInputMacro( GetChildInvalid );
89 
91  igstkDeclareStateMacro( EmptyGroup );
92  igstkDeclareStateMacro( NonEmptyGroup );
93 
95  void AddChildProcessing();
96  void GetChildProcessing();
97  void ReportNoChildAvailableProcessing();
98 
100  void NoProcessing();
101 
103  void ReportInvalidRequestProcessing();
104 
105  SpatialObject * m_ChildToAdd;
106  Transform m_TransformToAdd;
107  unsigned long m_ChildIdToGet;
108 };
109 
110 } // end namespace igstk
111 
112 #endif // __igstkGroupObject_h