#include <igstkObjectRepresentation.h>
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 |
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.
Definition at line 72 of file igstkObjectRepresentation.h.
typedef double igstk::ObjectRepresentation::OpacityType |
Type for representing the opacity of the object.
Definition at line 97 of file igstkObjectRepresentation.h.
igstk::ObjectRepresentation::ObjectRepresentation | ( | void | ) | [protected] |
igstk::ObjectRepresentation::~ObjectRepresentation | ( | void | ) | [protected] |
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] |
Create the vtkActors.
Implemented in igstk::AxesObjectRepresentation, igstk::BoxObjectRepresentation, igstk::ConeObjectRepresentation, igstk::CylinderObjectRepresentation, igstk::EllipsoidObjectRepresentation, igstk::ImageSpatialObjectRepresentation< TImageSpatialObject >, igstk::MeshObjectRepresentation, igstk::TubeObjectRepresentation, igstk::UltrasoundProbeObjectRepresentation, igstk::ImageSpatialObjectRepresentation< USImageObject >, igstk::ImageSpatialObjectRepresentation< MRImageSpatialObject >, and igstk::ImageSpatialObjectRepresentation< CTImageSpatialObject >.
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] |
Print the object informations in a stream.
Reimplemented from igstk::Object.
Reimplemented in igstk::AxesObjectRepresentation, igstk::BoxObjectRepresentation, igstk::ConeObjectRepresentation, igstk::CTImageSpatialObjectRepresentation, igstk::CylinderObjectRepresentation, igstk::EllipsoidObjectRepresentation, igstk::ImageSpatialObjectRepresentation< TImageSpatialObject >, igstk::MeshObjectRepresentation, igstk::MRImageSpatialObjectRepresentation, igstk::TubeObjectRepresentation, igstk::UltrasoundProbeObjectRepresentation, igstk::USImageObjectRepresentation, igstk::ImageSpatialObjectRepresentation< USImageObject >, igstk::ImageSpatialObjectRepresentation< MRImageSpatialObject >, and igstk::ImageSpatialObjectRepresentation< CTImageSpatialObject >.
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.
TimeStamp igstk::ObjectRepresentation::GetRenderTimeStamp | ( | ) | const [protected] |
Get Time stamp for the time at which the next rendering will take place.
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.
OpacityType igstk::ObjectRepresentation::m_Opacity [protected] |
Definition at line 121 of file igstkObjectRepresentation.h.