Voxomap
A C++11 voxel container.
|
Super container used in leaves of the VoxelOctree. Based on a fixed size 3D array, useful for high density of voxels. More...
#include <ArraySuperContainer.hpp>
Public Types | |
using | Container = T_Container |
using | VoxelData = typename Container::VoxelData |
using | VoxelContainer = typename Container::VoxelContainer |
using | iterator = supercontainer_iterator< ArraySuperContainer< Container > > |
Public Member Functions | |
ArraySuperContainer ()=default | |
Default constructor. More... | |
ArraySuperContainer (ArraySuperContainer const &other) | |
Copy constructor. More... | |
ArraySuperContainer (ArraySuperContainer &&other)=default | |
Default move constructor. More... | |
~ArraySuperContainer ()=default | |
Default destructor. More... | |
void | init (VoxelNode< ArraySuperContainer< Container >> const &) |
Initialization method, do nothing. More... | |
uint32_t | getNbVoxel () const |
Returns number of voxels. More... | |
template<typename Iterator > | |
VoxelData * | findVoxel (Iterator &it) |
Find voxel. More... | |
template<typename Iterator > | |
VoxelData const * | findVoxel (Iterator &it) const |
Find voxel. More... | |
bool | hasContainer (uint8_t x) const |
Check if there is sub-container. More... | |
bool | hasContainer (uint8_t x, uint8_t y) const |
Check if there is sub-container. More... | |
bool | hasContainer (uint8_t x, uint8_t y, uint8_t z) const |
Check if there is sub-container. More... | |
Container * | findContainer (uint8_t x, uint8_t y, uint8_t z) |
Find sub-container. More... | |
Container const * | findContainer (uint8_t x, uint8_t y, uint8_t z) const |
Find sub-container. 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 , typename... Args> | |
bool | removeVoxel (Iterator const &it, Args &&... args) |
Remove an existing voxel. More... | |
void | serialize (std::string &str) const |
Serialize the structure. More... | |
size_t | unserialize (char const *str, size_t size) |
Unserialize str inside this. More... | |
template<typename Iterator > | |
void | exploreVoxel (Iterator &it, std::function< void(Iterator const &)> const &predicate) const |
Go through all voxels of the container and call the predicate for each. More... | |
void | exploreVoxelContainer (std::function< void(typename Container::VoxelContainer const &)> const &predicate) const |
Static Public Attributes | |
static const uint32_t | NB_CONTAINERS = 8 |
static const uint32_t | CONTAINER_MASK = NB_CONTAINERS - 1 |
static const uint32_t | NB_VOXELS = NB_CONTAINERS * Container::NB_VOXELS |
static const uint32_t | COORD_MASK = ~(NB_VOXELS - 1) |
static const uint32_t | VOXEL_MASK = Container::VOXEL_MASK |
static const uint32_t | NB_SUPERCONTAINER = 1 + Container::NB_SUPERCONTAINER |
static const uint32_t | SUPERCONTAINER_ID = NB_SUPERCONTAINER - 1 |
Private Attributes | |
std::unique_ptr< Container > | _containerArray [NB_CONTAINERS][NB_CONTAINERS][NB_CONTAINERS] = { 0 } |
Array of voxel containers. More... | |
uint32_t | _nbVoxels = 0 |
Number of voxels. More... | |
Super container used in leaves of the VoxelOctree. Based on a fixed size 3D array, useful for high density of voxels.
Definition at line 30 of file ArraySuperContainer.hpp.
using voxomap::ArraySuperContainer< T_Container >::Container = T_Container |
Definition at line 32 of file ArraySuperContainer.hpp.
using voxomap::ArraySuperContainer< T_Container >::VoxelData = typename Container::VoxelData |
Definition at line 33 of file ArraySuperContainer.hpp.
using voxomap::ArraySuperContainer< T_Container >::VoxelContainer = typename Container::VoxelContainer |
Definition at line 34 of file ArraySuperContainer.hpp.
using voxomap::ArraySuperContainer< T_Container >::iterator = supercontainer_iterator<ArraySuperContainer<Container> > |
Definition at line 35 of file ArraySuperContainer.hpp.
|
default |
Default constructor.
voxomap::ArraySuperContainer< T_Container >::ArraySuperContainer | ( | ArraySuperContainer< T_Container > const & | other | ) |
Copy constructor.
|
default |
Default move constructor.
|
default |
Default destructor.
void voxomap::ArraySuperContainer< T_Container >::init | ( | VoxelNode< ArraySuperContainer< Container >> const & | ) |
Initialization method, do nothing.
Definition at line 66 of file ArraySuperContainer.hpp.
uint32_t voxomap::ArraySuperContainer< T_Container >::getNbVoxel | ( | ) | const |
Returns number of voxels.
VoxelData* voxomap::ArraySuperContainer< T_Container >::findVoxel | ( | Iterator & | it | ) |
Find voxel.
it | Iterator containing voxel position information |
VoxelData const* voxomap::ArraySuperContainer< T_Container >::findVoxel | ( | Iterator & | it | ) | const |
Find voxel.
it | Iterator containing voxel position information |
bool voxomap::ArraySuperContainer< T_Container >::hasContainer | ( | uint8_t | x | ) | const |
Check if there is sub-container.
x | X index |
bool voxomap::ArraySuperContainer< T_Container >::hasContainer | ( | uint8_t | x, |
uint8_t | y | ||
) | const |
Check if there is sub-container.
x | X index |
y | Y index |
bool voxomap::ArraySuperContainer< T_Container >::hasContainer | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | z | ||
) | const |
Check if there is sub-container.
x | X index |
y | Y index |
z | Z index |
Container* voxomap::ArraySuperContainer< T_Container >::findContainer | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | z | ||
) |
Find sub-container.
x | X index |
y | Y index |
z | Z index |
Container const* voxomap::ArraySuperContainer< T_Container >::findContainer | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | z | ||
) | const |
Find sub-container.
x | X index |
y | Y index |
z | Z index |
bool voxomap::ArraySuperContainer< T_Container >::addVoxel | ( | Iterator & | it, |
Args &&... | args | ||
) |
Add a voxel, don't update an existing voxel.
it | Iterator that contains the informations |
args | Arguments to forward to voxel constructor |
bool voxomap::ArraySuperContainer< T_Container >::updateVoxel | ( | Iterator & | it, |
Args &&... | args | ||
) |
Update an existing voxel, don't create a new one.
it | Iterator that contains the informations |
args | Arguments to forward to voxel constructor |
void voxomap::ArraySuperContainer< T_Container >::putVoxel | ( | Iterator & | it, |
Args &&... | args | ||
) |
Add or update a voxel.
it | Iterator that contains the informations |
args | Arguments to forward to voxel constructor |
bool voxomap::ArraySuperContainer< T_Container >::removeVoxel | ( | Iterator const & | it, |
Args &&... | args | ||
) |
Remove an existing voxel.
it | Iterator that contains the informations |
args | Arguments to forward to removeVoxel method of the container |
void voxomap::ArraySuperContainer< T_Container >::serialize | ( | std::string & | str | ) | const |
Serialize the structure.
str | String use for save the serialization |
size_t voxomap::ArraySuperContainer< T_Container >::unserialize | ( | char const * | str, |
size_t | size | ||
) |
Unserialize str inside this.
str | String that contains data |
size | Size of the string |
void voxomap::ArraySuperContainer< T_Container >::exploreVoxel | ( | Iterator & | it, |
std::function< void(Iterator const &)> const & | predicate | ||
) | const |
Go through all voxels of the container and call the predicate for each.
it | Begin iterator |
predicate | Function called for each voxel found |
void voxomap::ArraySuperContainer< T_Container >::exploreVoxelContainer | ( | std::function< void(typename Container::VoxelContainer const &)> const & | predicate | ) | const |
|
static |
Definition at line 37 of file ArraySuperContainer.hpp.
|
static |
Definition at line 38 of file ArraySuperContainer.hpp.
|
static |
Definition at line 39 of file ArraySuperContainer.hpp.
|
static |
Definition at line 40 of file ArraySuperContainer.hpp.
|
static |
Definition at line 41 of file ArraySuperContainer.hpp.
|
static |
Definition at line 42 of file ArraySuperContainer.hpp.
|
static |
Definition at line 43 of file ArraySuperContainer.hpp.
|
private |
Array of voxel containers.
Definition at line 180 of file ArraySuperContainer.hpp.
|
private |
Number of voxels.
Definition at line 181 of file ArraySuperContainer.hpp.