IPAL52559: TC7.5.0: Auto color has no effect on the faces group

This commit is contained in:
vsr 2014-10-31 17:03:46 +03:00
parent 76bdbaedf7
commit 84fa6ee9f3

View File

@ -253,7 +253,20 @@ namespace
#endif #endif
} }
} }
}
uint randomize( uint size )
{
static bool initialized = false;
if ( !initialized ) {
qsrand( QDateTime::currentDateTime().toTime_t() );
initialized = true;
}
uint v = qrand();
v = uint( (double)( v ) / RAND_MAX * size );
v = qMax( uint(0), qMin ( v, size-1 ) );
return v;
}
} // namespace
//================================================================ //================================================================
// Function : getActiveStudy // Function : getActiveStudy
@ -2261,7 +2274,7 @@ SALOMEDS::Color GEOM_Displayer::getPredefinedUniqueColor()
} }
} }
static int currentColor = 0; static int currentColor = randomize( colors.size() );
SALOMEDS::Color color; SALOMEDS::Color color;
color.R = (double)colors[currentColor].red() / 255.0; color.R = (double)colors[currentColor].red() / 255.0;