Commit d4f4b96f authored by Bill Hoffman's avatar Bill Hoffman

ENH: changed all static New methods to use the vtkObjectFactory

parent de79eb27

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -13,19 +13,8 @@ VPATH = @srcdir@
ABSTRACT_H =
CONCRETE_H = \
vtkDataSetCollection \
vtkFloatNormals \
vtkFloatPoints \
vtkFloatScalars \
vtkFloatTCoords \
vtkFloatTensors \
vtkFloatVectors \
vtkImplicitFunctionCollection \
vtkObjectFactoryCollection \
vtkPlaneCollection \
vtkPropCollection \
vtkTransformCollection \
vtkVersion
vtkObjectFactoryCollection
ABSTRACT = \
vtkAbstractMapper \
......@@ -59,6 +48,7 @@ vtkCoordinate \
vtkDataInformation \
vtkDataObject \
vtkDataSetAttributes \
vtkDataSetCollection \
vtkDirectory \
vtkDynamicLoader \
vtkDoubleArray \
......@@ -66,6 +56,12 @@ vtkEdgeTable \
vtkEmptyCell \
vtkFieldData \
vtkFloatArray \
vtkFloatNormals \
vtkFloatPoints \
vtkFloatScalars \
vtkFloatTCoords \
vtkFloatTensors \
vtkFloatVectors \
vtkGenericCell \
vtkHexahedron \
vtkIdList \
......@@ -73,6 +69,7 @@ vtkImageData \
vtkImageInformation \
vtkImageSource \
vtkImageToStructuredPoints \
vtkImplicitFunctionCollection \
vtkIndent \
vtkIntArray \
vtkLine \
......@@ -89,6 +86,7 @@ vtkNormals \
vtkObject \
vtkPixel \
vtkPlane \
vtkPlaneCollection \
vtkPointData \
vtkPointLocator \
vtkPointLocator2D \
......@@ -101,6 +99,7 @@ vtkPriorityQueue \
vtkProcessObject \
vtkProp \
vtkPropAssembly \
vtkPropCollection \
vtkProperty2D \
vtkPyramid \
vtkQuad \
......@@ -122,6 +121,7 @@ vtkTetra \
vtkTimerLog \
vtkTimeStamp \
vtkTransform \
vtkTransformCollection \
vtkTriangle \
vtkTriangleStrip \
vtkUnsignedCharArray \
......
......@@ -40,6 +40,25 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
#include "vtkAbstractMapper.h"
#include "vtkDataSet.h"
#include "vtkObjectFactory.h"
//------------------------------------------------------------------------------
vtkAbstractMapper* vtkAbstractMapper::New()
{
// First try to create the object from the vtkObjectFactory
vtkObject* ret = vtkObjectFactory::CreateInstance("vtkAbstractMapper");
if(ret)
{
return (vtkAbstractMapper*)ret;
}
// If the factory was unable to create the object, then create it here.
return new vtkAbstractMapper;
}
// Construct object.
vtkAbstractMapper::vtkAbstractMapper()
......
......@@ -62,7 +62,7 @@ public:
// Description:
// Instantiate object.
static vtkAbstractMapper *New() {return new vtkAbstractMapper;};
static vtkAbstractMapper *New();
// Description:
// Release any graphics resources that are being consumed by this mapper.
......
......@@ -42,6 +42,25 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkProperty2D.h"
#include "vtkMapper2D.h"
#include "vtkPropCollection.h"
#include "vtkObjectFactory.h"
//------------------------------------------------------------------------------
vtkActor2D* vtkActor2D::New()
{
// First try to create the object from the vtkObjectFactory
vtkObject* ret = vtkObjectFactory::CreateInstance("vtkActor2D");
if(ret)
{
return (vtkActor2D*)ret;
}
// If the factory was unable to create the object, then create it here.
return new vtkActor2D;
}
// Creates an actor2D with the following defaults:
// position -1, -1 (view coordinates)
......
......@@ -67,7 +67,7 @@ public:
// Creates an actor2D with the following defaults:
// position -1, -1 (view coordinates)
// orientation 0, scale (1,1), layer 0, visibility on
static vtkActor2D* New() {return new vtkActor2D;};
static vtkActor2D* New();
// Description:
// Support the standard render methods.
......
......@@ -42,6 +42,25 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkCollection.h"
#include "vtkActor2D.h"
#include "vtkActor2DCollection.h"
#include "vtkObjectFactory.h"
//------------------------------------------------------------------------------
vtkActor2DCollection* vtkActor2DCollection::New()
{
// First try to create the object from the vtkObjectFactory
vtkObject* ret = vtkObjectFactory::CreateInstance("vtkActor2DCollection");
if(ret)
{
return (vtkActor2DCollection*)ret;
}
// If the factory was unable to create the object, then create it here.
return new vtkActor2DCollection;
}
// protected function to delete an element. Internal use only.
void vtkActor2DCollection::DeleteElement(vtkCollectionElement *e)
......
......@@ -61,7 +61,7 @@ class VTK_EXPORT vtkActor2DCollection : public vtkPropCollection
// Description:
// Desctructor for the vtkActor2DCollection class. This removes all
// objects from the collection.
static vtkActor2DCollection *New() {return new vtkActor2DCollection;};
static vtkActor2DCollection *New();
const char *GetClassName() {return "vtkActor2DCollection";};
// Description:
......
......@@ -39,6 +39,25 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
#include "vtkBitArray.h"
#include "vtkObjectFactory.h"
//------------------------------------------------------------------------------
vtkBitArray* vtkBitArray::New()
{
// First try to create the object from the vtkObjectFactory
vtkObject* ret = vtkObjectFactory::CreateInstance("vtkBitArray");
if(ret)
{
return (vtkBitArray*)ret;
}
// If the factory was unable to create the object, then create it here.
return new vtkBitArray;
}
// Instantiate object.
vtkBitArray::vtkBitArray(int numComp)
......
......@@ -53,7 +53,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
class VTK_EXPORT vtkBitArray : public vtkDataArray
{
public:
static vtkBitArray *New() {return new vtkBitArray;};
static vtkBitArray *New();
virtual const char *GetClassName() {return "vtkBitArray";};
void PrintSelf(ostream& os, vtkIndent indent);
......
......@@ -40,6 +40,25 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
#include "vtkByteSwap.h"
#include <memory.h>
#include "vtkObjectFactory.h"
//------------------------------------------------------------------------------
vtkByteSwap* vtkByteSwap::New()
{
// First try to create the object from the vtkObjectFactory
vtkObject* ret = vtkObjectFactory::CreateInstance("vtkByteSwap");
if(ret)
{
return (vtkByteSwap*)ret;
}
// If the factory was unable to create the object, then create it here.
return new vtkByteSwap;
}
// Swap four byte word.
#ifdef VTK_WORDS_BIGENDIAN
......
......@@ -54,7 +54,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
class VTK_EXPORT vtkByteSwap : public vtkObject
{
public:
static vtkByteSwap *New() {return new vtkByteSwap;};
static vtkByteSwap *New();
const char *GetClassName() {return "vtkByteSwap";};
// Description:
......
......@@ -39,6 +39,25 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
#include "vtkCellArray.h"
#include "vtkObjectFactory.h"
//------------------------------------------------------------------------------
vtkCellArray* vtkCellArray::New()
{
// First try to create the object from the vtkObjectFactory
vtkObject* ret = vtkObjectFactory::CreateInstance("vtkCellArray");
if(ret)
{
return (vtkCellArray*)ret;
}
// If the factory was unable to create the object, then create it here.
return new vtkCellArray;
}