Commit ca880016 authored by Bill Lorensen's avatar Bill Lorensen Committed by David Gobbi
Browse files

COMP: Remove redundant test and unify tolerances

TestParametricFunctions.py existed in two modules. The version in
Filters/Sources used random numbers to populate the splines. This was
undesirable for producing consistent results across platforms.

The version in Common/ComputationalGeometry uses explicit points and
matches the points in the corresponding .tcl test.

Also, the .tcl and .py tests had different image tolerances. This
patch unifies those tolerances.

There are currently four baselines for these tests. Once merged, we
will remove all of the alternate baselines.

Change-Id: Ie09a6a27e0856596fcda2df7cec2d11ee279ed78
parent 0ea72ac6
......@@ -207,16 +207,17 @@ class TestParametricFunctions(vtk.test.Testing.vtkTest):
# ------------------------------------------------------------
# Create an open 1D spline
# ------------------------------------------------------------
splinePoints = [[ -0.981576726763 , 0.639953289013 , -0.305071552892 ],
[ 0.6624105478 , -0.865923131754 , 0.429924616325 ],
[ -0.2569734311 , -0.952456491977 , 0.0637393393851 ],
[ -0.732922955292 , -0.236109588871 , -0.293860152035 ],
[ -0.907575251492 , 0.382748181644 , 0.848688894812 ],
[ -0.0857448890273 , 0.885650117828 , -0.878469658959 ],
[ -0.439558122977 , 0.346627118693 , -0.238016126323 ],
[ -0.337035103392 , -0.548982715024 , -0.752491410706 ],
[ 0.876860257181 , -0.609657562156 , -0.514647156705 ],
[ 0.325237251504 , 0.26248602721 , -0.397340677398 ]]
splinePoints = [
[0.50380158308139134, -0.60679315105396936, -0.37248976406291578],
[-0.4354646054261665, -0.85362339758017258, -0.84844312996065385],
[0.2163147512899315, -0.39797507012168643, -0.76700353518454523],
[0.97158415334838644, -0.58513467367046257, -0.35846037946569753],
[-0.64359767997804918, -0.94620739107309249, -0.90762176546623086],
[-0.39901219094126117, -0.1978931497772658, 0.0098316934936828471],
[-0.75872745167404765, 0.067719714281950116, 0.165237936733867],
[-0.84599731389712418, -0.67685466896596114, 0.10357868909071133],
[0.84702754758625654, -0.0080077177882230677, -0.58571286666473044],
[-0.076150034124101484, 0.14637647622561856, 0.1494359239700418] ]
inputPoints = vtk.vtkPoints()
for i in range(0, 10):
inputPoints.InsertPoint(i, splinePoints[i])
......@@ -560,7 +561,10 @@ class TestParametricFunctions(vtk.test.Testing.vtkTest):
renWin.Render()
img_file = "TestParametricFunctions.png"
vtk.test.Testing.compareImage(iren.GetRenderWindow(), vtk.test.Testing.getAbsImagePath(img_file), threshold=35)
# NOTE: this test has a companion .tcl test. The threshold set
# here should be the same as the threshold in the .tcl
# test. Both tests should produce exactly the same results.
vtk.test.Testing.compareImage(iren.GetRenderWindow(), vtk.test.Testing.getAbsImagePath(img_file), threshold=10)
vtk.test.Testing.interact()
if __name__ == "__main__":
......
......@@ -7,7 +7,10 @@
# ------------------------------------------------------------
package require vtk
package require vtkinteraction
set threshold 30
# NOTE: this test has a companion .py test. The threshold set
# here should be the same as the threshold in the .py
# test. Both tests should produce exactly the same results.
set threshold 10
# ------------------------------------------------------------
# Get a texture`
# ------------------------------------------------------------
......@@ -199,16 +202,16 @@ vtkActor2D superEllipsoidTextActor
# ------------------------------------------------------------
# Create an open 1D spline
# ------------------------------------------------------------
set p0 "-0.981576726763 0.639953289013 -0.305071552892"
set p1 "0.6624105478 -0.865923131754 0.429924616325"
set p2 "-0.2569734311 -0.952456491977 0.0637393393851"
set p3 "-0.732922955292 -0.236109588871 -0.293860152035"
set p4 "-0.907575251492 0.382748181644 0.848688894812"
set p5 "-0.0857448890273 0.885650117828 -0.878469658959"
set p6 "-0.439558122977 0.346627118693 -0.238016126323"
set p7 "-0.337035103392 -0.548982715024 -0.752491410706"
set p8 "0.876860257181 -0.609657562156 -0.514647156705"
set p9 "0.325237251504 0.26248602721 -0.397340677398"
set p0 "0.50380158308139134 -0.60679315105396936 -0.37248976406291578"
set p1 "-0.4354646054261665 -0.85362339758017258 -0.84844312996065385"
set p2 "0.2163147512899315 -0.39797507012168643 -0.76700353518454523"
set p3 "0.97158415334838644 -0.58513467367046257 -0.35846037946569753"
set p4 "-0.64359767997804918 -0.94620739107309249 -0.90762176546623086"
set p5 "-0.39901219094126117 -0.1978931497772658 0.0098316934936828471"
set p6 "-0.75872745167404765 0.067719714281950116 0.165237936733867"
set p7 "-0.84599731389712418 -0.67685466896596114 0.10357868909071133"
set p8 "0.84702754758625654 -0.0080077177882230677 -0.58571286666473044"
set p9 "-0.076150034124101484 0.14637647622561856 0.1494359239700418"
vtkPoints inputPoints
for {set i 0} {$i < 10} {incr i 1} {
......
add_test_python(Disk.py Graphics)
add_test_python(OSCone.py Graphics)
add_test_python(TestButtonSource.py Graphics)
add_test_python(TestParametricFunctions.py Graphics)
add_test_python(TestRegularPolygonSource.py Graphics)
add_test_python(coneResolution.py Graphics)
add_test_python(glyph2D.py Graphics)
......
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