Voxomap
A C++11 voxel container.
voxomap::SidedContainer< T_Container, T_Voxel > Struct Template Reference

Wrap a voxel container to add side features. More...

#include <SidedContainer.hpp>

Inherits T_Container< SidedVoxel< T_Voxel > >.

Public Types

using VoxelData = SidedVoxel< T_Voxel >
 
using VoxelContainer = SidedContainer< T_Container, T_Voxel >
 
using iterator = container_iterator< SidedContainer< T_Container, T_Voxel > >
 

Public Member Functions

 SidedContainer ()=default
 Default constructor. More...
 
 SidedContainer (SidedContainer const &other)=default
 Default copy constructor. More...
 
 SidedContainer (SidedContainer &&other)=default
 Default move constructor. More...
 
void init (VoxelNode< SidedContainer > const &)
 Initialization method, do nothing. More...
 
uint16_t getNbSide () const
 Returns number of sides. More...
 
template<typename Iterator , typename... Args>
bool addVoxel (Iterator &it, Args &&... args)
 Add a voxel, don't update an existing voxel. More...
 
template<typename Iterator , typename... Args>
bool updateVoxel (Iterator &it, Args &&... args)
 Update an existing voxel, don't create a new one. More...
 
template<typename Iterator , typename... Args>
void putVoxel (Iterator &it, Args &&... args)
 Add or update a voxel. More...
 
template<typename Iterator >
bool removeVoxel (Iterator const &it, VoxelData *voxel=nullptr)
 Remove an existing voxel. More...
 
void exploreVoxelContainer (std::function< void(SidedContainer const &)> const &predicate) const
 
void serialize (std::string &str) const
 Serialize the structure. More...
 
size_t unserialize (char const *str, size_t size)
 Unserialize str inside this. More...
 

Static Public Attributes

static const uint32_t NB_VOXELS = T_Container<VoxelData>::NB_VOXELS
 
static const uint32_t COORD_MASK = ~(NB_VOXELS - 1)
 
static const uint32_t VOXEL_MASK = NB_VOXELS - 1
 
static const uint32_t NB_SUPERCONTAINER = 0
 

Private Member Functions

template<typename Iterator >
void addSide (Iterator const &it)
 
template<typename Iterator >
void removeSide (Iterator const &it)
 
template<typename Iterator >
void updateSide (Iterator const &it)
 

Private Attributes

uint16_t _nbSides = 0
 

Friends

template<class Iterator >
void addSide (Iterator const &otherIt, SideEnum side)
 
template<class Iterator >
void removeSide (Iterator const &currentIt, Iterator const &otherIt, SideEnum s1, SideEnum s2)
 
template<class Iterator >
void updateSide (Iterator const &currentIt, Iterator const &otherIt, SideEnum s1, SideEnum s2)
 

Detailed Description

template<template< class... > class T_Container, class T_Voxel>
struct voxomap::SidedContainer< T_Container, T_Voxel >

Wrap a voxel container to add side features.

Definition at line 155 of file SidedContainer.hpp.

Member Typedef Documentation

◆ VoxelData

template<template< class... > class T_Container, class T_Voxel >
using voxomap::SidedContainer< T_Container, T_Voxel >::VoxelData = SidedVoxel<T_Voxel>

Definition at line 157 of file SidedContainer.hpp.

◆ VoxelContainer

template<template< class... > class T_Container, class T_Voxel >
using voxomap::SidedContainer< T_Container, T_Voxel >::VoxelContainer = SidedContainer<T_Container, T_Voxel>

Definition at line 158 of file SidedContainer.hpp.

◆ iterator

template<template< class... > class T_Container, class T_Voxel >
using voxomap::SidedContainer< T_Container, T_Voxel >::iterator = container_iterator<SidedContainer<T_Container, T_Voxel> >

Definition at line 159 of file SidedContainer.hpp.

Constructor & Destructor Documentation

◆ SidedContainer() [1/3]

template<template< class... > class T_Container, class T_Voxel >
voxomap::SidedContainer< T_Container, T_Voxel >::SidedContainer ( )
default

Default constructor.

◆ SidedContainer() [2/3]

template<template< class... > class T_Container, class T_Voxel >
voxomap::SidedContainer< T_Container, T_Voxel >::SidedContainer ( SidedContainer< T_Container, T_Voxel > const &  other)
default

Default copy constructor.

◆ SidedContainer() [3/3]

template<template< class... > class T_Container, class T_Voxel >
voxomap::SidedContainer< T_Container, T_Voxel >::SidedContainer ( SidedContainer< T_Container, T_Voxel > &&  other)
default

Default move constructor.

Member Function Documentation

◆ init()

template<template< class... > class T_Container, class T_Voxel >
void voxomap::SidedContainer< T_Container, T_Voxel >::init ( VoxelNode< SidedContainer< T_Container, T_Voxel > > const &  )

Initialization method, do nothing.

Definition at line 182 of file SidedContainer.hpp.

◆ getNbSide()

template<template< class... > class T_Container, class T_Voxel >
uint16_t voxomap::SidedContainer< T_Container, T_Voxel >::getNbSide ( ) const

Returns number of sides.

◆ addVoxel()

template<template< class... > class T_Container, class T_Voxel >
template<typename Iterator , typename... Args>
bool voxomap::SidedContainer< T_Container, T_Voxel >::addVoxel ( Iterator &  it,
Args &&...  args 
)

Add a voxel, don't update an existing voxel.

Parameters
itIterator that contains the informations
argsArguments to forward to voxel constructor
Returns
True if success and update it

◆ updateVoxel()

template<template< class... > class T_Container, class T_Voxel >
template<typename Iterator , typename... Args>
bool voxomap::SidedContainer< T_Container, T_Voxel >::updateVoxel ( Iterator &  it,
Args &&...  args 
)

Update an existing voxel, don't create a new one.

Parameters
itIterator that contains the informations
argsArguments to forward to voxel constructor
Returns
True if success

◆ putVoxel()

template<template< class... > class T_Container, class T_Voxel >
template<typename Iterator , typename... Args>
void voxomap::SidedContainer< T_Container, T_Voxel >::putVoxel ( Iterator &  it,
Args &&...  args 
)

Add or update a voxel.

Parameters
itIterator that contains the informations
argsArguments to forward to voxel constructor

◆ removeVoxel()

template<template< class... > class T_Container, class T_Voxel >
template<typename Iterator >
bool voxomap::SidedContainer< T_Container, T_Voxel >::removeVoxel ( Iterator const &  it,
VoxelData voxel = nullptr 
)

Remove an existing voxel.

Parameters
itIterator that contains the informations
voxelPointer on a voxel structure, filled with the data of the removed voxel
Returns
True if success

◆ exploreVoxelContainer()

template<template< class... > class T_Container, class T_Voxel >
void voxomap::SidedContainer< T_Container, T_Voxel >::exploreVoxelContainer ( std::function< void(SidedContainer< T_Container, T_Voxel > const &)> const &  predicate) const

◆ serialize()

template<template< class... > class T_Container, class T_Voxel >
void voxomap::SidedContainer< T_Container, T_Voxel >::serialize ( std::string &  str) const

Serialize the structure.

Parameters
strString use for save the serialization

◆ unserialize()

template<template< class... > class T_Container, class T_Voxel >
size_t voxomap::SidedContainer< T_Container, T_Voxel >::unserialize ( char const *  str,
size_t  size 
)

Unserialize str inside this.

Parameters
strString that contains data
sizeSize of the string
Returns
Number of bytes read inside str

◆ addSide()

template<template< class... > class T_Container, class T_Voxel >
template<typename Iterator >
void voxomap::SidedContainer< T_Container, T_Voxel >::addSide ( Iterator const &  it)
private

◆ removeSide()

template<template< class... > class T_Container, class T_Voxel >
template<typename Iterator >
void voxomap::SidedContainer< T_Container, T_Voxel >::removeSide ( Iterator const &  it)
private

◆ updateSide()

template<template< class... > class T_Container, class T_Voxel >
template<typename Iterator >
void voxomap::SidedContainer< T_Container, T_Voxel >::updateSide ( Iterator const &  it)
private

Friends And Related Function Documentation

◆ addSide

template<template< class... > class T_Container, class T_Voxel >
template<class Iterator >
void addSide ( Iterator const &  otherIt,
SideEnum  side 
)
friend

◆ removeSide

template<template< class... > class T_Container, class T_Voxel >
template<class Iterator >
void removeSide ( Iterator const &  currentIt,
Iterator const &  otherIt,
SideEnum  s1,
SideEnum  s2 
)
friend

◆ updateSide

template<template< class... > class T_Container, class T_Voxel >
template<class Iterator >
void updateSide ( Iterator const &  currentIt,
Iterator const &  otherIt,
SideEnum  s1,
SideEnum  s2 
)
friend

Member Data Documentation

◆ NB_VOXELS

template<template< class... > class T_Container, class T_Voxel >
const uint32_t voxomap::SidedContainer< T_Container, T_Voxel >::NB_VOXELS = T_Container<VoxelData>::NB_VOXELS
static

Definition at line 161 of file SidedContainer.hpp.

◆ COORD_MASK

template<template< class... > class T_Container, class T_Voxel >
const uint32_t voxomap::SidedContainer< T_Container, T_Voxel >::COORD_MASK = ~(NB_VOXELS - 1)
static

Definition at line 162 of file SidedContainer.hpp.

◆ VOXEL_MASK

template<template< class... > class T_Container, class T_Voxel >
const uint32_t voxomap::SidedContainer< T_Container, T_Voxel >::VOXEL_MASK = NB_VOXELS - 1
static

Definition at line 163 of file SidedContainer.hpp.

◆ NB_SUPERCONTAINER

template<template< class... > class T_Container, class T_Voxel >
const uint32_t voxomap::SidedContainer< T_Container, T_Voxel >::NB_SUPERCONTAINER = 0
static

Definition at line 164 of file SidedContainer.hpp.

◆ _nbSides

template<template< class... > class T_Container, class T_Voxel >
uint16_t voxomap::SidedContainer< T_Container, T_Voxel >::_nbSides = 0
private

Definition at line 247 of file SidedContainer.hpp.


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