From 4914750f48517cd076600d7e209a8da391a3be59 Mon Sep 17 00:00:00 2001 From: Don Pellegrino Date: Thu, 18 Jun 2009 21:12:54 +0000 Subject: Implemented zooming. --- 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 + +/* + * 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 + +/* + * 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 -- cgit v0.8.3.1-22-g547a