vtk
Class vtkObjectFactory

java.lang.Object
  extended byvtk.vtkObjectBase
      extended byvtk.vtkObject
          extended byvtk.vtkObjectFactory
All Implemented Interfaces:
java.io.Serializable

public class vtkObjectFactory
extends vtkObject
implements java.io.Serializable

vtkObjectFactory - 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. JavaBean wrapper for vtkObjectFactory object.

Author:
vtk2jbean Automatic JavaBean wrapper for VTK.
See Also:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkObjectFactory()
           
protected vtkObjectFactory(int dmy)
           
 
Method Summary
 void createAllInstance(java.lang.String id0, vtkCollection id1)
          Create all possible instances of the named vtk object.
 vtkObject createInstance(java.lang.String id0)
          Create and return an instance of the named vtk object.
 void disable(java.lang.String id0)
          Set all enable flags for the given class to 0.
 java.lang.String getClassName()
          Return the class name as a string.
 java.lang.String getClassOverrideName(int id0)
          Return the name of a class override at the given index.
 java.lang.String getClassOverrideWithName(int id0)
          Return the name of the class that will override the class at the given index
 java.lang.String getDescription()
          Return a descriptive string describing the factory.
 int getEnableFlag(int id0)
          Return the enable flag for the class at the given index.
 int getEnableFlag(java.lang.String id0, java.lang.String id1)
          Set and Get the Enable flag for the specific override of className.
 java.lang.String getLibraryPath()
          This returns the path to a dynamically loaded factory.
 int getNumberOfOverrides()
          Return number of overrides this factory can create.
 java.lang.String getOverrideDescription(int id0)
          Return the description for a the class override at the given index.
 void getOverrideInformation(java.lang.String id0, vtkOverrideInformationCollection id1)
          Fill the given collection with all the overrides for the class with the given name.
 vtkObjectFactoryCollection getRegisteredFactories()
          Return the list of all registered factories.
 vtkObjectFactory getThisObjectFactory()
           
 java.lang.String getVTKSourceVersion()
          All sub-classes of vtkObjectFactory should must return the version of VTK they were built with.
 int hasOverride(java.lang.String id0)
          Return 1 if this factory overrides the given class name, 0 otherwise.
 int hasOverride(java.lang.String id0, java.lang.String id1)
          Return 1 if this factory overrides the given class name, 0 otherwise.
 int hasOverrideAny(java.lang.String id0)
          return 1 if one of the registered factories overrides the given class name
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 void registerFactory(vtkObjectFactory id0)
          Register a factory so it can be used to create vtk objects
 void reHash()
          Re-check the VTK_AUTOLOAD_PATH for new factory libraries.
 void setAllEnableFlags(int id0, java.lang.String id1)
          Set the enable flag for a given named class for all registered factories.
 void setAllEnableFlags(int id0, java.lang.String id1, java.lang.String id2)
          Set the enable flag for a given named class subclass pair for all registered factories.
 void setEnableFlag(int id0, java.lang.String id1, java.lang.String id2)
          Set and Get the Enable flag for the specific override of className.
 void unRegisterAllFactories()
          Unregister all factories
 void unRegisterFactory(vtkObjectFactory id0)
          Remove a factory from the list of registered factories
protected  void VTKCastInit()
           
 
Methods inherited from class vtk.vtkObject
AddObserver, breakOnError, debugOff, debugOn, getDebug, getGlobalWarningDisplay, getMTime, getThisObject, globalWarningDisplayOff, globalWarningDisplayOn, hasObserver, hasObserver, invokeEvent, invokeEvent, modified, Print, PrintRevisions, register, removeObserver, removeObservers, removeObservers, setDebug, setGlobalWarningDisplay, unRegister, VTKInit
 
Methods inherited from class vtk.vtkObjectBase
addPropertyChangeListener, finalize, getReferenceCount, getThisObjectBase, isTypeOf, removePropertyChangeListener, setReferenceCount, VTKDelete
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changes

protected java.beans.PropertyChangeSupport changes
Constructor Detail

vtkObjectFactory

public vtkObjectFactory()

vtkObjectFactory

protected vtkObjectFactory(int dmy)
Method Detail

getThisObjectFactory

public vtkObjectFactory getThisObjectFactory()

createInstance

public vtkObject createInstance(java.lang.String id0)
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.


createAllInstance

public void createAllInstance(java.lang.String id0,
                              vtkCollection id1)
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.


reHash

public void reHash()
Re-check the VTK_AUTOLOAD_PATH for new factory libraries. This calls UnRegisterAll before re-loading


registerFactory

public void registerFactory(vtkObjectFactory id0)
Register a factory so it can be used to create vtk objects


unRegisterFactory

public void unRegisterFactory(vtkObjectFactory id0)
Remove a factory from the list of registered factories


unRegisterAllFactories

public void unRegisterAllFactories()
Unregister all factories


getRegisteredFactories

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


hasOverrideAny

public int hasOverrideAny(java.lang.String id0)
return 1 if one of the registered factories overrides the given class name


getOverrideInformation

public void getOverrideInformation(java.lang.String id0,
                                   vtkOverrideInformationCollection id1)
Fill the given collection with all the overrides for the class with the given name.


setAllEnableFlags

public void setAllEnableFlags(int id0,
                              java.lang.String id1)
Set the enable flag for a given named class for all registered factories.


setAllEnableFlags

public void setAllEnableFlags(int id0,
                              java.lang.String id1,
                              java.lang.String id2)
Set the enable flag for a given named class subclass pair for all registered factories.


getClassName

public java.lang.String getClassName()
Description copied from class: vtkObjectBase
Return the class name as a string. This method is defined in all subclasses of vtkObjectBase with the vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
getClassName in class vtkObject

isA

public int isA(java.lang.String id0)
Description copied from class: vtkObjectBase
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 vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
isA in class vtkObject

getVTKSourceVersion

public java.lang.String getVTKSourceVersion()
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.


getDescription

public java.lang.String getDescription()
Return a descriptive string describing the factory.


getNumberOfOverrides

public int getNumberOfOverrides()
Return number of overrides this factory can create.


getClassOverrideName

public java.lang.String getClassOverrideName(int id0)
Return the name of a class override at the given index.


getClassOverrideWithName

public java.lang.String getClassOverrideWithName(int id0)
Return the name of the class that will override the class at the given index


getEnableFlag

public int getEnableFlag(int id0)
Return the enable flag for the class at the given index.


getOverrideDescription

public java.lang.String getOverrideDescription(int id0)
Return the description for a the class override at the given index.


setEnableFlag

public void setEnableFlag(int id0,
                          java.lang.String id1,
                          java.lang.String id2)
Set and Get the Enable flag for the specific override of className. if subclassName is null, then it is ignored.


getEnableFlag

public int getEnableFlag(java.lang.String id0,
                         java.lang.String id1)
Set and Get the Enable flag for the specific override of className. if subclassName is null, then it is ignored.


hasOverride

public int hasOverride(java.lang.String id0)
Return 1 if this factory overrides the given class name, 0 otherwise.


hasOverride

public int hasOverride(java.lang.String id0,
                       java.lang.String id1)
Return 1 if this factory overrides the given class name, 0 otherwise.


disable

public void disable(java.lang.String id0)
Set all enable flags for the given class to 0. This will mean that the factory will stop producing class with the given name.


getLibraryPath

public java.lang.String getLibraryPath()
This returns the path to a dynamically loaded factory.


VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtkObject


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.