vtk-dicom  0.8.17
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkObject Class Reference

abstract base class for most VTK objects More...

#include <vtkObject.h>

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

Public Member Functions

 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommand * GetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual vtkTypeBool IsA (const char *name)
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Friends

class vtkObjectCommandInternal
 

Detailed Description

abstract base class for most VTK objects

vtkObject is the base class for most objects in the visualization toolkit. vtkObject provides methods for tracking modification time, debugging, printing, and event callbacks. Most objects created within the VTK framework should be a subclass of vtkObject or one of its children. The few exceptions tend to be very small helper classes that usually never get instantiated or situations where multiple inheritance gets in the way. vtkObject also performs reference counting: objects that are reference counted exist as long as another object uses them. Once the last reference to a reference counted object is removed, the object will spontaneously destruct.

Warning
Note: in VTK objects should always be created with the New() method and deleted with the Delete() method. VTK objects cannot be allocated off the stack (i.e., automatic objects) because the constructor is a protected method.
See also
vtkCommand vtkTimeStamp

Member Function Documentation

◆ AddObserver() [1/3]

template<class U , class T >
unsigned long vtkObject::AddObserver ( unsigned long  event,
observer,
bool(T::*)(vtkObject *, unsigned long, void *)  callback,
float  priority = 0.0f 
)
inline

Allow user to set the AbortFlagOn() with the return value of the callback method.

◆ AddObserver() [2/3]

template<class U , class T >
unsigned long vtkObject::AddObserver ( unsigned long  event,
observer,
void(T::*)()  callback,
float  priority = 0.0f 
)
inline

Overloads to AddObserver that allow developers to add class member functions as callbacks for events. The callback function can be one of these two types:

void foo(void);\n
void foo(vtkObject*, unsigned long, void*);
abstract base class for most VTK objects
Definition: vtkObject.h:54

If the callback is a member of a vtkObjectBase-derived object, then the callback will automatically be disabled if the object destructs (but the observer will not automatically be removed). If the callback is a member of any other type of object, then the observer must be removed before the object destructs or else its dead pointer will be used the next time the event occurs. Typical usage of these functions is as follows:

SomeClassOfMine* observer = SomeClassOfMine::New();\n
to_observe->AddObserver(event, observer, \&SomeClassOfMine::SomeMethod);

Note that this does not affect the reference count of a vtkObjectBase-derived observer, which can be safely deleted with the observer still in place. For non-vtkObjectBase observers, the observer should never be deleted before it is removed. Return value is a tag that can be used to remove the observer.

◆ AddObserver() [3/3]

unsigned long vtkObject::AddObserver ( unsigned long  event,
vtkCommand *  ,
float  priority = 0.0f 
)

Allow people to add/remove/invoke observers (callbacks) to any VTK object. This is an implementation of the subject/observer design pattern. An observer is added by specifying an event to respond to and a vtkCommand to execute. It returns an unsigned long tag which can be used later to remove the event or retrieve the command. When events are invoked, the observers are called in the order they were added. If a priority value is specified, then the higher priority commands are called first. A command may set an abort flag to stop processing of the event. (See vtkCommand.h for more information.)

◆ BreakOnError()

static void vtkObject::BreakOnError ( )
static

This method is called when vtkErrorMacro executes. It allows the debugger to break on error.

◆ DebugOff()

virtual void vtkObject::DebugOff ( )
virtual

Turn debugging output off.

◆ DebugOn()

virtual void vtkObject::DebugOn ( )
virtual

Turn debugging output on.

◆ GetDebug()

bool vtkObject::GetDebug ( )

Get the value of the debug flag.

◆ GetMTime()

virtual vtkMTimeType vtkObject::GetMTime ( )
virtual

Return this object's modified time.

◆ InternalGrabFocus()

void vtkObject::InternalGrabFocus ( vtkCommand *  mouseEvents,
vtkCommand *  keypressEvents = NULL 
)
protected

These methods allow a command to exclusively grab all events. (This method is typically used by widgets to grab events once an event sequence begins.) These methods are provided in support of the public methods found in the class vtkInteractorObserver. Note that these methods are designed to support vtkInteractorObservers since they use two separate vtkCommands to watch for mouse and keypress events.

◆ InvokeEvent()

int vtkObject::InvokeEvent ( unsigned long  event,
void *  callData 
)

This method invokes an event and return whether the event was aborted or not. If the event was aborted, the return value is 1, otherwise it is 0.

◆ Modified()

virtual void vtkObject::Modified ( )
virtual

Update the modification time for this object. Many filters rely on the modification time to determine if they need to recompute their data. The modification time is a unique monotonically increasing unsigned long integer.

◆ New()

static vtkObject* vtkObject::New ( )
static

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

◆ PrintSelf()

void vtkObject::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObjectBase.

Reimplemented in vtkThreadedImageAlgorithm, and vtkScancoCTReader.

◆ SetDebug()

void vtkObject::SetDebug ( bool  debugFlag)

Set the value of the debug flag. A true value turns debugging on.

◆ SetGlobalWarningDisplay()

static void vtkObject::SetGlobalWarningDisplay ( int  val)
static

This is a global flag that controls whether any debug, warning or error messages are displayed.


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