Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
320596ac
Commit
320596ac
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix colors + color bar for "Numeric" range type
parent
c4cc0446
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Graphics/drawPost.cpp
+2
-2
2 additions, 2 deletions
Graphics/drawPost.cpp
Graphics/drawScales.cpp
+4
-1
4 additions, 1 deletion
Graphics/drawScales.cpp
with
6 additions
and
3 deletions
Graphics/drawPost.cpp
+
2
−
2
View file @
320596ac
...
@@ -1139,7 +1139,7 @@ static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numCo
...
@@ -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
;
for
(
int
j
=
0
;
j
<
numComp
;
j
++
)
d
[
j
]
/=
(
double
)
numNodes
;
double
v
=
ComputeScalarRep
(
numComp
,
d
);
double
v
=
ComputeScalarRep
(
numComp
,
d
);
if
(
v
>=
vmin
&&
v
<=
vmax
){
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
);
glColor4ubv
((
GLubyte
*
)
&
col
);
glRasterPos3d
(
pc
.
x
(),
pc
.
y
(),
pc
.
z
());
glRasterPos3d
(
pc
.
x
(),
pc
.
y
(),
pc
.
z
());
if
(
opt
->
CenterGlyphs
)
if
(
opt
->
CenterGlyphs
)
...
@@ -1152,7 +1152,7 @@ static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numCo
...
@@ -1152,7 +1152,7 @@ static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numCo
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
){
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
){
double
v
=
ComputeScalarRep
(
numComp
,
val
[
i
]);
double
v
=
ComputeScalarRep
(
numComp
,
val
[
i
]);
if
(
v
>=
vmin
&&
v
<=
vmax
){
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
);
glColor4ubv
((
GLubyte
*
)
&
col
);
glRasterPos3d
(
xyz
[
i
][
0
],
xyz
[
i
][
1
],
xyz
[
i
][
2
]);
glRasterPos3d
(
xyz
[
i
][
0
],
xyz
[
i
][
1
],
xyz
[
i
][
2
]);
if
(
opt
->
CenterGlyphs
)
if
(
opt
->
CenterGlyphs
)
...
...
This diff is collapsed.
Click to expand it.
Graphics/drawScales.cpp
+
4
−
1
View file @
320596ac
...
@@ -21,7 +21,8 @@ static void drawScaleBar(PView *p, double xmin, double ymin, double width,
...
@@ -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
);
double
box
=
(
horizontal
?
width
:
height
)
/
(
opt
->
NbIso
?
opt
->
NbIso
:
1
);
for
(
int
i
=
0
;
i
<
opt
->
NbIso
;
i
++
)
{
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
);
unsigned
int
col
=
opt
->
getColor
(
i
,
opt
->
NbIso
);
glColor4ubv
((
GLubyte
*
)
&
col
);
glColor4ubv
((
GLubyte
*
)
&
col
);
glBegin
(
GL_QUADS
);
glBegin
(
GL_QUADS
);
...
@@ -100,6 +101,7 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin
...
@@ -100,6 +101,7 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin
int
nbv
=
opt
->
NbIso
;
int
nbv
=
opt
->
NbIso
;
double
f
=
(
opt
->
IntervalsType
==
PViewOptions
::
Discrete
||
double
f
=
(
opt
->
IntervalsType
==
PViewOptions
::
Discrete
||
opt
->
IntervalsType
==
PViewOptions
::
Numeric
||
opt
->
IntervalsType
==
PViewOptions
::
Continuous
)
?
2
:
2.5
;
opt
->
IntervalsType
==
PViewOptions
::
Continuous
)
?
2
:
2.5
;
if
(
horizontal
&&
width
<
nbv
*
maxw
){
if
(
horizontal
&&
width
<
nbv
*
maxw
){
...
@@ -117,6 +119,7 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin
...
@@ -117,6 +119,7 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin
glColor4ubv
((
GLubyte
*
)
&
CTX
.
color
.
text
);
glColor4ubv
((
GLubyte
*
)
&
CTX
.
color
.
text
);
if
(
opt
->
IntervalsType
==
PViewOptions
::
Discrete
||
if
(
opt
->
IntervalsType
==
PViewOptions
::
Discrete
||
opt
->
IntervalsType
==
PViewOptions
::
Numeric
||
opt
->
IntervalsType
==
PViewOptions
::
Continuous
){
opt
->
IntervalsType
==
PViewOptions
::
Continuous
){
for
(
int
i
=
0
;
i
<
nbv
+
1
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nbv
+
1
;
i
++
)
{
double
v
=
opt
->
getScaleValue
(
i
,
nbv
+
1
,
opt
->
TmpMin
,
opt
->
TmpMax
);
double
v
=
opt
->
getScaleValue
(
i
,
nbv
+
1
,
opt
->
TmpMin
,
opt
->
TmpMax
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment