#include <lloctree.h>
Public Types | |
typedef LLOctreeTraveler< T > | oct_traveler |
typedef LLTreeTraveler< T > | tree_traveler |
typedef std::set< LLPointer< T > > | element_list |
typedef std::set< LLPointer< T > >::iterator | element_iter |
typedef std::set< LLPointer< T > >::const_iterator | const_element_iter |
typedef std::vector < LLTreeListener< T > * >::iterator | tree_listener_iter |
typedef std::vector < LLOctreeNode< T > * > | child_list |
typedef LLTreeNode< T > | BaseType |
typedef LLOctreeNode< T > | oct_node |
typedef LLOctreeListener< T > | oct_listener |
Public Member Functions | |
LLOctreeNode (LLVector3d center, LLVector3d size, BaseType *parent, U8 octant=255) | |
virtual | ~LLOctreeNode () |
const BaseType * | getParent () const |
void | setParent (BaseType *parent) |
const LLVector3d & | getCenter () const |
const LLVector3d & | getSize () const |
void | setCenter (LLVector3d center) |
void | setSize (LLVector3d size) |
oct_node * | getNodeAt (T *data) |
U8 | getOctant () const |
void | setOctant (U8 octant) |
const oct_node * | getOctParent () const |
oct_node * | getOctParent () |
U8 | getOctant (const F64 pos[]) const |
bool | isInside (const LLVector3d &pos, const F64 &rad) const |
bool | isInside (T *data) const |
bool | isInside (const LLVector3d &pos) const |
void | updateMinMax () |
oct_listener * | getOctListener (U32 index) |
bool | contains (T *xform) |
bool | contains (F64 radius) |
void | accept (oct_traveler *visitor) |
virtual bool | isLeaf () const |
U32 | getElementCount () const |
element_list & | getData () |
const element_list & | getData () const |
U32 | getChildCount () const |
oct_node * | getChild (U32 index) |
const oct_node * | getChild (U32 index) const |
child_list & | getChildren () |
const child_list & | getChildren () const |
void | accept (tree_traveler *visitor) const |
void | accept (oct_traveler *visitor) const |
oct_node * | getNodeAt (const LLVector3d &pos, const F64 &rad) |
virtual bool | insert (T *data) |
bool | remove (T *data) |
void | removeByAddress (T *data) |
void | clearChildren () |
void | validate () |
virtual bool | balance () |
void | destroy () |
void | addChild (oct_node *child, BOOL silent=FALSE) |
void | removeChild (U8 index, BOOL destroy=FALSE) |
void | checkAlive () |
void | deleteChild (oct_node *node) |
Static Public Member Functions | |
static void | pushCenter (LLVector3d ¢er, const LLVector3d &size, const T *data) |
Static Public Attributes | |
static const U8 | OCTANT_POSITIVE_X = 0x01 |
static const U8 | OCTANT_POSITIVE_Y = 0x02 |
static const U8 | OCTANT_POSITIVE_Z = 0x04 |
Protected Attributes | |
child_list | mChild |
element_list | mData |
oct_node * | mParent |
LLVector3d | mCenter |
LLVector3d | mSize |
LLVector3d | mMax |
LLVector3d | mMin |
U8 | mOctant |
Definition at line 76 of file lloctree.h.
typedef LLOctreeTraveler<T> LLOctreeNode< T >::oct_traveler |
Definition at line 79 of file lloctree.h.
typedef LLTreeTraveler<T> LLOctreeNode< T >::tree_traveler |
Definition at line 80 of file lloctree.h.
typedef std::set<LLPointer<T> > LLOctreeNode< T >::element_list |
Definition at line 81 of file lloctree.h.
typedef std::set<LLPointer<T> >::iterator LLOctreeNode< T >::element_iter |
Definition at line 82 of file lloctree.h.
typedef std::set<LLPointer<T> >::const_iterator LLOctreeNode< T >::const_element_iter |
Definition at line 83 of file lloctree.h.
typedef std::vector<LLTreeListener<T>*>::iterator LLOctreeNode< T >::tree_listener_iter |
Definition at line 84 of file lloctree.h.
typedef std::vector<LLOctreeNode<T>* > LLOctreeNode< T >::child_list |
Definition at line 85 of file lloctree.h.
typedef LLTreeNode<T> LLOctreeNode< T >::BaseType |
typedef LLOctreeNode<T> LLOctreeNode< T >::oct_node |
typedef LLOctreeListener<T> LLOctreeNode< T >::oct_listener |
Definition at line 88 of file lloctree.h.
LLOctreeNode< T >::LLOctreeNode | ( | LLVector3d | center, | |
LLVector3d | size, | |||
BaseType * | parent, | |||
U8 | octant = 255 | |||
) | [inline] |
Definition at line 94 of file lloctree.h.
References LLOctreeNode< T >::clearChildren(), LLOctreeNode< T >::mCenter, LLVector3d::mdV, LLOctreeNode< T >::mOctant, LLOctreeNode< T >::mParent, and LLOctreeNode< T >::updateMinMax().
virtual LLOctreeNode< T >::~LLOctreeNode | ( | ) | [inline, virtual] |
Definition at line 112 of file lloctree.h.
References LLTreeNode< T >::destroyListeners(), LLOctreeNode< T >::getChild(), LLOctreeNode< T >::getChildCount(), and i.
const BaseType* LLOctreeNode< T >::getParent | ( | ) | const [inline] |
Definition at line 122 of file lloctree.h.
References LLOctreeNode< T >::mParent.
Referenced by LLSpatialGroup::boundObjects(), LLOctreeNode< T >::getNodeAt(), LLOctreeNode< T >::getOctParent(), LLSpatialGroup::unbound(), and LLOctreeNode< T >::validate().
void LLOctreeNode< T >::setParent | ( | BaseType * | parent | ) | [inline] |
Definition at line 123 of file lloctree.h.
References LLOctreeNode< T >::mParent.
Referenced by LLOctreeNode< T >::addChild().
const LLVector3d& LLOctreeNode< T >::getCenter | ( | ) | const [inline] |
Definition at line 124 of file lloctree.h.
References LLOctreeNode< T >::mCenter.
Referenced by LLOctreeNode< T >::addChild(), LLOctreeRoot< T >::balance(), LLOctreeRoot< T >::insert(), LLOctreeNode< T >::insert(), LLSpatialGroup::LLSpatialGroup(), and LLSpatialGroup::shift().
const LLVector3d& LLOctreeNode< T >::getSize | ( | ) | const [inline] |
Definition at line 125 of file lloctree.h.
References LLOctreeNode< T >::mSize.
Referenced by LLOctreeNode< T >::addChild(), LLOctreeRoot< T >::balance(), LLOctreeNode< T >::getNodeAt(), LLOctreeRoot< T >::insert(), LLOctreeNode< T >::insert(), LLSpatialGroup::LLSpatialGroup(), LLSpatialBridge::updateBinRadius(), LLSpatialGroup::updateDistance(), and LLSpatialGroup::updateInGroup().
void LLOctreeNode< T >::setCenter | ( | LLVector3d | center | ) | [inline] |
Definition at line 126 of file lloctree.h.
References LLOctreeNode< T >::mCenter.
Referenced by LLOctreeRoot< T >::balance(), LLOctreeRoot< T >::insert(), and LLSpatialGroup::shift().
void LLOctreeNode< T >::setSize | ( | LLVector3d | size | ) | [inline] |
Definition at line 127 of file lloctree.h.
References LLOctreeNode< T >::mSize.
Referenced by LLOctreeRoot< T >::balance(), and LLOctreeRoot< T >::insert().
oct_node* LLOctreeNode< T >::getNodeAt | ( | T * | data | ) | [inline] |
Definition at line 128 of file lloctree.h.
Referenced by LLPipeline::findReflectionMap(), LLOctreeNode< T >::getNodeAt(), LLOctreeRoot< T >::insert(), and LLOctreeNode< T >::remove().
U8 LLOctreeNode< T >::getOctant | ( | ) | const [inline] |
Definition at line 129 of file lloctree.h.
References LLOctreeNode< T >::mOctant.
Referenced by LLOctreeNode< T >::getNodeAt().
void LLOctreeNode< T >::setOctant | ( | U8 | octant | ) | [inline] |
const oct_node* LLOctreeNode< T >::getOctParent | ( | ) | const [inline] |
Definition at line 131 of file lloctree.h.
References LLOctreeNode< T >::getParent().
Referenced by LLOctreeNode< T >::checkAlive(), LLSpatialGroup::getParent(), LLOctreeNode< T >::insert(), LLOctreeNode< T >::remove(), and LLSpatialGroup::updateInGroup().
oct_node* LLOctreeNode< T >::getOctParent | ( | ) | [inline] |
Definition at line 132 of file lloctree.h.
References LLOctreeNode< T >::getParent().
U8 LLOctreeNode< T >::getOctant | ( | const F64 | pos[] | ) | const [inline] |
Definition at line 134 of file lloctree.h.
References LLOctreeNode< T >::mCenter, LLVector3d::mdV, LLOctreeNode< T >::OCTANT_POSITIVE_X, LLOctreeNode< T >::OCTANT_POSITIVE_Y, and LLOctreeNode< T >::OCTANT_POSITIVE_Z.
bool LLOctreeNode< T >::isInside | ( | const LLVector3d & | pos, | |
const F64 & | rad | |||
) | const [inline] |
Definition at line 154 of file lloctree.h.
References LLVector3d::mdV, and LLOctreeNode< T >::mSize.
Referenced by LLOctreeNode< T >::getNodeAt(), LLOctreeRoot< T >::insert(), LLOctreeNode< T >::insert(), LLOctreeNode< T >::isInside(), LLOctreeNode< T >::remove(), and LLSpatialGroup::updateInGroup().
bool LLOctreeNode< T >::isInside | ( | T * | data | ) | const [inline] |
Definition at line 159 of file lloctree.h.
References LLOctreeNode< T >::isInside().
bool LLOctreeNode< T >::isInside | ( | const LLVector3d & | pos | ) | const [inline] |
Definition at line 164 of file lloctree.h.
References LLVector3d::mdV, LLOctreeNode< T >::mMax, and LLOctreeNode< T >::mMin.
void LLOctreeNode< T >::updateMinMax | ( | ) | [inline] |
Definition at line 180 of file lloctree.h.
References i, LLOctreeNode< T >::mCenter, LLVector3d::mdV, LLOctreeNode< T >::mMax, LLOctreeNode< T >::mMin, and LLOctreeNode< T >::mSize.
Referenced by LLOctreeRoot< T >::balance(), LLOctreeRoot< T >::insert(), LLOctreeNode< T >::LLOctreeNode(), and LLSpatialGroup::shift().
oct_listener* LLOctreeNode< T >::getOctListener | ( | U32 | index | ) | [inline] |
Definition at line 190 of file lloctree.h.
References LLTreeNode< T >::getListener().
Referenced by LLOctreeNode< T >::addChild(), and LLOctreeNode< T >::removeChild().
bool LLOctreeNode< T >::contains | ( | T * | xform | ) | [inline] |
Definition at line 195 of file lloctree.h.
Referenced by LLOctreeNode< T >::getNodeAt(), LLOctreeNode< T >::insert(), and LLSpatialGroup::updateInGroup().
bool LLOctreeNode< T >::contains | ( | F64 | radius | ) | [inline] |
Definition at line 200 of file lloctree.h.
References LLVector3d::mdV, LLOctreeNode< T >::mParent, LLOctreeNode< T >::mSize, and NULL.
static void LLOctreeNode< T >::pushCenter | ( | LLVector3d & | center, | |
const LLVector3d & | size, | |||
const T * | data | |||
) | [inline, static] |
Definition at line 214 of file lloctree.h.
References i, and LLVector3d::mdV.
Referenced by LLOctreeRoot< T >::insert(), and LLOctreeNode< T >::insert().
void LLOctreeNode< T >::accept | ( | oct_traveler * | visitor | ) | [inline] |
Definition at line 230 of file lloctree.h.
References LLOctreeTraveler< T >::visit().
Referenced by LLOctreePick::check(), LLOctreeRenderNonOccluded::traverse(), LLOctreeStateCheck::traverse(), and LLOctreeTraveler< T >::traverse().
virtual bool LLOctreeNode< T >::isLeaf | ( | ) | const [inline, virtual] |
Definition at line 231 of file lloctree.h.
References LLOctreeNode< T >::mChild.
Referenced by LLOctreeRoot< T >::balance(), and LLSpatialGroup::rebound().
U32 LLOctreeNode< T >::getElementCount | ( | ) | const [inline] |
Definition at line 233 of file lloctree.h.
References LLOctreeNode< T >::mData.
Referenced by LLOctreeRoot< T >::balance(), LLOctreeNode< T >::checkAlive(), LLOctreeCull::checkObjects(), LLSpatialGroup::getElementCount(), LLOctreeNode< T >::insert(), LLSpatialGroup::rebound(), and LLSpatialGroup::updateInGroup().
element_list& LLOctreeNode< T >::getData | ( | ) | [inline] |
Definition at line 234 of file lloctree.h.
References LLOctreeNode< T >::mData.
Referenced by LLSpatialGroup::boundObjects(), LLSpatialGroup::getData(), LLOctreeSelect::processGroup(), LLOctreePick::visit(), and LLOctreeRenderNonOccluded::visit().
const element_list& LLOctreeNode< T >::getData | ( | ) | const [inline] |
U32 LLOctreeNode< T >::getChildCount | ( | ) | const [inline] |
Definition at line 237 of file lloctree.h.
References LLOctreeNode< T >::mChild.
Referenced by LLOctreeNode< T >::addChild(), LLOctreeRoot< T >::balance(), LLOctreePick::check(), LLOctreeNode< T >::checkAlive(), LLOctreeCull::checkObjects(), LLOctreeNode< T >::deleteChild(), LLOctreeNode< T >::destroy(), LLOctreeNode< T >::getNodeAt(), LLOctreeRoot< T >::insert(), LLOctreeNode< T >::insert(), LLSpatialGroup::rebound(), LLOctreeNode< T >::removeByAddress(), LLOctreeRenderNonOccluded::traverse(), LLOctreeStateCheck::traverse(), LLOctreeTraveler< T >::traverse(), LLSpatialGroup::validate(), LLOctreeNode< T >::validate(), and LLOctreeNode< T >::~LLOctreeNode().
oct_node* LLOctreeNode< T >::getChild | ( | U32 | index | ) | [inline] |
Definition at line 238 of file lloctree.h.
References LLOctreeNode< T >::mChild.
Referenced by LLOctreeRoot< T >::balance(), LLOctreePick::check(), LLOctreeNode< T >::deleteChild(), LLOctreeNode< T >::getNodeAt(), LLOctreeRoot< T >::insert(), LLOctreeNode< T >::insert(), LLSpatialGroup::rebound(), LLOctreeNode< T >::removeByAddress(), LLOctreeNode< T >::removeChild(), LLOctreeRenderNonOccluded::traverse(), LLOctreeStateCheck::traverse(), LLOctreeTraveler< T >::traverse(), LLSpatialGroup::validate(), and LLOctreeNode< T >::~LLOctreeNode().
const oct_node* LLOctreeNode< T >::getChild | ( | U32 | index | ) | const [inline] |
child_list& LLOctreeNode< T >::getChildren | ( | ) | [inline] |
const child_list& LLOctreeNode< T >::getChildren | ( | ) | const [inline] |
void LLOctreeNode< T >::accept | ( | tree_traveler * | visitor | ) | const [inline] |
Definition at line 243 of file lloctree.h.
References LLTreeTraveler< T >::visit().
void LLOctreeNode< T >::accept | ( | oct_traveler * | visitor | ) | const [inline] |
Definition at line 244 of file lloctree.h.
References LLOctreeTraveler< T >::visit().
oct_node* LLOctreeNode< T >::getNodeAt | ( | const LLVector3d & | pos, | |
const F64 & | rad | |||
) | [inline] |
Definition at line 246 of file lloctree.h.
References LLOctreeNode< T >::contains(), FALSE, LLOctreeNode< T >::getChild(), LLOctreeNode< T >::getChildCount(), LLOctreeNode< T >::getNodeAt(), LLOctreeNode< T >::getOctant(), LLOctreeNode< T >::getParent(), LLOctreeNode< T >::getSize(), i, LLOctreeNode< T >::isInside(), LLVector3d::mdV, and TRUE.
virtual bool LLOctreeNode< T >::insert | ( | T * | data | ) | [inline, virtual] |
Reimplemented from LLTreeNode< T >.
Reimplemented in LLOctreeRoot< T >.
Definition at line 282 of file lloctree.h.
References LLOctreeNode< T >::addChild(), LLOctreeNode< T >::contains(), LLOctreeNode< T >::getCenter(), LLOctreeNode< T >::getChild(), LLOctreeNode< T >::getChildCount(), LLOctreeNode< T >::getElementCount(), LLOctreeNode< T >::getOctParent(), LLOctreeNode< T >::getSize(), i, LLOctreeNode< T >::insert(), LLTreeNode< T >::insert(), LLOctreeNode< T >::isInside(), LL_OCTREE_MAX_CAPACITY, llendl, llwarns, LLOctreeNode< T >::mChild, LLOctreeNode< T >::mData, LLVector3d::mdV, NULL, OCT_ERRS, and LLOctreeNode< T >::pushCenter().
Referenced by LLSpatialGroup::addObject(), LLOctreeRoot< T >::insert(), LLOctreeNode< T >::insert(), and LLSpatialPartition::put().
bool LLOctreeNode< T >::remove | ( | T * | data | ) | [inline, virtual] |
Reimplemented from LLTreeNode< T >.
Definition at line 378 of file lloctree.h.
References LLOctreeNode< T >::checkAlive(), LLOctreeNode< T >::getNodeAt(), LLOctreeNode< T >::getOctParent(), LLOctreeNode< T >::isInside(), llendl, llwarns, LLOctreeNode< T >::mData, LLTreeNode< T >::notifyRemoval(), NULL, LLOctreeNode< T >::remove(), and LLOctreeNode< T >::removeByAddress().
Referenced by LLOctreeNode< T >::remove(), and LLSpatialGroup::removeObject().
void LLOctreeNode< T >::removeByAddress | ( | T * | data | ) | [inline] |
Definition at line 415 of file lloctree.h.
References LLOctreeNode< T >::checkAlive(), LLOctreeNode< T >::getChild(), LLOctreeNode< T >::getChildCount(), i, llendl, llwarns, LLOctreeNode< T >::mData, LLTreeNode< T >::notifyRemoval(), and LLOctreeNode< T >::removeByAddress().
Referenced by LLOctreeNode< T >::remove(), and LLOctreeNode< T >::removeByAddress().
void LLOctreeNode< T >::clearChildren | ( | ) | [inline] |
Definition at line 433 of file lloctree.h.
References LLOctreeNode< T >::mChild.
Referenced by LLOctreeRoot< T >::balance(), LLOctreeRoot< T >::insert(), and LLOctreeNode< T >::LLOctreeNode().
void LLOctreeNode< T >::validate | ( | ) | [inline] |
Definition at line 438 of file lloctree.h.
References LLOctreeNode< T >::getChildCount(), LLOctreeNode< T >::getParent(), i, llendl, llerrs, and LLOctreeNode< T >::mChild.
virtual bool LLOctreeNode< T >::balance | ( | ) | [inline, virtual] |
Reimplemented in LLOctreeRoot< T >.
Definition at line 452 of file lloctree.h.
Referenced by LLSpatialBridge::LLSpatialBridge(), LLPipeline::updateMove(), and LLSpatialBridge::updateMove().
void LLOctreeNode< T >::destroy | ( | ) | [inline] |
Definition at line 457 of file lloctree.h.
References LLOctreeNode< T >::getChildCount(), i, and LLOctreeNode< T >::mChild.
Referenced by LLOctreeNode< T >::removeChild().
void LLOctreeNode< T >::addChild | ( | oct_node * | child, | |
BOOL | silent = FALSE | |||
) | [inline] |
Definition at line 466 of file lloctree.h.
References LLOctreeNode< T >::getCenter(), LLOctreeNode< T >::getChildCount(), LLTreeNode< T >::getListenerCount(), LLOctreeNode< T >::getOctListener(), LLOctreeNode< T >::getSize(), LLOctreeListener< T >::handleChildAddition(), i, llendl, LLOctreeNode< T >::mChild, OCT_ERRS, and LLOctreeNode< T >::setParent().
Referenced by LLOctreeRoot< T >::balance(), LLOctreeRoot< T >::insert(), and LLOctreeNode< T >::insert().
void LLOctreeNode< T >::removeChild | ( | U8 | index, | |
BOOL | destroy = FALSE | |||
) | [inline] |
Definition at line 500 of file lloctree.h.
References LLOctreeNode< T >::checkAlive(), LLOctreeNode< T >::destroy(), LLOctreeNode< T >::getChild(), LLTreeNode< T >::getListenerCount(), LLOctreeNode< T >::getOctListener(), LLOctreeListener< T >::handleChildRemoval(), i, and LLOctreeNode< T >::mChild.
Referenced by LLOctreeNode< T >::deleteChild().
void LLOctreeNode< T >::checkAlive | ( | ) | [inline] |
Definition at line 518 of file lloctree.h.
References LLOctreeNode< T >::deleteChild(), LLOctreeNode< T >::getChildCount(), LLOctreeNode< T >::getElementCount(), and LLOctreeNode< T >::getOctParent().
Referenced by LLOctreeNode< T >::remove(), LLOctreeNode< T >::removeByAddress(), and LLOctreeNode< T >::removeChild().
void LLOctreeNode< T >::deleteChild | ( | oct_node * | node | ) | [inline] |
Definition at line 530 of file lloctree.h.
References LLOctreeNode< T >::getChild(), LLOctreeNode< T >::getChildCount(), i, LLOctreeNode< T >::removeChild(), and TRUE.
Referenced by LLOctreeNode< T >::checkAlive().
const U8 LLOctreeNode< T >::OCTANT_POSITIVE_X = 0x01 [static] |
const U8 LLOctreeNode< T >::OCTANT_POSITIVE_Y = 0x02 [static] |
const U8 LLOctreeNode< T >::OCTANT_POSITIVE_Z = 0x04 [static] |
child_list LLOctreeNode< T >::mChild [protected] |
Definition at line 545 of file lloctree.h.
Referenced by LLOctreeNode< T >::addChild(), LLOctreeRoot< T >::balance(), LLOctreeNode< T >::clearChildren(), LLOctreeNode< T >::destroy(), LLOctreeNode< T >::getChild(), LLOctreeNode< T >::getChildCount(), LLOctreeNode< T >::getChildren(), LLOctreeNode< T >::insert(), LLOctreeNode< T >::isLeaf(), LLOctreeNode< T >::removeChild(), and LLOctreeNode< T >::validate().
element_list LLOctreeNode< T >::mData [protected] |
Definition at line 546 of file lloctree.h.
Referenced by LLOctreeNode< T >::getData(), LLOctreeNode< T >::getElementCount(), LLOctreeNode< T >::insert(), LLOctreeNode< T >::remove(), and LLOctreeNode< T >::removeByAddress().
oct_node* LLOctreeNode< T >::mParent [protected] |
Definition at line 547 of file lloctree.h.
Referenced by LLOctreeNode< T >::contains(), LLOctreeNode< T >::getParent(), LLOctreeNode< T >::LLOctreeNode(), and LLOctreeNode< T >::setParent().
LLVector3d LLOctreeNode< T >::mCenter [protected] |
Definition at line 548 of file lloctree.h.
Referenced by LLOctreeNode< T >::getCenter(), LLOctreeNode< T >::getOctant(), LLOctreeNode< T >::LLOctreeNode(), LLOctreeNode< T >::setCenter(), and LLOctreeNode< T >::updateMinMax().
LLVector3d LLOctreeNode< T >::mSize [protected] |
Definition at line 549 of file lloctree.h.
Referenced by LLOctreeNode< T >::contains(), LLOctreeNode< T >::getSize(), LLOctreeNode< T >::isInside(), LLOctreeNode< T >::setSize(), and LLOctreeNode< T >::updateMinMax().
LLVector3d LLOctreeNode< T >::mMax [protected] |
Definition at line 550 of file lloctree.h.
Referenced by LLOctreeNode< T >::isInside(), and LLOctreeNode< T >::updateMinMax().
LLVector3d LLOctreeNode< T >::mMin [protected] |
Definition at line 551 of file lloctree.h.
Referenced by LLOctreeNode< T >::isInside(), and LLOctreeNode< T >::updateMinMax().
U8 LLOctreeNode< T >::mOctant [protected] |
Definition at line 552 of file lloctree.h.
Referenced by LLOctreeNode< T >::getOctant(), LLOctreeNode< T >::LLOctreeNode(), and LLOctreeNode< T >::setOctant().