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);
35 double m_xmin, m_ymin, m_xmax, m_ymax;
46 std::vector<std::tuple<float, float, int> > nodes;
47 std::vector<int> elements;
49 static const size_t BlockCapacity = 10;
52 bool DoesBoxOverlap(
const double bb[4])
const;
54 int GetQuadrant(
const double x,
const double y)
const;
57 bool IsLeafNode()
const;
60 const QuadTree* GetBlockFromPoint(
const double x,
const double y)
const;
64 const QuadTree* GetBlockFromPointHelper(
const double x,
const double y)
const;
std::vector< int > GetElementsInBlock(const double x, const double y) const
Get all elements linked to a block corresponding to the given point.
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.