Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkSlicerMarkupsWidgetRepresentation Class Referenceabstract

Class for rendering a markups node. More...

#include <Modules/Loadable/Markups/VTKWidgets/vtkSlicerMarkupsWidgetRepresentation.h>

Inheritance diagram for vtkSlicerMarkupsWidgetRepresentation:
Inheritance graph
Collaboration diagram for vtkSlicerMarkupsWidgetRepresentation:
Collaboration graph


class  ControlPointsPipeline

Public Types

enum  {
  Unselected, Selected, Active, Project,
  ProjectBack, NumberOfControlPointTypes
typedef vtkMRMLAbstractWidgetRepresentation Superclass
 Standard methods for instances of this class. More...
- Public Types inherited from vtkMRMLAbstractWidgetRepresentation
typedef vtkProp Superclass
 Standard methods for instances of this class. More...

Public Member Functions

virtual void CanInteract (vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2)
virtual int FindClosestPointOnWidget (const int displayPos[2], double worldPos[3], int *idx)
virtual const char * GetClassName ()
virtual vtkPolyData * GetControlPointsPolyData (int controlPointType)
virtual vtkPolyData * GetLabelControlPointsPolyData (int pipeline)
virtual vtkStringArray * GetLabels (int pipeline)
virtual vtkMRMLMarkupsDisplayNodeGetMarkupsDisplayNode ()
virtual vtkMRMLMarkupsNodeGetMarkupsNode ()
virtual vtkMRMLMarkupsNode::ControlPointGetNthControlPoint (int n)
 Get the nth control point. More...
virtual int GetNthControlPointDisplayPosition (int n, double pos[2])
virtual int GetNumberOfControlPoints ()
 Get number of control points. More...
virtual vtkPointPlacer * GetPointPlacer ()
virtual bool GetTransformationReferencePoint (double referencePointWorld[3])
 Translation, rotation, scaling will happen around this position. More...
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent) override
virtual void SetMarkupsDisplayNode (vtkMRMLMarkupsDisplayNode *markupsDisplayNode)
 Set/Get the vtkMRMLMarkipsNode connected with this representation. More...
virtual void UpdateCenter ()
void UpdateFromMRML (vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
 Update the representation from markups node. More...
- Public Member Functions inherited from vtkMRMLAbstractWidgetRepresentation
virtual void AlwaysOnTopOff ()
virtual void AlwaysOnTopOn ()
virtual bool GetAlwaysOnTop ()
virtual double GetPickingTolerance ()
void PrintSelf (ostream &os, vtkIndent indent) override
virtual void SetAlwaysOnTop (bool)
virtual void SetPickingTolerance (double)
double * GetBounds () VTK_SIZEHINT(6) override
void GetActors (vtkPropCollection *) override
void GetActors2D (vtkPropCollection *) override
void GetVolumes (vtkPropCollection *) override
void ReleaseGraphicsResources (vtkWindow *) override
int RenderOverlay (vtkViewport *vtkNotUsed(viewport)) override
int RenderOpaqueGeometry (vtkViewport *vtkNotUsed(viewport)) override
int RenderTranslucentPolygonalGeometry (vtkViewport *vtkNotUsed(viewport)) override
int RenderVolumetricGeometry (vtkViewport *vtkNotUsed(viewport)) override
vtkTypeBool HasTranslucentPolygonalGeometry () override
virtual void SetRenderer (vtkRenderer *ren)
virtual vtkRenderer * GetRenderer ()
virtual void SetViewNode (vtkMRMLAbstractViewNode *viewNode)
virtual vtkMRMLAbstractViewNodeGetViewNode ()
virtual bool GetNeedToRender ()
virtual void SetNeedToRender (bool)
virtual void NeedToRenderOn ()
virtual void NeedToRenderOff ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkSlicerMarkupsWidgetRepresentationSafeDownCast (vtkObject *o)
- Static Public Member Functions inherited from vtkMRMLAbstractWidgetRepresentation
static int IsTypeOf (const char *type)
static vtkMRMLAbstractWidgetRepresentationSafeDownCast (vtkObject *o)

Protected Member Functions

void BuildLine (vtkPolyData *linePolyData, bool displayPosition)
bool GetAllControlPointsSelected ()
 Convenience method. More...
virtual bool GetAllControlPointsVisible ()
 Convenience method. More...
double * GetWidgetColor (int controlPointType)
virtual void SetMarkupsNode (vtkMRMLMarkupsNode *markupsNode)
virtual void UpdateControlPointSize ()=0
virtual void UpdateViewScaleFactor ()=0
 vtkSlicerMarkupsWidgetRepresentation ()
 ~vtkSlicerMarkupsWidgetRepresentation () override
- Protected Member Functions inherited from vtkMRMLAbstractWidgetRepresentation
void AddActorsBounds (vtkBoundingBox &bounds, const std::vector< vtkProp *> &actors, double *additionalBounds=nullptr)
void GetRendererComputedDisplayPositionFromWorldPosition (const double worldPos[3], double displayPos[2])
void UpdateRelativeCoincidentTopologyOffsets (vtkMapper *mapper)
 vtkMRMLAbstractWidgetRepresentation ()
 ~vtkMRMLAbstractWidgetRepresentation () override

Protected Attributes

vtkTypeBool ClosedLoop
ControlPointsPipelineControlPoints [NumberOfControlPointTypes]
double ControlPointSize
vtkWeakPointer< vtkMRMLMarkupsDisplayNodeMarkupsDisplayNode
vtkWeakPointer< vtkMRMLMarkupsNodeMarkupsNode
vtkTimeStamp MarkupsTransformModifiedTime
vtkSmartPointer< vtkPointPlacer > PointPlacer
double ScreenSizePixel
vtkSmartPointer< vtkTextActor > TextActor
double ViewScaleFactorMmPerPixel
- Protected Attributes inherited from vtkMRMLAbstractWidgetRepresentation
bool AlwaysOnTop
double Bounds [6]
 Temporary variable to store GetBounds() result. More...
bool NeedToRender
double PickingTolerance
vtkWeakPointer< vtkRenderer > Renderer
 The renderer in which this widget is placed. More...
double ScreenScaleFactor
 Allows global rescaling of all widgets (to compensate for larger or smaller physical screen size) More...
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
vtkSlicerMarkupsWidgetRepresentation vtkMRMLAbstractWidget vtkPointPlacer

Definition at line 59 of file vtkSlicerMarkupsWidgetRepresentation.h.

Member Typedef Documentation

◆ Superclass

Standard methods for instances of this class.

Definition at line 73 of file vtkSlicerMarkupsWidgetRepresentation.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 62 of file vtkSlicerMarkupsWidgetRepresentation.h.

Constructor & Destructor Documentation

◆ vtkSlicerMarkupsWidgetRepresentation()

vtkSlicerMarkupsWidgetRepresentation::vtkSlicerMarkupsWidgetRepresentation ( )

◆ ~vtkSlicerMarkupsWidgetRepresentation()

vtkSlicerMarkupsWidgetRepresentation::~vtkSlicerMarkupsWidgetRepresentation ( )

Member Function Documentation

◆ BuildLine()

void vtkSlicerMarkupsWidgetRepresentation::BuildLine ( vtkPolyData *  linePolyData,
bool  displayPosition 

◆ CanInteract()

virtual void vtkSlicerMarkupsWidgetRepresentation::CanInteract ( vtkMRMLInteractionEventData interactionEventData,
int &  foundComponentType,
int &  foundComponentIndex,
double &  closestDistance2 

Return found component type (as vtkMRMLMarkupsDisplayNode::ComponentType). closestDistance2 is the squared distance in display coordinates from the closest position where interaction is possible. componentIndex returns index of the found component (e.g., if control point is found then control point index is returned).

Reimplemented in vtkSlicerAngleRepresentation3D, vtkSlicerCurveRepresentation3D, vtkSlicerAngleRepresentation2D, vtkSlicerMarkupsWidgetRepresentation3D, vtkSlicerLineRepresentation3D, vtkSlicerCurveRepresentation2D, vtkSlicerMarkupsWidgetRepresentation2D, and vtkSlicerLineRepresentation2D.

◆ FindClosestPointOnWidget()

virtual int vtkSlicerMarkupsWidgetRepresentation::FindClosestPointOnWidget ( const int  displayPos[2],
double  worldPos[3],
int *  idx 

◆ GetAllControlPointsSelected()

bool vtkSlicerMarkupsWidgetRepresentation::GetAllControlPointsSelected ( )

Convenience method.

◆ GetAllControlPointsVisible()

virtual bool vtkSlicerMarkupsWidgetRepresentation::GetAllControlPointsVisible ( )

Convenience method.

Reimplemented in vtkSlicerMarkupsWidgetRepresentation2D.

◆ GetClassName()

virtual const char* vtkSlicerMarkupsWidgetRepresentation::GetClassName ( )

◆ GetControlPointsPolyData()

virtual vtkPolyData* vtkSlicerMarkupsWidgetRepresentation::GetControlPointsPolyData ( int  controlPointType)

Get internal control points polydata - for testing purposes. controlPointType can be Unselected, Selected, Active, Project, ProjectBack.

◆ GetLabelControlPointsPolyData()

virtual vtkPolyData* vtkSlicerMarkupsWidgetRepresentation::GetLabelControlPointsPolyData ( int  pipeline)

Get internal label control points polydata - for testing purposes. controlPointType can be Unselected, Selected, Active, Project, ProjectBack.

◆ GetLabels()

virtual vtkStringArray* vtkSlicerMarkupsWidgetRepresentation::GetLabels ( int  pipeline)

Get internal labels list - for testing purposes. controlPointType can be Unselected, Selected, Active, Project, ProjectBack.

◆ GetMarkupsDisplayNode()

virtual vtkMRMLMarkupsDisplayNode* vtkSlicerMarkupsWidgetRepresentation::GetMarkupsDisplayNode ( )

◆ GetMarkupsNode()

virtual vtkMRMLMarkupsNode* vtkSlicerMarkupsWidgetRepresentation::GetMarkupsNode ( )

◆ GetNthControlPoint()

virtual vtkMRMLMarkupsNode::ControlPoint* vtkSlicerMarkupsWidgetRepresentation::GetNthControlPoint ( int  n)

Get the nth control point.

◆ GetNthControlPointDisplayPosition()

virtual int vtkSlicerMarkupsWidgetRepresentation::GetNthControlPointDisplayPosition ( int  n,
double  pos[2] 

Get the nth node's display position. Will return 1 on success, or 0 if there are not at least (n+1) nodes (0 based counting).

Reimplemented in vtkSlicerMarkupsWidgetRepresentation2D.

◆ GetNumberOfControlPoints()

virtual int vtkSlicerMarkupsWidgetRepresentation::GetNumberOfControlPoints ( )

Get number of control points.

◆ GetPointPlacer()

virtual vtkPointPlacer* vtkSlicerMarkupsWidgetRepresentation::GetPointPlacer ( )

◆ GetTransformationReferencePoint()

virtual bool vtkSlicerMarkupsWidgetRepresentation::GetTransformationReferencePoint ( double  referencePointWorld[3])

Translation, rotation, scaling will happen around this position.

Reimplemented in vtkSlicerAngleRepresentation2D, and vtkSlicerAngleRepresentation3D.

◆ GetWidgetColor()

double* vtkSlicerMarkupsWidgetRepresentation::GetWidgetColor ( int  controlPointType)

◆ IsA()

virtual int vtkSlicerMarkupsWidgetRepresentation::IsA ( const char *  type)

◆ IsTypeOf()

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

◆ PrintSelf()

void vtkSlicerMarkupsWidgetRepresentation::PrintSelf ( ostream &  os,
vtkIndent  indent 

◆ SafeDownCast()

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

◆ SetMarkupsDisplayNode()

virtual void vtkSlicerMarkupsWidgetRepresentation::SetMarkupsDisplayNode ( vtkMRMLMarkupsDisplayNode markupsDisplayNode)

Set/Get the vtkMRMLMarkipsNode connected with this representation.

◆ SetMarkupsNode()

virtual void vtkSlicerMarkupsWidgetRepresentation::SetMarkupsNode ( vtkMRMLMarkupsNode markupsNode)

◆ UpdateCenter()

virtual void vtkSlicerMarkupsWidgetRepresentation::UpdateCenter ( )

Compute the center by sampling the points along the polyline of the widget at equal distances. and it also updates automatically the center pos stored in the Markups node

◆ UpdateControlPointSize()

virtual void vtkSlicerMarkupsWidgetRepresentation::UpdateControlPointSize ( )
protectedpure virtual

◆ UpdateFromMRML()

void vtkSlicerMarkupsWidgetRepresentation::UpdateFromMRML ( vtkMRMLNode caller,
unsigned long  event,
void *  callData = nullptr 

Update the representation from markups node.

Reimplemented from vtkMRMLAbstractWidgetRepresentation.

Reimplemented in vtkSlicerMarkupsWidgetRepresentation2D, and vtkSlicerMarkupsWidgetRepresentation3D.

◆ UpdateViewScaleFactor()

virtual void vtkSlicerMarkupsWidgetRepresentation::UpdateViewScaleFactor ( )
protectedpure virtual

Member Data Documentation

◆ ClosedLoop

vtkTypeBool vtkSlicerMarkupsWidgetRepresentation::ClosedLoop

Definition at line 174 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ControlPoints

ControlPointsPipeline* vtkSlicerMarkupsWidgetRepresentation::ControlPoints[NumberOfControlPointTypes]

Definition at line 192 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ControlPointSize

double vtkSlicerMarkupsWidgetRepresentation::ControlPointSize

Definition at line 163 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsDisplayNode

vtkWeakPointer<vtkMRMLMarkupsDisplayNode> vtkSlicerMarkupsWidgetRepresentation::MarkupsDisplayNode

Definition at line 167 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsNode

vtkWeakPointer<vtkMRMLMarkupsNode> vtkSlicerMarkupsWidgetRepresentation::MarkupsNode

Definition at line 168 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsTransformModifiedTime

vtkTimeStamp vtkSlicerMarkupsWidgetRepresentation::MarkupsTransformModifiedTime

Definition at line 188 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ PointPlacer

vtkSmartPointer<vtkPointPlacer> vtkSlicerMarkupsWidgetRepresentation::PointPlacer

Definition at line 170 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ScreenSizePixel

double vtkSlicerMarkupsWidgetRepresentation::ScreenSizePixel

Definition at line 157 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ TextActor

vtkSmartPointer<vtkTextActor> vtkSlicerMarkupsWidgetRepresentation::TextActor

Definition at line 172 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ViewScaleFactorMmPerPixel

double vtkSlicerMarkupsWidgetRepresentation::ViewScaleFactorMmPerPixel

Definition at line 156 of file vtkSlicerMarkupsWidgetRepresentation.h.

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