summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@coffee.donpellegrino.com>2009-09-03 01:42:37 (GMT)
committer Don Pellegrino <don@coffee.donpellegrino.com>2009-09-03 01:42:37 (GMT)
commit5e092a18b061cde68430f1b2bf4457d1e5e8b0fb (patch) (unidiff)
treeb7d812123e80f639f368dfa24289201fba61404e
parent1ed5cbf07842cfeffd45352d4345b021a9efd848 (diff)
downloadexp005-5e092a18b061cde68430f1b2bf4457d1e5e8b0fb.zip
exp005-5e092a18b061cde68430f1b2bf4457d1e5e8b0fb.tar.gz
exp005-5e092a18b061cde68430f1b2bf4457d1e5e8b0fb.tar.bz2
Shell for development of the datarose geometry.
-rw-r--r--src/model/geometry/datarose_geometry.c54
-rw-r--r--src/model/geometry/datarose_geometry.h11
2 files changed, 65 insertions, 0 deletions
diff --git a/src/model/geometry/datarose_geometry.c b/src/model/geometry/datarose_geometry.c
new file mode 100644
index 0000000..dded424
--- a/dev/null
+++ b/src/model/geometry/datarose_geometry.c
@@ -0,0 +1,54 @@
1#include "datarose_geometry.h"
2#include "../../util/check_error.h"
3#include "../../view/state0.h"
4#include <GL/glut.h>
5
6#define S state0
7
8void
9datarose_geometry (void)
10{
11 glNewList (S.list_offset + DATAROSE_GEOMETRY, GL_COMPILE);
12 glPolygonMode (GL_FRONT, GL_FILL);
13 glColor4f (DEFAULT_COLOR_R, DEFAULT_COLOR_G, DEFAULT_COLOR_B,
14 DEFAULT_COLOR_A);
15
16 /*
17 * The size of the rose will be a percentage of the world height so
18 * that it remains a fixed size when the window is resized or
19 * zoomed.
20 */
21 GLint viewport[4];
22 glGetIntegerv (GL_VIEWPORT, viewport);
23 const double *top = &S.ortho.max_y;
24 const double *bottom = &S.ortho.min_y;
25 double rose_radius = (*top - *bottom) / viewport[3] * 110.0;
26
27 /*
28 * Place the rose in the upper right of the display.
29 */
30 glMatrixMode (GL_MODELVIEW);
31 glPushMatrix ();
32 glLoadIdentity ();
33 const double *right = &S.ortho.max_x;
34 glTranslatef (*right - rose_radius - (rose_radius * 0.40),
35 *top - rose_radius - (rose_radius * 0.80),
36 0.0);
37
38 /*
39 * Create a circle.
40 */
41 GLUquadricObj *obj = gluNewQuadric ();
42 gluQuadricDrawStyle (obj, GLU_LINE);
43 gluDisk (obj, rose_radius * 0.999, rose_radius, 60, 60);
44
45 glPopMatrix ();
46
47 glEndList ();
48
49 gluDeleteQuadric (obj);
50
51 check_error (__FILE__, __LINE__);
52
53 return;
54}
diff --git a/src/model/geometry/datarose_geometry.h b/src/model/geometry/datarose_geometry.h
new file mode 100644
index 0000000..0823064
--- a/dev/null
+++ b/src/model/geometry/datarose_geometry.h
@@ -0,0 +1,11 @@
1#ifndef DATAROSE_GEOMETRY_H
2#define DATAROSE_GEOMETRY_H
3
4/*
5 * DataRose from Elmqvist, N.; Stasko, J. & Tsigas, P. "DataMeadow: a
6 * visual canvas for analysis of large-scale multivariate data",
7 * Information Visualization, Palgrave Macmillan Ltd, 2008, 7, 18-33.
8 */
9void datarose_geometry (void);
10
11#endif // DATAROSE_GEOMETRY_H

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.