|
TrioCFD 1.9.9_beta
TrioCFD documentation
|
: An octree allowing retrieval of point-like or parallelepiped-shaped objects in 1D, 2D or 3D space with integer coordinates More...
#include <Octree_Int.h>
Public Types | |
| using | int_t = _SIZE_ |
| using | ArrOfInt_t = ArrOfInt_T<_SIZE_> |
| using | IntTab_t = IntTab_T<_SIZE_> |
| using | ArrOfDouble_t = ArrOfDouble_T<_SIZE_> |
| using | DoubleTab_t = DoubleTab_T<_SIZE_> |
| using | ArrsOfInt_t = ArrsOfInt_T<_SIZE_> |
| using | AOFlag_ = TRUSTArray<int, _SIZE_> |
| using | AOFlagS_ = TRUST_Vector<AOFlag_> |
Public Member Functions | |
| void | build (const int dimension, const IntTab_t &elements_boxes) |
| builds the octree. | |
| 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 in the list, and the elements are in | |
| 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..zmax. Elements may appear more than once in the "elements" array. | |
| void | reset () |
| const ArrOfInt_t & | floor_elements () const |
Static Public Attributes | |
| static const int | coord_max_ |
| static const int | root_octree_half_width_ |
Protected Types | |
| enum | Octree_Type { EMPTY , OCTREE , FLOOR } |
Protected Member Functions | |
| 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. | |
| 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 | |
| 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) | |
| void | search_elements_box_floor (IntBoxData< _SIZE_ > &boxdata, int_t octree_floor_id) const |
| adds elements from the octree_floor to boxdata. | |
| 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, centred at cx, cy, cz. | |
Static Protected Member Functions | |
| static int_t | octree_id (int_t index, Octree_Type type) |
| builds an octree_id (see octree_structure_) | |
| 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 octree and its octree_id. | |
| static Octree_Type | octree_type (int_t octree_id) |
| Returns the type of an octree based on its octree_id. | |
Protected Attributes | |
| int_t | root_octree_id_ |
| int_t | nb_elements_ |
| IntTab_t | octree_structure_ |
| ArrOfInt_t | floor_elements_ |
: An octree allowing retrieval of point-like or parallelepiped-shaped objects in 1D, 2D or 3D space with integer coordinates
Definition at line 27 of file Octree_Int.h.
| using Octree_Int_32_64< _SIZE_ >::AOFlag_ = TRUSTArray<int, _SIZE_> |
Definition at line 36 of file Octree_Int.h.
| using Octree_Int_32_64< _SIZE_ >::AOFlagS_ = TRUST_Vector<AOFlag_> |
Definition at line 37 of file Octree_Int.h.
| using Octree_Int_32_64< _SIZE_ >::ArrOfDouble_t = ArrOfDouble_T<_SIZE_> |
Definition at line 33 of file Octree_Int.h.
| using Octree_Int_32_64< _SIZE_ >::ArrOfInt_t = ArrOfInt_T<_SIZE_> |
Definition at line 31 of file Octree_Int.h.
| using Octree_Int_32_64< _SIZE_ >::ArrsOfInt_t = ArrsOfInt_T<_SIZE_> |
Definition at line 35 of file Octree_Int.h.
| using Octree_Int_32_64< _SIZE_ >::DoubleTab_t = DoubleTab_T<_SIZE_> |
Definition at line 34 of file Octree_Int.h.
| using Octree_Int_32_64< _SIZE_ >::int_t = _SIZE_ |
Definition at line 30 of file Octree_Int.h.
| using Octree_Int_32_64< _SIZE_ >::IntTab_t = IntTab_T<_SIZE_> |
Definition at line 32 of file Octree_Int.h.
|
protected |
| Enumerator | |
|---|---|
| EMPTY | |
| OCTREE | |
| FLOOR | |
Definition at line 66 of file Octree_Int.h.
| void Octree_Int_32_64< _SIZE_ >::build | ( | const int | dimension, |
| const IntTab_t & | elements_boxes ) |
builds the octree.
The dimension (1, 2 or 3) and an array of elements to store in the octree are given. Two possibilities: 1) elements are point-like if elements_boxes.dimension(1) == dimension. In this case, each element belongs to exactly one octree_floor 2) elements are parallelepipeds, if elements_boxes.dimension(1) == dimension*2 The first "dimension" columns are the lower coordinates, the next "dimension" columns are the upper coordinates. A parallelepiped may be assigned to several octree_floors. Coordinates stored in elements_boxes range from 0 to coord_max_ inclusive. It is best to use the full integer range by multiplying by an appropriate factor.
Definition at line 99 of file Octree_Int.cpp.
|
protected |
builds an octree_floor with the given list of elements and returns the octree_id of that octree_floor
Definition at line 321 of file Octree_Int.cpp.
|
protected |
octree_center_i is the first int of the upper half of the octree in direction i.
octree_half_width is a power of 2 equal to octree_center_i-octree_min_i (octree_min_i is the first int included in this octree in direction i) Return value: octree_id of the built octree (see octree_structure_)
Definition at line 340 of file Octree_Int.cpp.
|
inline |
Definition at line 45 of file Octree_Int.h.
|
inlinestaticprotected |
builds an octree_id (see octree_structure_)
If type==EMPTY, the octree_id is 0 If type==OCTREE, index is assumed to be an index into octree_structure_ If type==FLOOR, index is assumed to be an index into floor_elements_
Definition at line 36 of file Octree_Int.cpp.
|
inlinestaticprotected |
computes the index of the octree in octree_structure or floor_elements based on the type of the octree and its octree_id.
In general the type is already known, so it is passed as a parameter for efficiency.
Definition at line 56 of file Octree_Int.cpp.
|
inlinestaticprotected |
Returns the type of an octree based on its octree_id.
Definition at line 75 of file Octree_Int.cpp.
| void Octree_Int_32_64< _SIZE_ >::reset | ( | ) |
Definition at line 309 of file Octree_Int.cpp.
| Octree_Int_32_64< _SIZE_ >::int_t Octree_Int_32_64< _SIZE_ >::search_elements | ( | int | x, |
| int | y, | ||
| int | z, | ||
| int_t & | index ) const |
returns the list of elements potentially containing the point (x,y,z). Returns n=number of elements in the list, and the elements are in
floor_elements()[index+i] for 0 <= i < n. In practice, all elements with a non-empty intersection with the octree_floor containing the point (x,y,z) are returned.
Definition at line 138 of file Octree_Int.cpp.
| Octree_Int_32_64< _SIZE_ >::int_t Octree_Int_32_64< _SIZE_ >::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..zmax. Elements may appear more than once in the "elements" array.
Definition at line 185 of file Octree_Int.cpp.
|
protected |
adds elements from the octree_floor to boxdata.
elements_
Definition at line 226 of file Octree_Int.cpp.
|
protected |
recursively searches for elements included in the box boxdata for the given octree_id, centred at cx, cy, cz.
Definition at line 260 of file Octree_Int.cpp.
|
protected |
returns the octree_id of the octree_floor containing the vertex (x,y,z) (may return the EMPTY octree)
Definition at line 469 of file Octree_Int.cpp.
|
static |
Definition at line 48 of file Octree_Int.h.
|
protected |
Definition at line 88 of file Octree_Int.h.
|
protected |
Definition at line 75 of file Octree_Int.h.
|
protected |
Definition at line 82 of file Octree_Int.h.
|
static |
Definition at line 50 of file Octree_Int.h.
|
protected |
Definition at line 73 of file Octree_Int.h.