Template Class BigGrid

Class Documentation

template<typename BaseVecT>
class BigGrid

Public Functions

BigGrid(std::vector<std::string> cloudPath, float voxelsize, float scale = 0, bool extrude = false, size_t bufferSize = 1024)

Constructor:

Parameters:
  • cloudPath – path to PointCloud in ASCII xyz Format // Todo: Add other file formats

  • voxelsize

BigGrid(float voxelsize, ScanProjectEditMarkPtr project, const fs::path &pathPrefix = "./", float scale = 0, bool extrude = false)

Constructor: specific case for incremental reconstruction/chunking. also compatible with simple reconstruction

Parameters:
  • voxelsize – specified voxelsize

  • projectScanProject, which contain one or more Scans

  • scale – scale value of for current scans

BigGrid(std::string path)
virtual ~BigGrid()
size_t size()
Returns:

Number of voxels

size_t pointSize()
Returns:

Number Points

size_t pointSize(const Vector3i &index)

Amount of Points in Voxel at position i,j,k

Parameters:

index

Returns:

amount of points, 0 if voxel does not exsist

lvr2::floatArr points(const Vector3i &index, size_t &numPoints) const

Points of Voxel at position i,j,k

Parameters:
  • index

  • numPoints, amount – of points in lvr2::floatArr

Returns:

lvr2::floatArr, containing points

lvr2::floatArr points(const BoundingBox<BaseVecT> &bb, size_t &numPoints, size_t minNumPoints = 0) const

Returns the points within a bounding box.

Parameters:
  • bb – the bounding box

  • numPoints – the number of points is written into this variable

  • minNumPoints – the minimum number of points to be returned

Returns:

lvr2::floatArr the points

lvr2::floatArr normals(const BoundingBox<BaseVecT> &bb, size_t &numNormals, size_t minNumNormals = 0) const

Returns the normals of points within a bounding box.

Parameters:
  • bb – the bounding box

  • numNormals – the number of normals is written into this variable

  • minNumNormals – the minimum number of normals to be returned

Returns:

lvr2::floatArr the normals

lvr2::ucharArr colors(const BoundingBox<BaseVecT> &bb, size_t &numColors, size_t minNumColors = 0) const

Returns the colors of points within a bounding box.

Parameters:
  • bb – the bounding box

  • numColors – the number of colors is written into this variable

  • minNumColors – the minimum number of colors to be returned

Returns:

lvr2::ucharArr the colors

inline size_t getSizeofBox(const BoundingBox<BaseVecT> &bb) const

return numbers of points in a bounding box of the grid

Parameters:

bb – the bounding box

Returns:

number of points in the area

size_t getSizeofBox(const BoundingBox<BaseVecT> &bb, std::vector<std::pair<const CellInfo*, size_t>> &cellCounts) const

calculate number of points in a bounding box of the grid

Parameters:
  • bb – the bounding box

  • cellCounts – will be filled with <cell, cellCount> of all cells intersecting bb where cellCount is the number of points in the cell that are within bb

Returns:

number of points in the area

size_t estimateSizeofBox(const BoundingBox<BaseVecT> &bb) const

calculate number of points in all cells touched by bb. Much faster than getSizeofBox, but overestimates the number of points.

Parameters:

bb – the bounding box

Returns:

a number >= the actual number of points in the area

void serialize(std::string path = "serinfo.ls")
lvr2::floatArr getPointCloud(size_t &numPoints)
inline BoundingBox<BaseVecT> &getBB()
inline BoundingBox<BaseVecT> &getpartialBB()

get the partial BB of the area, which needs to be reconstructed

Returns:

partial BB

inline void calcIndex(const BaseVecT &vec, Vector3i &index) const
inline Vector3i calcIndex(const BaseVecT &vec) const
inline bool exists(const Vector3i &index)
inline const std::unordered_map<Vector3i, CellInfo> &getCells() const
inline bool hasColors() const
inline bool hasNormals() const