Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkMRMLAnnotationDisplayableManager Class Reference

#include <Modules/Loadable/Annotations/MRMLDM/vtkMRMLAnnotationDisplayableManager.h>

Inheritance diagram for vtkMRMLAnnotationDisplayableManager:
Inheritance graph
[legend]
Collaboration diagram for vtkMRMLAnnotationDisplayableManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool AddAnnotation (vtkMRMLAnnotationNode *node)
bool GetDisplayCoordinatesChanged (double *displayCoordinates1, double *displayCoordinates2)
 Check if there are real changes between two sets of displayCoordinates.
void GetDisplayToWorldCoordinates (double x, double y, double *worldCoordinates)
 Convert display to world coordinates.
void GetDisplayToWorldCoordinates (double *displayCoordinates, double *worldCoordinates)
int GetLightboxIndex (vtkMRMLAnnotationNode *node, int controlPointIndex=0)
virtual double GetScaleFactor2D ()
vtkMRMLSliceNodeGetSliceNode ()
 Get the sliceNode, if registered. This would mean it is a 2D SliceView displayableManager.
bool GetWorldCoordinatesChanged (double *worldCoordinates1, double *worldCoordinates2)
 Check if there are real changes between two sets of worldCoordinates.
virtual void GetWorldToLocalCoordinates (vtkMRMLAnnotationNode *node, double *worldCoordinates, double *localCoordinates)
 Convert world coordinates to local using mrml parent transform.
virtual bool Is2DDisplayableManager ()
bool IsInLightboxMode ()
void PrintSelf (ostream &os, vtkIndent indent)
virtual void PropagateMRMLToWidget (vtkMRMLAnnotationNode *node, vtkAbstractWidget *widget)
 Propagate properties of MRML node to widget.
virtual void PropagateWidgetToMRML (vtkAbstractWidget *widget, vtkMRMLAnnotationNode *node)
 Propagate properties of widget to MRML node.
void RestrictDisplayCoordinatesToViewport (double *displayCoordinates)
 Check if the displayCoordinates are inside the viewport and if not, correct the displayCoordinates.
virtual void SetParentTransformToWidget (vtkMRMLAnnotationNode *vtkNotUsed(node), vtkAbstractWidget *vtkNotUsed(widget))
 Set mrml parent transform to widgets.
virtual void SetScaleFactor2D (double)
 Set/Get the 2d scale factor to divide 3D scale by to show 2D elements appropriately (usually set to 300)
 vtkTypeRevisionMacro (vtkMRMLAnnotationDisplayableManager, vtkMRMLAbstractDisplayableManager)

Static Public Member Functions

static
vtkMRMLAnnotationDisplayableManager
New ()

Protected Member Functions

void AddObserversToInteractionNode ()
 Observe the interaction node.
void AddObserversToSelectionNode ()
virtual void Create ()
virtual vtkAbstractWidget * CreateWidget (vtkMRMLAnnotationNode *node)
 Create a widget.
virtual int GetDisableInteractorStyleEventsProcessing ()
 Accessor for internal flag that disables interactor style event processing.
void GetDisplayToViewportCoordinates (double x, double y, double *viewportCoordinates)
 Convert display to viewport coordinates.
void GetDisplayToViewportCoordinates (double *displayCoordinates, double *viewportCoordinates)
vtkHandleWidget * GetSeed (int index)
 Return the placed seeds.
vtkAbstractWidget * GetWidget (vtkMRMLAnnotationNode *node)
 Get the widget of a node.
void GetWorldToDisplayCoordinates (double r, double a, double s, double *displayCoordinates)
 Convert display to world coordinates.
void GetWorldToDisplayCoordinates (double *worldCoordinates, double *displayCoordinates)
bool IsCorrectDisplayableManager ()
 Check if it is the right displayManager.
virtual bool IsManageable (vtkMRMLNode *node)
virtual bool IsManageable (const char *nodeID)
virtual bool IsWidgetDisplayable (vtkMRMLSliceNode *sliceNode, vtkMRMLAnnotationNode *node)
 Check, if the widget is displayable in the current slice geometry.
virtual void OnClickInRenderWindow (double x, double y, const char *associatedNodeID=NULL)
 Callback for click in RenderWindow.
void OnClickInRenderWindowGetCoordinates ()
virtual void OnInteractorStyleEvent (int eventid)
 Respond to interactor style events.
virtual void OnMRMLAnnotationControlPointModifiedEvent (vtkMRMLNode *node)
virtual void OnMRMLAnnotationDisplayNodeModifiedEvent (vtkMRMLNode *node)
virtual void OnMRMLAnnotationNodeLockModifiedEvent (vtkMRMLNode *node)
virtual void OnMRMLAnnotationNodeModifiedEvent (vtkMRMLNode *node)
 Preset functions for certain events.
virtual void OnMRMLAnnotationNodeTransformModifiedEvent (vtkMRMLNode *node)
virtual void OnMRMLDisplayableNodeModifiedEvent (vtkObject *caller)
 Called after the corresponding MRML View container was modified.
virtual void OnMRMLSceneEndClose ()
virtual void OnMRMLSceneNodeAdded (vtkMRMLNode *node)
virtual void OnMRMLSceneNodeRemoved (vtkMRMLNode *node)
virtual void OnMRMLSelectionNodeUnitModifiedEvent (vtkMRMLSelectionNode *node)
virtual void OnMRMLSliceNodeModifiedEvent (vtkMRMLSliceNode *sliceNode)
 Handler for specific SliceView actions.
virtual void OnWidgetCreated (vtkAbstractWidget *widget, vtkMRMLAnnotationNode *node)
 Gets called when widget was created.
virtual void PlaceSeed (double x, double y)
 Place a seed for widgets.
virtual void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData)
virtual void RemoveMRMLObservers ()
 Remove MRML observers.
void RemoveObserversFromInteractionNode ()
void RemoveObserversFromSelectionNode ()
virtual void RequestRender ()
 wrap the superclass render request in a check for batch processing
void SetAndObserveNode (vtkMRMLAnnotationNode *annotationNode)
 Observe one node.
void SetAndObserveNodes ()
 Observe all associated nodes.
virtual void SetMRMLSceneInternal (vtkMRMLScene *newScene)
virtual void UpdateFromMRML ()
virtual void UpdateFromMRMLScene ()
virtual void UpdatePosition (vtkAbstractWidget *vtkNotUsed(widget), vtkMRMLNode *vtkNotUsed(node))
 Update just the position for the widget, implemented by subclasses.
 vtkMRMLAnnotationDisplayableManager ()
virtual ~vtkMRMLAnnotationDisplayableManager ()

Protected Attributes

vtkMRMLAnnotationDisplayableManagerHelperHelper
double LastClickWorldCoordinates [4]
vtkMRMLAnnotationClickCounterm_ClickCounter
 Counter for clicks in Render Window.
const char * m_Focus
 Focus of this displayableManager is set to a specific annotation type when inherited.
int m_Updating
 Disable processing when updating is in progress.

Detailed Description

Definition at line 41 of file vtkMRMLAnnotationDisplayableManager.h.


Constructor & Destructor Documentation

vtkMRMLAnnotationDisplayableManager::vtkMRMLAnnotationDisplayableManager ( ) [protected]
virtual vtkMRMLAnnotationDisplayableManager::~vtkMRMLAnnotationDisplayableManager ( ) [protected, virtual]

Member Function Documentation

bool vtkMRMLAnnotationDisplayableManager::AddAnnotation ( vtkMRMLAnnotationNode node)

Set up data structures for an annotation node. Returns false on failure or if it's already set up. Can be called to reinitialise a node's widgets after calling RemoveWidgetAndNode on the Helper

See also:
vtkMRMLAnnotationDisplayableManagerHelper::RemoveWidgetAndNode()
void vtkMRMLAnnotationDisplayableManager::AddObserversToInteractionNode ( ) [protected]

Observe the interaction node.

void vtkMRMLAnnotationDisplayableManager::AddObserversToSelectionNode ( ) [protected]

Observe the selection node for: vtkMRMLSelectionNode::UnitModifiedEvent events to update the unit of the annotation nodes.

See also:
RemoveObserversFromSelectionNode(), AddObserversToInteractionNode(), OnMRMLSelectionNodeUnitModifiedEvent()
virtual void vtkMRMLAnnotationDisplayableManager::Create ( ) [protected, virtual]

Called after a valid MRML DisplayableNode is set. By default it simulates a ModifiedEvent event on the displayable node so that ProcessMRMLNodesEvents(displayableNode, ModifiedEvent) is called.

Note:
GetRenderer() and GetMRMLDisplayableNode() will return valid object

Reimplemented from vtkMRMLAbstractDisplayableManager.

virtual vtkAbstractWidget* vtkMRMLAnnotationDisplayableManager::CreateWidget ( vtkMRMLAnnotationNode node) [protected, virtual]
virtual int vtkMRMLAnnotationDisplayableManager::GetDisableInteractorStyleEventsProcessing ( ) [protected, virtual]

Accessor for internal flag that disables interactor style event processing.

bool vtkMRMLAnnotationDisplayableManager::GetDisplayCoordinatesChanged ( double *  displayCoordinates1,
double *  displayCoordinates2 
)

Check if there are real changes between two sets of displayCoordinates.

void vtkMRMLAnnotationDisplayableManager::GetDisplayToViewportCoordinates ( double  x,
double  y,
double *  viewportCoordinates 
) [protected]

Convert display to viewport coordinates.

void vtkMRMLAnnotationDisplayableManager::GetDisplayToViewportCoordinates ( double *  displayCoordinates,
double *  viewportCoordinates 
) [protected]
void vtkMRMLAnnotationDisplayableManager::GetDisplayToWorldCoordinates ( double  x,
double  y,
double *  worldCoordinates 
)

Convert display to world coordinates.

void vtkMRMLAnnotationDisplayableManager::GetDisplayToWorldCoordinates ( double *  displayCoordinates,
double *  worldCoordinates 
)
int vtkMRMLAnnotationDisplayableManager::GetLightboxIndex ( vtkMRMLAnnotationNode node,
int  controlPointIndex = 0 
)

Gets the world coordinate of the annotation node, transforms it to display coordinates. Defaults to returning the 0th control point's light box index. Returns -1 if not in lightbox mode.

virtual double vtkMRMLAnnotationDisplayableManager::GetScaleFactor2D ( ) [virtual]
vtkHandleWidget* vtkMRMLAnnotationDisplayableManager::GetSeed ( int  index) [protected]

Return the placed seeds.

vtkMRMLSliceNode* vtkMRMLAnnotationDisplayableManager::GetSliceNode ( )

Get the sliceNode, if registered. This would mean it is a 2D SliceView displayableManager.

vtkAbstractWidget* vtkMRMLAnnotationDisplayableManager::GetWidget ( vtkMRMLAnnotationNode node) [protected]

Get the widget of a node.

bool vtkMRMLAnnotationDisplayableManager::GetWorldCoordinatesChanged ( double *  worldCoordinates1,
double *  worldCoordinates2 
)

Check if there are real changes between two sets of worldCoordinates.

void vtkMRMLAnnotationDisplayableManager::GetWorldToDisplayCoordinates ( double  r,
double  a,
double  s,
double *  displayCoordinates 
) [protected]

Convert display to world coordinates.

Convert display to world coordinates

void vtkMRMLAnnotationDisplayableManager::GetWorldToDisplayCoordinates ( double *  worldCoordinates,
double *  displayCoordinates 
) [protected]
virtual void vtkMRMLAnnotationDisplayableManager::GetWorldToLocalCoordinates ( vtkMRMLAnnotationNode node,
double *  worldCoordinates,
double *  localCoordinates 
) [virtual]

Convert world coordinates to local using mrml parent transform.

virtual bool vtkMRMLAnnotationDisplayableManager::Is2DDisplayableManager ( ) [virtual]

Check if this is a 2d SliceView displayable manager, returns true if so, false otherwise. Checks return from GetSliceNode for non null, which means it's a 2d displayable manager

bool vtkMRMLAnnotationDisplayableManager::IsCorrectDisplayableManager ( ) [protected]

Check if it is the right displayManager.

bool vtkMRMLAnnotationDisplayableManager::IsInLightboxMode ( )

Return true if in lightbox mode - there is a slice node that has layout grid columns or rows > 1

virtual bool vtkMRMLAnnotationDisplayableManager::IsManageable ( const char *  nodeID) [protected, virtual]

Return true if this displayable manager supports(can manage) that node ID, false otherwise. Can be reimplemented to add more conditions.

See also:
IsManageable(vtkMRMLNode*), IsCorrectDisplayableManager()
virtual bool vtkMRMLAnnotationDisplayableManager::IsManageable ( vtkMRMLNode node) [protected, virtual]

Return true if this displayable manager supports(can manage) that node, false otherwise. Can be reimplemented to add more conditions.

See also:
IsManageable(const char*), IsCorrectDisplayableManager()
virtual bool vtkMRMLAnnotationDisplayableManager::IsWidgetDisplayable ( vtkMRMLSliceNode sliceNode,
vtkMRMLAnnotationNode node 
) [protected, virtual]

Check, if the widget is displayable in the current slice geometry.

Reimplemented in vtkMRMLAnnotationROIDisplayableManager.

static vtkMRMLAnnotationDisplayableManager* vtkMRMLAnnotationDisplayableManager::New ( ) [static]
virtual void vtkMRMLAnnotationDisplayableManager::OnClickInRenderWindow ( double  x,
double  y,
const char *  associatedNodeID = NULL 
) [protected, virtual]
void vtkMRMLAnnotationDisplayableManager::OnClickInRenderWindowGetCoordinates ( ) [protected]
virtual void vtkMRMLAnnotationDisplayableManager::OnInteractorStyleEvent ( int  eventid) [protected, virtual]

Respond to interactor style events.

Reimplemented from vtkMRMLAbstractDisplayableManager.

Reimplemented in vtkMRMLAnnotationFiducialDisplayableManager.

virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLAnnotationControlPointModifiedEvent ( vtkMRMLNode node) [protected, virtual]
virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLAnnotationDisplayNodeModifiedEvent ( vtkMRMLNode node) [protected, virtual]
virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLAnnotationNodeLockModifiedEvent ( vtkMRMLNode node) [protected, virtual]
virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLAnnotationNodeModifiedEvent ( vtkMRMLNode node) [protected, virtual]

Preset functions for certain events.

virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLAnnotationNodeTransformModifiedEvent ( vtkMRMLNode node) [protected, virtual]
virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLDisplayableNodeModifiedEvent ( vtkObject *  caller) [protected, virtual]

Called after the corresponding MRML View container was modified.

Reimplemented from vtkMRMLAbstractDisplayableManager.

virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLSceneEndClose ( ) [protected, virtual]

If vtkMRMLScene::EndCloseEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also:
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneStartClose

Reimplemented from vtkMRMLAbstractLogic.

Reimplemented in vtkMRMLAnnotationFiducialDisplayableManager.

virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLSceneNodeAdded ( vtkMRMLNode ) [protected, virtual]

If vtkMRMLScene::NodeAddedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also:
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneNodeRemoved, vtkMRMLScene::NodeAboutToBeAdded

Reimplemented from vtkMRMLAbstractLogic.

virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLSceneNodeRemoved ( vtkMRMLNode ) [protected, virtual]

If vtkMRMLScene::NodeRemovedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also:
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneNodeAdded, vtkMRMLScene::NodeAboutToBeRemoved

Reimplemented from vtkMRMLAbstractLogic.

Reimplemented in vtkMRMLAnnotationROIDisplayableManager.

virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLSelectionNodeUnitModifiedEvent ( vtkMRMLSelectionNode node) [inline, protected, virtual]
virtual void vtkMRMLAnnotationDisplayableManager::OnMRMLSliceNodeModifiedEvent ( vtkMRMLSliceNode sliceNode) [protected, virtual]

Handler for specific SliceView actions.

Reimplemented in vtkMRMLAnnotationROIDisplayableManager.

virtual void vtkMRMLAnnotationDisplayableManager::OnWidgetCreated ( vtkAbstractWidget *  widget,
vtkMRMLAnnotationNode node 
) [protected, virtual]
virtual void vtkMRMLAnnotationDisplayableManager::PlaceSeed ( double  x,
double  y 
) [protected, virtual]

Place a seed for widgets.

void vtkMRMLAnnotationDisplayableManager::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual void vtkMRMLAnnotationDisplayableManager::ProcessMRMLNodesEvents ( vtkObject *  caller,
unsigned long  event,
void *  callData 
) [protected, virtual]

Receives all the events fired by the nodes. To listen to a node, you can add an observer using GetMRMLNodesCallbackCommand() or use the utility macros vtkSet[AndObserve]MRMLNode[Event]Macro ProcessMRMLNodesEvents calls OnMRMLNodeModified when event is vtkCommand::ModifiedEvent.

See also:
ProcessMRMLSceneEvents, ProcessMRMLLogicsEvents, OnMRMLNodeModified(), vtkSetAndObserveMRMLNodeMacro, vtkSetAndObserveMRMLNodeMacro, vtkSetAndObserveMRMLNodeEventMacro

Reimplemented from vtkMRMLAbstractDisplayableManager.

virtual void vtkMRMLAnnotationDisplayableManager::PropagateMRMLToWidget ( vtkMRMLAnnotationNode node,
vtkAbstractWidget *  widget 
) [virtual]
virtual void vtkMRMLAnnotationDisplayableManager::PropagateWidgetToMRML ( vtkAbstractWidget *  widget,
vtkMRMLAnnotationNode node 
) [virtual]
virtual void vtkMRMLAnnotationDisplayableManager::RemoveMRMLObservers ( ) [protected, virtual]

Remove MRML observers.

Reimplemented from vtkMRMLAbstractDisplayableManager.

void vtkMRMLAnnotationDisplayableManager::RemoveObserversFromInteractionNode ( ) [protected]
void vtkMRMLAnnotationDisplayableManager::RemoveObserversFromSelectionNode ( ) [protected]
virtual void vtkMRMLAnnotationDisplayableManager::RequestRender ( ) [protected, virtual]

wrap the superclass render request in a check for batch processing

Reimplemented from vtkMRMLAbstractDisplayableManager.

void vtkMRMLAnnotationDisplayableManager::RestrictDisplayCoordinatesToViewport ( double *  displayCoordinates)

Check if the displayCoordinates are inside the viewport and if not, correct the displayCoordinates.

void vtkMRMLAnnotationDisplayableManager::SetAndObserveNode ( vtkMRMLAnnotationNode annotationNode) [protected]

Observe one node.

void vtkMRMLAnnotationDisplayableManager::SetAndObserveNodes ( ) [protected]

Observe all associated nodes.

virtual void vtkMRMLAnnotationDisplayableManager::SetMRMLSceneInternal ( vtkMRMLScene newScene) [protected, virtual]

Called by SetMRMLScene - Used to initialize the Scene Observe all the events of the scene and call OnMRMLSceneEndClose() or OnMRMLSceneEndImport() if the new scene is valid

Reimplemented from vtkMRMLAbstractDisplayableManager.

virtual void vtkMRMLAnnotationDisplayableManager::SetParentTransformToWidget ( vtkMRMLAnnotationNode vtkNotUsednode,
vtkAbstractWidget *  vtkNotUsedwidget 
) [inline, virtual]

Set mrml parent transform to widgets.

Definition at line 81 of file vtkMRMLAnnotationDisplayableManager.h.

virtual void vtkMRMLAnnotationDisplayableManager::SetScaleFactor2D ( double  ) [virtual]

Set/Get the 2d scale factor to divide 3D scale by to show 2D elements appropriately (usually set to 300)

virtual void vtkMRMLAnnotationDisplayableManager::UpdateFromMRML ( ) [protected, virtual]

Called from RequestRender method if UpdateFromMRMLRequested is true

See also:
RequestRender() SetUpdateFromMRMLRequested()

Reimplemented from vtkMRMLAbstractDisplayableManager.

virtual void vtkMRMLAnnotationDisplayableManager::UpdateFromMRMLScene ( ) [protected, virtual]

Called after the corresponding MRML event is triggered, from AbstractDisplayableManager

See also:
ProcessMRMLSceneEvents

Reimplemented from vtkMRMLAbstractLogic.

virtual void vtkMRMLAnnotationDisplayableManager::UpdatePosition ( vtkAbstractWidget *  vtkNotUsedwidget,
vtkMRMLNode vtkNotUsednode 
) [inline, protected, virtual]

Update just the position for the widget, implemented by subclasses.

Definition at line 177 of file vtkMRMLAnnotationDisplayableManager.h.

vtkMRMLAnnotationDisplayableManager::vtkTypeRevisionMacro ( vtkMRMLAnnotationDisplayableManager  ,
vtkMRMLAbstractDisplayableManager   
)

Member Data Documentation

Definition at line 238 of file vtkMRMLAnnotationDisplayableManager.h.

Definition at line 242 of file vtkMRMLAnnotationDisplayableManager.h.

Counter for clicks in Render Window.

Definition at line 174 of file vtkMRMLAnnotationDisplayableManager.h.

Focus of this displayableManager is set to a specific annotation type when inherited.

Definition at line 229 of file vtkMRMLAnnotationDisplayableManager.h.

Disable processing when updating is in progress.

Definition at line 232 of file vtkMRMLAnnotationDisplayableManager.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines