#include <BinTreeNode.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) |
BinTreeNode is a TreeNode subclass that represents nodes in a binary tree, where each subsequent level subdivides a node into two equal portions along one of the coordinate planes. The class implements an alternating subdivision scheme, i.e. the nodes are alternatively divided perpendicular to each of the three coordinate axes when descending the tree.
|
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 among the children 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 half-space that contains the specified point relative to the node's central division plane. If the specified point is inside the node, then it will also be inside the returned child. Invoking this function on a childless node results in undefined behavior.
Implements TreeNode.
|
overridevirtual |
This function creates two new nodes subdividing the node at its geometric center along a plane perpendicular to one of the coordinate axes, depending on the node's level in the tree. The splitting direction is selected as the modulo of the node's level, with (0=x, 1=y, 2=z), so that the nodes are alternatively divided along each of the axes when descending the tree.
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 binary tree 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 binary tree 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.