IGSTK
/build/buildd/igstk-4.4.0/Source/igstkMeshResliceObjectRepresentation.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Image Guided Surgery Software Toolkit
00004   Module:    $RCSfile: igstkMeshResliceObjectRepresentation.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-06-15 20:35:50 $
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 __igstkMeshResliceObjectRepresentation_h
00019 #define __igstkMeshResliceObjectRepresentation_h
00020 
00021 #include "igstkMacros.h"
00022 #include "igstkTransform.h"
00023 #include "igstkMeshObject.h"
00024 #include "igstkStateMachine.h"
00025 #include "igstkObjectRepresentation.h"
00026 #include "igstkReslicerPlaneSpatialObject.h"
00027 
00028 class vtkPlane;
00029 class vtkCutter;
00030 class vtkProperty;
00031 
00032 namespace igstk
00033 {
00034 
00043 class MeshResliceObjectRepresentation 
00044 : public ObjectRepresentation
00045 {
00046 
00047 public:
00048 
00050   igstkStandardClassTraitsMacro( MeshResliceObjectRepresentation, 
00051                                  ObjectRepresentation )
00052 
00053 public:
00054     
00057   typedef MeshObject                               MeshObjectType;
00058 
00059   typedef MeshObjectType::PointType                PointType;
00060 
00061   typedef ReslicerPlaneSpatialObject               ReslicerPlaneType;
00062   typedef ReslicerPlaneType::Pointer               ReslicerPlanePointerType;  
00063 
00064   typedef ReslicerPlaneType::VectorType            VectorType;
00065 
00067   Pointer Copy() const;
00068 
00070   void RequestSetMeshObject( const MeshObjectType * MeshObject );
00071 
00073   void SetVisibility(bool visibility);
00074 
00076   void RequestSetReslicePlaneSpatialObject( const ReslicerPlaneType *
00077                                                             planeSpatialObject);
00079   void SetLineWidth(double LineWidth);
00080   igstkGetMacro( LineWidth, double );
00081 
00082   // void RequestSetResliceAxes( vtkMatrix4x4 *matrix );
00083 
00084 protected:
00085 
00087   virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const; 
00088   
00090   MeshResliceObjectRepresentation( void );
00091 
00093   ~MeshResliceObjectRepresentation( void );
00094 
00096   void CreateActors();
00097 
00100   virtual bool VerifyTimeStamp() const;
00101 
00102 private:
00103   
00107   igstkObserverMacro( ReslicerPlaneCenter, 
00108                                     ReslicerPlaneType::ReslicerPlaneCenterEvent,
00109                                                  ReslicerPlaneType::VectorType);
00110 
00111   ReslicerPlaneCenterObserver::Pointer  m_ReslicerPlaneCenterObserver;
00112 
00113   igstkObserverMacro( ReslicerPlaneNormal, 
00114                                     ReslicerPlaneType::ReslicerPlaneNormalEvent,
00115                                                  ReslicerPlaneType::VectorType);
00116 
00117   ReslicerPlaneNormalObserver::Pointer  m_ReslicerPlaneNormalObserver;
00118 
00120   virtual void UpdateRepresentationProcessing();
00121 
00124   void SetMeshObjectProcessing(); 
00125 
00127   void NoProcessing();
00128 
00130   void SetReslicePlaneSpatialObjectProcessing();
00131 
00132 private:
00133 
00135   igstkDeclareInputMacro( ValidMeshObject );
00136   igstkDeclareInputMacro( NullMeshObject );
00137   igstkDeclareInputMacro( ValidReslicePlaneSpatialObject );
00138   igstkDeclareInputMacro( InValidReslicePlaneSpatialObject );
00139 
00140   igstkDeclareInputMacro( EmptyImageSpatialObject ); 
00141  // igstkDeclareInputMacro( Reslice );
00142 
00144   igstkDeclareStateMacro( NullMeshObject );
00145   igstkDeclareStateMacro( ValidMeshObject );
00146   igstkDeclareStateMacro( ValidReslicePlaneSpatialObject );
00147 
00149   MeshObjectType::ConstPointer   m_MeshObject;
00150   MeshObjectType::ConstPointer   m_MeshObjectToBeSet;
00151 
00153   ReslicerPlanePointerType  m_ReslicePlaneSpatialObjectToBeSet;
00154   ReslicerPlanePointerType  m_ReslicePlaneSpatialObject;
00155 
00157   vtkPlane*    m_Plane;
00158   vtkCutter*   m_Cutter;
00159   vtkProperty* m_ContourProperty;
00160 
00161   //vtkTubeFilter* m_Tuber;
00162   double       m_LineWidth;
00163 };
00164 
00165 } // end namespace igstk
00166 
00167 #endif // __igstkMeshResliceObjectRepresentation_h