17 #include <geos/export.h>
19 #include <geos/index/strtree/AbstractNode.h>
56 ItemsListItem(
void* item_)
61 ItemsListItem(ItemsList* item_)
76 assert(t == item_is_geometry);
82 assert(t == item_is_list);
93 class ItemsList :
public std::vector<ItemsListItem> {
95 typedef std::vector<ItemsListItem> base_type;
98 delete_item(ItemsListItem& item)
100 if(ItemsListItem::item_is_list == item.t) {
108 std::for_each(begin(), end(), &ItemsList::delete_item);
113 push_back(
void* item)
115 this->base_type::push_back(ItemsListItem(item));
120 push_back_owned(ItemsList* itemList)
122 this->base_type::push_back(ItemsListItem(itemList));
158 std::unique_ptr<BoundableList> sortBoundablesY(
const BoundableList* input);
160 bool remove(
const void* searchBounds,
AbstractNode& node,
void* item);
186 const void* bBounds) = 0;
194 std::vector <AbstractNode*>* nodes;
209 assert(!nodeList->empty());
222 virtual void insert(
const void* bounds,
void* item);
225 void query(
const void* searchBounds, std::vector<void*>& foundItems);
233 bool remove(
const void* itemEnv,
void* item);
235 std::unique_ptr<BoundableList> boundablesAtLevel(
int level);
238 std::size_t nodeCapacity;
260 nodeCapacity(newNodeCapacity)
262 assert(newNodeCapacity > 1);
286 virtual void query(
const void* searchBounds,
const AbstractNode* node, std::vector<void*>* matches);
A visitor for items in an index.
Definition: ItemVisitor.h:28
A node of the STR tree.
Definition: AbstractNode.h:43
A test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have diff...
Definition: AbstractSTRtree.h:175
virtual bool intersects(const void *aBounds, const void *bBounds)=0
Base class for STRtree and SIRtree.
Definition: AbstractSTRtree.h:138
void iterate(ItemVisitor &visitor)
virtual void insert(const void *bounds, void *item)
Also builds the tree, if necessary.
void query(const void *searchBounds, ItemVisitor &visitor)
Also builds the tree, if necessary.
AbstractSTRtree(std::size_t newNodeCapacity)
Constructs an AbstractSTRtree with the specified maximum number of child nodes that a node may have.
Definition: AbstractSTRtree.h:255
bool remove(const void *itemEnv, void *item)
Also builds the tree, if necessary.
void query(const void *searchBounds, std::vector< void * > &foundItems)
Also builds the tree, if necessary.
virtual std::size_t getNodeCapacity()
Returns the maximum number of child nodes that a node may have.
Definition: AbstractSTRtree.h:281
virtual IntersectsOp * getIntersectsOp()=0
virtual std::unique_ptr< BoundableList > createParentBoundables(BoundableList *childBoundables, int newLevel)
Sorts the childBoundables then divides them into groups of size M, where M is the node capacity.
virtual void boundablesAtLevel(int level, AbstractNode *top, BoundableList *boundables)
ItemsList * itemsTree()
Gets a tree structure (as a nested list) corresponding to the structure of the items and nodes in thi...
virtual void build()
Creates parent nodes, grandparent nodes, and so forth up to the root node, for the data that has been...
std::vector< Boundable * > BoundableList
A list of boundables. TODO: use a list.
Definition: AbstractSTRtree.h:43
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25