IGSTK
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

igstk::ObjectRepresentation Class Reference

An abstract base class for all the igstk representation objects. More...

#include <igstkObjectRepresentation.h>

Inheritance diagram for igstk::ObjectRepresentation:
Inheritance graph
[legend]
Collaboration diagram for igstk::ObjectRepresentation:
Collaboration graph
[legend]

List of all members.

Public Types

typedef double OpacityType
 Type for representing the opacity of the object.

Public Member Functions

void SetColor (ColorScalarType r, ColorScalarType g, ColorScalarType b)
 Set the color.
ColorScalarType GetRed () const
 Get each color component.
ColorScalarType GetGreen () const
ColorScalarType GetBlue () const
virtual void SetOpacity (OpacityType alpha)
 Set/Get the opacity.
virtual OpacityType GetOpacity ()
virtual void CreateActors ()=0
 Create the vtkActors.
virtual ActorsListType GetActors ()
 Get the VTK actors.
virtual void RequestUpdateRepresentation (const TimeStamp &time, const CoordinateSystem *cs)
 Update the visual representation with changes in the geometry.

Public Attributes

igstkStandardAbstractClassTraitsMacro(ObjectRepresentation,
Object) public typedef double 
ColorScalarType
 Macro with standard traits declarations.

Protected Member Functions

 ObjectRepresentation (void)
 ~ObjectRepresentation (void)
void AddActor (vtkProp *)
 Add an actor to the list.
virtual void DeleteActors ()
 Empty the list of actors.
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 Print the object informations in a stream.
void RequestSetSpatialObject (const SpatialObject *spatialObject)
 Request the state machine to set a Spatial Object.
virtual bool VerifyTimeStamp () const
 Verify the time stamp.
TimeStamp GetRenderTimeStamp () const
 Get Time stamp for the time at which the next rendering will take place.

Protected Attributes

ActorsListType m_Actors
OpacityType m_Opacity

Detailed Description

An abstract base class for all the igstk representation objects.

This class serves as the base class for all the representation objects that will provide a VTK visualization of the Spatial Objects that are composing a given scene.

Due to the critical nature of IGSTK applications, it is important to ensure that when we display objects in the surgical scene, we have confidence on the validity of their current location and orientation in space. In IGSTK we do this by managing Transforms with a finite validity time. In this way, when an object stops receiving fresh updated transforms, its old transforms are going to expire and the ObjectRepresentation class will then know that at this moment we can not trust the information of the transform. Objects whose transforms have expired are not displayed in the Views. This functionality is implemented in this current class by providing states of Visibility and Invisibility in an auxiliary state machine.

The validity of the SpatialObject transform is checked at every call of the RequestUpdateRepresentation() method. If the transform turns out to be invalid, then this class goes into the Invisible state, and remains there until subsequent calls to RequestUpdateRepresentation() reveal that a valid transform has been provided to the SpatialObject.

igstkObjectRepresentation.png

"Object Representation State Machine Diagram" "Object Representation State Machine Diagram"

Definition at line 72 of file igstkObjectRepresentation.h.


Member Typedef Documentation

Type for representing the opacity of the object.

Definition at line 97 of file igstkObjectRepresentation.h.


Constructor & Destructor Documentation

igstk::ObjectRepresentation::ObjectRepresentation ( void  ) [protected]
igstk::ObjectRepresentation::~ObjectRepresentation ( void  ) [protected]

Member Function Documentation

void igstk::ObjectRepresentation::SetColor ( ColorScalarType  r,
ColorScalarType  g,
ColorScalarType  b 
)

Set the color.

ColorScalarType igstk::ObjectRepresentation::GetRed ( ) const

Get each color component.

ColorScalarType igstk::ObjectRepresentation::GetGreen ( ) const
ColorScalarType igstk::ObjectRepresentation::GetBlue ( ) const
virtual void igstk::ObjectRepresentation::SetOpacity ( OpacityType  alpha) [virtual]

Set/Get the opacity.

virtual OpacityType igstk::ObjectRepresentation::GetOpacity ( ) [virtual]
virtual void igstk::ObjectRepresentation::CreateActors ( ) [pure virtual]
virtual ActorsListType igstk::ObjectRepresentation::GetActors ( ) [virtual]

Get the VTK actors.

virtual void igstk::ObjectRepresentation::RequestUpdateRepresentation ( const TimeStamp time,
const CoordinateSystem cs 
) [virtual]

Update the visual representation with changes in the geometry.

void igstk::ObjectRepresentation::AddActor ( vtkProp *  ) [protected]

Add an actor to the list.

virtual void igstk::ObjectRepresentation::DeleteActors ( ) [protected, virtual]
virtual void igstk::ObjectRepresentation::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const [protected, virtual]
void igstk::ObjectRepresentation::RequestSetSpatialObject ( const SpatialObject spatialObject) [protected]

Request the state machine to set a Spatial Object.

virtual bool igstk::ObjectRepresentation::VerifyTimeStamp ( ) const [protected, virtual]

Verify the time stamp.

A default implementation is provided that checks if the spatial object transform is within the Rendering time period. This method could be overridden in derived classes that can use other criteria to verify the time stamp.

Reimplemented in igstk::CrossHairObjectRepresentation, igstk::ImageResliceObjectRepresentation< TImageSpatialObject >, igstk::MeshResliceObjectRepresentation, igstk::ToolProjectionObjectRepresentation, and igstk::VideoFrameRepresentation< TVideoFrameSpatialObject >.

TimeStamp igstk::ObjectRepresentation::GetRenderTimeStamp ( ) const [protected]

Get Time stamp for the time at which the next rendering will take place.


Member Data Documentation

igstkStandardAbstractClassTraitsMacro ( ObjectRepresentation, Object ) public typedef double igstk::ObjectRepresentation::ColorScalarType

Macro with standard traits declarations.

Type for representing the color components

Definition at line 79 of file igstkObjectRepresentation.h.

ActorsListType igstk::ObjectRepresentation::m_Actors [protected]

Definition at line 119 of file igstkObjectRepresentation.h.

Definition at line 121 of file igstkObjectRepresentation.h.


The documentation for this class was generated from the following file: