Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkObjectFactory Class Reference

abstract base class for vtkObjectFactories. More...

#include <vtkObjectFactory.h>

Inheritance diagram for vtkObjectFactory:

Inheritance graph
[legend]
Collaboration diagram for vtkObjectFactory:

Collaboration graph
[legend]
List of all members.

Public Types

typedef vtkObject *(* CreateFunction )()

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual const char * GetVTKSourceVersion ()=0
virtual const char * GetDescription ()=0
virtual int GetNumberOfOverrides ()
virtual const char * GetClassOverrideName (int index)
virtual const char * GetClassOverrideWithName (int index)
virtual int GetEnableFlag (int index)
virtual const char * GetDescription (int index)
virtual void SetEnableFlag (int flag, const char *className, const char *subclassName)
virtual int GetEnableFlag (const char *className, const char *subclassName)
virtual void Disable (const char *className)
virtual char * GetLibraryPath ()

Static Public Methods

int IsTypeOf (const char *type)
vtkObjectFactory * SafeDownCast (vtkObject *o)
vtkObjectCreateInstance (const char *vtkclassname)
void ReHash ()
void RegisterFactory (vtkObjectFactory *)
void UnRegisterFactory (vtkObjectFactory *)
void UnRegisterAllFactories ()
vtkObjectFactoryCollectionGetRegisteredFactories ()

Protected Methods

void RegisterOverride (const char *classOverride, const char *overrideClassName, const char *description, int enableFlag, CreateFunction createFunction)
virtual vtkObjectCreateObject (const char *vtkclassname)
 vtkObjectFactory ()
 ~vtkObjectFactory ()
 vtkObjectFactory (const vtkObjectFactory &)
void operator= (const vtkObjectFactory &)

Protected Attributes

OverrideInformationOverrideArray
char ** OverrideClassNames
int SizeOverrideArray
int OverrideArrayLength

Detailed Description

abstract base class for vtkObjectFactories.

Date:
2000/12/10 20:08:13
Revision:
1.12
Thanks:
Thanks to William A. Hoffman who developed this class
vtkObjectFactory is used to create vtk objects. The base class vtkObjectFactory contains a static method CreateInstance which is used to create vtk objects from the list of registered vtkObjectFactory sub-classes. The first time CreateInstance is called, all dll's or shared libraries in the environment variable VTK_AUTOLOAD_PATH are loaded into the current process. The C function vtkLoad is called on each dll. vtkLoad should return an instance of the factory sub-class implemented in the shared library. VTK_AUTOLOAD_PATH is an environment variable containing a colon separated (semi-colon on win32) list of paths.

This can be use to override the creation of any object in VTK.

Examples:
vtkObjectFactory (examples)

Definition at line 74 of file vtkObjectFactory.h.


Member Typedef Documentation

typedef vtkObject*(* vtkObjectFactory::CreateFunction)()
 


Constructor & Destructor Documentation

vtkObjectFactory::vtkObjectFactory   [protected]
 

vtkObjectFactory::~vtkObjectFactory   [protected]
 

vtkObjectFactory::vtkObjectFactory const vtkObjectFactory &    [inline, protected]
 

Definition at line 167 of file vtkObjectFactory.h.


Member Function Documentation

virtual const char* vtkObjectFactory::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkKitwareObjectFactory.

int vtkObjectFactory::IsTypeOf const char *    type [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkKitwareObjectFactory.

virtual int vtkObjectFactory::IsA const char *    type [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkKitwareObjectFactory.

vtkObjectFactory* vtkObjectFactory::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkKitwareObjectFactory.

Referenced by vtkObjectFactoryCollection::GetNextItem().

virtual void vtkObjectFactory::PrintSelf ostream &    os,
vtkIndent    indent
[virtual]
 

Print ObjectFactor to stream.

Reimplemented from vtkObject.

Reimplemented in vtkKitwareObjectFactory.

vtkObject* vtkObjectFactory::CreateInstance const char *    vtkclassname [static]
 

Create and return an instance of the named vtk object. Each loaded vtkObjectFactory will be asked in the order the factory was in the VTK_AUTOLOAD_PATH. After the first factory returns the object no other factories are asked.

void vtkObjectFactory::ReHash   [static]
 

Re-check the VTK_AUTOLOAD_PATH for new factory libraries. This calls UnRegisterAll before re-loading

void vtkObjectFactory::RegisterFactory vtkObjectFactory *    [static]
 

Register a factory so it can be used to create vtk objects

void vtkObjectFactory::UnRegisterFactory vtkObjectFactory *    [static]
 

Remove a factory from the list of registered factories

void vtkObjectFactory::UnRegisterAllFactories   [static]
 

Unregister all factories

vtkObjectFactoryCollection* vtkObjectFactory::GetRegisteredFactories   [static]
 

Return the list of all registered factories. This is NOT a copy, do not remove items from this list!

virtual const char* vtkObjectFactory::GetVTKSourceVersion   [pure virtual]
 

All sub-classes of vtkObjectFactory should must return the version of VTK they were built with. This should be implemented with the macro VTK_SOURCE_VERSION and NOT a call to vtkVersion::GetVTKSourceVersion. As the version needs to be compiled into the file as a string constant. This is critical to determine possible incompatible dynamic factory loads.

Reimplemented in vtkKitwareObjectFactory.

virtual const char* vtkObjectFactory::GetDescription   [pure virtual]
 

Return a descriptive string describing the factory.

virtual int vtkObjectFactory::GetNumberOfOverrides   [virtual]
 

Return number of overrides this factory can create.

virtual const char* vtkObjectFactory::GetClassOverrideName int    index [virtual]
 

Return the name of a class override at the given index.

virtual const char* vtkObjectFactory::GetClassOverrideWithName int    index [virtual]
 

Return the name of the class that will override the class at the given index

virtual int vtkObjectFactory::GetEnableFlag int    index [virtual]
 

Return the enable flag for the class at the given index.

virtual const char* vtkObjectFactory::GetDescription int    index [virtual]
 

Return the description for a the class override at the given index.

virtual void vtkObjectFactory::SetEnableFlag int    flag,
const char *    className,
const char *    subclassName
[virtual]
 

Set and Get the Enable flag for the specific override of className

virtual int vtkObjectFactory::GetEnableFlag const char *    className,
const char *    subclassName
[virtual]
 

virtual void vtkObjectFactory::Disable const char *    className [virtual]
 

Set all enable flags for the given class to 0. This will mean that the factory will stop producing class with the given name.

virtual char* vtkObjectFactory::GetLibraryPath   [virtual]
 

This returns the path to a dynamically loaded factory.

void vtkObjectFactory::RegisterOverride const char *    classOverride,
const char *    overrideClassName,
const char *    description,
int    enableFlag,
CreateFunction    createFunction
[protected]
 

Register object creation information with the factory.

virtual vtkObject* vtkObjectFactory::CreateObject const char *    vtkclassname [protected, virtual]
 

This method is provided by sub-classes of vtkObjectFactory. It should create the named vtk object or return 0 if that object is not supported by the factory implementation.

Reimplemented in vtkKitwareObjectFactory.

void vtkObjectFactory::operator= const vtkObjectFactory &    [inline, protected]
 

Definition at line 168 of file vtkObjectFactory.h.


Member Data Documentation

OverrideInformation* vtkObjectFactory::OverrideArray [protected]
 

Definition at line 178 of file vtkObjectFactory.h.

char** vtkObjectFactory::OverrideClassNames [protected]
 

Definition at line 179 of file vtkObjectFactory.h.

int vtkObjectFactory::SizeOverrideArray [protected]
 

Definition at line 180 of file vtkObjectFactory.h.

int vtkObjectFactory::OverrideArrayLength [protected]
 

Definition at line 181 of file vtkObjectFactory.h.


The documentation for this class was generated from the following file:
Generated on Wed Nov 21 12:55:12 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001