Commit 76a3ce4a authored by Ben Boeckel's avatar Ben Boeckel

warnings: use static casts to point out precision loss

Lots of places where we pass floating point values as integers; make the
loss of precision more explicit.

Change-Id: Icafde395f0463421b5f36d1e4e855fa25cab5ab4
parent 830ef1b8
......@@ -47,7 +47,7 @@ int TestSurfacePlot(int , char * [])
vtkNew<vtkFloatArray> arr;
table->AddColumn(arr.GetPointer());
}
table->SetNumberOfRows(numPoints);
table->SetNumberOfRows(static_cast<vtkIdType>(numPoints));
for (vtkIdType i = 0; i < numPoints; ++i)
{
float x = i * inc;
......
......@@ -1500,14 +1500,14 @@ void vtkAxis::GenerateLogSpacedLinearTicks(int order, double min, double max)
// Figure out which digit to vary and by how much.
double linMin = pow(10., min);
double linMax = pow(10., max);
int varyDigit = floor(log10(linMax - linMin));
int varyDigit = static_cast<int>(floor(log10(linMax - linMin)));
if (varyDigit == order)
{
--varyDigit;
}
double multiplier = pow(10.,varyDigit);
int lo = floor(linMin / multiplier);
int hi = ceil(linMax / multiplier);
int lo = static_cast<int>(floor(linMin / multiplier));
int hi = static_cast<int>(ceil(linMax / multiplier));
if (hi - lo < 2)
{
++hi;
......
......@@ -171,7 +171,7 @@ vtkRectf vtkCategoryLegend::GetBoundingRect(vtkContext2D *painter)
// programmatically set Padding here. This results in better
// appearance when we zoom in or out on the legend.
this->Padding = height / 4.0;
this->Padding = static_cast<int>(height / 4.0);
if (this->Padding < 1)
{
this->Padding = 1;
......
......@@ -844,17 +844,17 @@ void vtkChartXYZ::DetermineWhichAxesToLabel()
switch (axis)
{
case 0:
this->XAxisToLabel[0] = j;
this->XAxisToLabel[1] = k;
this->XAxisToLabel[0] = static_cast<int>(j);
this->XAxisToLabel[1] = static_cast<int>(k);
break;
case 1:
this->YAxisToLabel[0] = i;
this->YAxisToLabel[1] = k;
this->YAxisToLabel[0] = static_cast<int>(i);
this->YAxisToLabel[1] = static_cast<int>(k);
break;
case 2:
default:
this->ZAxisToLabel[0] = i;
this->ZAxisToLabel[1] = j;
this->ZAxisToLabel[0] = static_cast<int>(i);
this->ZAxisToLabel[1] = static_cast<int>(j);
break;
}
}
......
......@@ -63,8 +63,8 @@ void CopyToPoints(vtkPoints2D *points, vtkPoints2D *previousPoints, A *a, B *b,
{
prev = prevData[2 * i + 1];
}
A tmpA((a[i] + ss[0]) * ss[2]);
B tmpB((b[i] + ss[1]) * ss[3]);
A tmpA(static_cast<A>((a[i] + ss[0]) * ss[2]));
B tmpB(static_cast<B>((b[i] + ss[1]) * ss[3]));
data[2 * i] = static_cast<float>((logScale & 1) ?
log10(static_cast<double>(tmpA))
: tmpA);
......@@ -93,7 +93,7 @@ void CopyToPoints(vtkPoints2D *points, vtkPoints2D *previousPoints, A *a, int n,
{
prev = prevData[2 * i + 1];
}
A tmpA((a[i] + ss[1]) * ss[3]);
A tmpA(static_cast<A>((a[i] + ss[1]) * ss[3]));
data[2 * i] = static_cast<float>((logScale & 1) ?
log10(static_cast<double>(i + 1.0))
: i);
......
......@@ -735,7 +735,7 @@ void vtkAbstractArray::UpdateDiscreteValueSet(
}
else
{
numberOfSampleTuples = VTK_SAMPLE_FACTOR * logfac;
numberOfSampleTuples = static_cast<vtkIdType>(VTK_SAMPLE_FACTOR * logfac);
}
/*
// Theoretically, we should discard values or tuples that recur fewer
......
......@@ -106,7 +106,7 @@ void vtkDataArrayInterpolateTuple(Iterator from1, Iterator from2, Scalar* to,
const double oneMinusT = 1.0 - t;
while (numComp-- > 0)
{
*(to++) = oneMinusT * (*(from1++)) + t * (*(from2++));
*(to++) = static_cast<Scalar>(oneMinusT * (*(from1++)) + t * (*(from2++)));
}
}
......
......@@ -363,8 +363,8 @@ void vtkProteinRibbonFilter::CreateThinStrip(vtkPolyData* poly,
p->InsertNextPoint((*points1)[i].GetData());
p->InsertNextPoint((*points2)[i].GetData());
vtkColor3ub color = colors[floor(0.5f + i /
static_cast<float>(this->SubdivideFactor))];
vtkColor3ub color = colors[static_cast<int>(floor(0.5f + i /
static_cast<float>(this->SubdivideFactor)))];
for (int k = 0; k < 2; ++k)
{
for (int ci = 0; ci < 3; ++ci)
......
......@@ -112,7 +112,7 @@ void vtkCopySelectedRows(
}
for (vtkIdType j = 0; j < numTuples; ++j)
{
vtkIdType val = rawPtr[j];
vtkIdType val = static_cast<vtkIdType>(rawPtr[j]);
output->InsertNextRow(input->GetRow(val));
if (addOriginalRowIdsArray)
{
......
......@@ -88,7 +88,7 @@ int TestGL2PSLabeledDataMapper(int, char *[] )
vtkNew<vtkSelectVisiblePoints> visPts;
visPts->SetInputConnection(ids->GetOutputPort());
visPts->SelectionWindowOn();
visPts->SetSelection(xmin, xmax, ymin, ymax);
visPts->SetSelection(static_cast<int>(xmin), static_cast<int>(xmax), static_cast<int>(ymin), static_cast<int>(ymax));
vtkNew<vtkLabeledDataMapper> ldm;
ldm->SetInputConnection(visPts->GetOutputPort());
......@@ -104,7 +104,7 @@ int TestGL2PSLabeledDataMapper(int, char *[] )
vtkNew<vtkSelectVisiblePoints> visCells;
visCells->SetInputConnection(cc->GetOutputPort());
visCells->SelectionWindowOn();
visCells->SetSelection(xmin, xmax, ymin, ymax);
visCells->SetSelection(static_cast<int>(xmin), static_cast<int>(xmax), static_cast<int>(ymin), static_cast<int>(ymax));
vtkNew<vtkLabeledDataMapper> cellMapper;
cellMapper->SetInputConnection(visCells->GetOutputPort());
......
......@@ -1303,21 +1303,21 @@ int vtkTIFFReader::EvaluateImageAt(T* out, T* in)
}
return this->InternalImage->SamplesPerPixel;
case vtkTIFFReader::PALETTE_RGB:
this->GetColor(*in, &red, &green, &blue);
this->GetColor(static_cast<int>(*in), &red, &green, &blue);
*(out ) = red << 8;
*(out + 1) = green << 8;
*(out + 2) = blue << 8;
if (this->GetDataScalarType() == VTK_SHORT ||
this->GetDataScalarType() == VTK_UNSIGNED_SHORT)
{
this->GetColor(*in, &red, &green, &blue);
this->GetColor(static_cast<int>(*in), &red, &green, &blue);
*(out ) = red << 8;
*(out + 1) = green << 8;
*(out + 2) = blue << 8;
}
else
{
this->GetColor(*in, &red, &green, &blue);
this->GetColor(static_cast<int>(*in), &red, &green, &blue);
*(out ) = red >> 8;
*(out + 1) = green >> 8;
*(out + 2) = blue >> 8;
......
......@@ -661,7 +661,7 @@ void vtkPhyloXMLTreeReader::ReadColorElement(vtkXMLDataElement *element,
}
std::string childVal =
this->GetTrimmedString(childElement->GetCharacterData());
unsigned char val = strtod(childVal.c_str(), NULL);
unsigned char val = static_cast<unsigned char>(strtod(childVal.c_str(), NULL));
if (strcmp(childElement->GetName(), "red") == 0)
{
red = val;
......
......@@ -37,10 +37,10 @@ vtkInteractorStyleRubberBand2D::vtkInteractorStyleRubberBand2D()
this->PixelArray = vtkUnsignedCharArray::New();
this->Interaction = NONE;
this->RenderOnMouseMove = false;
this->StartPosition[0] = 0.0;
this->StartPosition[1] = 0.0;
this->EndPosition[0] = 0.0;
this->EndPosition[1] = 0.0;
this->StartPosition[0] = 0;
this->StartPosition[1] = 0;
this->EndPosition[0] = 0;
this->EndPosition[1] = 0;
}
//--------------------------------------------------------------------------
......
......@@ -37,10 +37,10 @@ vtkInteractorStyleRubberBand3D::vtkInteractorStyleRubberBand3D()
this->PixelArray = vtkUnsignedCharArray::New();
this->Interaction = NONE;
this->RenderOnMouseMove = false;
this->StartPosition[0] = 0.0;
this->StartPosition[1] = 0.0;
this->EndPosition[0] = 0.0;
this->EndPosition[1] = 0.0;
this->StartPosition[0] = 0;
this->StartPosition[1] = 0;
this->EndPosition[0] = 0;
this->EndPosition[1] = 0;
}
//--------------------------------------------------------------------------
......
......@@ -75,7 +75,7 @@ vtkAxisActor::vtkAxisActor()
this->TitleTextProperty = vtkTextProperty::New();
this->TitleTextProperty->SetColor(0.,0.,0.);
this->TitleTextProperty->SetFontFamilyToArial();
this->TitleTextProperty->SetFontSize(18.);
this->TitleTextProperty->SetFontSize(18);
this->TitleTextProperty->SetVerticalJustificationToCentered();
this->TitleTextProperty->SetJustificationToCentered();
......@@ -105,7 +105,7 @@ vtkAxisActor::vtkAxisActor()
this->LabelTextProperty = vtkTextProperty::New();
this->LabelTextProperty->SetColor(0.,0.,0.);
this->LabelTextProperty->SetFontFamilyToArial();
this->LabelTextProperty->SetFontSize(14.);
this->LabelTextProperty->SetFontSize(14);
this->LabelTextProperty->SetVerticalJustificationToBottom();
this->LabelTextProperty->SetJustificationToLeft();
......
......@@ -88,14 +88,14 @@ vtkCubeAxesActor::vtkCubeAxesActor() : vtkActor()
this->TitleTextProperty[i] = vtkTextProperty::New();
this->TitleTextProperty[i]->SetColor(1.,1.,1.);
this->TitleTextProperty[i]->SetFontFamilyToArial();
this->TitleTextProperty[i]->SetFontSize(18.);
this->TitleTextProperty[i]->SetFontSize(18);
this->TitleTextProperty[i]->SetVerticalJustificationToCentered();
this->TitleTextProperty[i]->SetJustificationToCentered();
this->LabelTextProperty[i] = vtkTextProperty::New();
this->LabelTextProperty[i]->SetColor(1.,1.,1.);
this->LabelTextProperty[i]->SetFontFamilyToArial();
this->LabelTextProperty[i]->SetFontSize(14.);
this->LabelTextProperty[i]->SetFontSize(14);
this->LabelTextProperty[i]->SetVerticalJustificationToBottom();
this->LabelTextProperty[i]->SetJustificationToLeft();
}
......@@ -2310,7 +2310,7 @@ void vtkCubeAxesActor::BuildLabels(vtkAxisActor *axes[NUMBER_OF_ALIGNED_AXIS])
double delta = customizedLabels->GetNumberOfValues() / labelCount;
for (int i = 0; i < labelCount; ++i)
{
labels->SetValue(i, customizedLabels->GetValue(i * delta));
labels->SetValue(i, customizedLabels->GetValue(static_cast<vtkIdType>(i * delta)));
}
}
}
......
......@@ -835,9 +835,9 @@ void vtkScalarBarActor::ComputeScalarBarThickness()
{
nudge = this->TextPad;
}
this->P->ScalarBarBox.Size[0] -= nudge;
this->P->ScalarBarBox.Posn[this->P->TL[0]] += nudge *
(this->TextPosition == PrecedeScalarBar ? -1 : +1);
this->P->ScalarBarBox.Size[0] = static_cast<int>(this->P->ScalarBarBox.Size[0] - nudge);
this->P->ScalarBarBox.Posn[this->P->TL[0]] = static_cast<int>(this->P->ScalarBarBox.Posn[this->P->TL[0]] +
(nudge * (this->TextPosition == PrecedeScalarBar ? -1 : +1)));
}
//----------------------------------------------------------------------------
......@@ -865,17 +865,17 @@ void vtkScalarBarActor::LayoutNanSwatch()
{
this->P->NanBox.Posn[0] = this->P->ScalarBarBox.Posn[0];
this->P->NanBox.Posn[1] = this->P->Frame.Posn[1] + this->TextPad;
this->P->ScalarBarBox.Posn[1] +=
this->P->NanSwatchSize + this->P->SwatchPad;
this->P->ScalarBarBox.Posn[1] = static_cast<int>(this->P->ScalarBarBox.Posn[1] +
(this->P->NanSwatchSize + this->P->SwatchPad));
}
else // HORIZONTAL
{
this->P->NanBox.Posn = this->P->ScalarBarBox.Posn;
this->P->NanBox.Posn[this->P->TL[1]] +=
this->P->Frame.Size[1] - this->P->NanSwatchSize;
this->P->NanBox.Posn[this->P->TL[1]] = static_cast<int>(this->P->NanBox.Posn[this->P->TL[1]] +
(this->P->Frame.Size[1] - this->P->NanSwatchSize));
}
this->P->NanBox.Size[0] = this->P->ScalarBarBox.Size[0];
this->P->NanBox.Size[1] = this->P->NanSwatchSize;
this->P->NanBox.Size[1] = static_cast<int>(this->P->NanSwatchSize);
if (this->P->NanBox.Size[1] > 2 * this->TextPad)
{
this->P->NanBox.Size[1] -= this->TextPad;
......@@ -961,7 +961,7 @@ void vtkScalarBarActor::LayoutTitle()
this->P->Frame.Posn[0] +
(this->P->Frame.Size[this->P->TL[0]] - titleSize[0]) / 2;
this->P->TitleBox.Posn[1] =
this->P->Frame.Posn[1] + this->P->Frame.Size[this->P->TL[1]];
static_cast<int>(this->P->Frame.Posn[1] + this->P->Frame.Size[this->P->TL[1]]);
if (
this->Orientation == VTK_ORIENT_VERTICAL ||
this->TextPosition == vtkScalarBarActor::SucceedScalarBar)
......@@ -984,7 +984,8 @@ void vtkScalarBarActor::ComputeScalarBarLength()
this->P->Frame.Size[1];
// The scalar bar does not include the Nan Swatch.
this->P->ScalarBarBox.Size[1] -= this->P->NanSwatchSize + this->P->SwatchPad;
this->P->ScalarBarBox.Size[1] = static_cast<int>(this->P->ScalarBarBox.Size[1] -
(this->P->NanSwatchSize + this->P->SwatchPad));
}
//-----------------------------------------------------------------------------
......@@ -1083,8 +1084,8 @@ void vtkScalarBarActor::LayoutTicks()
// Tick box height also reduced by NaN swatch size, if present:
if (this->DrawNanAnnotation)
{
this->P->TickBox.Size[1] -=
this->P->NanBox.Size[1] + this->P->SwatchPad;
this->P->TickBox.Size[1] = static_cast<int>(this->P->TickBox.Size[1] -
(this->P->NanBox.Size[1] + this->P->SwatchPad));
}
if (this->TextPosition == vtkScalarBarActor::PrecedeScalarBar)
......@@ -1137,10 +1138,11 @@ void vtkScalarBarActor::LayoutTicks()
labelSize);
// Now adjust scalar bar size by the half-size of the first and last ticks
this->P->ScalarBarBox.Posn[this->P->TL[1]]
+= labelSize[this->P->TL[1]] / 2.;
this->P->ScalarBarBox.Posn[this->P->TL[1]] = static_cast<int>(this->P->ScalarBarBox.Posn[this->P->TL[1]] +
(labelSize[this->P->TL[1]] / 2.));
this->P->ScalarBarBox.Size[1] -= labelSize[this->P->TL[1]];
this->P->TickBox.Posn[this->P->TL[1]] += labelSize[this->P->TL[1]] / 2.;
this->P->TickBox.Posn[this->P->TL[1]] = static_cast<int>(this->P->TickBox.Posn[this->P->TL[1]] +
(labelSize[this->P->TL[1]] / 2.));
this->P->TickBox.Size[1] -= labelSize[this->P->TL[1]];
if (this->Orientation == VTK_ORIENT_HORIZONTAL)
......@@ -1294,12 +1296,12 @@ void vtkScalarBarActor::ConfigureScalarBar()
rgba[3] = lut->GetOpacity(rgbval);
//write into array directly
rgb = this->P->SwatchColors->GetPointer(nComponents * i);
rgb[0] = rgba[0] * 255.;
rgb[1] = rgba[1] * 255.;
rgb[2] = rgba[2] * 255.;
rgb[0] = static_cast<unsigned char>(rgba[0] * 255.);
rgb[1] = static_cast<unsigned char>(rgba[1] * 255.);
rgb[2] = static_cast<unsigned char>(rgba[2] * 255.);
if (this->P->SwatchColors->GetNumberOfComponents() > 3)
{
rgb[3] = this->UseOpacity ? rgba[3] * 255. : 255;
rgb[3] = static_cast<unsigned char>(this->UseOpacity ? rgba[3] * 255. : 255.);
}
}
......@@ -1428,10 +1430,10 @@ void vtkScalarBarActor::ConfigureNanSwatch()
polys->InsertNextCell(4, ptIds);
this->LookupTable->GetIndexedColor(-1,rgba);
rgb = colors->GetPointer(0); //write into array directly
rgb[0] = rgba[0] * 255.;
rgb[1] = rgba[1] * 255.;
rgb[2] = rgba[2] * 255.;
rgb[3] = this->UseOpacity ? rgba[3] * 255. : 255;
rgb[0] = static_cast<unsigned char>(rgba[0] * 255.);
rgb[1] = static_cast<unsigned char>(rgba[1] * 255.);
rgb[2] = static_cast<unsigned char>(rgba[2] * 255.);
rgb[3] = static_cast<unsigned char>(this->UseOpacity ? rgba[3] * 255. : 255.);
}
//----------------------------------------------------------------------------
......@@ -1578,13 +1580,13 @@ void vtkScalarBarActor::ConfigureAnnotations()
/* numComponents */ 4 *
/* numCells/swatch */ 2 *
/* swatch */ i ); //write into array directly
rgb[0] = rgbaF[0] * 255.;
rgb[1] = rgbaF[1] * 255.;
rgb[2] = rgbaF[2] * 255.;
rgb[3] = rgbaF[3] * 255.;
rgb[4] = rgbaF[0] * 255.;
rgb[5] = rgbaF[1] * 255.;
rgb[6] = rgbaF[2] * 255.;
rgb[0] = static_cast<unsigned char>(rgbaF[0] * 255.);
rgb[1] = static_cast<unsigned char>(rgbaF[1] * 255.);
rgb[2] = static_cast<unsigned char>(rgbaF[2] * 255.);
rgb[3] = static_cast<unsigned char>(rgbaF[3] * 255.);
rgb[4] = static_cast<unsigned char>(rgbaF[0] * 255.);
rgb[5] = static_cast<unsigned char>(rgbaF[1] * 255.);
rgb[6] = static_cast<unsigned char>(rgbaF[2] * 255.);
rgb[7] = 255; // second triangle is always opaque
}
}
......
......@@ -420,7 +420,7 @@ void vtkOpenGLContextDevice2D::DrawMarkers(int shape, bool highlight,
unsigned char *colors, int nc_comps)
{
// Get a point sprite for the shape
vtkImageData *sprite = this->GetMarker(shape, this->Pen->GetWidth(),
vtkImageData *sprite = this->GetMarker(shape, static_cast<int>(this->Pen->GetWidth()),
highlight);
this->DrawPointSprites(sprite, points, n, colors, nc_comps);
}
......
......@@ -1477,10 +1477,10 @@ void vtkColorTransferFunctionIndexedMapData(
else
self->GetNodeValue( idx % numNodes, nodeVal );
output[0] = 255. * nodeVal[1];
output[1] = 255. * nodeVal[2];
output[2] = 255. * nodeVal[3];
output[3] = 255.; // * nodeVal[3];
output[0] = static_cast<unsigned char>(255. * nodeVal[1]);
output[1] = static_cast<unsigned char>(255. * nodeVal[2]);
output[2] = static_cast<unsigned char>(255. * nodeVal[3]);
output[3] = static_cast<unsigned char>(255.); // * nodeVal[3];
input += inIncr;
output += 4;
}
......@@ -1496,9 +1496,9 @@ void vtkColorTransferFunctionIndexedMapData(
else
self->GetNodeValue( idx % numNodes, nodeVal );
output[0] = 255. * nodeVal[1];
output[1] = 255. * nodeVal[2];
output[2] = 255. * nodeVal[3];
output[0] = static_cast<unsigned char>(255. * nodeVal[1]);
output[1] = static_cast<unsigned char>(255. * nodeVal[2]);
output[2] = static_cast<unsigned char>(255. * nodeVal[3]);
input += inIncr;
output += 3;
}
......@@ -1515,7 +1515,7 @@ void vtkColorTransferFunctionIndexedMapData(
self->GetNodeValue( idx % numNodes, nodeVal );
output[0] = static_cast<unsigned char>(255. * nodeVal[1]*0.30 + 255. * nodeVal[2]*0.59 +
255. * nodeVal[3]*0.11 + 0.5);
output[1] = 255. * nodeVal[3];
output[1] = static_cast<unsigned char>(255. * nodeVal[3]);
input += inIncr;
output += 2;
}
......@@ -1549,9 +1549,9 @@ void vtkColorTransferFunctionIndexedMapData(
self->GetNanColor( &nodeVal[1] );
else
self->GetNodeValue( idx % numNodes, nodeVal );
output[0] = 255. * nodeVal[1];
output[1] = 255. * nodeVal[2];
output[2] = 255. * nodeVal[3];
output[0] = static_cast<unsigned char>(255. * nodeVal[1]);
output[1] = static_cast<unsigned char>(255. * nodeVal[2]);
output[2] = static_cast<unsigned char>(255. * nodeVal[3]);
output[3] = static_cast<unsigned char>(255. * /*nodeVal[3]*/alpha + 0.5);
input += inIncr;
output += 4;
......@@ -1567,9 +1567,9 @@ void vtkColorTransferFunctionIndexedMapData(
self->GetNanColor( &nodeVal[1] );
else
self->GetNodeValue( idx % numNodes, nodeVal );
output[0] = 255. * nodeVal[1];
output[1] = 255. * nodeVal[2];
output[2] = 255. * nodeVal[3];
output[0] = static_cast<unsigned char>(255. * nodeVal[1]);
output[1] = static_cast<unsigned char>(255. * nodeVal[2]);
output[2] = static_cast<unsigned char>(255. * nodeVal[3]);
input += inIncr;
output += 3;
}
......
......@@ -258,7 +258,7 @@ vtkAbstractPicker* vtkPickingManager::vtkInternal::SelectPicker()
double Y = this->External->Interactor->GetEventPosition()[1];
// Get the poked renderer
vtkRenderer* renderer = this->External->Interactor->FindPokedRenderer(X, Y);
vtkRenderer* renderer = this->External->Interactor->FindPokedRenderer(static_cast<int>(X), static_cast<int>(Y));
vtkAbstractPicker* selectedPicker =
this->ComputePickerSelection(X, Y, 0., renderer);
......
......@@ -300,11 +300,11 @@ int vtkTextActor::SetMultipleConstrainedFontSize(
actors[i]->GetSize(viewport, tempi);
if (tempi[0] > maxResultingSize[0])
{
maxResultingSize[0] = tempi[0];
maxResultingSize[0] = static_cast<int>(tempi[0]);
}
if (tempi[1] > maxResultingSize[1])
{
maxResultingSize[1] = tempi[1];
maxResultingSize[1] = static_cast<int>(tempi[1]);
}
}
}
......
......@@ -356,7 +356,7 @@ int ImageDataLIC2D(int argc, char* argv[])
size_t n = 3*licDataSize;
for (size_t i=0; i<n; ++i)
{
pPng[i] = pData[i]*255.0f;
pPng[i] = static_cast<unsigned char>(pData[i]*255.0f);
}
licData = NULL;
......
......@@ -587,7 +587,7 @@ int vtkImageDataLIC2D::RequestData(
// add ghosts
double rk4fac = 3.0;
int nGhosts = this->Steps*this->StepSize*rk4fac;
int nGhosts = static_cast<int>(this->Steps*this->StepSize*rk4fac);
nGhosts = nGhosts < 1 ? 1 : nGhosts;
nGhosts *= 2; // for second ee lic pass
......
......@@ -315,9 +315,9 @@ int vtkSurfaceLICComposite::AddGuardPixels(
for (size_t b=0; b<nExts; ++b)
{
int ng
= vectorMax[b]*arc
= static_cast<int>(vectorMax[b]*arc
+ this->NumberOfEEGuardPixels
+ this->NumberOfAAGuardPixels;
+ this->NumberOfAAGuardPixels);
ng = ng<2 ? 2 : ng;
//cerr << " " << ng;
tmpExts[b].Grow(ng);
......
......@@ -183,7 +183,7 @@ void vtkGraphItem::RebuildBuffers()
this->Internal->VertexColors = std::vector<vtkColor4ub>(numVertices);
this->Internal->VertexSizes = std::vector<float>(numVertices);
this->Internal->VertexMarkers = std::vector<int>(numVertices);
vtkMarkerUtilities::GenerateMarker(this->Sprite.GetPointer(), this->VertexMarker(0), this->VertexSize(0));
vtkMarkerUtilities::GenerateMarker(this->Sprite.GetPointer(), this->VertexMarker(0), static_cast<int>(this->VertexSize(0)));
for (vtkIdType vertexIdx = 0; vertexIdx < numVertices; ++vertexIdx)
{
this->Internal->VertexPositions[vertexIdx] = this->VertexPosition(vertexIdx);
......
......@@ -839,13 +839,13 @@ std::string vtkHeatmapItem::GetTooltipText(float x, float y)
if (orientation == vtkHeatmapItem::UP_TO_DOWN ||
orientation == vtkHeatmapItem::DOWN_TO_UP)
{
sceneRow = floor(fabs(x - this->Position[0]) / this->CellHeight);
sceneColumn = floor((y - this->MinY) / this->CellWidth);
sceneRow = static_cast<int>(floor(fabs(x - this->Position[0]) / this->CellHeight));
sceneColumn = static_cast<int>(floor((y - this->MinY) / this->CellWidth));
}
else
{
sceneRow = floor(fabs(y - this->Position[1]) / this->CellHeight);
sceneColumn = floor((x - this->MinX) / this->CellWidth);
sceneRow = static_cast<int>(floor(fabs(y - this->Position[1]) / this->CellHeight));
sceneColumn = static_cast<int>(floor((x - this->MinX) / this->CellWidth));
}
vtkIdType row = -1;
......@@ -1146,11 +1146,11 @@ bool vtkHeatmapItem::MouseDoubleClickEvent(const vtkContextMouseEvent &event)
if (orientation == vtkHeatmapItem::UP_TO_DOWN ||
orientation == vtkHeatmapItem::DOWN_TO_UP)
{
column = floor((pos[1] - this->MinY) / this->CellWidth);
column = static_cast<vtkIdType>(floor((pos[1] - this->MinY) / this->CellWidth));
}
else
{
column = floor((pos[0] - this->MinX) / this->CellWidth);
column = static_cast<vtkIdType>(floor((pos[0] - this->MinX) / this->CellWidth));
}
++column;
......
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