|
Voxomap
A C++11 voxel container.
|
Node optimized for voxel. More...
#include <VoxelNode.hpp>
Classes | |
| struct | NeighborAreaCache |
| Use by the method findRelativeVoxel to improve performance. More... | |
Public Types | |
| using | Container = T_Container |
| using | VoxelData = typename T_Container::VoxelData |
| using | iterator = typename T_Container::iterator |
| using | P_Node = Node< VoxelNode< T_Container > > |
Public Member Functions | |
| VoxelNode (int x, int y, int z, int size) | |
| Constructs VoxelNode with its properties. More... | |
| VoxelNode (VoxelNode const &other) | |
| Copy constructor. More... | |
| virtual | ~VoxelNode ()=default |
| Default destructor. More... | |
| iterator | begin () |
| Returns an iterator to the first voxel of the node. More... | |
| iterator | end () |
| Returns an iterator to the voxel folowing the last voxel of the node. More... | |
| unsigned int | getNbVoxel () const |
| Returns the number of voxels. More... | |
| bool | hasVoxel () const |
| Returns true if node has voxel. More... | |
| T_Container * | getVoxelContainer () |
| Returns the voxel container. More... | |
| T_Container const * | getVoxelContainer () const |
| Returns the voxel container. More... | |
| std::shared_ptr< T_Container > | getSharedVoxelContainer () |
| Returns a shared pointer to the voxel container. More... | |
| void | setVoxelContainer (std::shared_ptr< T_Container > container) |
| Sets the voxel container. More... | |
| iterator | findVoxel (int x, int y, int z) |
| Search voxel. More... | |
| bool | findVoxel (iterator &it) |
| Search voxel. More... | |
| iterator | findRelativeVoxel (int x, int y, int z) const |
| Search voxel with position relative to the node position. More... | |
| iterator | findRelativeVoxel (NeighborAreaCache &neighbor_cache, int x, int y, int z) const |
| Search voxel with position relative to the node position. Use cache structure for improve performance in case of lot of calls. More... | |
| template<typename... Args> | |
| bool | addVoxel (iterator &it, Args &&... args) |
| Add the voxel if not exist. More... | |
| template<typename... Args> | |
| bool | updateVoxel (iterator &it, Args &&... args) |
| Update the voxel if already exist. More... | |
| template<typename... Args> | |
| void | putVoxel (iterator &it, Args &&... args) |
| Add or update the voxel. More... | |
| template<typename... Args> | |
| bool | removeVoxel (iterator const &it, Args &&... args) |
| Remove an existing voxel. More... | |
| void | exploreVoxel (std::function< void(iterator const &)> const &predicate) const |
| Browse all voxels and call predicate on each. More... | |
| void | exploreVoxelContainer (std::function< void(typename T_Container::VoxelContainer const &)> const &predicate) const |
| Browse all voxel containers and call predicate on each. More... | |
| void | exploreVoxelNode (std::function< void(VoxelNode const &)> const &predicate) const |
| Browse all voxel nodes and call predicate on each. More... | |
| void | exploreVoxelNode (std::function< void(VoxelNode &)> const &predicate) |
| Browse all voxel containers and call predicate on each. More... | |
| void | exploreBoundingBox (BoundingBox< int > const &bounding_box, std::function< void(VoxelNode &)> const &in_predicate, std::function< void(VoxelNode &)> const &out_predicate) |
| Browse all voxel containers. More... | |
| void | copyOnWrite () |
| Copy the voxel container if a modification occured (add/remove/update voxel) and the container is shared with another octree. More... | |
| void | merge (VoxelNode &node) |
| Merge this with node Add existing voxel in node inside this but don't update voxel that already exists in this. More... | |
| bool | empty () const |
| Returns true if there is no voxel. More... | |
| void | serialize (std::string &str) const |
| Serialize the structure. More... | |
| size_t | unserialize (char const *str, size_t strsize) |
| Unserialize str. More... | |
Static Public Member Functions | |
| static int | findContainerPosition (int src, int container_id) |
| Method to find voxel container index inside its container. More... | |
| static int | findVoxelPosition (int src) |
| Method to find voxel index inside its container. More... | |
Private Member Functions | |
| uint32_t | serializeNode (std::string &str) const |
| Serialize node in str. More... | |
Private Attributes | |
| std::shared_ptr< T_Container > | _container |
| Voxel container. More... | |
| friend | T_Container |
Node optimized for voxel.
Definition at line 16 of file VoxelNode.hpp.
| using voxomap::VoxelNode< T_Container >::Container = T_Container |
Definition at line 24 of file VoxelNode.hpp.
| using voxomap::VoxelNode< T_Container >::VoxelData = typename T_Container::VoxelData |
Definition at line 25 of file VoxelNode.hpp.
| using voxomap::VoxelNode< T_Container >::iterator = typename T_Container::iterator |
Definition at line 26 of file VoxelNode.hpp.
| using voxomap::VoxelNode< T_Container >::P_Node = Node<VoxelNode<T_Container> > |
Definition at line 27 of file VoxelNode.hpp.
| voxomap::VoxelNode< T_Container >::VoxelNode | ( | int | x, |
| int | y, | ||
| int | z, | ||
| int | size | ||
| ) |
Constructs VoxelNode with its properties.
| x | X coordinate |
| y | Y coordinate |
| z | Z coordinate |
| size | Size of the node |
| voxomap::VoxelNode< T_Container >::VoxelNode | ( | VoxelNode< T_Container > const & | other | ) |
Copy constructor.
|
virtualdefault |
Default destructor.
| iterator voxomap::VoxelNode< T_Container >::begin | ( | ) |
Returns an iterator to the first voxel of the node.
| iterator voxomap::VoxelNode< T_Container >::end | ( | ) |
Returns an iterator to the voxel folowing the last voxel of the node.
| unsigned int voxomap::VoxelNode< T_Container >::getNbVoxel | ( | ) | const |
Returns the number of voxels.
| bool voxomap::VoxelNode< T_Container >::hasVoxel | ( | ) | const |
Returns true if node has voxel.
| T_Container* voxomap::VoxelNode< T_Container >::getVoxelContainer | ( | ) |
Returns the voxel container.
| T_Container const* voxomap::VoxelNode< T_Container >::getVoxelContainer | ( | ) | const |
Returns the voxel container.
| std::shared_ptr<T_Container> voxomap::VoxelNode< T_Container >::getSharedVoxelContainer | ( | ) |
Returns a shared pointer to the voxel container.
| void voxomap::VoxelNode< T_Container >::setVoxelContainer | ( | std::shared_ptr< T_Container > | container | ) |
Sets the voxel container.
| iterator voxomap::VoxelNode< T_Container >::findVoxel | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) |
Search voxel.
| x | X coordinate |
| y | Y coordinate |
| z | Z coordinate |
| bool voxomap::VoxelNode< T_Container >::findVoxel | ( | iterator & | it | ) |
Search voxel.
| it | Iterator with the voxel position |
| iterator voxomap::VoxelNode< T_Container >::findRelativeVoxel | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | const |
Search voxel with position relative to the node position.
| x | X coordinate |
| y | Y coordinate |
| z | Z coordinate |
| iterator voxomap::VoxelNode< T_Container >::findRelativeVoxel | ( | NeighborAreaCache & | neighbor_cache, |
| int | x, | ||
| int | y, | ||
| int | z | ||
| ) | const |
Search voxel with position relative to the node position. Use cache structure for improve performance in case of lot of calls.
| neighbor_cache | Cache structure |
| x | X coordinate |
| y | Y coordinate |
| z | Z coordinate |
| bool voxomap::VoxelNode< T_Container >::addVoxel | ( | iterator & | it, |
| Args &&... | args | ||
| ) |
Add the voxel if not exist.
| it | Iterator that contain coordinates |
| args | Arguments forward to VoxelData constructor |
| bool voxomap::VoxelNode< T_Container >::updateVoxel | ( | iterator & | it, |
| Args &&... | args | ||
| ) |
Update the voxel if already exist.
| it | Iterator that contain coordinates |
| args | Arguments forward to VoxelData constructor |
| void voxomap::VoxelNode< T_Container >::putVoxel | ( | iterator & | it, |
| Args &&... | args | ||
| ) |
Add or update the voxel.
| it | Iterator that contain coordinates |
| args | Arguments forward to VoxelData constructor |
| bool voxomap::VoxelNode< T_Container >::removeVoxel | ( | iterator const & | it, |
| Args &&... | args | ||
| ) |
Remove an existing voxel.
| it | Iterator that contain coordinates |
| args | Arguments forward to VoxelData constructor |
| void voxomap::VoxelNode< T_Container >::exploreVoxel | ( | std::function< void(iterator const &)> const & | predicate | ) | const |
Browse all voxels and call predicate on each.
| predicate | Function called for each voxel |
| void voxomap::VoxelNode< T_Container >::exploreVoxelContainer | ( | std::function< void(typename T_Container::VoxelContainer const &)> const & | predicate | ) | const |
Browse all voxel containers and call predicate on each.
| predicate | Function called for each voxel container |
| void voxomap::VoxelNode< T_Container >::exploreVoxelNode | ( | std::function< void(VoxelNode< T_Container > const &)> const & | predicate | ) | const |
Browse all voxel nodes and call predicate on each.
| predicate | Function called for each voxel node |
| void voxomap::VoxelNode< T_Container >::exploreVoxelNode | ( | std::function< void(VoxelNode< T_Container > &)> const & | predicate | ) |
Browse all voxel containers and call predicate on each.
| predicate | Function called for each voxel area |
| void voxomap::VoxelNode< T_Container >::exploreBoundingBox | ( | BoundingBox< int > const & | bounding_box, |
| std::function< void(VoxelNode< T_Container > &)> const & | in_predicate, | ||
| std::function< void(VoxelNode< T_Container > &)> const & | out_predicate | ||
| ) |
Browse all voxel containers.
| bounding_box | The aligned axis bounding box |
| in_predicate | Function called for each voxel container inside the bounding box |
| out_predicate | Function called for each voxel container outside the bounding box |
| void voxomap::VoxelNode< T_Container >::copyOnWrite | ( | ) |
Copy the voxel container if a modification occured (add/remove/update voxel) and the container is shared with another octree.
| void voxomap::VoxelNode< T_Container >::merge | ( | VoxelNode< T_Container > & | node | ) |
Merge this with node Add existing voxel in node inside this but don't update voxel that already exists in this.
| bool voxomap::VoxelNode< T_Container >::empty | ( | ) | const |
Returns true if there is no voxel.
| void voxomap::VoxelNode< T_Container >::serialize | ( | std::string & | str | ) | const |
Serialize the structure.
| str | String use for save the serialization |
| size_t voxomap::VoxelNode< T_Container >::unserialize | ( | char const * | str, |
| size_t | strsize | ||
| ) |
Unserialize str.
| str | String that contains data |
| strsize | Size of the string |
|
private |
Serialize node in str.
|
static |
Method to find voxel container index inside its container.
| src | Coordinate (x, y or z) |
| container_id | Id of the container |
|
static |
Method to find voxel index inside its container.
| src | Coordinate (x, y or z) |
|
private |
Voxel container.
Definition at line 222 of file VoxelNode.hpp.
|
private |
Definition at line 223 of file VoxelNode.hpp.