X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fquadtree.h;h=e35da2eab45182aba96509edd40f9b6cd3409b9a;hb=fe80b0a479a44182b6e7e982fb6ff33b6e17303d;hp=29d60ba9553dbdf9edbae085f67f08631f3aa3aa;hpb=836513d7874d20bec7247c6dfa8b3d2c426a71d4;p=ipdf%2Fcode.git diff --git a/src/quadtree.h b/src/quadtree.h index 29d60ba..e35da2e 100644 --- a/src/quadtree.h +++ b/src/quadtree.h @@ -13,6 +13,7 @@ namespace IPDF typedef int QuadTreeIndex; static const QuadTreeIndex QUADTREE_EMPTY = -1; + class Document; enum QuadTreeNodeChildren { @@ -39,6 +40,8 @@ namespace IPDF unsigned object_begin; // Last object in the node. unsigned object_end; + // Linked list of "extra" nodes + QuadTreeIndex next_overlay; }; struct QuadTree @@ -46,10 +49,15 @@ namespace IPDF QuadTree() : root_id(QUADTREE_EMPTY) {} QuadTreeIndex root_id; std::vector 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