Commit 2c7d96f9 authored by Francois Bertel's avatar Francois Bertel

COMP:Fixed old-style casts and removed some useless casts.

parent 006ce94c
......@@ -25,7 +25,7 @@
#include "vtkPolyData.h"
#include "vtkTransform.h"
vtkCxxRevisionMacro(vtkEllipticalButtonSource, "1.4");
vtkCxxRevisionMacro(vtkEllipticalButtonSource, "1.5");
vtkStandardNewMacro(vtkEllipticalButtonSource);
//----------------------------------------------------------------------------
......@@ -102,15 +102,16 @@ int vtkEllipticalButtonSource::RequestData(
double xP[3], dX, dY;
if ( this->TextureStyle == VTK_TEXTURE_STYLE_FIT_IMAGE )
{
dX = (double)this->TextureDimensions[0];
dY = (double)this->TextureDimensions[1];
dX = static_cast<double>(this->TextureDimensions[0]);
dY = static_cast<double>(this->TextureDimensions[1]);
}
else
{
dX = this->A;
dY = this->B;
}
int hRes = ((int)ceil(this->CircumferentialResolution * (dY/(dY+dX)))) / 2;
int hRes = static_cast<int>(
ceil(this->CircumferentialResolution * (dY/(dY+dX)))) / 2;
hRes = (hRes <= 0 ? 1 : hRes);
int wRes = (this->CircumferentialResolution - 2*hRes) / 2;
......@@ -164,7 +165,7 @@ int vtkEllipticalButtonSource::RequestData(
double t;
for (i=1; i < wRes; i++) //x0 -> x1
{
t = (double)i/wRes;
t = static_cast<double>(i)/wRes;
x[0] = x0[0] + t * (x1[0]-x0[0]);
x[1] = x0[1];
x[2] = this->ComputeDepth(1,x[0],x[1],n);
......@@ -174,7 +175,7 @@ int vtkEllipticalButtonSource::RequestData(
}
for (i=1; i < hRes; i++) //x1 -> x2
{
t = (double)i/hRes;
t = static_cast<double>(i)/hRes;
x[0] = x1[0];
x[1] = x1[1] + t * (x2[1]-x1[1]);
x[2] = this->ComputeDepth(1,x[0],x[1],n);
......@@ -184,7 +185,7 @@ int vtkEllipticalButtonSource::RequestData(
}
for (i=1; i < wRes; i++) //x2 -> x3
{
t = (double)i/wRes;
t = static_cast<double>(i)/wRes;
x[0] = x2[0] + t * (x3[0]-x2[0]);
x[1] = x2[1];
x[2] = this->ComputeDepth(1,x[0],x[1],n);
......@@ -194,7 +195,7 @@ int vtkEllipticalButtonSource::RequestData(
}
for (i=1; i < hRes; i++) //x3 -> x0
{
t = (double)i/hRes;
t = static_cast<double>(i)/hRes;
x[0] = x3[0];
x[1] = x3[1] + t * (x0[1]-x3[1]);
x[2] = this->ComputeDepth(1,x[0],x[1],n);
......@@ -338,7 +339,7 @@ void vtkEllipticalButtonSource::InterpolateCurve(int inTextureRegion,
for ( j=1; j < res; j++ )
{
idx = startPt+(j-1)*numPts;
t = (double)j / res;
t = static_cast<double>(j) / res;
x[0] = x0[0] + t * (x1[0] - x0[0]);
x[1] = x0[1] + t * (x1[1] - x0[1]);
x[2] = this->ComputeDepth(inTextureRegion,x[0],x[1],n);
......
......@@ -67,7 +67,7 @@ public:
vtkstd::vector<vtkDataArray*> OutArrays;
};
vtkCxxRevisionMacro(vtkExtractArraysOverTime, "1.15");
vtkCxxRevisionMacro(vtkExtractArraysOverTime, "1.16");
vtkStandardNewMacro(vtkExtractArraysOverTime);
//----------------------------------------------------------------------------
......@@ -911,7 +911,7 @@ void vtkExtractArraysOverTime::ExecuteIdAtTimeStep(
}
this->UpdateProgress(
(double)this->CurrentTimeIndex/this->NumberOfTimeSteps);
static_cast<double>(this->CurrentTimeIndex)/this->NumberOfTimeSteps);
}
//----------------------------------------------------------------------------
......@@ -1069,7 +1069,7 @@ void vtkExtractArraysOverTime::ExecuteLocationAtTimeStep(
idList->Delete();
this->UpdateProgress(
(double)this->CurrentTimeIndex/this->NumberOfTimeSteps);
static_cast<double>(this->CurrentTimeIndex)/this->NumberOfTimeSteps);
}
//----------------------------------------------------------------------------
......
......@@ -34,7 +34,7 @@
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkExtractCells, "1.6");
vtkCxxRevisionMacro(vtkExtractCells, "1.7");
vtkStandardNewMacro(vtkExtractCells);
#include <vtkstd/set>
......@@ -177,7 +177,7 @@ int vtkExtractCells::RequestData(
if (extractMetadata)
{
vtkModelMetadata::RemoveMetadata((vtkDataSet *)output);
vtkModelMetadata::RemoveMetadata(output);
extractMetadata->Pack(output);
extractMetadata->Delete();
}
......@@ -227,7 +227,7 @@ int vtkExtractCells::RequestData(
if (extractMetadata)
{
vtkModelMetadata::RemoveMetadata((vtkDataSet *)output);
vtkModelMetadata::RemoveMetadata(output);
extractMetadata->Pack(output);
extractMetadata->Delete();
}
......@@ -599,7 +599,7 @@ void vtkExtractCells::CopyCellsUnstructuredGrid(vtkIdList *ptMap,
int oldCellId = *cellPtr;
int loc = locs[oldCellId];
int size = (int)cells[loc];
int size = static_cast<int>(cells[loc]);
vtkIdType *pts = cells + loc + 1;
unsigned char type = types->GetValue(oldCellId);
......
......@@ -26,7 +26,7 @@
#include "vtkPointData.h"
#include "vtkPolyData.h"
vtkCxxRevisionMacro(vtkExtractEdges, "1.53");
vtkCxxRevisionMacro(vtkExtractEdges, "1.54");
vtkStandardNewMacro(vtkExtractEdges);
// Construct object.
......@@ -120,7 +120,7 @@ int vtkExtractEdges::RequestData(
{
if ( ! (cellNum % tenth) ) //manage progress reports / early abort
{
this->UpdateProgress ((double)cellNum / numCells);
this->UpdateProgress (static_cast<double>(cellNum) / numCells);
abort = this->GetAbortExecute();
}
......
......@@ -25,7 +25,7 @@
#include "vtkPointData.h"
#include "vtkUnstructuredGrid.h"
vtkCxxRevisionMacro(vtkExtractGeometry, "1.57");
vtkCxxRevisionMacro(vtkExtractGeometry, "1.58");
vtkStandardNewMacro(vtkExtractGeometry);
vtkCxxSetObjectMacro(vtkExtractGeometry,ImplicitFunction,vtkImplicitFunction);
......@@ -283,7 +283,7 @@ void vtkExtractGeometry::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
os << indent << "Implicit Function: "
<< (void *)this->ImplicitFunction << "\n";
<< static_cast<void *>(this->ImplicitFunction) << "\n";
os << indent << "Extract Inside: "
<< (this->ExtractInside ? "On\n" : "Off\n");
os << indent << "Extract Boundary Cells: "
......
......@@ -22,7 +22,7 @@
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkStructuredGrid.h"
vtkCxxRevisionMacro(vtkExtractGrid, "1.46");
vtkCxxRevisionMacro(vtkExtractGrid, "1.47");
vtkStandardNewMacro(vtkExtractGrid);
// Construct object to extract all of the input data.
......@@ -198,7 +198,7 @@ int vtkExtractGrid::RequestInformation(
outDims[i] = 1;
}
// We might as well make this work for negative extents.
mins[i] = (int)(floor((float)voi[2*i] / (float)rate[i]));
mins[i] = static_cast<int>(floor(voi[2*i]/static_cast<double>(rate[i])));
}
// Adjust the output dimensions if the boundaries are to be
......@@ -299,9 +299,9 @@ int vtkExtractGrid::RequestData(
// We need to duplicate the computation done in
// ExecuteInformtation for the output whole extent.
// Use shift as temporary variable (output mins).
shift[0] = (int)(floor( (float)(voi[0])/(float)(rate[0]) ));
shift[1] = (int)(floor( (float)(voi[2])/(float)(rate[1]) ));
shift[2] = (int)(floor( (float)(voi[4])/(float)(rate[2]) ));
shift[0] = static_cast<int>(floor(voi[0]/static_cast<double>(rate[0])));
shift[1] = static_cast<int>(floor(voi[2]/static_cast<double>(rate[1])));
shift[2] = static_cast<int>(floor(voi[4]/static_cast<double>(rate[2])));
// Take the different between the output and input mins (in input coordinates).
shift[0] = voi[0] - (shift[0]*rate[0]);
shift[1] = voi[2] - (shift[1]*rate[1]);
......
......@@ -24,7 +24,7 @@
#include "vtkPointData.h"
#include "vtkPolyData.h"
vtkCxxRevisionMacro(vtkExtractPolyDataGeometry, "1.24");
vtkCxxRevisionMacro(vtkExtractPolyDataGeometry, "1.25");
vtkStandardNewMacro(vtkExtractPolyDataGeometry);
vtkCxxSetObjectMacro(vtkExtractPolyDataGeometry,
ImplicitFunction,vtkImplicitFunction);
......@@ -278,7 +278,7 @@ void vtkExtractPolyDataGeometry::PrintSelf(ostream& os, vtkIndent indent)
if (this->ImplicitFunction)
{
os << indent << "Implicit Function: "
<< (void *)this->ImplicitFunction << "\n";
<< static_cast<void *>(this->ImplicitFunction) << "\n";
}
else
{
......
......@@ -23,7 +23,7 @@
#include "vtkRectilinearGrid.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkExtractRectilinearGrid, "1.11");
vtkCxxRevisionMacro(vtkExtractRectilinearGrid, "1.12");
vtkStandardNewMacro(vtkExtractRectilinearGrid);
// Construct object to extract all of the input data.
......@@ -195,7 +195,7 @@ int vtkExtractRectilinearGrid::RequestInformation(
outDims[i] = 1;
}
// We might as well make this work for negative extents.
mins[i] = (int)(floor((float)voi[2*i] / (float)rate[i]));
mins[i] = static_cast<int>(floor(voi[2*i]/static_cast<double>(rate[i])));
}
// Adjust the output dimensions if the boundaries are to be
......
......@@ -35,7 +35,7 @@
#include "vtkLine.h"
#include "vtkSelection.h"
vtkCxxRevisionMacro(vtkExtractSelectedFrustum, "1.10");
vtkCxxRevisionMacro(vtkExtractSelectedFrustum, "1.11");
vtkStandardNewMacro(vtkExtractSelectedFrustum);
vtkCxxSetObjectMacro(vtkExtractSelectedFrustum,Frustum,vtkPlanes);
......@@ -508,7 +508,7 @@ int vtkExtractSelectedFrustum::RequestData(
{
if ( ! (cellId % updateInterval) ) //manage progress reports
{
this->UpdateProgress ((float)cellId / numCells);
this->UpdateProgress (static_cast<double>(cellId) / numCells);
}
input->GetCellBounds(cellId, bounds);
......@@ -620,7 +620,7 @@ int vtkExtractSelectedFrustum::RequestData(
if ( ! (ptId % updateInterval) ) //manage progress reports
{
this->UpdateProgress ((float)ptId / numPts);
this->UpdateProgress (static_cast<double>(ptId) / numPts);
}
input->GetPoint(ptId,x);
......@@ -1069,7 +1069,7 @@ int vtkExtractSelectedFrustum::FrustumClipPolygon(int nverts,
double *ovlist)
{
int nwverts = nverts;
memcpy((void*)wvlist, (void*)ivlist, nverts*sizeof(double)*3);
memcpy(wvlist,ivlist, nverts*sizeof(double)*3);
int noverts = 0;
int pid;
......@@ -1081,7 +1081,7 @@ int vtkExtractSelectedFrustum::FrustumClipPolygon(int nverts,
{
return 0;
}
memcpy((void*)wvlist, (void*)ovlist, noverts*sizeof(double)*3);
memcpy(wvlist,ovlist, noverts*sizeof(double)*3);
nwverts = noverts;
}
......@@ -1162,7 +1162,7 @@ void vtkExtractSelectedFrustum::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
os << indent << "Frustum: "
<< (void *)this->Frustum << "\n";
<< static_cast<void *>(this->Frustum) << "\n";
os << indent << "ClipPoints: " << this->ClipPoints << "\n";
......
......@@ -30,7 +30,7 @@
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkExtractSelection, "1.18");
vtkCxxRevisionMacro(vtkExtractSelection, "1.19");
vtkStandardNewMacro(vtkExtractSelection);
//----------------------------------------------------------------------------
......@@ -231,8 +231,8 @@ int vtkExtractSelection::RequestData(
//make sure everything is deallocated
inputCopy->Delete();
ecOutput->Initialize();
subFilter->SetInput(0, (vtkDataSet*)NULL);
subFilter->SetInput(1, (vtkSelection*)NULL);
subFilter->SetInput(0,static_cast<vtkDataSet *>(NULL));
subFilter->SetInput(1,static_cast<vtkSelection *>(NULL));
return 1;
}
......
......@@ -24,7 +24,7 @@
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
vtkCxxRevisionMacro(vtkExtractVectorComponents, "1.51");
vtkCxxRevisionMacro(vtkExtractVectorComponents, "1.52");
vtkStandardNewMacro(vtkExtractVectorComponents);
vtkExtractVectorComponents::vtkExtractVectorComponents()
......@@ -224,10 +224,10 @@ int vtkExtractVectorComponents::RequestData(
{
vtkTemplateMacro(
vtkExtractComponents(numVectors,
(VTK_TT *)vectors->GetVoidPointer(0),
(VTK_TT *)vx->GetVoidPointer(0),
(VTK_TT *)vy->GetVoidPointer(0),
(VTK_TT *)vz->GetVoidPointer(0)));
static_cast<VTK_TT *>(vectors->GetVoidPointer(0)),
static_cast<VTK_TT *>(vx->GetVoidPointer(0)),
static_cast<VTK_TT *>(vy->GetVoidPointer(0)),
static_cast<VTK_TT *>(vz->GetVoidPointer(0))));
}
outVx->PassData(pd);
......@@ -272,11 +272,12 @@ int vtkExtractVectorComponents::RequestData(
switch (vectorsc->GetDataType())
{
vtkTemplateMacro(
vtkExtractComponents( numVectorsc,
(VTK_TT *)vectorsc->GetVoidPointer(0),
(VTK_TT *)vxc->GetVoidPointer(0),
(VTK_TT *)vyc->GetVoidPointer(0),
(VTK_TT *)vzc->GetVoidPointer(0)));
vtkExtractComponents(numVectorsc,
static_cast<VTK_TT *>(
vectorsc->GetVoidPointer(0)),
static_cast<VTK_TT *>(vxc->GetVoidPointer(0)),
static_cast<VTK_TT *>(vyc->GetVoidPointer(0)),
static_cast<VTK_TT *>(vzc->GetVoidPointer(0))));
}
outVxc->PassData(cd);
......
......@@ -29,7 +29,7 @@
#include "vtkCellData.h"
#include "vtkPointData.h"
vtkCxxRevisionMacro(vtkFeatureEdges, "1.73");
vtkCxxRevisionMacro(vtkFeatureEdges, "1.74");
vtkStandardNewMacro(vtkFeatureEdges);
// Construct object with feature angle = 30; all types of edges, except
......@@ -91,7 +91,8 @@ int vtkFeatureEdges::RequestData(
vtkPointData *pd=input->GetPointData(), *outPD=output->GetPointData();
vtkCellData *cd=input->GetCellData(), *outCD=output->GetCellData();
unsigned char* ghostLevels=0;
unsigned char updateLevel = (unsigned char)(output->GetUpdateGhostLevel());
unsigned char updateLevel = static_cast<unsigned char>(
output->GetUpdateGhostLevel());
vtkDebugMacro(<<"Executing feature edges");
......@@ -107,7 +108,7 @@ int vtkFeatureEdges::RequestData(
}
else
{
ghostLevels = ((vtkUnsignedCharArray*)temp)->GetPointer(0);
ghostLevels = static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
}
// Check input
......@@ -199,7 +200,7 @@ int vtkFeatureEdges::RequestData(
polyNormals->InsertTuple(cellId,n);
}
cosAngle = cos ((double) vtkMath::DegreesToRadians() * this->FeatureAngle);
cosAngle = cos (vtkMath::DegreesToRadians() * this->FeatureAngle);
}
neighbors = vtkIdList::New();
......@@ -214,7 +215,7 @@ int vtkFeatureEdges::RequestData(
{
if ( ! (cellId % progressInterval) ) //manage progress / early abort
{
this->UpdateProgress ((double)cellId / numCells);
this->UpdateProgress (static_cast<double>(cellId) / numCells);
abort = this->GetAbortExecute();
}
......
......@@ -27,7 +27,7 @@
#include "vtkSphere.h"
#include "vtkMath.h"
vtkCxxRevisionMacro(vtkFillHolesFilter, "1.2");
vtkCxxRevisionMacro(vtkFillHolesFilter, "1.3");
vtkStandardNewMacro(vtkFillHolesFilter);
//------------------------------------------------------------------------
......@@ -121,7 +121,7 @@ int vtkFillHolesFilter::RequestData(
{
if ( ! (cellId % progressInterval) ) //manage progress / early abort
{
this->UpdateProgress ((double)cellId / numCells);
this->UpdateProgress (static_cast<double>(cellId) / numCells);
abort = this->GetAbortExecute();
}
......
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