IGSTK
igstkMeshResliceObjectRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkMeshResliceObjectRepresentation.h,v $
5  Language: C++
6  Date: $Date: 2009-06-15 20:35:50 $
7  Version: $Revision: 1.2 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkMeshResliceObjectRepresentation_h
19 #define __igstkMeshResliceObjectRepresentation_h
20 
21 #include "igstkMacros.h"
22 #include "igstkTransform.h"
23 #include "igstkMeshObject.h"
24 #include "igstkStateMachine.h"
27 
28 class vtkPlane;
29 class vtkCutter;
30 class vtkProperty;
31 
32 namespace igstk
33 {
34 
44 : public ObjectRepresentation
45 {
46 
47 public:
48 
52 
53 public:
54 
57  typedef MeshObject MeshObjectType;
58 
59  typedef MeshObjectType::PointType PointType;
60 
62  typedef ReslicerPlaneType::Pointer ReslicerPlanePointerType;
63 
64  typedef ReslicerPlaneType::VectorType VectorType;
65 
67  Pointer Copy() const;
68 
70  void RequestSetMeshObject( const MeshObjectType * MeshObject );
71 
73  void SetVisibility(bool visibility);
74 
76  void RequestSetReslicePlaneSpatialObject( const ReslicerPlaneType *
77  planeSpatialObject);
79  void SetLineWidth(double LineWidth);
80  igstkGetMacro( LineWidth, double );
81 
82  // void RequestSetResliceAxes( vtkMatrix4x4 *matrix );
83 
84 protected:
85 
87  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
88 
91 
94 
96  void CreateActors();
97 
100  virtual bool VerifyTimeStamp() const;
101 
102 private:
103 
107  igstkObserverMacro( ReslicerPlaneCenter,
108  ReslicerPlaneType::ReslicerPlaneCenterEvent,
109  ReslicerPlaneType::VectorType);
110 
111  ReslicerPlaneCenterObserver::Pointer m_ReslicerPlaneCenterObserver;
112 
113  igstkObserverMacro( ReslicerPlaneNormal,
114  ReslicerPlaneType::ReslicerPlaneNormalEvent,
115  ReslicerPlaneType::VectorType);
116 
117  ReslicerPlaneNormalObserver::Pointer m_ReslicerPlaneNormalObserver;
118 
120  virtual void UpdateRepresentationProcessing();
121 
124  void SetMeshObjectProcessing();
125 
127  void NoProcessing();
128 
130  void SetReslicePlaneSpatialObjectProcessing();
131 
132 private:
133 
135  igstkDeclareInputMacro( ValidMeshObject );
136  igstkDeclareInputMacro( NullMeshObject );
137  igstkDeclareInputMacro( ValidReslicePlaneSpatialObject );
138  igstkDeclareInputMacro( InValidReslicePlaneSpatialObject );
139 
140  igstkDeclareInputMacro( EmptyImageSpatialObject );
141  // igstkDeclareInputMacro( Reslice );
142 
144  igstkDeclareStateMacro( NullMeshObject );
145  igstkDeclareStateMacro( ValidMeshObject );
146  igstkDeclareStateMacro( ValidReslicePlaneSpatialObject );
147 
149  MeshObjectType::ConstPointer m_MeshObject;
150  MeshObjectType::ConstPointer m_MeshObjectToBeSet;
151 
153  ReslicerPlanePointerType m_ReslicePlaneSpatialObjectToBeSet;
154  ReslicerPlanePointerType m_ReslicePlaneSpatialObject;
155 
157  vtkPlane* m_Plane;
158  vtkCutter* m_Cutter;
159  vtkProperty* m_ContourProperty;
160 
161  //vtkTubeFilter* m_Tuber;
162  double m_LineWidth;
163 };
164 
165 } // end namespace igstk
166 
167 #endif // __igstkMeshResliceObjectRepresentation_h