41 #ifndef vtkObjectFactory_h 42 #define vtkObjectFactory_h 45 #include "vtkCommonCoreModule.h" 67 static vtkObject* CreateInstance(
const char* vtkclassname,
68 bool isAbstract =
false);
76 static void CreateAllInstance(
const char* vtkclassname,
94 static void UnRegisterAllFactories();
106 static int HasOverrideAny(
const char* className);
112 static void GetOverrideInformation(
const char*
name,
120 const char* className);
126 const char* className,
127 const char* subclassName);
145 virtual const char* GetVTKSourceVersion() = 0;
150 virtual const char* GetDescription() = 0;
155 virtual int GetNumberOfOverrides();
160 virtual const char* GetClassOverrideName(
int index);
166 virtual const char* GetClassOverrideWithName(
int index);
177 virtual const char* GetOverrideDescription(
int index);
185 const char* className,
186 const char* subclassName);
187 virtual vtkTypeBool GetEnableFlag(
const char* className,
188 const char* subclassName);
194 virtual int HasOverride(
const char* className);
198 virtual int HasOverride(
const char* className,
const char* subclassName);
205 virtual void Disable(
const char* className);
221 void RegisterOverride(
const char* classOverride,
222 const char* overrideClassName,
225 CreateFunction createFunction);
232 virtual vtkObject* CreateObject(
const char* vtkclassname );
251 void GrowOverrideArray();
261 static void RegisterDefaults();
265 static void LoadDynamicFactories();
269 static void LoadLibrariesInPath(
const char*);
277 char* LibraryVTKVersion;
278 char* LibraryCompilerUsed;
302 #define VTK_CREATE_CREATE_FUNCTION(classname) \ 303 static vtkObject* vtkObjectFactoryCreate##classname() \ 304 { return classname::New(); } 308 #define VTK_FACTORY_INTERFACE_EXPORT VTKCOMMONCORE_EXPORT 315 #define VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName) \ 317 VTK_FACTORY_INTERFACE_EXPORT \ 318 const char* vtkGetFactoryCompilerUsed() \ 320 return VTK_CXX_COMPILER; \ 323 VTK_FACTORY_INTERFACE_EXPORT \ 324 const char* vtkGetFactoryVersion() \ 326 return VTK_SOURCE_VERSION; \ 329 VTK_FACTORY_INTERFACE_EXPORT \ 330 vtkObjectFactory* vtkLoad() \ 332 return factoryName ::New(); \ 336 #define VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \ 337 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, false); \ 340 return static_cast<thisClass*>(ret); \ 342 thisClass *result = new thisClass; \ 343 result->InitializeObjectBase(); \ 349 #define VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass) \ 350 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, true); \ 353 return static_cast<thisClass*>(ret); \ 355 vtkGenericWarningMacro("Error: no override found for '" #thisClass "'."); \ 359 #if defined(VTK_ALL_NEW_OBJECT_FACTORY) 360 # define VTK_STANDARD_NEW_BODY(thisClass) \ 361 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) 363 # define VTK_STANDARD_NEW_BODY(thisClass) \ 364 thisClass *result = new thisClass; \ 365 result->InitializeObjectBase(); \ 370 #define vtkStandardNewMacro(thisClass) \ 371 thisClass* thisClass::New() \ 373 VTK_STANDARD_NEW_BODY(thisClass) \ 377 #define vtkObjectFactoryNewMacro(thisClass) \ 378 thisClass* thisClass::New() \ 380 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \ 386 #define vtkAbstractObjectFactoryNewMacro(thisClass) \ 387 thisClass* thisClass::New() \ 389 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