1 | #include <fastuidraw/util/util.hpp> |
---|---|
2 | #include <fastuidraw/util/fastuidraw_memory.hpp> |
3 | #include <vector> |
4 | |
5 | #include "bounding_box.hpp" |
6 | |
7 | #ifndef FASTUIDRAW_DEMO_GENERIC_HIERARCHY_HPP |
8 | #define FASTUIDRAW_DEMO_GENERIC_HIERARCHY_HPP |
9 | |
10 | class GenericHierarchy:fastuidraw::noncopyable |
11 | { |
12 | public: |
13 | enum |
14 | { |
15 | not_found = ~0u |
16 | }; |
17 | |
18 | explicit |
19 | GenericHierarchy(const BoundingBox<float> &bbox); |
20 | |
21 | ~GenericHierarchy(); |
22 | |
23 | void |
24 | add(const BoundingBox<float> &bbox, unsigned int reference); |
25 | |
26 | void |
27 | query(const BoundingBox<float> &bbox, std::vector<unsigned int> *output); |
28 | |
29 | unsigned int |
30 | query(const fastuidraw::vec2 &p, BoundingBox<float> *out_bb); |
31 | |
32 | private: |
33 | void *m_root; |
34 | }; |
35 | |
36 | #endif |
37 |