diff --git a/configure.ac b/configure.ac index 7bc18102a9586e6f7577a320545104e5f0ab52ca..2542125cc3e85b04ca3b86e4a5d0d4205a20febb 100755 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,8 @@ if test x"$mem_check" = x"yes"; then AC_DEFINE([MEMLEAK_CHECK],[],[Memory check]) fi +AC_DEFINE([ON_IO_UNIT_TESTS],[],[IO unit tests]) + ##### CHECK FOR BOOST ############## AX_BOOST([1.52],[],[]) diff --git a/src/util.hpp b/src/util.hpp index 16d42529712f0de2f98eeef073b823d4d9c697fd..9533c1d0a16235052d5075668433180cfb0753c2 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -5,6 +5,8 @@ * Author: Pietro Incardona */ +#include "config.h" + #ifndef UTIL_HPP_ #define UTIL_HPP_ @@ -67,86 +69,80 @@ struct RGB getColor(int group, std::uniform_real_distribution<float> & d, std::d { struct RGB col; + float s = d(g); + +#ifdef ON_IO_UNIT_TESTS + s = 0.5; +#endif + if (group == 0) { - float s = d(g); col.R = s/2 + 0.5; col.G = 0.0; col.B = 0.0; } else if (group == 1) { - float s = d(g); col.R = 0.0; col.G = s/2 + 0.5; col.B = 0.0; } else if (group == 2) { - float s = d(g); col.R = 0.0; col.G = 0.0; col.B = s; } else if (group == 3) { - float s = d(g); col.R = s/2 + 0.5; col.G = s/2 + 0.5; col.B = 0.0; } else if (group == 4) { - float s = d(g); col.R = s/2 + 0.5; col.G = 0.0; col.B = s/2 + 0.5; } else if (group == 5) { - float s = d(g); col.R = 0.0; col.G = s/2 + 0.5; col.B = s/2 + 0.5; } else if (group == 6) { - float s = d(g); col.R = s/2 + 0.5; col.G = s/4 + 0.5; col.B = 0.0; } else if (group == 7) { - float s = d(g); col.R = s/4 + 0.5; col.G = s/2 + 0.5; col.B = 0.0; } else if (group == 8) { - float s = d(g); col.R = 0.0; col.G = s/2 + 0.5; col.B = s/4 + 0.5; } else if (group == 9) { - float s = d(g); col.R = 0.0; col.G = s/4 + 0.5; col.B = s/2 + 0.5; } else if (group == 10) { - float s = d(g); col.R = s/4 + 0.5; col.G = 0.0; col.B = s/2 + 0.5; } else if (group == 11) { - float s = d(g); col.R = s/2 + 0.5; col.G = 0.0; col.B = s/4 + 0.5; diff --git a/vtk_box_3D_2_test.vtk b/vtk_box_3D_2_test.vtk index f9378177d4a40f1f56ba7a0f7c87c1b9109fc692..15b3a76fe9e05403ac12808ee518752248ec62ef 100644 --- a/vtk_box_3D_2_test.vtk +++ b/vtk_box_3D_2_test.vtk @@ -129,17 +129,17 @@ CELL_TYPES 12 11 CELL_DATA 12 COLOR_SCALARS data 4 -0.500004 0.000000 0.000000 1.0 -0.565769 0.000000 0.000000 1.0 -0.877803 0.000000 0.000000 1.0 -0.729325 0.000000 0.000000 1.0 -0.766384 0.000000 0.000000 1.0 -0.609480 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 -0.000000 0.523522 0.000000 1.0 -0.000000 0.839432 0.000000 1.0 -0.000000 0.839648 0.000000 1.0 -0.000000 0.967346 0.000000 1.0 -0.000000 0.691751 0.000000 1.0 -0.000000 0.759708 0.000000 1.0 +0.000000 0.750000 0.000000 1.0 +0.000000 0.750000 0.000000 1.0 +0.000000 0.750000 0.000000 1.0 +0.000000 0.750000 0.000000 1.0 +0.000000 0.750000 0.000000 1.0 +0.000000 0.750000 0.000000 1.0 diff --git a/vtk_box_3D_test.vtk b/vtk_box_3D_test.vtk index b1dd26a5c27644eab9193558f49aa64c3a1a0c2e..c91e235cdcc5ce3779c8bffb0aea0bd4a6511775 100644 --- a/vtk_box_3D_test.vtk +++ b/vtk_box_3D_test.vtk @@ -68,10 +68,10 @@ CELL_TYPES 6 11 CELL_DATA 6 COLOR_SCALARS data 4 -0.500004 0.000000 0.000000 1.0 -0.565769 0.000000 0.000000 1.0 -0.877803 0.000000 0.000000 1.0 -0.729325 0.000000 0.000000 1.0 -0.766384 0.000000 0.000000 1.0 -0.609480 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 diff --git a/vtk_box_test.vtk b/vtk_box_test.vtk index dee9998a96265193fcf7de0cbccd603ddd2b0a27..8a50615a5eb706ae4e411897a4e387d5c31009da 100644 --- a/vtk_box_test.vtk +++ b/vtk_box_test.vtk @@ -44,10 +44,10 @@ CELL_TYPES 6 8 CELL_DATA 6 COLOR_SCALARS data 4 -0.500004 0.000000 0.000000 1.0 -0.565769 0.000000 0.000000 1.0 -0.877803 0.000000 0.000000 1.0 -0.729325 0.000000 0.000000 1.0 -0.766384 0.000000 0.000000 1.0 -0.609480 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0 +0.750000 0.000000 0.000000 1.0