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 Types | Protected Member Functions | Static 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
[legend]
Collaboration diagram for vtkSlicerMarkupsWidgetRepresentation:
Collaboration graph
[legend]

Classes

class  ControlPointsPipeline
 
class  MarkupsInteractionPipeline
 

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)
 
void GetActors (vtkPropCollection *) override
 Methods to make this class behave as a vtkProp. More...
 
virtual const char * GetClassName ()
 
virtual vtkPolyData * GetControlPointsPolyData (int controlPointType)
 
virtual void GetInteractionHandleAxisWorld (int type, int index, double axis[3])
 Get the axis for the handle specified by the index. More...
 
virtual void GetInteractionHandleOriginWorld (double origin[3])
 Get the origin of the interaction handle widget. More...
 
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...
 
vtkTypeBool HasTranslucentPolygonalGeometry () override
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void ReleaseGraphicsResources (vtkWindow *) override
 
int RenderOpaqueGeometry (vtkViewport *viewport) override
 
int RenderOverlay (vtkViewport *viewport) override
 
int RenderTranslucentPolygonalGeometry (vtkViewport *viewport) 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...
 
bool IsDisplayable ()
 
- 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 Types

typedef std::vector< MarkupsInteractionPipeline::HandleInfoHandleInfoList
 

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 SetupInteractionPipeline ()
 
virtual void UpdateControlPointSize ()=0
 
virtual void UpdateInteractionPipeline ()
 Update the interaction pipeline. More...
 
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])
 
virtual void UpdateRelativeCoincidentTopologyOffsets (vtkMapper *mapper)
 
 vtkMRMLAbstractWidgetRepresentation ()
 
 ~vtkMRMLAbstractWidgetRepresentation () override
 

Static Protected Member Functions

static int GetGlyphTypeSourceFromDisplay (int glyphTypeDisplay)
 

Protected Attributes

ControlPointsPipelineControlPoints [NumberOfControlPointTypes]
 
double ControlPointSize
 
vtkTypeBool CurveClosed
 
MarkupsInteractionPipelineInteractionPipeline
 
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 72 of file vtkSlicerMarkupsWidgetRepresentation.h.

Member Typedef Documentation

◆ HandleInfoList

Definition at line 291 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ Superclass

Standard methods for instances of this class.

Definition at line 86 of file vtkSlicerMarkupsWidgetRepresentation.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Unselected 
Selected 
Active 
Project 
ProjectBack 
NumberOfControlPointTypes 

Definition at line 75 of file vtkSlicerMarkupsWidgetRepresentation.h.

Constructor & Destructor Documentation

◆ vtkSlicerMarkupsWidgetRepresentation()

vtkSlicerMarkupsWidgetRepresentation::vtkSlicerMarkupsWidgetRepresentation ( )
protected

◆ ~vtkSlicerMarkupsWidgetRepresentation()

vtkSlicerMarkupsWidgetRepresentation::~vtkSlicerMarkupsWidgetRepresentation ( )
overrideprotected

Member Function Documentation

◆ BuildLine()

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

◆ CanInteract()

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

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 vtkSlicerROIRepresentation3D, vtkSlicerPlaneRepresentation3D, vtkSlicerPlaneRepresentation2D, vtkSlicerROIRepresentation2D, vtkSlicerAngleRepresentation3D, vtkSlicerCurveRepresentation3D, vtkSlicerAngleRepresentation2D, vtkSlicerMarkupsWidgetRepresentation3D, vtkSlicerLineRepresentation3D, vtkSlicerCurveRepresentation2D, vtkSlicerMarkupsWidgetRepresentation2D, and vtkSlicerLineRepresentation2D.

◆ FindClosestPointOnWidget()

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

◆ GetActors()

void vtkSlicerMarkupsWidgetRepresentation::GetActors ( vtkPropCollection *  )
override

Methods to make this class behave as a vtkProp.

◆ GetAllControlPointsSelected()

bool vtkSlicerMarkupsWidgetRepresentation::GetAllControlPointsSelected ( )
protected

Convenience method.

◆ GetAllControlPointsVisible()

virtual bool vtkSlicerMarkupsWidgetRepresentation::GetAllControlPointsVisible ( )
protectedvirtual

Convenience method.

Reimplemented in vtkSlicerMarkupsWidgetRepresentation2D.

◆ GetClassName()

virtual const char* vtkSlicerMarkupsWidgetRepresentation::GetClassName ( )
virtual

◆ GetControlPointsPolyData()

virtual vtkPolyData* vtkSlicerMarkupsWidgetRepresentation::GetControlPointsPolyData ( int  controlPointType)
virtual

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

◆ GetGlyphTypeSourceFromDisplay()

static int vtkSlicerMarkupsWidgetRepresentation::GetGlyphTypeSourceFromDisplay ( int  glyphTypeDisplay)
staticprotected

◆ GetInteractionHandleAxisWorld()

virtual void vtkSlicerMarkupsWidgetRepresentation::GetInteractionHandleAxisWorld ( int  type,
int  index,
double  axis[3] 
)
virtual

Get the axis for the handle specified by the index.

◆ GetInteractionHandleOriginWorld()

virtual void vtkSlicerMarkupsWidgetRepresentation::GetInteractionHandleOriginWorld ( double  origin[3])
virtual

Get the origin of the interaction handle widget.

◆ GetLabelControlPointsPolyData()

virtual vtkPolyData* vtkSlicerMarkupsWidgetRepresentation::GetLabelControlPointsPolyData ( int  pipeline)
virtual

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

◆ GetLabels()

virtual vtkStringArray* vtkSlicerMarkupsWidgetRepresentation::GetLabels ( int  pipeline)
virtual

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

◆ GetMarkupsDisplayNode()

virtual vtkMRMLMarkupsDisplayNode* vtkSlicerMarkupsWidgetRepresentation::GetMarkupsDisplayNode ( )
virtual

◆ GetMarkupsNode()

virtual vtkMRMLMarkupsNode* vtkSlicerMarkupsWidgetRepresentation::GetMarkupsNode ( )
virtual

◆ GetNthControlPoint()

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

Get the nth control point.

◆ GetNthControlPointDisplayPosition()

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

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 ( )
virtual

Get number of control points.

◆ GetPointPlacer()

virtual vtkPointPlacer* vtkSlicerMarkupsWidgetRepresentation::GetPointPlacer ( )
virtual

◆ GetTransformationReferencePoint()

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

Translation, rotation, scaling will happen around this position.

Reimplemented in vtkSlicerPlaneRepresentation2D, vtkSlicerPlaneRepresentation3D, vtkSlicerAngleRepresentation2D, and vtkSlicerAngleRepresentation3D.

◆ GetWidgetColor()

double* vtkSlicerMarkupsWidgetRepresentation::GetWidgetColor ( int  controlPointType)
protected

◆ HasTranslucentPolygonalGeometry()

vtkTypeBool vtkSlicerMarkupsWidgetRepresentation::HasTranslucentPolygonalGeometry ( )
override

◆ IsA()

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

◆ IsDisplayable()

bool vtkSlicerMarkupsWidgetRepresentation::IsDisplayable ( )

Returns true if the representation is displayable in the current view. It takes into account current view node's display node and parent folder's visibility.

◆ IsTypeOf()

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

◆ PrintSelf()

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

◆ ReleaseGraphicsResources()

void vtkSlicerMarkupsWidgetRepresentation::ReleaseGraphicsResources ( vtkWindow *  )
override

◆ RenderOpaqueGeometry()

int vtkSlicerMarkupsWidgetRepresentation::RenderOpaqueGeometry ( vtkViewport *  viewport)
override

◆ RenderOverlay()

int vtkSlicerMarkupsWidgetRepresentation::RenderOverlay ( vtkViewport *  viewport)
override

◆ RenderTranslucentPolygonalGeometry()

int vtkSlicerMarkupsWidgetRepresentation::RenderTranslucentPolygonalGeometry ( vtkViewport *  viewport)
override

◆ SafeDownCast()

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

◆ SetMarkupsDisplayNode()

virtual void vtkSlicerMarkupsWidgetRepresentation::SetMarkupsDisplayNode ( vtkMRMLMarkupsDisplayNode markupsDisplayNode)
virtual

Set/Get the vtkMRMLMarkipsNode connected with this representation.

◆ SetMarkupsNode()

virtual void vtkSlicerMarkupsWidgetRepresentation::SetMarkupsNode ( vtkMRMLMarkupsNode markupsNode)
protectedvirtual

◆ SetupInteractionPipeline()

virtual void vtkSlicerMarkupsWidgetRepresentation::SetupInteractionPipeline ( )
protectedvirtual

◆ UpdateCenter()

virtual void vtkSlicerMarkupsWidgetRepresentation::UpdateCenter ( )
virtual

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 
)
overridevirtual

◆ UpdateInteractionPipeline()

virtual void vtkSlicerMarkupsWidgetRepresentation::UpdateInteractionPipeline ( )
protectedvirtual

◆ UpdateViewScaleFactor()

virtual void vtkSlicerMarkupsWidgetRepresentation::UpdateViewScaleFactor ( )
protectedpure virtual

Member Data Documentation

◆ ControlPoints

ControlPointsPipeline* vtkSlicerMarkupsWidgetRepresentation::ControlPoints[NumberOfControlPointTypes]
protected

Definition at line 334 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ControlPointSize

double vtkSlicerMarkupsWidgetRepresentation::ControlPointSize
protected

Definition at line 305 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ CurveClosed

vtkTypeBool vtkSlicerMarkupsWidgetRepresentation::CurveClosed
protected

Definition at line 316 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ InteractionPipeline

MarkupsInteractionPipeline* vtkSlicerMarkupsWidgetRepresentation::InteractionPipeline
protected

Definition at line 337 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsDisplayNode

vtkWeakPointer<vtkMRMLMarkupsDisplayNode> vtkSlicerMarkupsWidgetRepresentation::MarkupsDisplayNode
protected

Definition at line 309 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsNode

vtkWeakPointer<vtkMRMLMarkupsNode> vtkSlicerMarkupsWidgetRepresentation::MarkupsNode
protected

Definition at line 310 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsTransformModifiedTime

vtkTimeStamp vtkSlicerMarkupsWidgetRepresentation::MarkupsTransformModifiedTime
protected

Definition at line 330 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ PointPlacer

vtkSmartPointer<vtkPointPlacer> vtkSlicerMarkupsWidgetRepresentation::PointPlacer
protected

Definition at line 312 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ScreenSizePixel

double vtkSlicerMarkupsWidgetRepresentation::ScreenSizePixel
protected

Definition at line 299 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ TextActor

vtkSmartPointer<vtkTextActor> vtkSlicerMarkupsWidgetRepresentation::TextActor
protected

Definition at line 314 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ViewScaleFactorMmPerPixel

double vtkSlicerMarkupsWidgetRepresentation::ViewScaleFactorMmPerPixel
protected

Definition at line 298 of file vtkSlicerMarkupsWidgetRepresentation.h.


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