Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkSlicerLayerDMLogic Class Reference

#include <Modules/Loadable/LayerDM/Logic/vtkSlicerLayerDMLogic.h>

Inheritance diagram for vtkSlicerLayerDMLogic:
Collaboration diagram for vtkSlicerLayerDMLogic:

Public Types

typedef vtkSlicerModuleLogic Superclass
 
- Public Types inherited from vtkSlicerModuleLogic
typedef vtkMRMLModuleLogic Superclass
 
- Public Types inherited from vtkMRMLModuleLogic
typedef vtkMRMLAbstractLogic Superclass
 
- Public Types inherited from vtkMRMLAbstractLogic
typedef vtkObject Superclass
 
typedef void(vtkMRMLAbstractLogic::* TaskFunctionPointer) (void *clientdata)
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void operator= (const vtkSlicerLayerDMLogic &)=delete
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void RegisterNodes () override
 Registers the LayerDM MRML nodes in the scene.
 
 vtkSlicerLayerDMLogic (const vtkSlicerLayerDMLogic &)=delete
 
- Public Member Functions inherited from vtkSlicerModuleLogic
virtual vtkSlicerApplicationLogic * GetApplicationLogic ()
 Get access to overall application state.
 
virtual vtkMRMLAbstractLogic * GetModuleLogic (const char *moduleName)
 Convenience method for getting another module's logic from the application logic.
 
std::string GetModuleShareDirectory () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void SetModuleShareDirectory (const std::string &shareDirectory)
 
- Public Member Functions inherited from vtkMRMLModuleLogic
virtual std::vector< vtkSmartPointer< vtkMRMLFileIOHandler > > CreateFileIOHandlers ()
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
- Public Member Functions inherited from vtkMRMLAbstractLogic
virtual vtkMRMLApplicationLogic * GetMRMLApplicationLogic () const
 Get access to overall application state.
 
vtkMRMLScene * GetMRMLScene () const
 Return a reference to the current MRML scene.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic)
 
void SetMRMLScene (vtkMRMLScene *newScene)
 Set and observe the MRMLScene.
 

Static Public Member Functions

static void CreateDefaultEventTranslation (vtkMRMLNode *node, const std::string &singletonId, const std::function< void(vtkMRMLLayerDMWidgetEventTranslationNode *)> &configureF)
 
template<typename T>
static T * CreateDisplayNode (vtkMRMLNode *node, bool allowMultiple=false)
 
template<typename T>
static T * CreateReferenceNode (vtkMRMLNode *node, bool allowMultiple=false)
 
template<typename T>
static T * CreateReferenceNode (vtkMRMLNode *node, const char *role, bool allowMultiple=false)
 
static vtkMRMLLayerDMWidgetEventTranslationNode * CreateWidgetEventTranslationSingleton (vtkMRMLScene *scene, const std::string &singletonId)
 
template<typename T>
static T * GetDisplayNode (vtkMRMLNode *node)
 
static std::string GetDisplayRole ()
 
static std::string GetEventTranslationRole ()
 
template<typename T>
static T * GetReferenceNode (vtkMRMLNode *node)
 
template<typename T>
static T * GetReferenceNode (vtkMRMLNode *node, const char *role)
 
template<typename T>
static std::vector< T * > GetReferenceNodes (vtkMRMLNode *node)
 
template<typename T>
static std::vector< T * > GetReferenceNodes (vtkMRMLNode *node, const char *role)
 
static vtkMRMLLayerDMWidgetEventTranslationNode * GetWidgetEventTranslationNode (vtkMRMLNode *node)
 
static vtkMRMLLayerDMWidgetEventTranslationNode * GetWidgetEventTranslationSingleton (vtkMRMLScene *scene, const std::string &singletonId)
 Get the singleton translation node with given ID if it exists in the scene.
 
static vtkMRMLLayerDMWidgetEventTranslationNode * GetWidgetEventTranslationSingleton (vtkMRMLScene *scene, const std::string &singletonId, const std::function< void(vtkMRMLLayerDMWidgetEventTranslationNode *)> &configureF)
 
static int IsTypeOf (const char *type)
 
static vtkSlicerLayerDMLogic * New ()
 
template<typename T>
static void RegisterNodeIfNeeded (vtkMRMLScene *scene)
 
static vtkSlicerLayerDMLogic * SafeDownCast (vtkObject *o)
 
static void SetWidgetEventTranslationNode (vtkMRMLNode *node, vtkMRMLLayerDMWidgetEventTranslationNode *translationNode)
 Attach a translation node ref to the input node.
 
template<typename T>
static T * AddReferenceNode (vtkMRMLNode *node, T *nodeRef, const char *role)
 
template<typename T>
static T * SetReferenceNode (vtkMRMLNode *node, T *nodeRef, const char *role)
 
template<typename T>
static T * SetNthReferenceNode (vtkMRMLNode *node, T *nodeRef, const char *role, int nthRef)
 
- Static Public Member Functions inherited from vtkSlicerModuleLogic
static int IsTypeOf (const char *type)
 
static vtkSlicerModuleLogic * New ()
 The Usual vtk class functions.
 
static vtkSlicerModuleLogic * SafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLModuleLogic
static int IsTypeOf (const char *type)
 
static vtkMRMLModuleLogic * New ()
 
static vtkMRMLModuleLogic * SafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLAbstractLogic
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractLogic * New ()
 
static vtkMRMLAbstractLogic * SafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkSlicerLayerDMLogic ()=default
 
 ~vtkSlicerLayerDMLogic () override=default
 
- Protected Member Functions inherited from vtkSlicerModuleLogic
 vtkSlicerModuleLogic ()
 
 ~vtkSlicerModuleLogic () override
 
- Protected Member Functions inherited from vtkMRMLModuleLogic
 vtkMRMLModuleLogic ()
 
 ~vtkMRMLModuleLogic () override
 
- Protected Member Functions inherited from vtkMRMLAbstractLogic
int EndModify (bool wasModifying)
 
virtual bool EnterMRMLLogicsCallback () const
 
virtual bool EnterMRMLNodesCallback () const
 
virtual bool EnterMRMLSceneCallback () const
 
bool GetDisableModifiedEvent () const
 
int GetInMRMLLogicsCallbackFlag () const
 
int GetInMRMLNodesCallbackFlag () const
 
int GetInMRMLSceneCallbackFlag () const
 
vtkCallbackCommand * GetMRMLLogicsCallbackCommand ()
 
vtkObserverManager * GetMRMLLogicsObserverManager () const
 
vtkCallbackCommand * GetMRMLNodesCallbackCommand ()
 
vtkObserverManager * GetMRMLNodesObserverManager () const
 
vtkCallbackCommand * GetMRMLSceneCallbackCommand ()
 
vtkObserverManager * GetMRMLSceneObserverManager () const
 
int GetPendingModifiedEventCount () const
 
int GetProcessingMRMLSceneEvent () const
 Return the event id currently processed or 0 if any.
 
int InvokePendingModifiedEvent ()
 
void Modified () override
 
virtual void ObserveMRMLScene ()
 
virtual void OnMRMLNodeModified (vtkMRMLNode *)
 
virtual void OnMRMLSceneEndBatchProcess ()
 
virtual void OnMRMLSceneEndClose ()
 
virtual void OnMRMLSceneEndImport ()
 
virtual void OnMRMLSceneEndRestore ()
 
virtual void OnMRMLSceneNew ()
 
virtual void OnMRMLSceneNodeAdded (vtkMRMLNode *)
 
virtual void OnMRMLSceneNodeRemoved (vtkMRMLNode *)
 
virtual void OnMRMLSceneStartBatchProcess ()
 
virtual void OnMRMLSceneStartClose ()
 
virtual void OnMRMLSceneStartImport ()
 
virtual void OnMRMLSceneStartRestore ()
 
virtual void ProcessMRMLLogicsEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData)
 
void SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=nullptr)
 
void SetDisableModifiedEvent (bool onOff)
 
void SetInMRMLLogicsCallbackFlag (int flag)
 
void SetInMRMLNodesCallbackFlag (int flag)
 
void SetInMRMLSceneCallbackFlag (int flag)
 
virtual void SetMRMLSceneInternal (vtkMRMLScene *newScene)
 
void SetProcessingMRMLSceneEvent (int event)
 
bool StartModify ()
 
virtual void UnobserveMRMLScene ()
 
virtual void UpdateFromMRMLScene ()
 
 vtkMRMLAbstractLogic ()
 
 ~vtkMRMLAbstractLogic () override
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkMRMLAbstractLogic
static void MRMLLogicsCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLLogicCallback is a static function to relay modified events from the logics.
 
static void MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLNodesCallback is a static function to relay modified events from the nodes.
 
static void MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 

Detailed Description

Logic class for the LayerDM module. Provides helper templates to simplify registering and accessing custom display nodes.

Definition at line 35 of file vtkSlicerLayerDMLogic.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkSlicerLayerDMLogic() [1/2]

vtkSlicerLayerDMLogic::vtkSlicerLayerDMLogic ( const vtkSlicerLayerDMLogic & )
delete

◆ vtkSlicerLayerDMLogic() [2/2]

vtkSlicerLayerDMLogic::vtkSlicerLayerDMLogic ( )
protecteddefault

◆ ~vtkSlicerLayerDMLogic()

vtkSlicerLayerDMLogic::~vtkSlicerLayerDMLogic ( )
overrideprotecteddefault

Member Function Documentation

◆ AddReferenceNode()

template<typename T>
T * vtkSlicerLayerDMLogic::AddReferenceNode ( vtkMRMLNode * node,
T * nodeRef,
const char * role )
static

Utility method change the node references of the input node using nodeRef and given role. If either the node or nodeRef is nullptr, does nothing. Will invoke a Modified event on the nodeRef after modification.

Definition at line 276 of file vtkSlicerLayerDMLogic.h.

◆ CreateDefaultEventTranslation()

static void vtkSlicerLayerDMLogic::CreateDefaultEventTranslation ( vtkMRMLNode * node,
const std::string & singletonId,
const std::function< void(vtkMRMLLayerDMWidgetEventTranslationNode *)> & configureF )
static

If the input node doesn't have any translation node, sets the singleton TL node as TL node. If the singleton doesn't yet exist in the scene, creates and initializes the TL node singleton given the input configure method.

If the node already has a TL node, does nothing. If the node doesn't have a TL node and isn't set in the Scene, does nothing.

◆ CreateDisplayNode()

template<typename T>
T * vtkSlicerLayerDMLogic::CreateDisplayNode ( vtkMRMLNode * node,
bool allowMultiple = false )
static

Creates a display node of given type and attach it to the input node

Parameters
nodeinstance of node for which the display node will be created. If the node is nullptr or not attached to a scene, will not create any node.
allowMultiplewhen false, will return the existing display node if a display node of given type / role is already attached to the input node.

Definition at line 240 of file vtkSlicerLayerDMLogic.h.

◆ CreateReferenceNode() [1/2]

template<typename T>
T * vtkSlicerLayerDMLogic::CreateReferenceNode ( vtkMRMLNode * node,
bool allowMultiple = false )
static

Creates a reference node of given type and role and attach it to the input node.

Parameters
nodeinstance of node for which the display node will be created. If the node is nullptr or not attached to a scene, will not create any node.
allowMultiplewhen false, will return the existing ref node if a ref node of given type / role is already attached to the input node.

Expects T to have a static T::GetReferenceRole method returning its reference role.

Definition at line 270 of file vtkSlicerLayerDMLogic.h.

◆ CreateReferenceNode() [2/2]

template<typename T>
T * vtkSlicerLayerDMLogic::CreateReferenceNode ( vtkMRMLNode * node,
const char * role,
bool allowMultiple = false )
static

Creates a reference node of given type and role and attach it to the input node.

Parameters
nodeinstance of node for which the display node will be created. If the node is nullptr or not attached to a scene, will not create any node.
rolename of the role for the created and attached reference node. Role can be any arbitrary string.
allowMultiplewhen false, will return the existing ref node if a ref node of given type / role is already attached to the input node.

Definition at line 251 of file vtkSlicerLayerDMLogic.h.

◆ CreateWidgetEventTranslationSingleton()

static vtkMRMLLayerDMWidgetEventTranslationNode * vtkSlicerLayerDMLogic::CreateWidgetEventTranslationSingleton ( vtkMRMLScene * scene,
const std::string & singletonId )
static

Create a singleton translation node with given ID.

By default, the created singleton is set to not be saved with the scene to avoid changing interaction events when loading scenes coming from other users.

◆ GetClassName()

virtual const char * vtkSlicerLayerDMLogic::GetClassName ( )
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ GetDisplayNode()

template<typename T>
T * vtkSlicerLayerDMLogic::GetDisplayNode ( vtkMRMLNode * node)
static
Returns
the first display node attached to the input displayable node with given type

Definition at line 191 of file vtkSlicerLayerDMLogic.h.

◆ GetDisplayRole()

static std::string vtkSlicerLayerDMLogic::GetDisplayRole ( )
static
Returns
the role associated with display nodes (equivalent to vtkMRMLDisplayableNode::GetDisplayRole but non-virtual and static)

◆ GetEventTranslationRole()

static std::string vtkSlicerLayerDMLogic::GetEventTranslationRole ( )
static
Returns
the role associated with widget event translation

◆ GetReferenceNode() [1/2]

template<typename T>
T * vtkSlicerLayerDMLogic::GetReferenceNode ( vtkMRMLNode * node)
static
Returns
the first reference node of given type attached to the input node with given role. Expects T to have a static T::GetReferenceRole method returning its reference role.

Definition at line 209 of file vtkSlicerLayerDMLogic.h.

◆ GetReferenceNode() [2/2]

template<typename T>
T * vtkSlicerLayerDMLogic::GetReferenceNode ( vtkMRMLNode * node,
const char * role )
static
Returns
the first reference node of given type attached to the input node with given role.

Definition at line 202 of file vtkSlicerLayerDMLogic.h.

◆ GetReferenceNodes() [1/2]

template<typename T>
std::vector< T * > vtkSlicerLayerDMLogic::GetReferenceNodes ( vtkMRMLNode * node)
static
Returns
all the reference nodes of given type attached to the input node with given role. Expects T to have a static T::GetReferenceRole method returning its reference role.

Definition at line 234 of file vtkSlicerLayerDMLogic.h.

◆ GetReferenceNodes() [2/2]

template<typename T>
std::vector< T * > vtkSlicerLayerDMLogic::GetReferenceNodes ( vtkMRMLNode * node,
const char * role )
static
Returns
all the reference nodes of given type attached to the input node with given role.

Definition at line 215 of file vtkSlicerLayerDMLogic.h.

◆ GetWidgetEventTranslationNode()

static vtkMRMLLayerDMWidgetEventTranslationNode * vtkSlicerLayerDMLogic::GetWidgetEventTranslationNode ( vtkMRMLNode * node)
static
Returns
the widget event translation node attached to the input node.

◆ GetWidgetEventTranslationSingleton() [1/2]

static vtkMRMLLayerDMWidgetEventTranslationNode * vtkSlicerLayerDMLogic::GetWidgetEventTranslationSingleton ( vtkMRMLScene * scene,
const std::string & singletonId )
static

Get the singleton translation node with given ID if it exists in the scene.

◆ GetWidgetEventTranslationSingleton() [2/2]

static vtkMRMLLayerDMWidgetEventTranslationNode * vtkSlicerLayerDMLogic::GetWidgetEventTranslationSingleton ( vtkMRMLScene * scene,
const std::string & singletonId,
const std::function< void(vtkMRMLLayerDMWidgetEventTranslationNode *)> & configureF )
static

Get the singleton translation node with given ID if it exists in the scene. If it doesn't exist in the scene, creates the singleton and configures the singleton given the input configure function.

◆ IsA()

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

Reimplemented from vtkSlicerModuleLogic.

◆ IsTypeOf()

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

◆ New()

static vtkSlicerLayerDMLogic * vtkSlicerLayerDMLogic::New ( )
static

◆ operator=()

void vtkSlicerLayerDMLogic::operator= ( const vtkSlicerLayerDMLogic & )
delete

◆ PrintSelf()

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

◆ RegisterNodeIfNeeded()

template<typename T>
void vtkSlicerLayerDMLogic::RegisterNodeIfNeeded ( vtkMRMLScene * scene)
static

Register node if the node isn't already registered in the scene. Otherwise, registering multiple time the same node will overwrite the previous node and generate a warning.

Definition at line 176 of file vtkSlicerLayerDMLogic.h.

◆ RegisterNodes()

void vtkSlicerLayerDMLogic::RegisterNodes ( )
overridevirtual

Registers the LayerDM MRML nodes in the scene.

Reimplemented from vtkMRMLAbstractLogic.

◆ SafeDownCast()

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

◆ SetNthReferenceNode()

template<typename T>
T * vtkSlicerLayerDMLogic::SetNthReferenceNode ( vtkMRMLNode * node,
T * nodeRef,
const char * role,
int nthRef )
static

Definition at line 288 of file vtkSlicerLayerDMLogic.h.

◆ SetReferenceNode()

template<typename T>
T * vtkSlicerLayerDMLogic::SetReferenceNode ( vtkMRMLNode * node,
T * nodeRef,
const char * role )
static

Definition at line 282 of file vtkSlicerLayerDMLogic.h.

◆ SetWidgetEventTranslationNode()

static void vtkSlicerLayerDMLogic::SetWidgetEventTranslationNode ( vtkMRMLNode * node,
vtkMRMLLayerDMWidgetEventTranslationNode * translationNode )
static

Attach a translation node ref to the input node.


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