PointCloud2BIM Library
1.0
Library to facilitate the transpormation of point clouds into digital BIM representation
|
Public Member Functions | |
BitGrid (int dimensions, struct BoundingBoxInfo &bbox, double step) | |
Creates bitgrid with given dimensions. More... | |
void | reset () |
Reset vector of points and resize it to current size. | |
const std::vector< bool > & | getPoints () |
Get the points object. More... | |
void | getActiveCellsIndex (std::vector< int > &res) |
Put active index ids into a vector. More... | |
BoundingBoxInfo & | getBBox () |
Get the bounding box struct. More... | |
bool | get (int i) |
Get grid item by coordinate index (1d or nth point in vector). More... | |
bool | get (int x, int y) |
Get grid item by coordinate indexes (2d). More... | |
bool | get (int x, int y, int z) |
Get grid item by coordinate indexes (3d). More... | |
int | getX (int i) |
Get x index coordinate from single vector index. More... | |
int | getY (int i) |
Get y index coordinate from single vector index. More... | |
bool | pointExists (PointXYZ &p) |
Check if points exists in our bit grid and if it is set true. More... | |
PointXYZ | getPoint (int i) |
Return a point from vector index. More... | |
double | getArea () |
Get the area of our grid. Only works for 2d grids. More... | |
int | getActiveCells () |
Get the number of active cells (marked as true). More... | |
int | getDimensions () |
Get grid dimensions. More... | |
int | getSize () |
Get the size of our grid (length of vector). More... | |
int | getSizeX () |
Get grid size in x direction. More... | |
int | getSizeY () |
Get grid size in y direction. More... | |
int | getSizeZ () |
Get grid size in z direction. More... | |
double | getStepX () |
Get size of grid step in the x direction. More... | |
double | getStepY () |
Get size of grid step in the y direction. More... | |
double | getStepZ () |
Get size of grid step in the z direction. More... | |
void | invert () |
Activate deactivated cells and deactivate activated. Used in backfill algorithm. | |
void | backfill () |
Backfill holes in the activated grid. Useful for found rooms not to miss some inner points. | |
bool | add (PointXYZNormal &p) |
Activate grid cell. Cell coordinates are computed for the given point. More... | |
bool | add (PointXYZ &p) |
Activate grid cell. Cell coordinates are computed for the given point. More... | |
void | add (int i) |
Activate grid cell by 1d index. More... | |
void | add (int x, int y) |
Activate grid by integer x,y coordinates. More... | |
void | remove (int i) |
Deactivate grid cell by 1d index. More... | |
std::vector< PointXYZ > | getBoundingPolygon () |
Returns bounding polygon. More... | |
svg::Document | toSVG (std::filesystem::path path) |
Saves BitGrid to SVG format. More... | |
BitGrid::BitGrid | ( | int | dimensions, |
struct BoundingBoxInfo & | bbox, | ||
double | step | ||
) |
Creates bitgrid with given dimensions.
dimensions | Number of dimensions |
bbox | Bounding box of BitGrid to be created |
step | Cell size |
bool BitGrid::add | ( | PointXYZNormal & | p | ) |
Activate grid cell. Cell coordinates are computed for the given point.
p | Point with X,Y,Z coordinates |
bool BitGrid::add | ( | PointXYZ & | p | ) |
Activate grid cell. Cell coordinates are computed for the given point.
p | Point with X,Y,Z coordinates |
void BitGrid::add | ( | int | i | ) |
Activate grid cell by 1d index.
i | Index of a cell to be activated |
void BitGrid::add | ( | int | x, |
int | y | ||
) |
Activate grid by integer x,y coordinates.
x | X grid coordinate |
y | Y grid coordinate |
bool BitGrid::get | ( | int | i | ) |
Get grid item by coordinate index (1d or nth point in vector).
i | Index in vector |
bool BitGrid::get | ( | int | x, |
int | y | ||
) |
Get grid item by coordinate indexes (2d).
x | X index |
y | Y index |
bool BitGrid::get | ( | int | x, |
int | y, | ||
int | z | ||
) |
Get grid item by coordinate indexes (3d).
x | X index |
y | Y index |
z | Z index |
int BitGrid::getActiveCells | ( | ) |
Get the number of active cells (marked as true).
void BitGrid::getActiveCellsIndex | ( | std::vector< int > & | res | ) |
Put active index ids into a vector.
res | Return parametr storing active cell indexes |
double BitGrid::getArea | ( | ) |
Get the area of our grid. Only works for 2d grids.
BoundingBoxInfo & BitGrid::getBBox | ( | ) |
Get the bounding box struct.
std::vector< PointXYZ > BitGrid::getBoundingPolygon | ( | ) |
Returns bounding polygon.
int BitGrid::getDimensions | ( | ) |
Get grid dimensions.
PointXYZ BitGrid::getPoint | ( | int | i | ) |
const std::vector< bool > & BitGrid::getPoints | ( | ) |
Get the points object.
int BitGrid::getSize | ( | ) |
Get the size of our grid (length of vector).
int BitGrid::getSizeX | ( | ) |
Get grid size in x direction.
int BitGrid::getSizeY | ( | ) |
Get grid size in y direction.
int BitGrid::getSizeZ | ( | ) |
Get grid size in z direction.
double BitGrid::getStepX | ( | ) |
Get size of grid step in the x direction.
double BitGrid::getStepY | ( | ) |
Get size of grid step in the y direction.
double BitGrid::getStepZ | ( | ) |
Get size of grid step in the z direction.
int BitGrid::getX | ( | int | i | ) |
Get x index coordinate from single vector index.
i | Index of the cell |
int BitGrid::getY | ( | int | i | ) |
Get y index coordinate from single vector index.
i | Index of the cell |
bool BitGrid::pointExists | ( | PointXYZ & | p | ) |
Check if points exists in our bit grid and if it is set true.
p | Point to check |
void BitGrid::remove | ( | int | i | ) |
Deactivate grid cell by 1d index.
i | Index of a cell to be deactivated |
svg::Document BitGrid::toSVG | ( | std::filesystem::path | path | ) |