ITK  4.1.0
Insight Segmentation and Registration Toolkit
Public Member Functions | Private Member Functions | Private Attributes
itk::OctreeNode Class Reference

#include <itkOctreeNode.h>

+ Collaboration diagram for itk::OctreeNode:

List of all members.

Public Member Functions

int GetColor (void) const
bool IsNodeColored (void) const
 OctreeNode (void)
void SetBranch (OctreeNodeBranch *NewBranch)
void SetColor (int NodeColor)
void SetParentOctree (OctreeBase *parent)
virtual ~OctreeNode (void)
OctreeNodeGetChild (const enum LeafIdentifier ChildID) const
OctreeNodeGetChild (const enum LeafIdentifier ChildID)

Private Member Functions

void RemoveChildren (void)

Private Attributes

OctreeNodeBranchm_Branch
OctreeBasem_Parent

Detailed Description

A data structure representing a node in an Octree.

OctreeNode data structure, OctreeNodes have two states: 1) They are a Colored node and the m_Branch is a sentinal value indicating the color, or 2) they are a branch node, and m_Branch is a dynamically allocated array of 8 pointers to OctreeNodes. In the second state, the 8 child OctreeNodes are instantiated by the parent node.

Author:
Hans J. Johnson This class is the basic building block of an octree. It is rarely used by itself, and commonly used by the Octree class.
Todo:
FIXME copy & paste documentation in all methods.

Definition at line 43 of file itkOctreeNode.h.


Constructor & Destructor Documentation

Default constructor

Postcondition:
After construction, it is assumed all children of this node are colored with values of 0.
virtual itk::OctreeNode::~OctreeNode ( void  ) [virtual]

Default destructor


Member Function Documentation

OctreeNode& itk::OctreeNode::GetChild ( const enum LeafIdentifier  ChildID) const

Returns the value of the specified Child for this OctreeNode

Parameters:
ChildIDThe numerical identifier of the desired child.
Returns:
A pointer to the Desired child. NOTE: This is always an instance of an OctreeNode.

Returns the value of the specified Child for this OctreeNode

Parameters:
ChildIDThe numerical identifier of the desired child.
Returns:
A pointer to the Desired child. NOTE: This is always an instance of an OctreeNode.
int itk::OctreeNode::GetColor ( void  ) const

Determines the color value of the specified Child for this OctreeNode

Returns:
A value between 0 and 255 to indicate the color of the Desired child.
Precondition:
Must determine that the specified node is colored (Use IsNodeColored() member function. Behavior is undefined when the child is another Octree.
bool itk::OctreeNode::IsNodeColored ( void  ) const

Determines if the child is a leaf node (colored), or a branch node (uncolored)

Returns:
true if it is colored, false if it is not
void itk::OctreeNode::RemoveChildren ( void  ) [private]

Removes all children from this node down, and sets the value value of the children to background.

Sets the color value of the specified Child for this OctreeNode

Postcondition:
All children of the specified child are removed, and the child is set to the desired value.

Referenced by itk::Octree< TPixel, ColorTableSize, MappingFunctionType >::SetTree().

void itk::OctreeNode::SetColor ( int  NodeColor)

Sets the color value of the specified Child for this OctreeNode

Parameters:
NodeColorThe desired color of this node.
Postcondition:
All children of the specified child are removed, and the child is set to the desired value.

Referenced by itk::Octree< TPixel, ColorTableSize, MappingFunctionType >::SetColor().

void itk::OctreeNode::SetParentOctree ( OctreeBase parent) [inline]

Definition at line 101 of file itkOctreeNode.h.

Referenced by itk::OctreeNodeBranch::OctreeNodeBranch().


Member Data Documentation

Each element holds COLOR or pointer to another octree node

Definition at line 117 of file itkOctreeNode.h.

Definition at line 118 of file itkOctreeNode.h.


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