Commit 545ff6d8 authored by Sean McBride's avatar Sean McBride

Fixed all -Wunused-member-function warnings, mostly by removing dead code

In 2 cases, made trivial use of NewInstance, so that it’s not unused.
parent 5140a677
......@@ -32,7 +32,6 @@ class MyArray : public vtkTypedDataArray<float>
{
vtkFloatArray *Data;
public:
vtkTypeMacro(MyArray, vtkTypedDataArray<float>)
static MyArray *New() { VTK_STANDARD_NEW_BODY(MyArray) }
void Init(vtkFloatArray *array)
{
......
......@@ -153,7 +153,6 @@ class MappedGridImpl : public vtkObject
{
public:
static MappedGridImpl* New();
vtkTypeMacro(MappedGridImpl, vtkObject);
void Initialize(vtkUnstructuredGrid* ug) { ug->Register(this); _grid = ug; }
......@@ -287,7 +286,6 @@ class MappedGrid : public vtkMappedUnstructuredGrid<MappedGridImpl, MappedCellIt
{
public:
typedef vtkMappedUnstructuredGrid<MappedGridImpl, MappedCellIterator<MappedGridImpl> > _myBase;
vtkTypeMacro(MappedGrid, _myBase);
int GetDataObjectType() override { return VTK_UNSTRUCTURED_GRID_BASE; }
......
......@@ -981,7 +981,6 @@ struct IdTuple
vtkIdType PtId;
double Dist2;
IdTuple() : PtId(-1), Dist2(0.0) {}
IdTuple(vtkIdType ptId, double dist2) : PtId(ptId), Dist2(dist2) {}
bool operator< (const IdTuple& tuple) const
......
......@@ -209,6 +209,11 @@ int TestComposite(std::string& inputDataFile, bool isAMR)
std::cout << "Per block field data for the second output port changed" << std::endl;
retVal = VTK_FAILURE;
}
// Exercise NewInstance for coverage.
auto dummy = testAlg->NewInstance();
dummy->Delete();
return retVal;
}
}
......
......@@ -373,11 +373,6 @@ struct PointSetFunctor : public CuttingFunctor
}
}
}
bool IsCellSlicedByPlane(vtkIdType cellId)
{
return CuttingFunctor::IsCellSlicedByPlane(cellId);
}
};
// Process unstructured grids
......
......@@ -469,6 +469,9 @@ struct VTile
return false;
}
// Dead code. Kept because this method seems to be here for instructional purposes,
// and is mentioned in comments elsewhere.
#if 0
// Indicate whether the specified point x is inside the Voronoi flower. See
// also IntersectTile(x) which is an equivalent computation.
bool InFlower(const double x[2])
......@@ -490,6 +493,7 @@ struct VTile
}
return false;
}
#endif
// Generate a Voronoi tile by iterative clipping of the tile with nearby points.
// Termination of the clipping process occurs when the neighboring points become
......
......@@ -297,10 +297,6 @@ struct ComputeGradients
}//over slices
}
void Reduce()
{
}
static void Execute(int dims[3], double origin[3], double spacing[3],
float *density, float *grad, float *mag,
unsigned char *fclass)
......
......@@ -140,27 +140,6 @@ namespace
{
typedef vtkStdString Type;
typedef vtkStringArray vtkArrayType;
std::string Name() const { return std::string("string"); }
vtkStdString Default() const { return vtkStdString("None"); }
static void Get(vtkIdType index, vtkStdString* in, vtkStringArray* array)
{
assert(array->GetNumberOfComponents() == 1);
*in = array->GetValue(index);
}
static void Stream(std::ostream& out, const vtkStdString& t)
{
std::size_t i = 0;
out << "\'";
for (; i < (t.size() < 32 ? t.size() : 32); i++)
{
out << t[i];
}
for (; i < 32; i++)
{
out << " ";
}
out << "\'";
}
};
template <int AttributeId>
......
......@@ -152,7 +152,6 @@ class MappedGridImpl : public vtkObject
{
public:
static MappedGridImpl* New();
vtkTypeMacro(MappedGridImpl, vtkObject);
void Initialize(vtkUnstructuredGrid* ug) { ug->Register(this); _grid = ug; }
......@@ -286,7 +285,6 @@ class MappedGrid : public vtkMappedUnstructuredGrid<MappedGridImpl, MappedCellIt
{
public:
typedef vtkMappedUnstructuredGrid<MappedGridImpl, MappedCellIterator<MappedGridImpl> > _myBase;
vtkTypeMacro(MappedGrid, _myBase);
int GetDataObjectType() override { return VTK_UNSTRUCTURED_GRID_BASE; }
......
......@@ -372,12 +372,6 @@ public:
class vtkICF::Seed
{
public:
Seed() {
pos[0] = 0; pos[1] = 0; pos[2] = 0; value = 0; }
Seed(int i, int j, int k) {
pos[0] = i; pos[1] = j; pos[2] = k; value = 0; }
Seed(int i, int j, int k, int v) {
pos[0] = i; pos[1] = j; pos[2] = k; value = v; }
......@@ -387,10 +381,8 @@ public:
pos[2] = seed.pos[2];
value = seed.value; };
const int &operator[](int i) const { return pos[i]; }
int &operator[](int i) { return pos[i]; }
const int &operator*() const { return value; }
int &operator*() { return value; }
vtkICF::Seed &operator=(const vtkICF::Seed& seed) {
......
......@@ -141,5 +141,9 @@ int TestContext2D(int, char*[])
view->GetInteractor()->Initialize();
view->Render();
// Exercise NewInstance for coverage.
auto dummy = test->NewInstance();
dummy->Delete();
return test->Succeeded ? EXIT_SUCCESS : EXIT_FAILURE;
}
......@@ -62,7 +62,6 @@ protected:
public:
static PointPickCommand * New() {return new PointPickCommand;}
vtkTypeMacro(PointPickCommand, vtkCommand);
PointPickCommand() = default;
......
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