summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2009-06-18 21:12:54 (GMT)
committer Don Pellegrino <don@drexel.edu>2009-06-18 21:12:54 (GMT)
commit4914750f48517cd076600d7e209a8da391a3be59 (patch) (side-by-side diff)
treea816e91fcf68971b788d323325be4638913cf2ba
parent816589d55b274c58425900e7cafd0288fe85c861 (diff)
downloadexp005-4914750f48517cd076600d7e209a8da391a3be59.zip
exp005-4914750f48517cd076600d7e209a8da391a3be59.tar.gz
exp005-4914750f48517cd076600d7e209a8da391a3be59.tar.bz2
Implemented zooming.
-rw-r--r--src/model/selection_info.h41
-rw-r--r--src/model/selection_info_init.c12
-rw-r--r--src/model/selection_info_init.h8
-rw-r--r--src/model/selection_purposes.h17
-rw-r--r--src/model/zoom_info.h21
-rw-r--r--src/model/zoom_info_init.c9
-rw-r--r--src/model/zoom_info_init.h8
7 files changed, 116 insertions, 0 deletions
diff --git a/src/model/selection_info.h b/src/model/selection_info.h
new file mode 100644
index 0000000..970ecec
--- a/dev/null
+++ b/src/model/selection_info.h
@@ -0,0 +1,41 @@
+#ifndef SELECTION_INFO_H
+#define SELECTION_INFO_H
+
+#include "selection_purposes.h"
+#include <stdbool.h>
+
+/*
+ * Vertices in the graph.
+ */
+#define ROWS 83905
+
+typedef struct {
+
+ /*
+ * Selection list.
+ */
+ bool set[ROWS];
+
+ /*
+ * A selection is being performed.
+ */
+ bool active;
+
+ /*
+ * Indicate if the user is currently defining a selection.
+ */
+ SELECTION_PURPOSES purpose;
+
+ /*
+ * X coordinate of mouse when selection mode initiated.
+ */
+ int x;
+
+ /*
+ * Y coordinate of mouse when selection mode initiated.
+ */
+ int y;
+
+} SELECTION_INFO;
+
+#endif // SELECTION_INFO_H
diff --git a/src/model/selection_info_init.c b/src/model/selection_info_init.c
new file mode 100644
index 0000000..e01b2b8
--- a/dev/null
+++ b/src/model/selection_info_init.c
@@ -0,0 +1,12 @@
+#include "selection_info_init.h"
+
+void
+selection_info_init (SELECTION_INFO* s)
+{
+ s->active = false;
+ s->purpose = SET;
+ s->x = 0;
+ s->y = 0;
+
+ return;
+}
diff --git a/src/model/selection_info_init.h b/src/model/selection_info_init.h
new file mode 100644
index 0000000..8ce56c5
--- a/dev/null
+++ b/src/model/selection_info_init.h
@@ -0,0 +1,8 @@
+#ifndef SELECTION_INFO_INIT_H
+#define SELECTION_INFO_INIT_H
+
+#include "selection_info.h"
+
+void selection_info_init (SELECTION_INFO* s);
+
+#endif // SELECTION_INFO_INIT_H
diff --git a/src/model/selection_purposes.h b/src/model/selection_purposes.h
new file mode 100644
index 0000000..12d6ec7
--- a/dev/null
+++ b/src/model/selection_purposes.h
@@ -0,0 +1,17 @@
+#ifndef SELECTION_PURPOSES_H
+#define SELECTION_PURPOSES_H
+
+typedef enum
+ {
+ /*
+ * The selection will define a new set.
+ */
+ SET,
+
+ /*
+ * The selection will define a zoom region.
+ */
+ ZOOM
+ } SELECTION_PURPOSES;
+
+#endif // SELECTION_PURPOSES_H
diff --git a/src/model/zoom_info.h b/src/model/zoom_info.h
new file mode 100644
index 0000000..0b935c8
--- a/dev/null
+++ b/src/model/zoom_info.h
@@ -0,0 +1,21 @@
+#ifndef ZOOM_INFO_H
+#define ZOOM_INFO_H
+
+#include <stdbool.h>
+
+/*
+ * Maintain information for zooming.
+ */
+typedef struct {
+ /*
+ * A zoomed region has been selection.
+ */
+ bool active;
+
+ /*
+ * Left, right, bottom and top of zoom region in world coordinates.
+ */
+ double coords[4];
+} ZOOM_INFO;
+
+#endif // ZOOM_INFO_H
diff --git a/src/model/zoom_info_init.c b/src/model/zoom_info_init.c
new file mode 100644
index 0000000..c5a3b1d
--- a/dev/null
+++ b/src/model/zoom_info_init.c
@@ -0,0 +1,9 @@
+#include "zoom_info_init.h"
+
+void
+zoom_info_init (ZOOM_INFO* z)
+{
+ z->active = false;
+
+ return;
+}
diff --git a/src/model/zoom_info_init.h b/src/model/zoom_info_init.h
new file mode 100644
index 0000000..262d408
--- a/dev/null
+++ b/src/model/zoom_info_init.h
@@ -0,0 +1,8 @@
+#ifndef ZOOM_INFO_INIT_H
+#define ZOOM_INFO_INIT_H
+
+#include "zoom_info.h"
+
+void zoom_info_init (ZOOM_INFO* z);
+
+#endif // ZOOM_INFO_INIT_H

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.