pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT > Class Template Reference

The Standalone Marching Cubes Class provides encapsulated functionality for the Marching Cubes implementation originally by Anatoly Baksheev. More...

`#include </build/pcl-qv3n_B/pcl-1.8.1+dfsg1/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/standalone_marching_cubes.h>`

## Public Types

typedef pcl::PointCloud< PointT > | PointCloud
typedef pcl::PointCloud< PointT >::Ptr | PointCloudPtr
typedef boost::shared_ptr< pcl::PolygonMesh > | MeshPtr

## Public Member Functions

| StandaloneMarchingCubes (int voxels_x=512, int voxels_y=512, int voxels_z=512, float volume_size=3.0f)
| Constructor. More...
| ~StandaloneMarchingCubes ()
| Destructor. More...
MeshPtr | getMeshFromTSDFCloud (const PointCloud &cloud)
| Run marching cubes in a TSDF cloud and returns a PolygonMesh. More...
void | getMeshesFromTSDFVector (const std::vector< PointCloudPtr > &tsdf_clouds, const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > &tsdf_offsets)
| Runs marching cubes on every pointcloud in the vector. More...
TsdfVolume::Ptr | tsdfVolumeGPU ()
| Returns the associated Tsdf Volume buffer in GPU. More...
std::vector< int > & | tsdfVolumeCPU ()
| Returns the associated Tsdf Volume buffer in CPU. More...

## Protected Member Functions

void | loadTsdfCloudToGPU (const PointCloud &cloud)
| Loads a TSDF Cloud to the TSDF Volume in GPU. More...
void | convertTsdfVectors (const PointCloud &cloud, std::vector< int > &output)
| Read the data in the point cloud. More...
MeshPtr | convertTrianglesToMesh (const pcl::gpu::DeviceArray< pcl::PointXYZ > &triangles)
| Converts the triangles buffer device to a PolygonMesh. More...
MeshPtr | runMarchingCubes ()
| Runs marching cubes on the data that is contained in the TSDF Volume in GPU. More...

## Detailed Description

### template<typename PointT>
class pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >

The Standalone Marching Cubes Class provides encapsulated functionality for the Marching Cubes implementation originally by Anatoly Baksheev.

Author
  Raphael Favier
  Francisco Heredia

Definition at line 78 of file standalone_marching_cubes.h.

## Member Typedef Documentation

## MeshPtr

template<typename PointT>

typedef boost::shared_ptr<pcl::PolygonMesh> pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr

Definition at line 83 of file standalone_marching_cubes.h.

## PointCloud

template<typename PointT>

typedef pcl::PointCloud<PointT> pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::PointCloud

Definition at line 81 of file standalone_marching_cubes.h.

## PointCloudPtr

template<typename PointT>

typedef pcl::PointCloud<PointT>::Ptr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::PointCloudPtr

Definition at line 82 of file standalone_marching_cubes.h.

## Constructor & Destructor Documentation

## StandaloneMarchingCubes()

template<typename PointT >

pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::StandaloneMarchingCubes | ( | int | voxels_x = `512`,
|  | int | voxels_y = `512`,
|  | int | voxels_z = `512`,
|  | float | volume_size = `3.0f`
| ) |  |

Constructor.

Creating GPU TSDF Volume instance

Creating CPU TSDF Volume instance

Definition at line 45 of file standalone_marching_cubes.hpp.

## ~StandaloneMarchingCubes()

template<typename PointT>

pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes | ( |  | ) |

inline

Destructor.

Definition at line 91 of file standalone_marching_cubes.h.

References pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTrianglesToMesh(), pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTsdfVectors(), pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::getMeshesFromTSDFVector(), pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::getMeshFromTSDFCloud(), pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::loadTsdfCloudToGPU(), pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::runMarchingCubes(), pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::tsdfVolumeCPU(), and pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::tsdfVolumeGPU().

## Member Function Documentation

## convertTrianglesToMesh()

template<typename PointT >

pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTrianglesToMesh | ( | const pcl::gpu::DeviceArray< pcl::PointXYZ > & | triangles | ) |

protected

Converts the triangles buffer device to a PolygonMesh.

Parameters

  [in] | triangles | the triangles buffer containing the points of the mesh

Returns
  pointer to the PolygonMesh egnerated by marchign cubes

Definition at line 218 of file standalone_marching_cubes.hpp.

References pcl::gpu::DeviceArray< T >::download(), pcl::gpu::DeviceMemory::empty(), pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::points, pcl::gpu::DeviceArray< T >::size(), pcl::toPCLPointCloud2(), pcl::Vertices::vertices, and pcl::PointCloud< PointT >::width.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

## convertTsdfVectors()

template<typename PointT >

void pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTsdfVectors | ( | const PointCloud & | cloud,
|  | std::vector< int > & | output
| ) |  |

protected

Read the data in the point cloud.

Performs a conversion to a suitable format for the TSDF Volume. Loads the converted data to the output vector.

Parameters

  [in] | cloud | point cloud to be converted
  [out] | output | the vector of converted values, ready to be loaded to the GPU.

For every point in the cloud

Calculate the index to write to

Definition at line 190 of file standalone_marching_cubes.hpp.

References pcl::PointCloud< PointT >::points.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

## getMeshesFromTSDFVector()

template<typename PointT >

void pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::getMeshesFromTSDFVector | ( | const std::vector< PointCloudPtr > & | tsdf_clouds,
|  | const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > & | tsdf_offsets
| ) |  |

Runs marching cubes on every pointcloud in the vector.

Returns a vector containing the PolygonMeshes.

Parameters

  [in] | tsdf_clouds | Vector of TSDF Clouds
  [in] | tsdf_offsets | Vector of the offsets for every pointcloud in TsdfClouds. This offset (in indices) indicates the position of the cloud with respect to the absolute origin of the world model

Definition at line 95 of file standalone_marching_cubes.hpp.

References pcl::fromPCLPointCloud2(), pcl::io::savePLYFile(), pcl::toPCLPointCloud2(), and pcl::transformPointCloud().

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

## getMeshFromTSDFCloud()

template<typename PointT >

pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::getMeshFromTSDFCloud | ( | const PointCloud & | cloud | ) |

Run marching cubes in a TSDF cloud and returns a PolygonMesh.

Input X,Y,Z coordinates must be in indices of the TSDF volume grid, output is in meters.

Parameters

  [in] | cloud | TSDF cloud with indices between [0 ... VOXELS_X][0 ... VOXELS_Y][0 ... VOXELS_Z]. Intensity value corresponds to the TSDF value in that coordinate.

Returns
  pointer to a PolygonMesh in meters generated by marching cubes.

Definition at line 69 of file standalone_marching_cubes.hpp.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

## loadTsdfCloudToGPU()

template<typename PointT >

void pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::loadTsdfCloudToGPU | ( | const PointCloud & | cloud | ) |

protected

Loads a TSDF Cloud to the TSDF Volume in GPU.

Parameters

  [in] | cloud | TSDF cloud that will be loaded. X,Y,Z of the cloud will only be loaded if their range is between [0 ... VOXELS_X][0 ... VOXELS_Y][0 ... VOXELS_Z]

Definition at line 177 of file standalone_marching_cubes.hpp.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

## runMarchingCubes()

template<typename PointT >

pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::runMarchingCubes | ( |  | ) |

protected

Runs marching cubes on the data that is contained in the TSDF Volume in GPU.

Returns
  param[return] pointer to a PolygonMesh in meters generated by marching cubes.

Definition at line 249 of file standalone_marching_cubes.hpp.

References pcl::fromPCLPointCloud2().

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

## tsdfVolumeCPU()

template<typename PointT >

std::vector< int > & pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::tsdfVolumeCPU | ( |  | ) |

Returns the associated Tsdf Volume buffer in CPU.

Returns
  the Tsdf Volume buffer in CPU returned returned by reference

Definition at line 169 of file standalone_marching_cubes.hpp.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

## tsdfVolumeGPU()

template<typename PointT >

pcl::gpu::kinfuLS::TsdfVolume::Ptr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::tsdfVolumeGPU | ( |  | ) |

Returns the associated Tsdf Volume buffer in GPU.

Returns
  pointer to the Tsdf Volume buffer in GPU

Definition at line 161 of file standalone_marching_cubes.hpp.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

The documentation for this class was generated from the following files:

- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/standalone_marching_cubes.h
- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/impl/standalone_marching_cubes.hpp