61 static constexpr std::size_t NODE_CAPACITY = 16;
65 std::vector<bool> removedItems;
66 std::vector<std::size_t> levelOffset;
67 std::size_t nodeCapacity = NODE_CAPACITY;
68 std::vector<Envelope> bounds;
85 std::vector<std::size_t> computeLevelOffsets();
87 static std::size_t ceilDivisor(std::size_t num, std::size_t denom);
88 static std::size_t clampMax(std::size_t x, std::size_t max);
90 std::size_t levelNodeCount(std::size_t numNodes);
92 std::vector<Envelope> createBounds();
94 void fillItemBounds(std::vector<Envelope>& bounds);
95 void fillLevelBounds(std::size_t lvl, std::vector<Envelope>& bounds);
97 static Envelope computeNodeEnvelope(
const std::vector<Envelope>& bounds,
98 std::size_t start, std::size_t end);
100 std::size_t start, std::size_t end);
102 void queryNode(
const Envelope& queryEnv,
103 std::size_t level, std::size_t nodeIndex,
104 std::vector<std::size_t>& result)
const;
105 void queryNodeRange(
const Envelope& queryEnv,
106 std::size_t level, std::size_t nodeStartIndex,
107 std::vector<std::size_t>& result)
const;
108 void queryItemRange(
const Envelope& queryEnv, std::size_t itemIndex,
109 std::vector<std::size_t>& result)
const;
111 std::size_t levelSize(std::size_t level)
const;
112 bool isNodeEmpty(std::size_t level, std::size_t index);
113 bool isItemsNodeEmpty(std::size_t nodeIndex);
126 std::vector<Envelope> getBounds();
143 void query(
const Envelope& queryEnv, std::vector<std::size_t>& result)
const;