IGSTK
igstkCrossHairObjectRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkCrossHairObjectRepresentation.h,v $
5  Language: C++
6  Date: $Date: 2009-02-02 21:00:06 $
7  Version: $Revision: 1.3 $
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 __igstkCrossHairObjectRepresentation_h
19 #define __igstkCrossHairObjectRepresentation_h
20 
21 #include "igstkMacros.h"
24 #include "igstkStateMachine.h"
25 
26 class vtkLineSource;
27 class vtkProperty;
28 
29 namespace igstk
30 {
31 
46 {
47 
48 public:
49 
53 
54 public:
55 
57  typedef CrossHairSpatialObject CrossHairType;
58  typedef CrossHairType::Pointer CrossHairPointerType;
59  typedef CrossHairType::PointType PointType;
60 
62  Pointer Copy() const;
63 
65  void RequestSetCrossHairObject( const CrossHairType * crossHairObject );
66 
67  virtual void SetVisibility ( bool visible);
68 
70  void SetLineWidth(double LineWidth);
71  igstkGetMacro( LineWidth, double );
72 
73 protected:
74 
76  virtual ~CrossHairObjectRepresentation( void );
77 
79  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
80 
82  void CreateActors();
83 
86  virtual bool VerifyTimeStamp() const;
87 
88 private:
89 
90  CrossHairObjectRepresentation(const Self&); //purposely not implemented
91  void operator=(const Self&); //purposely not implemented
92 
94  virtual void UpdateRepresentationProcessing();
95 
98  void SetCrossHairObjectProcessing();
99 
102  void NoProcessing();
103 
105  igstkObserverMacro( CrossHairPosition, PointEvent,
106  igstk::EventHelperType::PointType );
107 
108  CrossHairPositionObserver::Pointer m_CrossHairPositionObserver;
109 
110 private:
111 
112  double m_ImageBounds[6];
113 
114  vtkLineSource* m_LineSourceX;
115  vtkLineSource* m_LineSourceY;
116  vtkLineSource* m_LineSourceZ;
117 
118  vtkProperty* m_LineProperty;
119 
120  double m_LineWidth;
121 
123  igstkDeclareInputMacro( ValidCrossHairObject );
124  igstkDeclareInputMacro( NullCrossHairObject );
125 
127  igstkDeclareStateMacro( NullCrossHairObject );
128  igstkDeclareStateMacro( ValidCrossHairObject );
129  igstkDeclareStateMacro( ValidReslicePlaneSpatialObject );
130 
131  CrossHairPointerType m_CrossHairSpatialObjectToAdd;
132  CrossHairPointerType m_CrossHairSpatialObject;
133 
134  bool m_Visibility;
135 
136 };
137 
138 } // end namespace igstk
139 
140 #endif // __igstkCrossHairObjectRepresentation_h
void RequestSetCrossHairObject(const CrossHairType *crossHairObject)
Connect this representation class to the spatial object.
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
Print object information.
#define igstkGetMacro(name, type)
Get built-in type.
Definition: igstkMacros.h:105
Base class for all the IGSTK classes.
Definition: igstkObject.h:40
virtual void SetVisibility(bool visible)
#define igstkStandardClassTraitsMacro(classname, superclassname)
Convenience macro for traits of a non-templated class.
Definition: igstkMacros.h:275
This class provides a visual representation of a CrossHairSpatialObject.
defines standard system-wide macros, constants, and other common parameters in the IGSTK Library...
This class represents a cross hair spatial object.
::itk::SmartPointer< Self > Pointer
Definition: igstkObject.h:50
virtual bool VerifyTimeStamp() const
Verify time stamp.
void SetLineWidth(double LineWidth)
Set/Get line width.
igstkStandardClassTraitsMacro(CrossHairObjectRepresentation, ObjectRepresentation) public typedef CrossHairType::Pointer CrossHairPointerType
Macro with standard traits declarations.
Pointer Copy() const
Return a copy of the current object representation.
An abstract base class for all the igstk representation objects.
void CreateActors()
Create the VTK actors.