Commit 02eb71b5 authored by Brad King's avatar Brad King
Browse files

ENH: vtkDataObject::MakeObject() is now deprecated.

parent 036791f3
......@@ -22,7 +22,7 @@
#include "vtkObjectFactory.h"
#include "vtkSource.h"
vtkCxxRevisionMacro(vtkDataObject, "1.87");
vtkCxxRevisionMacro(vtkDataObject, "1.88");
vtkStandardNewMacro(vtkDataObject);
vtkCxxSetObjectMacro(vtkDataObject,FieldData,vtkFieldData);
......@@ -839,3 +839,12 @@ void vtkDataObject::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "ExtentTranslator: (" << this->ExtentTranslator << ")\n";
os << indent << "MaximumNumberOfPieces: " << this->MaximumNumberOfPieces << endl;
}
//----------------------------------------------------------------------------
#ifndef VTK_REMOVE_LEGACY_CODE
vtkDataObject* vtkDataObject::MakeObject()
{
VTK_LEGACY_METHOD(MakeObject, "4.2");
return this->NewInstance();
}
#endif
......@@ -53,9 +53,11 @@ public:
vtkTypeRevisionMacro(vtkDataObject,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
#ifndef VTK_REMOVE_LEGACY_CODE
// Description:
// Create concrete instance of this data object.
virtual vtkDataObject *MakeObject() {return vtkDataObject::New();}
// For legacy compatibility. Do not use.
virtual vtkDataObject* MakeObject();
#endif
// Description:
// Set/Get the source object creating this data object.
......
......@@ -41,10 +41,6 @@ public:
vtkTypeRevisionMacro(vtkImageData,vtkDataSet);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Create the same type object as this (virtual constructor).
vtkDataObject *MakeObject() {return vtkImageData::New();};
// Description:
// Copy the geometric and topological structure of an input image data
// object.
......
......@@ -63,10 +63,6 @@ public:
vtkTypeRevisionMacro(vtkPolyData,vtkPointSet);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Create a similar type object.
vtkDataObject *MakeObject() {return vtkPolyData::New();};
// Description:
// Return what type of dataset this is.
int GetDataObjectType() {return VTK_POLY_DATA;}
......
......@@ -53,10 +53,6 @@ public:
vtkTypeRevisionMacro(vtkRectilinearGrid,vtkDataSet);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Create a similar type object.
vtkDataObject *MakeObject() {return vtkRectilinearGrid::New();};
// Description:
// Return what type of dataset this is.
int GetDataObjectType() {return VTK_RECTILINEAR_GRID;};
......
......@@ -54,10 +54,6 @@ public:
// Return what type of dataset this is.
int GetDataObjectType() {return VTK_STRUCTURED_GRID;}
// Description:
// Create a similar type object
vtkDataObject *MakeObject() {return vtkStructuredGrid::New();}
// Description:
// Copy the geometric and topological structure of an input poly data object.
void CopyStructure(vtkDataSet *ds);
......
......@@ -38,10 +38,6 @@ class VTK_COMMON_EXPORT vtkStructuredPoints : public vtkImageData
public:
static vtkStructuredPoints *New();
vtkTypeRevisionMacro(vtkStructuredPoints,vtkImageData);
// Description:
// Create a similar type object
vtkDataObject *MakeObject() {return vtkStructuredPoints::New();}
// Description:
// To simplify filter superclasses,
......
......@@ -74,7 +74,6 @@ public:
void SetCells(vtkUnsignedCharArray *cellTypes, vtkIntArray *cellLocations,
vtkCellArray *cells);
vtkCellArray *GetCells() {return this->Connectivity;};
vtkDataObject *MakeObject() {return vtkUnstructuredGrid::New();};
virtual void CopyStructure(vtkDataSet *ds);
vtkIdType GetNumberOfCells();
virtual vtkCell *GetCell(vtkIdType cellId);
......
......@@ -22,7 +22,7 @@
#include "vtkUnstructuredGrid.h"
#include "vtkRectilinearGrid.h"
vtkCxxRevisionMacro(vtkDataSetToDataSetFilter, "1.62");
vtkCxxRevisionMacro(vtkDataSetToDataSetFilter, "1.63");
// Construct object.
vtkDataSetToDataSetFilter::vtkDataSetToDataSetFilter()
......@@ -52,7 +52,7 @@ void vtkDataSetToDataSetFilter::SetInput(vtkDataSet *input)
if (input != NULL && this->vtkSource::GetOutput(0) == NULL)
{
this->vtkSource::SetNthOutput(0, input->MakeObject());
this->vtkSource::SetNthOutput(0, input->NewInstance());
this->Outputs[0]->ReleaseData();
this->Outputs[0]->Delete();
}
......
......@@ -20,7 +20,7 @@
#include "vtkStructuredGrid.h"
#include "vtkUnstructuredGrid.h"
vtkCxxRevisionMacro(vtkPointSetToPointSetFilter, "1.58");
vtkCxxRevisionMacro(vtkPointSetToPointSetFilter, "1.59");
//----------------------------------------------------------------------------
// Construct object.
......@@ -52,7 +52,7 @@ void vtkPointSetToPointSetFilter::SetInput(vtkPointSet *input)
if (input != NULL && this->vtkSource::GetOutput(0) == NULL)
{
this->vtkSource::SetNthOutput(0, input->MakeObject());
this->vtkSource::SetNthOutput(0, input->NewInstance());
this->Outputs[0]->ReleaseData();
this->Outputs[0]->Delete();
}
......
......@@ -21,7 +21,7 @@
#include "vtkDataSet.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkExtractVectorComponents, "1.43");
vtkCxxRevisionMacro(vtkExtractVectorComponents, "1.44");
vtkStandardNewMacro(vtkExtractVectorComponents);
vtkExtractVectorComponents::vtkExtractVectorComponents()
......@@ -119,11 +119,11 @@ void vtkExtractVectorComponents::SetInput(vtkDataSet *input)
if (this->NumberOfOutputs < 3)
{
this->SetNthOutput(0,input->MakeObject());
this->SetNthOutput(0,input->NewInstance());
this->Outputs[0]->Delete();
this->SetNthOutput(1,input->MakeObject());
this->SetNthOutput(1,input->NewInstance());
this->Outputs[1]->Delete();
this->SetNthOutput(2,input->MakeObject());
this->SetNthOutput(2,input->NewInstance());
this->Outputs[2]->Delete();
return;
}
......@@ -131,11 +131,11 @@ void vtkExtractVectorComponents::SetInput(vtkDataSet *input)
// since the input has changed we might need to create a new output
if (strcmp(this->Outputs[0]->GetClassName(),input->GetClassName()))
{
this->SetNthOutput(0,input->MakeObject());
this->SetNthOutput(0,input->NewInstance());
this->Outputs[0]->Delete();
this->SetNthOutput(1,input->MakeObject());
this->SetNthOutput(1,input->NewInstance());
this->Outputs[1]->Delete();
this->SetNthOutput(2,input->MakeObject());
this->SetNthOutput(2,input->NewInstance());
this->Outputs[2]->Delete();
vtkWarningMacro(<<" a new output had to be created since the input type changed.");
}
......
......@@ -21,7 +21,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageStencilData, "1.6");
vtkCxxRevisionMacro(vtkImageStencilData, "1.7");
vtkStandardNewMacro(vtkImageStencilData);
//----------------------------------------------------------------------------
......@@ -80,15 +80,6 @@ void vtkImageStencilData::PrintSelf(ostream& os, vtkIndent indent)
<< this->OldOrigin[2] << ")\n";
}
//----------------------------------------------------------------------------
vtkDataObject *vtkImageStencilData::MakeObject()
{
vtkImageStencilData *o = vtkImageStencilData::New();
o->DeepCopy(this);
return (vtkDataObject *)o;
}
//----------------------------------------------------------------------------
void vtkImageStencilData::Initialize()
{
......@@ -469,9 +460,13 @@ void vtkImageStencilData::InsertNextExtent(int r1, int r2, int yIdx, int zIdx)
clist[clistlen++] = r2 + 1;
}
//----------------------------------------------------------------------------
#ifndef VTK_REMOVE_LEGACY_CODE
vtkDataObject* vtkImageStencilData::MakeObject()
{
VTK_LEGACY_METHOD(MakeObject, "4.2");
vtkImageStencilData* o = vtkImageStencilData::New();
o->DeepCopy(this);
return o;
}
#endif
......@@ -37,7 +37,13 @@ public:
vtkTypeRevisionMacro(vtkImageStencilData, vtkDataObject);
void PrintSelf(ostream& os, vtkIndent indent);
vtkDataObject *MakeObject();
#ifndef VTK_REMOVE_LEGACY_CODE
// Description:
// For legacy compatibility. Do not use.
virtual vtkDataObject* MakeObject();
#endif
void Initialize();
void DeepCopy(vtkDataObject *o);
void ShallowCopy(vtkDataObject *f);
......
......@@ -31,7 +31,7 @@
#include "vtkUnsignedCharArray.h"
#include "vtkUnsignedLongArray.h"
vtkCxxRevisionMacro(vtkCommunicator, "1.15");
vtkCxxRevisionMacro(vtkCommunicator, "1.16");
template <class T>
int SendDataArray(T* data, int length, int handle, int tag, vtkCommunicator *self)
......@@ -475,7 +475,7 @@ int vtkCommunicator::WriteDataSet(vtkDataSet *data)
unsigned long size;
vtkDataSetWriter *writer = vtkDataSetWriter::New();
copy = (vtkDataSet*)(data->MakeObject());
copy = data->NewInstance();
copy->ShallowCopy(data);
// There is a problem with binary files with no data.
......
......@@ -24,7 +24,7 @@
#include "vtkStructuredGrid.h"
#include "vtkRectilinearGrid.h"
vtkCxxRevisionMacro(vtkPDataSetWriter, "1.7");
vtkCxxRevisionMacro(vtkPDataSetWriter, "1.8");
vtkStandardNewMacro(vtkPDataSetWriter);
//----------------------------------------------------------------------------
......@@ -210,7 +210,7 @@ void vtkPDataSetWriter::Write()
writer->SetFileName(fileName);
input->SetUpdateExtent(i, this->NumberOfPieces, this->GhostLevel);
input->Update();
copy = input->MakeObject();
copy = input->NewInstance();
copy->ShallowCopy(input);
// I am putting this in here because shallow copy does not copy the
// UpdateExtentInitializedFlag, and I do not want to touch ShallowCopy
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment