mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-27 15:10:33 +05:00
Merge from V6_main 26/10/2012
This commit is contained in:
parent
63007c12d4
commit
b13e4d9ce0
@ -116,10 +116,10 @@
|
|||||||
|
|
||||||
// If the next macro is defined, autocolor feature works for all sub-shapes;
|
// If the next macro is defined, autocolor feature works for all sub-shapes;
|
||||||
// if it is undefined, autocolor feature works for groups only
|
// if it is undefined, autocolor feature works for groups only
|
||||||
//#define GENERAL_AUTOCOLOR
|
#define GENERAL_AUTOCOLOR
|
||||||
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
||||||
// of auto-color picking up
|
// of auto-color picking up
|
||||||
//#define SIMPLE_AUTOCOLOR
|
#define SIMPLE_AUTOCOLOR
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
// Function : getActiveStudy
|
// Function : getActiveStudy
|
||||||
@ -1835,19 +1835,15 @@ SALOMEDS::Color GEOM_Displayer::getPredefinedUniqueColor()
|
|||||||
static QList<QColor> colors;
|
static QList<QColor> colors;
|
||||||
|
|
||||||
if ( colors.isEmpty() ) {
|
if ( colors.isEmpty() ) {
|
||||||
const int rfactor = 4; // red color component split factor, must be > 0
|
|
||||||
const int gfactor = 4; // green color component split factor, must be > 0
|
for (int s = 0; s < 2 ; s++)
|
||||||
const int bfactor = 3; // blue color component split factor, must be > 0
|
{
|
||||||
// -
|
for (int v = 100; v >= 40; v = v - 20)
|
||||||
// total number of pre-defined colors is defined as
|
{
|
||||||
// nbcolors = rfactor * gfactor * bfactor
|
for (int h = 0; h < 359 ; h = h + 60)
|
||||||
// NB: all three factors should not have same values
|
{
|
||||||
// otherwise all colors will be greyish
|
colors.append(QColor::fromHsv(h, 255 - s * 127, v * 255 / 100));
|
||||||
|
}
|
||||||
for ( int g = 0; g < gfactor; g++ ) {
|
|
||||||
for ( int r = 0; r < rfactor; r++ ) {
|
|
||||||
for ( int b = 0; b < bfactor; b++ )
|
|
||||||
colors.append( QColor( qRgb( r * 255 / (rfactor-1), g * 255 / (gfactor-1), b * 255 / (bfactor-1) ) ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,10 +111,10 @@
|
|||||||
|
|
||||||
// If the next macro is defined, autocolor feature works for all sub-shapes;
|
// If the next macro is defined, autocolor feature works for all sub-shapes;
|
||||||
// if it is undefined, autocolor feature works for groups only
|
// if it is undefined, autocolor feature works for groups only
|
||||||
//#define GENERAL_AUTOCOLOR
|
#define GENERAL_AUTOCOLOR
|
||||||
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
||||||
// of auto-color picking up
|
// of auto-color picking up
|
||||||
//#define SIMPLE_AUTOCOLOR
|
#define SIMPLE_AUTOCOLOR
|
||||||
|
|
||||||
void GEOMToolsGUI::OnCheckGeometry()
|
void GEOMToolsGUI::OnCheckGeometry()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user