Commit 07a5fc02 authored by Jim Miller's avatar Jim Miller

FIX: Removed warnings. Most of the warnings were due to a subclass not

     overriding ALL versions of an overloaded function.  These were addressed
     by filling in the rest of the API.  In some cases, a subclass was
     overriding and overloading a function (changing input parameter to a
     more specific type).  For these cases, we "hid" the original function
     in the private section of the subclass.  There was one internal API
     change.  SetInput/Output(i, vtkDataObject*) was changed to SetNthInput/Output(.)
parent de59556a
......@@ -100,6 +100,13 @@ protected:
void operator=(const vtkActor2DCollection&) {};
virtual void DeleteElement(vtkCollectionElement *);
private:
// hide the standard AddItem from the user and the compiler.
void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); };
};
inline int vtkActor2DCollection::IsItemPresent(vtkActor2D *a)
......
......@@ -168,6 +168,11 @@ protected:
float *Tuple;
int SaveUserArray;
private:
// hide superclass' DeepCopy() from the user and the compiler
void DeepCopy(vtkDataArray &da) {this->vtkDataArray::DeepCopy(&da);}
};
inline unsigned char *vtkBitArray::WritePointer(const int id, const int number)
......
......@@ -125,7 +125,7 @@ void vtkDataObject::Initialize()
// no modification when initialized.
//
this->FieldData->Initialize();
};
}
//----------------------------------------------------------------------------
void vtkDataObject::SetGlobalReleaseDataFlag(int val)
......@@ -348,13 +348,13 @@ unsigned long vtkDataObject::GetEstimatedWholeMemorySize()
}
//----------------------------------------------------------------------------
void vtkDataObject::SetPipelineMTime(long t)
void vtkDataObject::SetPipelineMTime(unsigned long t)
{
this->Information->SetPipelineMTime(t);
}
//----------------------------------------------------------------------------
long vtkDataObject::GetPipelineMTime()
unsigned long vtkDataObject::GetPipelineMTime()
{
return this->Information->GetPipelineMTime();
}
......
......@@ -206,8 +206,8 @@ public:
// It does not include mtimes of the data objects.
// UpdateInformation must be called for the PipelineMTime to be correct.
// Only the source should set the PipelineMTime.
void SetPipelineMTime(long t);
long GetPipelineMTime();
void SetPipelineMTime(unsigned long t);
unsigned long GetPipelineMTime();
// Description:
// Copies the UpdateExtent from another dataset of the same type.
......
......@@ -76,6 +76,11 @@ protected:
vtkDataSetCollection(const vtkDataSetCollection&) {};
void operator=(const vtkDataSetCollection&) {};
private:
// hide the standard AddItem from the user and the compiler.
void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
};
......
......@@ -78,9 +78,11 @@ vtkEdgeTable::vtkEdgeTable()
// Free memory and return to instantiated state.
void vtkEdgeTable::Initialize()
{
int i;
if ( this->Table )
{
for (int i=0; i < this->TableSize; i++)
for (i=0; i < this->TableSize; i++)
{
if ( this->Table[i] )
{
......@@ -94,7 +96,7 @@ void vtkEdgeTable::Initialize()
if ( this->StoreAttributes )
{
for (int i=0; i < this->TableSize; i++)
for (i=0; i < this->TableSize; i++)
{
if ( this->Attributes[i] )
{
......@@ -161,6 +163,8 @@ vtkEdgeTable::~vtkEdgeTable()
int vtkEdgeTable::InitEdgeInsertion(int numPoints, int storeAttributes)
{
int i;
if ( numPoints < 1 )
{
numPoints = 1;
......@@ -171,7 +175,7 @@ int vtkEdgeTable::InitEdgeInsertion(int numPoints, int storeAttributes)
{
this->Initialize();
this->Table = new vtkIdList *[numPoints];
for (int i=0; i < numPoints; i++)
for (i=0; i < numPoints; i++)
{
this->Table[i] = NULL;
}
......@@ -180,7 +184,7 @@ int vtkEdgeTable::InitEdgeInsertion(int numPoints, int storeAttributes)
if ( this->StoreAttributes )
{
this->Attributes = new vtkIdList *[numPoints];
for (int i=0; i < numPoints; i++)
for (i=0; i < numPoints; i++)
{
this->Attributes[i] = NULL;
}
......
......@@ -79,6 +79,9 @@ protected:
vtkFloatNormals(const vtkFloatNormals&) {};
void operator=(const vtkFloatNormals&) {};
private:
// hide the vtkNormal's New() method
static vtkFloatNormals *New(int) { return vtkFloatNormals::New();};
};
inline float *vtkFloatNormals::GetPointer(const int id)
......
......@@ -78,7 +78,12 @@ protected:
~vtkFloatScalars() {};
vtkFloatScalars(const vtkFloatScalars&) {};
void operator=(const vtkFloatScalars&) {};
private:
// hide the vtkScalars' New() method
static vtkFloatScalars *New(int) { return vtkFloatScalars::New();};
static vtkFloatScalars *New(int dataType, int numComp)
{ return (vtkFloatScalars *)vtkScalars::New(dataType, numComp);};
};
inline float *vtkFloatScalars::GetPointer(const int id)
......
......@@ -79,6 +79,11 @@ protected:
vtkFloatTCoords(const vtkFloatTCoords&) {};
void operator=(const vtkFloatTCoords&) {};
private:
// hide the vtkTCoords' New() method
static vtkFloatTCoords *New(int) { return vtkFloatTCoords::New();};
static vtkFloatTCoords *New(int dataType, int numComp)
{ return (vtkFloatTCoords *) vtkTCoords::New(dataType, numComp);};
};
inline float *vtkFloatTCoords::GetPointer(const int id)
......
......@@ -79,6 +79,9 @@ protected:
vtkFloatTensors(const vtkFloatTensors&) {};
void operator=(const vtkFloatTensors&) {};
private:
// hide the vtkTensors' New() method
static vtkFloatTensors *New(int) { return vtkFloatTensors::New();};
};
......
......@@ -79,6 +79,9 @@ protected:
vtkFloatVectors(const vtkFloatVectors&) {};
void operator=(const vtkFloatVectors&) {};
private:
// hide the vtkVectors' New() method
static vtkFloatVectors *New(int) { return vtkFloatVectors::New();};
};
inline float *vtkFloatVectors::GetPointer(const int id)
......
......@@ -950,7 +950,6 @@ int vtkImageData::ComputeStructuredCoordinates(float x[3], int ijk[3],
void vtkImageData::PrintSelf(ostream& os, vtkIndent indent)
{
int idx;
vtkIndent i2 = indent.GetNextIndent();
vtkDataSet::PrintSelf(os,indent);
......
......@@ -95,6 +95,7 @@ public:
vtkCell *GetCell(int cellId);
void GetCell(int cellId, vtkGenericCell *cell);
void GetCellBounds(int cellId, float bounds[6]);
int FindPoint(float x, float y, float z) { return this->vtkDataSet::FindPoint(x, y, z);};
int FindPoint(float x[3]);
int FindCell(float x[3], vtkCell *cell, int cellId, float tol2, int& subId,
float pcoords[3], float *weights);
......@@ -322,7 +323,7 @@ public:
// Description:
// Legacy. Replaced with GetEstimatedUpdateMemorySize.
long GetUpdateExtentMemorySize()
unsigned long GetUpdateExtentMemorySize()
{
vtkWarningMacro("Change GetUpdateExtentMemorySize to GetEstimatedUpdateMemorySize");
return this->GetEstimatedUpdateMemorySize();
......
......@@ -62,7 +62,7 @@ vtkImageSource* vtkImageSource::New()
//----------------------------------------------------------------------------
vtkImageSource::vtkImageSource()
{
this->vtkSource::SetOutput(0,vtkImageData::New());
this->vtkSource::SetNthOutput(0,vtkImageData::New());
// Releasing data for pipeline parallism.
// Filters will know it is empty.
this->Outputs[0]->ReleaseData();
......@@ -73,7 +73,7 @@ vtkImageSource::vtkImageSource()
// Specify the input data or filter.
void vtkImageSource::SetOutput(vtkImageData *output)
{
this->vtkSource::SetOutput(0, output);
this->vtkSource::SetNthOutput(0, output);
}
//----------------------------------------------------------------------------
......
......@@ -64,6 +64,8 @@ public:
// Get the output of this source.
void SetOutput(vtkImageData *output);
vtkImageData *GetOutput();
vtkImageData *GetOutput(int idx)
{return (vtkImageData *) this->vtkSource::GetOutput(idx); };
// Description:
// Legacy. Sets the UpdateExtent to the WholeExtent, and Updates.
......
......@@ -67,7 +67,7 @@ vtkImageToStructuredPoints* vtkImageToStructuredPoints::New()
vtkImageToStructuredPoints::vtkImageToStructuredPoints()
{
this->Translate[0] = this->Translate[1] = this->Translate[2] = 0;
this->SetOutput(0,vtkStructuredPoints::New());
this->SetNthOutput(0,vtkStructuredPoints::New());
this->Outputs[0]->Delete();
}
......@@ -98,7 +98,7 @@ vtkStructuredPoints *vtkImageToStructuredPoints::GetOutput()
//----------------------------------------------------------------------------
void vtkImageToStructuredPoints::SetInput(vtkImageData *input)
{
this->vtkProcessObject::SetInput(0, input);
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
......@@ -116,7 +116,7 @@ vtkImageData *vtkImageToStructuredPoints::GetInput()
//----------------------------------------------------------------------------
void vtkImageToStructuredPoints::SetVectorInput(vtkImageData *input)
{
this->vtkProcessObject::SetInput(1, input);
this->vtkProcessObject::SetNthInput(1, input);
}
//----------------------------------------------------------------------------
......
......@@ -68,6 +68,7 @@ public:
void SetInput(vtkImageData *input);
vtkImageData *GetInput();
// Description:
// Set/Get the input object from the image pipeline.
void SetVectorInput(vtkImageData *input);
......@@ -76,6 +77,8 @@ public:
// Description:
// Get the output of this source.
vtkStructuredPoints *GetOutput();
vtkStructuredPoints *GetOutput(int idx)
{return (vtkStructuredPoints *) this->vtkSource::GetOutput(idx); };
protected:
vtkImageToStructuredPoints();
......@@ -89,6 +92,8 @@ protected:
void Execute();
void ExecuteInformation();
int ComputeInputUpdateExtents(vtkDataObject *data);
};
......
......@@ -71,6 +71,11 @@ protected:
vtkImplicitFunctionCollection(const vtkImplicitFunctionCollection&) {};
void operator=(const vtkImplicitFunctionCollection&) {};
private:
// hide the standard AddItem from the user and the compiler.
void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
};
inline void vtkImplicitFunctionCollection::AddItem(vtkImplicitFunction *f)
......
......@@ -68,7 +68,7 @@ vtkLookupTable(sze,ext)
this->LogMinRange = 0.0;
this->LogMaxRange = 1.0;
this->UseAbsoluteValue = 0;
};
}
// Set the minimum/maximum scalar values for scalar mapping. Scalar values
// less than minimum range value are clamped to minimum range value.
......@@ -162,7 +162,7 @@ static void vtkLogLookupTableMapDataToRGBA(vtkLogLookupTable *self,
}
}
void vtkLogLookupTable::MapScalarsThroughTable(void *input,
void vtkLogLookupTable::MapScalarsThroughTable2(void *input,
unsigned char *output,
int inputDataType,
int numberOfValues,
......
......@@ -72,6 +72,7 @@ public:
// range value. (The log base 10 of these values is taken and mapping is
// performed in logarithmic space.)
void SetTableRange(float min, float max);
void SetTableRange(float r[2]) { this->SetTableRange(r[0], r[1]);};
// Description:
// Given a scalar value v, return an rgba color value from lookup table.
......@@ -81,7 +82,7 @@ public:
// Description:
// map a set of scalars through the lookup table
void MapScalarsThroughTable(void *input, unsigned char *output,
void MapScalarsThroughTable2(void *input, unsigned char *output,
int inputDataType, int numberOfValues,
int inputIncrement);
protected:
......
......@@ -178,6 +178,7 @@ public:
// Sets/Gets the range of scalars which will eb mapped.
virtual float *GetRange() {return this->GetTableRange();};
virtual void SetRange(float min, float max) {this->SetTableRange(min,max);};
void SetRange(float rng[2]) {this->SetRange(rng[0],rng[1]);};
protected:
vtkLookupTable(int sze=256, int ext=256);
......
......@@ -182,7 +182,7 @@ void vtkMultiThreader::SetMultipleMethod( int index,
// Execute the method set as the SingleMethod on NumberOfThreads threads.
void vtkMultiThreader::SingleMethodExecute()
{
int thread_loop;
int thread_loop = 0;
#ifdef _WIN32
DWORD threadId;
......@@ -541,6 +541,10 @@ int vtkMultiThreader::SpawnThread( vtkThreadFunctionType f, void *UserData )
{
int id;
// avoid a warning
vtkThreadFunctionType tf;
tf = f; tf= tf;
#ifdef _WIN32
DWORD threadId;
#endif
......
......@@ -74,6 +74,11 @@ protected:
vtkObjectFactoryCollection(const vtkObjectFactoryCollection&) {};
void operator=(const vtkObjectFactoryCollection&) {};
private:
// hide the standard AddItem from the user and the compiler.
void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
};
......
......@@ -64,6 +64,8 @@ public:
// Description
// Evaluate plane equation for point x[3].
float EvaluateFunction(float x[3]);
float EvaluateFunction(float x, float y, float z)
{return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
// Description
// Evaluate function gradient at point x[3].
......
......@@ -71,6 +71,11 @@ protected:
vtkPlaneCollection(const vtkPlaneCollection&) {};
void operator=(const vtkPlaneCollection&) {};
private:
// hide the standard AddItem from the user and the compiler.
void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
};
inline void vtkPlaneCollection::AddItem(vtkPlane *f)
......
......@@ -1083,8 +1083,6 @@ void vtkPointLocator::InsertPoint(int ptId, float x[3])
int vtkPointLocator::IsInsertedPoint(float x[3])
{
int i, j, ijk[3];
int idx;
vtkIdList *bucket;
//
// Locate bucket that point is in.
......@@ -1095,8 +1093,8 @@ int vtkPointLocator::IsInsertedPoint(float x[3])
(this->Bounds[2*i+1] - this->Bounds[2*i])) * (this->Divisions[i] - 1));
}
idx = ijk[0] + ijk[1]*this->Divisions[0] +
ijk[2]*this->Divisions[0]*this->Divisions[1];
// idx = ijk[0] + ijk[1]*this->Divisions[0] +
// ijk[2]*this->Divisions[0]*this->Divisions[1];
//
// Check the list of points in that bucket for merging. Also need to
......
......@@ -945,7 +945,7 @@ int vtkPointLocator2D::IsInsertedPoint(float x[2])
// Build polygonal representation of locator. Create faces that separate
// inside/outside buckets, or separate inside/boundary of locator.
void vtkPointLocator2D::GenerateRepresentation(int vtkNotUsed(level),
vtkPolyData *pd)
vtkPolyData *vtkNotUsed(pd))
{
// to be done
}
......@@ -954,6 +954,12 @@ void vtkPointLocator2D::GenerateFace(int face, int i, int j, int k,
vtkPoints *pts, vtkCellArray *polys)
{
// to be done
face = face;
i = i;
j = j;
k = k;
pts = pts;
polys = polys;
}
......
......@@ -75,6 +75,7 @@ public:
float *GetPoint(int ptId) {return this->Points->GetPoint(ptId);};
void GetPoint(int ptId, float x[3]) {this->Points->GetPoint(ptId,x);};
int FindPoint(float x[3]);
int FindPoint(float x, float y, float z) { return this->vtkDataSet::FindPoint(x, y, z);};
int FindCell(float x[3], vtkCell *cell, int cellId, float tol2, int& subId,
float pcoords[3], float *weights);
int FindCell(float x[3], vtkCell *cell, vtkGenericCell *gencell,
......
......@@ -1344,14 +1344,14 @@ int vtkPolyData::ClipUpdateExtentWithWholeExtent()
int valid = 1;
int piece = this->GetUnstructuredUpdateExtent()->GetPiece();
int numPieces = this->GetUnstructuredUpdateExtent()->GetNumberOfPieces();
int maxPieces;
unsigned long maxPieces;
// Check to see if upstream filters can break up the data into the
// requested number of pieces.
maxPieces = this->GetUnstructuredInformation()->GetMaximumNumberOfPieces();
if (numPieces > maxPieces)
{
numPieces = maxPieces;
numPieces = (int) maxPieces;
}
if (numPieces <= 0 || piece < 0 || piece >= numPieces)
......
......@@ -222,11 +222,11 @@ void vtkProcessObject::RemoveInput(vtkDataObject *input)
//----------------------------------------------------------------------------
// Set an Input of this filter.
void vtkProcessObject::SetInput(int idx, vtkDataObject *input)
void vtkProcessObject::SetNthInput(int idx, vtkDataObject *input)
{
if (idx < 0)
{
vtkErrorMacro(<< "SetInput: " << idx << ", cannot set input. ");
vtkErrorMacro(<< "SetNthInput: " << idx << ", cannot set input. ");
return;
}
// Expand array if necessary.
......
......@@ -159,7 +159,7 @@ protected:
void SetNumberOfInputs(int num);
// protected methods for setting inputs.
virtual void SetInput(int num, vtkDataObject *input);
virtual void SetNthInput(int num, vtkDataObject *input);
virtual void AddInput(vtkDataObject *input);
virtual void RemoveInput(vtkDataObject *input);
......
......@@ -131,6 +131,9 @@ protected:
vtkPropCollection *Parts;
float Bounds[6];
private:
// hide the superclass' ShallowCopy() from the user and the compiler.
void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
};
#endif
......
......@@ -77,6 +77,11 @@ protected:
vtkPropCollection(const vtkPropCollection&) {};
void operator=(const vtkPropCollection&) {};
private:
// hide the standard AddItem from the user and the compiler.
void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
};
inline void vtkPropCollection::AddItem(vtkProp *a)
......
......@@ -678,8 +678,7 @@ void vtkPyramid::Clip(float vtkNotUsed(value),
vtkCellArray *vtkNotUsed(tetras),
vtkPointData *vtkNotUsed(inPd),
vtkPointData *vtkNotUsed(outPd),
vtkCellData *vtkNotUsed(inCd), int cellId,
vtkCellData *vtkNotUsed(outCd), int insideOut)
vtkCellData *vtkNotUsed(inCd), int vtkNotUsed(cellId),
vtkCellData *vtkNotUsed(outCd), int vtkNotUsed(insideOut))
{
}
......@@ -103,6 +103,7 @@ public:
vtkCell *GetCell(int cellId);
void GetCell(int cellId, vtkGenericCell *cell);
void GetCellBounds(int cellId, float bounds[6]);
int FindPoint(float x, float y, float z) { return this->vtkDataSet::FindPoint(x, y, z);};
int FindPoint(float x[3]);
int FindCell(float x[3], vtkCell *cell, int cellId, float tol2, int& subId,
float pcoords[3], float *weights);
......
......@@ -256,13 +256,13 @@ void vtkSource::RemoveOutput(vtkDataObject *output)
// Set an Output of this filter.
// tricky because we have to manage the double pointers and keep
// them consistent.
void vtkSource::SetOutput(int idx, vtkDataObject *newOutput)
void vtkSource::SetNthOutput(int idx, vtkDataObject *newOutput)
{
vtkDataObject *oldOutput;
if (idx < 0)
{
vtkErrorMacro(<< "SetOutput: " << idx << ", cannot set output. ");
vtkErrorMacro(<< "SetNthOutput: " << idx << ", cannot set output. ");
return;
}
// Expand array if necessary.
......@@ -489,7 +489,7 @@ int vtkSource::ComputeDivisionExtents(vtkDataObject *output,
//----------------------------------------------------------------------------
int vtkSource::ComputeInputUpdateExtents(vtkDataObject *output)
int vtkSource::ComputeInputUpdateExtents(vtkDataObject *vtkNotUsed(output))
{
if (this->NumberOfInputs > 0)
{
......
......@@ -163,7 +163,7 @@ protected:
vtkDataObject *GetOutput(int idx);
// protected methods for setting inputs.
virtual void SetOutput(int num, vtkDataObject *output);
virtual void SetNthOutput(int num, vtkDataObject *output);
virtual void AddOutput(vtkDataObject *output);
virtual void RemoveOutput(vtkDataObject *output);
......
......@@ -405,5 +405,7 @@ void vtkTimerLog::Sleep(int ms)
{
#ifdef _WIN32
Sleep(ms);
#else
ms = ms; // avoid warning
#endif
}
......@@ -870,7 +870,7 @@ void vtkTransform::Multiply4x4(double a[16], double b[16], double c[16])
SqMatPtr aMat = (SqMatPtr) a;
SqMatPtr bMat = (SqMatPtr) b;
SqMatPtr cMat = (SqMatPtr) c;
int i, j, k;