|
| C_Octree () |
|
| ~C_Octree () |
|
|
bool | is_leaf (CellHandle _ch) const |
|
bool | is_extraction_leaf (CellHandle _ch) const |
|
bool | is_root (CellHandle _ch) const |
|
int | level (CellHandle _ch) const |
|
int | depth (CellHandle _ch) const |
|
bool | is_inner_boundary (CellHandle _ch) const |
|
int | getChildIndex (BaseVecT center, coord< float > *point) |
|
int | getChildIndex (BaseVecT center, BaseVecT point) |
|
void | split (CellHandle _ch, const bool bGarbageCollectionOnTheFly=false) |
| Split the cell, i.e. create eight children. More...
|
|
void | SetPickedCell (CellHandle _ch) |
| Set the cell handle of the picked cell. More...
|
|
void | ResetPickedCell () |
| Reset the cell handle of the picked cell. More...
|
|
bool | PickParentCell () |
| Pick the parent cell of the currently picked cell. More...
|
|
bool | PickChildCell (int _idx) |
| Pick the child cell of the currently picked cell. More...
|
|
void | ResetNumberOfGeneratedCells () |
| Reset the number of generated cells. More...
|
|
LocCode | SetExtractionLevel (LocCode _level) |
| Set the level to be treated as leaf level. More...
|
|
|
CellHandle | root () const |
|
CellHandle | end () const |
|
|
CellHandle | parent (CellHandle _ch) const |
|
CellHandle | child (CellHandle _ch, int _idx) const |
|
CellHandle | face_neighbor (CellHandle _ch, int _idx) const |
|
CellHandle | edge_neighbor (CellHandle _ch, int _idx) const |
|
std::pair< std::vector< CellHandle >, std::vector< uint > > | all_corner_neighbors (CellHandle _ch, int _idx) const |
|
CellHandle | corner_neighbor (CellHandle _ch, int _idx) const |
|
void | MovePickedCell (int _key, double *_mvm) |
| Moving the picked cell, i.e. picking one of the neighbouring cells (if possible) More...
|
|
void | MovePickedCellLeft (double *_mvm) |
|
void | MovePickedCellRight (double *_mvm) |
|
void | MovePickedCellUp (double *_mvm) |
|
void | MovePickedCellDown (double *_mvm) |
|
|
int | size () const |
|
int | nr_cells () const |
|
BaseVecT | cell_corner (CellHandle _ch, int _idx) const |
|
void | cell_corner (CellHandle _ch, Scalar &_x, Scalar &_y, Scalar &_z, Scalar &_size) const |
|
void | cell_corner (CellHandle _ch, int _idx, Scalar &_x, Scalar &_y, Scalar &_z) const |
|
void | cell_corner (CellHandle _ch, int _idx, Scalar &_x, Scalar &_y, Scalar &_z, Scalar &_size) const |
|
BaseVecT | cell_center (CellHandle _ch) const |
|
void | cell_center (CellHandle _ch, Scalar &_x, Scalar &_y, Scalar &_z) const |
|
void | cell_center (CellHandle _ch, Scalar &_x, Scalar &_y, Scalar &_z, Scalar &_size) const |
|
Scalar | cell_size (CellHandle _ch) const |
|
Location & | location (CellHandle _h) |
|
const Location & | location (CellHandle _h) const |
|
CellHandle | cell (Scalar _x, Scalar _y, Scalar _z) const |
|
CellHandle | GetPickedCell () const |
| Get the handle of the picked cell. More...
|
|
int | GetNumberOfGeneratedCells () const |
| Get number of generated cells. More...
|
|
LocCode | GetExtractionLevel () const |
| Get the level to be treated as leaf level. More...
|
|
|
LocCode | m_rootLevel |
| Root level. More...
|
|
size_t | m_nextFreeBlock |
| Pointer to the next free block (garbage collection) More...
|
|
CellHandle | m_PickedCell |
| The handle of the picked octree cell. More...
|
|
int | m_NumberOfGeneratedCells |
| Number of octree cells generated; this counter is adjusted in the split routine only. More...
|
|
LocCode | m_ExtractionLevel |
| Level of the cells to be treated as leafs during surface extraction. More...
|
|
std::vector< T_CellData > | m_OctreeCell |
| Vector containing the cells. More...
|
|
void | reserve (unsigned int _size) |
|
void | resize (unsigned int _size) |
|
void | initialize (int _max_octree_level) |
| Initializing the octree with maximal level = root level (leafs have level 0) More...
|
|
void | clear () |
|
int | cell (int _i) const |
|
void | set_cell (int _i, int _cell) |
|
CellHandle | traverse (CellHandle _ch, LocCode _loc_x, LocCode _loc_y, LocCode _loc_z) const |
|
CellHandle | traverse_to_level (CellHandle _ch, LocCode _loc_x, LocCode _loc_y, LocCode _loc_z, LocCode _level) const |
|
CellHandle | get_common_ancestor (CellHandle _ch, LocCode _diff) const |
|
CellHandle | get_common_ancestor (CellHandle _ch, LocCode _diff0, LocCode _diff1) const |
|
CellHandle | get_common_ancestor (CellHandle _ch, LocCode _diff0, LocCode _diff1, LocCode _diff2) const |
|
template<typename BaseVecT, typename BoxT, typename T_CellData>
class lvr2::C_Octree< BaseVecT, BoxT, T_CellData >
An octree implementation using techniques described in
"Simple and efficient traversal methods for quadtrees and octrees", Sarah F. Frisken, Ronald N. Perry Journal of Graphics Tools, 7(3):1–11, 2002
Definition at line 26 of file Octree.hpp.
template<typename BaseVecT , typename BoxT , typename T_CellData >
int lvr2::C_Octree< BaseVecT, BoxT, T_CellData >::getChildIndex |
( |
BaseVecT |
center, |
|
|
coord< float > * |
point |
|
) |
| |
\param center The center of a cell in real world coordinates
\param point Point for to check it's position relative to the cell center
INDICES:
000 left down behind 001 right down behind 010 left top behind 011 right top behind 100 left down front 101 right down front 110 left top front 111 right top front
Definition at line 1198 of file Octree.hpp.
template<typename BaseVecT , typename BoxT , typename T_CellData >
void lvr2::C_Octree< BaseVecT, BoxT, T_CellData >::MovePickedCell |
( |
int |
_direction, |
|
|
double * |
_mvm |
|
) |
| |
Moving the picked cell, i.e. picking one of the neighbouring cells (if possible)
- Parameters
-
_direction | Direction of the movement |
_mvm | The current modelview matrix needed for estimating the plane of movement |
The rows of the current modelview matrix correspond to the camera axes in the world space. We use here the maximal components of the x- and y-axis as "guides" in which direction to move in the octree. This approach works only because the octree cells are world-axis-aligned!
Definition at line 1034 of file Octree.hpp.
template<typename BaseVecT , typename BoxT , typename T_CellData >
void lvr2::C_Octree< BaseVecT, BoxT, T_CellData >::split |
( |
CellHandle |
_parent, |
|
|
const bool |
bGarbageCollectionOnTheFly = false |
|
) |
| |
Split the cell, i.e. create eight children.
- Parameters
-
_parent | The cell handle of the parent cell |
bGarbageCollectionOnTheFly | true, if garbage collection should be done |
The following method simply splits an octree cell and generates 8 children cells. Depending on the value of bGarbageCollectionOnTheFly EITHER (false; default value) the new cells are simply pushed back in the vector(s) OR (true) we fill the next free block with the new cells, i.e. that the pointer to the next free block "m_nextFreeBlock" must not pointer to the end of the vector(s).
Definition at line 1222 of file Octree.hpp.