Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
objtree::Node Class Reference

#include <node.h>

List of all members.

Public Member Functions

void add (Object *object)
Nodechild (unsigned char place, bool createNew=false)
void deleteIfEmpty ()
Nodeneighbor (unsigned char dir)
 Node (unsigned char place=0, Node *parent=NULL)
const std::list< Object * > & objects () const
Nodeparent ()
void removeObject (Object *object)
 ~Node ()

Static Public Member Functions

static BoxgetChildBox (unsigned char place, Box &childBox, const Box &parentBox)

Static Public Attributes

static const unsigned int CHILDREN = 8
static const unsigned int NEIGHBORS = 26

Private Member Functions

NodecomputeNeighbor (unsigned char dir)
NodeparentNeighborChild (unsigned char parentNeighbor, unsigned char child)

Static Private Member Functions

static unsigned char reverseNeighborId (unsigned char dir)

Private Attributes

Nodem_children [CHILDREN]
Nodem_neighbors [NEIGHBORS]
std::list< Object * > m_objects
Nodem_parent
unsigned char m_place

Detailed Description

Octree node class.

Definition at line 43 of file node.h.


Constructor & Destructor Documentation

objtree::Node::Node ( unsigned char  place = 0,
Node parent = NULL 
)

A constructor. Creates a new node.

Parameters:
placeposition inside the parent
parentpointer to the parent

Definition at line 40 of file node.cpp.

A destructor.

Definition at line 76 of file node.cpp.


Member Function Documentation

void objtree::Node::add ( Object object)

Adds object to the node.

Parameters:
objectobject to add

Definition at line 149 of file node.cpp.

Node * objtree::Node::child ( unsigned char  place,
bool  createNew = false 
)

Returns pointer to the child.

Parameters:
placechild position
createNewif true non-existing childs are created
Returns:
pointer to child

Definition at line 116 of file node.cpp.

Node * objtree::Node::computeNeighbor ( unsigned char  dir) [private]

Computes neighbor from node position and neighbor direction. Returns pointer to the computed node.

Parameters:
dirneighbor direction
Returns:
pointer to the neighbor or NULL if neighbor doesn't exists

Definition at line 246 of file node.cpp.

Removes node if it doesn't contain any children and objects.

Definition at line 309 of file node.cpp.

Box & objtree::Node::getChildBox ( unsigned char  place,
Box childBox,
const Box parentBox 
) [static]

Computes position and size of selected child node.

Parameters:
placechild position
childBoxoutput computed position and size
parentBoxparent bounding box
Returns:
computed position and size

Definition at line 162 of file node.cpp.

Node * objtree::Node::neighbor ( unsigned char  dir)

Returns pointer to the neighbor.

Parameters:
dirneighbor direction (0-25)
Returns:
pointer to the neighbor

Definition at line 131 of file node.cpp.

const std::list< Object * > & objtree::Node::objects ( ) const

Returns objects in node.

Returns:
std::list of objects

Definition at line 140 of file node.cpp.

Returns node parent.

Returns:
node parent

Definition at line 105 of file node.cpp.

Node * objtree::Node::parentNeighborChild ( unsigned char  parentNeighbor,
unsigned char  child 
) [private]

Returns pointer to the child from parent neighbor.

Parameters:
parentNeighborparent neighbor direction
childchild position
Returns:
pointer to the selected node

Definition at line 211 of file node.cpp.

void objtree::Node::removeObject ( Object object)

Removes object from node. Also removes node if there is no one remaining.

Parameters:
objectpointer to the object

Definition at line 294 of file node.cpp.

unsigned char objtree::Node::reverseNeighborId ( unsigned char  dir) [static, private]

Returns opposite neighbor direction.

Parameters:
dirneighbor direction
Returns:
opposite neighbor direction

Definition at line 284 of file node.cpp.


Member Data Documentation

const unsigned int objtree::Node::CHILDREN = 8 [static]

Definition at line 46 of file node.h.

Definition at line 69 of file node.h.

Definition at line 60 of file node.h.

Definition at line 70 of file node.h.

Definition at line 51 of file node.h.

unsigned char objtree::Node::m_place [private]

Definition at line 50 of file node.h.

const unsigned int objtree::Node::NEIGHBORS = 26 [static]

Definition at line 47 of file node.h.


The documentation for this class was generated from the following files:


srs_env_model
Author(s): Vit Stancl (stancl@fit.vutbr.cz), Tomas Lokaj, Jan Gorig, Michal Spanel (spanel@fit.vutbr.cz)
autogenerated on Sun Jan 5 2014 11:50:50