15 QuadTree(
const double x0,
const double y0,
const double hx,
const double hy);
21 void InsertMeshNode(
const double x,
const double y,
const int index);
30 static std::vector<int> emptyBlock;
37 double m_xmin, m_ymin, m_xmax, m_ymax;
48 std::vector<std::tuple<float, float, int> > nodes;
49 std::vector<int> elements;
51 static const size_t BlockCapacity = 10;
54 bool DoesBoxOverlap(
const double bb[4])
const;
56 int GetQuadrant(
const double x,
const double y)
const;
59 bool IsLeafNode()
const;
62 const QuadTree* GetBlockFromPoint(
const double x,
const double y)
const;
66 const QuadTree* GetBlockFromPointHelper(
const double x,
const double y)
const;
QuadTree(const double x0, const double y0, const double hx, const double hy)
Constructor.
void InsertMeshElement(const double bb[4], const int index)
Insert a mesh element with given bounding box and index to the tree.
void InsertMeshNode(const double x, const double y, const int index)
Insert a mesh node (a vertex/point) to the tree.
const std::vector< int > & GetElementsInBlock(const double x, const double y) const
Get all elements linked to a block corresponding to the given point.