Salome HOME
projects
/
modules
/
smesh.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3f66560
)
IPAL52559: TC7.5.0: Auto color has no effect on the faces group
V7_5_0b1
author
vsr
<vsr@opencascade.com>
Fri, 31 Oct 2014 13:43:41 +0000
(16:43 +0300)
committer
vsr
<vsr@opencascade.com>
Fri, 31 Oct 2014 13:43:41 +0000
(16:43 +0300)
src/SMESHGUI/SMESHGUI.cxx
patch
|
blob
|
history
diff --git
a/src/SMESHGUI/SMESHGUI.cxx
b/src/SMESHGUI/SMESHGUI.cxx
index 0f8f8d31ebb3f26771f0cb160d36b5d2f1401401..61ff14fb5ed3a71a07d55fd5985bfe99860e2851 100644
(file)
--- a/
src/SMESHGUI/SMESHGUI.cxx
+++ b/
src/SMESHGUI/SMESHGUI.cxx
@@
-1756,6
+1756,19
@@
namespace
return RefType;
}
return RefType;
}
+ 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
void SMESHGUI::OnEditDelete()
} //namespace
void SMESHGUI::OnEditDelete()
@@
-6939,7
+6952,7
@@
SALOMEDS::Color SMESHGUI::getPredefinedUniqueColor()
}
}
}
}
}
}
- static int currentColor =
0
;
+ static int currentColor =
randomize( colors.size() )
;
SALOMEDS::Color color;
color.R = (double)colors[currentColor].red() / 255.0;
SALOMEDS::Color color;
color.R = (double)colors[currentColor].red() / 255.0;