pcl::visualization::CloudViewer Class Reference
Module visualization

Simple point cloud visualization class. More...

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

Inheritance diagram for pcl::visualization::CloudViewer:

## Public Types

typedef pcl::PointCloud< pcl::PointXYZRGBA > | ColorACloud
typedef pcl::PointCloud< pcl::PointXYZRGB > | ColorCloud
typedef pcl::PointCloud< pcl::PointXYZI > | GrayCloud
typedef pcl::PointCloud< pcl::PointXYZ > | MonochromeCloud
typedef boost::function1< void, pcl::visualization::PCLVisualizer & > | VizCallable
| Visualization callable function, may be used for running things on the UI thread. More...

## Public Member Functions

| CloudViewer (const std::string &window_name)
| Construct a cloud viewer, with a window name. More...
| ~CloudViewer ()
| Will quit the window, and release all resources held by the viewer. More...
void | showCloud (const ColorCloud::ConstPtr &cloud, const std::string &cloudname="cloud")
| Show a cloud, with an optional key for multiple clouds. More...
void | showCloud (const ColorACloud::ConstPtr &cloud, const std::string &cloudname="cloud")
| Show a cloud, with an optional key for multiple clouds. More...
void | showCloud (const GrayCloud::ConstPtr &cloud, const std::string &cloudname="cloud")
| Show a cloud, with an optional key for multiple clouds. More...
void | showCloud (const MonochromeCloud::ConstPtr &cloud, const std::string &cloudname="cloud")
| Show a cloud, with an optional key for multiple clouds. More...
bool | wasStopped (int millis_to_wait=1)
| Check if the gui was quit, you should quit also. More...
void | runOnVisualizationThread (VizCallable x, const std::string &key="callable")
| Run a callbable object on the UI thread. More...
void | runOnVisualizationThreadOnce (VizCallable x)
| Run a callbable object on the UI thread. More...
void | removeVisualizationCallable (const std::string &key="callable")
| Remove a previously added callable object, NOP if it doesn't exist. More...
boost::signals2::connection | registerKeyboardCallback (void(*callback)(const pcl::visualization::KeyboardEvent &, void *), void *cookie=NULL)
| Register a callback function for keyboard events. More...
template<typename T >
boost::signals2::connection | registerKeyboardCallback (void(T::*callback)(const pcl::visualization::KeyboardEvent &, void *), T &instance, void *cookie=NULL)
| Register a callback function for keyboard events. More...
boost::signals2::connection | registerMouseCallback (void(*callback)(const pcl::visualization::MouseEvent &, void *), void *cookie=NULL)
| Register a callback function for mouse events. More...
template<typename T >
boost::signals2::connection | registerMouseCallback (void(T::*callback)(const pcl::visualization::MouseEvent &, void *), T &instance, void *cookie=NULL)
| Register a callback function for mouse events. More...
boost::signals2::connection | registerPointPickingCallback (void(*callback)(const pcl::visualization::PointPickingEvent &, void *), void *cookie=NULL)
| Register a callback function for point picking events. More...
template<typename T >
boost::signals2::connection | registerPointPickingCallback (void(T::*callback)(const pcl::visualization::PointPickingEvent &, void *), T &instance, void *cookie=NULL)
| Register a callback function for point picking events. More...

## Detailed Description

Simple point cloud visualization class.

Author
  Ethan Rublee

Definition at line 51 of file cloud_viewer.h.

## Member Typedef Documentation

## ColorACloud

typedef pcl::PointCloud<pcl::PointXYZRGBA> pcl::visualization::CloudViewer::ColorACloud

Definition at line 54 of file cloud_viewer.h.

## ColorCloud

typedef pcl::PointCloud<pcl::PointXYZRGB> pcl::visualization::CloudViewer::ColorCloud

Definition at line 55 of file cloud_viewer.h.

## GrayCloud

typedef pcl::PointCloud<pcl::PointXYZI> pcl::visualization::CloudViewer::GrayCloud

Definition at line 56 of file cloud_viewer.h.

## MonochromeCloud

typedef pcl::PointCloud<pcl::PointXYZ> pcl::visualization::CloudViewer::MonochromeCloud

Definition at line 57 of file cloud_viewer.h.

## VizCallable

typedef boost::function1<void, pcl::visualization::PCLVisualizer&> pcl::visualization::CloudViewer::VizCallable

Visualization callable function, may be used for running things on the UI thread.

Definition at line 108 of file cloud_viewer.h.

## Constructor & Destructor Documentation

## CloudViewer()

pcl::visualization::CloudViewer::CloudViewer | ( | const std::string & | window_name | ) |

Construct a cloud viewer, with a window name.

Parameters

  window_name | This is displayed at the top of the window

## ~CloudViewer()

pcl::visualization::CloudViewer::~CloudViewer | ( |  | ) |

Will quit the window, and release all resources held by the viewer.

Returns

## Member Function Documentation

## registerKeyboardCallback() [1/2]

boost::signals2::connection pcl::visualization::CloudViewer::registerKeyboardCallback | ( | void(*)(const pcl::visualization::KeyboardEvent &, void *) | callback,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for keyboard events.

Parameters

  [in] | callback | the function that will be registered as a callback for a keyboard event
  [in] | cookie | user data that is passed to the callback

Returns
  connection object that allows to disconnect the callback function.

Definition at line 135 of file cloud_viewer.h.

## registerKeyboardCallback() [2/2]

template<typename T >

boost::signals2::connection pcl::visualization::CloudViewer::registerKeyboardCallback | ( | void(T::*)(const pcl::visualization::KeyboardEvent &, void *) | callback,
|  | T & | instance,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for keyboard events.

Parameters

  [in] | callback | the member function that will be registered as a callback for a keyboard event
  [in] | instance | instance to the class that implements the callback function
  [in] | cookie | user data that is passed to the callback

Returns
  connection object that allows to disconnect the callback function.

Definition at line 147 of file cloud_viewer.h.

## registerMouseCallback() [1/2]

boost::signals2::connection pcl::visualization::CloudViewer::registerMouseCallback | ( | void(*)(const pcl::visualization::MouseEvent &, void *) | callback,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for mouse events.

Parameters

  [in] | callback | the function that will be registered as a callback for a mouse event
  [in] | cookie | user data that is passed to the callback

Returns
  connection object that allows to disconnect the callback function.

Definition at line 158 of file cloud_viewer.h.

## registerMouseCallback() [2/2]

template<typename T >

boost::signals2::connection pcl::visualization::CloudViewer::registerMouseCallback | ( | void(T::*)(const pcl::visualization::MouseEvent &, void *) | callback,
|  | T & | instance,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for mouse events.

Parameters

  [in] | callback | the member function that will be registered as a callback for a mouse event
  [in] | instance | instance to the class that implements the callback function
  [in] | cookie | user data that is passed to the callback

Returns
  connection object that allows to disconnect the callback function.

Definition at line 170 of file cloud_viewer.h.

## registerPointPickingCallback() [1/2]

boost::signals2::connection pcl::visualization::CloudViewer::registerPointPickingCallback | ( | void(*)(const pcl::visualization::PointPickingEvent &, void *) | callback,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for point picking events.

Parameters

  [in] | callback | the function that will be registered as a callback for a point picking event
  [in] | cookie | user data that is passed to the callback

Returns
  connection object that allows to disconnect the callback function.

Definition at line 182 of file cloud_viewer.h.

## registerPointPickingCallback() [2/2]

template<typename T >

boost::signals2::connection pcl::visualization::CloudViewer::registerPointPickingCallback | ( | void(T::*)(const pcl::visualization::PointPickingEvent &, void *) | callback,
|  | T & | instance,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for point picking events.

Parameters

  [in] | callback | the member function that will be registered as a callback for a point picking event
  [in] | instance | instance to the class that implements the callback function
  [in] | cookie | user data that is passed to the callback

Returns
  connection object that allows to disconnect the callback function.

Definition at line 194 of file cloud_viewer.h.

## removeVisualizationCallable()

void pcl::visualization::CloudViewer::removeVisualizationCallable | ( | const std::string & | key = `"callable"` | ) |

Remove a previously added callable object, NOP if it doesn't exist.

Parameters

  key | the key that was registered with the callable object.

## runOnVisualizationThread()

void pcl::visualization::CloudViewer::runOnVisualizationThread | ( | VizCallable | x,
|  | const std::string & | key = `"callable"`
| ) |  |

Run a callbable object on the UI thread.

Will persist until removed

Parameters

  x | Use boost::ref(x) for a function object that you would like to not copy
  key | The key for the callable – use the same key to overwrite.

## runOnVisualizationThreadOnce()

void pcl::visualization::CloudViewer::runOnVisualizationThreadOnce | ( | VizCallable | x | ) |

Run a callbable object on the UI thread.

This will run once and be removed

Parameters

  x | Use boost::ref(x) for a function object that you would like to not copy

## showCloud() [1/4]

void pcl::visualization::CloudViewer::showCloud | ( | const ColorCloud::ConstPtr & | cloud,
|  | const std::string & | cloudname = `"cloud"`
| ) |  |

Show a cloud, with an optional key for multiple clouds.

Parameters

  [in] | cloud | RGB point cloud
  [in] | cloudname | a key for the point cloud, use the same name if you would like to overwrite the existing cloud.

Referenced by pcl::gpu::DataSource::runCloudViewer().

## showCloud() [2/4]

void pcl::visualization::CloudViewer::showCloud | ( | const ColorACloud::ConstPtr & | cloud,
|  | const std::string & | cloudname = `"cloud"`
| ) |  |

Show a cloud, with an optional key for multiple clouds.

Parameters

  [in] | cloud | RGB point cloud
  [in] | cloudname | a key for the point cloud, use the same name if you would like to overwrite the existing cloud.

## showCloud() [3/4]

void pcl::visualization::CloudViewer::showCloud | ( | const GrayCloud::ConstPtr & | cloud,
|  | const std::string & | cloudname = `"cloud"`
| ) |  |

Show a cloud, with an optional key for multiple clouds.

Parameters

  [in] | cloud | XYZI point cloud
  [in] | cloudname | a key for the point cloud, use the same name if you would like to overwrite the existing cloud.

## showCloud() [4/4]

void pcl::visualization::CloudViewer::showCloud | ( | const MonochromeCloud::ConstPtr & | cloud,
|  | const std::string & | cloudname = `"cloud"`
| ) |  |

Show a cloud, with an optional key for multiple clouds.

Parameters

  [in] | cloud | XYZ point cloud
  [in] | cloudname | a key for the point cloud, use the same name if you would like to overwrite the existing cloud.

## wasStopped()

bool pcl::visualization::CloudViewer::wasStopped | ( | int | millis_to_wait = `1` | ) |

Check if the gui was quit, you should quit also.

Parameters

  millis_to_wait | This will request to "spin" for the number of milliseconds, before exiting.

Returns
  true if the user signaled the gui to stop

Referenced by pcl::gpu::DataSource::runCloudViewer().

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

- /build/pcl-OilVEB/pcl-1.8.1+dfsg1/visualization/include/pcl/visualization/cloud_viewer.h