Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkObserverManager Class Reference

Manages adding and deleting of obserevers with events. More...

#include <Libs/MRML/Core/vtkObserverManager.h>

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

Public Types

typedef vtkObject Superclass
 

Public Member Functions

void AddObjectEvents (vtkObject *nodePtr, vtkIntArray *events, vtkFloatArray *priorities=0)
 add observers for specified events More...
 
void AssignOwner (vtkObject *owner)
 
virtual vtkCallbackCommand * GetCallbackCommand ()
 
virtual const char * GetClassName ()
 
void GetObjectEvents (vtkObject *nodePtr, vtkIntArray *events, vtkFloatArray *priorities)
 get a list of all observed events and priorities for the selected node More...
 
int GetObservationsCount (vtkObject *nodePtr, unsigned long event=0)
 
vtkObject * GetObserver ()
 Returns the owner if any, otherwise returns the manager itself. More...
 
virtual vtkObject * GetOwner ()
 
virtual int IsA (const char *type)
 
void ObserveObject (vtkObject *node, float priority=0.0)
 Observe ModifiedEvent on the object. More...
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
void RemoveObjectEvents (vtkObject *nodePtr)
 remove all observers for all events More...
 
void SetAndObserveObject (vtkObject **nodePtr, vtkObject *node, float priority=0.0, bool logWarningIfSameObservationExists=true)
 set vtkObject to a specified pointer, remove all observers for all events, add observer for Modify event More...
 
void SetAndObserveObjectEvents (vtkObject **nodePtr, vtkObject *node, vtkIntArray *events, vtkFloatArray *priorities=0, bool logWarningIfSameObservationExists=true)
 set vtkObject to a specified pointer, remove all observers for all events, add observers for specified events More...
 
void SetObject (vtkObject **nodePtr, vtkObject *node)
 set vtkObject to a specified pointer and remove all observers for all events More...
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkObserverManagerNew ()
 The Usual vtk class functions. More...
 
static vtkObserverManagerSafeDownCast (vtkObject *o)
 

Protected Member Functions

void operator= (const vtkObserverManager &)
 
 vtkObserverManager ()
 
 vtkObserverManager (const vtkObserverManager &)
 
virtual ~vtkObserverManager ()
 

Protected Attributes

vtkCallbackCommand * CallbackCommand
 
Holder for callback More...
 
std::map< vtkObject *, vtkUnsignedLongArray *> ObserverTags
 
vtkObject * Owner
 
The owner of the observer manager (e.g. the vtkMRMLNode) More...
 

Detailed Description

Manages adding and deleting of obserevers with events.

Class that manages adding and deleting of obserevers with events This class keeps track of obserevers and events added to each vtk object it caches tags returned by AddObserver method so that obserevers can be removed properly.

Definition at line 41 of file vtkObserverManager.h.

Member Typedef Documentation

◆ Superclass

typedef vtkObject vtkObserverManager::Superclass

Definition at line 47 of file vtkObserverManager.h.

Constructor & Destructor Documentation

◆ vtkObserverManager() [1/2]

vtkObserverManager::vtkObserverManager ( )
protected

◆ ~vtkObserverManager()

virtual vtkObserverManager::~vtkObserverManager ( )
protectedvirtual

◆ vtkObserverManager() [2/2]

vtkObserverManager::vtkObserverManager ( const vtkObserverManager )
protected

Member Function Documentation

◆ AddObjectEvents()

void vtkObserverManager::AddObjectEvents ( vtkObject *  nodePtr,
vtkIntArray *  events,
vtkFloatArray *  priorities = 0 
)

add observers for specified events

◆ AssignOwner()

void vtkObserverManager::AssignOwner ( vtkObject *  owner)
inline

Definition at line 77 of file vtkObserverManager.h.

◆ GetCallbackCommand()

virtual vtkCallbackCommand* vtkObserverManager::GetCallbackCommand ( )
virtual

◆ GetClassName()

virtual const char* vtkObserverManager::GetClassName ( )
virtual

◆ GetObjectEvents()

void vtkObserverManager::GetObjectEvents ( vtkObject *  nodePtr,
vtkIntArray *  events,
vtkFloatArray *  priorities 
)

get a list of all observed events and priorities for the selected node

◆ GetObservationsCount()

int vtkObserverManager::GetObservationsCount ( vtkObject *  nodePtr,
unsigned long  event = 0 
)

Return the number of observations by the manager on the node. If event is != 0 , only observations matching the events are counted

◆ GetObserver()

vtkObject* vtkObserverManager::GetObserver ( )

Returns the owner if any, otherwise returns the manager itself.

◆ GetOwner()

virtual vtkObject* vtkObserverManager::GetOwner ( )
virtual

accessors for the owner class

  • note we do not hold a registered pointer to the owner to avoid reference loops
  • the owner must be careful to always clean up the ObserverManager in the destructor (this is the standard use case)

◆ IsA()

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

◆ IsTypeOf()

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

◆ New()

static vtkObserverManager* vtkObserverManager::New ( )
static

The Usual vtk class functions.

◆ ObserveObject()

void vtkObserverManager::ObserveObject ( vtkObject *  node,
float  priority = 0.0 
)

Observe ModifiedEvent on the object.

◆ operator=()

void vtkObserverManager::operator= ( const vtkObserverManager )
protected

◆ PrintSelf()

void vtkObserverManager::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

◆ RemoveObjectEvents()

void vtkObserverManager::RemoveObjectEvents ( vtkObject *  nodePtr)

remove all observers for all events

◆ SafeDownCast()

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

◆ SetAndObserveObject()

void vtkObserverManager::SetAndObserveObject ( vtkObject **  nodePtr,
vtkObject *  node,
float  priority = 0.0,
bool  logWarningIfSameObservationExists = true 
)

set vtkObject to a specified pointer, remove all observers for all events, add observer for Modify event

◆ SetAndObserveObjectEvents()

void vtkObserverManager::SetAndObserveObjectEvents ( vtkObject **  nodePtr,
vtkObject *  node,
vtkIntArray *  events,
vtkFloatArray *  priorities = 0,
bool  logWarningIfSameObservationExists = true 
)

set vtkObject to a specified pointer, remove all observers for all events, add observers for specified events

◆ SetObject()

void vtkObserverManager::SetObject ( vtkObject **  nodePtr,
vtkObject *  node 
)

set vtkObject to a specified pointer and remove all observers for all events

Member Data Documentation

◆ CallbackCommand

vtkCallbackCommand* vtkObserverManager::CallbackCommand
protected


Holder for callback

Definition at line 98 of file vtkObserverManager.h.

◆ ObserverTags

std::map< vtkObject*, vtkUnsignedLongArray* > vtkObserverManager::ObserverTags
protected

Definition at line 100 of file vtkObserverManager.h.

◆ Owner

vtkObject* vtkObserverManager::Owner
protected


The owner of the observer manager (e.g. the vtkMRMLNode)

Definition at line 94 of file vtkObserverManager.h.


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