41 #ifndef vtkObjectFactory_h 42 #define vtkObjectFactory_h 45 #include "vtkCommonCoreModule.h" 67 static vtkObject* CreateInstance(
const char* vtkclassname,
68 bool isAbstract =
false);
76 VTK_LEGACY(
static void ConstructInstance(
const char* vtkclassname));
84 static void CreateAllInstance(
const char* vtkclassname,
102 static void UnRegisterAllFactories();
114 static int HasOverrideAny(
const char* className);
120 static void GetOverrideInformation(
const char*
name,
128 const char* className);
134 const char* className,
135 const char* subclassName);
153 virtual const char* GetVTKSourceVersion() = 0;
158 virtual const char* GetDescription() = 0;
163 virtual int GetNumberOfOverrides();
168 virtual const char* GetClassOverrideName(
int index);
174 virtual const char* GetClassOverrideWithName(
int index);
185 virtual const char* GetOverrideDescription(
int index);
193 const char* className,
194 const char* subclassName);
195 virtual vtkTypeBool GetEnableFlag(
const char* className,
196 const char* subclassName);
202 virtual int HasOverride(
const char* className);
206 virtual int HasOverride(
const char* className,
const char* subclassName);
213 virtual void Disable(
const char* className);
229 void RegisterOverride(
const char* classOverride,
230 const char* overrideClassName,
233 CreateFunction createFunction);
240 virtual vtkObject* CreateObject(
const char* vtkclassname );
259 void GrowOverrideArray();
269 static void RegisterDefaults();
273 static void LoadDynamicFactories();
277 static void LoadLibrariesInPath(
const char*);
285 char* LibraryVTKVersion;
286 char* LibraryCompilerUsed;
310 #define VTK_CREATE_CREATE_FUNCTION(classname) \ 311 static vtkObject* vtkObjectFactoryCreate##classname() \ 312 { return classname::New(); } 316 #define VTK_FACTORY_INTERFACE_EXPORT VTKCOMMONCORE_EXPORT 323 #define VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName) \ 325 VTK_FACTORY_INTERFACE_EXPORT \ 326 const char* vtkGetFactoryCompilerUsed() \ 328 return VTK_CXX_COMPILER; \ 331 VTK_FACTORY_INTERFACE_EXPORT \ 332 const char* vtkGetFactoryVersion() \ 334 return VTK_SOURCE_VERSION; \ 337 VTK_FACTORY_INTERFACE_EXPORT \ 338 vtkObjectFactory* vtkLoad() \ 340 return factoryName ::New(); \ 344 #define VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \ 345 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, false); \ 348 return static_cast<thisClass*>(ret); \ 350 thisClass *result = new thisClass; \ 351 result->InitializeObjectBase(); \ 357 #define VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass) \ 358 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, true); \ 361 return static_cast<thisClass*>(ret); \ 363 vtkGenericWarningMacro("Error: no override found for '" #thisClass "'."); \ 367 #if defined(VTK_ALL_NEW_OBJECT_FACTORY) 368 # define VTK_STANDARD_NEW_BODY(thisClass) \ 369 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) 371 # define VTK_STANDARD_NEW_BODY(thisClass) \ 372 thisClass *result = new thisClass; \ 373 result->InitializeObjectBase(); \ 378 #define vtkStandardNewMacro(thisClass) \ 379 thisClass* thisClass::New() \ 381 VTK_STANDARD_NEW_BODY(thisClass) \ 385 #define vtkObjectFactoryNewMacro(thisClass) \ 386 thisClass* thisClass::New() \ 388 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \ 394 #define vtkAbstractObjectFactoryNewMacro(thisClass) \ 395 thisClass* thisClass::New() \ 397 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 unsorted lists of objects
abstract base class for vtkObjectFactories