DisjointRectSet.h 488 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <AK/Vector.h>
  3. #include <SharedGraphics/Rect.h>
  4. class DisjointRectSet {
  5. public:
  6. DisjointRectSet() { }
  7. ~DisjointRectSet() { }
  8. DisjointRectSet(DisjointRectSet&& other) : m_rects(move(other.m_rects)) { }
  9. void add(const Rect&);
  10. void clear() { m_rects.clear(); }
  11. void clear_with_capacity() { m_rects.clear_with_capacity(); }
  12. const Vector<Rect>& rects() const { return m_rects; }
  13. private:
  14. void shatter();
  15. Vector<Rect> m_rects;
  16. };