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); }
inline bool operator==(const Bounds& lhs, const Bounds& rhs) { return lhs.min() == rhs.min() && lhs.max() == rhs.max(); }
Bounds intersection(const Bounds& b) const { return Bounds(Point::max(min(), b.min()), Point::min(max(), b.max())); }
void Bounds::shrink(const Bounds& other) { m_min = Point::max(m_min, other.min()); m_max = Point::min(m_max, other.max()); setMid(); }
void Bounds::grow(const Bounds& other) { grow(other.min()); grow(other.max()); }