#include <voxel_grid.h>
Classes | |
class | ClearVoxel |
class | ClearVoxelInMap |
class | GridOffset |
class | MarkVoxel |
class | ZOffset |
Public Member Functions | |
bool | bitsBelowThreshold (unsigned int n, unsigned int bit_threshold) |
void | clearVoxel (unsigned int x, unsigned int y, unsigned int z) |
void | clearVoxelColumn (unsigned int index) |
void | clearVoxelInMap (unsigned int x, unsigned int y, unsigned int z) |
void | clearVoxelLine (double x0, double y0, double z0, double x1, double y1, double z1, unsigned int max_length=UINT_MAX) |
void | clearVoxelLineInMap (double x0, double y0, double z0, double x1, double y1, double z1, unsigned char *map_2d, unsigned int unknown_threshold, unsigned int mark_threshold, unsigned char free_cost=0, unsigned char unknown_cost=255, unsigned int max_length=UINT_MAX) |
uint32_t * | getData () |
VoxelStatus | getVoxel (unsigned int x, unsigned int y, unsigned int z) |
VoxelStatus | getVoxelColumn (unsigned int x, unsigned int y, unsigned int unknown_threshold=0, unsigned int marked_threshold=0) |
void | markVoxel (unsigned int x, unsigned int y, unsigned int z) |
bool | markVoxelInMap (unsigned int x, unsigned int y, unsigned int z, unsigned int marked_threshold) |
void | markVoxelLine (double x0, double y0, double z0, double x1, double y1, double z1, unsigned int max_length=UINT_MAX) |
void | printColumnGrid () |
void | printVoxelGrid () |
template<class ActionType > | |
void | raytraceLine (ActionType at, double x0, double y0, double z0, double x1, double y1, double z1, unsigned int max_length=UINT_MAX) |
void | reset () |
void | resize (unsigned int size_x, unsigned int size_y, unsigned int size_z) |
Resizes a voxel grid to the desired size. | |
unsigned int | sizeX () |
unsigned int | sizeY () |
unsigned int | sizeZ () |
VoxelGrid (unsigned int size_x, unsigned int size_y, unsigned int size_z) | |
Constructor for a voxel grid. | |
~VoxelGrid () | |
Static Public Member Functions | |
static VoxelStatus | getVoxel (unsigned int x, unsigned int y, unsigned int z, unsigned int size_x, unsigned int size_y, unsigned int size_z, const uint32_t *data) |
static unsigned int | numBits (unsigned int n) |
Private Member Functions | |
template<class ActionType , class OffA , class OffB , class OffC > | |
void | bresenham3D (ActionType at, OffA off_a, OffB off_b, OffC off_c, unsigned int abs_da, unsigned int abs_db, unsigned int abs_dc, int error_b, int error_c, int offset_a, int offset_b, int offset_c, unsigned int &offset, unsigned int &z_mask, unsigned int max_length=UINT_MAX) |
unsigned int | max (unsigned int x, unsigned int y) |
int | sign (int i) |
Private Attributes | |
unsigned char * | costmap |
uint32_t * | data_ |
unsigned int | size_x_ |
unsigned int | size_y_ |
unsigned int | size_z_ |
Definition at line 62 of file voxel_grid.h.
VoxelGrid::VoxelGrid | ( | unsigned int | size_x, |
unsigned int | size_y, | ||
unsigned int | size_z | ||
) |
Constructor for a voxel grid.
size_x | The x size of the grid |
size_y | The y size of the grid |
size_z | The z size of the grid, only sizes <= 16 are supported |
Definition at line 42 of file voxel_grid.cpp.
Definition at line 89 of file voxel_grid.cpp.
bool voxel_grid::VoxelGrid::bitsBelowThreshold | ( | unsigned int | n, |
unsigned int | bit_threshold | ||
) | [inline] |
Definition at line 143 of file voxel_grid.h.
void voxel_grid::VoxelGrid::bresenham3D | ( | ActionType | at, |
OffA | off_a, | ||
OffB | off_b, | ||
OffC | off_c, | ||
unsigned int | abs_da, | ||
unsigned int | abs_db, | ||
unsigned int | abs_dc, | ||
int | error_b, | ||
int | error_c, | ||
int | offset_a, | ||
int | offset_b, | ||
int | offset_c, | ||
unsigned int & | offset, | ||
unsigned int & | z_mask, | ||
unsigned int | max_length = UINT_MAX |
||
) | [inline, private] |
Definition at line 257 of file voxel_grid.h.
void voxel_grid::VoxelGrid::clearVoxel | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z | ||
) | [inline] |
Definition at line 111 of file voxel_grid.h.
void voxel_grid::VoxelGrid::clearVoxelColumn | ( | unsigned int | index | ) | [inline] |
Definition at line 120 of file voxel_grid.h.
void voxel_grid::VoxelGrid::clearVoxelInMap | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z | ||
) | [inline] |
Definition at line 125 of file voxel_grid.h.
void VoxelGrid::clearVoxelLine | ( | double | x0, |
double | y0, | ||
double | z0, | ||
double | x1, | ||
double | y1, | ||
double | z1, | ||
unsigned int | max_length = UINT_MAX |
||
) |
Definition at line 114 of file voxel_grid.cpp.
void VoxelGrid::clearVoxelLineInMap | ( | double | x0, |
double | y0, | ||
double | z0, | ||
double | x1, | ||
double | y1, | ||
double | z1, | ||
unsigned char * | map_2d, | ||
unsigned int | unknown_threshold, | ||
unsigned int | mark_threshold, | ||
unsigned char | free_cost = 0 , |
||
unsigned char | unknown_cost = 255 , |
||
unsigned int | max_length = UINT_MAX |
||
) |
Definition at line 125 of file voxel_grid.cpp.
uint32_t* voxel_grid::VoxelGrid::getData | ( | ) | [inline] |
Definition at line 83 of file voxel_grid.h.
static VoxelStatus voxel_grid::VoxelGrid::getVoxel | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z, | ||
unsigned int | size_x, | ||
unsigned int | size_y, | ||
unsigned int | size_z, | ||
const uint32_t * | data | ||
) | [inline, static] |
Definition at line 163 of file voxel_grid.h.
VoxelStatus VoxelGrid::getVoxel | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z | ||
) |
Definition at line 143 of file voxel_grid.cpp.
VoxelStatus VoxelGrid::getVoxelColumn | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | unknown_threshold = 0 , |
||
unsigned int | marked_threshold = 0 |
||
) |
Definition at line 164 of file voxel_grid.cpp.
void voxel_grid::VoxelGrid::markVoxel | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z | ||
) | [inline] |
Definition at line 85 of file voxel_grid.h.
bool voxel_grid::VoxelGrid::markVoxelInMap | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z, | ||
unsigned int | marked_threshold | ||
) | [inline] |
Definition at line 94 of file voxel_grid.h.
void VoxelGrid::markVoxelLine | ( | double | x0, |
double | y0, | ||
double | z0, | ||
double | x1, | ||
double | y1, | ||
double | z1, | ||
unsigned int | max_length = UINT_MAX |
||
) |
Definition at line 103 of file voxel_grid.cpp.
unsigned int voxel_grid::VoxelGrid::max | ( | unsigned int | x, |
unsigned int | y | ||
) | [inline, private] |
Definition at line 283 of file voxel_grid.h.
static unsigned int voxel_grid::VoxelGrid::numBits | ( | unsigned int | n | ) | [inline, static] |
Definition at line 154 of file voxel_grid.h.
void VoxelGrid::printColumnGrid | ( | ) |
Definition at line 212 of file voxel_grid.cpp.
void VoxelGrid::printVoxelGrid | ( | ) |
Definition at line 200 of file voxel_grid.cpp.
void voxel_grid::VoxelGrid::raytraceLine | ( | ActionType | at, |
double | x0, | ||
double | y0, | ||
double | z0, | ||
double | x1, | ||
double | y1, | ||
double | z1, | ||
unsigned int | max_length = UINT_MAX |
||
) | [inline] |
Definition at line 202 of file voxel_grid.h.
void VoxelGrid::reset | ( | ) |
Definition at line 94 of file voxel_grid.cpp.
void VoxelGrid::resize | ( | unsigned int | size_x, |
unsigned int | size_y, | ||
unsigned int | size_z | ||
) |
Resizes a voxel grid to the desired size.
size_x | The x size of the grid |
size_y | The y size of the grid |
size_z | The z size of the grid, only sizes <= 16 are supported |
Definition at line 62 of file voxel_grid.cpp.
int voxel_grid::VoxelGrid::sign | ( | int | i | ) | [inline, private] |
Definition at line 279 of file voxel_grid.h.
unsigned int VoxelGrid::sizeX | ( | ) |
Definition at line 188 of file voxel_grid.cpp.
unsigned int VoxelGrid::sizeY | ( | ) |
Definition at line 192 of file voxel_grid.cpp.
unsigned int VoxelGrid::sizeZ | ( | ) |
Definition at line 196 of file voxel_grid.cpp.
unsigned char* voxel_grid::VoxelGrid::costmap [private] |
Definition at line 289 of file voxel_grid.h.
uint32_t* voxel_grid::VoxelGrid::data_ [private] |
Definition at line 288 of file voxel_grid.h.
unsigned int voxel_grid::VoxelGrid::size_x_ [private] |
Definition at line 287 of file voxel_grid.h.
unsigned int voxel_grid::VoxelGrid::size_y_ [private] |
Definition at line 287 of file voxel_grid.h.
unsigned int voxel_grid::VoxelGrid::size_z_ [private] |
Definition at line 287 of file voxel_grid.h.