Commit e4e6c028 authored by Brad King's avatar Brad King 💬
Browse files

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

parent 11c88362
......@@ -30,7 +30,8 @@
void TestOEC(ostream& strm)
{
vtkEmptyCell *cell = vtkEmptyCell::New();
vtkCell *cell2 = cell->MakeObject();
vtkCell *cell2 = cell->NewInstance();
cell2->DeepCopy(cell);
vtkIdList *ids = vtkIdList::New();
vtkPoints *pts = vtkPoints::New();
float v = 0.0;
......
......@@ -47,21 +47,21 @@ int TestQE(ostream& strm)
int subId;
//-----------------------------------------------------------
strm << "Test instantiation New() and MakeObject() Start" << endl;
strm << "Test instantiation New() and NewInstance() Start" << endl;
vtkQuadraticEdge *edge = vtkQuadraticEdge::New();
vtkQuadraticEdge *edge2 = static_cast<vtkQuadraticEdge*>(edge->MakeObject());
vtkQuadraticEdge *edge2 = edge->NewInstance();
vtkQuadraticTriangle *tri = vtkQuadraticTriangle::New();
vtkQuadraticTriangle *tri2 = static_cast<vtkQuadraticTriangle*>(tri->MakeObject());
vtkQuadraticTriangle *tri2 = tri->NewInstance();
vtkQuadraticQuad *quad = vtkQuadraticQuad::New();
vtkQuadraticQuad *quad2 = static_cast<vtkQuadraticQuad*>(quad->MakeObject());
vtkQuadraticQuad *quad2 = quad->NewInstance();
vtkQuadraticTetra *tetra = vtkQuadraticTetra::New();
vtkQuadraticTetra *tetra2 = static_cast<vtkQuadraticTetra*>(tetra->MakeObject());
vtkQuadraticTetra *tetra2 = tetra->NewInstance();
vtkQuadraticHexahedron *hex = vtkQuadraticHexahedron::New();
vtkQuadraticHexahedron *hex2 = static_cast<vtkQuadraticHexahedron*>(hex->MakeObject());
vtkQuadraticHexahedron *hex2 = hex->NewInstance();
edge2->Delete();
tri2->Delete();
......@@ -69,7 +69,7 @@ int TestQE(ostream& strm)
tetra2->Delete();
hex2->Delete();
strm << "Test instantiation New() and MakeObject() End" << endl;
strm << "Test instantiation New() and NewInstance() End" << endl;
//-------------------------------------------------------------
......
......@@ -18,7 +18,7 @@
#include "vtkCell.h"
#include "vtkMarchingSquaresCases.h"
vtkCxxRevisionMacro(vtkCell, "1.53");
vtkCxxRevisionMacro(vtkCell, "1.54");
// Construct cell.
vtkCell::vtkCell()
......@@ -306,3 +306,14 @@ vtkMarchingSquaresLineCases* vtkMarchingSquaresLineCases::GetCases()
{
return VTK_MARCHING_SQUARES_LINECASES;
}
//----------------------------------------------------------------------------
#ifndef VTK_REMOVE_LEGACY_CODE
vtkCell* vtkCell::MakeObject()
{
VTK_LEGACY_METHOD(MakeObject, "4.2");
vtkCell* c = this->NewInstance();
c->DeepCopy(this);
return c;
}
#endif
......@@ -63,10 +63,11 @@ public:
// coordinates specified.
void Initialize(int npts, vtkIdType *pts, vtkPoints *p);
#ifndef VTK_REMOVE_LEGACY_CODE
// Description:
// Create concrete copy of this cell. Initially, the copy is made by
// performing a ShallowCopy() operation.
virtual vtkCell *MakeObject() = 0;
// For legacy compatibility. Do not use.
virtual vtkCell* MakeObject();
#endif
// Description:
// Copy this cell by reference counting the internal data structures.
......
......@@ -25,7 +25,7 @@
#include "vtkPointData.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkConvexPointSet, "1.13");
vtkCxxRevisionMacro(vtkConvexPointSet, "1.14");
vtkStandardNewMacro(vtkConvexPointSet);
// Construct the hexahedron with eight points.
......@@ -53,13 +53,6 @@ vtkConvexPointSet::~vtkConvexPointSet()
this->Triangle->Delete();
}
vtkCell *vtkConvexPointSet::MakeObject()
{
vtkCell *cell = vtkConvexPointSet::New();
cell->DeepCopy(this);
return cell;
}
// Should be called by GetCell() prior to any other method invocation
void vtkConvexPointSet::Initialize()
{
......
......@@ -51,7 +51,6 @@ public:
// Description:
// See the vtkCell API for descriptions of these methods.
virtual vtkCell *MakeObject();
virtual int GetCellType() {return VTK_CONVEX_POINT_SET;}
// Description:
......
......@@ -33,7 +33,6 @@ public:
// Description:
// See the vtkCell API for descriptions of these methods.
vtkCell *MakeObject() {return vtkEmptyCell::New();};
int GetCellType() {return VTK_EMPTY_CELL;};
int GetCellDimension() {return 0;};
int GetNumberOfEdges() {return 0;};
......
......@@ -39,7 +39,7 @@
#include "vtkConvexPointSet.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkGenericCell, "1.16");
vtkCxxRevisionMacro(vtkGenericCell, "1.17");
vtkStandardNewMacro(vtkGenericCell);
// Construct cell.
......@@ -53,13 +53,6 @@ vtkGenericCell::~vtkGenericCell()
this->Cell->Delete();
}
// The following methods dereference vtkCell virtual functions to allow
// vtkCell to act like a concrete object.
vtkCell *vtkGenericCell::MakeObject()
{
return this->Cell->MakeObject();
}
void vtkGenericCell::ShallowCopy(vtkCell *c)
{
this->Cell->ShallowCopy(c);
......
......@@ -43,7 +43,6 @@ public:
// Description:
// See the vtkCell API for descriptions of these methods.
vtkCell *MakeObject();
void ShallowCopy(vtkCell *c);
void DeepCopy(vtkCell *c);
int GetCellType();
......
......@@ -26,7 +26,7 @@
#include "vtkPointLocator.h"
#include "vtkQuad.h"
vtkCxxRevisionMacro(vtkHexahedron, "1.83");
vtkCxxRevisionMacro(vtkHexahedron, "1.84");
vtkStandardNewMacro(vtkHexahedron);
static const float VTK_DIVERGED = 1.e6;
......@@ -57,13 +57,6 @@ vtkHexahedron::~vtkHexahedron()
this->Quad->Delete();
}
vtkCell *vtkHexahedron::MakeObject()
{
vtkCell *cell = vtkHexahedron::New();
cell->DeepCopy(this);
return cell;
}
// Method to calculate parametric coordinates in an eight noded
// linear hexahedron element from global coordinates.
//
......
......@@ -46,7 +46,6 @@ public:
// Description:
// See the vtkCell API for descriptions of these methods.
vtkCell *MakeObject();
int GetCellType() {return VTK_HEXAHEDRON;}
int GetNumberOfEdges() {return 12;}
int GetNumberOfFaces() {return 6;}
......
......@@ -24,7 +24,7 @@
#include "vtkPointData.h"
#include "vtkPointLocator.h"
vtkCxxRevisionMacro(vtkLine, "1.76");
vtkCxxRevisionMacro(vtkLine, "1.77");
vtkStandardNewMacro(vtkLine);
// Construct the line with two points.
......@@ -44,13 +44,6 @@ vtkLine::vtkLine()
}
}
vtkCell *vtkLine::MakeObject()
{
vtkCell *cell = vtkLine::New();
cell->DeepCopy(this);
return cell;
}
static const int VTK_NO_INTERSECTION=0;
static const int VTK_YES_INTERSECTION=2;
static const int VTK_ON_LINE=3;
......
......@@ -32,7 +32,6 @@ public:
// Description:
// See the vtkCell API for descriptions of these methods.
vtkCell *MakeObject();
int GetCellType() {return VTK_LINE;};
int GetCellDimension() {return 1;};
int GetNumberOfEdges() {return 0;};
......
......@@ -28,7 +28,7 @@
#include "vtkPointData.h"
#include "vtkCellData.h"
vtkCxxRevisionMacro(vtkPixel, "1.74");
vtkCxxRevisionMacro(vtkPixel, "1.75");
vtkStandardNewMacro(vtkPixel);
// Construct the pixel with four points.
......@@ -54,13 +54,6 @@ vtkPixel::~vtkPixel()
this->Line->Delete();
}
vtkCell *vtkPixel::MakeObject()
{
vtkCell *cell = vtkPixel::New();
cell->DeepCopy(this);
return cell;
}
int vtkPixel::EvaluatePosition(float x[3], float* closestPoint,
int& subId, float pcoords[3],
float& dist2, float *weights)
......
......@@ -36,7 +36,6 @@ public:
// Description:
// See the vtkCell API for descriptions of these methods.
vtkCell *MakeObject();
int GetCellType() {return VTK_PIXEL;};
int GetCellDimension() {return 2;};
int GetNumberOfEdges() {return 4;};
......
......@@ -21,7 +21,7 @@
#include "vtkObjectFactory.h"
#include "vtkFloatArray.h"
vtkCxxRevisionMacro(vtkPolyLine, "1.72");
vtkCxxRevisionMacro(vtkPolyLine, "1.73");
vtkStandardNewMacro(vtkPolyLine);
vtkPolyLine::vtkPolyLine()
......@@ -34,13 +34,6 @@ vtkPolyLine::~vtkPolyLine()
this->Line->Delete();
}
vtkCell *vtkPolyLine::MakeObject()
{
vtkCell *cell = vtkPolyLine::New();
cell->DeepCopy(this);
return cell;
}
// Given points and lines, compute normals to lines. These are not true
// normals, they are "orientation" normals used by classes like vtkTubeFilter
// that control the rotation around the line. The normals try to stay pointing
......
......@@ -43,7 +43,6 @@ public:
// Description:
// See the vtkCell API for descriptions of these methods.
vtkCell *MakeObject();
int GetCellType() {return VTK_POLY_LINE;};
int GetCellDimension() {return 1;};
int GetNumberOfEdges() {return 0;};
......
......@@ -24,7 +24,7 @@
#include "vtkPointData.h"
#include "vtkCellData.h"
vtkCxxRevisionMacro(vtkPolyVertex, "1.58");
vtkCxxRevisionMacro(vtkPolyVertex, "1.59");
vtkStandardNewMacro(vtkPolyVertex);
vtkPolyVertex::vtkPolyVertex()
......@@ -37,13 +37,6 @@ vtkPolyVertex::~vtkPolyVertex()
this->Vertex->Delete();
}
vtkCell *vtkPolyVertex::MakeObject()
{
vtkCell *cell = vtkPolyVertex::New();
cell->DeepCopy(this);
return cell;
}
int vtkPolyVertex::EvaluatePosition(float x[3], float* closestPoint,
int& subId, float pcoords[3],
float& minDist2, float *weights)
......
......@@ -34,7 +34,6 @@ public:
// Description:
// See the vtkCell API for descriptions of these methods.
vtkCell *MakeObject();
int GetCellType() {return VTK_POLY_VERTEX;};
int GetCellDimension() {return 0;};
int GetNumberOfEdges() {return 0;};
......
......@@ -26,7 +26,7 @@
#include <stdlib.h>
vtkCxxRevisionMacro(vtkPolygon, "1.96");
vtkCxxRevisionMacro(vtkPolygon, "1.97");
vtkStandardNewMacro(vtkPolygon);
// Instantiate polygon.
......@@ -50,13 +50,6 @@ vtkPolygon::~vtkPolygon()
this->Line->Delete();
}
vtkCell *vtkPolygon::MakeObject()
{
vtkCell *cell = vtkPolygon::New();
cell->DeepCopy(this);
return cell;
}
#define VTK_POLYGON_FAILURE -1
#define VTK_POLYGON_OUTSIDE 0
#define VTK_POLYGON_INSIDE 1
......
Supports Markdown
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