Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkMRMLAbstractWidgetRepresentation Class Reference

Class for rendering a markups node. More...

#include <Libs/MRML/DisplayableManager/vtkMRMLAbstractWidgetRepresentation.h>

Inheritance diagram for vtkMRMLAbstractWidgetRepresentation:
Collaboration diagram for vtkMRMLAbstractWidgetRepresentation:

Public Types

typedef vtkProp Superclass
 Standard methods for instances of this class.
 

Public Member Functions

virtual void AlwaysOnTopOff ()
 
virtual void AlwaysOnTopOn ()
 
void GetActors (vtkPropCollection *) override
 
void GetActors2D (vtkPropCollection *) override
 
virtual bool GetAlwaysOnTop ()
 
virtual double GetAlwaysOnTopRelativeOffsetFactor ()
 
virtual double GetAlwaysOnTopRelativeOffsetUnits ()
 
virtual vtkMRMLApplicationLogicGetApplicationLogic ()
 
double * GetBounds () VTK_SIZEHINT(6) override
 
virtual const char * GetClassName ()
 
virtual bool GetNeedToRender ()
 
virtual double GetPickingTolerance ()
 
virtual vtkRenderer * GetRenderer ()
 
double GetScreenScaleFactor ()
 Convenience method for getting screen scale factor from the associated view node.
 
virtual vtkMRMLAbstractViewNodeGetViewNode ()
 
void GetVolumes (vtkPropCollection *) override
 
vtkTypeBool HasTranslucentPolygonalGeometry () override
 
virtual int IsA (const char *type)
 
virtual void NeedToRenderOff ()
 
virtual void NeedToRenderOn ()
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void ReleaseGraphicsResources (vtkWindow *) override
 
int RenderOpaqueGeometry (vtkViewport *vtkNotUsed(viewport)) override
 
int RenderOverlay (vtkViewport *vtkNotUsed(viewport)) override
 
int RenderTranslucentPolygonalGeometry (vtkViewport *vtkNotUsed(viewport)) override
 
int RenderVolumetricGeometry (vtkViewport *vtkNotUsed(viewport)) override
 
virtual void SetAlwaysOnTop (bool)
 
virtual void SetAlwaysOnTopRelativeOffsetFactor (double)
 
virtual void SetAlwaysOnTopRelativeOffsetUnits (double)
 
virtual void SetApplicationLogic (vtkMRMLApplicationLogic *appLogic)
 
virtual void SetNeedToRender (bool)
 
virtual void SetPickingTolerance (double)
 
virtual void SetRenderer (vtkRenderer *ren)
 
virtual void SetViewNode (vtkMRMLAbstractViewNode *viewNode)
 
virtual void UpdateFromMRML (vtkMRMLNode *caller, unsigned long event, void *callData=nullptr)
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractWidgetRepresentationSafeDownCast (vtkObject *o)
 

Protected Member Functions

void AddActorsBounds (vtkBoundingBox &bounds, const std::vector< vtkProp * > &actors, double *additionalBounds=nullptr)
 
void GetRendererComputedDisplayPositionFromWorldPosition (const double worldPos[3], double displayPos[2])
 
virtual void UpdateRelativeCoincidentTopologyOffsets (vtkMapper *mapper)
 
 vtkMRMLAbstractWidgetRepresentation ()
 
 ~vtkMRMLAbstractWidgetRepresentation () override
 

Protected Attributes

bool AlwaysOnTop
 
double AlwaysOnTopRelativeOffsetFactor { 0.0 }
 Relative offset used for rendering occluded actors.
 
double AlwaysOnTopRelativeOffsetUnits { -66000.0 }
 
vtkWeakPointer< vtkMRMLApplicationLogicApplicationLogic
 
double Bounds [6]
 Temporary variable to store GetBounds() result.
 
bool NeedToRender
 
double PickingTolerance
 
vtkWeakPointer< vtkRenderer > Renderer
 The renderer in which this widget is placed.
 
vtkWeakPointer< vtkMRMLAbstractViewNodeViewNode
 

Detailed Description

Class for rendering a markups node.

This class can display a markups node in the scene. It plays a similar role to vtkWidgetRepresentation, but it is simplified and specialized for optimal use in Slicer. It state is stored in the associated MRML display node to avoid extra synchronization mechanisms. The representation only observes MRML node changes, it does not directly process any interaction events directly (interaction events are processed by vtkMRMLAbstractWidget, which then modifies MRML nodes).

This class (and subclasses) are a type of vtkProp; meaning that they can be associated with a vtkRenderer end embedded in a scene like any other vtkActor.

See also
vtkMRMLAbstractWidgetRepresentation vtkMRMLAbstractWidget

Definition at line 56 of file vtkMRMLAbstractWidgetRepresentation.h.

Member Typedef Documentation

◆ Superclass

Standard methods for instances of this class.

Definition at line 60 of file vtkMRMLAbstractWidgetRepresentation.h.

Constructor & Destructor Documentation

◆ vtkMRMLAbstractWidgetRepresentation()

vtkMRMLAbstractWidgetRepresentation::vtkMRMLAbstractWidgetRepresentation ( )
protected

◆ ~vtkMRMLAbstractWidgetRepresentation()

vtkMRMLAbstractWidgetRepresentation::~vtkMRMLAbstractWidgetRepresentation ( )
overrideprotected

Member Function Documentation

◆ AddActorsBounds()

void vtkMRMLAbstractWidgetRepresentation::AddActorsBounds ( vtkBoundingBox & bounds,
const std::vector< vtkProp * > & actors,
double * additionalBounds = nullptr )
protected

Helper function to add bounds of all listed actors to the supplied bounding box. additionalBounds is for convenience only, it allows defining additional bounds.

◆ AlwaysOnTopOff()

virtual void vtkMRMLAbstractWidgetRepresentation::AlwaysOnTopOff ( )
virtual

◆ AlwaysOnTopOn()

virtual void vtkMRMLAbstractWidgetRepresentation::AlwaysOnTopOn ( )
virtual

◆ GetActors()

void vtkMRMLAbstractWidgetRepresentation::GetActors ( vtkPropCollection * )
inlineoverride

Definition at line 72 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ GetActors2D()

void vtkMRMLAbstractWidgetRepresentation::GetActors2D ( vtkPropCollection * )
inlineoverride

Definition at line 73 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ GetAlwaysOnTop()

virtual bool vtkMRMLAbstractWidgetRepresentation::GetAlwaysOnTop ( )
virtual

◆ GetAlwaysOnTopRelativeOffsetFactor()

virtual double vtkMRMLAbstractWidgetRepresentation::GetAlwaysOnTopRelativeOffsetFactor ( )
virtual

◆ GetAlwaysOnTopRelativeOffsetUnits()

virtual double vtkMRMLAbstractWidgetRepresentation::GetAlwaysOnTopRelativeOffsetUnits ( )
virtual

◆ GetApplicationLogic()

virtual vtkMRMLApplicationLogic * vtkMRMLAbstractWidgetRepresentation::GetApplicationLogic ( )
virtual

◆ GetBounds()

double * vtkMRMLAbstractWidgetRepresentation::GetBounds ( )
inlineoverride

Methods to make this class behave as a vtkProp. They are repeated here (from the vtkProp superclass) as a reminder to the widget implementer. Failure to implement these methods properly may result in the representation not appearing in the scene (i.e., not implementing the Render() methods properly) or leaking graphics resources (i.e., not implementing ReleaseGraphicsResources() properly).

Definition at line 71 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ GetClassName()

◆ GetNeedToRender()

virtual bool vtkMRMLAbstractWidgetRepresentation::GetNeedToRender ( )
virtual

The widget representation can set this data member to true to indicate that it needs to be re-rendered. If the rendering request is processed then the flag is cleared.

◆ GetPickingTolerance()

virtual double vtkMRMLAbstractWidgetRepresentation::GetPickingTolerance ( )
virtual

◆ GetRenderer()

virtual vtkRenderer * vtkMRMLAbstractWidgetRepresentation::GetRenderer ( )
virtual

◆ GetRendererComputedDisplayPositionFromWorldPosition()

void vtkMRMLAbstractWidgetRepresentation::GetRendererComputedDisplayPositionFromWorldPosition ( const double worldPos[3],
double displayPos[2] )
protected

Given a world position and orientation, this computes the display position using the renderer of this class.

◆ GetScreenScaleFactor()

double vtkMRMLAbstractWidgetRepresentation::GetScreenScaleFactor ( )

Convenience method for getting screen scale factor from the associated view node.

◆ GetViewNode()

virtual vtkMRMLAbstractViewNode * vtkMRMLAbstractWidgetRepresentation::GetViewNode ( )
virtual

◆ GetVolumes()

void vtkMRMLAbstractWidgetRepresentation::GetVolumes ( vtkPropCollection * )
inlineoverride

Definition at line 74 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ HasTranslucentPolygonalGeometry()

vtkTypeBool vtkMRMLAbstractWidgetRepresentation::HasTranslucentPolygonalGeometry ( )
inlineoverride

Definition at line 80 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ IsA()

◆ IsTypeOf()

static int vtkMRMLAbstractWidgetRepresentation::IsTypeOf ( const char * type)
static

◆ NeedToRenderOff()

virtual void vtkMRMLAbstractWidgetRepresentation::NeedToRenderOff ( )
virtual

◆ NeedToRenderOn()

virtual void vtkMRMLAbstractWidgetRepresentation::NeedToRenderOn ( )
virtual

◆ PrintSelf()

void vtkMRMLAbstractWidgetRepresentation::PrintSelf ( ostream & os,
vtkIndent indent )
override

◆ ReleaseGraphicsResources()

void vtkMRMLAbstractWidgetRepresentation::ReleaseGraphicsResources ( vtkWindow * )
inlineoverride

Definition at line 75 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ RenderOpaqueGeometry()

int vtkMRMLAbstractWidgetRepresentation::RenderOpaqueGeometry ( vtkViewport * vtkNotUsedviewport)
inlineoverride

Definition at line 77 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ RenderOverlay()

int vtkMRMLAbstractWidgetRepresentation::RenderOverlay ( vtkViewport * vtkNotUsedviewport)
inlineoverride

Definition at line 76 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ RenderTranslucentPolygonalGeometry()

int vtkMRMLAbstractWidgetRepresentation::RenderTranslucentPolygonalGeometry ( vtkViewport * vtkNotUsedviewport)
inlineoverride

Definition at line 78 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ RenderVolumetricGeometry()

int vtkMRMLAbstractWidgetRepresentation::RenderVolumetricGeometry ( vtkViewport * vtkNotUsedviewport)
inlineoverride

Definition at line 79 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ SafeDownCast()

static vtkMRMLAbstractWidgetRepresentation * vtkMRMLAbstractWidgetRepresentation::SafeDownCast ( vtkObject * o)
static

◆ SetAlwaysOnTop()

virtual void vtkMRMLAbstractWidgetRepresentation::SetAlwaysOnTop ( bool )
virtual

Controls whether the widget should always appear on top of other actors in the scene. (In effect, this will disable OpenGL Depth buffer tests while rendering the widget). Default is to set it to false.

◆ SetAlwaysOnTopRelativeOffsetFactor()

virtual void vtkMRMLAbstractWidgetRepresentation::SetAlwaysOnTopRelativeOffsetFactor ( double )
virtual

Always on top relative offset factor and units.

See also
vtkMapper::SetRelativeCoincidentTopologyLineOffsetParameters().

◆ SetAlwaysOnTopRelativeOffsetUnits()

virtual void vtkMRMLAbstractWidgetRepresentation::SetAlwaysOnTopRelativeOffsetUnits ( double )
virtual

◆ SetApplicationLogic()

virtual void vtkMRMLAbstractWidgetRepresentation::SetApplicationLogic ( vtkMRMLApplicationLogic * appLogic)
virtual

Set the application logic. Used for retrieving custom font file, etc.

◆ SetNeedToRender()

virtual void vtkMRMLAbstractWidgetRepresentation::SetNeedToRender ( bool )
virtual

◆ SetPickingTolerance()

virtual void vtkMRMLAbstractWidgetRepresentation::SetPickingTolerance ( double )
virtual

Specify tolerance for performing pick operations of points. For display renderers it is defined in pixels. The specified value is scaled with ScreenScaleFactor. For VR renderer it is defined in millimeters. The specified value is scaled with WorldToPhysicalScale.

◆ SetRenderer()

virtual void vtkMRMLAbstractWidgetRepresentation::SetRenderer ( vtkRenderer * ren)
virtual

Set the renderer in which the representations draws itself. Typically the renderer is set by the associated widget. Use the widget's SetCurrentRenderer() method in most cases; otherwise there is a risk of inconsistent behavior as events and drawing may be performed in different viewports. WARNING: The renderer is NOT reference counted by the representation, in order to avoid reference loops. Be sure that the representation lifetime does not extend beyond the renderer lifetime.

Reimplemented in vtkSlicerMarkupsWidgetRepresentation3D.

◆ SetViewNode()

virtual void vtkMRMLAbstractWidgetRepresentation::SetViewNode ( vtkMRMLAbstractViewNode * viewNode)
virtual

Set the view node where this widget is displayed.

◆ UpdateFromMRML()

virtual void vtkMRMLAbstractWidgetRepresentation::UpdateFromMRML ( vtkMRMLNode * caller,
unsigned long event,
void * callData = nullptr )
virtual

UpdateFromMRML() - update the widget from its state stored in MRML. if event is non-zero then a specific update (faster, smaller scope) is performed instead of a full update.

Reimplemented in vtkMRMLInteractionWidgetRepresentation, vtkMRMLSliceEdgeWidgetRepresentation, vtkMRMLSliceIntersectionInteractionRepresentation, and vtkSlicerMarkupsWidgetRepresentation.

◆ UpdateRelativeCoincidentTopologyOffsets()

virtual void vtkMRMLAbstractWidgetRepresentation::UpdateRelativeCoincidentTopologyOffsets ( vtkMapper * mapper)
protectedvirtual

Member Data Documentation

◆ AlwaysOnTop

bool vtkMRMLAbstractWidgetRepresentation::AlwaysOnTop
protected

Definition at line 189 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ AlwaysOnTopRelativeOffsetFactor

double vtkMRMLAbstractWidgetRepresentation::AlwaysOnTopRelativeOffsetFactor { 0.0 }
protected

Relative offset used for rendering occluded actors.

Definition at line 195 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ AlwaysOnTopRelativeOffsetUnits

double vtkMRMLAbstractWidgetRepresentation::AlwaysOnTopRelativeOffsetUnits { -66000.0 }
protected

Definition at line 196 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ ApplicationLogic

vtkWeakPointer<vtkMRMLApplicationLogic> vtkMRMLAbstractWidgetRepresentation::ApplicationLogic
protected

Definition at line 178 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ Bounds

double vtkMRMLAbstractWidgetRepresentation::Bounds[6]
protected

Temporary variable to store GetBounds() result.

Definition at line 192 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ NeedToRender

bool vtkMRMLAbstractWidgetRepresentation::NeedToRender
protected

Definition at line 180 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ PickingTolerance

double vtkMRMLAbstractWidgetRepresentation::PickingTolerance
protected

Tolerance for performing pick operations of points. For display renderers it is defined in pixels. The specified value is scaled with ScreenScaleFactor. For VR renderer it is defined in millimeters. The specified value is scaled with WorldToPhysicalScale.

Definition at line 185 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ Renderer

vtkWeakPointer<vtkRenderer> vtkMRMLAbstractWidgetRepresentation::Renderer
protected

The renderer in which this widget is placed.

Definition at line 176 of file vtkMRMLAbstractWidgetRepresentation.h.

◆ ViewNode

vtkWeakPointer<vtkMRMLAbstractViewNode> vtkMRMLAbstractWidgetRepresentation::ViewNode
protected

Definition at line 187 of file vtkMRMLAbstractWidgetRepresentation.h.


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