Commit eaf823ed authored by Lefebvre, Jordan's avatar Lefebvre, Jordan
Browse files

Cleaning warnings in vtkPlotPointsErrorBars.cc.

parent a529c112
Pipeline #15649 passed with stages
in 7 minutes and 47 seconds
......@@ -184,10 +184,10 @@ bool vtkPlotPointsErrorBars::Paint(vtkContext2D *painter)
float width = this->MarkerSize;
if (width < 0.0f)
{
width = this->Pen->GetWidth() * 2.3;
if (width < 8.0)
width = this->Pen->GetWidth() * 2.3f;
if (width < 8.0f)
{
width = 8.0;
width = 8.0f;
}
}
......@@ -212,7 +212,7 @@ bool vtkPlotPointsErrorBars::Paint(vtkContext2D *painter)
if (id - lastGood > 0)
{
// Draw lines for error bars
PaintErrorBars(painter, points + 2 * (lastGood), id - lastGood);
PaintErrorBars(painter, points + 2 * (lastGood), int(id - lastGood));
}
lastGood = id + 1;
bpIdx++;
......@@ -221,7 +221,7 @@ bool vtkPlotPointsErrorBars::Paint(vtkContext2D *painter)
else
{
// draw all of the error bars
PaintErrorBars(painter, points, this->Points->GetNumberOfPoints());
PaintErrorBars(painter, points, int(this->Points->GetNumberOfPoints()));
}
}
......@@ -257,9 +257,10 @@ bool vtkPlotPointsErrorBars::Paint(vtkContext2D *painter)
// render from last good point to one before this bad point
if (id - lastGood > 0)
{
painter->DrawMarkers(
this->MarkerStyle, false, points + 2 * (lastGood), id - lastGood,
colors ? colors + 4 * (lastGood) : nullptr, nColorComponents);
painter->DrawMarkers(this->MarkerStyle, false,
points + 2 * (lastGood), int(id - lastGood),
colors ? colors + 4 * (lastGood) : nullptr,
nColorComponents);
}
lastGood = id + 1;
bpIdx++;
......@@ -269,7 +270,7 @@ bool vtkPlotPointsErrorBars::Paint(vtkContext2D *painter)
{
// draw all of the points
painter->DrawMarkers(this->MarkerStyle, false, points,
this->Points->GetNumberOfPoints(), colors,
int(this->Points->GetNumberOfPoints()), colors,
nColorComponents);
}
}
......@@ -296,21 +297,21 @@ bool vtkPlotPointsErrorBars::Paint(vtkContext2D *painter)
vtkDebugMacro(<< "Selection set " << this->Selection->GetNumberOfTuples());
painter->GetPen()->SetColor(this->SelectionPen->GetColor());
painter->GetPen()->SetOpacity(this->SelectionPen->GetOpacity());
painter->GetPen()->SetWidth(width + 2.7);
painter->GetPen()->SetWidth(width + 2.7f);
if (this->MarkerStyle == VTK_MARKER_NONE)
{
painter->DrawMarkers(
VTK_MARKER_PLUS, false,
static_cast<float *>(this->SelectedPoints->GetVoidPointer(0)),
this->SelectedPoints->GetNumberOfTuples());
int(this->SelectedPoints->GetNumberOfTuples()));
}
else
{
painter->DrawMarkers(
this->MarkerStyle, true,
static_cast<float *>(this->SelectedPoints->GetVoidPointer(0)),
this->SelectedPoints->GetNumberOfTuples());
int(this->SelectedPoints->GetNumberOfTuples()));
}
}
......@@ -323,10 +324,10 @@ bool vtkPlotPointsErrorBars::PaintLegend(vtkContext2D *painter,
{
if (this->MarkerStyle)
{
float width = this->Pen->GetWidth() * 2.3;
if (width < 8.0)
float width = this->Pen->GetWidth() * 2.3f;
if (width < 8.0f)
{
width = 8.0;
width = 8.0f;
}
painter->ApplyPen(this->Pen);
painter->ApplyBrush(this->Brush);
......@@ -358,12 +359,12 @@ void vtkPlotPointsErrorBars::PaintErrorBars(vtkContext2D *painter,
for (int i = 0; i < n; ++i)
{
float thisX = points[2 * i], thisY = points[2 * i + 1];
float capLengthX = (this->GetXAxis()->GetMaximum() -
this->GetXAxis()->GetMinimum()) /
100,
capLengthY = (this->GetYAxis()->GetMaximum() -
this->GetYAxis()->GetMinimum()) /
100;
float capLengthX = float(this->GetXAxis()->GetMaximum() -
this->GetXAxis()->GetMinimum()) /
100.f,
capLengthY = float(this->GetYAxis()->GetMaximum() -
this->GetYAxis()->GetMinimum()) /
100.f;
if (XErrors && XErrors->GetNumberOfValues() > i)
{
......@@ -464,7 +465,7 @@ void vtkPlotPointsErrorBars::CreateSortedPoints()
vtkIdType n = this->Points->GetNumberOfPoints();
vtkVector2f *data =
static_cast<vtkVector2f *>(this->Points->GetVoidPointer(0));
this->Sorted = new VectorPIMPL(data, n);
this->Sorted = new VectorPIMPL(data, size_t(n));
std::sort(this->Sorted->begin(), this->Sorted->end(), compVector3fX);
}
}
......@@ -590,7 +591,7 @@ bool vtkPlotPointsErrorBars::SelectPointsInPolygon(
double point[3];
this->Points->GetPoint(pointId, point);
if (polygon.Contains(vtkVector2f(point[0], point[1])))
if (polygon.Contains(vtkVector2f(float(point[0]), float(point[1]))))
{
this->Selection->InsertNextValue(pointId);
}
......@@ -610,7 +611,7 @@ void SetBadPoints(T *data, vtkIdType n, std::set<vtkIdType> &bad)
{
for (vtkIdType i = 0; i < n; ++i)
{
if (vtkMath::IsInf(data[i]) || vtkMath::IsNan(data[i]))
if (vtkMath::IsInf(double(data[i])) || vtkMath::IsNan(double(data[i])))
{
bad.insert(i);
}
......@@ -754,12 +755,9 @@ template <typename A>
void CopyToXErrors(vtkFloatArray *xErrors, A *a, int n, const vtkRectd &ss)
{
xErrors->Initialize();
// xErrors->SetNumberOfComponents(n);
// float *data = static_cast<float *>(xErrors->GetVoidPointer(0));
for (int i = 0; i < n; ++i)
{
xErrors->InsertNextValue(static_cast<float>((a[i] + ss[0]) * ss[2]));
// data[i] = static_cast<float>((a[i] + ss[0]) * ss[2]);
}
}
......@@ -768,12 +766,9 @@ template <typename A>
void CopyToYErrors(vtkFloatArray *yErrors, A *a, int n, const vtkRectd &ss)
{
yErrors->Initialize();
// yErrors->SetNumberOfComponents(n);
// float *data = static_cast<float *>(yErrors->GetVoidPointer(0));
for (int i = 0; i < n; ++i)
{
yErrors->InsertNextValue(static_cast<float>((a[i] + ss[1]) * ss[3]));
// data[i] = static_cast<float>((a[i] + ss[1]) * ss[3]);
}
}
......@@ -843,9 +838,9 @@ bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table)
{
switch (y->GetDataType())
{
vtkTemplateMacro(CopyToPoints(this->Points,
static_cast<VTK_TT *>(y->GetVoidPointer(0)),
y->GetNumberOfTuples(), this->ShiftScale));
vtkTemplateMacro(CopyToPoints(
this->Points, static_cast<VTK_TT *>(y->GetVoidPointer(0)),
int(y->GetNumberOfTuples()), this->ShiftScale));
}
}
else
......@@ -854,7 +849,7 @@ bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table)
{
vtkTemplateMacro(CopyToPointsSwitch(
this->Points, static_cast<VTK_TT *>(x->GetVoidPointer(0)), y,
x->GetNumberOfTuples(), this->ShiftScale));
int(x->GetNumberOfTuples()), this->ShiftScale));
}
}
......@@ -874,7 +869,7 @@ bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table)
{
vtkTemplateMacro(CopyToXErrors(
this->XErrors, static_cast<VTK_TT *>(xErr->GetVoidPointer(0)),
xErr->GetNumberOfTuples(), this->ShiftScale));
int(xErr->GetNumberOfTuples()), this->ShiftScale));
}
vtkDataArray *yErr = array[3];
......
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