Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Classes | Macros
vtkMRMLAbstractLogic.h File Reference
#include <vtkObserverManager.h>
#include <vtkCommand.h>
#include <vtkObject.h>
#include "vtkMRMLLogicExport.h"
Include dependency graph for vtkMRMLAbstractLogic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vtkMRMLAbstractLogic
 Superclass for MRML logic classes. More...
 

Macros

#define vtkIsObservedMRMLNodeEventMacro(node, event)
 
#define vtkObserveMRMLNodeEventsMacro(node, events)
 
#define vtkObserveMRMLNodeMacro(node)
 
#define vtkSetAndObserveMRMLNodeEventsMacro(node, value, events)
 
#define vtkSetAndObserveMRMLNodeMacro(node, value)
 Set and observe a MRML node. Replace the existing value of node with value. Unobserve the old node and observe the ModifiedEvent of the new. When the new node is modified, vtkMRMLAbstractLogic::ProcessMRMLNodesEvents is called which propagate the call to vtkMRMLAbstractLogic::OnMRMLNodeModified(vtkMRMLNode*) automatically. More...
 
#define vtkSetMRMLNodeMacro(node, value)
 
#define vtkUnObserveMRMLNodeMacro(node)
 

Macro Definition Documentation

◆ vtkIsObservedMRMLNodeEventMacro

#define vtkIsObservedMRMLNodeEventMacro (   node,
  event 
)
Value:
( \
this->GetMRMLNodesObserverManager()->GetObservationsCount(node, event) != 0 \
)

Definition at line 115 of file vtkMRMLAbstractLogic.h.

◆ vtkObserveMRMLNodeEventsMacro

#define vtkObserveMRMLNodeEventsMacro (   node,
  events 
)
Value:
{ \
this->GetMRMLNodesObserverManager()->AddObjectEvents ( (node), (events) ); \
};

Definition at line 101 of file vtkMRMLAbstractLogic.h.

◆ vtkObserveMRMLNodeMacro

#define vtkObserveMRMLNodeMacro (   node)
Value:
{ \
this->GetMRMLNodesObserverManager()->ObserveObject( (node) ); \
};

Definition at line 93 of file vtkMRMLAbstractLogic.h.

◆ vtkSetAndObserveMRMLNodeEventsMacro

#define vtkSetAndObserveMRMLNodeEventsMacro (   node,
  value,
  events 
)
Value:
{ \
vtkObject *_oldNode = (node); \
this->GetMRMLNodesObserverManager()->SetAndObserveObjectEvents( \
vtkObjectPointer(&(node)), (value), (events)); \
vtkObject *_newNode = (node); \
if (_oldNode != _newNode) \
{ \
this->Modified(); \
} \
};
#define vtkObjectPointer(xx)

Definition at line 80 of file vtkMRMLAbstractLogic.h.

◆ vtkSetAndObserveMRMLNodeMacro

#define vtkSetAndObserveMRMLNodeMacro (   node,
  value 
)
Value:
{ \
vtkObject *_oldNode = (node); \
this->GetMRMLNodesObserverManager()->SetAndObserveObject( \
vtkObjectPointer(&(node)), (value)); \
vtkObject *_newNode = (node); \
if (_oldNode != _newNode) \
{ \
this->Modified(); \
} \
};
#define vtkObjectPointer(xx)

Set and observe a MRML node. Replace the existing value of node with value. Unobserve the old node and observe the ModifiedEvent of the new. When the new node is modified, vtkMRMLAbstractLogic::ProcessMRMLNodesEvents is called which propagate the call to vtkMRMLAbstractLogic::OnMRMLNodeModified(vtkMRMLNode*) automatically.

Note
Can't be used with objects other than vtkMRMLNodes
void vtkMRMLMyLogic::SetMyNode(vtkMRMLNode* newNode)
{
vtkSetAndObserveMRMLNodeMacro(this->MyNode, newNode);
this->OnMRMLNodeModified(this->MyNode);
}
See also
vtkMRMLAbstractLogic::ProcessMRMLNodesEvents(), vtkMRMLAbstractLogic::OnMRMLNodeModified()

Definition at line 66 of file vtkMRMLAbstractLogic.h.

◆ vtkSetMRMLNodeMacro

#define vtkSetMRMLNodeMacro (   node,
  value 
)
Value:
{ \
vtkObject *_oldNode = (node); \
this->GetMRMLNodesObserverManager()->SetObject( \
vtkObjectPointer(&(node)), (value)); \
vtkObject *_newNode = (node); \
if (_oldNode != _newNode) \
{ \
this->Modified(); \
} \
};
#define vtkObjectPointer(xx)

Definition at line 36 of file vtkMRMLAbstractLogic.h.

◆ vtkUnObserveMRMLNodeMacro

#define vtkUnObserveMRMLNodeMacro (   node)
Value:
{ \
this->GetMRMLNodesObserverManager()->RemoveObjectEvents ( (node) ); \
};

Definition at line 108 of file vtkMRMLAbstractLogic.h.