Go to the documentation of this file.
44 #ifndef vtkObjectFactory_h
45 #define vtkObjectFactory_h
48 #include "vtkCommonCoreModule.h"
72 static vtkObject* CreateInstance(
const char* vtkclassname,
73 bool isAbstract =
false);
81 static void CreateAllInstance(
const char* vtkclassname,
99 static void UnRegisterAllFactories();
111 static int HasOverrideAny(
const char* className);
117 static void GetOverrideInformation(
const char*
name,
125 const char* className);
131 const char* className,
132 const char* subclassName);
150 virtual const char* GetVTKSourceVersion() = 0;
155 virtual const char* GetDescription() = 0;
160 virtual int GetNumberOfOverrides();
165 virtual const char* GetClassOverrideName(
int index);
171 virtual const char* GetClassOverrideWithName(
int index);
182 virtual const char* GetOverrideDescription(
int index);
190 const char* className,
191 const char* subclassName);
192 virtual vtkTypeBool GetEnableFlag(
const char* className,
193 const char* subclassName);
199 virtual int HasOverride(
const char* className);
203 virtual int HasOverride(
const char* className,
const char* subclassName);
210 virtual void Disable(
const char* className);
216 vtkGetStringMacro(LibraryPath);
226 void RegisterOverride(
const char* classOverride,
227 const char* overrideClassName,
230 CreateFunction createFunction);
237 virtual vtkObject* CreateObject(
const char* vtkclassname );
256 void GrowOverrideArray();
266 static void RegisterDefaults();
270 static void LoadDynamicFactories();
274 static void LoadLibrariesInPath(
const std::string&);
282 char* LibraryVTKVersion;
283 char* LibraryCompilerUsed;
307 #define VTK_CREATE_CREATE_FUNCTION(classname) \
308 static vtkObject* vtkObjectFactoryCreate##classname() \
309 { return classname::New(); }
313 #define VTK_FACTORY_INTERFACE_EXPORT VTKCOMMONCORE_EXPORT
320 #define VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName) \
322 VTK_FACTORY_INTERFACE_EXPORT \
323 const char* vtkGetFactoryCompilerUsed() \
325 return VTK_CXX_COMPILER; \
328 VTK_FACTORY_INTERFACE_EXPORT \
329 const char* vtkGetFactoryVersion() \
331 return VTK_SOURCE_VERSION; \
334 VTK_FACTORY_INTERFACE_EXPORT \
335 vtkObjectFactory* vtkLoad() \
337 return factoryName ::New(); \
341 #define VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \
342 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, false); \
345 return static_cast<thisClass*>(ret); \
347 thisClass *result = new thisClass; \
348 result->InitializeObjectBase(); \
354 #define VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass) \
355 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, true); \
358 return static_cast<thisClass*>(ret); \
360 vtkGenericWarningMacro("Error: no override found for '" #thisClass "'."); \
364 #if defined(VTK_ALL_NEW_OBJECT_FACTORY)
365 # define VTK_STANDARD_NEW_BODY(thisClass) \
366 VTK_OBJECT_FACTORY_NEW_BODY(thisClass)
368 # define VTK_STANDARD_NEW_BODY(thisClass) \
369 thisClass *result = new thisClass; \
370 result->InitializeObjectBase(); \
375 #define vtkStandardNewMacro(thisClass) \
376 thisClass* thisClass::New() \
378 VTK_STANDARD_NEW_BODY(thisClass) \
382 #define vtkObjectFactoryNewMacro(thisClass) \
383 thisClass* thisClass::New() \
385 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \
391 #define vtkAbstractObjectFactoryNewMacro(thisClass) \
392 thisClass* thisClass::New() \
394 VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass) \
static vtkObjectFactoryRegistryCleanup vtkObjectFactoryRegistryCleanupInstance
abstract base class for most VTK objects
char ** OverrideClassNames
create and manipulate ordered lists of objects
abstract base class for vtkObjectFactories
a simple class to control print indentation
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
maintain a list of object factories
OverrideInformation * OverrideArray