10#ifndef __vtkMRMLAbstractLogic_h
11#define __vtkMRMLAbstractLogic_h
22#include <vtkCommand.h>
27#include "vtkMRMLLogicExport.h"
35#ifndef vtkSetMRMLNodeMacro
36#define vtkSetMRMLNodeMacro(node,value) { \
37 vtkObject *_oldNode = (node); \
38 this->GetMRMLNodesObserverManager()->SetObject( \
39 vtkObjectPointer(&(node)), (value)); \
40 vtkObject *_newNode = (node); \
41 if (_oldNode != _newNode) \
36#define vtkSetMRMLNodeMacro(node,value) { \ …
49#ifndef vtkSetAndObserveMRMLNodeMacro
66#define vtkSetAndObserveMRMLNodeMacro(node,value) { \
67 vtkObject *_oldNode = (node); \
68 this->GetMRMLNodesObserverManager()->SetAndObserveObject( \
69 vtkObjectPointer(&(node)), (value)); \
70 vtkObject *_newNode = (node); \
71 if (_oldNode != _newNode) \
66#define vtkSetAndObserveMRMLNodeMacro(node,value) { \ …
79#ifndef vtkSetAndObserveMRMLNodeEventsMacro
80#define vtkSetAndObserveMRMLNodeEventsMacro(node,value,events) { \
81 vtkObject *_oldNode = (node); \
82 this->GetMRMLNodesObserverManager()->SetAndObserveObjectEvents( \
83 vtkObjectPointer(&(node)), (value), (events)); \
84 vtkObject *_newNode = (node); \
85 if (_oldNode != _newNode) \
80#define vtkSetAndObserveMRMLNodeEventsMacro(node,value,events) { \ …
92#ifndef vtkObserveMRMLNodeMacro
93#define vtkObserveMRMLNodeMacro(node) \
95 this->GetMRMLNodesObserverManager()->ObserveObject( (node) ); \
93#define vtkObserveMRMLNodeMacro(node) \ …
100#ifndef vtkObserveMRMLNodeEventsMacro
101#define vtkObserveMRMLNodeEventsMacro(node, events) \
103 this->GetMRMLNodesObserverManager()->AddObjectEvents ( (node), (events) ); \
101#define vtkObserveMRMLNodeEventsMacro(node, events) \ …
107#ifndef vtkUnObserveMRMLNodeMacro
108#define vtkUnObserveMRMLNodeMacro(node) \
110 this->GetMRMLNodesObserverManager()->RemoveObjectEvents ( (node) ); \
108#define vtkUnObserveMRMLNodeMacro(node) \ …
114#ifndef vtkIsObservedMRMLNodeEventMacro
115#define vtkIsObservedMRMLNodeEventMacro(node, event) \
117 this->GetMRMLNodesObserverManager()->GetObservationsCount(node, event) != 0 \
115#define vtkIsObservedMRMLNodeEventMacro(node, event) \ …
163 void SetAndObserveMRMLSceneEvents(
vtkMRMLScene * newScene, vtkIntArray * events, vtkFloatArray* priorities=
nullptr);
326 void SetAndObserveMRMLSceneInternal(
vtkMRMLScene *newScene);
343 vtkFloatArray *priorities=
nullptr);
404 static void MRMLSceneCallback(vtkObject *caller,
unsigned long eid,
void *clientData,
void *callData);
407 static void MRMLNodesCallback(vtkObject *caller,
unsigned long eid,
void *clientData,
void *callData);
410 static void MRMLLogicsCallback(vtkObject *caller,
unsigned long eid,
void *clientData,
void *callData);
444 vtkInternal * Internal;
453 return disabledModify;
460 if (!previousDisableModifiedEventState)
int GetProcessingMRMLSceneEvent() const
Return the event id currently processed or 0 if any.
virtual void OnMRMLSceneStartImport()
virtual void OnMRMLSceneStartClose()
virtual void OnMRMLNodeModified(vtkMRMLNode *)
vtkMRMLScene * GetMRMLScene() const
Return a reference to the current MRML scene.
vtkCallbackCommand * GetMRMLLogicsCallbackCommand()
int GetInMRMLSceneCallbackFlag() const
static vtkMRMLAbstractLogic * New()
void PrintSelf(ostream &os, vtkIndent indent) override
vtkCallbackCommand * GetMRMLNodesCallbackCommand()
void SetDisableModifiedEvent(bool onOff)
~vtkMRMLAbstractLogic() override
virtual void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData)
virtual bool EnterMRMLLogicsCallback() const
void SetInMRMLNodesCallbackFlag(int flag)
vtkCallbackCommand * GetMRMLSceneCallbackCommand()
virtual void UpdateFromMRMLScene()
void SetMRMLScene(vtkMRMLScene *newScene)
Set and observe the MRMLScene.
virtual void ProcessMRMLSceneEvents(vtkObject *caller, unsigned long event, void *callData)
virtual vtkMRMLApplicationLogic * GetMRMLApplicationLogic() const
Get access to overall application state.
virtual bool EnterMRMLSceneCallback() const
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.
vtkObserverManager * GetMRMLLogicsObserverManager() const
bool GetDisableModifiedEvent() const
virtual void OnMRMLSceneEndClose()
vtkObserverManager * GetMRMLNodesObserverManager() const
virtual void SetMRMLSceneInternal(vtkMRMLScene *newScene)
virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode *)
virtual void SetMRMLApplicationLogic(vtkMRMLApplicationLogic *logic)
virtual void UnobserveMRMLScene()
void(vtkMRMLAbstractLogic::* TaskFunctionPointer)(void *clientdata)
int EndModify(bool wasModifying)
int GetPendingModifiedEventCount() const
virtual void ObserveMRMLScene()
virtual void OnMRMLSceneNodeAdded(vtkMRMLNode *)
void SetAndObserveMRMLSceneEventsInternal(vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=nullptr)
virtual void OnMRMLSceneEndBatchProcess()
void SetInMRMLLogicsCallbackFlag(int flag)
virtual void OnMRMLSceneNew()
void SetInMRMLSceneCallbackFlag(int flag)
virtual void RegisterNodes()
int GetInMRMLNodesCallbackFlag() const
virtual void ProcessMRMLLogicsEvents(vtkObject *caller, unsigned long event, void *callData)
int InvokePendingModifiedEvent()
int GetInMRMLLogicsCallbackFlag() const
virtual void OnMRMLSceneEndImport()
virtual bool EnterMRMLNodesCallback() const
virtual void OnMRMLSceneStartRestore()
vtkObserverManager * GetMRMLSceneObserverManager() const
void SetProcessingMRMLSceneEvent(int event)
virtual void OnMRMLSceneEndRestore()
static void MRMLSceneCallback(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
virtual void OnMRMLSceneStartBatchProcess()
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
Manages adding and deleting of observers with events.