1
/*=========================================================================
3
Program: Image Guided Surgery Software Toolkit
4
Module: $RCSfile: igstkToolProjectionObjectRepresentation.h,v $
6
Date: $Date: 2009-06-15 21:05:54 $
7
Version: $Revision: 1.2 $
9
Copyright (c) ISC Insight Software Consortium. All rights reserved.
10
See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
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.
16
=========================================================================*/
18
#ifndef __igstkToolProjectionObjectRepresentation_h
19
#define __igstkToolProjectionObjectRepresentation_h
21
#include "igstkMacros.h"
22
#include "igstkObjectRepresentation.h"
23
#include "igstkToolProjectionSpatialObject.h"
24
#include "igstkReslicerPlaneSpatialObject.h"
25
#include "igstkStateMachine.h"
33
/** \class ToolProjectionObjectRepresentation
35
* \brief This class provides a visual representation of a ToolProjectionObject.
37
* This class displays the projection of a tool spatial object on top of a
40
* \sa ToolProjectionObject
42
* \ingroup ObjectRepresentation
45
class ToolProjectionObjectRepresentation : public ObjectRepresentation
50
/** Macro with standard traits declarations. */
51
igstkStandardClassTraitsMacro( ToolProjectionObjectRepresentation,
52
ObjectRepresentation )
58
typedef ReslicerPlaneSpatialObject ReslicerPlaneType;
60
typedef ReslicerPlaneType::Pointer ReslicerPlanePointerType;
62
typedef ReslicerPlaneType::VectorType VectorType;
64
typedef ToolProjectionSpatialObject ToolProjectionSpatialObjectType;
66
/** Provides the reslicing plane onto which the tool is projected */
67
void RequestSetReslicePlaneSpatialObject( const ReslicerPlaneType *
70
/** Return a copy of the current object representation */
73
/** Connect this representation class to the spatial object */
74
void RequestSetToolProjectionObject( const ToolProjectionSpatialObjectType *
75
toolProjectionObject );
77
virtual void SetVisibility ( bool visible);
79
/** Set/Get line width */
80
void SetLineWidth(double LineWidth);
81
igstkGetMacro( LineWidth, double );
85
ToolProjectionObjectRepresentation( void );
86
virtual ~ToolProjectionObjectRepresentation( void );
88
/** Print object information */
89
virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
91
/** Create the VTK actors */
94
/** Verify time stamp. Use the reslicing tool transform to verify
96
virtual bool VerifyTimeStamp() const;
100
ToolProjectionObjectRepresentation(const Self&); //purposely not implemented
101
void operator=(const Self&); //purposely not implemented
104
/** Internal itkSpatialObject */
105
ToolProjectionSpatialObjectType::ConstPointer m_ToolProjectionSpatialObject;
107
/** update the visual representation with changes in the geometry */
108
virtual void UpdateRepresentationProcessing();
110
/** Connect this representation class to the spatial object. Only to be
111
* called by the State Machine. */
112
void SetToolProjectionObjectProcessing();
114
/** Method for performing a null operation during a State Machine
118
/** Set the reslice plane spatial object */
119
void SetReslicePlaneSpatialObjectProcessing();
121
/** Define observers for event communication */
122
igstkObserverMacro( ImageBounds, igstk::ImageBoundsEvent,
123
igstk::EventHelperType::ImageBoundsType );
125
/** Declare the observer that will receive the reslice plane normal from the
126
* ReslicerPlaneSpatialObject */
127
igstkObserverMacro( ReslicerPlaneNormal,
128
ReslicerPlaneType::ReslicerPlaneNormalEvent,
129
ReslicerPlaneType::VectorType);
131
ReslicerPlaneNormalObserver::Pointer m_ReslicerPlaneNormalObserver;
135
/** Variables for managing reslice plane spatial object */
136
ReslicerPlanePointerType m_ReslicePlaneSpatialObjectToBeSet;
137
ReslicerPlanePointerType m_ReslicePlaneSpatialObject;
139
vtkLineSource* m_LineSource;
140
vtkProperty* m_LineProperty;
144
/** Inputs to the State Machine */
145
igstkDeclareInputMacro( ValidToolProjectionObject );
146
igstkDeclareInputMacro( NullToolProjectionObject );
147
igstkDeclareInputMacro( ValidReslicePlaneSpatialObject );
148
igstkDeclareInputMacro( InValidReslicePlaneSpatialObject );
150
/** States for the State Machine */
151
igstkDeclareStateMacro( NullToolProjectionObject );
152
igstkDeclareStateMacro( ValidToolProjectionObject );
153
igstkDeclareStateMacro( ValidReslicePlaneSpatialObject );
155
ToolProjectionSpatialObjectType::ConstPointer m_ToolProjectionObjectToAdd;
159
} // end namespace igstk
161
#endif // __igstkToolProjectionObjectRepresentation_h