#include <OctTreeNode.hpp>
Public Member Functions | |
void | addNeighbors () override |
TreeNode * | child (Vec r) override |
void | createChildren (int id) override |
TreeNode (const Box &extent) | |
TreeNode (TreeNode *parent, int id, const Box &extent) | |
![]() | |
TreeNode (const Box &extent) | |
TreeNode (TreeNode *parent, int id, const Box &extent) | |
virtual | ~TreeNode () |
void | addNeighbor (Wall wall, TreeNode *node) |
virtual void | addNeighbors ()=0 |
virtual TreeNode * | child (Vec r)=0 |
const vector< TreeNode * > & | children () const |
virtual void | createChildren (int id)=0 |
void | deleteNeighbor (Wall wall, TreeNode *node) |
int | id () const |
bool | isChildless () const |
TreeNode * | leafChild (Vec r) |
int | level () const |
const TreeNode * | neighbor (Wall wall, Vec r) const |
const vector< TreeNode * > & | neighbors (Wall wall) const |
TreeNode * | parent () |
void | sortNeighbors () |
void | subdivide (vector< TreeNode * > &nodev) |
![]() | |
Box () | |
Box (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) | |
Box (Vec rmin, Vec rmax) | |
void | cellIndices (int &i, int &j, int &k, Vec r, int nx, int ny, int nz) const |
Vec | center () const |
bool | contains (const Box &box) const |
bool | contains (double x, double y, double z) const |
bool | contains (Vec r) const |
double | diagonal () const |
void | extend (const Box &box) |
const Box & | extent () const |
void | extent (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const |
Vec | fracPos (double xfrac, double yfrac, double zfrac) const |
Vec | fracPos (int xd, int yd, int zd, int xn, int yn, int zn) const |
bool | intersects (const Box &box) const |
bool | intersects (Vec r, const Vec k, double &smin, double &smax) const |
bool | intersects (Vec rc, double r) const |
Vec | rmax () const |
Vec | rmin () const |
double | volume () const |
Vec | widths () const |
double | xmax () const |
double | xmin () const |
double | xwidth () const |
double | ymax () const |
double | ymin () const |
double | ywidth () const |
double | zmax () const |
double | zmin () const |
double | zwidth () const |
Additional Inherited Members | |
![]() | |
enum | Wall { BACK , FRONT , LEFT , RIGHT , BOTTOM , TOP } |
![]() | |
static void | makeNeighbors (Wall wall1, TreeNode *node1, TreeNode *node2) |
![]() | |
void | addChild (TreeNode *child) |
TreeNode * | childAt (int l) |
![]() | |
void | setExtent (const Box &extent) |
void | setExtent (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) |
OctTreeNode is a TreeNode subclass that represents nodes in an octtree, where each subsequent level subdivides a node into eight equal portions (i.e. using a regular geometric subdivision scheme).
|
overridevirtual |
This function adds the relevant neighbors to a node with children (the function does nothing if the node doesn't have any children). It considers internal neighbors (each of the 8 children has 3 neighbors among its siblings) as well as the neighbors of the parent node (i.e. this node). These external neighbors are distributed among the children depending on the geometry; note that a particular external neighbor may be neighbor to multiple children.
Implements TreeNode.
This function returns a pointer to the node's child that contains the specified point. More accurately, it returns the child corresponding to the octant that contains the specified point relative to the node's central division point. If the specified point is inside the node, then it will also be inside the returned child. This function crashes if the node is childless.
Implements TreeNode.
|
overridevirtual |
This function creates eight new equally sized subnodes subdividing the node at the geometric center, and adds these new nodes as its own child nodes. The children are assigned consecutive integer identifiers, starting with the identifier specified as an argument to this function. A node does NOT take ownership of its children, so the caller is responsible for deleting the child nodes when they are no longer needed. Invoking this function on a node that already has children results in undefined behavior.
Implements TreeNode.
TreeNode::TreeNode | ( | const Box & | extent | ) |
This constructor creates a new octtree node with the specified parent node, identifier, and spatial extent. The constructor sets the level of the new node to be one higher than the level of the parent. If the pointer to the parent is null, the level of the new node is zero.
This constructor creates a new octtree node with the specified parent node, identifier, and spatial extent. The constructor sets the level of the new node to be one higher than the level of the parent. If the pointer to the parent is null, the level of the new node is zero.