Documentation for vtkObject

vtkObject - abstract base class for most of the vtk objects

Description:

vtkObject is the base class for many objects in the visualization toolkit. vtkObject provides methods for tracking modification times, debugging, and printing. 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. Typically only data objects that are passed between objects are reference counted.

 

Caveats:

Note: in vtk objects should always be created with combinations of new/Delete() methods. This does not work when objects are allocated off the stack (i.e., automatic objects). Automatic objects, when automatically deleted (by exiting scope), will cause warnings to occur. You should not create vtkObjects in this manner.

 

Methods:

void vtkObject ()
void vtkObject ()
const char *GetClassName ()
void Delete ()
static vtkObject *New ()
void DebugOn ()
void DebugOff ()
unsigned char GetDebug ()
void SetDebug (unsigned char )
static void BreakOnError ()
unsigned long GetMTime ()
void Modified ()
void PrintSelf (unknown & ,vtkIndent )
void Print (unknown &)
void PrintHeader (unknown & ,vtkIndent )
void PrintTrailer (unknown & ,vtkIndent )
static void SetGlobalWarningDisplay (int )
static void GlobalWarningDisplayOn ()
static void GlobalWarningDisplayOff ()
static int GetGlobalWarningDisplay ()
void Register (vtkObject *)
void UnRegister (vtkObject *)
int GetReferenceCount ()
void SetReferenceCount (int )
void ReferenceCountingOff ()

 

Detailed Method Descriptions:

Return the class name as a string.

const char *GetClassName ()

Delete a vtk object. This method should always be used to delete an object when the new operator was used to create it. Using the C++ delete method will not work with reference counting.

void Delete ()

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

static vtkObject *New ()

Turn debugging output on.

void DebugOn ()

Turn debugging output off.

void DebugOff ()

Get the value of the debug flag.

unsigned char GetDebug ()

Set the value of the debug flag. A non-zero value turns debugging on.

void SetDebug (unsigned char )

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

static void BreakOnError ()

Return this objects modified time.

unsigned long GetMTime ()

Update the modification time for this object. Many filters rely on the modification time to determine if they need to recompute their data.

void Modified ()

Chaining method to print an object's instance variables, as well as its superclasses.

void PrintSelf (unknown & ,vtkIndent )

Print an object to an ostream.

void Print (unknown &)

Support methods for the printing process.

void PrintHeader (unknown & ,vtkIndent )
void PrintTrailer (unknown & ,vtkIndent )

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

static void SetGlobalWarningDisplay (int )
static void GlobalWarningDisplayOn ()
static void GlobalWarningDisplayOff ()
static int GetGlobalWarningDisplay ()

Increase the reference count (mark as used by another object).

void Register (vtkObject *)

Decrease the reference count (release by another object).

void UnRegister (vtkObject *)

Sets the reference count (use with care)

void SetReferenceCount (int )

For legacy compatibility. Do not use. Works now by making reference count negative.

void ReferenceCountingOff ()