Compile with float/double again.
[ipdf/code.git] / src / quadtree.h
index 671ee0f..e35da2e 100644 (file)
@@ -6,12 +6,14 @@
 
 
 #include "common.h"
+#include "ipdf.h"
 
 namespace IPDF
 {
 
        typedef int QuadTreeIndex;
        static const QuadTreeIndex QUADTREE_EMPTY = -1;
+       class Document;
 
        enum QuadTreeNodeChildren
        {
@@ -38,13 +40,24 @@ namespace IPDF
                unsigned object_begin;
                // Last object in the node.
                unsigned object_end;
+               // Linked list of "extra" nodes
+               QuadTreeIndex next_overlay;
        };
 
        struct QuadTree
        {
+               QuadTree() : root_id(QUADTREE_EMPTY) {}
                QuadTreeIndex root_id;
                std::vector<QuadTreeNode> nodes;
+
+               QuadTreeIndex GetNeighbour(QuadTreeIndex start, int xdir, int ydir, Document *doc) const;
+
        };
+
+       Rect TransformToQuadChild(const Rect& src, QuadTreeNodeChildren child_type);
+       Rect TransformFromQuadChild(const Rect& src, QuadTreeNodeChildren child_type);
+       bool IntersectsQuadChild(const Rect& src, QuadTreeNodeChildren child_type);
+       bool ContainedInQuadChild(const Rect& src, QuadTreeNodeChildren child_type);
 }
 
 #else

UCC git Repository :: git.ucc.asn.au