Skip to content
Snippets Groups Projects
Commit 320596ac authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix colors + color bar for "Numeric" range type

parent c4cc0446
No related branches found
No related tags found
No related merge requests found
......@@ -1139,7 +1139,7 @@ static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numCo
for(int j = 0; j < numComp; j++) d[j] /= (double)numNodes;
double v = ComputeScalarRep(numComp, d);
if(v >= vmin && v <= vmax){
unsigned int col = opt->getColor(v, vmin, vmax);
unsigned int col = opt->getColor(v, vmin, vmax, false, opt->NbIso);
glColor4ubv((GLubyte *) & col);
glRasterPos3d(pc.x(), pc.y(), pc.z());
if(opt->CenterGlyphs)
......@@ -1152,7 +1152,7 @@ static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numCo
for(int i = 0; i < numNodes; i++){
double v = ComputeScalarRep(numComp, val[i]);
if(v >= vmin && v <= vmax){
unsigned int col = opt->getColor(v, vmin, vmax);
unsigned int col = opt->getColor(v, vmin, vmax, false, opt->NbIso);
glColor4ubv((GLubyte *) & col);
glRasterPos3d(xyz[i][0], xyz[i][1], xyz[i][2]);
if(opt->CenterGlyphs)
......
......@@ -21,7 +21,8 @@ static void drawScaleBar(PView *p, double xmin, double ymin, double width,
double box = (horizontal ? width : height) / (opt->NbIso ? opt->NbIso : 1);
for(int i = 0; i < opt->NbIso; i++) {
if(opt->IntervalsType == PViewOptions::Discrete){
if(opt->IntervalsType == PViewOptions::Discrete ||
opt->IntervalsType == PViewOptions::Numeric){
unsigned int col = opt->getColor(i, opt->NbIso);
glColor4ubv((GLubyte *) &col);
glBegin(GL_QUADS);
......@@ -100,6 +101,7 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin
int nbv = opt->NbIso;
double f = (opt->IntervalsType == PViewOptions::Discrete ||
opt->IntervalsType == PViewOptions::Numeric ||
opt->IntervalsType == PViewOptions::Continuous) ? 2 : 2.5;
if(horizontal && width < nbv * maxw){
......@@ -117,6 +119,7 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin
glColor4ubv((GLubyte *) & CTX.color.text);
if(opt->IntervalsType == PViewOptions::Discrete ||
opt->IntervalsType == PViewOptions::Numeric ||
opt->IntervalsType == PViewOptions::Continuous){
for(int i = 0; i < nbv + 1; i++) {
double v = opt->getScaleValue(i, nbv + 1, opt->TmpMin, opt->TmpMax);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment