-rw-r--r-- | src/controller/callbacks/keyboard.c | 8 | ||||
-rw-r--r-- | src/controller/callbacks/reshape.c | 1 | ||||
-rw-r--r-- | src/model/state/state.h | 5 | ||||
-rw-r--r-- | src/view/geometry.c | 6 | ||||
-rw-r--r-- | src/view/init.c | 1 |
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. |