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> 57 ItemsListItem(
void* item_)
62 ItemsListItem(ItemsList* item_)
77 assert(t == item_is_geometry);
83 assert(t == item_is_list);
94 class ItemsList :
public std::vector<ItemsListItem> {
96 typedef std::vector<ItemsListItem> base_type;
99 delete_item(ItemsListItem& item)
101 if(ItemsListItem::item_is_list == item.t) {
109 std::for_each(begin(), end(), &ItemsList::delete_item);
114 push_back(
void* item)
116 this->base_type::push_back(ItemsListItem(item));
121 push_back_owned(ItemsList* itemList)
123 this->base_type::push_back(ItemsListItem(itemList));
159 virtual std::unique_ptr<BoundableList> sortBoundables(
const BoundableList* input) = 0;
161 bool remove(
const void* searchBounds,
AbstractNode& node,
void* item);
183 virtual bool intersects(
const void* aBounds,
184 const void* bBounds) = 0;
192 std::vector <AbstractNode*>* nodes;
201 virtual std::unique_ptr<BoundableList> createParentBoundables(
207 assert(!nodeList->empty());
209 return static_cast<AbstractNode*>(nodeList->back());
220 virtual void insert(
const void* bounds,
void* item);
223 void query(
const void* searchBounds, std::vector<void*>& foundItems);
226 void query(
const void* searchBounds,
ItemVisitor& visitor);
228 void query(
const void* searchBounds,
const AbstractNode& node,
ItemVisitor& visitor);
231 bool remove(
const void* itemEnv,
void* item);
233 std::unique_ptr<BoundableList> boundablesAtLevel(
int level);
236 std::size_t nodeCapacity;
244 virtual IntersectsOp* getIntersectsOp() = 0;
258 nodeCapacity(newNodeCapacity)
260 assert(newNodeCapacity > 1);
264 compareDoubles(
double a,
double b)
270 return (a < b) ? true :
false;
273 virtual ~AbstractSTRtree();
283 virtual void build();
294 virtual void query(
const void* searchBounds,
const AbstractNode* node, std::vector<void*>* matches);
308 virtual void boundablesAtLevel(
int level,
AbstractNode* top,
325 ItemsList* itemsTree();
333 #endif // GEOS_INDEX_STRTREE_ABSTRACTSTRTREE_H virtual std::size_t getNodeCapacity()
Returns the maximum number of child nodes that a node may have.
Definition: AbstractSTRtree.h:289
Base class for STRtree and SIRtree.
Definition: AbstractSTRtree.h:139
AbstractSTRtree(std::size_t newNodeCapacity)
Constructs an AbstractSTRtree with the specified maximum number of child nodes that a node may have.
Definition: AbstractSTRtree.h:253
A test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have diff...
Definition: AbstractSTRtree.h:173
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:44
std::vector< Boundable * > BoundableList
A list of boundables. TODO: use a list.
Definition: AbstractSTRtree.h:44