BoundablePair.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2016 Daniel Baston
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: index/strtree/BoundablePair.java (JTS-1.14)
*
**********************************************************************/
#pragma once
#include <geos/index/strtree/Boundable.h>
#include <geos/index/strtree/ItemDistance.h>
#include <queue>
namespace geos {
namespace index {
namespace strtree {
class BoundablePair {
private:
const Boundable* boundable1;
const Boundable* boundable2;
ItemDistance* itemDistance;
double mDistance;
public:
struct BoundablePairQueueCompare {
bool
operator()(const BoundablePair* a, const BoundablePair* b)
{
return a->getDistance() > b->getDistance();
}
};
typedef std::priority_queue<BoundablePair*, std::vector<BoundablePair*>, BoundablePairQueueCompare> BoundablePairQueue;
BoundablePair(const Boundable* boundable1, const Boundable* boundable2, ItemDistance* itemDistance);
const Boundable* getBoundable(int i) const;
double distance() const;
double getDistance() const;
bool isLeaves() const;
double maximumDistance();
static bool isComposite(const Boundable* item);
static double area(const Boundable* b);
void expandToQueue(BoundablePairQueue&, double minDistance);
void expand(const Boundable* bndComposite, const Boundable* bndOther, bool isFlipped, BoundablePairQueue& priQ,
double minDistance);
};
}
}
}
geos::index::strtree::BoundablePair::distance
double distance() const
Computes the distance between the Boundables in this pair. The boundables are either composites or le...
geos::index::strtree::BoundablePair::isLeaves
bool isLeaves() const
geos::index::strtree::BoundablePair::maximumDistance
double maximumDistance()
Computes the maximum distance between any two items in the pair of nodes.
geos::index::strtree::BoundablePair::getBoundable
const Boundable * getBoundable(int i) const
geos::index::strtree::BoundablePair::getDistance
double getDistance() const
Gets the minimum possible distance between the Boundables in this pair.
geos::index::strtree::Boundable
A spatial object in an AbstractSTRtree.
Definition Boundable.h:24
geos::index::strtree::ItemDistance
A function method which computes the distance between two ItemBoundables in an STRtree....
Definition ItemDistance.h:33
geos::index::strtree
Contains 2-D and 1-D versions of the Sort-Tile-Recursive (STR) tree, a query-only R-tree.
Definition AbstractNode.h:31
geos::index
Provides classes for various kinds of spatial indexes.
Definition CleanCoverage.h:39
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38