-
Marcus D. Hanwell authored
Factored the vtkStandardNewMacro into a VTK_STANDARD_NEW_BODY macro and a vtkStandardNewMacro. Also introduced vtkObjectFactoryNewMacro and vtkAbstractObjectFactoryNewMacro in order to replace the functionality present in some of the hard coded factories remaining from before VTK modularization. The vtkObjectFactoryNewMacro does what the vtkStandardNewMacro did previously (and will continue to do if the VTK_ALL_NEW_OBJECT_FACTORY option is turned on) - use the object factory override of the new method of the class. The vtkAbstractObjectFactoryNewMacro will attempt to return a class from the vtkObjectFactory::CreateInstance method, or return NULL if there are no overrides, i.e. the behavior of the vtkGraphicsFactory which is necesasary for abstract base classes like vtkRenderWindow. The VTK_ALL_NEW_OBJECT_FACTORY method allows VTK to be compiled with the previous behavior of all New methods using the object factory. A new static method was added to vtkObjectFactory largely for pragmatic reasons - all of those implementations already include vtkObjectFactory but not vtkDebugLeaks and so this reduces the change necessary to still work with VTK_DEBUG_LEAKS when that option is on. Change-Id: I06f713d70fc6d97ae086186c424a78f524592a4d
98ddb3e1