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
86c1b666
Commit
86c1b666
authored
23 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Perf. improvement without display lists
parent
a7eeed9b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/Options.cpp
+7
-2
7 additions, 2 deletions
Common/Options.cpp
Graphics/Post.cpp
+23
-27
23 additions, 27 deletions
Graphics/Post.cpp
with
30 additions
and
29 deletions
Common/Options.cpp
+
7
−
2
View file @
86c1b666
// $Id: Options.cpp,v 1.3
4
2001-07-30
18:34:26
geuzaine Exp $
// $Id: Options.cpp,v 1.3
5
2001-07-30
20:22:55
geuzaine Exp $
#include
"Gmsh.h"
#include
"Gmsh.h"
#include
"GmshUI.h"
#include
"GmshUI.h"
...
@@ -738,8 +738,13 @@ double opt_general_small_axes(OPT_ARGS_NUM){
...
@@ -738,8 +738,13 @@ double opt_general_small_axes(OPT_ARGS_NUM){
return
CTX
.
small_axes
;
return
CTX
.
small_axes
;
}
}
double
opt_general_display_lists
(
OPT_ARGS_NUM
){
double
opt_general_display_lists
(
OPT_ARGS_NUM
){
if
(
action
&
GMSH_SET
)
int
i
;
if
(
action
&
GMSH_SET
){
CTX
.
display_lists
=
(
int
)
val
;
CTX
.
display_lists
=
(
int
)
val
;
if
(
CTX
.
display_lists
)
for
(
i
=
0
;
i
<
List_Nbr
(
Post_ViewList
)
;
i
++
)
((
Post_View
*
)
List_Pointer_Test
(
Post_ViewList
,
i
))
->
Changed
=
1
;
}
#ifdef _FLTK
#ifdef _FLTK
if
(
WID
&&
(
action
&
GMSH_GUI
))
if
(
WID
&&
(
action
&
GMSH_GUI
))
WID
->
gen_butt
[
4
]
->
value
(
CTX
.
display_lists
);
WID
->
gen_butt
[
4
]
->
value
(
CTX
.
display_lists
);
...
...
This diff is collapsed.
Click to expand it.
Graphics/Post.cpp
+
23
−
27
View file @
86c1b666
// $Id: Post.cpp,v 1.1
8
2001-07-30
18:34:26
geuzaine Exp $
// $Id: Post.cpp,v 1.1
9
2001-07-30
20:22:55
geuzaine Exp $
#include
"Gmsh.h"
#include
"Gmsh.h"
#include
"GmshUI.h"
#include
"GmshUI.h"
...
@@ -275,12 +275,15 @@ void Draw_Post (void) {
...
@@ -275,12 +275,15 @@ void Draw_Post (void) {
if
(
v
->
NbST
&&
v
->
DrawTriangles
&&
v
->
DrawScalars
){
if
(
v
->
NbST
&&
v
->
DrawTriangles
&&
v
->
DrawScalars
){
nb
=
List_Nbr
(
v
->
ST
)
/
v
->
NbST
;
nb
=
List_Nbr
(
v
->
ST
)
/
v
->
NbST
;
if
(
v
->
Light
&&
v
->
SmoothNormals
){
//two passes
if
(
v
->
Light
&&
v
->
SmoothNormals
){
//two passes
for
(
i
=
0
;
i
<
List_Nbr
(
v
->
ST
)
;
i
+=
nb
)
if
(
v
->
Changed
){
Draw_ScalarTriangle
(
v
,
1
,
ValMin
,
ValMax
,
Raise
,
Msg
(
DEBUG
,
"Preprocessing of triangle normals in view %d"
,
v
->
Num
);
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
),
for
(
i
=
0
;
i
<
List_Nbr
(
v
->
ST
)
;
i
+=
nb
)
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
+
3
),
Draw_ScalarTriangle
(
v
,
1
,
ValMin
,
ValMax
,
Raise
,
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
+
6
),
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
),
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
+
9
));
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
+
3
),
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
+
6
),
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
+
9
));
}
for
(
i
=
0
;
i
<
List_Nbr
(
v
->
ST
)
;
i
+=
nb
)
for
(
i
=
0
;
i
<
List_Nbr
(
v
->
ST
)
;
i
+=
nb
)
Draw_ScalarTriangle
(
v
,
0
,
ValMin
,
ValMax
,
Raise
,
Draw_ScalarTriangle
(
v
,
0
,
ValMin
,
ValMax
,
Raise
,
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
),
(
double
*
)
List_Pointer_Fast
(
v
->
ST
,
i
),
...
@@ -317,25 +320,19 @@ void Draw_Post (void) {
...
@@ -317,25 +320,19 @@ void Draw_Post (void) {
}
}
// Tetrahedra
// Tetrahedra
/*
Modif Jf :
IsoSurfaces are really better rendered with smooth shading.
My idea is first to transform the scalar simplex map on a
scalar triangle map. This map has to be changed each time
the number of iso-surfaces is changed.
*/
if
(
v
->
NbSS
&&
v
->
DrawTetrahedra
&&
v
->
DrawScalars
){
if
(
v
->
NbSS
&&
v
->
DrawTetrahedra
&&
v
->
DrawScalars
){
nb
=
List_Nbr
(
v
->
SS
)
/
v
->
NbSS
;
nb
=
List_Nbr
(
v
->
SS
)
/
v
->
NbSS
;
if
(
v
->
Light
&&
v
->
SmoothNormals
){
//two passes
if
(
v
->
Light
&&
v
->
SmoothNormals
){
//two passes
for
(
i
=
0
;
i
<
List_Nbr
(
v
->
SS
)
;
i
+=
nb
)
if
(
v
->
Changed
){
Draw_ScalarTetrahedron
(
v
,
1
,
ValMin
,
ValMax
,
Raise
,
Msg
(
DEBUG
,
"Preprocessing of tets normals in view %d"
,
v
->
Num
);
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
),
for
(
i
=
0
;
i
<
List_Nbr
(
v
->
SS
)
;
i
+=
nb
)
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
+
4
),
Draw_ScalarTetrahedron
(
v
,
1
,
ValMin
,
ValMax
,
Raise
,
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
+
8
),
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
),
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
+
12
));
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
+
4
),
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
+
8
),
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
+
12
));
}
for
(
i
=
0
;
i
<
List_Nbr
(
v
->
SS
)
;
i
+=
nb
)
for
(
i
=
0
;
i
<
List_Nbr
(
v
->
SS
)
;
i
+=
nb
)
Draw_ScalarTetrahedron
(
v
,
0
,
ValMin
,
ValMax
,
Raise
,
Draw_ScalarTetrahedron
(
v
,
0
,
ValMin
,
ValMax
,
Raise
,
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
),
(
double
*
)
List_Pointer_Fast
(
v
->
SS
,
i
),
...
@@ -372,10 +369,9 @@ void Draw_Post (void) {
...
@@ -372,10 +369,9 @@ void Draw_Post (void) {
}
}
if
(
CTX
.
display_lists
){
if
(
CTX
.
display_lists
)
glEndList
();
glEndList
();
v
->
Changed
=
0
;
v
->
Changed
=
0
;
}
if
(
v
->
ShowElement
||
v
->
ArrowType
==
DRAW_POST_DISPLACEMENT
)
if
(
v
->
ShowElement
||
v
->
ArrowType
==
DRAW_POST_DISPLACEMENT
)
glDisable
(
GL_POLYGON_OFFSET_FILL
)
;
glDisable
(
GL_POLYGON_OFFSET_FILL
)
;
...
@@ -386,7 +382,7 @@ void Draw_Post (void) {
...
@@ -386,7 +382,7 @@ void Draw_Post (void) {
}
}
/
* revenir au shading par defaut, pour l'echelle */
/
/ go back to default shading for the scale
InitNoShading
();
InitNoShading
();
}
}
...
...
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