44 #ifndef vtkObjectFactory_h 45 #define vtkObjectFactory_h 48 #include "vtkCommonCoreModule.h" 70 static vtkObject* CreateInstance(
const char* vtkclassname,
71 bool isAbstract =
false);
79 static void CreateAllInstance(
const char* vtkclassname,
97 static void UnRegisterAllFactories();
109 static int HasOverrideAny(
const char* className);
115 static void GetOverrideInformation(
const char*
name,
123 const char* className);
129 const char* className,
130 const char* subclassName);
148 virtual const char* GetVTKSourceVersion() = 0;
153 virtual const char* GetDescription() = 0;
158 virtual int GetNumberOfOverrides();
163 virtual const char* GetClassOverrideName(
int index);
169 virtual const char* GetClassOverrideWithName(
int index);
180 virtual const char* GetOverrideDescription(
int index);
188 const char* className,
189 const char* subclassName);
190 virtual vtkTypeBool GetEnableFlag(
const char* className,
191 const char* subclassName);
197 virtual int HasOverride(
const char* className);
201 virtual int HasOverride(
const char* className,
const char* subclassName);
208 virtual void Disable(
const char* className);
224 void RegisterOverride(
const char* classOverride,
225 const char* overrideClassName,
228 CreateFunction createFunction);
235 virtual vtkObject* CreateObject(
const char* vtkclassname );
254 void GrowOverrideArray();
264 static void RegisterDefaults();
268 static void LoadDynamicFactories();
272 static void LoadLibrariesInPath(
const char*);
280 char* LibraryVTKVersion;
281 char* LibraryCompilerUsed;
305 #define VTK_CREATE_CREATE_FUNCTION(classname) \ 306 static vtkObject* vtkObjectFactoryCreate##classname() \ 307 { return classname::New(); } 311 #define VTK_FACTORY_INTERFACE_EXPORT VTKCOMMONCORE_EXPORT 318 #define VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName) \ 320 VTK_FACTORY_INTERFACE_EXPORT \ 321 const char* vtkGetFactoryCompilerUsed() \ 323 return VTK_CXX_COMPILER; \ 326 VTK_FACTORY_INTERFACE_EXPORT \ 327 const char* vtkGetFactoryVersion() \ 329 return VTK_SOURCE_VERSION; \ 332 VTK_FACTORY_INTERFACE_EXPORT \ 333 vtkObjectFactory* vtkLoad() \ 335 return factoryName ::New(); \ 339 #define VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \ 340 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, false); \ 343 return static_cast<thisClass*>(ret); \ 345 thisClass *result = new thisClass; \ 346 result->InitializeObjectBase(); \ 352 #define VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass) \ 353 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, true); \ 356 return static_cast<thisClass*>(ret); \ 358 vtkGenericWarningMacro("Error: no override found for '" #thisClass "'."); \ 362 #if defined(VTK_ALL_NEW_OBJECT_FACTORY) 363 # define VTK_STANDARD_NEW_BODY(thisClass) \ 364 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) 366 # define VTK_STANDARD_NEW_BODY(thisClass) \ 367 thisClass *result = new thisClass; \ 368 result->InitializeObjectBase(); \ 373 #define vtkStandardNewMacro(thisClass) \ 374 thisClass* thisClass::New() \ 376 VTK_STANDARD_NEW_BODY(thisClass) \ 380 #define vtkObjectFactoryNewMacro(thisClass) \ 381 thisClass* thisClass::New() \ 383 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \ 389 #define vtkAbstractObjectFactoryNewMacro(thisClass) \ 390 thisClass* thisClass::New() \ 392 VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass) \
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkObjectFactoryRegistryCleanup vtkObjectFactoryRegistryCleanupInstance
a simple class to control print indentation
OverrideInformation * OverrideArray
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
maintain a list of object factories
char ** OverrideClassNames
create and manipulate ordered lists of objects
abstract base class for vtkObjectFactories