41 #ifndef vtkObjectFactory_h 42 #define vtkObjectFactory_h 45 #include "vtkCommonCoreModule.h" 69 static vtkObject* CreateInstance(
const char* vtkclassname,
70 bool isAbstract =
false);
78 static void CreateAllInstance(
const char* vtkclassname,
96 static void UnRegisterAllFactories();
108 static int HasOverrideAny(
const char* className);
114 static void GetOverrideInformation(
const char*
name,
122 const char* className);
128 const char* className,
129 const char* subclassName);
147 virtual const char* GetVTKSourceVersion() = 0;
152 virtual const char* GetDescription() = 0;
157 virtual int GetNumberOfOverrides();
162 virtual const char* GetClassOverrideName(
int index);
168 virtual const char* GetClassOverrideWithName(
int index);
179 virtual const char* GetOverrideDescription(
int index);
187 const char* className,
188 const char* subclassName);
189 virtual vtkTypeBool GetEnableFlag(
const char* className,
190 const char* subclassName);
196 virtual int HasOverride(
const char* className);
200 virtual int HasOverride(
const char* className,
const char* subclassName);
207 virtual void Disable(
const char* className);
213 vtkGetStringMacro(LibraryPath);
223 void RegisterOverride(
const char* classOverride,
224 const char* overrideClassName,
227 CreateFunction createFunction);
234 virtual vtkObject* CreateObject(
const char* vtkclassname );
253 void GrowOverrideArray();
263 static void RegisterDefaults();
267 static void LoadDynamicFactories();
271 static void LoadLibrariesInPath(
const std::string&);
279 char* LibraryVTKVersion;
280 char* LibraryCompilerUsed;
304 #define VTK_CREATE_CREATE_FUNCTION(classname) \ 305 static vtkObject* vtkObjectFactoryCreate##classname() \ 306 { return classname::New(); } 310 #define VTK_FACTORY_INTERFACE_EXPORT VTKCOMMONCORE_EXPORT 317 #define VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName) \ 319 VTK_FACTORY_INTERFACE_EXPORT \ 320 const char* vtkGetFactoryCompilerUsed() \ 322 return VTK_CXX_COMPILER; \ 325 VTK_FACTORY_INTERFACE_EXPORT \ 326 const char* vtkGetFactoryVersion() \ 328 return VTK_SOURCE_VERSION; \ 331 VTK_FACTORY_INTERFACE_EXPORT \ 332 vtkObjectFactory* vtkLoad() \ 334 return factoryName ::New(); \ 338 #define VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \ 339 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, false); \ 342 return static_cast<thisClass*>(ret); \ 344 thisClass *result = new thisClass; \ 345 result->InitializeObjectBase(); \ 351 #define VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass) \ 352 vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, true); \ 355 return static_cast<thisClass*>(ret); \ 357 vtkGenericWarningMacro("Error: no override found for '" #thisClass "'."); \ 361 #if defined(VTK_ALL_NEW_OBJECT_FACTORY) 362 # define VTK_STANDARD_NEW_BODY(thisClass) \ 363 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) 365 # define VTK_STANDARD_NEW_BODY(thisClass) \ 366 thisClass *result = new thisClass; \ 367 result->InitializeObjectBase(); \ 372 #define vtkStandardNewMacro(thisClass) \ 373 thisClass* thisClass::New() \ 375 VTK_STANDARD_NEW_BODY(thisClass) \ 379 #define vtkObjectFactoryNewMacro(thisClass) \ 380 thisClass* thisClass::New() \ 382 VTK_OBJECT_FACTORY_NEW_BODY(thisClass) \ 388 #define vtkAbstractObjectFactoryNewMacro(thisClass) \ 389 thisClass* thisClass::New() \ 391 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
maintain a list of object factories
char ** OverrideClassNames
create and manipulate ordered lists of objects
abstract base class for vtkObjectFactories