ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::OctreeNode Class Reference

#include <itkOctreeNode.h>

Detailed Description

A data structure representing a node in an Octree.

OctreeNode is the basic building block of an octree. It is rarely used by itself, and commonly used by the Octree class.

OctreeNodes have two states: 1) They are a Colored node and the m_Branch is a sentinel 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
Todo
FIXME copy & paste documentation in all methods.

Definition at line 46 of file itkOctreeNode.h.

+ Collaboration diagram for itk::OctreeNode:

Public Types

using LeafIdentifierEnum = OctreeEnums::LeafIdentifier
 

Public Member Functions

long GetColor () const
 
bool IsNodeColored () const
 
 OctreeNode ()
 
void SetBranch (OctreeNodeBranch *NewBranch)
 
void SetColor (int color)
 
void SetParentOctree (OctreeBase *parent)
 
virtual ~OctreeNode ()
 
OctreeNodeGetChild (const LeafIdentifierEnum ChildID) const
 
OctreeNodeGetChild (const LeafIdentifierEnum ChildID)
 

Private Member Functions

void RemoveChildren ()
 

Private Attributes

OctreeNodeBranchm_Branch {}
 
OctreeBasem_Parent {}
 

Member Typedef Documentation

◆ LeafIdentifierEnum

Constructor & Destructor Documentation

◆ OctreeNode()

itk::OctreeNode::OctreeNode ( )

Default constructor

Postcondition
After construction, it is assumed all children of this node are colored with values of 0.

Referenced by GetChild().

◆ ~OctreeNode()

virtual itk::OctreeNode::~OctreeNode ( )
virtual

Default destructor

Member Function Documentation

◆ GetChild() [1/2]

OctreeNode & itk::OctreeNode::GetChild ( const LeafIdentifierEnum ChildID)

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.

◆ GetChild() [2/2]

OctreeNode & itk::OctreeNode::GetChild ( const LeafIdentifierEnum 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.

References OctreeNode().

◆ GetColor()

long itk::OctreeNode::GetColor ( ) const

Determines the color value of the specified Child for this OctreeNode

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

◆ IsNodeColored()

bool itk::OctreeNode::IsNodeColored ( ) 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

◆ RemoveChildren()

void itk::OctreeNode::RemoveChildren ( )
private

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

◆ SetBranch()

void itk::OctreeNode::SetBranch ( OctreeNodeBranch * NewBranch)

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.

◆ SetColor()

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

Sets the color value of the specified Child for this OctreeNode

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

◆ SetParentOctree()

void itk::OctreeNode::SetParentOctree ( OctreeBase * parent)
inline

Definition at line 125 of file itkOctreeNode.h.

References m_Parent.

Member Data Documentation

◆ m_Branch

OctreeNodeBranch* itk::OctreeNode::m_Branch {}
private

Each element holds COLOR or pointer to another octree node

Definition at line 142 of file itkOctreeNode.h.

◆ m_Parent

OctreeBase* itk::OctreeNode::m_Parent {}
private

Definition at line 143 of file itkOctreeNode.h.

Referenced by SetParentOctree().


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