VTK
|
abstract base class for vtkObjectFactories More...
#include <vtkObjectFactory.h>
Classes | |
struct | OverrideInformation |
Public Types | |
typedef vtkObject | Superclass |
typedef vtkObject *(* | CreateFunction) () |
![]() | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkObjectFactory * | NewInstance () const |
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 * | GetOverrideDescription (int index) |
virtual int | HasOverride (const char *className) |
virtual int | HasOverride (const char *className, const char *subclassName) |
virtual void | Disable (const char *className) |
virtual void | SetEnableFlag (int flag, const char *className, const char *subclassName) |
virtual int | GetEnableFlag (const char *className, const char *subclassName) |
virtual char * | GetLibraryPath () |
![]() | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
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) |
![]() | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static vtkObject * | CreateInstance (const char *vtkclassname) |
static void | ConstructInstance (const char *vtkclassname) |
static void | ReHash () |
static void | RegisterFactory (vtkObjectFactory *) |
static void | UnRegisterFactory (vtkObjectFactory *) |
static void | UnRegisterAllFactories () |
static vtkObjectFactoryCollection * | GetRegisteredFactories () |
static int | HasOverrideAny (const char *className) |
static int | IsTypeOf (const char *type) |
static vtkObjectFactory * | SafeDownCast (vtkObjectBase *o) |
static void | CreateAllInstance (const char *vtkclassname, vtkCollection *retList) |
static void | GetOverrideInformation (const char *name, vtkOverrideInformationCollection *) |
static void | SetAllEnableFlags (int flag, const char *className) |
static void | SetAllEnableFlags (int flag, const char *className, const char *subclassName) |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
![]() | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
virtual vtkObject * | CreateObject (const char *vtkclassname) |
vtkObjectFactory () | |
~vtkObjectFactory () | |
void | RegisterOverride (const char *classOverride, const char *overrideClassName, const char *description, int enableFlag, CreateFunction createFunction) |
![]() | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
OverrideInformation * | OverrideArray |
char ** | OverrideClassNames |
int | SizeOverrideArray |
int | OverrideArrayLength |
![]() | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
![]() | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
abstract base class for vtkObjectFactories
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 functions vtkLoad, vtkGetFactoryCompilerUsed, and vtkGetFactoryVersion are called on each dll. To implement these functions in a shared library or dll, use the macro: VTK_FACTORY_INTERFACE_IMPLEMENT. VTK_AUTOLOAD_PATH is an environment variable containing a colon separated (semi-colon on win32) list of paths.
The vtkObjectFactory can be use to override the creation of any object in VTK with a sub-class of that object. The factories can be registered either at run time with the VTK_AUTOLOAD_PATH, or at compile time with the vtkObjectFactory::RegisterFactory method.
Definition at line 50 of file vtkObjectFactory.h.
Definition at line 114 of file vtkObjectFactory.h.
typedef vtkObject*(* vtkObjectFactory::CreateFunction) () |
Definition at line 170 of file vtkObjectFactory.h.
|
protected |
|
protected |
|
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.
|
static |
Call vtkDebugLeaks::ConstructClass if necessary. Does not attempt to use the object factory to create an instance.
|
static |
Create all possible instances of the named vtk object. Each registered vtkObjectFactory will be asked, and the result will be stored in the user allocated vtkCollection passed in to the function.
|
static |
Re-check the VTK_AUTOLOAD_PATH for new factory libraries. This calls UnRegisterAll before re-loading
|
static |
Register a factory so it can be used to create vtk objects
|
static |
Remove a factory from the list of registered factories
|
static |
Unregister all factories
|
static |
Return the list of all registered factories. This is NOT a copy, do not remove items from this list!
|
static |
return 1 if one of the registered factories overrides the given class name
|
static |
Fill the given collection with all the overrides for the class with the given name.
|
static |
Set the enable flag for a given named class for all registered factories.
|
static |
Set the enable flag for a given named class subclass pair for all registered factories.
|
static |
|
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 vtkInteractionStyleObjectFactory, vtkRenderingContextOpenGLObjectFactory, vtkRenderingFreeTypeObjectFactory, vtkRenderingOpenGLObjectFactory, and vtkRenderingVolumeOpenGLObjectFactory.
|
static |
|
protectedvirtual |
Reimplemented from vtkObject.
Reimplemented in vtkInteractionStyleObjectFactory, vtkRenderingContextOpenGLObjectFactory, vtkRenderingFreeTypeObjectFactory, vtkRenderingOpenGLObjectFactory, and vtkRenderingVolumeOpenGLObjectFactory.
vtkObjectFactory* vtkObjectFactory::NewInstance | ( | ) | const |
|
virtual |
Print ObjectFactory to stream.
Reimplemented from vtkObject.
Reimplemented in vtkInteractionStyleObjectFactory, vtkRenderingContextOpenGLObjectFactory, vtkRenderingFreeTypeObjectFactory, vtkRenderingOpenGLObjectFactory, and vtkRenderingVolumeOpenGLObjectFactory.
|
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.
Implemented in vtkInteractionStyleObjectFactory, vtkRenderingContextOpenGLObjectFactory, vtkRenderingFreeTypeObjectFactory, vtkRenderingOpenGLObjectFactory, and vtkRenderingVolumeOpenGLObjectFactory.
|
pure virtual |
Return a descriptive string describing the factory.
Implemented in vtkInteractionStyleObjectFactory, vtkRenderingContextOpenGLObjectFactory, vtkRenderingFreeTypeObjectFactory, vtkRenderingOpenGLObjectFactory, and vtkRenderingVolumeOpenGLObjectFactory.
|
virtual |
Return number of overrides this factory can create.
|
virtual |
Return the name of a class override at the given index.
|
virtual |
Return the name of the class that will override the class at the given index
Return the enable flag for the class at the given index.
|
virtual |
Return the description for a the class override at the given index.
|
virtual |
Set and Get the Enable flag for the specific override of className. if subclassName is null, then it is ignored.
|
virtual |
Set and Get the Enable flag for the specific override of className. if subclassName is null, then it is ignored.
|
virtual |
Return 1 if this factory overrides the given class name, 0 otherwise.
|
virtual |
Return 1 if this factory overrides the given class name, 0 otherwise.
|
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 |
This returns the path to a dynamically loaded factory.
|
protected |
Register object creation information with the factory.
|
protectedvirtual |
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.
|
protected |
Definition at line 203 of file vtkObjectFactory.h.
|
protected |
Definition at line 204 of file vtkObjectFactory.h.
|
protected |
Definition at line 205 of file vtkObjectFactory.h.
|
protected |
Definition at line 206 of file vtkObjectFactory.h.