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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
1449f214
Commit
1449f214
authored
8 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
same time labels as in gmsh
parent
c9e9b73d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/mobile/drawContext.cpp
+44
-9
44 additions, 9 deletions
contrib/mobile/drawContext.cpp
with
44 additions
and
9 deletions
contrib/mobile/drawContext.cpp
+
44
−
9
View file @
1449f214
...
...
@@ -491,19 +491,54 @@ void drawContext::drawScale()
glDisableClientState
(
GL_VERTEX_ARRAY
);
char
label
[
1024
];
int
nt
=
data
->
getNumTimeSteps
();
if
((
opt
->
showTime
==
1
&&
nt
>
1
)
||
opt
->
showTime
==
2
){
char
tmp
[
256
];
sprintf
(
tmp
,
opt
->
format
.
c_str
(),
data
->
getTime
(
opt
->
timeStep
));
sprintf
(
label
,
"%s (%s)"
,
data
->
getName
().
c_str
(),
tmp
);
}
else
if
((
opt
->
showTime
==
3
&&
nt
>
1
)
||
opt
->
showTime
==
4
){
sprintf
(
label
,
"%s (%d/%d)"
,
data
->
getName
().
c_str
(),
opt
->
timeStep
,
data
->
getNumTimeSteps
()
-
1
);
}
else
{
int
n0
=
data
->
getFirstNonEmptyTimeStep
();
int
n
=
(
nt
-
n0
>
0
)
?
nt
-
n0
:
1
;
char
time
[
256
];
sprintf
(
time
,
opt
->
format
.
c_str
(),
data
->
getTime
(
opt
->
timeStep
));
int
choice
=
opt
->
showTime
;
if
(
choice
==
3
){
// automatic
if
(
n
==
1
)
choice
=
0
;
// nothing
else
if
(
n
==
2
)
choice
=
2
;
// harmonic
else
choice
=
5
;
// multi-step data
}
switch
(
choice
){
case
1
:
// time series
sprintf
(
label
,
"%s - time %s"
,
data
->
getName
().
c_str
(),
time
);
break
;
case
2
:
// harmonic data
if
(
n
<=
2
)
sprintf
(
label
,
"%s - %s part"
,
data
->
getName
().
c_str
(),
((
opt
->
timeStep
-
n0
)
%
2
)
?
"imaginary"
:
"real"
);
else
sprintf
(
label
,
"%s - harmonic %s (%s part)"
,
data
->
getName
().
c_str
(),
time
,
((
opt
->
timeStep
-
n0
)
%
2
)
?
"imaginary"
:
"real"
);
break
;
case
3
:
// automatic
// never here
break
;
case
4
:
// step data
sprintf
(
label
,
"%s - step %d"
,
data
->
getName
().
c_str
(),
opt
->
timeStep
);
break
;
case
5
:
// multi-step data
sprintf
(
label
,
"%s - step %d in [0,%d]"
,
data
->
getName
().
c_str
(),
opt
->
timeStep
,
data
->
getNumTimeSteps
()
-
1
);
break
;
case
6
:
// real eigenvalues
sprintf
(
label
,
"%s - eigenvalue %s"
,
data
->
getName
().
c_str
(),
time
);
break
;
case
7
:
// complex eigenvalues
sprintf
(
label
,
"%s - eigenvalue %s (%s part)"
,
data
->
getName
().
c_str
(),
time
,
((
opt
->
timeStep
-
n0
)
%
2
)
?
"imaginary"
:
"real"
);
break
;
default:
sprintf
(
label
,
"%s"
,
data
->
getName
().
c_str
());
break
;
}
drawString
lbl
(
label
,
20
*
_fontFactor
);
lbl
.
draw
(
xmin
+
width
/
2
,
ymin
+
2.8
*
dh
,
0.
,
_width
/
(
_right
-
_left
),
_height
/
(
_top
-
_bottom
));
...
...
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