17#include <geos/index/strtree/TemplateSTRNode.h>
24template<
typename ItemType,
typename BoundsTraits,
typename ItemDistance>
25class TemplateSTRNodePair {
27 using Node = TemplateSTRNode<ItemType, BoundsTraits>;
29 TemplateSTRNodePair(
const Node &node1,
const Node &node2, ItemDistance&
id)
30 : m_node1(&node1), m_node2(&node2), m_distance(distance(id)) {}
32 bool isLeaves()
const {
33 return getFirst().isLeaf() && getSecond().isLeaf();
36 double getDistance()
const {
40 std::pair<ItemType, ItemType> getItems()
const {
42 return std::make_pair(getFirst().getItem(), getSecond().getItem());
45 const Node &getFirst()
const {
49 const Node &getSecond()
const {
53 double distance(ItemDistance&
id) {
55 return id(getFirst().getItem(), getSecond().getItem());
57 return BoundsTraits::distance(getFirst().getBounds(), getSecond().getBounds());
61 double maximumDistance() {
62 return BoundsTraits::maxDistance(getFirst().getBounds(), getSecond().getBounds());
Basic namespace for all GEOS functionalities.
Definition geos.h:39