Beispiel #1
0
ChunkReader::QueryRange ChunkReader::candidates(const Bounds& queryBounds) const
{
    if (queryBounds.contains(m_bounds))
    {
        return QueryRange(m_points.begin(), m_points.end());
    }

    const auto& gb(m_metadata.boundsScaledCubic());
    const PointInfo min(Tube::calcTick(queryBounds.min(), gb, m_depth));
    const PointInfo max(Tube::calcTick(queryBounds.max(), gb, m_depth));

    It begin(std::lower_bound(m_points.begin(), m_points.end(), min));
    It end(std::upper_bound(m_points.begin(), m_points.end(), max));

    return QueryRange(begin, end);
}
Beispiel #2
0
inline bool operator==(const Bounds& lhs, const Bounds& rhs)
{
    return lhs.min() == rhs.min() && lhs.max() == rhs.max();
}
Beispiel #3
0
 Bounds intersection(const Bounds& b) const
 {
     return Bounds(Point::max(min(), b.min()), Point::min(max(), b.max()));
 }
Beispiel #4
0
void Bounds::shrink(const Bounds& other)
{
    m_min = Point::max(m_min, other.min());
    m_max = Point::min(m_max, other.max());
    setMid();
}
Beispiel #5
0
void Bounds::grow(const Bounds& other)
{
    grow(other.min());
    grow(other.max());
}