 |
Voxomap
A C++11 voxel container.
|
Go to the documentation of this file. 1 #ifndef _VOXOMAP_SIDEDCONTAINER_HPP_
2 #define _VOXOMAP_SIDEDCONTAINER_HPP_
7 #include "../VoxelNode.hpp"
8 #include "../iterator.hpp"
42 template <
class T_Voxel>
52 template <typename T, typename = typename std::enable_if<!std::is_class<T>::value,
int>::type>
57 template <typename T, typename = typename std::enable_if<std::is_class<T>::value,
int>::type>
62 template <
typename T,
typename U,
typename... Args>
77 template <
typename... Args>
89 operator bool()
const;
154 template <
template <
class...>
class T_Container,
class T_Voxel>
161 const static uint32_t
NB_VOXELS = T_Container<VoxelData>::NB_VOXELS;
194 template <
typename Iterator,
typename... Args>
202 template <
typename Iterator,
typename... Args>
209 template <
typename Iterator,
typename... Args>
217 template <
typename Iterator>
237 template <
typename Iterator>
239 template <
typename Iterator>
241 template <
typename Iterator>
243 template <
class Iterator>
friend void addSide(Iterator
const& otherIt,
SideEnum side);
252 #include "SidedContainer.ipp"
254 #endif // _VOXOMAP_SidedContainer_HPP_
static const uint32_t NB_VOXELS
uint16_t getNbSide() const
Returns number of sides.
uint8_t operator&(uint8_t s) const
Returns AND of internal side with s.
bool updateVoxel(Iterator &it, Args &&... args)
Update an existing voxel, don't create a new one.
SidedVoxel(T arg)
Constructor with one argument forward to Voxel constructor.
uint8_t getSide() const
Returns internal side.
uint8_t operator|(SideEnum s) const
Returns OR of internal side with s.
bool addVoxel(Iterator &it, Args &&... args)
Add a voxel, don't update an existing voxel.
SidedVoxel(SidedVoxel &&other)=default
Move constructor.
SidedVoxel & operator|=(uint8_t s)
Apply OR.
void init(VoxelNode< SidedContainer > const &)
Initialization method, do nothing.
SidedVoxel & operator=(SidedVoxel const &other)=default
Default assignement operator.
SidedContainer()=default
Default constructor.
bool operator!=(uint8_t s) const
True if the side of this is different to s.
void putVoxel(Iterator &it, Args &&... args)
Add or update a voxel.
SideEnum
List of the voxel sides.
static const uint32_t VOXEL_MASK
SidedContainer(SidedContainer &&other)=default
Default move constructor.
SidedVoxel(T const &arg)
Constructor with one argument forward to Voxel constructor.
bool operator!=(SidedVoxel const &other) const
Call the T_Voxel method operator!=.
void updateSide(Iterator const &it)
SidedVoxel(T &&arg_1, U &&arg_2, Args &&... args)
Constructor with arguments forward to Voxel constructor.
friend void removeSide(Iterator const ¤tIt, Iterator const &otherIt, SideEnum s1, SideEnum s2)
uint8_t operator&(SideEnum s) const
Returns AND of internal side with s.
bool operator==(uint8_t s) const
True if the side of this is equal to s.
SidedVoxel(SidedVoxel const &other)=default
Copy constructor.
void serialize(std::string &str) const
Serialize the structure.
Node optimized for voxel.
SidedContainer(SidedContainer const &other)=default
Default copy constructor.
size_t unserialize(char const *str, size_t size)
Unserialize str inside this.
void removeSide(Iterator const &it)
bool operator==(SidedVoxel const &other) const
Call the T_Voxel method operator==.
SidedVoxel()=default
Default constructor.
void exploreVoxelContainer(std::function< void(SidedContainer const &)> const &predicate) const
static const uint32_t COORD_MASK
bool removeVoxel(Iterator const &it, VoxelData *voxel=nullptr)
Remove an existing voxel.
bool operator==(T_Voxel const &other) const
Call the T_Voxel method operator==.
Voxel with side informations Side is present if the corresponding neighbor voxel exist....
friend void addSide(Iterator const &otherIt, SideEnum side)
Wrap a voxel container to add side features.
static const uint32_t NB_SUPERCONTAINER
void addSide(Iterator const &it)
SidedVoxel & operator=(SidedVoxel &&other)=default
Default move assignement operator.
uint8_t operator|(uint8_t s) const
Returns OR of internal side with s.
SidedVoxel(SideEnum side, Args &&... args)
Constructor with side information.
bool operator!=(T_Voxel const &other) const
Call the T_Voxel method operator!=.
SidedVoxel & operator&=(uint8_t s)
Apply AND.
friend void updateSide(Iterator const ¤tIt, Iterator const &otherIt, SideEnum s1, SideEnum s2)