/*protected*/ void AbstractSTRtree::query(const void* searchBounds, const AbstractNode& node, ItemVisitor& visitor) { const BoundableList& boundables = *(node.getChildBoundables()); for (BoundableList::const_iterator i=boundables.begin(), e=boundables.end(); i!=e; i++) { const Boundable* childBoundable = *i; if (!getIntersectsOp()->intersects(childBoundable->getBounds(), searchBounds)) { continue; } if(const AbstractNode *an=dynamic_cast<const AbstractNode*>(childBoundable)) { query(searchBounds, *an, visitor); } else if (const ItemBoundable *ib=dynamic_cast<const ItemBoundable *>(childBoundable)) { visitor.visitItem(ib->getItem()); } else { assert(0); // unsupported childBoundable type } } }
void TexToolItem::foreachItem(ItemVisitor& visitor) { for (std::size_t i = 0; i < _children.size(); i++) { // Visit the children visitor.visit(_children[i]); // Propagate the visitor class down the hierarchy _children[i]->foreachItem(visitor); } }
/*private*/ void NodeBase::visitItems(const Envelope* searchEnv, ItemVisitor& visitor) { // would be nice to filter items based on search envelope, but can't // until they contain an envelope for (vector<void*>::iterator i=items->begin(), e=items->end(); i!=e; i++) { visitor.visitItem(*i); } }
/*private*/ void NodeBase::visitItems(const Envelope* searchEnv, ItemVisitor& visitor) { ::geos::ignore_unused_variable_warning(searchEnv); // would be nice to filter items based on search envelope, but can't // until they contain an envelope for(auto& item : items) { visitor.visitItem(item); } }
void AbstractSTRtree::iterate(ItemVisitor& visitor) { for (BoundableList::const_iterator i=itemBoundables->begin(), e=itemBoundables->end(); i!=e; i++) { const Boundable* boundable = *i; if (const ItemBoundable *ib=dynamic_cast<const ItemBoundable *>(boundable)) { visitor.visitItem(ib->getItem()); } } }
/*private*/ void NodeBase::visitItems(const Envelope* searchEnv, ItemVisitor& visitor) { ::geos::ignore_unused_variable_warning(searchEnv); // would be nice to filter items based on search envelope, but can't // until they contain an envelope for (vector<void*>::iterator i=items.begin(), e=items.end(); i!=e; i++) { visitor.visitItem(*i); } }
void EditableTextItem::accept(const ItemVisitor& visitor) { visitor.visit(this); }
virtual void accept(ItemVisitor& visitor) { visitor.visit(*this); }