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

Public Types

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 vtkMRMLMarkupsDisplayNodeGetMarkupsDisplayNode ()
 
virtual vtkMRMLMarkupsNodeGetMarkupsNode ()
 
virtual vtkMRMLMarkupsNode::ControlPointGetNthControlPoint (int n)
 Get the nth node. More...
 
virtual int GetNthControlPointDisplayPosition (int n, double pos[2])
 
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
 
- 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

enum  {
  Unselected, Selected, Active, Project,
  ProjectBack, NumberOfControlPointTypes
}
 

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 63 of file vtkSlicerMarkupsWidgetRepresentation.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
Unselected 
Selected 
Active 
Project 
ProjectBack 
NumberOfControlPointTypes 

Definition at line 167 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 vtkSlicerAngleRepresentation3D, vtkSlicerCurveRepresentation3D, vtkSlicerAngleRepresentation2D, vtkSlicerMarkupsWidgetRepresentation3D, vtkSlicerLineRepresentation3D, vtkSlicerCurveRepresentation2D, vtkSlicerMarkupsWidgetRepresentation2D, and vtkSlicerLineRepresentation2D.

◆ FindClosestPointOnWidget()

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

◆ 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

◆ GetMarkupsDisplayNode()

virtual vtkMRMLMarkupsDisplayNode* vtkSlicerMarkupsWidgetRepresentation::GetMarkupsDisplayNode ( )
virtual

◆ GetMarkupsNode()

virtual vtkMRMLMarkupsNode* vtkSlicerMarkupsWidgetRepresentation::GetMarkupsNode ( )
virtual

◆ GetNthControlPoint()

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

Get the nth node.

◆ 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.

◆ GetPointPlacer()

vtkPointPlacer* vtkSlicerMarkupsWidgetRepresentation::GetPointPlacer ( )

◆ GetTransformationReferencePoint()

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

Translation, rotation, scaling will happen around this position.

Reimplemented in vtkSlicerAngleRepresentation2D, and vtkSlicerAngleRepresentation3D.

◆ GetWidgetColor()

double* vtkSlicerMarkupsWidgetRepresentation::GetWidgetColor ( int  controlPointType)
protected

◆ IsA()

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

◆ IsTypeOf()

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

◆ PrintSelf()

void vtkSlicerMarkupsWidgetRepresentation::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
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

◆ 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

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 from vtkMRMLAbstractWidgetRepresentation.

Reimplemented in vtkSlicerMarkupsWidgetRepresentation2D, and vtkSlicerMarkupsWidgetRepresentation3D.

◆ UpdateViewScaleFactor()

virtual void vtkSlicerMarkupsWidgetRepresentation::UpdateViewScaleFactor ( )
protectedpure virtual

Member Data Documentation

◆ ClosedLoop

vtkTypeBool vtkSlicerMarkupsWidgetRepresentation::ClosedLoop
protected

Definition at line 151 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ControlPoints

ControlPointsPipeline* vtkSlicerMarkupsWidgetRepresentation::ControlPoints[NumberOfControlPointTypes]
protected

Definition at line 179 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ControlPointSize

double vtkSlicerMarkupsWidgetRepresentation::ControlPointSize
protected

Definition at line 140 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsDisplayNode

vtkWeakPointer<vtkMRMLMarkupsDisplayNode> vtkSlicerMarkupsWidgetRepresentation::MarkupsDisplayNode
protected

Definition at line 144 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsNode

vtkWeakPointer<vtkMRMLMarkupsNode> vtkSlicerMarkupsWidgetRepresentation::MarkupsNode
protected

Definition at line 145 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ MarkupsTransformModifiedTime

vtkTimeStamp vtkSlicerMarkupsWidgetRepresentation::MarkupsTransformModifiedTime
protected

Definition at line 165 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ PointPlacer

vtkSmartPointer<vtkPointPlacer> vtkSlicerMarkupsWidgetRepresentation::PointPlacer
protected

Definition at line 147 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ScreenSizePixel

double vtkSlicerMarkupsWidgetRepresentation::ScreenSizePixel
protected

Definition at line 134 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ TextActor

vtkSmartPointer<vtkTextActor> vtkSlicerMarkupsWidgetRepresentation::TextActor
protected

Definition at line 149 of file vtkSlicerMarkupsWidgetRepresentation.h.

◆ ViewScaleFactorMmPerPixel

double vtkSlicerMarkupsWidgetRepresentation::ViewScaleFactorMmPerPixel
protected

Definition at line 133 of file vtkSlicerMarkupsWidgetRepresentation.h.


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