IGSTK

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

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Image Guided Surgery Software Toolkit
00004   Module:    $RCSfile: igstkToolProjectionObjectRepresentation.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-06-15 21:05:54 $
00007   Version:   $Revision: 1.2 $
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 __igstkToolProjectionObjectRepresentation_h
00019 #define __igstkToolProjectionObjectRepresentation_h
00020 
00021 #include "igstkMacros.h"
00022 #include "igstkObjectRepresentation.h"
00023 #include "igstkToolProjectionSpatialObject.h"
00024 #include "igstkReslicerPlaneSpatialObject.h"
00025 #include "igstkStateMachine.h"
00026 
00027 class vtkLineSource;
00028 class vtkProperty;
00029 
00030 namespace igstk
00031 {
00032 
00045 class ToolProjectionObjectRepresentation : public ObjectRepresentation
00046 {
00047 
00048 public:
00049 
00051   igstkStandardClassTraitsMacro( ToolProjectionObjectRepresentation, 
00052                                  ObjectRepresentation )
00053 
00054 public:
00055 
00058   typedef ReslicerPlaneSpatialObject                   ReslicerPlaneType;
00059 
00060   typedef ReslicerPlaneType::Pointer            ReslicerPlanePointerType;  
00061 
00062   typedef ReslicerPlaneType::VectorType                       VectorType;
00063 
00064   typedef ToolProjectionSpatialObject    ToolProjectionSpatialObjectType;
00065 
00067   void RequestSetReslicePlaneSpatialObject( const ReslicerPlaneType *
00068                                                             planeSpatialObject);
00069 
00071   Pointer Copy() const;
00072 
00074   void RequestSetToolProjectionObject( const ToolProjectionSpatialObjectType * 
00075                                                          toolProjectionObject );
00076 
00077   virtual void SetVisibility ( bool visible);
00078 
00080   void SetLineWidth(double LineWidth);
00081   igstkGetMacro( LineWidth, double );
00082 
00083 protected:
00084 
00085   ToolProjectionObjectRepresentation( void );
00086   virtual ~ToolProjectionObjectRepresentation( void );
00087 
00089   virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const; 
00090 
00092   void CreateActors();
00093 
00096   virtual bool VerifyTimeStamp() const;
00097 
00098 private:
00099 
00100   ToolProjectionObjectRepresentation(const Self&); //purposely not implemented
00101   void operator=(const Self&);     //purposely not implemented
00102 
00103   
00105   ToolProjectionSpatialObjectType::ConstPointer   m_ToolProjectionSpatialObject;
00106 
00108   virtual void UpdateRepresentationProcessing();
00109 
00112   void SetToolProjectionObjectProcessing();
00113 
00116   void NoProcessing();
00117 
00119   void SetReslicePlaneSpatialObjectProcessing();
00120 
00122   igstkObserverMacro( ImageBounds, igstk::ImageBoundsEvent, 
00123                                   igstk::EventHelperType::ImageBoundsType );
00124 
00127   igstkObserverMacro( ReslicerPlaneNormal, 
00128                                     ReslicerPlaneType::ReslicerPlaneNormalEvent,
00129                                                  ReslicerPlaneType::VectorType);
00130 
00131   ReslicerPlaneNormalObserver::Pointer  m_ReslicerPlaneNormalObserver;
00132 
00133 private:
00134 
00136   ReslicerPlanePointerType  m_ReslicePlaneSpatialObjectToBeSet;
00137   ReslicerPlanePointerType  m_ReslicePlaneSpatialObject;
00138 
00139   vtkLineSource* m_LineSource;  
00140   vtkProperty*   m_LineProperty;
00141 
00142   double m_LineWidth;
00143 
00145   igstkDeclareInputMacro( ValidToolProjectionObject );
00146   igstkDeclareInputMacro( NullToolProjectionObject );
00147   igstkDeclareInputMacro( ValidReslicePlaneSpatialObject );
00148   igstkDeclareInputMacro( InValidReslicePlaneSpatialObject );
00149   
00151   igstkDeclareStateMacro( NullToolProjectionObject );
00152   igstkDeclareStateMacro( ValidToolProjectionObject );
00153   igstkDeclareStateMacro( ValidReslicePlaneSpatialObject );
00154 
00155   ToolProjectionSpatialObjectType::ConstPointer m_ToolProjectionObjectToAdd;
00156 
00157 };
00158 
00159 } // end namespace igstk
00160 
00161 #endif // __igstkToolProjectionObjectRepresentation_h