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