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
c99b077a
Commit
c99b077a
authored
22 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Fix small bug for multi-timestep strings in views
parent
8848d77a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Graphics/Graph2D.cpp
+28
-15
28 additions, 15 deletions
Graphics/Graph2D.cpp
tutorial/t8.geo
+1
-1
1 addition, 1 deletion
tutorial/t8.geo
tutorial/view4.pos
+5
-0
5 additions, 0 deletions
tutorial/view4.pos
with
34 additions
and
16 deletions
Graphics/Graph2D.cpp
+
28
−
15
View file @
c99b077a
// $Id: Graph2D.cpp,v 1.2
0
2002-10-1
2
1
9:41
:1
3
geuzaine Exp $
// $Id: Graph2D.cpp,v 1.2
1
2002-10-1
9
1
8:56
:1
2
geuzaine Exp $
//
// Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -390,18 +390,18 @@ void Draw_Graph2D(void){
}
}
//
2D t
ext strings
//
T
ext strings
// T2(x,y,style){"str","str",...};
// T2D : x,y,style,index,x,y,style,index,...
// T2C : string\0,string\0,string\0,string\0,...
//
Parser format:
T2(x,y,style){"str","str",...};
// T2D
list of double
: x,y,style,index,x,y,style,index,...
// T2C
list of chars
: string\0,string\0,string\0,string\0,...
// T3(x,y,z,style){"str","str",...};
// T3D : x,y,z,style,index,x,y,z,style,index,...
// T3C : string\0,string\0,string\0,string\0,...
//
Parser format:
T3(x,y,z,style){"str","str",...};
// T3D
list of double
: x,y,z,style,index,x,y,z,style,index,...
// T3C
list of chars
: string\0,string\0,string\0,string\0,...
void
Draw_Text2D3D
(
int
dim
,
int
timestep
,
int
nb
,
List_T
*
td
,
List_T
*
tc
){
int
j
,
k
,
l
,
nbd
,
index
,
stop
;
int
j
,
k
,
l
,
nbd
,
index
,
nbchar
;
char
*
c
;
double
*
d1
,
*
d2
,
style
,
x
,
y
,
z
;
...
...
@@ -409,6 +409,19 @@ void Draw_Text2D3D(int dim, int timestep, int nb, List_T *td, List_T *tc){
else
if
(
dim
==
3
)
nbd
=
5
;
else
return
;
#if 0 //debug
if(nb){
for(j=0; j<List_Nbr(tc); j++){
c = (char*)List_Pointer(tc, j);
if(*c == '\0')
printf("|");
else
printf("%c", *c);
}
printf("\n");
}
#endif
for
(
j
=
0
;
j
<
nb
;
j
++
){
d1
=
(
double
*
)
List_Pointer
(
td
,
j
*
nbd
);
d2
=
(
double
*
)
List_Pointer_Test
(
td
,
(
j
+
1
)
*
nbd
);
...
...
@@ -420,8 +433,8 @@ void Draw_Text2D3D(int dim, int timestep, int nb, List_T *td, List_T *tc){
z
=
0.
;
style
=
d1
[
2
];
index
=
(
int
)
d1
[
3
];
if
(
d2
)
stop
=
(
int
)
d2
[
3
];
else
stop
=
List_Nbr
(
tc
)
-
index
;
if
(
d2
)
nbchar
=
(
int
)
d2
[
3
]
-
index
;
else
nbchar
=
List_Nbr
(
tc
)
-
index
;
}
else
{
x
=
d1
[
0
];
...
...
@@ -429,16 +442,16 @@ void Draw_Text2D3D(int dim, int timestep, int nb, List_T *td, List_T *tc){
z
=
d1
[
2
];
style
=
d1
[
3
];
index
=
(
int
)
d1
[
4
];
if
(
d2
)
stop
=
(
int
)
d2
[
4
];
else
stop
=
List_Nbr
(
tc
)
-
index
;
if
(
d2
)
nbchar
=
(
int
)
d2
[
4
]
-
index
;
else
nbchar
=
List_Nbr
(
tc
)
-
index
;
}
glRasterPos3d
(
x
,
y
,
z
);
c
=
(
char
*
)
List_Pointer
(
tc
,
index
);
k
=
l
=
0
;
while
(
k
<
stop
&&
l
!=
timestep
){
while
(
k
<
nbchar
&&
l
!=
timestep
){
if
(
c
[
k
++
]
==
'\0'
)
l
++
;
}
if
(
k
<
stop
&&
l
==
timestep
)
if
(
k
<
nbchar
&&
l
==
timestep
)
Draw_String
(
&
c
[
k
]);
else
Draw_String
(
c
);
...
...
This diff is collapsed.
Click to expand it.
tutorial/t8.geo
+
1
−
1
View file @
c99b077a
...
...
@@ -52,7 +52,7 @@ View[2].AutoPosition = 0;
View
[
2
].
PositionX
=
85
;
View
[
2
].
PositionY
=
50
;
View
[
2
].
Width
=
200
;
View
[
2
].
Height
=
1
5
0
;
View
[
2
].
Height
=
1
3
0
;
View
[
3
].
Type
=
3
;
View
[
3
].
RangeType
=
2
;
...
...
This diff is collapsed.
Click to expand it.
tutorial/view4.pos
+
5
−
0
View file @
c99b077a
...
...
@@ -103,4 +103,9 @@ SP(0.05,0.3,0){0,0,0,0,0};
};
View "e" {
SP(0.05,0.2,0){1939799.2,-3879808.7,1939891.9,1939888.6,-3880387.9};
T2(10,-12,0){"File created on Fri Oct 18 23:50:20 2002"};
T2(220,-12,0){"First time step", "Second time step", "Third time step",
"Fourth time step", "Last time step!"};
T3(0.1,0,0,0){"This is a 3D string, defined in model coordinates"};
T3(0.1,0.3,0,0){"Test 1","Test 2","Test 3","Test 4","Test 5","Test 6","Test 7"};
};
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