~ubuntu-branches/debian/experimental/inkscape/experimental

« back to all changes in this revision

Viewing changes to src/2geom/quadtree.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <vector>
 
2
#include <cassert>
 
3
 
 
4
class Quad{
 
5
public:
 
6
    Quad* children[4];
 
7
    std::vector<int> data;
 
8
    Quad() {
 
9
        for(int i = 0; i < 4; i++)
 
10
            children[i] = 0;
 
11
    }
 
12
    typedef std::vector<int>::iterator iterator;
 
13
};
 
14
 
 
15
class QuadTree{
 
16
public:
 
17
    Quad* root;
 
18
    double scale;
 
19
    double bx0, bx1;
 
20
    double by0, by1;
 
21
 
 
22
    QuadTree() : root(0), scale(1) {}
 
23
 
 
24
    Quad* search(double x0, double y0, double x1, double y1);
 
25
    void insert(double x0, double y0, double x1, double y1, int shape);
 
26
    void erase(Quad *q, int shape);
 
27
};
 
28
 
 
29
 
 
30
/*
 
31
  Local Variables:
 
32
  mode:c++
 
33
  c-file-style:"stroustrup"
 
34
  c-file-offsets:((innamespace . 0)(substatement-open . 0))
 
35
  indent-tabs-mode:nil
 
36
  c-brace-offset:0
 
37
  fill-column:99
 
38
  End:
 
39
  vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
 
40
*/
 
41