22 #ifndef FIFE_INSTANCETREE_H
23 #define FIFE_INSTANCETREE_H
33 #include "util/base/fifeclass.h"
35 #include "util/structures/quadtree.h"
36 #include "model/metamodel/modelcoords.h"
42 class InstanceTree:
public FifeClass {
44 static const int32_t MIN_TREE_SIZE = 2;
46 typedef std::list<Instance*> InstanceList;
47 typedef QuadTree< InstanceList, MIN_TREE_SIZE > InstanceQuadTree;
48 typedef InstanceQuadTree::Node InstanceTreeNode;
58 virtual ~InstanceTree();
68 void addInstance(Instance* instance);
77 void removeInstance(Instance* instance);
89 void findInstances(
const ModelCoordinate& point, int32_t w, int32_t h, InstanceList& lst);
93 template<
typename Visitor>
void applyVisitor(Visitor& visitor) {
94 m_tree.apply_visitor(visitor);
99 InstanceQuadTree m_tree;
100 std::map<Instance*,InstanceTreeNode*> m_reverse;