FusedPointCloud Class Reference

A fused point cloud contains both geometric and color data of the scene captured by spatial mapping. More...

Types

typedef std::vector< size_t > chunkList
 

Functions

 FusedPointCloud ()
 Default constructor which creates an empty FusedPointCloud. More...
 
 ~FusedPointCloud ()
 FusedPointCloud destructor. More...
 
PointCloudChunkoperator[] (int index)
 Defines the [] operator to directly access the desired chunk. More...
 
size_t getNumberOfPoints ()
 Computes the total number of triangles stored in all chunks. More...
 
void updateFromChunkList (chunkList IDs=chunkList())
 Updates vertices / normals / colors from chunks' data pointed by the given chunkList. More...
 
bool save (String filename, MESH_FILE_FORMAT type=MESH_FILE_FORMAT::OBJ, chunkList IDs=chunkList())
 Saves the current fused point cloud into a file. More...
 
bool load (String filename, bool update_chunk_only=false)
 Loads the fused point cloud from a file. More...
 
void clear ()
 Clears all the data. More...
 

Attributes

std::vector< PointCloudChunkchunks
 
std::vector< float4vertices
 
std::vector< float3normals
 

Detailed Description

A fused point cloud contains both geometric and color data of the scene captured by spatial mapping.

By default the fused point cloud is defined as a set of point cloud chunks, this way we update only the required data, avoiding a time consuming remapping process every time a small part of the fused point cloud is changed.

Member Typedef Documentation

◆ chunkList

typedef std::vector<size_t> chunkList

Constructor and Destructor

◆ FusedPointCloud()

Default constructor which creates an empty FusedPointCloud.

◆ ~FusedPointCloud()

FusedPointCloud destructor.

Functions

◆ operator[]()

PointCloudChunk& operator[] ( int  index)

Defines the [] operator to directly access the desired chunk.

◆ getNumberOfPoints()

size_t getNumberOfPoints ( )

Computes the total number of triangles stored in all chunks.

Returns
The number of points stored in all chunks.

◆ updateFromChunkList()

void updateFromChunkList ( chunkList  IDs = chunkList())

Updates vertices / normals / colors from chunks' data pointed by the given chunkList.

Parameters
IDs: the index of chunks which will be concatenated. default : (empty).
Note
If the given chunkList is empty, all chunks will be used.

◆ save()

bool save ( String  filename,
MESH_FILE_FORMAT  type = MESH_FILE_FORMAT::OBJ,
chunkList  IDs = chunkList() 
)

Saves the current fused point cloud into a file.

Parameters
filename: the path and filename of the mesh.
type: defines the file type (extension). default : MESH_FILE_OBJ.
IDs: (by default empty) Specify a set of chunks to be saved, if none provided all chunks are saved. default : (empty).
Returns
True if the file was successfully saved, false otherwise.
Note
Only MESH_FILE_OBJ support textures data.
This function operates on the fused point cloud not on the chunks. This way you can save different parts of your fused point cloud (update with updateFromChunkList).

◆ load()

bool load ( String  filename,
bool  update_chunk_only = false 
)

Loads the fused point cloud from a file.

Parameters
filename: the path and filename of the fused point cloud (do not forget the extension).
update_chunk_only: if set to false the fused point cloud data (vertices/normals) are updated otherwise only the chunk's data are updated. default : false.
Returns
True if the loading was successful, false otherwise.
Note
Updating the fused point cloud is time consuming, consider using only chunks for better performances.

◆ clear()

void clear ( )

Clears all the data.

Variables

◆ chunks

std::vector<PointCloudChunk> chunks

contains the list of chunks

◆ vertices

std::vector<float4> vertices

Vertices are defined by colored 3D points {x, y, z, rgba}.

◆ normals

std::vector<float3> normals

Normals are defined by three components, {nx, ny, nz}. Normals are defined for each vertices.