Commit 180ebd0b authored by Ken Martin's avatar Ken Martin
Browse files

Fix floating point issue with chart test

TestChartXYZ test fails on various platforms.  It turns out it is
failing due to floating point issues. Basically

1)	By default the plot data points define the bounds of the axes
    for the chart
2)	the axes define the plot area (clip stuff outside that)
3)	which defines the clipping plane equations
4)	which can in turn clip the original data points subject to
    floating point precision

This is what is happening (FYI, the point that disappears in the middle
is actual on the boundary in the depth axis). This patch
“fixes” the test by defining axes that are slightly bigger than the
data and replacing the valid image.

Change-Id: I25e7f05736f274ffc16633d8110767b9a5a5907b
parent 26af2896
......@@ -13,6 +13,7 @@
#include "vtkAxis.h"
#include "vtkChartXYZ.h"
#include "vtkContextView.h"
#include "vtkContextScene.h"
......@@ -82,7 +83,6 @@ int TestChartXYZ(int , char * [])
int numPoints = 69;
float inc = 7.5 / (numPoints-1);
for (int i = 0; i < numPoints; ++i)
table->SetValue(i, 0, i * inc);
......@@ -97,6 +97,10 @@ int TestChartXYZ(int , char * [])
const vtkColor4ub axisColor(20, 200, 30);
// We want a duplicate, that does not move.
vtkNew<vtkPlotPoints3D> plot2;
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