15 #ifndef GEOS_INDEX_STRTREE_ABSTRACTSTRTREE_H
16 #define GEOS_INDEX_STRTREE_ABSTRACTSTRTREE_H
18 #include <geos/export.h>
20 #include <geos/index/strtree/AbstractNode.h>
58 ItemsListItem(
void* item_)
63 ItemsListItem(ItemsList* item_)
78 assert(t == item_is_geometry);
84 assert(t == item_is_list);
95 class ItemsList :
public std::vector<ItemsListItem> {
97 typedef std::vector<ItemsListItem> base_type;
100 delete_item(ItemsListItem& item)
102 if(ItemsListItem::item_is_list == item.t) {
110 std::for_each(begin(), end(), &ItemsList::delete_item);
115 push_back(
void* item)
117 this->base_type::push_back(ItemsListItem(item));
122 push_back_owned(ItemsList* itemList)
124 this->base_type::push_back(ItemsListItem(itemList));
144 BoundableList* itemBoundables;
157 BoundableList* boundablesOfALevel,
160 virtual std::unique_ptr<BoundableList> sortBoundables(
const BoundableList* input) = 0;
162 bool remove(
const void* searchBounds,
AbstractNode& node,
void* item);
184 virtual bool intersects(
const void* aBounds,
185 const void* bBounds) = 0;
193 std::vector <AbstractNode*>* nodes;
202 virtual std::unique_ptr<BoundableList> createParentBoundables(
203 BoundableList* childBoundables,
int newLevel);
206 lastNode(BoundableList* nodeList)
208 assert(!nodeList->empty());
221 virtual void insert(
const void* bounds,
void* item);
224 void query(
const void* searchBounds, std::vector<void*>& foundItems);
229 query(
const void* searchBounds)
231 vector<void*>* matches =
new vector<void*>();
232 query(searchBounds, *matches);
236 void query(
const void* searchBounds, ItemVisitor& visitor);
239 void query(
const void* searchBounds,
const AbstractNode& node, ItemVisitor& visitor);
242 bool remove(
const void* itemEnv,
void* item);
244 std::unique_ptr<BoundableList> boundablesAtLevel(
int level);
247 std::size_t nodeCapacity;
255 virtual IntersectsOp* getIntersectsOp() = 0;
267 itemBoundables(new BoundableList()),
269 nodeCapacity(newNodeCapacity)
271 assert(newNodeCapacity > 1);
275 compareDoubles(
double a,
double b)
281 return (a < b) ?
true :
false;
284 virtual ~AbstractSTRtree();
292 virtual void build();
303 virtual void query(
const void* searchBounds,
const AbstractNode* node, std::vector<void*>* matches);
315 virtual void boundablesAtLevel(
int level,
AbstractNode* top,
316 BoundableList* boundables);
332 ItemsList* itemsTree();
340 #endif // GEOS_INDEX_STRTREE_ABSTRACTSTRTREE_H
virtual std::size_t getNodeCapacity()
Definition: AbstractSTRtree.h:298
Base class for STRtree and SIRtree.
Definition: AbstractSTRtree.h:140
AbstractSTRtree(std::size_t newNodeCapacity)
Definition: AbstractSTRtree.h:264
A test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have diff...
Definition: AbstractSTRtree.h:174
A visitor for items in an index.
Definition: ItemVisitor.h:29
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
A node of the STR tree.
Definition: AbstractNode.h:43
std::vector< Boundable * > BoundableList
A list of boundables. TODO: use a list.
Definition: AbstractSTRtree.h:44