pcl::visualization::PointCloudColorHandlerRandom< PointT > Class Template Reference
Module visualization

Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen) More...

`#include <pcl/visualization/point_cloud_color_handlers.h>`

Inheritance diagram for pcl::visualization::PointCloudColorHandlerRandom< PointT >:

## Public Types

using | Ptr = shared_ptr< PointCloudColorHandlerRandom< PointT > >
using | ConstPtr = shared_ptr< const PointCloudColorHandlerRandom< PointT > >
Public Types inherited from pcl::visualization::PointCloudColorHandler< PointT >
using | PointCloud = pcl::PointCloud< PointT >
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
using | Ptr = shared_ptr< PointCloudColorHandler< PointT > >
using | ConstPtr = shared_ptr< const PointCloudColorHandler< PointT > >

## Public Member Functions

| PointCloudColorHandlerRandom ()
| Constructor. More...
| PointCloudColorHandlerRandom (const PointCloudConstPtr &cloud)
| Constructor. More...
virtual std::string | getName () const
| Abstract getName method. More...
virtual std::string | getFieldName () const
| Get the name of the field used. More...
vtkSmartPointer< vtkDataArray > | getColor () const override
| Obtain the actual color for the input dataset as a VTK data array. More...
Public Member Functions inherited from pcl::visualization::PointCloudColorHandler< PointT >
| PointCloudColorHandler ()
| Constructor. More...
| PointCloudColorHandler (const PointCloudConstPtr &cloud)
| Constructor. More...
virtual | ~PointCloudColorHandler ()
| Destructor. More...
bool | isCapable () const
| Check if this handler is capable of handling the input data or not. More...
virtual bool | getColor (vtkSmartPointer< vtkDataArray > &scalars) const
| Obtain the actual color for the input dataset as a VTK data array. More...
virtual void | setInputCloud (const PointCloudConstPtr &cloud)
| Set the input cloud to be used. More...

## Additional Inherited Members

Protected Attributes inherited from pcl::visualization::PointCloudColorHandler< PointT >
PointCloudConstPtr | cloud_
| A pointer to the input dataset. More...
bool | capable_
| True if this handler is capable of handling the input data, false otherwise. More...
int | field_idx_
| The index of the field holding the data that represents the color. More...
std::vector< pcl::PCLPointField > | fields_
| The list of fields available for this PointCloud. More...

## Detailed Description

### template<typename PointT>
class pcl::visualization::PointCloudColorHandlerRandom< PointT >

Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen)

Author
  Radu B. Rusu

Definition at line 154 of file point_cloud_color_handlers.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointT >

using pcl::visualization::PointCloudColorHandlerRandom< PointT >::ConstPtr = shared_ptr<const PointCloudColorHandlerRandom<PointT> >

Definition at line 162 of file point_cloud_color_handlers.h.

## Ptr

template<typename PointT >

using pcl::visualization::PointCloudColorHandlerRandom< PointT >::Ptr = shared_ptr<PointCloudColorHandlerRandom<PointT> >

Definition at line 161 of file point_cloud_color_handlers.h.

## Constructor & Destructor Documentation

## PointCloudColorHandlerRandom() [1/2]

template<typename PointT >

pcl::visualization::PointCloudColorHandlerRandom< PointT >::PointCloudColorHandlerRandom | ( |  | ) |

inline

Constructor.

Definition at line 165 of file point_cloud_color_handlers.h.

References pcl::visualization::PointCloudColorHandler< PointT >::capable_.

## PointCloudColorHandlerRandom() [2/2]

template<typename PointT >

pcl::visualization::PointCloudColorHandlerRandom< PointT >::PointCloudColorHandlerRandom | ( | const PointCloudConstPtr & | cloud | ) |

inline

Constructor.

Definition at line 172 of file point_cloud_color_handlers.h.

References pcl::visualization::PointCloudColorHandler< PointT >::capable_.

## Member Function Documentation

## getColor()

template<typename PointT >

vtkSmartPointer< vtkDataArray > pcl::visualization::PointCloudColorHandlerRandom< PointT >::getColor | ( |  | ) | const

override virtual

Obtain the actual color for the input dataset as a VTK data array.

Deriving handlers should override this method. The default implementation is provided only for backwards compatibility with handlers that were written before PCL 1.10.0 and will be removed in future.

Returns
  smart pointer to VTK array if the operation was successful (the handler is capable and the input cloud was given), a null pointer otherwise

Reimplemented from pcl::visualization::PointCloudColorHandler< PointT >.

Definition at line 76 of file point_cloud_color_handlers.hpp.

References pcl::visualization::getRandomColors(), and pcl_lrint.

## getFieldName()

template<typename PointT >

virtual std::string pcl::visualization::PointCloudColorHandlerRandom< PointT >::getFieldName | ( |  | ) | const

inline virtual

Get the name of the field used.

Implements pcl::visualization::PointCloudColorHandler< PointT >.

Definition at line 184 of file point_cloud_color_handlers.h.

## getName()

template<typename PointT >

virtual std::string pcl::visualization::PointCloudColorHandlerRandom< PointT >::getName | ( |  | ) | const

inline virtual

Abstract getName method.

Implements pcl::visualization::PointCloudColorHandler< PointT >.

Definition at line 180 of file point_cloud_color_handlers.h.

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

- pcl/visualization/point_cloud_color_handlers.h
- pcl/visualization/impl/point_cloud_color_handlers.hpp