Commit 69198ba4 authored by Dan Lipsa's avatar Dan Lipsa

ENH: Remove legacy code from before vtk-6.1 (2014-01-21)

Remove all code marked with VTK_LEGACY...
from before vtk-6.1 (2014-01-21)
parent 2bb0090f
......@@ -820,44 +820,6 @@ bool vtkAxis::SetCustomTickPositions(vtkDoubleArray *positions,
}
}
#ifndef VTK_LEGACY_REMOVE
//-----------------------------------------------------------------------------
void vtkAxis::SetTickPositions(vtkDoubleArray* array)
{
VTK_LEGACY_REPLACED_BODY(vtkAxis::SetTickPositions, "VTK 6.0",
vtkAxis::SetCustomTickPositions);
if (!array)
{
this->TickPositions->SetNumberOfTuples(0);
}
else
{
this->TickPositions->DeepCopy(array);
}
this->CustomTickLabels = true;
this->TickMarksDirty = false;
this->Modified();
}
//-----------------------------------------------------------------------------
void vtkAxis::SetTickLabels(vtkStringArray* array)
{
VTK_LEGACY_REPLACED_BODY(vtkAxis::SetTickLabels, "VTK 6.0",
vtkAxis::SetCustomTickPositions);
if (!array)
{
this->TickLabels->SetNumberOfTuples(0);
}
else
{
this->TickLabels->DeepCopy(array);
}
this->CustomTickLabels = true;
this->TickMarksDirty = false;
this->Modified();
}
#endif // VTK_LEGACY_REMOVE
//-----------------------------------------------------------------------------
vtkRectf vtkAxis::GetBoundingRect(vtkContext2D* painter)
{
......
......@@ -293,13 +293,6 @@ public:
STANDARD_NOTATION = 0,
SCIENTIFIC_NOTATION,
FIXED_NOTATION,
#ifndef VTK_LEGACY_REMOVE
// deprecated, use the *_NOTATION versions above
STANDARD = STANDARD_NOTATION,
SCIENTIFIC = SCIENTIFIC_NOTATION,
MIXED = FIXED_NOTATION
#endif
};
// Description:
......@@ -389,16 +382,6 @@ public:
virtual bool SetCustomTickPositions(vtkDoubleArray* positions,
vtkStringArray* labels = 0);
// Description:
// Set the tick positions (in plot coordinates).
// \deprecated 6.0 Use the two parameter SetTickPositions function.
VTK_LEGACY(virtual void SetTickPositions(vtkDoubleArray* positions));
// Description:
// Set the tick labels for the axis.
// \deprecated 6.0 Use the two parameter SetTickPositions function.
VTK_LEGACY(virtual void SetTickLabels(vtkStringArray* labels));
// Description:
// Request the space the axes require to be drawn. This is returned as a
// vtkRectf, with the corner being the offset from Point1, and the width/
......
......@@ -773,18 +773,6 @@ void vtkScatterPlotMatrix::ProcessEvents(vtkObject *, unsigned long event,
}
}
#ifndef VTK_LEGACY_REMOVE
vtkAnnotationLink* vtkScatterPlotMatrix::GetActiveAnnotationLink()
{
// Never made it into a release, deprecating for shorter, more consistent
// naming of the function.
VTK_LEGACY_REPLACED_BODY(vtkScatterPlotMatrix::GetActiveAnnotationLink,
"VTK 5.8",
vtkScatterPlotMatrix::GetAnnotationLink);
return this->GetAnnotationLink();
}
#endif
vtkAnnotationLink* vtkScatterPlotMatrix::GetAnnotationLink()
{
return this->Private->Link.GetPointer();
......
......@@ -73,12 +73,6 @@ public:
// Get the position of the active plot.
virtual vtkVector2i GetActivePlot();
// Description:
// Get the active AnnotationLink from the big chart, which
// is the only active AnnotationLink in the matrix.
// @deprecated Replaced by GetAnnotationLink(), never in a VTK release.
VTK_LEGACY(vtkAnnotationLink* GetActiveAnnotationLink());
// Description:
// Get the AnnotationLink for the scatter plot matrix, this gives you access
// to the currently selected points in the scatter plot matrix.
......
......@@ -3170,21 +3170,3 @@ bool vtkMath::IsFinite(double x)
return !vtkMath::IsNan(x) && !vtkMath::IsInf(x);
}
#endif
#ifndef VTK_LEGACY_REMOVE
//-----------------------------------------------------------------------------
double vtkMath::DoublePi()
{
VTK_LEGACY_REPLACED_BODY(vtkMath::DoublePi, "VTK 6.0", vtkMath::Pi);
return vtkMath::Pi();
}
#endif
#ifndef VTK_LEGACY_REMOVE
//-----------------------------------------------------------------------------
double vtkMath::DoubleTwoPi()
{
VTK_LEGACY_BODY(vtkMath::DoubleTwoPi, "VTK 6.0");
return 2.0*vtkMath::Pi();
};
#endif
......@@ -80,14 +80,6 @@ public:
// A mathematical constant. This version is atan(1.0) * 4.0
static double Pi() { return 3.141592653589793; };
// Description:
// Deprecated. Use vtkMath::Pi() instead.
VTK_LEGACY(static double DoublePi());
// Description:
// Deprecated. Use 2.0 * vtkMath::Pi() instead.
VTK_LEGACY(static double DoubleTwoPi());
// Description:
// Convert degrees into radians
static float RadiansFromDegrees( float degrees);
......
......@@ -637,15 +637,6 @@ virtual double *Get##name() \
} \
public:
// Legacy versions of vtkTypeMacro and helpers.
#if !defined(VTK_LEGACY_REMOVE)
# define vtkExportedTypeRevisionMacro(thisClass,superclass,dllExport) \
vtkTypeMacro(thisClass,superclass)
# define vtkTypeRevisionMacro(thisClass,superclass) \
vtkTypeMacro(thisClass,superclass)
# define vtkCxxRevisionMacro(thisClass, revision)
#endif
// Macro to implement the instantiator's wrapper around the New()
// method. Use this macro if and only if vtkStandardNewMacro or
// vtkObjectFactoryNewMacro is not used by the class.
......
......@@ -165,12 +165,6 @@
# endif
#endif
/* Define compatibility names for these constants. */
#if !defined(VTK_LEGACY_REMOVE)
# define VTK_LARGE_INTEGER VTK_INT_MAX
# define VTK_LARGE_FLOAT VTK_FLOAT_MAX
#endif
/*--------------------------------------------------------------------------*/
/* Define named types and constants corresponding to specific integer
and floating-point sizes and signedness. */
......@@ -284,19 +278,5 @@ typedef int vtkIdType;
# define VTK_ID_MAX VTK_INT_MAX
#endif
/*--------------------------------------------------------------------------*/
/* Provide deprecated pre-VTK6 constant. */
#if !defined(VTK_LEGACY_REMOVE)
# define VTK_LARGE_ID VTK_ID_MAX
#endif
/*--------------------------------------------------------------------------*/
/* Define the type of floating point interface used for old and new
versions of VTK. VTK 4.2 and older use float and VTK 4.4 and newer
use double for most of the API calls. */
#if !defined(VTK_LEGACY_REMOVE)
# define vtkFloatingPointType double
#endif
#endif
// VTK-HeaderTest-Exclude: vtkType.h
......@@ -82,18 +82,6 @@ public:
// Description:
// Get the blue component of the color, i.e. element 2.
const T& GetBlue() const { return this->Data[2]; }
// Description:
// Legacy method for getting the red component.
VTK_LEGACY(const T& Red() const);
// Description:
// Legacy method for getting the green component.
VTK_LEGACY(const T& Green() const);
// Description:
// Legacy method for getting the blue component.
VTK_LEGACY(const T& Blue() const);
};
// .NAME vtkColor4 - templated base type for storage of 4 component colors.
......@@ -172,22 +160,6 @@ public:
// Description:
// Get the alpha component of the color, i.e. element 3.
const T& GetAlpha() const { return this->Data[3]; }
// Description:
// Legacy method for getting the red component.
VTK_LEGACY(const T& Red() const);
// Description:
// Legacy method for getting the green component.
VTK_LEGACY(const T& Green() const);
// Description:
// Legacy method for getting the blue component.
VTK_LEGACY(const T& Blue() const);
// Description:
// Legacy method for getting the alpha component.
VTK_LEGACY(const T& Alpha() const);
};
// Description:
......@@ -286,56 +258,5 @@ public:
: vtkColor4<double>(r, g, b, a) {}
};
#ifndef VTK_LEGACY_REMOVE
template<typename T>
const T& vtkColor3<T>::Red() const
{
VTK_LEGACY_REPLACED_BODY(vtkColor3::Red, "VTK 6.0", vtkColor3::GetRed);
return this->GetRed();
}
template<typename T>
const T& vtkColor3<T>::Green() const
{
VTK_LEGACY_REPLACED_BODY(vtkColor3::Green, "VTK 6.0", vtkColor3::GetGreen);
return this->GetGreen();
}
template<typename T>
const T& vtkColor3<T>::Blue() const
{
VTK_LEGACY_REPLACED_BODY(vtkColor3::Blue, "VTK 6.0", vtkColor3::GetBlue);
return this->GetBlue();
}
template<typename T>
const T& vtkColor4<T>::Red() const
{
VTK_LEGACY_REPLACED_BODY(vtkColor4::Red, "VTK 6.0", vtkColor4::GetRed);
return this->GetRed();
}
template<typename T>
const T& vtkColor4<T>::Green() const
{
VTK_LEGACY_REPLACED_BODY(vtkColor4::Green, "VTK 6.0", vtkColor4::GetGreen);
return this->GetGreen();
}
template<typename T>
const T& vtkColor4<T>::Blue() const
{
VTK_LEGACY_REPLACED_BODY(vtkColor4::Blue, "VTK 6.0", vtkColor4::GetBlue);
return this->GetBlue();
}
template<typename T>
const T& vtkColor4<T>::Alpha() const
{
VTK_LEGACY_REPLACED_BODY(vtkColor4::Alpha, "VTK 6.0", vtkColor4::GetAlpha);
return this->GetAlpha();
}
#endif // VTK_LEGACY_REMOVE
#endif // vtkColor_h
// VTK-HeaderTest-Exclude: vtkColor.h
......@@ -357,7 +357,7 @@ static int faces[6][4] = { {0,4,7,3}, {1,2,6,5},
// Marching cubes case table
//
#include "vtkMarchingCubesCases.h"
#include "vtkMarchingCubesTriangleCases.h"
void vtkHexahedron::Contour(double value, vtkDataArray *cellScalars,
vtkIncrementalPointLocator *locator,
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkMarchingCubesCases.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkSystemIncludes.h"
// Retained for compatibility, deprecated in VTK 5.10, remove in VTK 6.0.
#ifndef VTK_LEGACY_REMOVE
# include "vtkMarchingCubesTriangleCases.h"
#endif
// VTK-HeaderTest-Exclude: vtkMarchingCubesCases.h
/*=========================================================================
Program: Visualization Toolkit
Module: vtkMarchingSquaresCases.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkSystemIncludes.h"
// Retained for compatibility, deprecated in VTK 5.10, remove in VTK 6.0.
#ifndef VTK_LEGACY_REMOVE
# include "vtkMarchingSquaresLineCases.h"
#endif
// VTK-HeaderTest-Exclude: vtkMarchingSquaresCases.h
......@@ -212,7 +212,7 @@ int vtkPixel::CellBoundary(int vtkNotUsed(subId), double pcoords[3], vtkIdList *
//
// Marching squares
//
#include "vtkMarchingSquaresCases.h"
#include "vtkMarchingSquaresLineCases.h"
static int edges[4][2] = { {0,1}, {1,3}, {2,3}, {0,2} };
......
......@@ -85,22 +85,6 @@ public:
// Description:
// Get the height of the rectangle, i.e. element 3.
const T& GetHeight() const { return this->Data[3]; }
// Description:
// Legacy method for getting the x position.
VTK_LEGACY(const T& X() const);
// Description:
// Legacy method for getting the y position.
VTK_LEGACY(const T& Y() const);
// Description:
// Legacy method for getting the width.
VTK_LEGACY(const T& Width() const);
// Description:
// Legacy method for getting the height.
VTK_LEGACY(const T& Height() const);
};
class vtkRecti : public vtkRect<int>
......@@ -130,37 +114,5 @@ public:
explicit vtkRectd(const double *init) : vtkRect<double>(init) {}
};
#ifndef VTK_LEGACY_REMOVE
template<typename T>
const T& vtkRect<T>::X() const
{
VTK_LEGACY_REPLACED_BODY(vtkRect::X, "VTK 6.0", vtkRect::GetX);
return this->GetX();
}
template<typename T>
const T& vtkRect<T>::Y() const
{
VTK_LEGACY_REPLACED_BODY(vtkRect::Y, "VTK 6.0", vtkRect::GetY);
return this->GetY();
}
template<typename T>
const T& vtkRect<T>::Width() const
{
VTK_LEGACY_REPLACED_BODY(vtkRect::Width, "VTK 6.0", vtkRect::GetWidth);
return this->GetWidth();
}
template<typename T>
const T& vtkRect<T>::Height() const
{
VTK_LEGACY_REPLACED_BODY(vtkRect::Height, "VTK 6.0", vtkRect::GetHeight);
return this->GetHeight();
}
#endif // VTK_LEGACY_REMOVE
#endif // vtkRect_h
// VTK-HeaderTest-Exclude: vtkRect.h
......@@ -2090,11 +2090,3 @@ vtkUnstructuredGrid* vtkUnstructuredGrid::GetData(vtkInformationVector* v,
{
return vtkUnstructuredGrid::GetData(v->GetInformationObject(i));
}
//----------------------------------------------------------------------------
#ifndef VTK_LEGACY_REMOVE
void vtkUnstructuredGrid::GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
{
this->GetCellNeighbors(cellId, &ptIds, &cellIds);
}
#endif
......@@ -375,10 +375,6 @@ private:
void operator=(const vtkUnstructuredGrid&); // Not implemented.
void Cleanup();
// Description:
// For legacy compatibility. Do not use.
VTK_LEGACY(void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds));
};
#endif
......@@ -168,14 +168,6 @@ public:
// Description:
// Get the y component of the vector, i.e. element 1.
const T& GetY() const { return this->Data[1]; }
// Description:
// Legacy method for getting the x component.
VTK_LEGACY(const T& X() const);
// Description:
// Legacy method for getting the y component.
VTK_LEGACY(const T& Y() const);
};
// .NAME vtkVector3 - templated base type for storage of 3D vectors.
......@@ -246,18 +238,6 @@ public:
res[2] = this->Data[0] * other.Data[1] - this->Data[1] * other.Data[0];
return res;
}
// Description:
// Legacy method for getting the x component.
VTK_LEGACY(const T& X() const);
// Description:
// Legacy method for getting the y component.
VTK_LEGACY(const T& Y() const);
// Description:
// Legacy method for getting the z component.
VTK_LEGACY(const T& Z() const);
};
// Description:
......@@ -342,42 +322,5 @@ public:
vtkVector3Cross(vtkVector3d, double)
};
#ifndef VTK_LEGACY_REMOVE
template<typename T>
const T& vtkVector2<T>::X() const
{
VTK_LEGACY_REPLACED_BODY(vtkVector2::X, "VTK 6.0", vtkVector2::GetX);
return this->GetX();
}
template<typename T>
const T& vtkVector2<T>::Y() const
{
VTK_LEGACY_REPLACED_BODY(vtkVector2::Y, "VTK 6.0", vtkVector2::GetY);
return this->GetY();
}
template<typename T>
const T& vtkVector3<T>::X() const
{
VTK_LEGACY_REPLACED_BODY(vtkVector3::X, "VTK 6.0", vtkVector3::GetX);
return this->GetX();
}
template<typename T>
const T& vtkVector3<T>::Y() const
{
VTK_LEGACY_REPLACED_BODY(vtkVector3::Y, "VTK 6.0", vtkVector3::GetY);
return this->GetY();
}
template<typename T>
const T& vtkVector3<T>::Z() const
{
VTK_LEGACY_REPLACED_BODY(vtkVector3::Z, "VTK 6.0", vtkVector3::GetZ);
return this->GetZ();
}
#endif // VTK_LEGACY_REMOVE
#endif // vtkVector_h
// VTK-HeaderTest-Exclude: vtkVector.h
......@@ -298,7 +298,7 @@ static int faces[6][4] = { {2,0,6,4}, {1,3,5,7},
//
// Marching cubes case table
//
#include "vtkMarchingCubesCases.h"
#include "vtkMarchingCubesTriangleCases.h"
void vtkVoxel::Contour(double value, vtkDataArray *cellScalars,
vtkIncrementalPointLocator *locator,
......
......@@ -15,12 +15,6 @@ set(Module_SRCS
vtkTuple.h
)
if(NOT VTK_LEGACY_REMOVE)
list(APPEND Module_SRCS
vtkFastNumericConversion.cxx
)
endif()
set_source_files_properties(
vtkQuaternion
vtkTuple
......
......@@ -5,12 +5,4 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
TestPolynomialSolversUnivariate.cxx
TestQuaternion.cxx
)
if(NOT VTK_LEGACY_REMOVE)
vtk_add_test_cxx(${vtk-module}CxxTests extra_tests
NO_DATA NO_VALID NO_OUTPUT
TestFastNumericConversion.cxx
)
list(APPEND tests
${extra_tests})
endif()
vtk_test_cxx_executable(${vtk-module}CxxTests tests)
/*=========================================================================
Program: Visualization Toolkit
Module: TestFastNumericConversion.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME Test of vtkFastNumericConversion.
// .SECTION Description
// Tests performance of the vtkFastNumericConversion methods.
#include "vtkFastNumericConversion.h"
#include "vtkMath.h"
#include "vtkTimerLog.h"
int TestFastNumericConversion(int,char *[])
{
double bare_time;
double cast_time;
double mathfloor_time;
double mathround_time;
double convert_time;
double quickfloor_time;
double safefloor_time;
double round_time;
vtkFastNumericConversion* fnc = vtkFastNumericConversion::New();
const int inner_count = 10000;
const int outer_count = 10000;
double *dval = new double[inner_count];
int *ival = new int[inner_count];
int *frac = new int[inner_count];
union { int i; double d; } int_double_conv;
int i,o;
vtkTimerLog *timer = vtkTimerLog::New();
for (i=0; i<inner_count; i++)
{
dval[i] = i;
ival[i] = 0;
}
timer->StartTimer();
for (o=0; o<outer_count; o++)
{
for (i=0; i<inner_count; i++)
{
// Pure bit copy
int_double_conv.d = dval[i];
ival[i] = int_double_conv.i;
}
}
timer->StopTimer();
bare_time = timer->GetElapsedTime();
// Compute cast time
timer->StartTimer();
for (o=0; o<outer_count; o++)
{
for (i=0; i<inner_count; i++)
{
ival[i] = static_cast<int>(dval[i]);
}
}
timer->StopTimer();
cast_time = timer->GetElapsedTime();
// Compute vtkMath::Floor time
timer->StartTimer();
for (o=0; o<outer_count; o++)
{
for (i=0; i<inner_count; i++)
{
ival[i] = vtkMath::Floor(dval[i]);
}
}
timer->StopTimer();
mathfloor_time = timer->GetElapsedTime();
// Compute vtkMath::Round time
timer->StartTimer();
for (o=0; o<outer_count; o++)
{
for (i=0; i<inner_count; i++)
{
ival[i] = vtkMath::Round(dval[i]);
}
}
timer->StopTimer();
mathround_time = timer->GetElapsedTime();
// Compute convert time
timer->StartTimer();
for (o=0; o<outer_count; o++)
{
for (i=0; i<inner_count; i++)
{
ival[i] =fnc->ConvertFixedPoint(dval[i], frac[i]);
}
}
timer->StopTimer();
convert_time = timer->GetElapsedTime();
// Compute quickfloor time
timer->StartTimer();
for (o=0; o<outer_count; o++)
{
for (i=0; i<inner_count; i++)
{
ival[i] = vtkFastNumericConversion::QuickFloor(dval[i]);
}
}
timer->StopTimer();
quickfloor_time = timer->GetElapsedTime();
// Compute safefloor time
timer->StartTimer();
for (o=0; o<outer_count; o++)
{
for (i=0; i<inner_count; i++)
{
ival[i] = vtkFastNumericConversion::SafeFloor(dval[i]);
}
}
timer->StopTimer();
safefloor_time = timer->GetElapsedTime();
// Compute round time
timer->StartTimer();
for (o=0; o<outer_count; o++)
{
for (i=0; i<inner_count; i++)
{
ival[i] = vtkFastNumericConversion::Round(dval[i]);
}
}
timer->StopTimer();
round_time = timer->GetElapsedTime();
delete [] dval;
delete [] ival;
delete [] frac;
timer->Delete();
fnc->Delete();
cout << "Bare time from last PerformanceTest() call: " << bare_time << endl;