supereight
Loading...
Searching...
No Matches
octant_util.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016-2019 Emanuele Vespa
3 * SPDX-FileCopyrightText: 2021 Smart Robotics Lab, Imperial College London, Technical University of Munich
4 * SPDX-FileCopyrightText: 2021 Nils Funk
5 * SPDX-FileCopyrightText: 2021 Sotiris Papatheodorou
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#ifndef SE_OCTANT_UTIL_HPP
10#define SE_OCTANT_UTIL_HPP
11
13
14
15namespace se {
16namespace octantops {
17
18
19
28template<typename BlockT, se::Sort SortT = se::Sort::SmallToLarge>
29inline typename std::enable_if_t<SortT == se::Sort::SmallToLarge>
30sort_blocks(std::vector<se::OctantBase*>& block_ptrs);
31
40template<typename BlockT, se::Sort SortT>
41inline typename std::enable_if_t<SortT == se::Sort::LargeToSmall>
42sort_blocks(std::vector<se::OctantBase*>& block_ptrs);
43
45constexpr int size_to_scale(const int octant_size);
46
48constexpr int scale_to_size(const int octant_scale);
49
58template<typename OctreeT>
60
69template<typename OctreeT>
71
80template<typename OctreeT>
82
83
84
85} // namespace octantops
86} // namespace se
87
88#include "impl/octant_util_impl.hpp"
89
90#endif // SE_OCTANT_UTIL_HPP
Definition image.hpp:19
The base class of all octants (se::Node and se::Block) in an se::Octree.
Definition octant.hpp:19
se::key_t octant_to_key(const se::OctantBase *octant_ptr)
Get the octant's key.
int octant_to_scale(const se::OctantBase *octant_ptr)
Get the octant's scale.
constexpr int scale_to_size(const int octant_scale)
Return the octant size in voxels corresponding to octant_scale.
constexpr int size_to_scale(const int octant_size)
Return the octree scale corresponding to octant_size in voxels.
std::enable_if_t< SortT==se::Sort::SmallToLarge > sort_blocks(std::vector< se::OctantBase * > &block_ptrs)
Sort a vector of blocks according to its morton code from small to large.
int octant_to_size(const se::OctantBase *octant_ptr)
Get the octant's size.
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14
uint64_t key_t
key = 1 bit buffer + 57 bits of morton code + 6 bits of scale information The maxium scale is limited...
Definition type_util.hpp:43