summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@coffee.donpellegrino.com>2009-12-04 14:57:32 (GMT)
committer Don Pellegrino <don@coffee.donpellegrino.com>2009-12-04 14:57:32 (GMT)
commit59475bbfa700f83ad1ef12d79ce0ec96867d2345 (patch) (side-by-side diff)
treef551f9f740da1ce0a2a1b9256341ce9aac8f3c17
parent708bb6abd3ad7c0401a2db115dc767807173639c (diff)
downloadexp005-59475bbfa700f83ad1ef12d79ce0ec96867d2345.zip
exp005-59475bbfa700f83ad1ef12d79ce0ec96867d2345.tar.gz
exp005-59475bbfa700f83ad1ef12d79ce0ec96867d2345.tar.bz2
Added a feature to toggle display the datarose geometry by keyboard input.
-rw-r--r--src/controller/callbacks/keyboard.c8
-rw-r--r--src/controller/callbacks/reshape.c1
-rw-r--r--src/model/state/state.h5
-rw-r--r--src/view/geometry.c6
-rw-r--r--src/view/init.c1
5 files changed, 20 insertions, 1 deletions
diff --git a/src/controller/callbacks/keyboard.c b/src/controller/callbacks/keyboard.c
index a74ac7b..d657053 100644
--- a/src/controller/callbacks/keyboard.c
+++ b/src/controller/callbacks/keyboard.c
@@ -22,6 +22,14 @@ keyboard (unsigned char key, int x, int y)
glutPostRedisplay ();
break;
+ case 'd':
+ /*
+ * Toggle display of the datarose.
+ */
+ S.datarose = !S.datarose;
+ glutPostRedisplay ();
+ break;
+
case 'g':
/*
* g has been pressed. This is used to load a selection from
diff --git a/src/controller/callbacks/reshape.c b/src/controller/callbacks/reshape.c
index 67210c5..99557b7 100644
--- a/src/controller/callbacks/reshape.c
+++ b/src/controller/callbacks/reshape.c
@@ -1,3 +1,4 @@
+#include "../../model/geometry/datarose_geometry.h"
#include "../../model/geometry/density_legend_geometry.h"
#include "../../view/state0.h"
#include "../actions/set_ortho.h"
diff --git a/src/model/state/state.h b/src/model/state/state.h
index ba6d7ab..6e4f62e 100644
--- a/src/model/state/state.h
+++ b/src/model/state/state.h
@@ -108,6 +108,11 @@ typedef struct
*/
bool legend;
+ /*
+ * Display data rose.
+ */
+ bool datarose;
+
} STATE;
#endif // STATE_H
diff --git a/src/view/geometry.c b/src/view/geometry.c
index fc09ee0..3fe92b0 100644
--- a/src/view/geometry.c
+++ b/src/view/geometry.c
@@ -30,7 +30,11 @@ geometry (GLenum mode)
if (S.legend)
glCallList (S.list_offset + DENSITY_LEGEND_GEOMETRY);
- glCallList (S.list_offset + DATAROSE_GEOMETRY);
+ /*
+ * Draw the data rose.
+ */
+ if (S.datarose)
+ glCallList (S.list_offset + DATAROSE_GEOMETRY);
return;
}
diff --git a/src/view/init.c b/src/view/init.c
index 47e8ffa..f1c1bce 100644
--- a/src/view/init.c
+++ b/src/view/init.c
@@ -27,6 +27,7 @@ init (void)
zoom_info_init (&S.zoom);
pan_info_init (&S.pan);
S.legend = true;
+ S.datarose = false;
/*
* Load the data.

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.