Point Cloud Library (PCL)  1.14.0-dev
List of all members | Public Member Functions
pcl::visualization::PointPickingEvent Class Reference

/brief Class representing 3D point picking events. More...

#include <pcl/visualization/point_picking_event.h>

Public Member Functions

 PointPickingEvent (pcl::index_t idx)
 
 PointPickingEvent (pcl::index_t idx, float x, float y, float z, const std::string &name="")
 
 PointPickingEvent (pcl::index_t idx1, pcl::index_t idx2, float x1, float y1, float z1, float x2, float y2, float z2)
 
pcl::index_t getPointIndex () const
 Obtain the ID of a point that the user just clicked on. More...
 
void getPoint (float &x, float &y, float &z) const
 Obtain the XYZ point coordinates of a point that the user just clicked on. More...
 
bool getPoints (float &x1, float &y1, float &z1, float &x2, float &y2, float &z2) const
 For situations when multiple points are selected in a sequence, return the point coordinates. More...
 
bool getPointIndices (pcl::index_t &index_1, pcl::index_t &index_2) const
 For situations where multiple points are selected in a sequence, return the points indices. More...
 
const std::string & getCloudName () const
 Get name of selected cloud. More...
 

Detailed Description

/brief Class representing 3D point picking events.

Definition at line 93 of file point_picking_event.h.

Constructor & Destructor Documentation

◆ PointPickingEvent() [1/3]

pcl::visualization::PointPickingEvent::PointPickingEvent ( pcl::index_t  idx)
inline

Definition at line 96 of file point_picking_event.h.

◆ PointPickingEvent() [2/3]

pcl::visualization::PointPickingEvent::PointPickingEvent ( pcl::index_t  idx,
float  x,
float  y,
float  z,
const std::string &  name = "" 
)
inline

Definition at line 97 of file point_picking_event.h.

◆ PointPickingEvent() [3/3]

pcl::visualization::PointPickingEvent::PointPickingEvent ( pcl::index_t  idx1,
pcl::index_t  idx2,
float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
)
inline

Definition at line 98 of file point_picking_event.h.

Member Function Documentation

◆ getCloudName()

const std::string& pcl::visualization::PointPickingEvent::getCloudName ( ) const
inline

Get name of selected cloud.

Returns
name of the cloud selected by the user

Definition at line 169 of file point_picking_event.h.

◆ getPoint()

void pcl::visualization::PointPickingEvent::getPoint ( float &  x,
float &  y,
float &  z 
) const
inline

Obtain the XYZ point coordinates of a point that the user just clicked on.

Parameters
[out]xthe x coordinate of the point that got selected by the user
[out]ythe y coordinate of the point that got selected by the user
[out]zthe z coordinate of the point that got selected by the user

Definition at line 121 of file point_picking_event.h.

◆ getPointIndex()

pcl::index_t pcl::visualization::PointPickingEvent::getPointIndex ( ) const
inline

Obtain the ID of a point that the user just clicked on.

Warning
If the cloud contains NaNs the index returned by this function will not correspond to the original indices. To get the correct index either sanitize the input cloud to remove NaNs or use the PointPickingEvent::getPoint function to get the x,y,z of the picked point and then search the original cloud for the correct index. An example of how to do this can be found in the pp_callback function in visualization/tools/pcd_viewer.cpp

Definition at line 110 of file point_picking_event.h.

◆ getPointIndices()

bool pcl::visualization::PointPickingEvent::getPointIndices ( pcl::index_t index_1,
pcl::index_t index_2 
) const
inline

For situations where multiple points are selected in a sequence, return the points indices.

Parameters
[out]index_1index of the first point selected by user
[out]index_2index of the second point selected by user
Returns
true, if two points are available and have been clicked by the user, false otherwise
Warning
If the cloud contains NaNs the index returned by this function will not correspond to the original indices. To get the correct index either sanitize the input cloud to remove NaNs or use the PointPickingEvent::getPoint function to get the x,y,z of the picked point and then search the original cloud for the correct index. An example of how to do this can be found in the pp_callback function in visualization/tools/pcd_viewer.cpp

Definition at line 156 of file point_picking_event.h.

References pcl::UNAVAILABLE.

◆ getPoints()

bool pcl::visualization::PointPickingEvent::getPoints ( float &  x1,
float &  y1,
float &  z1,
float &  x2,
float &  y2,
float &  z2 
) const
inline

For situations when multiple points are selected in a sequence, return the point coordinates.

Parameters
[out]x1the x coordinate of the first point that got selected by the user
[out]y1the y coordinate of the first point that got selected by the user
[out]z1the z coordinate of the first point that got selected by the user
[out]x2the x coordinate of the second point that got selected by the user
[out]y2the y coordinate of the second point that got selected by the user
[out]z2the z coordinate of the second point that got selected by the user
Returns
true, if two points are available and have been clicked by the user, false otherwise

Definition at line 136 of file point_picking_event.h.

References pcl::UNAVAILABLE.


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