38 #include <gtest/gtest.h> 41 int size_x = 50, size_y = 10, size_z = 16;
46 int table_x_min = 5, table_x_max = 15;
47 int table_y_min = 0, table_y_max = 3;
48 for(
int x = table_x_min; x <= table_x_max; x++){
49 vg.
markVoxelLine(x, table_y_min, table_z, x, table_y_max, table_z);
52 for(
int i = table_x_min; i <= table_x_max; ++i){
53 for(
int j = table_y_min; j <= table_y_max; ++j){
60 unsigned int unknown_count = 0;
62 for(
unsigned int i = 0; i < vg.
sizeX(); ++i){
63 for(
unsigned int j = 0; j < vg.
sizeY(); ++j){
64 for(
unsigned int k = 0; k < vg.
sizeZ(); ++k){
74 ASSERT_EQ(mark_count, 44);
80 vg.
clearVoxelLine(table_x_min, table_y_min, table_z, table_x_max, table_y_min, table_z);
86 for(
unsigned int i = 0; i < vg.
sizeX(); ++i){
87 for(
unsigned int j = 0; j < vg.
sizeY(); ++j){
88 for(
unsigned int k = 0; k < vg.
sizeZ(); ++k){
103 ASSERT_EQ(mark_count, 33);
106 ASSERT_EQ(free_count, 11);
112 for(
unsigned int i = 0; i < vg.
sizeZ(); ++i){
123 for(
unsigned int i = 0; i < vg.
sizeZ(); ++i){
143 int main(
int argc,
char** argv){
144 testing::InitGoogleTest(&argc, argv);
145 return RUN_ALL_TESTS();
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)
int main(int argc, char **argv)
void markVoxel(unsigned int x, unsigned int y, unsigned int z)
void markVoxelLine(double x0, double y0, double z0, double x1, double y1, double z1, unsigned int max_length=UINT_MAX)
void clearVoxelLine(double x0, double y0, double z0, double x1, double y1, double z1, unsigned int max_length=UINT_MAX)
TEST(voxel_grid, basicMarkingAndClearing)