1#ifndef TETRAHEDRAL_TREE_H
2#define TETRAHEDRAL_TREE_H
12 float x = 0.,
y = 0.,
z = 0.;
15 Vec3(
float _x,
float _y,
float _z) :
x(_x),
y(_y),
z(_z) {}
74 static std::vector<int> emptyBlock;
95 std::vector<std::pair<Vec3, int> > nodes;
96 std::vector<int> elements;
98 static const size_t BlockCapacity = 10;
101 bool DoesBoxOverlap(
const double bb[6])
const;
103 int GetOctantContainingPoint(
const Vec3& point)
const;
106 bool IsLeafNode()
const;
void InsertMeshElement(const double bb[6], const int index)
Insert a mesh element with given bounding box and index to the tree.
~TetrahedralTree()
Destructor.
TetrahedralTree(const Vec3 &origin, const Vec3 &halfDimension)
Constructor.
void InsertMeshNode(Vec3 point, const int index)
Insert a mesh node (a vertex/point) to the tree.
const std::vector< int > & GetElementsInBlock(const Vec3 &point) const
Get all elements linked to a block corresponding to the given point.
Vec3(float _x, float _y, float _z)
Vec3 & operator+=(const Vec3 &r)
Vec3 & operator-=(const Vec3 &r)
Vec3 operator-(const Vec3 &r) const
Vec3 operator/(float r) const
Vec3 operator*(float r) const
Vec3 operator+(const Vec3 &r) const