15#ifndef Octree_Int_included
16#define Octree_Int_included
18#include <TRUSTArrays.h>
26template <
typename _SIZE_>
40 void build(
const int dimension,
const IntTab_t& elements_boxes);
54 const int octree_half_width,
: An octree allowing retrieval of point-like or parallelepiped-shaped objects in 1D,...
int_t search_octree_floor(int x_pos, int y_pos, int z_pos) const
returns the octree_id of the octree_floor containing the vertex (x,y,z) (may return the EMPTY octree)
ArrOfDouble_T< _SIZE_ > ArrOfDouble_t
static Octree_Type octree_type(int_t octree_id)
Returns the type of an octree based on its octree_id.
void search_elements_box_recursively(IntBoxData< _SIZE_ > &boxdata, int_t octree_id, int cx, int cy, int cz, int half_width) const
recursively searches for elements included in the box boxdata for the given octree_id,...
int_t search_elements_box(int xmin, int ymin, int zmin, int xmax, int ymax, int zmax, ArrOfInt_t &elements) const
searches for elements potentially having a non-empty intersection with the box xmin....
ArrOfInt_T< _SIZE_ > ArrOfInt_t
IntTab_T< _SIZE_ > IntTab_t
ArrOfInt_t floor_elements_
int_t build_octree_recursively(const int octree_center_x, const int octree_center_y, const int octree_center_z, const int octree_half_width, const IntTab_t &elements_boxes, ArrsOfInt_t &vect_elements_list, const int level, AOFlagS_ &tmp_elem_flags)
octree_center_i is the first int of the upper half of the octree in direction i.
static const int root_octree_half_width_
static int_t octree_id(int_t index, Octree_Type type)
builds an octree_id (see octree_structure_)
TRUSTArray< int, _SIZE_ > AOFlag_
IntTab_t octree_structure_
DoubleTab_T< _SIZE_ > DoubleTab_t
ArrsOfInt_T< _SIZE_ > ArrsOfInt_t
int_t search_elements(int x, int y, int z, int_t &floor_elements_index) const
returns the list of elements potentially containing the point (x,y,z). Returns n=number of elements i...
static int_t octree_index(int_t octree_id, Octree_Type type)
computes the index of the octree in octree_structure or floor_elements based on the type of the octre...
void search_elements_box_floor(IntBoxData< _SIZE_ > &boxdata, int_t octree_floor_id) const
adds elements from the octree_floor to boxdata.
const ArrOfInt_t & floor_elements() const
TRUST_Vector< AOFlag_ > AOFlagS_
static const int coord_max_
int_t build_octree_floor(const ArrOfInt_t &elements_list)
builds an octree_floor with the given list of elements and returns the octree_id of that octree_floor
void build(const int dimension, const IntTab_t &elements_boxes)
builds the octree.
Represents a an array of int/int64/double/... values.