12#include <Eigen/Geometry>
36template<
typename DataT, Res ResT = Res::Single,
int BlockSize = 8>
39 typedef std::shared_ptr<Octree<DataT, ResT, BlockSize>>
Ptr;
103 const Eigen::Affine3f&
T_OV = Eigen::Affine3f::Identity(),
119 const Eigen::Affine3f&
T_OV = Eigen::Affine3f::Identity(),
149 const Eigen::AlignedBox3i&
aabb()
const;
170 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
177 Eigen::AlignedBox3i aabb_;
182#include "impl/octree_impl.hpp"
The base class of all octants (se::Node and se::Block) in an se::Octree.
Definition octant.hpp:19
The octree data structure containing the map data.
Definition octree.hpp:37
static constexpr Res res_
Definition octree.hpp:164
Octree & operator=(const Octree &)=delete
The copy assignment operator is explicitly deleted because copying octrees is expensive.
OctreeIterator< const Octree< DataT, ResT, BlockSize > > cend() const
Octree(const int size)
Initialize an octree with an edge length of at least size voxels.
DataT DataType
Definition octree.hpp:40
std::shared_ptr< Octree< DataT, ResT, BlockSize > > Ptr
Definition octree.hpp:39
OctreeIterator< const Octree< DataT, ResT, BlockSize > > end() const
int saveMesh(const std::string &filename, const Eigen::Affine3f &T_OV=Eigen::Affine3f::Identity(), const int min_desired_scale=0) const
Save the mesh returned by se::Octree::mesh() in filename.
int getMaxScale() const
Return the maximum octree scale, that is, the scale of the root node.
bool allocate(NodeType *const parent_ptr, const int child_idx, OctantBase *&child_ptr)
Allocate a child of a node.
StructureMesh structure(const Eigen::Affine3f &T_OV=Eigen::Affine3f::Identity(), const bool only_leaves=true) const
Return a mesh of the octree structure in the octree frame in units of voxels.
const Eigen::AlignedBox3i & aabb() const
Return the axis-aligned bounding box of the octree's allocated leaves.
bool contains(const Eigen::Vector3i &voxel_coord) const
Return whether point voxel_coord with coordinates in voxels is contained in the octree.
OctreeIterator< Octree< DataT, ResT, BlockSize > > end()
OctantBase * getRoot() const
Const version of se::Octree::getRoot().
Node< DataT, ResT > NodeType
Definition octree.hpp:41
static constexpr Semantics sem_
Definition octree.hpp:163
int getSize() const
Return the edge length of the octree volume in voxels.
QuadMesh< Colour::Off, Semantics::Off > StructureMesh
Definition octree.hpp:44
int saveStructure(const std::string &filename, const Eigen::Affine3f &T_OV=Eigen::Affine3f::Identity(), const bool only_leaves=true) const
Save the mesh returned by se::Octree::structure() in filename.
void deleteChildren(NodeType *const parent_ptr)
Recursively delete all the children of parent_ptr.
int getBlockDepth() const
Return the depth blocks are allocated at.
OctreeIterator< const Octree< DataT, ResT, BlockSize > > cbegin() const
OctreeIterator< const Octree< DataT, ResT, BlockSize > > begin() const
void aabbExtend(const Eigen::Vector3i &voxel_coord, const int size)
Extend the octree allocated leaf AABB to contain the octant with coordinates in voxels voxel_coord an...
Octree(const Octree &)=delete
The copy constructor is explicitly deleted because copying octrees is expensive.
void allocateChildren(NodeType *const parent_ptr)
Allocate all the children of parent_ptr.
static constexpr Field fld_
Definition octree.hpp:161
static constexpr Colour col_
Definition octree.hpp:162
OctreeIterator< Octree< DataT, ResT, BlockSize > > begin()
SurfaceMesh mesh(const Eigen::Affine3f &T_OV=Eigen::Affine3f::Identity(), const int min_desired_scale=0) const
Return a mesh of the reconstructed surface in the octree frame in units of voxels.
Block< DataT, ResT, BlockSize > BlockType
Definition octree.hpp:42
static constexpr scale_t max_block_scale
The maximum scale of a block.
Definition octree.hpp:168
TriangleMesh< DataT::col_, DataT::sem_ > SurfaceMesh
Definition octree.hpp:43
OctantBase * getRoot()
Return a non-null pointer to the octree's root node.
static constexpr int block_size
The edge length of a block in voxels.
Definition octree.hpp:166
constexpr int size_to_scale(const int octant_size)
Return the octree scale corresponding to octant_size in voxels.
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14
Res
Definition setup_util.hpp:23
Field
Definition setup_util.hpp:18
Semantics
Definition setup_util.hpp:20
uint64_t scale_t
The type of the scale in the morton code.
Definition type_util.hpp:45
Colour
Definition setup_util.hpp:19