19 #ifndef GEOS_IDX_QUADTREE_NODEBASE_H
20 #define GEOS_IDX_QUADTREE_NODEBASE_H
22 #include <geos/export.h>
29 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
55 class GEOS_DLL NodeBase {
59 void visitItems(
const geom::Envelope* searchEnv,
60 ItemVisitor& visitor);
64 static int getSubnodeIndex(
const geom::Envelope* env,
65 const geom::Coordinate& centre);
71 std::vector<void*>& getItems();
78 std::vector<void*>& addAllItems(std::vector<void*>& resultItems)
const;
80 virtual void addAllItemsFromOverlapping(
const geom::Envelope& searchEnv,
81 std::vector<void*>& resultItems)
const;
83 unsigned int depth()
const;
87 size_t getNodeCount()
const;
89 virtual std::string toString()
const;
91 virtual void visit(
const geom::Envelope* searchEnv, ItemVisitor& visitor);
100 bool remove(
const geom::Envelope* itemEnv,
void* item);
102 bool hasItems()
const;
104 bool hasChildren()
const;
106 bool isPrunable()
const;
111 std::vector<void*> items;
123 std::array<Node*, 4> subnodes;
125 virtual bool isSearchMatch(
const geom::Envelope& searchEnv)
const = 0;
132 NodeBase::hasChildren()
const
134 for(
const auto& subnode :
subnodes) {
135 if(subnode !=
nullptr) {
144 NodeBase::isPrunable()
const
146 return !(hasChildren() || hasItems());
150 NodeBase::hasItems()
const
152 return !
items.empty();
163 #endif // GEOS_IDX_QUADTREE_NODEBASE_H