IGSTK

/build/buildd/igstk-4.2.0/Source/igstkCrossHairObjectRepresentation.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Image Guided Surgery Software Toolkit
00004   Module:    $RCSfile: igstkCrossHairObjectRepresentation.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-02 21:00:06 $
00007   Version:   $Revision: 1.3 $
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 __igstkCrossHairObjectRepresentation_h
00019 #define __igstkCrossHairObjectRepresentation_h
00020 
00021 #include "igstkMacros.h"
00022 #include "igstkObjectRepresentation.h"
00023 #include "igstkCrossHairSpatialObject.h"
00024 #include "igstkStateMachine.h"
00025 
00026 class vtkLineSource;
00027 class vtkProperty;
00028 
00029 namespace igstk
00030 {
00031 
00045 class CrossHairObjectRepresentation : public ObjectRepresentation
00046 {
00047 
00048 public:
00049 
00051   igstkStandardClassTraitsMacro( CrossHairObjectRepresentation, 
00052                                  ObjectRepresentation )
00053 
00054 public:
00055 
00057   typedef CrossHairSpatialObject                      CrossHairType;
00058   typedef CrossHairType::Pointer                      CrossHairPointerType;
00059   typedef CrossHairType::PointType                    PointType;
00060 
00062   Pointer Copy() const;
00063 
00065   void RequestSetCrossHairObject( const CrossHairType * crossHairObject );
00066 
00067   virtual void SetVisibility ( bool visible);
00068 
00070   void SetLineWidth(double LineWidth);
00071   igstkGetMacro( LineWidth, double );
00072 
00073 protected:
00074 
00075   CrossHairObjectRepresentation( void );
00076   virtual ~CrossHairObjectRepresentation( void );
00077 
00079   virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const; 
00080 
00082   void CreateActors();
00083 
00086   virtual bool VerifyTimeStamp() const;
00087 
00088 private:
00089 
00090   CrossHairObjectRepresentation(const Self&); //purposely not implemented
00091   void operator=(const Self&);     //purposely not implemented  
00092 
00094   virtual void UpdateRepresentationProcessing();
00095 
00098   void SetCrossHairObjectProcessing();
00099 
00102   void NoProcessing();
00103 
00105   igstkObserverMacro( CrossHairPosition, PointEvent,
00106                                     igstk::EventHelperType::PointType );
00107 
00108   CrossHairPositionObserver::Pointer  m_CrossHairPositionObserver;
00109 
00110 private:
00111 
00112   double                            m_ImageBounds[6];
00113 
00114   vtkLineSource* m_LineSourceX;
00115   vtkLineSource* m_LineSourceY;
00116   vtkLineSource* m_LineSourceZ;
00117 
00118   vtkProperty* m_LineProperty;
00119 
00120   double m_LineWidth;
00121 
00123   igstkDeclareInputMacro( ValidCrossHairObject );
00124   igstkDeclareInputMacro( NullCrossHairObject );
00125   
00127   igstkDeclareStateMacro( NullCrossHairObject );
00128   igstkDeclareStateMacro( ValidCrossHairObject );
00129   igstkDeclareStateMacro( ValidReslicePlaneSpatialObject );
00130 
00131   CrossHairPointerType    m_CrossHairSpatialObjectToAdd;
00132   CrossHairPointerType    m_CrossHairSpatialObject;
00133 
00134   bool                    m_Visibility;
00135 
00136 };
00137 
00138 } // end namespace igstk
00139 
00140 #endif // __igstkCrossHairObjectRepresentation_h