summaryrefslogtreecommitdiffstats
path: root/src/2geom/quadtree.h
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-08-14 20:54:48 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-08-14 20:54:48 +0000
commit55d43e4e27e0ba58a47fad70957dfa989aa173ad (patch)
tree2ccfbac1c50023d08ae32975c876fa2478c1ad2a /src/2geom/quadtree.h
parentFix for bug #1752113; added set_preview_widget_active(false) to FileSaveDialo... (diff)
downloadinkscape-55d43e4e27e0ba58a47fad70957dfa989aa173ad.tar.gz
inkscape-55d43e4e27e0ba58a47fad70957dfa989aa173ad.zip
Commit LivePathEffect branch to trunk!
(disabled extension/internal/bitmap/*.* in build.xml to fix compilation) (bzr r3472)
Diffstat (limited to 'src/2geom/quadtree.h')
-rw-r--r--src/2geom/quadtree.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/2geom/quadtree.h b/src/2geom/quadtree.h
new file mode 100644
index 000000000..ef583c0b5
--- /dev/null
+++ b/src/2geom/quadtree.h
@@ -0,0 +1,41 @@
+#include <vector>
+#include <cassert>
+
+class Quad{
+public:
+ Quad* children[4];
+ std::vector<int> data;
+ Quad() {
+ for(int i = 0; i < 4; i++)
+ children[i] = 0;
+ }
+ typedef std::vector<int>::iterator iterator;
+};
+
+class QuadTree{
+public:
+ Quad* root;
+ double scale;
+ double bx0, bx1;
+ double by0, by1;
+
+ QuadTree() : root(0), scale(1) {}
+
+ Quad* search(double x0, double y0, double x1, double y1);
+ void insert(double x0, double y0, double x1, double y1, int shape);
+ void erase(Quad *q, int shape);
+};
+
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(substatement-open . 0))
+ indent-tabs-mode:nil
+ c-brace-offset:0
+ fill-column:99
+ End:
+ vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
+*/
+