Commit 26e27df8 authored by Ken Martin's avatar Ken Martin

fix sort of lots of places where vtkIdType is assumed 64

add casts in lots of places to mun
parent 10b93e30
......@@ -132,7 +132,7 @@ static void MinusSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelecti
{
output.push_back(ptrOldSelection[iOld++]);
}
selection->SetNumberOfTuples(output.size());
selection->SetNumberOfTuples(static_cast<vtkIdType>(output.size()));
ptrSelection = static_cast<vtkIdType *>(selection->GetVoidPointer(0));
for (std::vector<vtkIdType>::iterator it = output.begin();
it != output.end(); ++it, ++ptrSelection)
......@@ -211,7 +211,7 @@ static void ToggleSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelect
{
output.push_back(ptrOldSelection[iOld++]);
}
selection->SetNumberOfTuples(output.size());
selection->SetNumberOfTuples(static_cast<vtkIdType>(output.size()));
ptrSelection = static_cast<vtkIdType *>(selection->GetVoidPointer(0));
for (std::vector<vtkIdType>::iterator it = output.begin();
it != output.end(); ++it, ++ptrSelection)
......
......@@ -1173,7 +1173,7 @@ vtkIdType vtkChartXY::AddPlot(vtkPlot* plot)
}
plot->Register(this);
this->ChartPrivate->plots.push_back(plot);
vtkIdType plotIndex = this->ChartPrivate->plots.size() - 1;
vtkIdType plotIndex = static_cast<vtkIdType>(this->ChartPrivate->plots.size() - 1);
this->SetPlotCorner(plot, 0);
// Ensure that the bounds are recalculated
this->PlotTransformValid = false;
......@@ -1354,7 +1354,7 @@ vtkTooltipItem* vtkChartXY::GetTooltip()
//-----------------------------------------------------------------------------
vtkIdType vtkChartXY::GetNumberOfPlots()
{
return this->ChartPrivate->plots.size();
return static_cast<vtkIdType>(this->ChartPrivate->plots.size());
}
//-----------------------------------------------------------------------------
......
......@@ -600,7 +600,7 @@ bool vtkVASPTessellationReader::ReadTimeStep(std::istream &in,
for (size_t faceId = 0; faceId < faceData.size(); ++faceId)
{
const std::vector<vtkIdType> &face = faceData[faceId];
faceStream.push_back(face.size());
faceStream.push_back(static_cast<vtkIdType>(face.size()));
for (std::vector<vtkIdType>::const_iterator it = face.begin(),
itEnd = face.end(); it != itEnd; ++it)
{
......@@ -618,7 +618,7 @@ bool vtkVASPTessellationReader::ReadTimeStep(std::istream &in,
voronoi->InsertNextCell(VTK_POLYHEDRON,
static_cast<vtkIdType>(pointIds.size()),
pointIds.empty() ? NULL : &pointIds[0],
faceData.size(),
static_cast<vtkIdType>(faceData.size()),
faceStream.empty() ? NULL : &faceStream[0]);
tessAtomicNumbers->InsertNextValue(atom.GetAtomicNumber());
tessAtomIds->InsertNextValue(atom.GetId());
......
......@@ -29,7 +29,7 @@
int main()
{
int i;
static float x[47]={
static double x[47]={
-1.22396, -1.17188, -1.11979, -1.06771, -1.01562, -0.963542,
-0.911458, -0.859375, -0.807292, -0.755208, -0.703125, -0.651042,
-0.598958, -0.546875, -0.494792, -0.442708, -0.390625, -0.338542,
......@@ -38,13 +38,13 @@ int main()
0.338542, 0.390625, 0.442708, 0.494792, 0.546875, 0.598958,
0.651042, 0.703125, 0.755208, 0.807292, 0.859375, 0.911458,
0.963542, 1.01562, 1.06771, 1.11979, 1.17188};
static float y[33]={-1.25, -1.17188, -1.09375, -1.01562, -0.9375, -0.859375,
static double y[33]={-1.25, -1.17188, -1.09375, -1.01562, -0.9375, -0.859375,
-0.78125, -0.703125, -0.625, -0.546875, -0.46875, -0.390625,
-0.3125, -0.234375, -0.15625, -0.078125, 0, 0.078125,
0.15625, 0.234375, 0.3125, 0.390625, 0.46875, 0.546875,
0.625, 0.703125, 0.78125, 0.859375, 0.9375, 1.01562,
1.09375, 1.17188, 1.25};
static float z[44]={0, 0.1, 0.2, 0.3, 0.4, 0.5,
static double z[44]={0, 0.1, 0.2, 0.3, 0.4, 0.5,
0.6, 0.7, 0.75, 0.8, 0.9, 1,
1.1, 1.2, 1.3, 1.4, 1.5, 1.6,
1.7, 1.75, 1.8, 1.9, 2, 2.1,
......@@ -56,13 +56,21 @@ int main()
// Create a rectilinear grid by defining three arrays specifying the
// coordinates in the x-y-z directions.
vtkFloatArray *xCoords = vtkFloatArray::New();
for (i=0; i<47; i++) xCoords->InsertNextValue(x[i]);
for (i=0; i<47; i++)
{
xCoords->InsertNextValue(x[i]);
}
vtkFloatArray *yCoords = vtkFloatArray::New();
for (i=0; i<33; i++) yCoords->InsertNextValue(y[i]);
for (i=0; i<33; i++)
{
yCoords->InsertNextValue(y[i]);
}
vtkFloatArray *zCoords = vtkFloatArray::New();
for (i=0; i<44; i++) zCoords->InsertNextValue(z[i]);
for (i=0; i<44; i++)
{
zCoords->InsertNextValue(z[i]);
}
// The coordinates are assigned to the rectilinear grid. Make sure that
// the number of values in each of the XCoordinates, YCoordinates,
......
......@@ -269,7 +269,7 @@ int vtkConvertSelection::ConvertToBlockSelection(
vtkSmartPointer<vtkUnsignedIntArray> selectionList =
vtkSmartPointer<vtkUnsignedIntArray>::New();
selectionList->SetNumberOfTuples(indices.size());
selectionList->SetNumberOfTuples(static_cast<vtkIdType>(indices.size()));
std::set<unsigned int>::iterator siter;
vtkIdType index = 0;
for (siter = indices.begin(); siter != indices.end(); ++siter, ++index)
......
......@@ -130,7 +130,7 @@ int vtkExtractCells::RequestData(
((vtkUnstructuredGrid::SafeDownCast(input)) != NULL);
vtkIdType numCellsInput = input->GetNumberOfCells();
vtkIdType numCells = this->CellList->IdTypeSet.size();
vtkIdType numCells = static_cast<vtkIdType>(this->CellList->IdTypeSet.size());
if (numCells == numCellsInput)
{
......@@ -420,7 +420,7 @@ vtkIdList *vtkExtractCells::reMapPointIds(vtkDataSet *grid)
void vtkExtractCells::CopyCellsDataSet(vtkIdList *ptMap, vtkDataSet *input,
vtkUnstructuredGrid *output)
{
output->Allocate(this->CellList->IdTypeSet.size());
output->Allocate(static_cast<vtkIdType>(this->CellList->IdTypeSet.size()));
vtkCellData *oldCD = input->GetCellData();
vtkCellData *newCD = output->GetCellData();
......
......@@ -683,7 +683,7 @@ void vtkParticleTracerBase::AssignUniqueIds(
vtkParticleTracerBaseNamespace::ParticleVector &localSeedPoints)
{
vtkIdType particleCountOffset = 0;
vtkIdType numParticles = localSeedPoints.size();
vtkIdType numParticles = static_cast<vtkIdType>(localSeedPoints.size());
for (vtkIdType i=0; i<numParticles; i++)
{
localSeedPoints[i].UniqueParticleId =
......
......@@ -204,7 +204,7 @@ int vtkProjectedTerrainPath::RequestData(vtkInformation *,
for (j=0; j<(npts-1); j++)
{
this->EdgeList->push_back(vtkEdge(pts[j],pts[j+1]));
this->ComputeError(this->EdgeList->size()-1); //puts edges in queues
this->ComputeError(static_cast<vtkIdType>(this->EdgeList->size()-1)); //puts edges in queues
this->NumLines++;
}
}
......@@ -220,7 +220,7 @@ int vtkProjectedTerrainPath::RequestData(vtkInformation *,
//Okay now dump out the edges from the edge list into the output polydata
vtkCellArray *outLines = vtkCellArray::New();
outLines->Allocate(outLines->EstimateSize(this->EdgeList->size(),2));
outLines->Allocate(outLines->EstimateSize(static_cast<vtkIdType>(this->EdgeList->size()),2));
for (EdgeListIterator iter=this->EdgeList->begin();
iter != this->EdgeList->end();
++iter)
......@@ -342,7 +342,7 @@ void vtkProjectedTerrainPath::SplitEdge(vtkIdType eId, double t)
vtkIdType v2 = e.V2;
e.V2 = pId;
this->EdgeList->push_back(vtkEdge(pId,v2));
vtkIdType eNew = this->EdgeList->size() - 1;
vtkIdType eNew = static_cast<vtkIdType>(this->EdgeList->size() - 1);
// Recompute the errors along the edges
this->ComputeError(eId);
......
......@@ -145,7 +145,7 @@ namespace {
// Check to see that last point is the same as the first. Such a loop is
// closed and can be directly output. Otherwise, check on the strategy
// for closing the loop and close as appropriate.
vtkIdType num = sortedPoints.size();
vtkIdType num = static_cast<vtkIdType>(sortedPoints.size());
if ( sortedPoints[0].Id == sortedPoints[num-1].Id )
{
--num;
......
......@@ -64,7 +64,7 @@ void vtkDijkstraGraphGeodesicPath::GetCumulativeWeights(vtkDoubleArray *weights)
double *weightsArray = new double[this->Internals->CumulativeWeights.size()];
std::copy(this->Internals->CumulativeWeights.begin(),
this->Internals->CumulativeWeights.end(), weightsArray);
weights->SetArray(weightsArray, this->Internals->CumulativeWeights.size(), 0);
weights->SetArray(weightsArray, static_cast<vtkIdType>(this->Internals->CumulativeWeights.size()), 0);
}
//----------------------------------------------------------------------------
......
......@@ -198,7 +198,7 @@ int vtkPOutlineFilterInternals::RequestData(
double* temp = new double[6*this->BoundsList.size()];
this->Controller->Reduce(&boundsList[0],
temp,
6*this->BoundsList.size(),
static_cast<vtkIdType>(6*this->BoundsList.size()),
&operation,
0);
memcpy(&boundsList[0], temp, 6*this->BoundsList.size()*sizeof(double));
......
......@@ -423,7 +423,7 @@ void vtkPUnstructuredGridGhostCellsGenerator::ExtractAndReduceSurfacePoints()
// Now reduce surface point global ids on ALL ranks
::AllGatherV(this->Controller, &globalIdsOfSurfacePoints[0],
globalIdsOfSurfacePoints.size(),
static_cast<vtkIdType>(globalIdsOfSurfacePoints.size()),
this->Internals->AllGlobalIdsOfSurfacePoints,
this->Internals->AllSizes, this->Internals->AllOffsets);
}
......@@ -563,7 +563,7 @@ void vtkPUnstructuredGridGhostCellsGenerator::ExtractAndSendGhostCells(
{
int toRank = iter->first;
std::set<vtkIdType>& cellsToShare = iter->second;
cellIdsList->SetNumberOfIds(cellsToShare.size());
cellIdsList->SetNumberOfIds(static_cast<vtkIdType>(cellsToShare.size()));
std::set<vtkIdType>::iterator sIter = cellsToShare.begin();
for (vtkIdType i = 0; sIter != cellsToShare.end(); ++sIter, i++)
{
......
......@@ -147,7 +147,7 @@ void MergePoints(std::vector<vtkMergePointsData>& data,
mergePoints.Begin = second;
mergePoints.End = end;
// Actual work
vtkSMPTools::For(0, nonEmptyBuckets.size(), mergePoints);
vtkSMPTools::For(0, static_cast<vtkIdType>(nonEmptyBuckets.size()), mergePoints);
//mergePoints.operator()(0, nonEmptyBuckets.size());
// Fixup output sizes.
......
......@@ -690,7 +690,7 @@ int vtkHyperTreeGridSource::InitializeFromStringDescriptor()
for ( unsigned int i = 1; i < nLevels; ++ i )
{
this->LevelBitsIndex.push_back(
LevelBitsIndex[i-1] + this->LevelDescriptors[i-1].length());
static_cast<vtkIdType>(LevelBitsIndex[i-1] + this->LevelDescriptors[i-1].length()));
}
this->LevelBitsIndexCnt = this->LevelBitsIndex;
......@@ -784,7 +784,7 @@ int vtkHyperTreeGridSource::InitializeFromBitsDescriptor()
// Calculate total level 0 grid size
vtkIdType nTotal = this->LevelZeroMaterialIndex ?
this->LevelZeroMaterialMap.size() :
static_cast<vtkIdType>(this->LevelZeroMaterialMap.size()) :
this->GridSize[0] * this->GridSize[1] * this->GridSize[2];
// Parse descriptor and material mask if used
......@@ -1139,7 +1139,7 @@ vtkBitArray* vtkHyperTreeGridSource::ConvertDescriptorStringToBitArray(
const std::string& str )
{
vtkBitArray* desc = vtkBitArray::New();
desc->Allocate( str.length() );
desc->Allocate( static_cast<vtkIdType>(str.length()) );
for ( std::string::const_iterator dit = str.begin();
dit != str.end(); ++ dit )
{
......
......@@ -316,7 +316,7 @@ int vtkFLUENTReader::RequestData(
else if (this->Cells->value[i].type == 7 )
{
this->ConvexPointSet->GetPointIds()->
SetNumberOfIds(this->Cells->value[i].nodes.size());
SetNumberOfIds(static_cast<vtkIdType>(this->Cells->value[i].nodes.size()));
for (int j = 0; j < (int)this->Cells->value[i].nodes.size(); j++)
{
this->ConvexPointSet->GetPointIds()->
......
......@@ -896,7 +896,7 @@ vtkIdType vtkLSDynaPart::GetMaxGlobalPointId() const
//-----------------------------------------------------------------------------
void vtkLSDynaPart::BuildCells()
{
this->NumberOfCells = this->Cells->size();
this->NumberOfCells = static_cast<vtkIdType>(this->Cells->size());
//make the unstrucuted grid data structures point to the
//Cells vectors underlying memory
......
......@@ -505,7 +505,7 @@ void vtkLSDynaPartCollection::InitCollection(LSDynaMetaData *metaData,
//reserve enough space for the grids. Each node
//will have a part allocated, since we don't know yet
//how the cells map to parts.
this->Storage = new LSDynaPartStorage(metaData->PartIds.size());
this->Storage = new LSDynaPartStorage(static_cast<vtkIdType>(metaData->PartIds.size()));
this->MinIds = new vtkIdType[LSDynaMetaData::NUM_CELL_TYPES];
this->MaxIds = new vtkIdType[LSDynaMetaData::NUM_CELL_TYPES];
......
......@@ -141,12 +141,12 @@ int vtkNetCDFCFReader::vtkDimensionInfo::LoadMetaData(int ncFD)
this->Coordinates = vtkSmartPointer<vtkDoubleArray>::New();
this->Coordinates->SetName((this->Name + "_Coordinates").c_str());
this->Coordinates->SetNumberOfComponents(1);
this->Coordinates->SetNumberOfTuples(dimLen);
this->Coordinates->SetNumberOfTuples(static_cast<vtkIdType>(dimLen));
this->Bounds = vtkSmartPointer<vtkDoubleArray>::New();
this->Bounds->SetName((this->Name + "_Bounds").c_str());
this->Bounds->SetNumberOfComponents(1);
this->Bounds->SetNumberOfTuples(dimLen+1);
this->Bounds->SetNumberOfTuples(static_cast<vtkIdType>(dimLen+1));
this->SpecialVariables = vtkSmartPointer<vtkStringArray>::New();
......@@ -170,13 +170,13 @@ int vtkNetCDFCFReader::vtkDimensionInfo::LoadMetaData(int ncFD)
// Check to see if the spacing is regular.
this->Origin = this->Coordinates->GetValue(0);
this->Spacing
= (this->Coordinates->GetValue(dimLen-1) - this->Origin)/(dimLen-1);
= (this->Coordinates->GetValue(static_cast<vtkIdType>(dimLen-1)) - this->Origin)/(dimLen-1);
this->HasRegularSpacing = true; // Then check to see if it is false.
double tolerance = 0.01*this->Spacing;
for (size_t i = 1; i < dimLen; i++)
{
double expectedValue = this->Origin + i*this->Spacing;
double actualValue = this->Coordinates->GetValue(i);
double actualValue = this->Coordinates->GetValue(static_cast<vtkIdType>(i));
if ( (actualValue < expectedValue-tolerance)
|| (actualValue > expectedValue+tolerance) )
{
......@@ -337,7 +337,7 @@ int vtkNetCDFCFReader::vtkDimensionInfo::LoadMetaData(int ncFD)
start[0] = dimLen-1; start[1] = 1;
count[0] = 1; count[1] = 1;
CALL_NETCDF_GW(nc_get_vars_double(ncFD, boundsVarId, start, count, NULL,
this->Bounds->GetPointer(dimLen)));
this->Bounds->GetPointer(static_cast<vtkIdType>(dimLen))));
}
else
{
......@@ -351,7 +351,7 @@ int vtkNetCDFCFReader::vtkDimensionInfo::LoadMetaData(int ncFD)
this->Bounds->SetValue(i, 0.5*(v0+v1));
}
this->Bounds->SetValue(dimLen,
this->Coordinates->GetValue(dimLen-1)+0.5*this->Spacing);
this->Coordinates->GetValue(static_cast<vtkIdType>(dimLen-1))+0.5*this->Spacing);
}
}
else
......@@ -359,10 +359,13 @@ int vtkNetCDFCFReader::vtkDimensionInfo::LoadMetaData(int ncFD)
// Fake coordinates
for (size_t i = 0; i < dimLen; i++)
{
this->Coordinates->SetValue(i, static_cast<double>(i));
this->Bounds->SetValue(i, static_cast<double>(i) - 0.5);
this->Coordinates->SetValue(static_cast<vtkIdType>(i),
static_cast<double>(i));
this->Bounds->SetValue(static_cast<vtkIdType>(i),
static_cast<double>(i) - 0.5);
}
this->Bounds->SetValue(dimLen, static_cast<double>(dimLen) - 0.5);
this->Bounds->SetValue(static_cast<vtkIdType>(dimLen),
static_cast<double>(dimLen) - 0.5);
this->HasRegularSpacing = true;
this->Origin = 0.0;
this->Spacing = 1.0;
......
......@@ -278,15 +278,15 @@ int vtkNetCDFPOPReader::RequestData(vtkInformation* request,
start+2, count+2, rStride+2, z);
#endif
vtkFloatArray *xCoords = vtkFloatArray::New();
xCoords->SetArray(z, count[2], 0, 1);
xCoords->SetArray(z, static_cast<vtkIdType>(count[2]), 0, 1);
vtkFloatArray *yCoords = vtkFloatArray::New();
yCoords->SetArray(y, count[1], 0, 1);
yCoords->SetArray(y, static_cast<vtkIdType>(count[1]), 0, 1);
for (unsigned int q=0; q<count[0]; q++)
{
x[q] = -x[q];
}
vtkFloatArray *zCoords = vtkFloatArray::New();
zCoords->SetArray(x, count[0], 0, 1);
zCoords->SetArray(x, static_cast<vtkIdType>(count[0]), 0, 1);
rgrid->SetXCoordinates(xCoords);
rgrid->SetYCoordinates(yCoords);
rgrid->SetZCoordinates(zCoords);
......@@ -296,7 +296,7 @@ int vtkNetCDFPOPReader::RequestData(vtkInformation* request,
}
//create vtkFloatArray and get the scalars into it
vtkFloatArray *scalars = vtkFloatArray::New();
vtkIdType numberOfTuples = (count[0])*(count[1])*(count[2]);
vtkIdType numberOfTuples = static_cast<vtkIdType>((count[0])*(count[1])*(count[2]));
float* data = new float[numberOfTuples];
#if 0
nc_get_vara_float(this->NCDFFD, varidp, start, count, data);
......
......@@ -708,10 +708,11 @@ vtkSmartPointer<vtkDoubleArray> vtkNetCDFReader::GetTimeValues(int ncFD,
size_t dimLength;
CALL_NETCDF(nc_inq_dimlen(ncFD, dimId, &dimLength));
timeValues->SetNumberOfComponents(1);
timeValues->SetNumberOfTuples(dimLength);
timeValues->SetNumberOfTuples(static_cast<vtkIdType>(dimLength));
for (size_t j = 0; j < dimLength; j++)
{
timeValues->SetValue(j, static_cast<double>(j));
timeValues->SetValue(static_cast<vtkIdType>(j),
static_cast<double>(j));
}
return timeValues;
}
......@@ -762,7 +763,7 @@ int vtkNetCDFReader::LoadVariable(int ncFD, const char *varName, double time,
start[0] < static_cast<size_t>(timeValues->GetNumberOfTuples());
start[0]++)
{
if (timeValues->GetValue(start[0]) >= time) break;
if (timeValues->GetValue(static_cast<vtkIdType>(start[0])) >= time) break;
}
count[0] = 1;
numDims--;
......@@ -816,7 +817,7 @@ int vtkNetCDFReader::LoadVariable(int ncFD, const char *varName, double time,
// If loading cell data, subtract one from the data being loaded.
if (!loadingPointData) count[i+timeIndexOffset]--;
arraySize *= count[i+timeIndexOffset];
arraySize *= static_cast<vtkIdType>(count[i+timeIndexOffset]);
}
// Allocate an array of the right type.
......
......@@ -239,7 +239,7 @@ namespace vtkPSLACReaderTypes
midpointListsType &recvMidpoints,
int process)
{
vtkIdType sendLength = sendMidpoints.position.size();
vtkIdType sendLength = static_cast<vtkIdType>(sendMidpoints.position.size());
if (sendLength != static_cast<vtkIdType>(sendMidpoints.topology.size()))
{
vtkGenericWarningMacro(<< "Bad midpoint array structure.");
......@@ -635,7 +635,7 @@ int vtkPSLACReader::ReadConnectivity(int meshFD,
// local to global id map for now. We will fill the global to local id
// later when we iterate over the local ids.
this->Internal->LocalToGlobalIds->Allocate(
this->Internal->GlobalToLocalIds.size());
static_cast<vtkIdType>(this->Internal->GlobalToLocalIds.size()));
vtkInternal::GlobalToLocalIdType::iterator itr;
for (itr = this->Internal->GlobalToLocalIds.begin();
itr != this->Internal->GlobalToLocalIds.end(); itr++)
......@@ -900,9 +900,9 @@ vtkSmartPointer<vtkDataArray> vtkPSLACReader::ReadPointDataArray(int ncFD,
for (int i = 0; i < this->NumberOfPieces; i++)
{
sendLengths->SetValue(i,
this->Internal->PointsToSendToProcessesLengths->GetValue(i)*numComponents);
static_cast<int>(this->Internal->PointsToSendToProcessesLengths->GetValue(i)*numComponents));
sendOffsets->SetValue(i,
this->Internal->PointsToSendToProcessesOffsets->GetValue(i)*numComponents);
static_cast<int>(this->Internal->PointsToSendToProcessesOffsets->GetValue(i)*numComponents));
}
// Let each process have a turn sending data to the other processes.
......@@ -911,8 +911,10 @@ vtkSmartPointer<vtkDataArray> vtkPSLACReader::ReadPointDataArray(int ncFD,
{
// Scatter data from source. Note that lengths and offsets are only valid
// on the source process. All others are ignored.
vtkIdType destLength = numComponents*this->Internal->PointsExpectedFromProcessesLengths->GetValue(proc);
vtkIdType destOffset = numComponents*this->Internal->PointsExpectedFromProcessesOffsets->GetValue(proc);
vtkIdType destLength = static_cast<vtkIdType>(
numComponents*this->Internal->PointsExpectedFromProcessesLengths->GetValue(proc));
vtkIdType destOffset = static_cast<vtkIdType>(
numComponents*this->Internal->PointsExpectedFromProcessesOffsets->GetValue(proc));
this->Controller->GetCommunicator()->ScatterVVoidArray(
sendBuffer->GetVoidPointer(0),
finalDataArray->GetVoidPointer(destOffset),
......
......@@ -383,8 +383,9 @@ int vtkPNetCDFPOPReader::RequestData(vtkInformation* request,
rStride+2, &buffer[wholeCount[0] + wholeCount[1]]);
}
this->Controller->Broadcast( &buffer[0], (wholeCount[0] + wholeCount[1] + wholeCount[2]),
this->Internals->ReaderRanks[0]);
this->Controller->Broadcast( &buffer[0],
static_cast<vtkIdType>(wholeCount[0] + wholeCount[1] + wholeCount[2]),
this->Internals->ReaderRanks[0]);
// Extract the values we need out of buffer and store them in the x, y & z buffers
float* x = new float[count[0]];
......@@ -396,15 +397,15 @@ int vtkPNetCDFPOPReader::RequestData(vtkInformation* request,
// Note the axis swap: xcoords gets the z data and zcoords gets the x data
vtkFloatArray *xCoords = vtkFloatArray::New();
xCoords->SetArray(z, count[2], 0, 1);
xCoords->SetArray(z, static_cast<vtkIdType>(count[2]), 0, 1);
vtkFloatArray *yCoords = vtkFloatArray::New();
yCoords->SetArray(y, count[1], 0, 1);
yCoords->SetArray(y, static_cast<vtkIdType>(count[1]), 0, 1);
for (unsigned int q=0; q<count[0]; q++)
{
x[q] = -x[q];
}
vtkFloatArray *zCoords = vtkFloatArray::New();
zCoords->SetArray(x, count[0], 0, 1);
zCoords->SetArray(x, static_cast<vtkIdType>(count[0]), 0, 1);
rgrid->SetXCoordinates(xCoords);
rgrid->SetYCoordinates(yCoords);
rgrid->SetZCoordinates(zCoords);
......@@ -414,7 +415,7 @@ int vtkPNetCDFPOPReader::RequestData(vtkInformation* request,
}
//create vtkFloatArray and get the scalars into it
vtkFloatArray *scalars = vtkFloatArray::New();
vtkIdType numberOfTuples = (count[0])*(count[1])*(count[2]);
vtkIdType numberOfTuples = static_cast<vtkIdType>(count[0]*count[1]*count[2]);
float* data = new float[numberOfTuples];
......
......@@ -102,7 +102,7 @@ void vtkXMLPStructuredDataWriter::PrepareSummaryFile()
int nRanks = this->Controller->GetNumberOfProcesses();
int nPiecesTotal = 0;
vtkIdType nPieces = this->Extents.size();
vtkIdType nPieces = static_cast<vtkIdType>(this->Extents.size());
vtkIdType* offsets = 0;
vtkIdType* nPiecesAll = 0;
......
......@@ -55,7 +55,7 @@ static void BuildGraph(vtkGraph* input_graph, const std::vector<vtkIdType>& vert
continue;
output_graph->AddVertex();
output_vertex_data->CopyData(input_vertex_data, i, vertex_map[i]);
output_vertex_data->CopyData(input_vertex_data, static_cast<vtkIdType>(i), vertex_map[i]);
}
vtkDataSetAttributes* const input_edge_data = input_graph->GetEdgeData();
......
......@@ -246,7 +246,7 @@ private:
{
;
}
cellArray->InsertNextCell( clit->size(), ids );
cellArray->InsertNextCell( static_cast<vtkIdType>(clit->size()), ids );
delete [] ids;
}
}
......
......@@ -205,7 +205,7 @@ void vtkPolygonalSurfaceContourLineInterpolator
for (int i = 0; i < nNodes; i++)
{
// 1 for the node and then the number of points.
nPoints += (rep->GetNthNode(i)->Points.size() + 1);
nPoints += static_cast<vtkIdType>(rep->GetNthNode(i)->Points.size() + 1);
}
ids->SetNumberOfIds(nPoints);
......
......@@ -120,7 +120,7 @@ int TestPolygonSelection( int argc, char* argv[] )
{
vtkNew<vtkIntArray> polygonPointsArray;
polygonPointsArray->SetNumberOfComponents(2);
polygonPointsArray->SetNumberOfTuples(points.size());
polygonPointsArray->SetNumberOfTuples(static_cast<vtkIdType>(points.size()));
for (unsigned int j = 0; j < points.size(); ++j)
{
const vtkVector2i &v = points[j];
......
......@@ -128,7 +128,7 @@ public:
vtkIdTypeArray* ids = vtkIdTypeArray::New();
ids->SetName("SelectedIds");
ids->SetNumberOfComponents(1);
ids->SetNumberOfTuples(iter->second.size());
ids->SetNumberOfTuples(static_cast<vtkIdType>(iter->second.size()));
vtkIdType* ptr = ids->GetPointer(0);
std::set<vtkIdType>::const_iterator idIter;
vtkIdType cc=0;
......
......@@ -825,7 +825,7 @@ bool vtkLabeledContourMapper::CreateLabels(vtkActor *)
vtkIdType numLabels = 0;
while (outerLabels != outerLabelsEnd)
{
numLabels += (outerLabels++)->size();
numLabels += static_cast<vtkIdType>((outerLabels++)->size());
}
if (!this->AllocateTextActors(numLabels))
......
......@@ -147,7 +147,7 @@ public:
++ this->TotalAnchors;
}
void Increment() { ++ this->TotalAnchors; }
vtkIdType GetLocalAnchorCount() const { return this->size(); }
vtkIdType GetLocalAnchorCount() const { return static_cast<vtkIdType>(this->size()); }
vtkIdType GetTotalAnchorCount() const { return this->TotalAnchors; }
vtkIdType TotalAnchors; // Count of all anchors stored in this node and its children.
......
......@@ -1921,7 +1921,7 @@ public:
}
// Return width*height
vtkIdType GetSize() { return this->Vector.size(); }
vtkIdType GetSize() { return static_cast<vtkIdType>(this->Vector.size()); }
// Return the size of the list at pixel `i'.
vtkIdType GetListSize(int i)
......@@ -1977,7 +1977,7 @@ public:
{
assert("pre: mm_exists" && mm!=0);
vtkIdType i=0;
vtkIdType c=this->Vector.size();
vtkIdType c = static_cast<vtkIdType>(this->Vector.size());
while(i<c)
{
vtkPixelList *l=&(Vector[i]);
......@@ -2119,7 +2119,7 @@ public:
:Vector(size)
{
vtkIdType i=0;
vtkIdType c=this->Vector.size();
vtkIdType c = static_cast<vtkIdType>(this->Vector.size());
while(i<c)
{
this->Vector[i]=0;
......@@ -2133,7 +2133,7 @@ public:
~vtkUseSet()
{
vtkIdType i=0;
vtkIdType c=this->Vector.size();
vtkIdType c = static_cast<vtkIdType>(this->Vector.size());
while(i<c)
{
if(this->Vector[i]!=0)
......@@ -2169,7 +2169,7 @@ public:
void Clear()
{
vtkIdType i=0;
vtkIdType c=this->Vector.size();
vtkIdType c = static_cast<vtkIdType>(this->Vector.size());
while(i<c)
{
if(this->Vector[i]!=0)
......
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