IGSTK
/tmp/buildd/igstk-4.4.0/Source/igstkSpatialObject.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Image Guided Surgery Software Toolkit
00004   Module:    $RCSfile: igstkSpatialObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-01-30 18:24:31 $
00007   Version:   $Revision: 1.23 $
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 __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: // this "public: is necessary because the 
00066         // Macro above introduces a private section.
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 } // end namespace igstk
00146 
00147 #endif // __igstkSpatialObject_h