Commit fba50fba authored by Ben Boeckel's avatar Ben Boeckel

TestSurfacePlot: loop using vtkIdType

The 'inc' variable will take care of the implicit float cast. Avoid the
implicit downcast when passing i and j as indicies though.

Change-Id: Ia84dc4b67c102c0da3c0bd5ef43bd89d0e861e0d
parent ede46c84
......@@ -40,18 +40,18 @@ int TestSurfacePlot(int , char * [])
// Create a surface
vtkNew<vtkTable> table;
float numPoints = 70;
vtkIdType numPoints = 70;
float inc = 9.424778 / (numPoints - 1);
for (float i = 0; i < numPoints; ++i)
for (vtkIdType i = 0; i < numPoints; ++i)
{
vtkNew<vtkFloatArray> arr;
table->AddColumn(arr.GetPointer());
}
table->SetNumberOfRows(numPoints);
for (float i = 0; i < numPoints; ++i)
for (vtkIdType i = 0; i < numPoints; ++i)
{
float x = i * inc;
for (float j = 0; j < numPoints; ++j)
for (vtkIdType j = 0; j < numPoints; ++j)
{
float y = j * inc;
table->SetValue(i, j, sin(sqrt(x*x + y*y)));
......
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