supereight
Public Types | Public Member Functions | List of all members
se::Node< DataT, ResT > Class Template Reference

The node type of the octant. More...

#include <block.hpp>

Inheritance diagram for se::Node< DataT, ResT >:
se::OctantBase

Public Types

typedef DataT DataType
 

Public Member Functions

 Node (const Eigen::Vector3i &coord, const int size, const DataT init_data)
 Setup a node via its voxel coordinates and size. More...
 
 Node (Node *parent_ptr, const int child_idx, const DataT init_data)
 Setup a node via its parent and child index. More...
 
int getSize () const
 Get the size in [voxel] of the node. More...
 
const se::OctantBasegetChild (const int child_idx) const
 Get the pointer to one of the children of the node. More...
 
se::OctantBasegetChild (const int child_idx)
 Get the pointer to one of the children of the node. More...
 
se::OctantBasesetChild (const int child_idx, se::OctantBase *child_ptr)
 Set the pointer of one of the children of the node. More...
 
- Public Member Functions inherited from se::OctantBase
 OctantBase (const bool is_block, const Eigen::Vector3i &coord, OctantBase *parent_ptr=nullptr)
 Setup a octant via its parent. More...
 
bool isBlock () const
 Verify if an octant is a block. More...
 
Eigen::Vector3i getCoord () const
 Get the voxel coordinates of the octant. More...
 
const se::OctantBasegetParent () const
 Get the parent pointer of the octant. More...
 
se::OctantBasegetParent ()
 
int getTimeStamp () const
 Get the time stamp of an octant. More...
 
void setTimeStamp (const int time_stamp)
 Set the time stamp of an octant. More...
 
bool getActive () const
 Get the active state of an octant. More...
 
void setActive (bool is_active)
 Set the active state of an octant. More...
 
unsigned int getChildrenMask () const
 
void clearChildrenMask ()
 Clear the children mask. More...
 

Additional Inherited Members

- Protected Attributes inherited from se::OctantBase
const bool is_block_
 
OctantBaseparent_ptr_
 Every node/block (other than root) needs a parent. More...
 
const Eigen::Vector3i coord_
 The coordinates of the block (left, front , bottom corner) More...
 
int time_stamp_
 The frame of the last update. More...
 
bool is_active_
 The active state of the octant. More...
 
unsigned int children_mask_
 The allocated children. More...
 

Detailed Description

template<typename DataT, se::Res ResT = se::Res::Single>
class se::Node< DataT, ResT >

The node type of the octant.

Template Parameters
DataT
ResT

Member Typedef Documentation

◆ DataType

template<typename DataT, se::Res ResT = se::Res::Single>
typedef DataT se::Node< DataT, ResT >::DataType

Constructor & Destructor Documentation

◆ Node() [1/2]

template<typename DataT, se::Res ResT = se::Res::Single>
se::Node< DataT, ResT >::Node ( const Eigen::Vector3i &  coord,
const int  size,
const DataT  init_data 
)

Setup a node via its voxel coordinates and size.

Warning
This function should only be used for the octrees root.
Parameters
[in]coordThe coordinates in [voxel] of the node
[in]sizeThe size in [voxel] of the node

◆ Node() [2/2]

template<typename DataT, se::Res ResT = se::Res::Single>
se::Node< DataT, ResT >::Node ( Node< DataT, ResT > *  parent_ptr,
const int  child_idx,
const DataT  init_data 
)

Setup a node via its parent and child index.

Parameters
[in]parent_ptrThe pointer to the parent node
[in]child_idxThe child index of the node

Member Function Documentation

◆ getSize()

template<typename DataT, se::Res ResT = se::Res::Single>
int se::Node< DataT, ResT >::getSize ( ) const
inline

Get the size in [voxel] of the node.

Returns
The size of the node

◆ getChild() [1/2]

template<typename DataT, se::Res ResT = se::Res::Single>
const se::OctantBase* se::Node< DataT, ResT >::getChild ( const int  child_idx) const
inline

Get the pointer to one of the children of the node.

Parameters
[in]child_idxThe child index of the requested child
Returns
The pointer to the child. nullptr if not allocated

◆ getChild() [2/2]

template<typename DataT, se::Res ResT = se::Res::Single>
se::OctantBase* se::Node< DataT, ResT >::getChild ( const int  child_idx)
inline

Get the pointer to one of the children of the node.

Parameters
[in]child_idxThe child index of the requested child
Returns
The pointer to the child. nullptr if not allocated

◆ setChild()

template<typename DataT, se::Res ResT = se::Res::Single>
se::OctantBase* se::Node< DataT, ResT >::setChild ( const int  child_idx,
se::OctantBase child_ptr 
)
inline

Set the pointer of one of the children of the node.

Parameters
[in]child_idxThe child index of the child to be set
[in]child_ptrThe pointer to the child to be set

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