UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
ufo::Tree< Derived, Dim, Blocks > Class Template Reference

Utilizing curiously recurring template pattern (CRTP) More...

#include <lib/container/include/ufo/container/tree/tree.hpp>

Inheritance diagram for ufo::Tree< Derived, Dim, Blocks >:
ufo::TreeData< Derived, Dim, TreeBlock, Blocks... > ufo::TreeMap< 3, node_t >

Classes

struct  is_node_type
 
struct  TraceParams
 
struct  TraceStackElement
 

Public Types

using Bounds = AABB< Dim, coord_type >
 
using Code = TreeCode< Dim >
 
using code_type = typename Code::code_type
 
using const_iterator = TreeIterator< Derived >
 
using const_nearest_iterator = TreeNearestIterator< Derived >
 
template<class Geometry >
using const_nearest_iterator_geom = TreeNearestIterator< Derived, Geometry >
 
using const_query_iterator = TreeQueryIterator< Derived >
 
template<class Predicate >
using const_query_iterator_pred = TreeQueryIterator< Derived, Predicate >
 
using const_query_nearest_iterator = TreeQueryNearestIterator< Derived >
 
template<class Predicate , class Geometry >
using const_query_nearest_iterator_pred_geom = TreeQueryNearestIterator< Derived, Predicate, Geometry >
 
template<class Geometry >
using ConstNearest = IteratorWrapper< const_nearest_iterator_geom< Geometry >, const_nearest_iterator >
 
template<class Predicate >
using ConstQuery = IteratorWrapper< const_query_iterator_pred< Predicate >, const_query_iterator >
 
template<class Predicate , class Geometry >
using ConstQueryNearest = IteratorWrapper< const_query_nearest_iterator_pred_geom< Predicate, Geometry >, const_query_nearest_iterator >
 
using Coord = TreeCoord< Dim, coord_type >
 
using coord_type = float
 
using depth_type = std::uint32_t
 
using Index = TreeIndex
 
using Key = TreeKey< Dim >
 
using key_type = typename Key::key_type
 
using Length = Vec< Dim, length_type >
 
using length_type = double
 
using Node = TreeNode< Dim >
 
using offset_type = typename Index::offset_type
 
using Point = Vec< Dim, coord_type >
 
using pos_type = typename Index::pos_type
 
using Ray = ufo::Ray< Dim, coord_type >
 
using TraceResult = ufo::TraceResult< Dim >
 
- Public Types inherited from ufo::TreeData< Derived, Dim, TreeBlock, Blocks... >
using Index = TreeIndex
 
using InnerData = TreeContainer< typename Ts::template InnerBlock< Dim, BF >... >
 
using LeafData = TreeContainer< typename Ts::template LeafBlock< Dim, BF >... >
 
using pos_type = Index::pos_type
 

Public Member Functions

template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ancestor (NodeType node, depth_type depth) const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ancestorChecked (NodeType node, depth_type depth) const
 
const_iterator begin (bool only_leaves=true, bool only_exists=true) const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
const_iterator begin (NodeType node, bool only_leaves=true, bool only_exists=true) const
 
template<class Geometry >
const_nearest_iterator_geom< Geometry > beginNearest (Geometry const &geometry, double epsilon=0.0, bool only_leaves=true, bool only_exists=true) const
 
template<class NodeType , class Geometry , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
const_nearest_iterator_geom< Geometry > beginNearest (NodeType node, Geometry const &geometry, double epsilon=0.0, bool only_leaves=true, bool only_exists=true) const
 
template<class NodeType , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
const_query_iterator_pred< Predicate > beginQuery (NodeType node, Predicate const &pred, bool only_exists=true, bool early_stopping=false) const
 
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
const_query_iterator_pred< Predicate > beginQuery (Predicate const &pred, bool only_exists=true, bool early_stopping=false) const
 
template<class NodeType , class Predicate , class Geometry , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
const_query_nearest_iterator_pred_geom< Predicate, Geometry > beginQueryNearest (NodeType node, Predicate const &pred, Geometry const &geometry, double epsilon=0.0, bool only_exists=true, bool early_stopping=false) const
 
template<class Predicate , class Geometry , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
const_query_nearest_iterator_pred_geom< Predicate, Geometry > beginQueryNearest (Predicate const &pred, Geometry const &geometry, double epsilon=0.0, bool only_exists=true, bool early_stopping=false) const
 
constexpr pos_type block () const noexcept
 Returns the block position of the root node.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
pos_type block (NodeType node) const
 Returns the block position of node.
 
Bounds bounds () const
 Returns the bounds of the tree (/ root node).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Bounds bounds (NodeType node) const
 Returns the bounds of node.
 
Coord center () const
 Returns the center of the tree (/ root node).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr Coord center (NodeType node) const
 Returns the center of node.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
coord_type centerAxis (NodeType node, std::size_t axis) const
 Returns the center of node for the axis specified.
 
coord_type centerAxis (std::size_t axis) const
 Returns the center of the tree (/ root node) for the axis specified.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
std::optional< coord_type > centerAxisChecked (NodeType node, std::size_t axis) const
 Returns the center of node for the axis specified, if the node is valid (i.e., valid(node)).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
std::optional< CoordcenterChecked (NodeType node) const
 Returns the center of node if the node is valid (i.e., valid(node)).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr auto child (NodeType node, offset_type offset) const
 Returns the i:th child of node.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto childChecked (NodeType node, offset_type offset) const
 Get a child of a node with bounds checking.
 
pos_type children (Index node) const
 
std::array< pos_type, BF > const & children (pos_type block) const
 
void clear ()
 Erases all nodes from the tree.
 
void clear (Length const &leaf_node_length, depth_type num_depth_levels)
 
void clear (length_type const &leaf_node_length, depth_type num_depth_levels)
 
Code code () const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Code code (NodeType node) const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
std::optional< CodecodeChecked (NodeType node) const
 
template<class ExecutionPolicy , class RandomIt , std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
std::vector< Indexcreate (ExecutionPolicy &&policy, RandomIt first, RandomIt last)
 
template<class ExecutionPolicy , class RandomIt1 , class RandomIt2 , std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
RandomIt2 create (ExecutionPolicy &&policy, RandomIt1 first, RandomIt1 last, RandomIt2 d_first)
 
template<class ExecutionPolicy , class Range , std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true, std::enable_if_t<!is_node_type_v< Range >, bool > = true>
std::vector< Indexcreate (ExecutionPolicy &&policy, Range const &r)
 
template<class ExecutionPolicy , class Range , class RandomIt , std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true, std::enable_if_t<!is_node_type_v< Range >, bool > = true>
RandomIt create (ExecutionPolicy &&policy, Range const &r, RandomIt d_first)
 
template<class InputIt >
std::vector< Indexcreate (InputIt first, InputIt last)
 
template<class InputIt , class OutputIt >
OutputIt create (InputIt first, InputIt last, OutputIt d_first)
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Index create (NodeType node)
 
template<class Range , std::enable_if_t<!is_node_type_v< Range >, bool > = true>
std::vector< Indexcreate (Range const &r)
 
template<class Range , class OutputIt , std::enable_if_t<!is_node_type_v< Range > &&!execution::is_execution_policy_v< Range >, bool > = true>
OutputIt create (Range const &r, OutputIt d_first)
 
depth_type depth () const
 Returns the depth of the root node, i.e. numDepthLevels() - 1.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr depth_type depth (NodeType node) const
 Returns the depth of the node.
 
depth_type depth (pos_type block) const
 Returns the depth of the block.
 
const_iterator end () const
 
const_nearest_iterator endNearest () const
 
const_query_iterator endQuery () const
 
const_query_nearest_iterator endQueryNearest () const
 
void eraseChildren ()
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
void eraseChildren (NodeType node)
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool exists (NodeType node) const
 Checks if a node exists.
 
bool exists (pos_type block) const
 
Length halfLength () const
 Returns the half length of the tree (/ root node), i.e. length() / 2.
 
Length halfLength (depth_type depth) const
 Returns the half length of nodes at depth, i.e. length(depth) / 2.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr Length halfLength (NodeType node) const
 Returns the half length of node, i.e. length(node) / 2.
 
Length halfLengthReciprocal () const
 Returns the reciprocal of the half length of the tree (/ root node), i.e. 1 / (length() / 2) = 2 / length().
 
Length halfLengthReciprocal (depth_type depth) const
 Returns the reciprocal of the half length of nodes at depth, i.e. 1 / (length(depth) / 2) = 2 / length(depth).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Length halfLengthReciprocal (NodeType node) const
 Returns the reciprocal of the half length of node, i.e. 1 / (length(node) / 2) = 2 / length(node).
 
constexpr Index index () const noexcept
 Returns the index of the root node.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr Index index (NodeType node) const
 
bool isInside (Point coord) const
 Checks if a coordinate is inside the tree bounds, i.e. inside bounds().
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool isLeaf (NodeType node) const
 Checks if the node is a leaf (i.e., has no children).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool isParent (NodeType node) const
 Checks if the node is a parent (i.e., has children).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool isPureLeaf (NodeType node) const
 Checks if the node is a pure leaf (i.e., can never have children).
 
bool isPureLeaf (pos_type block) const
 Checks if the block is pure leaf (i.e., can never have children).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr bool isRoot (NodeType node) const
 Checks if the node is the root of the tree.
 
constexpr bool isRoot (pos_type block) const
 
Key key () const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Key key (NodeType node) const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
std::optional< KeykeyChecked (NodeType node) const
 
Length length () const
 Returns the length of the tree (/ root node), i.e. leaf_node_length * 2^depth().
 
Length length (depth_type depth) const
 Returns the length of nodes at depth, i.e. leaf_node_length * 2^depth.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Length length (NodeType node) const
 Returns the length of node, i.e. leaf_node_length * 2^depth(node).
 
Length lengthReciprocal () const
 Returns the reciprocal of the length of the tree (/ root node), i.e. 1 / length().
 
Length lengthReciprocal (depth_type depth) const
 Returns the reciprocal of the length of nodes at depth, i.e. 1 / length(depth).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Length lengthReciprocal (NodeType node) const
 Returns the reciprocal of the length of node, i.e. 1 / length(node).
 
Point max () const
 Returns the maximum point of the tree (/ root node).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Point max (NodeType node) const
 Returns the maximum point of node.
 
Point min () const
 Returns the minimum point of the tree (/ root node).
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Point min (NodeType node) const
 Returns the minimum point of node.
 
bool modified () const
 Check if the root of the tree is modified.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool modified (NodeType node) const
 Check if a node of the tree is in a modified state.
 
void modifiedReset ()
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
void modifiedReset (NodeType node)
 
void modifiedSet ()
 
void modifiedSet (bool value)
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
void modifiedSet (NodeType node)
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
void modifiedSet (NodeType node, bool value)
 
template<class Geometry >
ConstNearest< Geometry > nearest (Geometry const &geometry, double epsilon=0.0, bool only_leaves=true, bool only_exists=true) const
 
template<class NodeType , class Geometry , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
ConstNearest< Geometry > nearest (NodeType node, Geometry const &geometry, double epsilon=0.0, bool only_leaves=true, bool only_exists=true) const
 
Node node () const
 Returns the root node.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Node node (NodeType node) const
 Returns the node corresponding to node.
 
constexpr depth_type numDepthLevels () const noexcept
 Returns the number of depth levels of the tree, i.e. depth() + 1.
 
constexpr offset_type offset () const noexcept
 Returns the offset of the root node.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
offset_type offset (NodeType node) const
 Returns the offset of node.
 
template<class NodeType , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQuery< Predicate > operator() (NodeType node, Predicate const &pred, bool only_exists=true, bool early_stopping=false) const
 
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQuery< Predicate > operator() (Predicate const &pred, bool only_exists=true, bool early_stopping=false) const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Node operator[] (NodeType node) const
 Get the node corresponding to a code.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto parent (NodeType node) const
 
Index parent (pos_type block) const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto parentChecked (NodeType node) const
 
template<class NodeType , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQuery< Predicate > query (NodeType node, Predicate const &pred, bool only_exists=true, bool early_stopping=false) const
 
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQuery< Predicate > query (Predicate const &pred, bool only_exists=true, bool early_stopping=false) const
 
template<class NodeType , class Predicate , class Geometry , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQueryNearest< Predicate, Geometry > queryNearest (NodeType node, Predicate const &pred, Geometry const &geometry, double epsilon=0.0, bool only_exists=true, bool early_stopping=false) const
 
template<class Predicate , class Geometry , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQueryNearest< Predicate, Geometry > queryNearest (Predicate const &pred, Geometry const &geometry, double epsilon=0.0, bool only_exists=true, bool early_stopping=false) const
 
void reserve (std::size_t num_nodes)
 Increase the capacity of the tree to at least hold num_nodes nodes.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto sibling (NodeType node, offset_type offset) const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto siblingChecked (NodeType node, offset_type offset) const
 
std::size_t size () const
 Returns the number of nodes in the tree.
 
template<class ExecutionPolicy , class NodeType , class RandomIt , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true, std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
std::vector< TraceResulttrace (ExecutionPolicy &&policy, NodeType node, RandomIt first, RandomIt last, Predicate const &pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class ExecutionPolicy , class NodeType , class RandomIt1 , class RandomIt2 , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true, std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
RandomIt2 trace (ExecutionPolicy &&policy, NodeType node, RandomIt1 first, RandomIt1 last, RandomIt2 d_first, Predicate pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class ExecutionPolicy , class RandomIt , class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true, std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
std::vector< TraceResulttrace (ExecutionPolicy &&policy, RandomIt first, RandomIt last, Predicate const &pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class ExecutionPolicy , class RandomIt1 , class RandomIt2 , class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true, std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
RandomIt2 trace (ExecutionPolicy &&policy, RandomIt1 first, RandomIt1 last, RandomIt2 d_first, Predicate const &pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class InputIt , class OutputIt , class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
OutputIt trace (InputIt first, InputIt last, OutputIt d_first, Predicate const &pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class InputIt , class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
std::vector< TraceResulttrace (InputIt first, InputIt last, Predicate const &pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class NodeType , class InputIt , class OutputIt , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
OutputIt trace (NodeType node, InputIt first, InputIt last, OutputIt d_first, Predicate const &pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class NodeType , class InputIt , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
std::vector< TraceResulttrace (NodeType node, InputIt first, InputIt last, Predicate const &pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class NodeType , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
TraceResult trace (NodeType node, Ray const &ray, Predicate pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
TraceResult trace (Ray const &ray, Predicate const &pred, float min_dist=0.0f, float max_dist=std::numeric_limits< float >::max(), bool only_exists=true) const
 
template<class NodeType , class UnaryFun , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< std::is_invocable_r_v< bool, UnaryFun, Index >, bool > = true>
void traverse (NodeType node, UnaryFun f) const
 Depth first traversal of the tree, starting at node. The function 'f' will be called for each traversed node. If 'f' returns true then the children of the node will also be traverse, otherwise they will not.
 
template<class NodeType , class UnaryFun , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< std::is_invocable_v< UnaryFun, Node >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
void traverse (NodeType node, UnaryFun f, Predicate pred, bool only_exists=true) const
 Depth first traversal of the tree, starting at node. The function 'f' will be called for each traversed node that fulfills the predicates pred.
 
template<class UnaryFun , std::enable_if_t< std::is_invocable_r_v< bool, UnaryFun, Index >, bool > = true>
void traverse (UnaryFun f) const
 Depth first traversal of the tree, starting at the root node. The function 'f' will be called for each node traverse. If 'f' returns true then the children of the node will also be traverse, otherwise they will not.
 
template<class UnaryFun , class Predicate , std::enable_if_t< std::is_invocable_r_v< bool, UnaryFun, Node >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
void traverse (UnaryFun f, Predicate const &pred, bool only_exists=true) const
 Depth first traversal of the tree, starting at the root node. The function 'f' will be called for each node traverse. If 'f' returns true then the children of the node will also be traverse, otherwise they will not.
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool valid (NodeType node) const
 Checks if an index is valid.
 
bool valid (pos_type block) const
 Checks if a block is valid.
 
- Public Member Functions inherited from ufo::TreeData< Derived, Dim, TreeBlock, Blocks... >
bool exists (pos_type block) const
 Checks if a block exists.
 
WGPUDevice gpuDevice () const
 
bool gpuInit (WGPUAdapter adapter)
 
bool gpuInit (WGPUAdapter adapter, WGPULimits const &required_limits)
 
bool gpuInit (WGPUDevice device)
 
bool gpuInit (WGPULimits const &required_limits, WGPUSurface compatible_surface=nullptr, WGPUPowerPreference power_preference=WGPUPowerPreference_HighPerformance, WGPUBackendType backend_type=WGPUBackendType_Undefined)
 
bool gpuInit (WGPUPowerPreference power_preference=WGPUPowerPreference_HighPerformance, WGPUBackendType backend_type=WGPUBackendType_Undefined)
 
WGPUBuffer gpuInnerBuffer (std::size_t index) const
 
std::size_t gpuInnerBufferSize (std::size_t index) const
 
WGPUBuffer gpuLeafBuffer (std::size_t index) const
 
std::size_t gpuLeafBufferSize (std::size_t index) const
 
std::size_t gpuNumBuffers () const
 
std::size_t gpuNumInnerBuffers () const
 
std::size_t gpuNumLeafBuffers () const
 
WGPUQueue gpuQueue () const
 
void gpuRead ()
 
void gpuRead ()
 
void gpuReadInner ()
 
void gpuReadInner ()
 
void gpuReadLeaf ()
 
void gpuReadLeaf ()
 
void gpuRelease ()
 
bool gpuWrite ()
 
bool gpuWrite ()
 
bool gpuWriteInner ()
 
bool gpuWriteInner ()
 
bool gpuWriteLeaf ()
 
bool gpuWriteLeaf ()
 
InnerDatainnerData ()
 
InnerData const & innerData () const
 
bool innerExists (pos_type block) const
 
LeafDataleafData ()
 
LeafData const & leafData () const
 
bool leafExists (pos_type block) const
 

Static Public Member Functions

static constexpr offset_type branchingFactor () noexcept
 Returns the branching factor of the tree (i.e., 2 = binary tree, 4 = quadtree, 8 = octree, 16 = hextree).
 
static constexpr std::size_t dimensions () noexcept
 Returns the number of dimensions of the tree (i.e., 1 = binary tree, 2 = quadtree, 3 = octree, 4 = hextree).
 
static constexpr depth_type maxNumDepthLevels () noexcept
 Returns the maximum number of depth levels a tree can have.
 
static constexpr depth_type minNumDepthLevels () noexcept
 Returns the minimum number of depth levels a tree must have.
 

Static Public Attributes

template<class T >
static constexpr bool const is_node_type_v = is_node_type<T>::value
 
- Static Public Attributes inherited from ufo::TreeData< Derived, Dim, TreeBlock, Blocks... >
static constexpr TreeIndex::offset_type const BF
 
static constexpr std::size_t const NumBuffers
 

Protected Types

using Data = TreeData< Derived, Dim, TreeBlock, Blocks... >
 
using InnerBlock = typename TreeBlock::InnerBlock< Dim, BF >
 
using LeafBlock = typename TreeBlock::LeafBlock< Dim, BF >
 
using modified_type = typename LeafBlock::modified_type
 

Protected Member Functions

 Tree (Length leaf_node_length, depth_type num_depth_levels)
 
 Tree (length_type leaf_node_length, depth_type num_depth_levels)
 
 Tree (Tree &&)=default
 
 Tree (Tree const &)=default
 
bool allLeaf (InnerBlock const &block) const
 
bool allLeaf (LeafBlock const &block) const
 
bool allLeaf (pos_type block) const
 Checks if all nodes of a block are leaves.
 
bool allParent (pos_type block) const
 Checks if all nodes of a block are parents.
 
bool anyLeaf (InnerBlock const &block) const
 
bool anyLeaf (LeafBlock const &block) const
 
bool anyLeaf (pos_type block) const
 Checks if any node of a block is a leaf.
 
bool anyParent (pos_type block) const
 Checks if any node of a block is a parent.
 
Index createChild (Index node, offset_type child_offset)
 
pos_type createChildren (Index node)
 
pos_type createChildrenThreadSafe (Index node)
 
Index createChildThreadSafe (Index node, offset_type child_offset)
 
void createRoot ()
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Index createThreadSafe (NodeType node)
 
constexpr Derived & derived ()
 Returns a reference of the derived class.
 
constexpr Derived const & derived () const
 Returns a reference of the derived class.
 
void init (Length leaf_node_length, depth_type num_depth_levels)
 
void initInnerChildren (Index node, InnerBlock const &block, pos_type children)
 
void initLeafChildren (Index node, InnerBlock const &block, pos_type children)
 
template<bool OnlyDistance = false, bool FastAsSonic = false, class ValueFun , class InnerFun >
std::conditional_t< OnlyDistance, float, std::pair< float, Index > > nearest (Index node, NearestSearchAlgorithm search_alg, ValueFun value_f, InnerFun inner_f, float max_dist, float epsilon) const
 
template<class Predicate , class ValueFun , class InnerFun , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
std::pair< float, Indexnearest (Index node, Predicate pred, NearestSearchAlgorithm search_alg, ValueFun value_f, InnerFun inner_f, float max_dist, float epsilon) const
 
template<bool OnlyDistance, bool FastAsSonic, class ValueFun , class InnerFun >
std::conditional_t< OnlyDistance, float, std::pair< float, Index > > nearestDepthFirst (pos_type block, depth_type depth, float c_dist, float epsilon, ValueFun value_f, InnerFun inner_f) const
 
template<class ValueFun , class InnerFun >
std::pair< float, IndexnearestDepthFirst (pos_type block, depth_type depth, float c_dist, ValueFun value_f, InnerFun inner_f) const
 
bool noneLeaf (pos_type block) const
 Checks if no nodes of a block are leaves.
 
bool noneParent (pos_type block) const
 Checks if no nodes of a block are parents.
 
Treeoperator= (Tree &&)=default
 
Treeoperator= (Tree const &)=default
 
void pruneChildren (Index node)
 
void pruneChildren (Index node, pos_type children)
 
template<class UpdateFun , std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void recursDown (Index node, UpdateFun update_f)
 
template<class UpdateFun , std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void recursDown (pos_type block, UpdateFun update_f)
 
template<class NodeType , class NodeFun , class BlockFun , class UpdateFun , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, NodeFun, Index >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, BlockFun, pos_type >, bool > = true, std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void recursLeaves (NodeType node, NodeFun node_f, BlockFun block_f, UpdateFun update_f, bool propagate)
 
template<class NodeFun , class BlockFun , class UpdateFun , std::enable_if_t< std::is_invocable_r_v< void, NodeFun, Index >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, BlockFun, pos_type >, bool > = true, std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void recursLeaves (pos_type block, NodeFun node_f, BlockFun block_f, UpdateFun update_f)
 
template<class NodeType , class NodeFun , class BlockFun , class UpdateFun , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, NodeFun, Index >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, BlockFun, pos_type >, bool > = true, std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void recursParentFirst (NodeType node, NodeFun node_f, BlockFun block_f, UpdateFun update_f, bool propagate)
 
template<class BlockFun , std::enable_if_t< std::is_invocable_r_v< void, BlockFun, pos_type >, bool > = true>
void recursParentFirst (pos_type block, BlockFun block_f)
 
template<class UpdateFun , std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void recursUp (Index node, UpdateFun update_f)
 
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
constexpr TraceResult trace (Node node, TraceParams const &params, Predicate const &pred, float const near_clip, float const far_clip, bool only_exists) const
 
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
TraceParams traceInit (NodeType node, Ray const &ray) const
 
InnerBlock & treeInnerBlock (pos_type block)
 
InnerBlock const & treeInnerBlock (pos_type block) const
 
InnerBlock const & treeInnerBlockConst (pos_type block) const
 
LeafBlock & treeLeafBlock (pos_type block)
 
LeafBlock const & treeLeafBlock (pos_type block) const
 
LeafBlock const & treeLeafBlockConst (pos_type block) const
 
- Protected Member Functions inherited from ufo::TreeData< Derived, Dim, TreeBlock, Blocks... >
void clear ()
 
pos_type create (bool leaf)
 
pos_type createThreadSafe (bool leaf)
 
void erase (pos_type block)
 
T & innerBlock (pos_type block)
 
T const & innerBlock (pos_type block) const
 
void innerClear ()
 
pos_type innerCreate ()
 
pos_type innerCreateThreadSafe ()
 
void innerErase (pos_type block)
 
void innerReserve (std::size_t cap)
 
std::size_t innerSize () const
 
T & leafBlock (pos_type block)
 
T const & leafBlock (pos_type block) const
 
void leafClear ()
 
pos_type leafCreate ()
 
pos_type leafCreateThreadSafe ()
 
void leafErase (pos_type block)
 
void leafReserve (std::size_t cap)
 
std::size_t leafSize () const
 
void reserve (std::size_t cap)
 
std::size_t size () const
 

Static Protected Member Functions

static constexpr Point childCenter (Point center, Length half_length, offset_type child)
 Returns the center of the child_indexth child.
 
static constexpr unsigned firstNode (Point const &tm, float const t) noexcept
 
static constexpr unsigned newNode (unsigned cur, unsigned dim) noexcept
 
static constexpr Point parentCenter (Point center, Length half_length, offset_type index)
 Returns the center of the parent of the node.
 
static constexpr TraceParams traceInit (Ray const &ray, Point const &center, Length half_length) noexcept
 
- Static Protected Member Functions inherited from ufo::TreeData< Derived, Dim, TreeBlock, Blocks... >
static constexpr pos_type addInnerType (pos_type block) noexcept
 
static constexpr pos_type addLeafType (pos_type block) noexcept
 
static constexpr bool inner (pos_type block) noexcept
 
static constexpr bool leaf (pos_type block) noexcept
 
static constexpr pos_type removeInnerType (pos_type block) noexcept
 
static constexpr pos_type removeLeafType (pos_type block) noexcept
 

Protected Attributes

friend Derived
 
- Protected Attributes inherited from ufo::TreeData< Derived, Dim, TreeBlock, Blocks... >
WGPUAdapter adapter_
 
WGPUDevice device_
 
std::array< std::vector< WGPUBuffer >, NumBuffers > inner_buffers_
 
InnerData inner_data_
 
WGPUInstance instance_
 
std::array< std::vector< WGPUBuffer >, NumBuffers > leaf_buffers_
 
LeafData leaf_data_
 
std::size_t max_buffer_size_
 
WGPUQueue queue_
 

Static Protected Attributes

static constexpr TreeIndex::offset_type const BF = Data::BF
 
static constexpr modified_type const MODIFIED_ALL_SET
 
static constexpr modified_type const MODIFIED_NONE_SET = {}
 

Friends

template<class Derived2 , std::size_t Dim2, class... Blocks2>
bool operator!= (Tree< Derived2, Dim2, Blocks2... > const &lhs, Tree< Derived2, Dim2, Blocks2... > const &rhs)
 
template<class Derived2 , std::size_t Dim2, class... Blocks2>
bool operator== (Tree< Derived2, Dim2, Blocks2... > const &lhs, Tree< Derived2, Dim2, Blocks2... > const &rhs)
 

Detailed Description

template<class Derived, std::size_t Dim, class... Blocks>
class ufo::Tree< Derived, Dim, Blocks >

Utilizing curiously recurring template pattern (CRTP)

Template Parameters
Derived...
Dim...
Ts...

Definition at line 103 of file tree.hpp.

Member Typedef Documentation

◆ Bounds

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Bounds = AABB<Dim, coord_type>

Definition at line 141 of file tree.hpp.

◆ Code

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Code = TreeCode<Dim>

Definition at line 136 of file tree.hpp.

◆ code_type

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::code_type = typename Code::code_type

Definition at line 147 of file tree.hpp.

◆ const_iterator

template<class Derived , std::size_t Dim, class... Blocks>
const_iterator

Definition at line 152 of file tree.hpp.

◆ const_nearest_iterator

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::const_nearest_iterator = TreeNearestIterator<Derived>

Definition at line 160 of file tree.hpp.

◆ const_nearest_iterator_geom

template<class Derived , std::size_t Dim, class... Blocks>
template<class Geometry >
using ufo::Tree< Derived, Dim, Blocks >::const_nearest_iterator_geom = TreeNearestIterator<Derived, Geometry>

Definition at line 159 of file tree.hpp.

◆ const_query_iterator

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::const_query_iterator = TreeQueryIterator<Derived>

Definition at line 156 of file tree.hpp.

◆ const_query_iterator_pred

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate >
using ufo::Tree< Derived, Dim, Blocks >::const_query_iterator_pred = TreeQueryIterator<Derived, Predicate>

Definition at line 155 of file tree.hpp.

◆ const_query_nearest_iterator

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::const_query_nearest_iterator = TreeQueryNearestIterator<Derived>

Definition at line 165 of file tree.hpp.

◆ const_query_nearest_iterator_pred_geom

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , class Geometry >
using ufo::Tree< Derived, Dim, Blocks >::const_query_nearest_iterator_pred_geom = TreeQueryNearestIterator<Derived, Predicate, Geometry>

Definition at line 163 of file tree.hpp.

◆ ConstNearest

template<class Derived , std::size_t Dim, class... Blocks>
template<class Geometry >
using ufo::Tree< Derived, Dim, Blocks >::ConstNearest = IteratorWrapper<const_nearest_iterator_geom<Geometry>, const_nearest_iterator>

Definition at line 172 of file tree.hpp.

◆ ConstQuery

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate >
using ufo::Tree< Derived, Dim, Blocks >::ConstQuery = IteratorWrapper<const_query_iterator_pred<Predicate>, const_query_iterator>

Definition at line 168 of file tree.hpp.

◆ ConstQueryNearest

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , class Geometry >
using ufo::Tree< Derived, Dim, Blocks >::ConstQueryNearest = IteratorWrapper<const_query_nearest_iterator_pred_geom<Predicate, Geometry>, const_query_nearest_iterator>

Definition at line 176 of file tree.hpp.

◆ Coord

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Coord = TreeCoord<Dim, coord_type>

Definition at line 138 of file tree.hpp.

◆ coord_type

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::coord_type = float

Definition at line 130 of file tree.hpp.

◆ Data

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Data = TreeData<Derived, Dim, TreeBlock, Blocks...>
protected

Definition at line 112 of file tree.hpp.

◆ depth_type

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::depth_type = std::uint32_t

Definition at line 132 of file tree.hpp.

◆ Index

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Index = TreeIndex

Definition at line 134 of file tree.hpp.

◆ InnerBlock

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::InnerBlock = typename TreeBlock::InnerBlock<Dim, BF>
protected

Definition at line 117 of file tree.hpp.

◆ Key

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Key = TreeKey<Dim>

Definition at line 137 of file tree.hpp.

◆ key_type

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::key_type = typename Key::key_type

Definition at line 148 of file tree.hpp.

◆ LeafBlock

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::LeafBlock = typename TreeBlock::LeafBlock<Dim, BF>
protected

Definition at line 116 of file tree.hpp.

◆ Length

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Length = Vec<Dim, length_type>

Definition at line 140 of file tree.hpp.

◆ length_type

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::length_type = double

Definition at line 131 of file tree.hpp.

◆ modified_type

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::modified_type = typename LeafBlock::modified_type
protected

Definition at line 119 of file tree.hpp.

◆ Node

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Node = TreeNode<Dim>

Definition at line 135 of file tree.hpp.

◆ offset_type

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::offset_type = typename Index::offset_type

Definition at line 146 of file tree.hpp.

◆ Point

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Point = Vec<Dim, coord_type>

Definition at line 139 of file tree.hpp.

◆ pos_type

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::pos_type = typename Index::pos_type

Definition at line 145 of file tree.hpp.

◆ Ray

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::Ray = ufo::Ray<Dim, coord_type>

Definition at line 142 of file tree.hpp.

◆ TraceResult

template<class Derived , std::size_t Dim, class... Blocks>
using ufo::Tree< Derived, Dim, Blocks >::TraceResult = ufo::TraceResult<Dim>

Definition at line 143 of file tree.hpp.

Constructor & Destructor Documentation

◆ Tree() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
ufo::Tree< Derived, Dim, Blocks >::Tree ( Length  leaf_node_length,
depth_type  num_depth_levels 
)
inlineprotected

Definition at line 2150 of file tree.hpp.

◆ Tree() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
ufo::Tree< Derived, Dim, Blocks >::Tree ( length_type  leaf_node_length,
depth_type  num_depth_levels 
)
inlineprotected

Definition at line 2156 of file tree.hpp.

Member Function Documentation

◆ allLeaf() [1/3]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::allLeaf ( InnerBlock const &  block) const
inlineprotected

Definition at line 2504 of file tree.hpp.

◆ allLeaf() [2/3]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::allLeaf ( LeafBlock const &  block) const
inlineprotected

Definition at line 2499 of file tree.hpp.

◆ allLeaf() [3/3]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::allLeaf ( pos_type  block) const
inlineprotected

Checks if all nodes of a block are leaves.

Parameters
blockthe block to check
Returns
true if all nodes of the block are leaves, false otherwise.

Definition at line 2516 of file tree.hpp.

◆ allParent()

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::allParent ( pos_type  block) const
inlineprotected

Checks if all nodes of a block are parents.

Parameters
blockthe block to check
Returns
true if all nodes of the block are parents, false otherwise.

Definition at line 2557 of file tree.hpp.

◆ ancestor()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ufo::Tree< Derived, Dim, Blocks >::ancestor ( NodeType  node,
depth_type  depth 
) const
inline

Definition at line 1566 of file tree.hpp.

◆ ancestorChecked()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ufo::Tree< Derived, Dim, Blocks >::ancestorChecked ( NodeType  node,
depth_type  depth 
) const
inline

Definition at line 1600 of file tree.hpp.

◆ anyLeaf() [1/3]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::anyLeaf ( InnerBlock const &  block) const
inlineprotected

Definition at line 2526 of file tree.hpp.

◆ anyLeaf() [2/3]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::anyLeaf ( LeafBlock const &  block) const
inlineprotected

Definition at line 2521 of file tree.hpp.

◆ anyLeaf() [3/3]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::anyLeaf ( pos_type  block) const
inlineprotected

Checks if any node of a block is a leaf.

Parameters
blockthe block to check
Returns
true if any node of the block is a leaf, false otherwise.

Definition at line 2538 of file tree.hpp.

◆ anyParent()

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::anyParent ( pos_type  block) const
inlineprotected

Checks if any node of a block is a parent.

Parameters
blockthe block to check
Returns
true if any node of the block is a parent, false otherwise.

Definition at line 2565 of file tree.hpp.

◆ begin() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
const_iterator ufo::Tree< Derived, Dim, Blocks >::begin ( bool  only_leaves = true,
bool  only_exists = true 
) const
inline

Definition at line 1774 of file tree.hpp.

◆ begin() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
const_iterator ufo::Tree< Derived, Dim, Blocks >::begin ( NodeType  node,
bool  only_leaves = true,
bool  only_exists = true 
) const
inline

Definition at line 1781 of file tree.hpp.

◆ beginNearest() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Geometry >
const_nearest_iterator_geom< Geometry > ufo::Tree< Derived, Dim, Blocks >::beginNearest ( Geometry const &  geometry,
double  epsilon = 0.0,
bool  only_leaves = true,
bool  only_exists = true 
) const
inline

Definition at line 1818 of file tree.hpp.

◆ beginNearest() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class Geometry , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
const_nearest_iterator_geom< Geometry > ufo::Tree< Derived, Dim, Blocks >::beginNearest ( NodeType  node,
Geometry const &  geometry,
double  epsilon = 0.0,
bool  only_leaves = true,
bool  only_exists = true 
) const
inline

Definition at line 1827 of file tree.hpp.

◆ beginQuery() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
const_query_iterator_pred< Predicate > ufo::Tree< Derived, Dim, Blocks >::beginQuery ( NodeType  node,
Predicate const &  pred,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1803 of file tree.hpp.

◆ beginQuery() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
const_query_iterator_pred< Predicate > ufo::Tree< Derived, Dim, Blocks >::beginQuery ( Predicate const &  pred,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1794 of file tree.hpp.

◆ beginQueryNearest() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class Predicate , class Geometry , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
const_query_nearest_iterator_pred_geom< Predicate, Geometry > ufo::Tree< Derived, Dim, Blocks >::beginQueryNearest ( NodeType  node,
Predicate const &  pred,
Geometry const &  geometry,
double  epsilon = 0.0,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1858 of file tree.hpp.

◆ beginQueryNearest() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , class Geometry , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
const_query_nearest_iterator_pred_geom< Predicate, Geometry > ufo::Tree< Derived, Dim, Blocks >::beginQueryNearest ( Predicate const &  pred,
Geometry const &  geometry,
double  epsilon = 0.0,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1847 of file tree.hpp.

◆ block() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
constexpr pos_type ufo::Tree< Derived, Dim, Blocks >::block ( ) const
inlineconstexprnoexcept

Returns the block position of the root node.

Returns
The block position of the root node.

Definition at line 743 of file tree.hpp.

◆ block() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
pos_type ufo::Tree< Derived, Dim, Blocks >::block ( NodeType  node) const
inline

Returns the block position of node.

Parameters
nodethe node
Returns
The block position of the node.

Definition at line 756 of file tree.hpp.

◆ bounds() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
Bounds ufo::Tree< Derived, Dim, Blocks >::bounds ( ) const
inline

Returns the bounds of the tree (/ root node).

Returns
The bounds of the tree (/ root node).

Definition at line 567 of file tree.hpp.

◆ bounds() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Bounds ufo::Tree< Derived, Dim, Blocks >::bounds ( NodeType  node) const
inline

Returns the bounds of node.

Parameters
nodethe node
Returns
The bounds of the node.

Definition at line 587 of file tree.hpp.

◆ branchingFactor()

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr offset_type ufo::Tree< Derived, Dim, Blocks >::branchingFactor ( )
inlinestaticconstexprnoexcept

Returns the branching factor of the tree (i.e., 2 = binary tree, 4 = quadtree, 8 = octree, 16 = hextree).

Returns
The branching factor of the tree.

Definition at line 203 of file tree.hpp.

◆ center() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
Coord ufo::Tree< Derived, Dim, Blocks >::center ( ) const
inline

Returns the center of the tree (/ root node).

Returns
The center of the tree (/ root node).

Definition at line 637 of file tree.hpp.

◆ center() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr Coord ufo::Tree< Derived, Dim, Blocks >::center ( NodeType  node) const
inlineconstexpr

Returns the center of node.

Parameters
nodethe node
Returns
The center of the node.

Definition at line 646 of file tree.hpp.

◆ centerAxis() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
coord_type ufo::Tree< Derived, Dim, Blocks >::centerAxis ( NodeType  node,
std::size_t  axis 
) const
inline

Returns the center of node for the axis specified.

Parameters
nodethe node
axisthe axis
Returns
The center of the node for the axis specified.

Definition at line 711 of file tree.hpp.

◆ centerAxis() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
coord_type ufo::Tree< Derived, Dim, Blocks >::centerAxis ( std::size_t  axis) const
inline

Returns the center of the tree (/ root node) for the axis specified.

Parameters
axisthe axis
Returns
The center of the tree (/ root node) for the axis specified.

Definition at line 697 of file tree.hpp.

◆ centerAxisChecked()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
std::optional< coord_type > ufo::Tree< Derived, Dim, Blocks >::centerAxisChecked ( NodeType  node,
std::size_t  axis 
) const
inline

Returns the center of node for the axis specified, if the node is valid (i.e., valid(node)).

Parameters
nodethe node
axisthe axis
Returns
The center of the node for the axis specified if the node is valid, null otherwise.

Definition at line 727 of file tree.hpp.

◆ centerChecked()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
std::optional< Coord > ufo::Tree< Derived, Dim, Blocks >::centerChecked ( NodeType  node) const
inline

Returns the center of node if the node is valid (i.e., valid(node)).

Parameters
nodethe node
Returns
The center of the node if the node is valid, null otherwise.

Definition at line 682 of file tree.hpp.

◆ child()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr auto ufo::Tree< Derived, Dim, Blocks >::child ( NodeType  node,
offset_type  offset 
) const
inlineconstexpr

Returns the i:th child of node.

Parameters
nodethe node to return the child of.
offsetthe offset of the child (in range [0..2^Dim)).
Returns
i:th child of node.

Definition at line 1450 of file tree.hpp.

◆ childCenter()

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr Point ufo::Tree< Derived, Dim, Blocks >::childCenter ( Point  center,
Length  half_length,
offset_type  child 
)
inlinestaticconstexprprotected

Returns the center of the child_indexth child.

Parameters
centerthe center of the parent
half_lengththe half length of the parent
childthe offset of the child
Returns
The center of the childth child.

Definition at line 2593 of file tree.hpp.

◆ childChecked()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ufo::Tree< Derived, Dim, Blocks >::childChecked ( NodeType  node,
offset_type  offset 
) const
inline

Get a child of a node with bounds checking.

Parameters
nodeThe node.
offsetThe offset of the child.
Returns
The child.

Definition at line 1480 of file tree.hpp.

◆ children() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
pos_type ufo::Tree< Derived, Dim, Blocks >::children ( Index  node) const
inline

Definition at line 1437 of file tree.hpp.

◆ children() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
std::array< pos_type, BF > const & ufo::Tree< Derived, Dim, Blocks >::children ( pos_type  block) const
inline

Definition at line 1431 of file tree.hpp.

◆ clear() [1/3]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::clear ( )
inline

Erases all nodes from the tree.

Definition at line 234 of file tree.hpp.

◆ clear() [2/3]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::clear ( Length const &  leaf_node_length,
depth_type  num_depth_levels 
)
inline

Definition at line 241 of file tree.hpp.

◆ clear() [3/3]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::clear ( length_type const &  leaf_node_length,
depth_type  num_depth_levels 
)
inline

Definition at line 247 of file tree.hpp.

◆ code() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
Code ufo::Tree< Derived, Dim, Blocks >::code ( ) const
inline

Definition at line 891 of file tree.hpp.

◆ code() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Code ufo::Tree< Derived, Dim, Blocks >::code ( NodeType  node) const
inline

Definition at line 894 of file tree.hpp.

◆ codeChecked()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
std::optional< Code > ufo::Tree< Derived, Dim, Blocks >::codeChecked ( NodeType  node) const
inline

Definition at line 924 of file tree.hpp.

◆ create() [1/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ExecutionPolicy , class RandomIt , std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
std::vector< Index > ufo::Tree< Derived, Dim, Blocks >::create ( ExecutionPolicy &&  policy,
RandomIt  first,
RandomIt  last 
)
inline

Definition at line 1172 of file tree.hpp.

◆ create() [2/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ExecutionPolicy , class RandomIt1 , class RandomIt2 , std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
RandomIt2 ufo::Tree< Derived, Dim, Blocks >::create ( ExecutionPolicy &&  policy,
RandomIt1  first,
RandomIt1  last,
RandomIt2  d_first 
)
inline

Definition at line 1122 of file tree.hpp.

◆ create() [3/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ExecutionPolicy , class Range , std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true, std::enable_if_t<!is_node_type_v< Range >, bool > = true>
std::vector< Index > ufo::Tree< Derived, Dim, Blocks >::create ( ExecutionPolicy &&  policy,
Range const &  r 
)
inline

Definition at line 1194 of file tree.hpp.

◆ create() [4/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ExecutionPolicy , class Range , class RandomIt , std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true, std::enable_if_t<!is_node_type_v< Range >, bool > = true>
RandomIt ufo::Tree< Derived, Dim, Blocks >::create ( ExecutionPolicy &&  policy,
Range const &  r,
RandomIt  d_first 
)
inline

Definition at line 1183 of file tree.hpp.

◆ create() [5/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class InputIt >
std::vector< Index > ufo::Tree< Derived, Dim, Blocks >::create ( InputIt  first,
InputIt  last 
)
inline

Definition at line 1091 of file tree.hpp.

◆ create() [6/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class InputIt , class OutputIt >
OutputIt ufo::Tree< Derived, Dim, Blocks >::create ( InputIt  first,
InputIt  last,
OutputIt  d_first 
)
inline

Definition at line 1063 of file tree.hpp.

◆ create() [7/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Index ufo::Tree< Derived, Dim, Blocks >::create ( NodeType  node)
inline

Definition at line 1042 of file tree.hpp.

◆ create() [8/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Range , std::enable_if_t<!is_node_type_v< Range >, bool > = true>
std::vector< Index > ufo::Tree< Derived, Dim, Blocks >::create ( Range const &  r)
inline

Definition at line 1110 of file tree.hpp.

◆ create() [9/9]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Range , class OutputIt , std::enable_if_t<!is_node_type_v< Range > &&!execution::is_execution_policy_v< Range >, bool > = true>
OutputIt ufo::Tree< Derived, Dim, Blocks >::create ( Range const &  r,
OutputIt  d_first 
)
inline

Definition at line 1102 of file tree.hpp.

◆ createChild()

template<class Derived , std::size_t Dim, class... Blocks>
Index ufo::Tree< Derived, Dim, Blocks >::createChild ( Index  node,
offset_type  child_offset 
)
inlineprotected

Definition at line 2739 of file tree.hpp.

◆ createChildren()

template<class Derived , std::size_t Dim, class... Blocks>
pos_type ufo::Tree< Derived, Dim, Blocks >::createChildren ( Index  node)
inlineprotected

Definition at line 2654 of file tree.hpp.

◆ createChildrenThreadSafe()

template<class Derived , std::size_t Dim, class... Blocks>
pos_type ufo::Tree< Derived, Dim, Blocks >::createChildrenThreadSafe ( Index  node)
inlineprotected

Definition at line 2680 of file tree.hpp.

◆ createChildThreadSafe()

template<class Derived , std::size_t Dim, class... Blocks>
Index ufo::Tree< Derived, Dim, Blocks >::createChildThreadSafe ( Index  node,
offset_type  child_offset 
)
inlineprotected

Definition at line 2747 of file tree.hpp.

◆ createRoot()

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::createRoot ( )
inlineprotected

Definition at line 2262 of file tree.hpp.

◆ createThreadSafe()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Index ufo::Tree< Derived, Dim, Blocks >::createThreadSafe ( NodeType  node)
inlineprotected

Definition at line 2756 of file tree.hpp.

◆ depth() [1/3]

template<class Derived , std::size_t Dim, class... Blocks>
depth_type ufo::Tree< Derived, Dim, Blocks >::depth ( ) const
inline

Returns the depth of the root node, i.e. numDepthLevels() - 1.

Note
The tree's depth levels are [0..depth()].
Returns
The depth of the root node.

Definition at line 290 of file tree.hpp.

◆ depth() [2/3]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr depth_type ufo::Tree< Derived, Dim, Blocks >::depth ( NodeType  node) const
inlineconstexpr

Returns the depth of the node.

Note
The tree's depth levels are [0..depth()].
Parameters
nodethe node
Returns
The depth of the node.

Definition at line 314 of file tree.hpp.

◆ depth() [3/3]

template<class Derived , std::size_t Dim, class... Blocks>
depth_type ufo::Tree< Derived, Dim, Blocks >::depth ( pos_type  block) const
inline

Returns the depth of the block.

Note
The tree's depth levels are [0..depth()].
Parameters
blockthe block
Returns
The depth of the block.

Definition at line 300 of file tree.hpp.

◆ derived() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
constexpr Derived & ufo::Tree< Derived, Dim, Blocks >::derived ( )
inlineconstexprprotected

Returns a reference of the derived class.

Returns
A reference of the derived class.

Definition at line 2244 of file tree.hpp.

◆ derived() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
constexpr Derived const & ufo::Tree< Derived, Dim, Blocks >::derived ( ) const
inlineconstexprprotected

Returns a reference of the derived class.

Returns
A reference of the derived class.

Definition at line 2251 of file tree.hpp.

◆ dimensions()

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr std::size_t ufo::Tree< Derived, Dim, Blocks >::dimensions ( )
inlinestaticconstexprnoexcept

Returns the number of dimensions of the tree (i.e., 1 = binary tree, 2 = quadtree, 3 = octree, 4 = hextree).

Returns
The number of dimensions of the tree.

Definition at line 211 of file tree.hpp.

◆ end()

template<class Derived , std::size_t Dim, class... Blocks>
const_iterator ufo::Tree< Derived, Dim, Blocks >::end ( ) const
inline

Definition at line 1787 of file tree.hpp.

◆ endNearest()

template<class Derived , std::size_t Dim, class... Blocks>
const_nearest_iterator ufo::Tree< Derived, Dim, Blocks >::endNearest ( ) const
inline

Definition at line 1835 of file tree.hpp.

◆ endQuery()

template<class Derived , std::size_t Dim, class... Blocks>
const_query_iterator ufo::Tree< Derived, Dim, Blocks >::endQuery ( ) const
inline

Definition at line 1811 of file tree.hpp.

◆ endQueryNearest()

template<class Derived , std::size_t Dim, class... Blocks>
const_query_nearest_iterator ufo::Tree< Derived, Dim, Blocks >::endQueryNearest ( ) const
inline

Definition at line 1867 of file tree.hpp.

◆ eraseChildren() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::eraseChildren ( )
inline

Definition at line 1208 of file tree.hpp.

◆ eraseChildren() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::eraseChildren ( NodeType  node)
inline

Definition at line 1211 of file tree.hpp.

◆ exists() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool ufo::Tree< Derived, Dim, Blocks >::exists ( NodeType  node) const
inline

Checks if a node exists.

Parameters
nodethe node to check
Returns
true if the node exists, false otherwise.

Definition at line 1413 of file tree.hpp.

◆ exists() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::exists ( pos_type  block) const
inline

Definition at line 1401 of file tree.hpp.

◆ firstNode()

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr unsigned ufo::Tree< Derived, Dim, Blocks >::firstNode ( Point const &  tm,
float const  t 
)
inlinestaticconstexprprotectednoexcept

Definition at line 3439 of file tree.hpp.

◆ halfLength() [1/3]

template<class Derived , std::size_t Dim, class... Blocks>
Length ufo::Tree< Derived, Dim, Blocks >::halfLength ( ) const
inline

Returns the half length of the tree (/ root node), i.e. length() / 2.

Note
The half length is often used, therefore this function exists for improved performance and precision.
Returns
The half length of the tree (/ root node).

Definition at line 379 of file tree.hpp.

◆ halfLength() [2/3]

template<class Derived , std::size_t Dim, class... Blocks>
Length ufo::Tree< Derived, Dim, Blocks >::halfLength ( depth_type  depth) const
inline

Returns the half length of nodes at depth, i.e. length(depth) / 2.

Note
The half length is often used, therefore this function exists for improved performance and precision.
The tree's depth levels are [0..depth()].
Parameters
depththe depth
Returns
The half length of nodes at depth.

Definition at line 392 of file tree.hpp.

◆ halfLength() [3/3]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr Length ufo::Tree< Derived, Dim, Blocks >::halfLength ( NodeType  node) const
inlineconstexpr

Returns the half length of node, i.e. length(node) / 2.

Note
The half length is often used, therefore this function exists for improved performance and precision.
Parameters
nodethe node
Returns
The half length of the node.

Definition at line 408 of file tree.hpp.

◆ halfLengthReciprocal() [1/3]

template<class Derived , std::size_t Dim, class... Blocks>
Length ufo::Tree< Derived, Dim, Blocks >::halfLengthReciprocal ( ) const
inline

Returns the reciprocal of the half length of the tree (/ root node), i.e. 1 / (length() / 2) = 2 / length().

Note
The reciprocal of the half length is often used, therefore this function exists for improved performance and precision.
Returns
The reciprocal of the half length of the tree (/ root node).

Definition at line 466 of file tree.hpp.

◆ halfLengthReciprocal() [2/3]

template<class Derived , std::size_t Dim, class... Blocks>
Length ufo::Tree< Derived, Dim, Blocks >::halfLengthReciprocal ( depth_type  depth) const
inline

Returns the reciprocal of the half length of nodes at depth, i.e. 1 / (length(depth) / 2) = 2 / length(depth).

Note
The reciprocal of the half length is often used, therefore this function exists for improved performance and precision.
The tree's depth levels are [0..depth()].
Parameters
depththe depth
Returns
The reciprocal of the half length of nodes at depth.

Definition at line 483 of file tree.hpp.

◆ halfLengthReciprocal() [3/3]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Length ufo::Tree< Derived, Dim, Blocks >::halfLengthReciprocal ( NodeType  node) const
inline

Returns the reciprocal of the half length of node, i.e. 1 / (length(node) / 2) = 2 / length(node).

Note
The reciprocal of the half length is often used, therefore this function exists for improved performance and precision.
Parameters
nodethe node
Returns
The reciprocal of the half length of the node.

Definition at line 500 of file tree.hpp.

◆ index() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
constexpr Index ufo::Tree< Derived, Dim, Blocks >::index ( ) const
inlineconstexprnoexcept

Returns the index of the root node.

Returns
The index of the root node.

Definition at line 803 of file tree.hpp.

◆ index() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr Index ufo::Tree< Derived, Dim, Blocks >::index ( NodeType  node) const
inlineconstexpr

Definition at line 809 of file tree.hpp.

◆ init()

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::init ( Length  leaf_node_length,
depth_type  num_depth_levels 
)
inlineprotected

Definition at line 2189 of file tree.hpp.

◆ initInnerChildren()

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::initInnerChildren ( Index  node,
InnerBlock const &  block,
pos_type  children 
)
inlineprotected

Definition at line 2642 of file tree.hpp.

◆ initLeafChildren()

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::initLeafChildren ( Index  node,
InnerBlock const &  block,
pos_type  children 
)
inlineprotected

Definition at line 2632 of file tree.hpp.

◆ isInside()

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::isInside ( Point  coord) const
inline

Checks if a coordinate is inside the tree bounds, i.e. inside bounds().

Parameters
coordthe coordinate
Returns
true if the coordinate is inside the bounds, false otherwise.

Definition at line 610 of file tree.hpp.

◆ isLeaf()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool ufo::Tree< Derived, Dim, Blocks >::isLeaf ( NodeType  node) const
inline

Checks if the node is a leaf (i.e., has no children).

Parameters
nodethe node to check
Returns
true if the node is a leaf, false otherwise.

Definition at line 1292 of file tree.hpp.

◆ isParent()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool ufo::Tree< Derived, Dim, Blocks >::isParent ( NodeType  node) const
inline

Checks if the node is a parent (i.e., has children).

Parameters
nodethe node to check
Returns
true if the node is a parent, false otherwise.

Definition at line 1308 of file tree.hpp.

◆ isPureLeaf() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool ufo::Tree< Derived, Dim, Blocks >::isPureLeaf ( NodeType  node) const
inline

Checks if the node is a pure leaf (i.e., can never have children).

Note
Only have to check if the depth of the node is 0.
Parameters
nodethe node to check
Returns
true if the node is a pure leaf, false otherwise.

Definition at line 1271 of file tree.hpp.

◆ isPureLeaf() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::isPureLeaf ( pos_type  block) const
inline

Checks if the block is pure leaf (i.e., can never have children).

Note
Only have to check if the depth of the block is 0.
Parameters
blockthe block to check
Returns
true if the block is pure leaf, false otherwise.

Definition at line 1256 of file tree.hpp.

◆ isRoot() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
constexpr bool ufo::Tree< Derived, Dim, Blocks >::isRoot ( NodeType  node) const
inlineconstexpr

Checks if the node is the root of the tree.

Parameters
nodethe node to check
Returns
true if the node is the root, false otherwise.

Definition at line 1331 of file tree.hpp.

◆ isRoot() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
constexpr bool ufo::Tree< Derived, Dim, Blocks >::isRoot ( pos_type  block) const
inlineconstexpr

Definition at line 1319 of file tree.hpp.

◆ key() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
Key ufo::Tree< Derived, Dim, Blocks >::key ( ) const
inline

Definition at line 933 of file tree.hpp.

◆ key() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Key ufo::Tree< Derived, Dim, Blocks >::key ( NodeType  node) const
inline

Definition at line 936 of file tree.hpp.

◆ keyChecked()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
std::optional< Key > ufo::Tree< Derived, Dim, Blocks >::keyChecked ( NodeType  node) const
inline

Definition at line 965 of file tree.hpp.

◆ length() [1/3]

template<class Derived , std::size_t Dim, class... Blocks>
Length ufo::Tree< Derived, Dim, Blocks >::length ( ) const
inline

Returns the length of the tree (/ root node), i.e. leaf_node_length * 2^depth().

Returns
The length of the tree (/ root node).

Definition at line 342 of file tree.hpp.

◆ length() [2/3]

template<class Derived , std::size_t Dim, class... Blocks>
Length ufo::Tree< Derived, Dim, Blocks >::length ( depth_type  depth) const
inline

Returns the length of nodes at depth, i.e. leaf_node_length * 2^depth.

Note
The tree's depth levels are [0..depth()].
Parameters
depththe depth
Returns
The length of nodes at depth.

Definition at line 353 of file tree.hpp.

◆ length() [3/3]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Length ufo::Tree< Derived, Dim, Blocks >::length ( NodeType  node) const
inline

Returns the length of node, i.e. leaf_node_length * 2^depth(node).

Parameters
nodethe node
Returns
The length of the node.

Definition at line 366 of file tree.hpp.

◆ lengthReciprocal() [1/3]

template<class Derived , std::size_t Dim, class... Blocks>
Length ufo::Tree< Derived, Dim, Blocks >::lengthReciprocal ( ) const
inline

Returns the reciprocal of the length of the tree (/ root node), i.e. 1 / length().

Note
The reciprocal of the length is often used, therefore this function exists for improved performance and precision.
Returns
The reciprocal of the length of the tree (/ root node).

Definition at line 422 of file tree.hpp.

◆ lengthReciprocal() [2/3]

template<class Derived , std::size_t Dim, class... Blocks>
Length ufo::Tree< Derived, Dim, Blocks >::lengthReciprocal ( depth_type  depth) const
inline

Returns the reciprocal of the length of nodes at depth, i.e. 1 / length(depth).

Note
The reciprocal of the length is often used, therefore this function exists for improved performance and precision.
The tree's depth levels are [0..depth()].
Parameters
depththe depth
Returns
The reciprocal of the length of nodes at depth.

Definition at line 436 of file tree.hpp.

◆ lengthReciprocal() [3/3]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Length ufo::Tree< Derived, Dim, Blocks >::lengthReciprocal ( NodeType  node) const
inline

Returns the reciprocal of the length of node, i.e. 1 / length(node).

Note
The reciprocal of the length is often used, therefore this function exists for improved performance and precision.
Parameters
nodethe node
Returns
The reciprocal of the length of the node.

Definition at line 452 of file tree.hpp.

◆ max() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
Point ufo::Tree< Derived, Dim, Blocks >::max ( ) const
inline

Returns the maximum point of the tree (/ root node).

Returns
The maximum point of the tree (/ root node).

Definition at line 533 of file tree.hpp.

◆ max() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Point ufo::Tree< Derived, Dim, Blocks >::max ( NodeType  node) const
inline

Returns the maximum point of node.

Parameters
nodethe node
Returns
The maximum point of the node.

Definition at line 551 of file tree.hpp.

◆ maxNumDepthLevels()

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr depth_type ufo::Tree< Derived, Dim, Blocks >::maxNumDepthLevels ( )
inlinestaticconstexprnoexcept

Returns the maximum number of depth levels a tree can have.

Returns
The maximum number of depth levels a tree can have.

Definition at line 278 of file tree.hpp.

◆ min() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
Point ufo::Tree< Derived, Dim, Blocks >::min ( ) const
inline

Returns the minimum point of the tree (/ root node).

Returns
The minimum point of the tree (/ root node).

Definition at line 514 of file tree.hpp.

◆ min() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Point ufo::Tree< Derived, Dim, Blocks >::min ( NodeType  node) const
inline

Returns the minimum point of node.

Parameters
nodethe node
Returns
The minimum point of the node.

Definition at line 523 of file tree.hpp.

◆ minNumDepthLevels()

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr depth_type ufo::Tree< Derived, Dim, Blocks >::minNumDepthLevels ( )
inlinestaticconstexprnoexcept

Returns the minimum number of depth levels a tree must have.

Returns
The minimum number of depth levels a tree must have.

Definition at line 271 of file tree.hpp.

◆ modified() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::modified ( ) const
inline

Check if the root of the tree is modified.

Returns
Whether the root of the tree is in a modified state.

Definition at line 981 of file tree.hpp.

◆ modified() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool ufo::Tree< Derived, Dim, Blocks >::modified ( NodeType  node) const
inline

Check if a node of the tree is in a modified state.

Parameters
nodeThe node to check.
Returns
Whether the node is in a modified state.

Definition at line 990 of file tree.hpp.

◆ modifiedReset() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::modifiedReset ( )
inline

Definition at line 1017 of file tree.hpp.

◆ modifiedReset() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::modifiedReset ( NodeType  node)
inline

Definition at line 1020 of file tree.hpp.

◆ modifiedSet() [1/4]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::modifiedSet ( )
inline

Definition at line 1004 of file tree.hpp.

◆ modifiedSet() [2/4]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::modifiedSet ( bool  value)
inline

Definition at line 996 of file tree.hpp.

◆ modifiedSet() [3/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::modifiedSet ( NodeType  node)
inline

Definition at line 1007 of file tree.hpp.

◆ modifiedSet() [4/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::modifiedSet ( NodeType  node,
bool  value 
)
inline

Definition at line 999 of file tree.hpp.

◆ nearest() [1/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Geometry >
ConstNearest< Geometry > ufo::Tree< Derived, Dim, Blocks >::nearest ( Geometry const &  geometry,
double  epsilon = 0.0,
bool  only_leaves = true,
bool  only_exists = true 
) const
inline

Definition at line 1924 of file tree.hpp.

◆ nearest() [2/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<bool OnlyDistance = false, bool FastAsSonic = false, class ValueFun , class InnerFun >
std::conditional_t< OnlyDistance, float, std::pair< float, Index > > ufo::Tree< Derived, Dim, Blocks >::nearest ( Index  node,
NearestSearchAlgorithm  search_alg,
ValueFun  value_f,
InnerFun  inner_f,
float  max_dist,
float  epsilon 
) const
inlineprotected

Definition at line 2817 of file tree.hpp.

◆ nearest() [3/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , class ValueFun , class InnerFun , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
std::pair< float, Index > ufo::Tree< Derived, Dim, Blocks >::nearest ( Index  node,
Predicate  pred,
NearestSearchAlgorithm  search_alg,
ValueFun  value_f,
InnerFun  inner_f,
float  max_dist,
float  epsilon 
) const
inlineprotected

Definition at line 2867 of file tree.hpp.

◆ nearest() [4/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class Geometry , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
ConstNearest< Geometry > ufo::Tree< Derived, Dim, Blocks >::nearest ( NodeType  node,
Geometry const &  geometry,
double  epsilon = 0.0,
bool  only_leaves = true,
bool  only_exists = true 
) const
inline

Definition at line 1934 of file tree.hpp.

◆ nearestDepthFirst() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<bool OnlyDistance, bool FastAsSonic, class ValueFun , class InnerFun >
std::conditional_t< OnlyDistance, float, std::pair< float, Index > > ufo::Tree< Derived, Dim, Blocks >::nearestDepthFirst ( pos_type  block,
depth_type  depth,
float  c_dist,
float  epsilon,
ValueFun  value_f,
InnerFun  inner_f 
) const
inlineprotected

Definition at line 2891 of file tree.hpp.

◆ nearestDepthFirst() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ValueFun , class InnerFun >
std::pair< float, Index > ufo::Tree< Derived, Dim, Blocks >::nearestDepthFirst ( pos_type  block,
depth_type  depth,
float  c_dist,
ValueFun  value_f,
InnerFun  inner_f 
) const
inlineprotected

Definition at line 3091 of file tree.hpp.

◆ newNode()

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr unsigned ufo::Tree< Derived, Dim, Blocks >::newNode ( unsigned  cur,
unsigned  dim 
)
inlinestaticconstexprprotectednoexcept

Definition at line 3449 of file tree.hpp.

◆ node() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
Node ufo::Tree< Derived, Dim, Blocks >::node ( ) const
inline

Returns the root node.

Returns
The root node.

Definition at line 843 of file tree.hpp.

◆ node() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Node ufo::Tree< Derived, Dim, Blocks >::node ( NodeType  node) const
inline

Returns the node corresponding to node.

Parameters
nodethe node
Returns
The node.

Definition at line 852 of file tree.hpp.

◆ noneLeaf()

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::noneLeaf ( pos_type  block) const
inlineprotected

Checks if no nodes of a block are leaves.

Parameters
blockthe block to check
Returns
true if no nodes of the block are leaves, false otherwise.

Definition at line 2549 of file tree.hpp.

◆ noneParent()

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::noneParent ( pos_type  block) const
inlineprotected

Checks if no nodes of a block are parents.

Parameters
blockthe block to check
Returns
true if no nodes of the block are parents, false otherwise.

Definition at line 2573 of file tree.hpp.

◆ numDepthLevels()

template<class Derived , std::size_t Dim, class... Blocks>
constexpr depth_type ufo::Tree< Derived, Dim, Blocks >::numDepthLevels ( ) const
inlineconstexprnoexcept

Returns the number of depth levels of the tree, i.e. depth() + 1.

Returns
The number of depth levels of the tree.

Definition at line 261 of file tree.hpp.

◆ offset() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
constexpr offset_type ufo::Tree< Derived, Dim, Blocks >::offset ( ) const
inlineconstexprnoexcept

Returns the offset of the root node.

Returns
The offset of the root node.

Definition at line 770 of file tree.hpp.

◆ offset() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
offset_type ufo::Tree< Derived, Dim, Blocks >::offset ( NodeType  node) const
inline

Returns the offset of node.

Parameters
nodethe node
Returns
The offset of the node.

Definition at line 780 of file tree.hpp.

◆ operator()() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQuery< Predicate > ufo::Tree< Derived, Dim, Blocks >::operator() ( NodeType  node,
Predicate const &  pred,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1912 of file tree.hpp.

◆ operator()() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQuery< Predicate > ufo::Tree< Derived, Dim, Blocks >::operator() ( Predicate const &  pred,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1902 of file tree.hpp.

◆ operator[]()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
Node ufo::Tree< Derived, Dim, Blocks >::operator[] ( NodeType  node) const
inline

Get the node corresponding to a code.

Note
The node can be higher up the tree than the specified depth. This happens if the node at a higher depth has no children. If it is neccessary that the node is at the specified depth, then the corresponding 'createNode' function can be used. The data inside the nodes returned by this function and 'createNode' will be the same, so it is only neccessary to use 'createNode' if you intend to alter what the node stores.
Parameters
nodeThe node.
Returns
The node.

Definition at line 882 of file tree.hpp.

◆ parent() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ufo::Tree< Derived, Dim, Blocks >::parent ( NodeType  node) const
inline

Definition at line 1537 of file tree.hpp.

◆ parent() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
Index ufo::Tree< Derived, Dim, Blocks >::parent ( pos_type  block) const
inline

Definition at line 1529 of file tree.hpp.

◆ parentCenter()

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr Point ufo::Tree< Derived, Dim, Blocks >::parentCenter ( Point  center,
Length  half_length,
offset_type  index 
)
inlinestaticconstexprprotected

Returns the center of the parent of the node.

Parameters
centerthe center of the child
half_lengththe half length of the child
indexthe index of the child
Returns
The center of the parent.

Definition at line 2616 of file tree.hpp.

◆ parentChecked()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ufo::Tree< Derived, Dim, Blocks >::parentChecked ( NodeType  node) const
inline

Definition at line 1556 of file tree.hpp.

◆ pruneChildren() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::pruneChildren ( Index  node)
inlineprotected

Definition at line 2783 of file tree.hpp.

◆ pruneChildren() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::pruneChildren ( Index  node,
pos_type  children 
)
inlineprotected

Definition at line 2785 of file tree.hpp.

◆ query() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQuery< Predicate > ufo::Tree< Derived, Dim, Blocks >::query ( NodeType  node,
Predicate const &  pred,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1893 of file tree.hpp.

◆ query() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQuery< Predicate > ufo::Tree< Derived, Dim, Blocks >::query ( Predicate const &  pred,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1883 of file tree.hpp.

◆ queryNearest() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class Predicate , class Geometry , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQueryNearest< Predicate, Geometry > ufo::Tree< Derived, Dim, Blocks >::queryNearest ( NodeType  node,
Predicate const &  pred,
Geometry const &  geometry,
double  epsilon = 0.0,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1959 of file tree.hpp.

◆ queryNearest() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , class Geometry , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
ConstQueryNearest< Predicate, Geometry > ufo::Tree< Derived, Dim, Blocks >::queryNearest ( Predicate const &  pred,
Geometry const &  geometry,
double  epsilon = 0.0,
bool  only_exists = true,
bool  early_stopping = false 
) const
inline

Definition at line 1949 of file tree.hpp.

◆ recursDown() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class UpdateFun , std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::recursDown ( Index  node,
UpdateFun  update_f 
)
inlineprotected

Definition at line 2359 of file tree.hpp.

◆ recursDown() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class UpdateFun , std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::recursDown ( pos_type  block,
UpdateFun  update_f 
)
inlineprotected

Definition at line 2340 of file tree.hpp.

◆ recursLeaves() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class NodeFun , class BlockFun , class UpdateFun , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, NodeFun, Index >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, BlockFun, pos_type >, bool > = true, std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::recursLeaves ( NodeType  node,
NodeFun  node_f,
BlockFun  block_f,
UpdateFun  update_f,
bool  propagate 
)
inlineprotected

Definition at line 2414 of file tree.hpp.

◆ recursLeaves() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeFun , class BlockFun , class UpdateFun , std::enable_if_t< std::is_invocable_r_v< void, NodeFun, Index >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, BlockFun, pos_type >, bool > = true, std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::recursLeaves ( pos_type  block,
NodeFun  node_f,
BlockFun  block_f,
UpdateFun  update_f 
)
inlineprotected

Definition at line 2378 of file tree.hpp.

◆ recursParentFirst() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class NodeFun , class BlockFun , class UpdateFun , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, NodeFun, Index >, bool > = true, std::enable_if_t< std::is_invocable_r_v< void, BlockFun, pos_type >, bool > = true, std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::recursParentFirst ( NodeType  node,
NodeFun  node_f,
BlockFun  block_f,
UpdateFun  update_f,
bool  propagate 
)
inlineprotected

Definition at line 2470 of file tree.hpp.

◆ recursParentFirst() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class BlockFun , std::enable_if_t< std::is_invocable_r_v< void, BlockFun, pos_type >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::recursParentFirst ( pos_type  block,
BlockFun  block_f 
)
inlineprotected

Definition at line 2442 of file tree.hpp.

◆ recursUp()

template<class Derived , std::size_t Dim, class... Blocks>
template<class UpdateFun , std::enable_if_t< std::is_invocable_r_v< bool, UpdateFun, Index, pos_type >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::recursUp ( Index  node,
UpdateFun  update_f 
)
inlineprotected

Definition at line 2324 of file tree.hpp.

◆ reserve()

template<class Derived , std::size_t Dim, class... Blocks>
void ufo::Tree< Derived, Dim, Blocks >::reserve ( std::size_t  num_nodes)
inline

Increase the capacity of the tree to at least hold num_nodes nodes.

Parameters
num_nodesThe new capacity.

Definition at line 229 of file tree.hpp.

◆ sibling()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ufo::Tree< Derived, Dim, Blocks >::sibling ( NodeType  node,
offset_type  offset 
) const
inline

Definition at line 1499 of file tree.hpp.

◆ siblingChecked()

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
auto ufo::Tree< Derived, Dim, Blocks >::siblingChecked ( NodeType  node,
offset_type  offset 
) const
inline

Definition at line 1519 of file tree.hpp.

◆ size()

template<class Derived , std::size_t Dim, class... Blocks>
std::size_t ufo::Tree< Derived, Dim, Blocks >::size ( ) const
inline

Returns the number of nodes in the tree.

Returns
The number of nodes in the tree.

Definition at line 218 of file tree.hpp.

◆ trace() [1/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ExecutionPolicy , class NodeType , class RandomIt , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true, std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
std::vector< TraceResult > ufo::Tree< Derived, Dim, Blocks >::trace ( ExecutionPolicy &&  policy,
NodeType  node,
RandomIt  first,
RandomIt  last,
Predicate const &  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 2118 of file tree.hpp.

◆ trace() [2/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ExecutionPolicy , class NodeType , class RandomIt1 , class RandomIt2 , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true, std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
RandomIt2 ufo::Tree< Derived, Dim, Blocks >::trace ( ExecutionPolicy &&  policy,
NodeType  node,
RandomIt1  first,
RandomIt1  last,
RandomIt2  d_first,
Predicate  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 2070 of file tree.hpp.

◆ trace() [3/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ExecutionPolicy , class RandomIt , class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true, std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
std::vector< TraceResult > ufo::Tree< Derived, Dim, Blocks >::trace ( ExecutionPolicy &&  policy,
RandomIt  first,
RandomIt  last,
Predicate const &  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 2104 of file tree.hpp.

◆ trace() [4/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class ExecutionPolicy , class RandomIt1 , class RandomIt2 , class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true, std::enable_if_t< execution::is_execution_policy_v< ExecutionPolicy >, bool > = true>
RandomIt2 ufo::Tree< Derived, Dim, Blocks >::trace ( ExecutionPolicy &&  policy,
RandomIt1  first,
RandomIt1  last,
RandomIt2  d_first,
Predicate const &  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 2056 of file tree.hpp.

◆ trace() [5/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class InputIt , class OutputIt , class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
OutputIt ufo::Tree< Derived, Dim, Blocks >::trace ( InputIt  first,
InputIt  last,
OutputIt  d_first,
Predicate const &  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 2010 of file tree.hpp.

◆ trace() [6/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class InputIt , class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
std::vector< TraceResult > ufo::Tree< Derived, Dim, Blocks >::trace ( InputIt  first,
InputIt  last,
Predicate const &  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 2031 of file tree.hpp.

◆ trace() [7/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
constexpr TraceResult ufo::Tree< Derived, Dim, Blocks >::trace ( Node  node,
TraceParams const &  params,
Predicate const &  pred,
float const  near_clip,
float const  far_clip,
bool  only_exists 
) const
inlineconstexprprotected

Definition at line 3458 of file tree.hpp.

◆ trace() [8/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class InputIt , class OutputIt , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
OutputIt ufo::Tree< Derived, Dim, Blocks >::trace ( NodeType  node,
InputIt  first,
InputIt  last,
OutputIt  d_first,
Predicate const &  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 2021 of file tree.hpp.

◆ trace() [9/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class InputIt , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
std::vector< TraceResult > ufo::Tree< Derived, Dim, Blocks >::trace ( NodeType  node,
InputIt  first,
InputIt  last,
Predicate const &  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 2041 of file tree.hpp.

◆ trace() [10/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
TraceResult ufo::Tree< Derived, Dim, Blocks >::trace ( NodeType  node,
Ray const &  ray,
Predicate  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 1988 of file tree.hpp.

◆ trace() [11/11]

template<class Derived , std::size_t Dim, class... Blocks>
template<class Predicate , std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
TraceResult ufo::Tree< Derived, Dim, Blocks >::trace ( Ray const &  ray,
Predicate const &  pred,
float  min_dist = 0.0f,
float  max_dist = std::numeric_limits<float>::max(),
bool  only_exists = true 
) const
inline

Definition at line 1977 of file tree.hpp.

◆ traceInit() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
TraceParams ufo::Tree< Derived, Dim, Blocks >::traceInit ( NodeType  node,
Ray const &  ray 
) const
inlineprotected

Definition at line 3411 of file tree.hpp.

◆ traceInit() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
static constexpr TraceParams ufo::Tree< Derived, Dim, Blocks >::traceInit ( Ray const &  ray,
Point const &  center,
Length  half_length 
)
inlinestaticconstexprprotectednoexcept

Definition at line 3416 of file tree.hpp.

◆ traverse() [1/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class UnaryFun , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< std::is_invocable_r_v< bool, UnaryFun, Index >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::traverse ( NodeType  node,
UnaryFun  f 
) const
inline

Depth first traversal of the tree, starting at node. The function 'f' will be called for each traversed node. If 'f' returns true then the children of the node will also be traverse, otherwise they will not.

Parameters
nodeThe node to start the traversal from.
fThe callback function to be called for each node traversed.

Definition at line 1633 of file tree.hpp.

◆ traverse() [2/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , class UnaryFun , class Predicate , std::enable_if_t< is_node_type_v< NodeType >, bool > = true, std::enable_if_t< std::is_invocable_v< UnaryFun, Node >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::traverse ( NodeType  node,
UnaryFun  f,
Predicate  pred,
bool  only_exists = true 
) const
inline

Depth first traversal of the tree, starting at node. The function 'f' will be called for each traversed node that fulfills the predicates pred.

Parameters
nodeThe node to start the traversal from.
fThe callback function to be called.
predPredicates that need to be fulfilled.
only_existsWhether only existing nodes should be traversed.

Definition at line 1690 of file tree.hpp.

◆ traverse() [3/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class UnaryFun , std::enable_if_t< std::is_invocable_r_v< bool, UnaryFun, Index >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::traverse ( UnaryFun  f) const
inline

Depth first traversal of the tree, starting at the root node. The function 'f' will be called for each node traverse. If 'f' returns true then the children of the node will also be traverse, otherwise they will not.

Parameters
fThe callback function to be called for each node traversed.

Definition at line 1617 of file tree.hpp.

◆ traverse() [4/4]

template<class Derived , std::size_t Dim, class... Blocks>
template<class UnaryFun , class Predicate , std::enable_if_t< std::is_invocable_r_v< bool, UnaryFun, Node >, bool > = true, std::enable_if_t< pred::is_pred_v< Predicate >, bool > = true>
void ufo::Tree< Derived, Dim, Blocks >::traverse ( UnaryFun  f,
Predicate const &  pred,
bool  only_exists = true 
) const
inline

Depth first traversal of the tree, starting at the root node. The function 'f' will be called for each node traverse. If 'f' returns true then the children of the node will also be traverse, otherwise they will not.

Parameters
fThe callback function to be called for each node traversed.
predPredicates that need to be fulfilled.
only_existsWhether only existing nodes should be traversed.

Definition at line 1672 of file tree.hpp.

◆ treeInnerBlock() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
InnerBlock & ufo::Tree< Derived, Dim, Blocks >::treeInnerBlock ( pos_type  block)
inlineprotected

Definition at line 2297 of file tree.hpp.

◆ treeInnerBlock() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
InnerBlock const & ufo::Tree< Derived, Dim, Blocks >::treeInnerBlock ( pos_type  block) const
inlineprotected

Definition at line 2303 of file tree.hpp.

◆ treeInnerBlockConst()

template<class Derived , std::size_t Dim, class... Blocks>
InnerBlock const & ufo::Tree< Derived, Dim, Blocks >::treeInnerBlockConst ( pos_type  block) const
inlineprotected

Definition at line 2309 of file tree.hpp.

◆ treeLeafBlock() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
LeafBlock & ufo::Tree< Derived, Dim, Blocks >::treeLeafBlock ( pos_type  block)
inlineprotected

Definition at line 2279 of file tree.hpp.

◆ treeLeafBlock() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
LeafBlock const & ufo::Tree< Derived, Dim, Blocks >::treeLeafBlock ( pos_type  block) const
inlineprotected

Definition at line 2285 of file tree.hpp.

◆ treeLeafBlockConst()

template<class Derived , std::size_t Dim, class... Blocks>
LeafBlock const & ufo::Tree< Derived, Dim, Blocks >::treeLeafBlockConst ( pos_type  block) const
inlineprotected

Definition at line 2291 of file tree.hpp.

◆ valid() [1/2]

template<class Derived , std::size_t Dim, class... Blocks>
template<class NodeType , std::enable_if_t< is_node_type_v< NodeType >, bool > = true>
bool ufo::Tree< Derived, Dim, Blocks >::valid ( NodeType  node) const
inline

Checks if an index is valid.

Parameters
indexthe index to check
Returns
true if the index is valid, false otherwise.

Definition at line 1370 of file tree.hpp.

◆ valid() [2/2]

template<class Derived , std::size_t Dim, class... Blocks>
bool ufo::Tree< Derived, Dim, Blocks >::valid ( pos_type  block) const
inline

Checks if a block is valid.

Parameters
blockthe block to check
Returns
true if the block is valid, false otherwise.

Definition at line 1361 of file tree.hpp.

Member Data Documentation

◆ BF

template<class Derived , std::size_t Dim, class... Blocks>
constexpr TreeIndex::offset_type const ufo::Tree< Derived, Dim, Blocks >::BF = Data::BF
staticconstexprprotected

Definition at line 114 of file tree.hpp.

◆ Derived

template<class Derived , std::size_t Dim, class... Blocks>
friend ufo::Tree< Derived, Dim, Blocks >::Derived
protected

Definition at line 110 of file tree.hpp.

◆ is_node_type_v

template<class Derived , std::size_t Dim, class... Blocks>
template<class T >
constexpr bool const ufo::Tree< Derived, Dim, Blocks >::is_node_type_v = is_node_type<T>::value
inlinestaticconstexpr

Definition at line 188 of file tree.hpp.

◆ MODIFIED_ALL_SET

template<class Derived , std::size_t Dim, class... Blocks>
constexpr modified_type const ufo::Tree< Derived, Dim, Blocks >::MODIFIED_ALL_SET
staticconstexprprotected
Initial value:
=
static_cast<modified_type>(~(~0u << BF))

Definition at line 121 of file tree.hpp.

◆ MODIFIED_NONE_SET

template<class Derived , std::size_t Dim, class... Blocks>
constexpr modified_type const ufo::Tree< Derived, Dim, Blocks >::MODIFIED_NONE_SET = {}
staticconstexprprotected

Definition at line 123 of file tree.hpp.


The documentation for this class was generated from the following files: