MVE - Multi-View Environment mve-devel
|
A regular octree data structure (each node has zero or eight child nodes). More...
#include <octree.h>
Classes | |
struct | Iterator |
Octree iterator that keeps track of level and path through the octree. More... | |
struct | Node |
Simple recursive octree node that stores samples in a vector. More... | |
Public Member Functions | |
Octree (void) | |
virtual | ~Octree (void) |
void | clear (void) |
Resets the octree to its initial state. | |
void | clear_samples (void) |
Clears all samples in all nodes. | |
Iterator | get_iterator_for_root (void) const |
Returns an octree iterator for the root. | |
int | get_max_level (void) const |
Returns the maximum level on which voxels are generated. | |
int | get_num_levels (void) const |
Returns the number of levels (WARNING: traverses whole tree). | |
std::size_t | get_num_nodes (void) const |
Returns the number of nodes in the octree. | |
std::size_t | get_num_samples (void) const |
Returns the number of samples in the octree. | |
Node const * | get_root_node (void) const |
Returns the root node (read-only). | |
math::Vec3d const & | get_root_node_center (void) const |
Returns the center of the root node. | |
double | get_root_node_size (void) const |
Returns the size of the root node. | |
void | get_samples_per_level (std::vector< std::size_t > *stats) const |
Returns octree level statistics (WARNING: traverses whole tree). | |
void | influence_query (math::Vec3d const &pos, double factor, std::vector< Sample const * > *result) const |
Queries all samples that influence the given point. | |
void | insert_sample (Sample const &s) |
Inserts a single sample into the octree. | |
void | insert_samples (SampleList const &samples) |
Inserts all samples from the point set into the octree. | |
void | limit_octree_level (void) |
Limits the octree to the max level. | |
void | node_center_and_size (Iterator const &iter, math::Vec3d *center, double *size) const |
Retuns center and size for the iterator node. | |
void | print_stats (std::ostream &out) |
Prints some octree statistics to the stream. | |
void | refine_octree (void) |
Refines the octree by subdividing all leaves. | |
void | set_max_level (int max_level) |
Sets the maximum level on which voxels are generated. | |
A regular octree data structure (each node has zero or eight child nodes).
The octree is limited to 20 levels because of the way the iterator works and the voxel indexing scheme (see voxel.h).
|
inline |
|
inline |
Octree::Iterator fssr::Octree::get_iterator_for_root | ( | void | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void fssr::Octree::insert_sample | ( | Sample const & | s | ) |
Inserts a single sample into the octree.
The sample scale is used to determine the approriate octree level. If the sample is outside the octree root, the octree is expanded. Although new samples are not inserted in levels finer than the maximum level, samples can still end up in finer levels due to octree expansion. Thus limit_octree_level() method must be called once after all samples have been inserted.
void fssr::Octree::insert_samples | ( | SampleList const & | samples | ) |
void fssr::Octree::limit_octree_level | ( | void | ) |
void fssr::Octree::node_center_and_size | ( | Iterator const & | iter, |
math::Vec3d * | center, | ||
double * | size | ||
) | const |
void fssr::Octree::print_stats | ( | std::ostream & | out | ) |
void fssr::Octree::refine_octree | ( | void | ) |
|
inline |