17#include <geos/index/strtree/TemplateSTRNode.h>
23template<
typename ItemType,
typename BoundsTraits,
typename ItemDistance>
24class TemplateSTRNodePair {
26 using Node = TemplateSTRNode<ItemType, BoundsTraits>;
28 TemplateSTRNodePair(
const Node &node1,
const Node &node2, ItemDistance&
id)
29 : m_node1(&node1), m_node2(&node2), m_distance(distance(id)) {}
31 bool isLeaves()
const {
32 return getFirst().isLeaf() && getSecond().isLeaf();
35 double getDistance()
const {
39 std::pair<ItemType, ItemType> getItems()
const {
41 return std::make_pair(getFirst().getItem(), getSecond().getItem());
44 const Node &getFirst()
const {
48 const Node &getSecond()
const {
52 double distance(ItemDistance&
id) {
54 return id(getFirst().getItem(), getSecond().getItem());
56 return BoundsTraits::distance(getFirst().getBounds(), getSecond().getBounds());
Basic namespace for all GEOS functionalities.
Definition: geos.h:39