Commit ebe99fd6 authored by Pietro Incardona's avatar Pietro Incardona

Fixing color randomizer

parent b2256f8d
......@@ -305,8 +305,7 @@ class VTKWriter<vector,VECTOR_BOX>
std::string get_cell_data_list()
{
// random engine
std::default_random_engine generator;
std::uniform_real_distribution<float> d(0.0,1.0);
SimpleRNG rng;
//! vertex node output string
std::string v_out;
......@@ -322,7 +321,7 @@ class VTKWriter<vector,VECTOR_BOX>
while (it.isNext())
{
// write a color
v_out += getColor(col_group,d,generator).toString() + " 1.0" + "\n";
v_out += getColor(col_group,rng).toString() + " 1.0" + "\n";
++it;
}
......
......@@ -7,6 +7,8 @@
#include "config.h"
#include "util/SimpleRNG.hpp"
#ifndef UTIL_HPP_
#define UTIL_HPP_
......@@ -65,11 +67,11 @@ struct RGB
*
*/
static inline struct RGB getColor(int group, std::uniform_real_distribution<float> & d, std::default_random_engine & g)
static inline struct RGB getColor(int group, SimpleRNG & d)
{
struct RGB col;
float s = d(g);
float s = (float)d.GetUniform();
group = group % 12;
......
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