improved window slot identification vs plot - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/window-cpp.h
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2010年08月19日 00:19:58 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2010年08月19日 00:19:58 +0200
commitbef124c9c9e081062a457f6d0b2ab1eda6283a3e (patch)
tree5a757e1c2a84900feb642a9790dad5d61f870509 /agg-plot/window-cpp.h
parent7cdb95a74e7f352620cd500940b73bf221f9e91a (diff)
downloadgsl-shell-bef124c9c9e081062a457f6d0b2ab1eda6283a3e.tar.gz
improved window slot identification vs plot
The code to generate a tree, to parse a split spec and to store window plot tree information is now factored. Now each plot area get a slot_id and redraw is made only in the region when required.
Diffstat (limited to 'agg-plot/window-cpp.h')
-rw-r--r--agg-plot/window-cpp.h 36
1 files changed, 25 insertions, 11 deletions
diff --git a/agg-plot/window-cpp.h b/agg-plot/window-cpp.h
index ede02c45..be6a8f92 100644
--- a/agg-plot/window-cpp.h
+++ b/agg-plot/window-cpp.h
@@ -14,27 +14,39 @@ extern "C" {
#include "agg_color_rgba.h"
#include "agg_trans_affine.h"
-#include "split-spec-parser.h"
+#include "split-parser.h"
class window : public canvas_window {
+public:
typedef plot<drawable, lua_management> plot_type;
+ typedef agg::trans_affine bmatrix;
+
struct ref {
+ typedef tree::node<ref, direction_e> node;
+
plot_type *plot;
- int id;
+ int plot_id;
+ int slot_id;
- ref() : plot(0), id(-1) {};
- ref(plot_type *p, int _id) : plot(p), id(_id) {};
- };
+ bmatrix matrix;
- typedef split::node<ref> node_type;
- typedef split::node<ref>::list list_type;
+ ref() : plot(0), plot_id(-1), matrix() {};
+ ref(plot_type *p, int _id) : plot(p), plot_id(_id), matrix() {};
- node_type* m_tree;
+ static void compose(bmatrix& a, const bmatrix& b);
+ static int calculate(node *t, const bmatrix& m, int id);
+ };
+
+private:
+ void clear_box(const agg::trans_affine& box_mtx);
+ void draw_rec(ref::node *n);
+ void cleanup_tree_rec (lua_State *L, int window_index, ref::node* n);
- void draw_rec(node_type *n);
- void cleanup_tree_rec (lua_State *L, int window_index, node_type* n);
+ static ref *ref_lookup (ref::node *p, int slot_id);
+ ref::node* m_tree;
+
public:
window(agg::rgba& bgcol) : canvas_window(bgcol), m_tree(0)
{
@@ -46,13 +58,15 @@ public:
static window *check (lua_State *L, int index);
void split(const char *spec);
- int attach(lua_plot *plot, const char *spec, int id);
+ int attach(lua_plot *plot, const char *spec, int plot_id, int& slot_id);
void cleanup_refs(lua_State *L, int window_index)
{
cleanup_tree_rec (L, window_index, m_tree);
};
+ void draw_slot(int slot_id);
+
void on_draw_unprotected();
virtual void on_draw();
};
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月12日 14:30:17 +0000

AltStyle によって変換されたページ (->オリジナル) /