IGSTK
igstkSpatialObject.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkSpatialObject.h,v $
5  Language: C++
6  Date: $Date: 2009-01-30 18:24:31 $
7  Version: $Revision: 1.23 $
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 __igstkSpatialObject_h
19 #define __igstkSpatialObject_h
20 
21 #include "igstkLogger.h"
22 #include "itkSpatialObject.h"
23 
24 #include "igstkMacros.h"
25 #include "igstkObject.h"
26 #include "igstkStateMachine.h"
27 #include "igstkEvents.h"
28 
30 
31 namespace igstk
32 {
33 
34 
57 class SpatialObject : public Object
58 {
59 
60 public:
61 
64 
65 public: // this "public: is necessary because the
66  // Macro above introduces a private section.
67 
68 
70  typedef itk::SpatialObject<3> SpatialObjectType;
71 
72  typedef SpatialObjectType::BoundingBoxType BoundingBoxType;
73 
74  igstkLoadedObjectEventMacro( BoundingBoxEvent, IGSTKEvent,
75  BoundingBoxType );
76 
77  void RequestGetBounds();
78  void RequestGetBounds() const;
79 
80 protected:
81 
86  SpatialObject( void );
87 
90  ~SpatialObject( void );
91 
94  void RequestSetInternalSpatialObject( SpatialObjectType * object );
95 
97  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
98 
101  SpatialObjectType * GetInternalSpatialObject() const;
102 
103 private:
104 
106  SpatialObjectType::Pointer m_SpatialObject;
107  SpatialObjectType::Pointer m_SpatialObjectToBeSet;
108 
109  void ReportBoundsProcessing();
110  void ReportBoundsNotAvailableProcessing();
111 
113  igstkDeclareInputMacro( InternalSpatialObjectNull );
114  igstkDeclareInputMacro( InternalSpatialObjectValid );
115  igstkDeclareInputMacro( RequestBounds );
116 
118  igstkDeclareStateMacro( Initial );
119  igstkDeclareStateMacro( Ready );
120 
122  void SetInternalSpatialObjectProcessing();
123 
126  void ReportSpatialObjectNullProcessing();
127 
130  igstkCoordinateSystemClassInterfaceMacro();
131 
132 };
133 
137  SpatialObjectModifiedEvent, IGSTKEvent, SpatialObject );
138 
143 igstkEventMacro( SpatialObjectNotAvailableEvent, IGSTKErrorEvent );
144 
145 } // end namespace igstk
146 
147 #endif // __igstkSpatialObject_h
Geometrical abstraction of physical objects present in the surgical scene.
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
Print the object information in a stream.
Base class for all the IGSTK classes.
Definition: igstkObject.h:40
void RequestSetInternalSpatialObject(SpatialObjectType *object)
Replacement for RequestSetSpatialObject().
igstkEventMacro(AuroraTrackerToolEvent, StringEvent)
#define igstkStandardClassTraitsMacro(classname, superclassname)
Convenience macro for traits of a non-templated class.
Definition: igstkMacros.h:275
defines standard system-wide macros, constants, and other common parameters in the IGSTK Library...
::itk::SmartPointer< Self > Pointer
Definition: igstkObject.h:50
igstkLoadedObjectEventMacro(BoundingBoxEvent, IGSTKEvent, BoundingBoxType)
igstkStandardClassTraitsMacro(SpatialObject, Object) public typedef SpatialObjectType::BoundingBoxType BoundingBoxType
Macro with standard traits declarations.
SpatialObjectType * GetInternalSpatialObject() const
Returns the ITK spatial object that is contained inside this IGSTK spatial object.