00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __igstkSpatialObject_h
00019 #define __igstkSpatialObject_h
00020
00021 #include "igstkLogger.h"
00022 #include "itkSpatialObject.h"
00023
00024 #include "igstkMacros.h"
00025 #include "igstkObject.h"
00026 #include "igstkStateMachine.h"
00027 #include "igstkEvents.h"
00028
00029 #include "igstkCoordinateSystemInterfaceMacros.h"
00030
00031 namespace igstk
00032 {
00033
00034
00057 class SpatialObject : public Object
00058 {
00059
00060 public:
00061
00063 igstkStandardClassTraitsMacro( SpatialObject, Object )
00064
00065 public:
00066
00067
00068
00070 typedef itk::SpatialObject<3> SpatialObjectType;
00071
00072 typedef SpatialObjectType::BoundingBoxType BoundingBoxType;
00073
00074 igstkLoadedObjectEventMacro( BoundingBoxEvent, IGSTKEvent,
00075 BoundingBoxType );
00076
00077 void RequestGetBounds();
00078 void RequestGetBounds() const;
00079
00080 protected:
00081
00086 SpatialObject( void );
00087
00090 ~SpatialObject( void );
00091
00094 void RequestSetInternalSpatialObject( SpatialObjectType * object );
00095
00097 virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
00098
00101 SpatialObjectType * GetInternalSpatialObject() const;
00102
00103 private:
00104
00106 SpatialObjectType::Pointer m_SpatialObject;
00107 SpatialObjectType::Pointer m_SpatialObjectToBeSet;
00108
00109 void ReportBoundsProcessing();
00110 void ReportBoundsNotAvailableProcessing();
00111
00113 igstkDeclareInputMacro( InternalSpatialObjectNull );
00114 igstkDeclareInputMacro( InternalSpatialObjectValid );
00115 igstkDeclareInputMacro( RequestBounds );
00116
00118 igstkDeclareStateMacro( Initial );
00119 igstkDeclareStateMacro( Ready );
00120
00122 void SetInternalSpatialObjectProcessing();
00123
00126 void ReportSpatialObjectNullProcessing();
00127
00130 igstkCoordinateSystemClassInterfaceMacro();
00131
00132 };
00133
00136 igstkLoadedObjectEventMacro(
00137 SpatialObjectModifiedEvent, IGSTKEvent, SpatialObject );
00138
00143 igstkEventMacro( SpatialObjectNotAvailableEvent, IGSTKErrorEvent );
00144
00145 }
00146
00147 #endif // __igstkSpatialObject_h