Point Cloud Library (PCL)  1.14.1-dev
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
pcl::visualization::PCLVisualizer Class Reference

PCL Visualizer main class. More...

#include <pcl/visualization/pcl_visualizer.h>

+ Collaboration diagram for pcl::visualization::PCLVisualizer:

Public Types

using Ptr = shared_ptr< PCLVisualizer >
 
using ConstPtr = shared_ptr< const PCLVisualizer >
 
using GeometryHandler = PointCloudGeometryHandler< pcl::PCLPointCloud2 >
 
using GeometryHandlerPtr = GeometryHandler::Ptr
 
using GeometryHandlerConstPtr = GeometryHandler::ConstPtr
 
using ColorHandler = PointCloudColorHandler< pcl::PCLPointCloud2 >
 
using ColorHandlerPtr = ColorHandler::Ptr
 
using ColorHandlerConstPtr = ColorHandler::ConstPtr
 

Public Member Functions

 PCLVisualizer (const std::string &name="", const bool create_interactor=true)
 PCL Visualizer constructor. More...
 
 PCLVisualizer (int &argc, char **argv, const std::string &name="", PCLVisualizerInteractorStyle *style=PCLVisualizerInteractorStyle::New(), const bool create_interactor=true)
 PCL Visualizer constructor. More...
 
 PCLVisualizer (vtkSmartPointer< vtkRenderer > ren, vtkSmartPointer< vtkRenderWindow > wind, const std::string &name="", const bool create_interactor=true)
 PCL Visualizer constructor. More...
 
 PCLVisualizer (int &argc, char **argv, vtkSmartPointer< vtkRenderer > ren, vtkSmartPointer< vtkRenderWindow > wind, const std::string &name="", PCLVisualizerInteractorStyle *style=PCLVisualizerInteractorStyle::New(), const bool create_interactor=true)
 PCL Visualizer constructor. More...
 
virtual ~PCLVisualizer ()
 PCL Visualizer destructor. More...
 
void setFullScreen (bool mode)
 Enables/Disabled the underlying window mode to full screen. More...
 
void setWindowName (const std::string &name)
 Set the visualizer window name. More...
 
void setWindowBorders (bool mode)
 Enables or disable the underlying window borders. More...
 
boost::signals2::connection registerKeyboardCallback (std::function< void(const pcl::visualization::KeyboardEvent &)> cb)
 Register a callback std::function for keyboard events. More...
 
boost::signals2::connection registerKeyboardCallback (void(*callback)(const pcl::visualization::KeyboardEvent &, void *), void *cookie=nullptr)
 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=nullptr)
 Register a callback function for keyboard events. More...
 
boost::signals2::connection registerMouseCallback (std::function< void(const pcl::visualization::MouseEvent &)> cb)
 Register a callback function for mouse events. More...
 
boost::signals2::connection registerMouseCallback (void(*callback)(const pcl::visualization::MouseEvent &, void *), void *cookie=nullptr)
 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=nullptr)
 Register a callback function for mouse events. More...
 
boost::signals2::connection registerPointPickingCallback (std::function< void(const pcl::visualization::PointPickingEvent &)> cb)
 Register a callback function for point picking events. More...
 
boost::signals2::connection registerPointPickingCallback (void(*callback)(const pcl::visualization::PointPickingEvent &, void *), void *cookie=nullptr)
 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=nullptr)
 Register a callback function for point picking events. More...
 
boost::signals2::connection registerAreaPickingCallback (std::function< void(const pcl::visualization::AreaPickingEvent &)> cb)
 Register a callback function for area picking events. More...
 
boost::signals2::connection registerAreaPickingCallback (void(*callback)(const pcl::visualization::AreaPickingEvent &, void *), void *cookie=nullptr)
 Register a callback function for area picking events. More...
 
template<typename T >
boost::signals2::connection registerAreaPickingCallback (void(T::*callback)(const pcl::visualization::AreaPickingEvent &, void *), T &instance, void *cookie=nullptr)
 Register a callback function for area picking events. More...
 
void spin ()
 Spin method. More...
 
void spinOnce (int time=1, bool force_redraw=false)
 Spin once method. More...
 
void addOrientationMarkerWidgetAxes (vtkRenderWindowInteractor *interactor)
 Adds a widget which shows an interactive axes display for orientation. More...
 
void removeOrientationMarkerWidgetAxes ()
 Disables the Orientatation Marker Widget so it is removed from the renderer. More...
 
void addCoordinateSystem (double scale=1.0, const std::string &id="reference", int viewport=0)
 Adds 3D axes describing a coordinate system to screen at 0,0,0. More...
 
void addCoordinateSystem (double scale, float x, float y, float z, const std::string &id="reference", int viewport=0)
 Adds 3D axes describing a coordinate system to screen at x, y, z. More...
 
void addCoordinateSystem (double scale, const Eigen::Affine3f &t, const std::string &id="reference", int viewport=0)
 Adds 3D axes describing a coordinate system to screen at x, y, z, Roll,Pitch,Yaw. More...
 
bool removeCoordinateSystem (const std::string &id="reference", int viewport=0)
 Removes a previously added 3D axes (coordinate system) More...
 
bool removePointCloud (const std::string &id="cloud", int viewport=0)
 Removes a Point Cloud from screen, based on a given ID. More...
 
bool removePolygonMesh (const std::string &id="polygon", int viewport=0)
 Removes a PolygonMesh from screen, based on a given ID. More...
 
bool removeShape (const std::string &id="cloud", int viewport=0)
 Removes an added shape from screen (line, polygon, etc.), based on a given ID. More...
 
bool removeText3D (const std::string &id="cloud", int viewport=0)
 Removes an added 3D text from the scene, based on a given ID. More...
 
bool removeAllPointClouds (int viewport=0)
 Remove all point cloud data on screen from the given viewport. More...
 
bool removeAllShapes (int viewport=0)
 Remove all 3D shape data on screen from the given viewport. More...
 
bool removeAllCoordinateSystems (int viewport=0)
 Removes all existing 3D axes (coordinate systems) More...
 
void setBackgroundColor (const double &r, const double &g, const double &b, int viewport=0)
 Set the viewport's background color. More...
 
bool addText (const std::string &text, int xpos, int ypos, const std::string &id="", int viewport=0)
 Add a text to screen. More...
 
bool addText (const std::string &text, int xpos, int ypos, double r, double g, double b, const std::string &id="", int viewport=0)
 Add a text to screen. More...
 
bool addText (const std::string &text, int xpos, int ypos, int fontsize, double r, double g, double b, const std::string &id="", int viewport=0)
 Add a text to screen. More...
 
bool updateText (const std::string &text, int xpos, int ypos, const std::string &id="")
 Update a text to screen. More...
 
bool updateText (const std::string &text, int xpos, int ypos, double r, double g, double b, const std::string &id="")
 Update a text to screen. More...
 
bool updateText (const std::string &text, int xpos, int ypos, int fontsize, double r, double g, double b, const std::string &id="")
 Update a text to screen. More...
 
bool updateShapePose (const std::string &id, const Eigen::Affine3f &pose)
 Set the pose of an existing shape. More...
 
bool updateCoordinateSystemPose (const std::string &id, const Eigen::Affine3f &pose)
 Set the pose of an existing coordinate system. More...
 
bool updatePointCloudPose (const std::string &id, const Eigen::Affine3f &pose)
 Set the pose of an existing point cloud. More...
 
template<typename PointT >
bool addText3D (const std::string &text, const PointT &position, double textScale=1.0, double r=1.0, double g=1.0, double b=1.0, const std::string &id="", int viewport=0)
 Add a 3d text to the scene. More...
 
template<typename PointT >
bool addText3D (const std::string &text, const PointT &position, double orientation[3], double textScale=1.0, double r=1.0, double g=1.0, double b=1.0, const std::string &id="", int viewport=0)
 Add a 3d text to the scene. More...
 
bool contains (const std::string &id) const
 Check if the cloud, shape, or coordinate with the given id was already added to this visualizer. More...
 
template<typename PointNT >
bool addPointCloudNormals (const typename pcl::PointCloud< PointNT >::ConstPtr &cloud, int level=100, float scale=0.02f, const std::string &id="cloud", int viewport=0)
 Add the estimated surface normals of a Point Cloud to screen. More...
 
template<typename PointT , typename PointNT >
bool addPointCloudNormals (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const typename pcl::PointCloud< PointNT >::ConstPtr &normals, int level=100, float scale=0.02f, const std::string &id="cloud", int viewport=0)
 Add the estimated surface normals of a Point Cloud to screen. More...
 
template<typename PointNT >
bool addPointCloudPrincipalCurvatures (const typename pcl::PointCloud< PointNT >::ConstPtr &cloud, const typename pcl::PointCloud< pcl::PrincipalCurvatures >::ConstPtr &pcs, int level=100, float scale=1.0f, const std::string &id="cloud", int viewport=0)
 Add the estimated principal curvatures of a Point Cloud to screen. More...
 
template<typename PointT , typename PointNT >
bool addPointCloudPrincipalCurvatures (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const typename pcl::PointCloud< PointNT >::ConstPtr &normals, const pcl::PointCloud< pcl::PrincipalCurvatures >::ConstPtr &pcs, int level=100, float scale=1.0f, const std::string &id="cloud", int viewport=0)
 Add the estimated principal curvatures of a Point Cloud to screen. More...
 
template<typename PointT , typename GradientT >
bool addPointCloudIntensityGradients (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const typename pcl::PointCloud< GradientT >::ConstPtr &gradients, int level=100, double scale=1e-6, const std::string &id="cloud", int viewport=0)
 Add the estimated surface intensity gradients of a Point Cloud to screen. More...
 
template<typename PointT >
bool addPointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const std::string &id="cloud", int viewport=0)
 Add a Point Cloud (templated) to screen. More...
 
template<typename PointT >
bool updatePointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const std::string &id="cloud")
 Updates the XYZ data for an existing cloud object id on screen. More...
 
template<typename PointT >
bool updatePointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const PointCloudGeometryHandler< PointT > &geometry_handler, const std::string &id="cloud")
 Updates the XYZ data for an existing cloud object id on screen. More...
 
template<typename PointT >
bool updatePointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const PointCloudColorHandler< PointT > &color_handler, const std::string &id="cloud")
 Updates the XYZ data for an existing cloud object id on screen. More...
 
template<typename PointT >
bool addPointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const PointCloudGeometryHandler< PointT > &geometry_handler, const std::string &id="cloud", int viewport=0)
 Add a Point Cloud (templated) to screen. More...
 
template<typename PointT >
bool addPointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const GeometryHandlerConstPtr &geometry_handler, const std::string &id="cloud", int viewport=0)
 Add a Point Cloud (templated) to screen. More...
 
template<typename PointT >
bool addPointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const PointCloudColorHandler< PointT > &color_handler, const std::string &id="cloud", int viewport=0)
 Add a Point Cloud (templated) to screen. More...
 
template<typename PointT >
bool addPointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const ColorHandlerConstPtr &color_handler, const std::string &id="cloud", int viewport=0)
 Add a Point Cloud (templated) to screen. More...
 
template<typename PointT >
bool addPointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const GeometryHandlerConstPtr &geometry_handler, const ColorHandlerConstPtr &color_handler, const std::string &id="cloud", int viewport=0)
 Add a Point Cloud (templated) to screen. More...
 
bool addPointCloud (const pcl::PCLPointCloud2::ConstPtr &cloud, const GeometryHandlerConstPtr &geometry_handler, const ColorHandlerConstPtr &color_handler, const Eigen::Vector4f &sensor_origin, const Eigen::Quaternion< float > &sensor_orientation, const std::string &id="cloud", int viewport=0)
 Add a binary blob Point Cloud to screen. More...
 
bool addPointCloud (const pcl::PCLPointCloud2::ConstPtr &cloud, const GeometryHandlerConstPtr &geometry_handler, const Eigen::Vector4f &sensor_origin, const Eigen::Quaternion< float > &sensor_orientation, const std::string &id="cloud", int viewport=0)
 Add a binary blob Point Cloud to screen. More...
 
bool addPointCloud (const pcl::PCLPointCloud2::ConstPtr &cloud, const ColorHandlerConstPtr &color_handler, const Eigen::Vector4f &sensor_origin, const Eigen::Quaternion< float > &sensor_orientation, const std::string &id="cloud", int viewport=0)
 Add a binary blob Point Cloud to screen. More...
 
template<typename PointT >
bool addPointCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const PointCloudColorHandler< PointT > &color_handler, const PointCloudGeometryHandler< PointT > &geometry_handler, const std::string &id="cloud", int viewport=0)
 Add a Point Cloud (templated) to screen. More...
 
bool addPointCloud (const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud, const std::string &id="cloud", int viewport=0)
 Add a PointXYZ Point Cloud to screen. More...
 
bool addPointCloud (const pcl::PointCloud< pcl::PointXYZRGB >::ConstPtr &cloud, const std::string &id="cloud", int viewport=0)
 Add a PointXYZRGB Point Cloud to screen. More...
 
bool addPointCloud (const pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr &cloud, const std::string &id="cloud", int viewport=0)
 Add a PointXYZRGBA Point Cloud to screen. More...
 
bool addPointCloud (const pcl::PointCloud< pcl::PointXYZL >::ConstPtr &cloud, const std::string &id="cloud", int viewport=0)
 Add a PointXYZL Point Cloud to screen. More...
 
bool updatePointCloud (const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud, const std::string &id="cloud")
 Updates the XYZ data for an existing cloud object id on screen. More...
 
bool updatePointCloud (const pcl::PointCloud< pcl::PointXYZRGB >::ConstPtr &cloud, const std::string &id="cloud")
 Updates the XYZRGB data for an existing cloud object id on screen. More...
 
bool updatePointCloud (const pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr &cloud, const std::string &id="cloud")
 Updates the XYZRGBA data for an existing cloud object id on screen. More...
 
bool updatePointCloud (const pcl::PointCloud< pcl::PointXYZL >::ConstPtr &cloud, const std::string &id="cloud")
 Updates the XYZL data for an existing cloud object id on screen. More...
 
bool addPolygonMesh (const pcl::PolygonMesh &polymesh, const std::string &id="polygon", int viewport=0)
 Add a PolygonMesh object to screen. More...
 
template<typename PointT >
bool addPolygonMesh (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const std::vector< pcl::Vertices > &vertices, const std::string &id="polygon", int viewport=0)
 Add a PolygonMesh object to screen. More...
 
template<typename PointT >
bool updatePolygonMesh (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const std::vector< pcl::Vertices > &vertices, const std::string &id="polygon")
 Update a PolygonMesh object on screen. More...
 
bool updatePolygonMesh (const pcl::PolygonMesh &polymesh, const std::string &id="polygon")
 Update a PolygonMesh object on screen. More...
 
bool addPolylineFromPolygonMesh (const pcl::PolygonMesh &polymesh, const std::string &id="polyline", int viewport=0)
 Add a Polygonline from a polygonMesh object to screen. More...
 
template<typename PointT >
bool addCorrespondences (const typename pcl::PointCloud< PointT >::ConstPtr &source_points, const typename pcl::PointCloud< PointT >::ConstPtr &target_points, const std::vector< int > &correspondences, const std::string &id="correspondences", int viewport=0)
 Add the specified correspondences to the display. More...
 
bool addTextureMesh (const pcl::TextureMesh &polymesh, const std::string &id="texture", int viewport=0)
 Add a TextureMesh object to screen. More...
 
template<typename PointT >
bool addCorrespondences (const typename pcl::PointCloud< PointT >::ConstPtr &source_points, const typename pcl::PointCloud< PointT >::ConstPtr &target_points, const pcl::Correspondences &correspondences, int nth, const std::string &id="correspondences", int viewport=0, bool overwrite=false)
 Add the specified correspondences to the display. More...
 
template<typename PointT >
bool addCorrespondences (const typename pcl::PointCloud< PointT >::ConstPtr &source_points, const typename pcl::PointCloud< PointT >::ConstPtr &target_points, const pcl::Correspondences &correspondences, const std::string &id="correspondences", int viewport=0)
 Add the specified correspondences to the display. More...
 
template<typename PointT >
bool updateCorrespondences (const typename pcl::PointCloud< PointT >::ConstPtr &source_points, const typename pcl::PointCloud< PointT >::ConstPtr &target_points, const pcl::Correspondences &correspondences, int nth, const std::string &id="correspondences", int viewport=0)
 Update the specified correspondences to the display. More...
 
template<typename PointT >
bool updateCorrespondences (const typename pcl::PointCloud< PointT >::ConstPtr &source_points, const typename pcl::PointCloud< PointT >::ConstPtr &target_points, const pcl::Correspondences &correspondences, const std::string &id="correspondences", int viewport=0)
 Update the specified correspondences to the display. More...
 
void removeCorrespondences (const std::string &id="correspondences", int viewport=0)
 Remove the specified correspondences from the display. More...
 
int getColorHandlerIndex (const std::string &id)
 Get the color handler index of a rendered PointCloud based on its ID. More...
 
int getGeometryHandlerIndex (const std::string &id)
 Get the geometry handler index of a rendered PointCloud based on its ID. More...
 
bool updateColorHandlerIndex (const std::string &id, int index)
 Update/set the color index of a rendered PointCloud based on its ID. More...
 
bool setPointCloudRenderingProperties (int property, double val1, double val2, double val3, const std::string &id="cloud", int viewport=0)
 Set the rendering properties of a PointCloud (3x values - e.g., RGB) More...
 
bool setPointCloudRenderingProperties (int property, double val1, double val2, const std::string &id="cloud", int viewport=0)
 Set the rendering properties of a PointCloud (2x values - e.g., LUT minmax values) More...
 
bool setPointCloudRenderingProperties (int property, double value, const std::string &id="cloud", int viewport=0)
 Set the rendering properties of a PointCloud. More...
 
bool getPointCloudRenderingProperties (int property, double &value, const std::string &id="cloud")
 Get the rendering properties of a PointCloud. More...
 
bool getPointCloudRenderingProperties (RenderingProperties property, double &val1, double &val2, double &val3, const std::string &id="cloud")
 Get the rendering properties of a PointCloud. More...
 
bool setPointCloudSelected (const bool selected, const std::string &id="cloud")
 Set whether the point cloud is selected or not. More...
 
bool setShapeRenderingProperties (int property, double value, const std::string &id, int viewport=0)
 Set the rendering properties of a shape. More...
 
bool setShapeRenderingProperties (int property, double val1, double val2, const std::string &id, int viewport=0)
 Set the rendering properties of a shape (2x values - e.g., LUT minmax values) More...
 
bool setShapeRenderingProperties (int property, double val1, double val2, double val3, const std::string &id, int viewport=0)
 Set the rendering properties of a shape (3x values - e.g., RGB) More...
 
bool wasStopped () const
 Returns true when the user tried to close the window. More...
 
void resetStoppedFlag ()
 Set the stopped flag back to false. More...
 
void close ()
 Stop the interaction and close the visualization window. More...
 
void createViewPort (double xmin, double ymin, double xmax, double ymax, int &viewport)
 Create a new viewport from [xmin,ymin] -> [xmax,ymax]. More...
 
void createViewPortCamera (const int viewport)
 Create a new separate camera for the given viewport. More...
 
template<typename PointT >
bool addPolygon (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, double r, double g, double b, const std::string &id="polygon", int viewport=0)
 Add a polygon (polyline) that represents the input point cloud (connects all points in order) More...
 
template<typename PointT >
bool addPolygon (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const std::string &id="polygon", int viewport=0)
 Add a polygon (polyline) that represents the input point cloud (connects all points in order) More...
 
template<typename PointT >
bool addPolygon (const pcl::PlanarPolygon< PointT > &polygon, double r, double g, double b, const std::string &id="polygon", int viewport=0)
 Add a planar polygon that represents the input point cloud (connects all points in order) More...
 
template<typename P1 , typename P2 >
bool addLine (const P1 &pt1, const P2 &pt2, const std::string &id="line", int viewport=0)
 Add a line segment from two points. More...
 
template<typename P1 , typename P2 >
bool addLine (const P1 &pt1, const P2 &pt2, double r, double g, double b, const std::string &id="line", int viewport=0)
 Add a line segment from two points. More...
 
template<typename P1 , typename P2 >
bool addArrow (const P1 &pt1, const P2 &pt2, double r, double g, double b, const std::string &id="arrow", int viewport=0)
 Add a line arrow segment between two points, and display the distance between them. More...
 
template<typename P1 , typename P2 >
bool addArrow (const P1 &pt1, const P2 &pt2, double r, double g, double b, bool display_length, const std::string &id="arrow", int viewport=0)
 Add a line arrow segment between two points, and (optionally) display the distance between them. More...
 
template<typename P1 , typename P2 >
bool addArrow (const P1 &pt1, const P2 &pt2, double r_line, double g_line, double b_line, double r_text, double g_text, double b_text, const std::string &id="arrow", int viewport=0)
 Add a line arrow segment between two points, and display the distance between them in a given color. More...
 
template<typename PointT >
bool addSphere (const PointT &center, double radius, const std::string &id="sphere", int viewport=0)
 Add a sphere shape from a point and a radius. More...
 
template<typename PointT >
bool addSphere (const PointT &center, double radius, double r, double g, double b, const std::string &id="sphere", int viewport=0)
 Add a sphere shape from a point and a radius. More...
 
template<typename PointT >
bool updateSphere (const PointT &center, double radius, double r, double g, double b, const std::string &id="sphere")
 Update an existing sphere shape from a point and a radius. More...
 
bool addModelFromPolyData (vtkSmartPointer< vtkPolyData > polydata, const std::string &id="PolyData", int viewport=0)
 Add a vtkPolydata as a mesh. More...
 
bool addModelFromPolyData (vtkSmartPointer< vtkPolyData > polydata, vtkSmartPointer< vtkTransform > transform, const std::string &id="PolyData", int viewport=0)
 Add a vtkPolydata as a mesh. More...
 
bool addModelFromPLYFile (const std::string &filename, const std::string &id="PLYModel", int viewport=0)
 Add a PLYmodel as a mesh. More...
 
bool addModelFromPLYFile (const std::string &filename, vtkSmartPointer< vtkTransform > transform, const std::string &id="PLYModel", int viewport=0)
 Add a PLYmodel as a mesh and applies given transformation. More...
 
bool addCylinder (const pcl::ModelCoefficients &coefficients, const std::string &id="cylinder", int viewport=0)
 Add a cylinder from a set of given model coefficients. More...
 
bool addSphere (const pcl::ModelCoefficients &coefficients, const std::string &id="sphere", int viewport=0)
 Add a sphere from a set of given model coefficients. More...
 
bool addLine (const pcl::ModelCoefficients &coefficients, const std::string &id="line", int viewport=0)
 Add a line from a set of given model coefficients. More...
 
bool addLine (const pcl::ModelCoefficients &coefficients, const char *id="line", int viewport=0)
 Add a line from a set of given model coefficients. More...
 
bool addPlane (const pcl::ModelCoefficients &coefficients, const std::string &id="plane", int viewport=0)
 Add a plane from a set of given model coefficients. More...
 
bool addPlane (const pcl::ModelCoefficients &coefficients, double x, double y, double z, const std::string &id="plane", int viewport=0)
 
bool addCircle (const pcl::ModelCoefficients &coefficients, const std::string &id="circle", int viewport=0)
 Add a circle from a set of given model coefficients. More...
 
bool addCone (const pcl::ModelCoefficients &coefficients, const std::string &id="cone", int viewport=0)
 Add a cone from a set of given model coefficients. More...
 
bool addCube (const pcl::ModelCoefficients &coefficients, const std::string &id="cube", int viewport=0)
 Add a cube from a set of given model coefficients. More...
 
bool addCube (const Eigen::Vector3f &translation, const Eigen::Quaternionf &rotation, double width, double height, double depth, const std::string &id="cube", int viewport=0)
 Add a cube from a set of given model coefficients. More...
 
bool addCube (float x_min, float x_max, float y_min, float y_max, float z_min, float z_max, double r=1.0, double g=1.0, double b=1.0, const std::string &id="cube", int viewport=0)
 Add a cube. More...
 
bool addEllipsoid (const Eigen::Isometry3d &transform, double radius_x, double radius_y, double radius_z, const std::string &id="ellipsoid", int viewport=0)
 Add an ellipsoid from the given parameters. More...
 
void enableEDLRendering (int viewport=0)
 Eye-Dome Lighting makes dark areas to improve depth perception See https://www.kitware.com/eye-dome-lighting-a-non-photorealistic-shading-technique/ It is applied to all actors, including texts. More...
 
void setRepresentationToSurfaceForAllActors ()
 Changes the visual representation for all actors to surface representation. More...
 
void setRepresentationToPointsForAllActors ()
 Changes the visual representation for all actors to points representation. More...
 
void setRepresentationToWireframeForAllActors ()
 Changes the visual representation for all actors to wireframe representation. More...
 
void setShowFPS (bool show_fps)
 Sets whether the 2D overlay text showing the framerate of the window is displayed or not. More...
 
float getFPS () const
 Get the current rendering framerate. More...
 
void renderView (int xres, int yres, pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud)
 Renders a virtual scene as seen from the camera viewpoint and returns the rendered point cloud. More...
 
void renderViewTesselatedSphere (int xres, int yres, pcl::PointCloud< pcl::PointXYZ >::CloudVectorType &cloud, std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > &poses, std::vector< float > &enthropies, int tesselation_level, float view_angle=45, float radius_sphere=1, bool use_vertices=true)
 The purpose of this method is to render a CAD model added to the visualizer from different viewpoints in order to simulate partial views of model. More...
 
void initCameraParameters ()
 Initialize camera parameters with some default values. More...
 
bool getCameraParameters (int argc, char **argv)
 Search for camera parameters at the command line and set them internally. More...
 
bool loadCameraParameters (const std::string &file)
 Load camera parameters from a camera parameters file. More...
 
bool cameraParamsSet () const
 Checks whether the camera parameters were manually loaded. More...
 
bool cameraFileLoaded () const
 Checks whether a camera file were automatically loaded. More...
 
std::string getCameraFile () const
 Get camera file for camera parameter saving/restoring. More...
 
void resetCamera ()
 Reset camera parameters and render. More...
 
void resetCameraViewpoint (const std::string &id="cloud")
 Reset the camera direction from {0, 0, 0} to the center_{x, y, z} of a given dataset. More...
 
void setCameraPosition (double pos_x, double pos_y, double pos_z, double view_x, double view_y, double view_z, double up_x, double up_y, double up_z, int viewport=0)
 Set the camera pose given by position, viewpoint and up vector. More...
 
void setCameraPosition (double pos_x, double pos_y, double pos_z, double up_x, double up_y, double up_z, int viewport=0)
 Set the camera location and viewup according to the given arguments. More...
 
void setCameraParameters (const Eigen::Matrix3f &intrinsics, const Eigen::Matrix4f &extrinsics, int viewport=0)
 Set the camera parameters via an intrinsics and and extrinsics matrix. More...
 
void setCameraParameters (const Camera &camera, int viewport=0)
 Set the camera parameters by given a full camera data structure. More...
 
void setCameraClipDistances (double near, double far, int viewport=0)
 Set the camera clipping distances. More...
 
void setCameraFieldOfView (double fovy, int viewport=0)
 Set the camera vertical field of view. More...
 
void getCameras (std::vector< Camera > &cameras)
 Get the current camera parameters. More...
 
Eigen::Affine3f getViewerPose (int viewport=0)
 Get the current viewing pose. More...
 
void saveScreenshot (const std::string &file)
 Save the current rendered image to disk, as a PNG screenshot. More...
 
void saveCameraParameters (const std::string &file)
 Save the camera parameters to disk, as a .cam file. More...
 
void getCameraParameters (Camera &camera, int viewport=0) const
 Get camera parameters of a given viewport (0 means default viewport). More...
 
vtkSmartPointer< vtkRenderWindow > getRenderWindow ()
 Return a pointer to the underlying VTK Render Window used. More...
 
vtkSmartPointer< vtkRendererCollection > getRendererCollection ()
 Return a pointer to the underlying VTK Renderer Collection. More...
 
CloudActorMapPtr getCloudActorMap ()
 Return a pointer to the CloudActorMap this visualizer uses. More...
 
ShapeActorMapPtr getShapeActorMap ()
 Return a pointer to the ShapeActorMap this visualizer uses. More...
 
void setPosition (int x, int y)
 Set the position in screen coordinates. More...
 
void setSize (int xw, int yw)
 Set the window size in screen coordinates. More...
 
void setUseVbos (bool use_vbos)
 Use Vertex Buffer Objects renderers. More...
 
void setLookUpTableID (const std::string id)
 Set the ID of a cloud or shape to be used for LUT display. More...
 
void createInteractor ()
 Create the internal Interactor object. More...
 
void setupInteractor (vtkRenderWindowInteractor *iren, vtkRenderWindow *win)
 Set up our unique PCL interactor style for a given vtkRenderWindowInteractor object attached to a given vtkRenderWindow. More...
 
void setupInteractor (vtkRenderWindowInteractor *iren, vtkRenderWindow *win, vtkInteractorStyle *style)
 Set up PCLVisualizer with custom interactor style for a given vtkRenderWindowInteractor object attached to a given vtkRenderWindow. More...
 
vtkSmartPointer< PCLVisualizerInteractorStylegetInteractorStyle ()
 Get a pointer to the current interactor style used. More...
 
template<typename PointNT >
bool addPointCloudPrincipalCurvatures (const typename pcl::PointCloud< PointNT >::ConstPtr &cloud, const pcl::PointCloud< pcl::PrincipalCurvatures >::ConstPtr &pcs, int level, float scale, const std::string &id, int viewport)
 

Static Public Member Functions

static void convertToVtkMatrix (const Eigen::Matrix4f &m, vtkSmartPointer< vtkMatrix4x4 > &vtk_matrix)
 Convert Eigen::Matrix4f to vtkMatrix4x4. More...
 
static void convertToVtkMatrix (const Eigen::Vector4f &origin, const Eigen::Quaternion< float > &orientation, vtkSmartPointer< vtkMatrix4x4 > &vtk_matrix)
 Convert origin and orientation to vtkMatrix4x4. More...
 
static void convertToEigenMatrix (const vtkSmartPointer< vtkMatrix4x4 > &vtk_matrix, Eigen::Matrix4f &m)
 Convert vtkMatrix4x4 to an Eigen4f. More...
 

Protected Attributes

vtkSmartPointer< vtkRenderWindowInteractor > interactor_
 The render window interactor. More...
 

Detailed Description

PCL Visualizer main class.

Author
Radu B. Rusu
Note
This class can NOT be used across multiple threads. Only call functions of objects of this class from the same thread that they were created in! Some methods, e.g. addPointCloud, will crash if called from other threads.

Definition at line 93 of file pcl_visualizer.h.

Member Typedef Documentation

◆ ColorHandler

Definition at line 103 of file pcl_visualizer.h.

◆ ColorHandlerConstPtr

Definition at line 105 of file pcl_visualizer.h.

◆ ColorHandlerPtr

Definition at line 104 of file pcl_visualizer.h.

◆ ConstPtr

Definition at line 97 of file pcl_visualizer.h.

◆ GeometryHandler

Definition at line 99 of file pcl_visualizer.h.

◆ GeometryHandlerConstPtr

Definition at line 101 of file pcl_visualizer.h.

◆ GeometryHandlerPtr

Definition at line 100 of file pcl_visualizer.h.

◆ Ptr

Definition at line 96 of file pcl_visualizer.h.

Constructor & Destructor Documentation

◆ PCLVisualizer() [1/4]

pcl::visualization::PCLVisualizer::PCLVisualizer ( const std::string &  name = "",
const bool  create_interactor = true 
)

PCL Visualizer constructor.

Parameters
[in]namethe window name (empty by default)
[in]create_interactorif true (default), create an interactor, false otherwise

◆ PCLVisualizer() [2/4]

pcl::visualization::PCLVisualizer::PCLVisualizer ( int &  argc,
char **  argv,
const std::string &  name = "",
PCLVisualizerInteractorStyle style = PCLVisualizerInteractorStyle::New(),
const bool  create_interactor = true 
)

PCL Visualizer constructor.

It looks through the passed argv arguments to find the "-cam *.cam" argument. If the search failed, the name for cam file is calculated with boost uuid. If there is no such file, camera is not initialized.

Parameters
[in]argc
[in]argv
[in]namethe window name (empty by default)
[in]styleinteractor style (defaults to PCLVisualizerInteractorStyle)
[in]create_interactorif true (default), create an interactor, false otherwise

◆ PCLVisualizer() [3/4]

pcl::visualization::PCLVisualizer::PCLVisualizer ( vtkSmartPointer< vtkRenderer >  ren,
vtkSmartPointer< vtkRenderWindow >  wind,
const std::string &  name = "",
const bool  create_interactor = true 
)

PCL Visualizer constructor.

Parameters
[in]rencustom vtk renderer
[in]windcustom vtk render window
[in]create_interactorif true (default), create an interactor, false otherwise

◆ PCLVisualizer() [4/4]

pcl::visualization::PCLVisualizer::PCLVisualizer ( int &  argc,
char **  argv,
vtkSmartPointer< vtkRenderer >  ren,
vtkSmartPointer< vtkRenderWindow >  wind,
const std::string &  name = "",
PCLVisualizerInteractorStyle style = PCLVisualizerInteractorStyle::New(),
const bool  create_interactor = true 
)

PCL Visualizer constructor.

Parameters
[in]argc
[in]argv
[in]rencustom vtk renderer
[in]windcustom vtk render window
[in]styleinteractor style (defaults to PCLVisualizerInteractorStyle)
[in]create_interactorif true (default), create an interactor, false otherwise

◆ ~PCLVisualizer()

virtual pcl::visualization::PCLVisualizer::~PCLVisualizer ( )
virtual

PCL Visualizer destructor.

Member Function Documentation

◆ addArrow() [1/3]

template<typename P1 , typename P2 >
bool pcl::visualization::PCLVisualizer::addArrow ( const P1 &  pt1,
const P2 &  pt2,
double  r,
double  g,
double  b,
bool  display_length,
const std::string &  id = "arrow",
int  viewport = 0 
)

Add a line arrow segment between two points, and (optionally) display the distance between them.

Arrow head is attached on the start point (pt1) of the arrow.

Parameters
[in]pt1the first (start) point on the line
[in]pt2the second (end) point on the line
[in]rthe red channel of the color that the line should be rendered with
[in]gthe green channel of the color that the line should be rendered with
[in]bthe blue channel of the color that the line should be rendered with
[in]display_lengthtrue if the length should be displayed on the arrow as text
[in]idthe line id/name (default: "arrow")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 540 of file pcl_visualizer.hpp.

◆ addArrow() [2/3]

template<typename P1 , typename P2 >
bool pcl::visualization::PCLVisualizer::addArrow ( const P1 &  pt1,
const P2 &  pt2,
double  r,
double  g,
double  b,
const std::string &  id = "arrow",
int  viewport = 0 
)

Add a line arrow segment between two points, and display the distance between them.

Arrow heads are attached to both end points of the arrow.

Parameters
[in]pt1the first (start) point on the line
[in]pt2the second (end) point on the line
[in]rthe red channel of the color that the line should be rendered with
[in]gthe green channel of the color that the line should be rendered with
[in]bthe blue channel of the color that the line should be rendered with
[in]idthe arrow id/name (default: "arrow")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 513 of file pcl_visualizer.hpp.

◆ addArrow() [3/3]

template<typename P1 , typename P2 >
bool pcl::visualization::PCLVisualizer::addArrow ( const P1 &  pt1,
const P2 &  pt2,
double  r_line,
double  g_line,
double  b_line,
double  r_text,
double  g_text,
double  b_text,
const std::string &  id = "arrow",
int  viewport = 0 
)

Add a line arrow segment between two points, and display the distance between them in a given color.

Arrow heads are attached to both end points of the arrow.

Parameters
[in]pt1the first (start) point on the line
[in]pt2the second (end) point on the line
[in]r_linethe red channel of the color that the line should be rendered with
[in]g_linethe green channel of the color that the line should be rendered with
[in]b_linethe blue channel of the color that the line should be rendered with
[in]r_textthe red channel of the color that the text should be rendered with
[in]g_textthe green channel of the color that the text should be rendered with
[in]b_textthe blue channel of the color that the text should be rendered with
[in]idthe line id/name (default: "arrow")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 570 of file pcl_visualizer.hpp.

◆ addCircle()

bool pcl::visualization::PCLVisualizer::addCircle ( const pcl::ModelCoefficients coefficients,
const std::string &  id = "circle",
int  viewport = 0 
)

Add a circle from a set of given model coefficients.

Parameters
[in]coefficientsthe model coefficients (x, y, radius)
[in]idthe circle id/name (default: "circle")
[in]viewport(optional) the id of the new viewport (default: 0)
// The following are given (or computed using sample consensus techniques)
// See SampleConsensusModelCircle2D for more information
// float x, y, radius;
circle_coeff.values.resize (3); // We need 3 values
circle_coeff.values[0] = x;
circle_coeff.values[1] = y;
circle_coeff.values[2] = radius;
PCL_EXPORTS vtkSmartPointer< vtkDataSet > create2DCircle(const pcl::ModelCoefficients &coefficients, double z=0.0)
Create a 2d circle shape from a set of model coefficients.
std::vector< float > values

◆ addCone()

bool pcl::visualization::PCLVisualizer::addCone ( const pcl::ModelCoefficients coefficients,
const std::string &  id = "cone",
int  viewport = 0 
)

Add a cone from a set of given model coefficients.

Parameters
[in]coefficientsthe model coefficients (see pcl::visualization::createCone)
[in]idthe cone id/name (default: "cone")
[in]viewport(optional) the id of the new viewport (default: 0)

◆ addCoordinateSystem() [1/3]

void pcl::visualization::PCLVisualizer::addCoordinateSystem ( double  scale,
const Eigen::Affine3f &  t,
const std::string &  id = "reference",
int  viewport = 0 
)

Adds 3D axes describing a coordinate system to screen at x, y, z, Roll,Pitch,Yaw.

Parameters
[in]scalethe scale of the axes (default: 1)
[in]ttransformation matrix
[in]idthe coordinate system object id (default: reference)
[in]viewportthe view port where the 3D axes should be added (default: all)

RPY Angles Rotate the reference frame by the angle roll about axis x Rotate the reference frame by the angle pitch about axis y Rotate the reference frame by the angle yaw about axis z

Description: Sets the orientation of the Prop3D. Orientation is specified as X,Y and Z rotations in that order, but they are performed as RotateZ, RotateX, and finally RotateY.

All axies use right hand rule. x=red axis, y=green axis, z=blue axis z direction is point into the screen.

z
\
\
\
-----------> x
|
|
|
|
|
|
y

◆ addCoordinateSystem() [2/3]

void pcl::visualization::PCLVisualizer::addCoordinateSystem ( double  scale,
float  x,
float  y,
float  z,
const std::string &  id = "reference",
int  viewport = 0 
)

Adds 3D axes describing a coordinate system to screen at x, y, z.

Parameters
[in]scalethe scale of the axes (default: 1)
[in]xthe X position of the axes
[in]ythe Y position of the axes
[in]zthe Z position of the axes
[in]idthe coordinate system object id (default: reference)
[in]viewportthe view port where the 3D axes should be added (default: all)

◆ addCoordinateSystem() [3/3]

void pcl::visualization::PCLVisualizer::addCoordinateSystem ( double  scale = 1.0,
const std::string &  id = "reference",
int  viewport = 0 
)

Adds 3D axes describing a coordinate system to screen at 0,0,0.

Parameters
[in]scalethe scale of the axes (default: 1)
[in]idthe coordinate system object id (default: reference)
[in]viewportthe view port where the 3D axes should be added (default: all)

◆ addCorrespondences() [1/3]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addCorrespondences ( const typename pcl::PointCloud< PointT >::ConstPtr source_points,
const typename pcl::PointCloud< PointT >::ConstPtr target_points,
const pcl::Correspondences correspondences,
const std::string &  id = "correspondences",
int  viewport = 0 
)
inline

Add the specified correspondences to the display.

Parameters
[in]source_pointsThe source points
[in]target_pointsThe target points
[in]correspondencesThe mapping from source points to target points. Each element must be an index into target_points
[in]idthe polygon object id (default: "correspondences")
[in]viewportthe view port where the correspondences should be added (default: all)

Definition at line 1072 of file pcl_visualizer.h.

◆ addCorrespondences() [2/3]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addCorrespondences ( const typename pcl::PointCloud< PointT >::ConstPtr source_points,
const typename pcl::PointCloud< PointT >::ConstPtr target_points,
const pcl::Correspondences correspondences,
int  nth,
const std::string &  id = "correspondences",
int  viewport = 0,
bool  overwrite = false 
)

Add the specified correspondences to the display.

Parameters
[in]source_pointsThe source points
[in]target_pointsThe target points
[in]correspondencesThe mapping from source points to target points. Each element must be an index into target_points
[in]nthdisplay only the Nth correspondence (e.g., skip the rest)
[in]idthe polygon object id (default: "correspondences")
[in]viewportthe view port where the correspondences should be added (default: all)
[in]overwriteallow to overwrite already existing correspondences

Definition at line 1198 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::sensor_orientation_, pcl::PointCloud< PointT >::sensor_origin_, and pcl::UNAVAILABLE.

◆ addCorrespondences() [3/3]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addCorrespondences ( const typename pcl::PointCloud< PointT >::ConstPtr source_points,
const typename pcl::PointCloud< PointT >::ConstPtr target_points,
const std::vector< int > &  correspondences,
const std::string &  id = "correspondences",
int  viewport = 0 
)

Add the specified correspondences to the display.

Parameters
[in]source_pointsThe source points
[in]target_pointsThe target points
[in]correspondencesThe mapping from source points to target points. Each element must be an index into target_points
[in]idthe polygon object id (default: "correspondences")
[in]viewportthe view port where the correspondences should be added (default: all)

Definition at line 1175 of file pcl_visualizer.hpp.

◆ addCube() [1/3]

bool pcl::visualization::PCLVisualizer::addCube ( const Eigen::Vector3f &  translation,
const Eigen::Quaternionf &  rotation,
double  width,
double  height,
double  depth,
const std::string &  id = "cube",
int  viewport = 0 
)

Add a cube from a set of given model coefficients.

Parameters
[in]translationa translation to apply to the cube from 0,0,0
[in]rotationa quaternion-based rotation to apply to the cube
[in]widththe cube's width
[in]heightthe cube's height
[in]depththe cube's depth
[in]idthe cube id/name (default: "cube")
[in]viewport(optional) the id of the new viewport (default: 0)

◆ addCube() [2/3]

bool pcl::visualization::PCLVisualizer::addCube ( const pcl::ModelCoefficients coefficients,
const std::string &  id = "cube",
int  viewport = 0 
)

Add a cube from a set of given model coefficients.

Parameters
[in]coefficientsthe model coefficients (see pcl::visualization::createCube)
[in]idthe cube id/name (default: "cube")
[in]viewport(optional) the id of the new viewport (default: 0)

Referenced by pcl::people::PersonCluster< PointT >::drawTBoundingBox().

◆ addCube() [3/3]

bool pcl::visualization::PCLVisualizer::addCube ( float  x_min,
float  x_max,
float  y_min,
float  y_max,
float  z_min,
float  z_max,
double  r = 1.0,
double  g = 1.0,
double  b = 1.0,
const std::string &  id = "cube",
int  viewport = 0 
)

Add a cube.

Parameters
[in]x_minthe min X coordinate
[in]x_maxthe max X coordinate
[in]y_minthe min Y coordinate
[in]y_maxthe max Y coordinate
[in]z_minthe min Z coordinate
[in]z_maxthe max Z coordinate
[in]rhow much red (0.0 -> 1.0)
[in]ghow much green (0.0 -> 1.0)
[in]bhow much blue (0.0 -> 1.0)
[in]idthe cube id/name (default: "cube")
[in]viewport(optional) the id of the new viewport (default: 0)

◆ addCylinder()

bool pcl::visualization::PCLVisualizer::addCylinder ( const pcl::ModelCoefficients coefficients,
const std::string &  id = "cylinder",
int  viewport = 0 
)

Add a cylinder from a set of given model coefficients.

Parameters
[in]coefficientsthe model coefficients (point_on_axis, axis_direction, radius)
[in]idthe cylinder id/name (default: "cylinder")
[in]viewport(optional) the id of the new viewport (default: 0)
// The following are given (or computed using sample consensus techniques)
// See SampleConsensusModelCylinder for more information.
// Eigen::Vector3f pt_on_axis, axis_direction;
// float radius;
pcl::ModelCoefficients cylinder_coeff;
cylinder_coeff.values.resize (7); // We need 7 values
cylinder_coeff.values[0] = pt_on_axis.x ();
cylinder_coeff.values[1] = pt_on_axis.y ();
cylinder_coeff.values[2] = pt_on_axis.z ();
cylinder_coeff.values[3] = axis_direction.x ();
cylinder_coeff.values[4] = axis_direction.y ();
cylinder_coeff.values[5] = axis_direction.z ();
cylinder_coeff.values[6] = radius;
addCylinder (cylinder_coeff);
bool addCylinder(const pcl::ModelCoefficients &coefficients, const std::string &id="cylinder", int viewport=0)
Add a cylinder from a set of given model coefficients.

◆ addEllipsoid()

bool pcl::visualization::PCLVisualizer::addEllipsoid ( const Eigen::Isometry3d &  transform,
double  radius_x,
double  radius_y,
double  radius_z,
const std::string &  id = "ellipsoid",
int  viewport = 0 
)

Add an ellipsoid from the given parameters.

Parameters
[in]transforma transformation to apply to the ellipsoid from 0,0,0
[in]radius_xthe ellipsoid's radius along its local x-axis
[in]radius_ythe ellipsoid's radius along its local y-axis
[in]radius_zthe ellipsoid's radius along its local z-axis
[in]idthe ellipsoid id/name (default: "ellipsoid")
[in]viewport(optional) the id of the new viewport (default: 0)

◆ addLine() [1/4]

template<typename P1 , typename P2 >
bool pcl::visualization::PCLVisualizer::addLine ( const P1 &  pt1,
const P2 &  pt2,
const std::string &  id = "line",
int  viewport = 0 
)

Add a line segment from two points.

Parameters
[in]pt1the first (start) point on the line
[in]pt2the second (end) point on the line
[in]idthe line id/name (default: "line")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 602 of file pcl_visualizer.hpp.

◆ addLine() [2/4]

template<typename P1 , typename P2 >
bool pcl::visualization::PCLVisualizer::addLine ( const P1 &  pt1,
const P2 &  pt2,
double  r,
double  g,
double  b,
const std::string &  id = "line",
int  viewport = 0 
)

Add a line segment from two points.

Parameters
[in]pt1the first (start) point on the line
[in]pt2the second (end) point on the line
[in]rthe red channel of the color that the line should be rendered with
[in]gthe green channel of the color that the line should be rendered with
[in]bthe blue channel of the color that the line should be rendered with
[in]idthe line id/name (default: "line")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 488 of file pcl_visualizer.hpp.

References pcl::visualization::createLine().

◆ addLine() [3/4]

bool pcl::visualization::PCLVisualizer::addLine ( const pcl::ModelCoefficients coefficients,
const char *  id = "line",
int  viewport = 0 
)
inline

Add a line from a set of given model coefficients.

Parameters
[in]coefficientsthe model coefficients (point_on_line, direction)
[in]idthe line id/name (default: "line")
[in]viewport(optional) the id of the new viewport (default: 0)
// The following are given (or computed using sample consensus techniques)
// See SampleConsensusModelLine for more information
// Eigen::Vector3f point_on_line, line_direction;
line_coeff.values.resize (6); // We need 6 values
line_coeff.values[0] = point_on_line.x ();
line_coeff.values[1] = point_on_line.y ();
line_coeff.values[2] = point_on_line.z ();
line_coeff.values[3] = line_direction.x ();
line_coeff.values[4] = line_direction.y ();
line_coeff.values[5] = line_direction.z ();
addLine (line_coeff);
bool addLine(const P1 &pt1, const P2 &pt2, const std::string &id="line", int viewport=0)
Add a line segment from two points.

Definition at line 1587 of file pcl_visualizer.h.

◆ addLine() [4/4]

bool pcl::visualization::PCLVisualizer::addLine ( const pcl::ModelCoefficients coefficients,
const std::string &  id = "line",
int  viewport = 0 
)

Add a line from a set of given model coefficients.

Parameters
[in]coefficientsthe model coefficients (point_on_line, direction)
[in]idthe line id/name (default: "line")
[in]viewport(optional) the id of the new viewport (default: 0)
// The following are given (or computed using sample consensus techniques)
// See SampleConsensusModelLine for more information
// Eigen::Vector3f point_on_line, line_direction;
line_coeff.values.resize (6); // We need 6 values
line_coeff.values[0] = point_on_line.x ();
line_coeff.values[1] = point_on_line.y ();
line_coeff.values[2] = point_on_line.z ();
line_coeff.values[3] = line_direction.x ();
line_coeff.values[4] = line_direction.y ();
line_coeff.values[5] = line_direction.z ();
addLine (line_coeff);

◆ addModelFromPLYFile() [1/2]

bool pcl::visualization::PCLVisualizer::addModelFromPLYFile ( const std::string &  filename,
const std::string &  id = "PLYModel",
int  viewport = 0 
)

Add a PLYmodel as a mesh.

Parameters
[in]filenameof the ply file
[in]idthe model id/name (default: "PLYModel")
[in]viewport(optional) the id of the new viewport (default: 0)

◆ addModelFromPLYFile() [2/2]

bool pcl::visualization::PCLVisualizer::addModelFromPLYFile ( const std::string &  filename,
vtkSmartPointer< vtkTransform >  transform,
const std::string &  id = "PLYModel",
int  viewport = 0 
)

Add a PLYmodel as a mesh and applies given transformation.

Parameters
[in]filenameof the ply file
[in]transformtransformation to apply
[in]idthe model id/name (default: "PLYModel")
[in]viewport(optional) the id of the new viewport (default: 0)

◆ addModelFromPolyData() [1/2]

bool pcl::visualization::PCLVisualizer::addModelFromPolyData ( vtkSmartPointer< vtkPolyData >  polydata,
const std::string &  id = "PolyData",
int  viewport = 0 
)

Add a vtkPolydata as a mesh.

Parameters
[in]polydatavtkPolyData
[in]idthe model id/name (default: "PolyData")
[in]viewport(optional) the id of the new viewport (default: 0)

◆ addModelFromPolyData() [2/2]

bool pcl::visualization::PCLVisualizer::addModelFromPolyData ( vtkSmartPointer< vtkPolyData >  polydata,
vtkSmartPointer< vtkTransform >  transform,
const std::string &  id = "PolyData",
int  viewport = 0 
)

Add a vtkPolydata as a mesh.

Parameters
[in]polydatavtkPolyData
[in]transformtransformation to apply
[in]idthe model id/name (default: "PolyData")
[in]viewport(optional) the id of the new viewport (default: 0)

◆ addOrientationMarkerWidgetAxes()

void pcl::visualization::PCLVisualizer::addOrientationMarkerWidgetAxes ( vtkRenderWindowInteractor *  interactor)

Adds a widget which shows an interactive axes display for orientation.

Parameters
[in]interactor- Pointer to the vtk interactor object used by the PCLVisualizer window

◆ addPlane() [1/2]

bool pcl::visualization::PCLVisualizer::addPlane ( const pcl::ModelCoefficients coefficients,
const std::string &  id = "plane",
int  viewport = 0 
)

Add a plane from a set of given model coefficients.

Parameters
[in]coefficientsthe model coefficients (a, b, c, d with ax+by+cz+d=0)
[in]idthe plane id/name (default: "plane")
[in]viewport(optional) the id of the new viewport (default: 0)
// The following are given (or computed using sample consensus techniques)
// See SampleConsensusModelPlane for more information
// Eigen::Vector4f plane_parameters;
plane_coeff.values.resize (4); // We need 4 values
plane_coeff.values[0] = plane_parameters.x ();
plane_coeff.values[1] = plane_parameters.y ();
plane_coeff.values[2] = plane_parameters.z ();
plane_coeff.values[3] = plane_parameters.w ();
addPlane (plane_coeff);
bool addPlane(const pcl::ModelCoefficients &coefficients, const std::string &id="plane", int viewport=0)
Add a plane from a set of given model coefficients.

◆ addPlane() [2/2]

bool pcl::visualization::PCLVisualizer::addPlane ( const pcl::ModelCoefficients coefficients,
double  x,
double  y,
double  z,
const std::string &  id = "plane",
int  viewport = 0 
)

◆ addPointCloud() [1/14]

bool pcl::visualization::PCLVisualizer::addPointCloud ( const pcl::PCLPointCloud2::ConstPtr cloud,
const ColorHandlerConstPtr color_handler,
const Eigen::Vector4f &  sensor_origin,
const Eigen::Quaternion< float > &  sensor_orientation,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a binary blob Point Cloud to screen.

Because the geometry/color handler is given as a pointer, it will be pushed back to the list of available handlers, rather than replacing the current active handler. This makes it possible to switch between different handlers 'on-the-fly' at runtime, from the PCLVisualizer interactor interface (using [Alt+]0..9).

Parameters
[in]cloudthe input point cloud dataset
[in]color_handlera specific PointCloud visualizer handler for colors
[in]sensor_originthe origin of the cloud data in global coordinates (defaults to 0,0,0)
[in]sensor_orientationthe orientation of the cloud data in global coordinates (defaults to 1,0,0,0)
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

◆ addPointCloud() [2/14]

bool pcl::visualization::PCLVisualizer::addPointCloud ( const pcl::PCLPointCloud2::ConstPtr cloud,
const GeometryHandlerConstPtr geometry_handler,
const ColorHandlerConstPtr color_handler,
const Eigen::Vector4f &  sensor_origin,
const Eigen::Quaternion< float > &  sensor_orientation,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a binary blob Point Cloud to screen.

Because the geometry/color handler is given as a pointer, it will be pushed back to the list of available handlers, rather than replacing the current active handler. This makes it possible to switch between different handlers 'on-the-fly' at runtime, from the PCLVisualizer interactor interface (using [Alt+]0..9).

Parameters
[in]cloudthe input point cloud dataset
[in]geometry_handlera specific PointCloud visualizer handler for geometry
[in]color_handlera specific PointCloud visualizer handler for colors
[in]sensor_originthe origin of the cloud data in global coordinates (defaults to 0,0,0)
[in]sensor_orientationthe orientation of the cloud data in global coordinates (defaults to 1,0,0,0)
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

◆ addPointCloud() [3/14]

bool pcl::visualization::PCLVisualizer::addPointCloud ( const pcl::PCLPointCloud2::ConstPtr cloud,
const GeometryHandlerConstPtr geometry_handler,
const Eigen::Vector4f &  sensor_origin,
const Eigen::Quaternion< float > &  sensor_orientation,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a binary blob Point Cloud to screen.

Because the geometry/color handler is given as a pointer, it will be pushed back to the list of available handlers, rather than replacing the current active handler. This makes it possible to switch between different handlers 'on-the-fly' at runtime, from the PCLVisualizer interactor interface (using [Alt+]0..9).

Parameters
[in]cloudthe input point cloud dataset
[in]geometry_handlera specific PointCloud visualizer handler for geometry
[in]sensor_originthe origin of the cloud data in global coordinates (defaults to 0,0,0)
[in]sensor_orientationthe orientation of the cloud data in global coordinates (defaults to 1,0,0,0)
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

◆ addPointCloud() [4/14]

bool pcl::visualization::PCLVisualizer::addPointCloud ( const pcl::PointCloud< pcl::PointXYZ >::ConstPtr cloud,
const std::string &  id = "cloud",
int  viewport = 0 
)
inline

Add a PointXYZ Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 873 of file pcl_visualizer.h.

◆ addPointCloud() [5/14]

bool pcl::visualization::PCLVisualizer::addPointCloud ( const pcl::PointCloud< pcl::PointXYZL >::ConstPtr cloud,
const std::string &  id = "cloud",
int  viewport = 0 
)
inline

Add a PointXYZL Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 912 of file pcl_visualizer.h.

◆ addPointCloud() [6/14]

bool pcl::visualization::PCLVisualizer::addPointCloud ( const pcl::PointCloud< pcl::PointXYZRGB >::ConstPtr cloud,
const std::string &  id = "cloud",
int  viewport = 0 
)
inline

Add a PointXYZRGB Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 886 of file pcl_visualizer.h.

◆ addPointCloud() [7/14]

bool pcl::visualization::PCLVisualizer::addPointCloud ( const pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr cloud,
const std::string &  id = "cloud",
int  viewport = 0 
)
inline

Add a PointXYZRGBA Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 899 of file pcl_visualizer.h.

◆ addPointCloud() [8/14]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const ColorHandlerConstPtr color_handler,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a Point Cloud (templated) to screen.

Because the color handler is given as a pointer, it will be pushed back to the list of available handlers, rather than replacing the current active color handler. This makes it possible to switch between different color handlers 'on-the-fly' at runtime, from the PCLVisualizer interactor interface (using 0..9).

Parameters
[in]cloudthe input point cloud dataset
[in]color_handlera specific PointCloud visualizer handler for colors
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 153 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::sensor_orientation_, and pcl::PointCloud< PointT >::sensor_origin_.

◆ addPointCloud() [9/14]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const GeometryHandlerConstPtr geometry_handler,
const ColorHandlerConstPtr color_handler,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a Point Cloud (templated) to screen.

Because the geometry/color handler is given as a pointer, it will be pushed back to the list of available handlers, rather than replacing the current active handler. This makes it possible to switch between different handlers 'on-the-fly' at runtime, from the PCLVisualizer interactor interface (using [Alt+]0..9).

Parameters
[in]cloudthe input point cloud dataset
[in]geometry_handlera specific PointCloud visualizer handler for geometry
[in]color_handlera specific PointCloud visualizer handler for colors
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 174 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::sensor_orientation_, and pcl::PointCloud< PointT >::sensor_origin_.

◆ addPointCloud() [10/14]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const GeometryHandlerConstPtr geometry_handler,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a Point Cloud (templated) to screen.

Because the geometry handler is given as a pointer, it will be pushed back to the list of available handlers, rather than replacing the current active geometric handler. This makes it possible to switch between different geometric handlers 'on-the-fly' at runtime, from the PCLVisualizer interactor interface (using Alt+0..9).

Parameters
[in]cloudthe input point cloud dataset
[in]geometry_handleruse a geometry handler object to extract the XYZ data
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 110 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::sensor_orientation_, and pcl::PointCloud< PointT >::sensor_origin_.

◆ addPointCloud() [11/14]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const PointCloudColorHandler< PointT > &  color_handler,
const PointCloudGeometryHandler< PointT > &  geometry_handler,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a Point Cloud (templated) to screen.

Parameters
[in]cloudthe input point cloud dataset
[in]color_handlera specific PointCloud visualizer handler for colors
[in]geometry_handleruse a geometry handler object to extract the XYZ data
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 195 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::sensor_orientation_, and pcl::PointCloud< PointT >::sensor_origin_.

◆ addPointCloud() [12/14]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const PointCloudColorHandler< PointT > &  color_handler,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a Point Cloud (templated) to screen.

Parameters
[in]cloudthe input point cloud dataset
[in]color_handlera specific PointCloud visualizer handler for colors
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 131 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::sensor_orientation_, and pcl::PointCloud< PointT >::sensor_origin_.

◆ addPointCloud() [13/14]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const PointCloudGeometryHandler< PointT > &  geometry_handler,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a Point Cloud (templated) to screen.

Parameters
[in]cloudthe input point cloud dataset
[in]geometry_handleruse a geometry handler object to extract the XYZ data
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 88 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::sensor_orientation_, and pcl::PointCloud< PointT >::sensor_origin_.

◆ addPointCloud() [14/14]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add a Point Cloud (templated) to screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id (default: cloud)
viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 77 of file pcl_visualizer.hpp.

◆ addPointCloudIntensityGradients()

template<typename PointT , typename GradientT >
bool pcl::visualization::PCLVisualizer::addPointCloudIntensityGradients ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const typename pcl::PointCloud< GradientT >::ConstPtr gradients,
int  level = 100,
double  scale = 1e-6,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add the estimated surface intensity gradients of a Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset containing the XYZ data
[in]gradientsthe input point cloud dataset containing the intensity gradient data
[in]leveldisplay only every level'th point (default: 100)
[in]scalethe intensity gradient arrow scale (default: 1e-6m)
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 1103 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::size().

◆ addPointCloudNormals() [1/2]

template<typename PointNT >
bool pcl::visualization::PCLVisualizer::addPointCloudNormals ( const typename pcl::PointCloud< PointNT >::ConstPtr cloud,
int  level = 100,
float  scale = 0.02f,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add the estimated surface normals of a Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset containing XYZ data and normals
[in]leveldisplay only every level'th point (default: 100)
[in]scalethe normal arrow scale (default: 0.02m)
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 850 of file pcl_visualizer.hpp.

◆ addPointCloudNormals() [2/2]

template<typename PointT , typename PointNT >
bool pcl::visualization::PCLVisualizer::addPointCloudNormals ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const typename pcl::PointCloud< PointNT >::ConstPtr normals,
int  level = 100,
float  scale = 0.02f,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add the estimated surface normals of a Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset containing the XYZ data
[in]normalsthe input point cloud dataset containing the normal data
[in]leveldisplay only every level'th point (default: 100)
[in]scalethe normal arrow scale (default: 0.02m)
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 859 of file pcl_visualizer.hpp.

References pcl::PointCloud< PointT >::empty(), pcl::PointCloud< PointT >::height, pcl::isFinite(), pcl::isNormalFinite(), pcl::PointCloud< PointT >::isOrganized(), pcl::PointCloud< PointT >::sensor_orientation_, pcl::PointCloud< PointT >::sensor_origin_, pcl::PointCloud< PointT >::size(), and pcl::PointCloud< PointT >::width.

◆ addPointCloudPrincipalCurvatures() [1/3]

template<typename PointNT >
bool pcl::visualization::PCLVisualizer::addPointCloudPrincipalCurvatures ( const typename pcl::PointCloud< PointNT >::ConstPtr cloud,
const pcl::PointCloud< pcl::PrincipalCurvatures >::ConstPtr pcs,
int  level,
float  scale,
const std::string &  id,
int  viewport 
)

Definition at line 988 of file pcl_visualizer.hpp.

◆ addPointCloudPrincipalCurvatures() [2/3]

template<typename PointNT >
bool pcl::visualization::PCLVisualizer::addPointCloudPrincipalCurvatures ( const typename pcl::PointCloud< PointNT >::ConstPtr cloud,
const typename pcl::PointCloud< pcl::PrincipalCurvatures >::ConstPtr pcs,
int  level = 100,
float  scale = 1.0f,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add the estimated principal curvatures of a Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset containing the XYZ data and normals
[in]pcsthe input point cloud dataset containing the principal curvatures data
[in]leveldisplay only every level'th point. Default: 100
[in]scalethe normal arrow scale. Default: 1.0
[in]idthe point cloud object id. Default: "cloud"
[in]viewportthe view port where the Point Cloud should be added (default: all)

◆ addPointCloudPrincipalCurvatures() [3/3]

template<typename PointT , typename PointNT >
bool pcl::visualization::PCLVisualizer::addPointCloudPrincipalCurvatures ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const typename pcl::PointCloud< PointNT >::ConstPtr normals,
const pcl::PointCloud< pcl::PrincipalCurvatures >::ConstPtr pcs,
int  level = 100,
float  scale = 1.0f,
const std::string &  id = "cloud",
int  viewport = 0 
)

Add the estimated principal curvatures of a Point Cloud to screen.

Parameters
[in]cloudthe input point cloud dataset containing the XYZ data
[in]normalsthe input point cloud dataset containing the normal data
[in]pcsthe input point cloud dataset containing the principal curvatures data
[in]leveldisplay only every level'th point. Default: 100
[in]scalethe normal arrow scale. Default: 1.0
[in]idthe point cloud object id. Default: "cloud"
[in]viewportthe view port where the Point Cloud should be added (default: all)

Definition at line 999 of file pcl_visualizer.hpp.

References pcl::visualization::CloudActor::actor, pcl::console::print_error(), and pcl::PointCloud< PointT >::size().

◆ addPolygon() [1/3]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPolygon ( const pcl::PlanarPolygon< PointT > &  polygon,
double  r,
double  g,
double  b,
const std::string &  id = "polygon",
int  viewport = 0 
)

Add a planar polygon that represents the input point cloud (connects all points in order)

Parameters
[in]polygonthe polygon to draw
[in]rthe red channel of the color that the polygon should be rendered with
[in]gthe green channel of the color that the polygon should be rendered with
[in]bthe blue channel of the color that the polygon should be rendered with
[in]idthe polygon id/name (default: "polygon")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 424 of file pcl_visualizer.hpp.

◆ addPolygon() [2/3]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPolygon ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const std::string &  id = "polygon",
int  viewport = 0 
)

Add a polygon (polyline) that represents the input point cloud (connects all points in order)

Parameters
[in]cloudthe point cloud dataset representing the polygon
[in]idthe polygon id/name (default: "polygon")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 479 of file pcl_visualizer.hpp.

◆ addPolygon() [3/3]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPolygon ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
double  r,
double  g,
double  b,
const std::string &  id = "polygon",
int  viewport = 0 
)

Add a polygon (polyline) that represents the input point cloud (connects all points in order)

Parameters
[in]cloudthe point cloud dataset representing the polygon
[in]rthe red channel of the color that the polygon should be rendered with
[in]gthe green channel of the color that the polygon should be rendered with
[in]bthe blue channel of the color that the polygon should be rendered with
[in]id(optional) the polygon id/name (default: "polygon")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 370 of file pcl_visualizer.hpp.

◆ addPolygonMesh() [1/2]

bool pcl::visualization::PCLVisualizer::addPolygonMesh ( const pcl::PolygonMesh polymesh,
const std::string &  id = "polygon",
int  viewport = 0 
)

Add a PolygonMesh object to screen.

Parameters
[in]polymeshthe polygonal mesh
[in]idthe polygon object id (default: "polygon")
[in]viewportthe view port where the PolygonMesh should be added (default: all)

◆ addPolygonMesh() [2/2]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addPolygonMesh ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const std::vector< pcl::Vertices > &  vertices,
const std::string &  id = "polygon",
int  viewport = 0 
)

Add a PolygonMesh object to screen.

Parameters
[in]cloudthe polygonal mesh point cloud
[in]verticesthe polygonal mesh vertices
[in]idthe polygon object id (default: "polygon")
[in]viewportthe view port where the PolygonMesh should be added (default: all)

Definition at line 1630 of file pcl_visualizer.hpp.

References pcl::visualization::allocVtkUnstructuredGrid(), pcl::visualization::details::fillCells(), pcl::PointCloud< PointT >::is_dense, pcl::isFinite(), pcl::PointCloud< PointT >::points, pcl::PointCloud< PointT >::sensor_orientation_, pcl::PointCloud< PointT >::sensor_origin_, and pcl::PointCloud< PointT >::size().

◆ addPolylineFromPolygonMesh()

bool pcl::visualization::PCLVisualizer::addPolylineFromPolygonMesh ( const pcl::PolygonMesh polymesh,
const std::string &  id = "polyline",
int  viewport = 0 
)

Add a Polygonline from a polygonMesh object to screen.

Parameters
[in]polymeshthe polygonal mesh from where the polylines will be extracted
[in]idthe polygon object id (default: "polygon")
[in]viewportthe view port where the PolygonMesh should be added (default: all)

◆ addSphere() [1/3]

bool pcl::visualization::PCLVisualizer::addSphere ( const pcl::ModelCoefficients coefficients,
const std::string &  id = "sphere",
int  viewport = 0 
)

Add a sphere from a set of given model coefficients.

Parameters
[in]coefficientsthe model coefficients (sphere center, radius)
[in]idthe sphere id/name (default: "sphere")
[in]viewport(optional) the id of the new viewport (default: 0)
// The following are given (or computed using sample consensus techniques)
// See SampleConsensusModelSphere for more information
// Eigen::Vector3f sphere_center;
// float radius;
sphere_coeff.values.resize (4); // We need 4 values
sphere_coeff.values[0] = sphere_center.x ();
sphere_coeff.values[1] = sphere_center.y ();
sphere_coeff.values[2] = sphere_center.z ();
sphere_coeff.values[3] = radius;
addSphere (sphere_coeff);
bool addSphere(const PointT &center, double radius, const std::string &id="sphere", int viewport=0)
Add a sphere shape from a point and a radius.

◆ addSphere() [2/3]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addSphere ( const PointT center,
double  radius,
const std::string &  id = "sphere",
int  viewport = 0 
)

Add a sphere shape from a point and a radius.

Parameters
[in]centerthe center of the sphere
[in]radiusthe radius of the sphere
[in]idthe sphere id/name (default: "sphere")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 648 of file pcl_visualizer.hpp.

◆ addSphere() [3/3]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addSphere ( const PointT center,
double  radius,
double  r,
double  g,
double  b,
const std::string &  id = "sphere",
int  viewport = 0 
)

Add a sphere shape from a point and a radius.

Parameters
[in]centerthe center of the sphere
[in]radiusthe radius of the sphere
[in]rthe red channel of the color that the sphere should be rendered with
[in]gthe green channel of the color that the sphere should be rendered with
[in]bthe blue channel of the color that the sphere should be rendered with
[in]idthe sphere id/name (default: "sphere")
[in]viewport(optional) the id of the new viewport (default: 0)

Definition at line 609 of file pcl_visualizer.hpp.

◆ addText() [1/3]

bool pcl::visualization::PCLVisualizer::addText ( const std::string &  text,
int  xpos,
int  ypos,
const std::string &  id = "",
int  viewport = 0 
)

Add a text to screen.

Parameters
[in]textthe text to add
[in]xposthe X position on screen where the text should be added
[in]yposthe Y position on screen where the text should be added
[in]idthe text object id (default: equal to the "text" parameter)
[in]viewportthe view port (default: all)

◆ addText() [2/3]

bool pcl::visualization::PCLVisualizer::addText ( const std::string &  text,
int  xpos,
int  ypos,
double  r,
double  g,
double  b,
const std::string &  id = "",
int  viewport = 0 
)

Add a text to screen.

Parameters
[in]textthe text to add
[in]xposthe X position on screen where the text should be added
[in]yposthe Y position on screen where the text should be added
[in]rthe red color value
[in]gthe green color value
[in]bthe blue color value
[in]idthe text object id (default: equal to the "text" parameter)
[in]viewportthe view port (default: all)

◆ addText() [3/3]

bool pcl::visualization::PCLVisualizer::addText ( const std::string &  text,
int  xpos,
int  ypos,
int  fontsize,
double  r,
double  g,
double  b,
const std::string &  id = "",
int  viewport = 0 
)

Add a text to screen.

Parameters
[in]textthe text to add
[in]xposthe X position on screen where the text should be added
[in]yposthe Y position on screen where the text should be added
[in]fontsizethe fontsize of the text
[in]rthe red color value
[in]gthe green color value
[in]bthe blue color value
[in]idthe text object id (default: equal to the "text" parameter)
[in]viewportthe view port (default: all)

◆ addText3D() [1/2]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addText3D ( const std::string &  text,
const PointT position,
double  orientation[3],
double  textScale = 1.0,
double  r = 1.0,
double  g = 1.0,
double  b = 1.0,
const std::string &  id = "",
int  viewport = 0 
)

Add a 3d text to the scene.

Parameters
[in]textthe text to add
[in]positionthe world position where the text should be added
[in]orientationthe angles of rotation of the text around X, Y and Z axis, in this order. The way the rotations are effectively done is the Z-X-Y intrinsic rotations: https://en.wikipedia.org/wiki/Euler_angles#Definition_by_intrinsic_rotations
[in]textScalethe scale of the text to render
[in]rthe red color value
[in]gthe green color value
[in]bthe blue color value
[in]idthe text object id (default: equal to the "text" parameter)
[in]viewportthe view port (default: all)

Definition at line 769 of file pcl_visualizer.hpp.

◆ addText3D() [2/2]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::addText3D ( const std::string &  text,
const PointT position,
double  textScale = 1.0,
double  r = 1.0,
double  g = 1.0,
double  b = 1.0,
const std::string &  id = "",
int  viewport = 0 
)

Add a 3d text to the scene.

Parameters
[in]textthe text to add
[in]positionthe world position where the text should be added
[in]textScalethe scale of the text to render
[in]rthe red color value
[in]gthe green color value
[in]bthe blue color value
[in]idthe text object id (default: equal to the "text" parameter)
[in]viewportthe view port (default: all)

Definition at line 684 of file pcl_visualizer.hpp.

◆ addTextureMesh()

bool pcl::visualization::PCLVisualizer::addTextureMesh ( const pcl::TextureMesh polymesh,
const std::string &  id = "texture",
int  viewport = 0 
)

Add a TextureMesh object to screen.

Parameters
[in]polymeshthe textured polygonal mesh
[in]idthe texture mesh object id (default: "texture")
[in]viewportthe view port where the TextureMesh should be added (default: all)

◆ cameraFileLoaded()

bool pcl::visualization::PCLVisualizer::cameraFileLoaded ( ) const

Checks whether a camera file were automatically loaded.

Returns
True if a valid camera file is automatically loaded.
Note
The camera file is saved by pressing "ctrl + s" during last run of the program and restored automatically when the program runs this time.
See also
cameraParamsSet ()

◆ cameraParamsSet()

bool pcl::visualization::PCLVisualizer::cameraParamsSet ( ) const

Checks whether the camera parameters were manually loaded.

Returns
True if valid "-cam" option is available in command line.
See also
cameraFileLoaded ()

◆ close()

void pcl::visualization::PCLVisualizer::close ( )

Stop the interaction and close the visualization window.

◆ contains()

bool pcl::visualization::PCLVisualizer::contains ( const std::string &  id) const
inline

Check if the cloud, shape, or coordinate with the given id was already added to this visualizer.

Parameters
[in]idthe id of the cloud, shape, or coordinate to check
Returns
true if a cloud, shape, or coordinate with the specified id was found

Definition at line 595 of file pcl_visualizer.h.

◆ convertToEigenMatrix()

static void pcl::visualization::PCLVisualizer::convertToEigenMatrix ( const vtkSmartPointer< vtkMatrix4x4 > &  vtk_matrix,
Eigen::Matrix4f &  m 
)
static

Convert vtkMatrix4x4 to an Eigen4f.

Parameters
[in]vtk_matrixthe original VTK 4x4 matrix
[out]mthe resultant Eigen 4x4 matrix

◆ convertToVtkMatrix() [1/2]

static void pcl::visualization::PCLVisualizer::convertToVtkMatrix ( const Eigen::Matrix4f &  m,
vtkSmartPointer< vtkMatrix4x4 > &  vtk_matrix 
)
static

Convert Eigen::Matrix4f to vtkMatrix4x4.

Parameters
[in]mthe input Eigen matrix
[out]vtk_matrixthe resultant VTK matrix

◆ convertToVtkMatrix() [2/2]

static void pcl::visualization::PCLVisualizer::convertToVtkMatrix ( const Eigen::Vector4f &  origin,
const Eigen::Quaternion< float > &  orientation,
vtkSmartPointer< vtkMatrix4x4 > &  vtk_matrix 
)
static

Convert origin and orientation to vtkMatrix4x4.

Parameters
[in]originthe point cloud origin
[in]orientationthe point cloud orientation
[out]vtk_matrixthe resultant VTK 4x4 matrix

◆ createInteractor()

void pcl::visualization::PCLVisualizer::createInteractor ( )

Create the internal Interactor object.

◆ createViewPort()

void pcl::visualization::PCLVisualizer::createViewPort ( double  xmin,
double  ymin,
double  xmax,
double  ymax,
int &  viewport 
)

Create a new viewport from [xmin,ymin] -> [xmax,ymax].

Parameters
[in]xminthe minimum X coordinate for the viewport (0.0 <= 1.0)
[in]yminthe minimum Y coordinate for the viewport (0.0 <= 1.0)
[in]xmaxthe maximum X coordinate for the viewport (0.0 <= 1.0)
[in]ymaxthe maximum Y coordinate for the viewport (0.0 <= 1.0)
[in]viewportthe id of the new viewport
Note
If no renderer for the current window exists, one will be created, and the viewport will be set to 0 ('all'). In case one or multiple renderers do exist, the viewport ID will be set to the total number of renderers - 1.

◆ createViewPortCamera()

void pcl::visualization::PCLVisualizer::createViewPortCamera ( const int  viewport)

Create a new separate camera for the given viewport.

Parameters
[in]viewportthe viewport to create a new camera for.

◆ enableEDLRendering()

void pcl::visualization::PCLVisualizer::enableEDLRendering ( int  viewport = 0)

Eye-Dome Lighting makes dark areas to improve depth perception See https://www.kitware.com/eye-dome-lighting-a-non-photorealistic-shading-technique/ It is applied to all actors, including texts.

Parameters
viewport

◆ getCameraFile()

std::string pcl::visualization::PCLVisualizer::getCameraFile ( ) const

Get camera file for camera parameter saving/restoring.

Note
This will be valid only when valid "-cam" option were available in command line or a saved camera file were automatically loaded.
See also
cameraParamsSet (), cameraFileLoaded ()

◆ getCameraParameters() [1/2]

void pcl::visualization::PCLVisualizer::getCameraParameters ( Camera camera,
int  viewport = 0 
) const

Get camera parameters of a given viewport (0 means default viewport).

◆ getCameraParameters() [2/2]

bool pcl::visualization::PCLVisualizer::getCameraParameters ( int  argc,
char **  argv 
)

Search for camera parameters at the command line and set them internally.

Parameters
[in]argc
[in]argv

◆ getCameras()

void pcl::visualization::PCLVisualizer::getCameras ( std::vector< Camera > &  cameras)

Get the current camera parameters.

◆ getCloudActorMap()

CloudActorMapPtr pcl::visualization::PCLVisualizer::getCloudActorMap ( )
inline

Return a pointer to the CloudActorMap this visualizer uses.

Definition at line 1933 of file pcl_visualizer.h.

◆ getColorHandlerIndex()

int pcl::visualization::PCLVisualizer::getColorHandlerIndex ( const std::string &  id)

Get the color handler index of a rendered PointCloud based on its ID.

Parameters
[in]idthe point cloud object id

◆ getFPS()

float pcl::visualization::PCLVisualizer::getFPS ( ) const

Get the current rendering framerate.

See also
setShowFPS

◆ getGeometryHandlerIndex()

int pcl::visualization::PCLVisualizer::getGeometryHandlerIndex ( const std::string &  id)

Get the geometry handler index of a rendered PointCloud based on its ID.

Parameters
[in]idthe point cloud object id

◆ getInteractorStyle()

vtkSmartPointer<PCLVisualizerInteractorStyle> pcl::visualization::PCLVisualizer::getInteractorStyle ( )
inline

Get a pointer to the current interactor style used.

Definition at line 2000 of file pcl_visualizer.h.

◆ getPointCloudRenderingProperties() [1/2]

bool pcl::visualization::PCLVisualizer::getPointCloudRenderingProperties ( int  property,
double &  value,
const std::string &  id = "cloud" 
)

Get the rendering properties of a PointCloud.

Parameters
[in]propertythe property type
[in]valuethe resultant property value
[in]idthe point cloud object id (default: cloud)
Note
The list of properties can be found in pcl::visualization::LookUpTableRepresentationProperties.

◆ getPointCloudRenderingProperties() [2/2]

bool pcl::visualization::PCLVisualizer::getPointCloudRenderingProperties ( RenderingProperties  property,
double &  val1,
double &  val2,
double &  val3,
const std::string &  id = "cloud" 
)

Get the rendering properties of a PointCloud.

Parameters
[in]propertythe property type
[out]val1the resultant property value
[out]val2the resultant property value
[out]val3the resultant property value
[in]idthe point cloud object id (default: cloud)
Returns
True if the property is effectively retrieved.
Note
The list of properties can be found in pcl::visualization::LookUpTableRepresentationProperties.

◆ getRendererCollection()

vtkSmartPointer<vtkRendererCollection> pcl::visualization::PCLVisualizer::getRendererCollection ( )
inline

Return a pointer to the underlying VTK Renderer Collection.

Definition at line 1926 of file pcl_visualizer.h.

◆ getRenderWindow()

vtkSmartPointer<vtkRenderWindow> pcl::visualization::PCLVisualizer::getRenderWindow ( )
inline

Return a pointer to the underlying VTK Render Window used.

Definition at line 1919 of file pcl_visualizer.h.

◆ getShapeActorMap()

ShapeActorMapPtr pcl::visualization::PCLVisualizer::getShapeActorMap ( )
inline

Return a pointer to the ShapeActorMap this visualizer uses.

Definition at line 1940 of file pcl_visualizer.h.

◆ getViewerPose()

Eigen::Affine3f pcl::visualization::PCLVisualizer::getViewerPose ( int  viewport = 0)

Get the current viewing pose.

◆ initCameraParameters()

void pcl::visualization::PCLVisualizer::initCameraParameters ( )

Initialize camera parameters with some default values.

◆ loadCameraParameters()

bool pcl::visualization::PCLVisualizer::loadCameraParameters ( const std::string &  file)

Load camera parameters from a camera parameters file.

Parameters
[in]filethe name of the camera parameters file

◆ registerAreaPickingCallback() [1/3]

boost::signals2::connection pcl::visualization::PCLVisualizer::registerAreaPickingCallback ( std::function< void(const pcl::visualization::AreaPickingEvent &)>  cb)

Register a callback function for area picking events.

Parameters
[in]cba std function that will be registered as a callback for an area picking event
Returns
a connection object that allows to disconnect the callback function.

◆ registerAreaPickingCallback() [2/3]

boost::signals2::connection pcl::visualization::PCLVisualizer::registerAreaPickingCallback ( void(*)(const pcl::visualization::AreaPickingEvent &, void *)  callback,
void *  cookie = nullptr 
)

Register a callback function for area picking events.

Parameters
[in]callbackthe function that will be registered as a callback for an area picking event
[in]cookieuser data that is passed to the callback
Returns
a connection object that allows to disconnect the callback function.

◆ registerAreaPickingCallback() [3/3]

template<typename T >
boost::signals2::connection pcl::visualization::PCLVisualizer::registerAreaPickingCallback ( void(T::*)(const pcl::visualization::AreaPickingEvent &, void *)  callback,
T &  instance,
void *  cookie = nullptr 
)
inline

Register a callback function for area picking events.

Parameters
[in]callbackthe member function that will be registered as a callback for an area picking event
[in]instanceinstance to the class that implements the callback function
[in]cookieuser data that is passed to the callback
Returns
a connection object that allows to disconnect the callback function.

Definition at line 278 of file pcl_visualizer.h.

◆ registerKeyboardCallback() [1/3]

boost::signals2::connection pcl::visualization::PCLVisualizer::registerKeyboardCallback ( std::function< void(const pcl::visualization::KeyboardEvent &)>  cb)

Register a callback std::function for keyboard events.

Parameters
[in]cba std function that will be registered as a callback for a keyboard event
Returns
a connection object that allows to disconnect the callback function.

◆ registerKeyboardCallback() [2/3]

boost::signals2::connection pcl::visualization::PCLVisualizer::registerKeyboardCallback ( void(*)(const pcl::visualization::KeyboardEvent &, void *)  callback,
void *  cookie = nullptr 
)
inline

Register a callback function for keyboard events.

Parameters
[in]callbackthe function that will be registered as a callback for a keyboard event
[in]cookieuser data that is passed to the callback
Returns
a connection object that allows to disconnect the callback function.

Definition at line 182 of file pcl_visualizer.h.

◆ registerKeyboardCallback() [3/3]

template<typename T >
boost::signals2::connection pcl::visualization::PCLVisualizer::registerKeyboardCallback ( void(T::*)(const pcl::visualization::KeyboardEvent &, void *)  callback,
T &  instance,
void *  cookie = nullptr 
)
inline

Register a callback function for keyboard events.

Parameters
[in]callbackthe member function that will be registered as a callback for a keyboard event
[in]instanceinstance to the class that implements the callback function
[in]cookieuser data that is passed to the callback
Returns
a connection object that allows to disconnect the callback function.

Definition at line 194 of file pcl_visualizer.h.

◆ registerMouseCallback() [1/3]

boost::signals2::connection pcl::visualization::PCLVisualizer::registerMouseCallback ( std::function< void(const pcl::visualization::MouseEvent &)>  cb)

Register a callback function for mouse events.

Parameters
[in]cba std function that will be registered as a callback for a mouse event
Returns
a connection object that allows to disconnect the callback function.

◆ registerMouseCallback() [2/3]

boost::signals2::connection pcl::visualization::PCLVisualizer::registerMouseCallback ( void(*)(const pcl::visualization::MouseEvent &, void *)  callback,
void *  cookie = nullptr 
)
inline

Register a callback function for mouse events.

Parameters
[in]callbackthe function that will be registered as a callback for a mouse event
[in]cookieuser data that is passed to the callback
Returns
a connection object that allows to disconnect the callback function.

Definition at line 212 of file pcl_visualizer.h.

◆ registerMouseCallback() [3/3]

template<typename T >
boost::signals2::connection pcl::visualization::PCLVisualizer::registerMouseCallback ( void(T::*)(const pcl::visualization::MouseEvent &, void *)  callback,
T &  instance,
void *  cookie = nullptr 
)
inline

Register a callback function for mouse events.

Parameters
[in]callbackthe member function that will be registered as a callback for a mouse event
[in]instanceinstance to the class that implements the callback function
[in]cookieuser data that is passed to the callback
Returns
a connection object that allows to disconnect the callback function.

Definition at line 224 of file pcl_visualizer.h.

◆ registerPointPickingCallback() [1/3]

boost::signals2::connection pcl::visualization::PCLVisualizer::registerPointPickingCallback ( std::function< void(const pcl::visualization::PointPickingEvent &)>  cb)

Register a callback function for point picking events.

Parameters
[in]cba std function that will be registered as a callback for a point picking event
Returns
a connection object that allows to disconnect the callback function.

◆ registerPointPickingCallback() [2/3]

boost::signals2::connection pcl::visualization::PCLVisualizer::registerPointPickingCallback ( void(*)(const pcl::visualization::PointPickingEvent &, void *)  callback,
void *  cookie = nullptr 
)

Register a callback function for point picking events.

Parameters
[in]callbackthe function that will be registered as a callback for a point picking event
[in]cookieuser data that is passed to the callback
Returns
a connection object that allows to disconnect the callback function.

◆ registerPointPickingCallback() [3/3]

template<typename T >
boost::signals2::connection pcl::visualization::PCLVisualizer::registerPointPickingCallback ( void(T::*)(const pcl::visualization::PointPickingEvent &, void *)  callback,
T &  instance,
void *  cookie = nullptr 
)
inline

Register a callback function for point picking events.

Parameters
[in]callbackthe member function that will be registered as a callback for a point picking event
[in]instanceinstance to the class that implements the callback function
[in]cookieuser data that is passed to the callback
Returns
a connection object that allows to disconnect the callback function.

Definition at line 251 of file pcl_visualizer.h.

◆ removeAllCoordinateSystems()

bool pcl::visualization::PCLVisualizer::removeAllCoordinateSystems ( int  viewport = 0)

Removes all existing 3D axes (coordinate systems)

Parameters
[in]viewportview port where the 3D axes should be removed from (default: all)

◆ removeAllPointClouds()

bool pcl::visualization::PCLVisualizer::removeAllPointClouds ( int  viewport = 0)

Remove all point cloud data on screen from the given viewport.

Parameters
[in]viewportview port from where the clouds should be removed (default: all)

◆ removeAllShapes()

bool pcl::visualization::PCLVisualizer::removeAllShapes ( int  viewport = 0)

Remove all 3D shape data on screen from the given viewport.

Parameters
[in]viewportview port from where the shapes should be removed (default: all)

◆ removeCoordinateSystem()

bool pcl::visualization::PCLVisualizer::removeCoordinateSystem ( const std::string &  id = "reference",
int  viewport = 0 
)

Removes a previously added 3D axes (coordinate system)

Parameters
[in]idthe coordinate system object id (default: reference)
[in]viewportview port where the 3D axes should be removed from (default: all)

◆ removeCorrespondences()

void pcl::visualization::PCLVisualizer::removeCorrespondences ( const std::string &  id = "correspondences",
int  viewport = 0 
)

Remove the specified correspondences from the display.

Parameters
[in]idthe polygon correspondences object id (i.e., given on addCorrespondences)
[in]viewportview port from where the correspondences should be removed (default: all)

◆ removeOrientationMarkerWidgetAxes()

void pcl::visualization::PCLVisualizer::removeOrientationMarkerWidgetAxes ( )

Disables the Orientatation Marker Widget so it is removed from the renderer.

◆ removePointCloud()

bool pcl::visualization::PCLVisualizer::removePointCloud ( const std::string &  id = "cloud",
int  viewport = 0 
)

Removes a Point Cloud from screen, based on a given ID.

Parameters
[in]idthe point cloud object id (i.e., given on addPointCloud)
[in]viewportview port from where the Point Cloud should be removed (default: all)
Returns
true if the point cloud is successfully removed and false if the point cloud is not actually displayed

◆ removePolygonMesh()

bool pcl::visualization::PCLVisualizer::removePolygonMesh ( const std::string &  id = "polygon",
int  viewport = 0 
)
inline

Removes a PolygonMesh from screen, based on a given ID.

Parameters
[in]idthe polygon object id (i.e., given on addPolygonMesh)
[in]viewportview port from where the PolygonMesh should be removed (default: all)

Definition at line 385 of file pcl_visualizer.h.

◆ removeShape()

bool pcl::visualization::PCLVisualizer::removeShape ( const std::string &  id = "cloud",
int  viewport = 0 
)

Removes an added shape from screen (line, polygon, etc.), based on a given ID.

Note
This methods also removes PolygonMesh objects and PointClouds, if they match the ID
Parameters
[in]idthe shape object id (i.e., given on addLine etc.)
[in]viewportview port from where the Point Cloud should be removed (default: all)

Referenced by pcl::people::PersonCluster< PointT >::drawTBoundingBox().

◆ removeText3D()

bool pcl::visualization::PCLVisualizer::removeText3D ( const std::string &  id = "cloud",
int  viewport = 0 
)

Removes an added 3D text from the scene, based on a given ID.

Parameters
[in]idthe 3D text id (i.e., given on addText3D etc.)
[in]viewportview port from where the 3D text should be removed (default: all)

◆ renderView()

void pcl::visualization::PCLVisualizer::renderView ( int  xres,
int  yres,
pcl::PointCloud< pcl::PointXYZ >::Ptr cloud 
)

Renders a virtual scene as seen from the camera viewpoint and returns the rendered point cloud.

ATT: This method will only render the scene if only on viewport exists. Otherwise, returns an empty point cloud and exits immediately.

Parameters
[in]xresis the size of the window (X) used to render the scene
[in]yresis the size of the window (Y) used to render the scene
[in]cloudis the rendered point cloud

◆ renderViewTesselatedSphere()

void pcl::visualization::PCLVisualizer::renderViewTesselatedSphere ( int  xres,
int  yres,
pcl::PointCloud< pcl::PointXYZ >::CloudVectorType &  cloud,
std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > &  poses,
std::vector< float > &  enthropies,
int  tesselation_level,
float  view_angle = 45,
float  radius_sphere = 1,
bool  use_vertices = true 
)

The purpose of this method is to render a CAD model added to the visualizer from different viewpoints in order to simulate partial views of model.

The viewpoint locations are the vertices of a tessellated sphere build from an icosaheadron. The tessellation parameter controls how many times the triangles of the original icosahedron are divided to approximate the sphere and thus the number of partial view generated for a model, with a tesselation_level of 0, 12 views are generated if use_vertices=true and 20 views if use_vertices=false

Parameters
[in]xresthe size of the window (X) used to render the partial view of the object
[in]yresthe size of the window (Y) used to render the partial view of the object
[in]cloudis a vector of pointcloud with XYZ information that represent the model as seen from the respective viewpoints.
[out]posesrepresent the transformation from object coordinates to camera coordinates for the respective viewpoint.
[out]enthropiesare values between 0 and 1 representing which percentage of the model is seen from the respective viewpoint.
[in]tesselation_levelrepresents the number of subdivisions applied to the triangles of original icosahedron.
[in]view_anglefield of view of the virtual camera. Default: 45
[in]radius_spherethe tessellated sphere radius. Default: 1
[in]use_verticesif true, use the vertices of tessellated icosahedron (12,42,...) or if false, use the faces of tessellated icosahedron (20,80,...). Default: true

◆ resetCamera()

void pcl::visualization::PCLVisualizer::resetCamera ( )

Reset camera parameters and render.

◆ resetCameraViewpoint()

void pcl::visualization::PCLVisualizer::resetCameraViewpoint ( const std::string &  id = "cloud")

Reset the camera direction from {0, 0, 0} to the center_{x, y, z} of a given dataset.

Parameters
[in]idthe point cloud object id (default: cloud)

◆ resetStoppedFlag()

void pcl::visualization::PCLVisualizer::resetStoppedFlag ( )

Set the stopped flag back to false.

◆ saveCameraParameters()

void pcl::visualization::PCLVisualizer::saveCameraParameters ( const std::string &  file)

Save the camera parameters to disk, as a .cam file.

Parameters
[in]filethe name of the .cam file

◆ saveScreenshot()

void pcl::visualization::PCLVisualizer::saveScreenshot ( const std::string &  file)

Save the current rendered image to disk, as a PNG screenshot.

Parameters
[in]filethe name of the PNG file

◆ setBackgroundColor()

void pcl::visualization::PCLVisualizer::setBackgroundColor ( const double &  r,
const double &  g,
const double &  b,
int  viewport = 0 
)

Set the viewport's background color.

Parameters
[in]rthe red component of the RGB color
[in]gthe green component of the RGB color
[in]bthe blue component of the RGB color
[in]viewportthe view port (default: all)

◆ setCameraClipDistances()

void pcl::visualization::PCLVisualizer::setCameraClipDistances ( double  near,
double  far,
int  viewport = 0 
)

Set the camera clipping distances.

Parameters
[in]nearthe near clipping distance (no objects closer than this to the camera will be drawn)
[in]farthe far clipping distance (no objects further away than this to the camera will be drawn)
[in]viewportthe viewport to modify camera of (0 modifies all cameras)

◆ setCameraFieldOfView()

void pcl::visualization::PCLVisualizer::setCameraFieldOfView ( double  fovy,
int  viewport = 0 
)

Set the camera vertical field of view.

Parameters
[in]fovyvertical field of view in radians
[in]viewportthe viewport to modify camera of (0 modifies all cameras)

◆ setCameraParameters() [1/2]

void pcl::visualization::PCLVisualizer::setCameraParameters ( const Camera camera,
int  viewport = 0 
)

Set the camera parameters by given a full camera data structure.

Parameters
[in]cameracamera structure containing all the camera parameters.
[in]viewportthe viewport to modify camera of (0 modifies all cameras)

◆ setCameraParameters() [2/2]

void pcl::visualization::PCLVisualizer::setCameraParameters ( const Eigen::Matrix3f &  intrinsics,
const Eigen::Matrix4f &  extrinsics,
int  viewport = 0 
)

Set the camera parameters via an intrinsics and and extrinsics matrix.

Note
This assumes that the pixels are square and that the center of the image is at the center of the sensor.
Parameters
[in]intrinsicsthe intrinsics that will be used to compute the VTK camera parameters
[in]extrinsicsthe extrinsics that will be used to compute the VTK camera parameters
[in]viewportthe viewport to modify camera of (0 modifies all cameras)

◆ setCameraPosition() [1/2]

void pcl::visualization::PCLVisualizer::setCameraPosition ( double  pos_x,
double  pos_y,
double  pos_z,
double  up_x,
double  up_y,
double  up_z,
int  viewport = 0 
)

Set the camera location and viewup according to the given arguments.

Parameters
[in]pos_xthe x coordinate of the camera location
[in]pos_ythe y coordinate of the camera location
[in]pos_zthe z coordinate of the camera location
[in]up_xthe x component of the view up direction of the camera
[in]up_ythe y component of the view up direction of the camera
[in]up_zthe z component of the view up direction of the camera
[in]viewportthe viewport to modify camera of (0 modifies all cameras)

◆ setCameraPosition() [2/2]

void pcl::visualization::PCLVisualizer::setCameraPosition ( double  pos_x,
double  pos_y,
double  pos_z,
double  view_x,
double  view_y,
double  view_z,
double  up_x,
double  up_y,
double  up_z,
int  viewport = 0 
)

Set the camera pose given by position, viewpoint and up vector.

Parameters
[in]pos_xthe x coordinate of the camera location
[in]pos_ythe y coordinate of the camera location
[in]pos_zthe z coordinate of the camera location
[in]view_xthe x component of the view point of the camera
[in]view_ythe y component of the view point of the camera
[in]view_zthe z component of the view point of the camera
[in]up_xthe x component of the view up direction of the camera
[in]up_ythe y component of the view up direction of the camera
[in]up_zthe z component of the view up direction of the camera
[in]viewportthe viewport to modify camera of (0 modifies all cameras)

◆ setFullScreen()

void pcl::visualization::PCLVisualizer::setFullScreen ( bool  mode)

Enables/Disabled the underlying window mode to full screen.

Note
This might or might not work, depending on your window manager. See the VTK documentation for additional details.
Parameters
[in]modetrue for full screen, false otherwise

◆ setLookUpTableID()

void pcl::visualization::PCLVisualizer::setLookUpTableID ( const std::string  id)

Set the ID of a cloud or shape to be used for LUT display.

Parameters
[in]idThe id of the cloud/shape look up table to be displayed The look up table is displayed by pressing 'u' in the PCLVisualizer

◆ setPointCloudRenderingProperties() [1/3]

bool pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( int  property,
double  val1,
double  val2,
const std::string &  id = "cloud",
int  viewport = 0 
)

Set the rendering properties of a PointCloud (2x values - e.g., LUT minmax values)

Parameters
[in]propertythe property type
[in]val1the first value to be set
[in]val2the second value to be set
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud's rendering properties should be modified (default: all)
Note
The list of properties can be found in pcl::visualization::LookUpTableRepresentationProperties.

◆ setPointCloudRenderingProperties() [2/3]

bool pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( int  property,
double  val1,
double  val2,
double  val3,
const std::string &  id = "cloud",
int  viewport = 0 
)

Set the rendering properties of a PointCloud (3x values - e.g., RGB)

Parameters
[in]propertythe property type
[in]val1the first value to be set
[in]val2the second value to be set
[in]val3the third value to be set
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud's rendering properties should be modified (default: all)
Note
The list of properties can be found in pcl::visualization::LookUpTableRepresentationProperties.

◆ setPointCloudRenderingProperties() [3/3]

bool pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( int  property,
double  value,
const std::string &  id = "cloud",
int  viewport = 0 
)

Set the rendering properties of a PointCloud.

Parameters
[in]propertythe property type
[in]valuethe value to be set
[in]idthe point cloud object id (default: cloud)
[in]viewportthe view port where the Point Cloud's rendering properties should be modified (default: all)
Note
The list of properties can be found in pcl::visualization::LookUpTableRepresentationProperties.

◆ setPointCloudSelected()

bool pcl::visualization::PCLVisualizer::setPointCloudSelected ( const bool  selected,
const std::string &  id = "cloud" 
)

Set whether the point cloud is selected or not.

Parameters
[in]selectedwhether the cloud is selected or not (true = selected)
[in]idthe point cloud object id (default: cloud)

◆ setPosition()

void pcl::visualization::PCLVisualizer::setPosition ( int  x,
int  y 
)

Set the position in screen coordinates.

Parameters
[in]xwhere to move the window to (X)
[in]ywhere to move the window to (Y)

◆ setRepresentationToPointsForAllActors()

void pcl::visualization::PCLVisualizer::setRepresentationToPointsForAllActors ( )

Changes the visual representation for all actors to points representation.

◆ setRepresentationToSurfaceForAllActors()

void pcl::visualization::PCLVisualizer::setRepresentationToSurfaceForAllActors ( )

Changes the visual representation for all actors to surface representation.

◆ setRepresentationToWireframeForAllActors()

void pcl::visualization::PCLVisualizer::setRepresentationToWireframeForAllActors ( )

Changes the visual representation for all actors to wireframe representation.

◆ setShapeRenderingProperties() [1/3]

bool pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( int  property,
double  val1,
double  val2,
const std::string &  id,
int  viewport = 0 
)

Set the rendering properties of a shape (2x values - e.g., LUT minmax values)

Parameters
[in]propertythe property type
[in]val1the first value to be set
[in]val2the second value to be set
[in]idthe shape object id
[in]viewportthe view port where the shape's properties should be modified (default: all)
Note
When using addPolygonMesh you you should use setPointCloudRenderingProperties

◆ setShapeRenderingProperties() [2/3]

bool pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( int  property,
double  val1,
double  val2,
double  val3,
const std::string &  id,
int  viewport = 0 
)

Set the rendering properties of a shape (3x values - e.g., RGB)

Parameters
[in]propertythe property type
[in]val1the first value to be set
[in]val2the second value to be set
[in]val3the third value to be set
[in]idthe shape object id
[in]viewportthe view port where the shape's properties should be modified (default: all)
Note
When using addPolygonMesh you you should use setPointCloudRenderingProperties

◆ setShapeRenderingProperties() [3/3]

bool pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( int  property,
double  value,
const std::string &  id,
int  viewport = 0 
)

Set the rendering properties of a shape.

Parameters
[in]propertythe property type
[in]valuethe value to be set
[in]idthe shape object id
[in]viewportthe view port where the shape's properties should be modified (default: all)
Note
When using addPolygonMesh you you should use setPointCloudRenderingProperties
The list of properties can be found in pcl::visualization::LookUpTableRepresentationProperties.

Referenced by pcl::people::PersonCluster< PointT >::drawTBoundingBox().

◆ setShowFPS()

void pcl::visualization::PCLVisualizer::setShowFPS ( bool  show_fps)

Sets whether the 2D overlay text showing the framerate of the window is displayed or not.

Parameters
[in]show_fpsdetermines whether the fps text will be shown or not.

◆ setSize()

void pcl::visualization::PCLVisualizer::setSize ( int  xw,
int  yw 
)

Set the window size in screen coordinates.

Parameters
[in]xwwindow size in horizontal (pixels)
[in]ywwindow size in vertical (pixels)

◆ setupInteractor() [1/2]

void pcl::visualization::PCLVisualizer::setupInteractor ( vtkRenderWindowInteractor *  iren,
vtkRenderWindow *  win 
)

Set up our unique PCL interactor style for a given vtkRenderWindowInteractor object attached to a given vtkRenderWindow.

Parameters
[in,out]irenthe vtkRenderWindowInteractor object to set up
[in,out]wina vtkRenderWindow object that the interactor is attached to

◆ setupInteractor() [2/2]

void pcl::visualization::PCLVisualizer::setupInteractor ( vtkRenderWindowInteractor *  iren,
vtkRenderWindow *  win,
vtkInteractorStyle *  style 
)

Set up PCLVisualizer with custom interactor style for a given vtkRenderWindowInteractor object attached to a given vtkRenderWindow.

Parameters
[in,out]irenthe vtkRenderWindowInteractor object to set up
[in,out]wina vtkRenderWindow object that the interactor is attached to
[in,out]stylea vtkInteractorStyle object

◆ setUseVbos()

void pcl::visualization::PCLVisualizer::setUseVbos ( bool  use_vbos)

Use Vertex Buffer Objects renderers.

This is an optimization for the obsolete OpenGL backend. Modern OpenGL2 backend (VTK ≥ 6.3) uses vertex buffer objects by default, transparently for the user.

Parameters
[in]use_vbosset to true to use VBOs
Deprecated:
Scheduled for removal in version 1 . 18 : "this function has no effect"

◆ setWindowBorders()

void pcl::visualization::PCLVisualizer::setWindowBorders ( bool  mode)

Enables or disable the underlying window borders.

Note
This might or might not work, depending on your window manager. See the VTK documentation for additional details.
Parameters
[in]modetrue for borders, false otherwise

◆ setWindowName()

void pcl::visualization::PCLVisualizer::setWindowName ( const std::string &  name)

Set the visualizer window name.

Parameters
[in]namethe name of the window

◆ spin()

void pcl::visualization::PCLVisualizer::spin ( )

Spin method.

Calls the interactor and runs an internal loop.

◆ spinOnce()

void pcl::visualization::PCLVisualizer::spinOnce ( int  time = 1,
bool  force_redraw = false 
)

Spin once method.

Calls the interactor and updates the screen once.

Parameters
[in]time- How long (in ms) should the visualization loop be allowed to run.
[in]force_redraw- if false it might return without doing anything if the interactor's framerate does not require a redraw yet.
Note
This function may not return immediately after the specified time has elapsed, for example if the user continues to interact with the visualizer, meaning that there are still events to process.

◆ updateColorHandlerIndex()

bool pcl::visualization::PCLVisualizer::updateColorHandlerIndex ( const std::string &  id,
int  index 
)

Update/set the color index of a rendered PointCloud based on its ID.

Parameters
[in]idthe point cloud object id
[in]indexthe color handler index to use

◆ updateCoordinateSystemPose()

bool pcl::visualization::PCLVisualizer::updateCoordinateSystemPose ( const std::string &  id,
const Eigen::Affine3f &  pose 
)

Set the pose of an existing coordinate system.

Returns false if the coordinate system doesn't exist, true if the pose was successfully updated.

Parameters
[in]idthe point cloud object id (i.e., given on addCoordinateSystem etc.)
[in]posethe new pose
Returns
false if no coordinate system with the specified ID was found

◆ updateCorrespondences() [1/2]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::updateCorrespondences ( const typename pcl::PointCloud< PointT >::ConstPtr source_points,
const typename pcl::PointCloud< PointT >::ConstPtr target_points,
const pcl::Correspondences correspondences,
const std::string &  id = "correspondences",
int  viewport = 0 
)
inline

Update the specified correspondences to the display.

Parameters
[in]source_pointsThe source points
[in]target_pointsThe target points
[in]correspondencesThe mapping from source points to target points. Each element must be an index into target_points
[in]idthe polygon object id (default: "correspondences")
[in]viewportthe view port where the correspondences should be updated (default: all)

Definition at line 1108 of file pcl_visualizer.h.

◆ updateCorrespondences() [2/2]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::updateCorrespondences ( const typename pcl::PointCloud< PointT >::ConstPtr source_points,
const typename pcl::PointCloud< PointT >::ConstPtr target_points,
const pcl::Correspondences correspondences,
int  nth,
const std::string &  id = "correspondences",
int  viewport = 0 
)

Update the specified correspondences to the display.

Parameters
[in]source_pointsThe source points
[in]target_pointsThe target points
[in]correspondencesThe mapping from source points to target points. Each element must be an index into target_points
[in]nthdisplay only the Nth correspondence (e.g., skip the rest)
[in]idthe polygon object id (default: "correspondences")
[in]viewportthe view port where the correspondences should be updated (default: all)

Definition at line 1330 of file pcl_visualizer.hpp.

◆ updatePointCloud() [1/7]

bool pcl::visualization::PCLVisualizer::updatePointCloud ( const pcl::PointCloud< pcl::PointXYZ >::ConstPtr cloud,
const std::string &  id = "cloud" 
)
inline

Updates the XYZ data for an existing cloud object id on screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id to update (default: cloud)
Returns
false if no cloud with the specified ID was found

Definition at line 925 of file pcl_visualizer.h.

◆ updatePointCloud() [2/7]

bool pcl::visualization::PCLVisualizer::updatePointCloud ( const pcl::PointCloud< pcl::PointXYZL >::ConstPtr cloud,
const std::string &  id = "cloud" 
)
inline

Updates the XYZL data for an existing cloud object id on screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id to update (default: cloud)
Returns
false if no cloud with the specified ID was found

Definition at line 963 of file pcl_visualizer.h.

◆ updatePointCloud() [3/7]

bool pcl::visualization::PCLVisualizer::updatePointCloud ( const pcl::PointCloud< pcl::PointXYZRGB >::ConstPtr cloud,
const std::string &  id = "cloud" 
)
inline

Updates the XYZRGB data for an existing cloud object id on screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id to update (default: cloud)
Returns
false if no cloud with the specified ID was found

Definition at line 937 of file pcl_visualizer.h.

◆ updatePointCloud() [4/7]

bool pcl::visualization::PCLVisualizer::updatePointCloud ( const pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr cloud,
const std::string &  id = "cloud" 
)
inline

Updates the XYZRGBA data for an existing cloud object id on screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id to update (default: cloud)
Returns
false if no cloud with the specified ID was found

Definition at line 950 of file pcl_visualizer.h.

◆ updatePointCloud() [5/7]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::updatePointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const PointCloudColorHandler< PointT > &  color_handler,
const std::string &  id = "cloud" 
)

Updates the XYZ data for an existing cloud object id on screen.

Parameters
[in]cloudthe input point cloud dataset
[in]color_handlerthe color handler to use
[in]idthe point cloud object id to update (default: cloud)
Returns
false if no cloud with the specified ID was found

Definition at line 1592 of file pcl_visualizer.hpp.

References pcl::visualization::PointCloudColorHandler< PointT >::getColor().

◆ updatePointCloud() [6/7]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::updatePointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const PointCloudGeometryHandler< PointT > &  geometry_handler,
const std::string &  id = "cloud" 
)

Updates the XYZ data for an existing cloud object id on screen.

Parameters
[in]cloudthe input point cloud dataset
[in]geometry_handlerthe geometry handler to use
[in]idthe point cloud object id to update (default: cloud)
Returns
false if no cloud with the specified ID was found

Definition at line 1560 of file pcl_visualizer.hpp.

◆ updatePointCloud() [7/7]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::updatePointCloud ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const std::string &  id = "cloud" 
)

Updates the XYZ data for an existing cloud object id on screen.

Parameters
[in]cloudthe input point cloud dataset
[in]idthe point cloud object id to update (default: cloud)
Returns
false if no cloud with the specified ID was found

Definition at line 1530 of file pcl_visualizer.hpp.

◆ updatePointCloudPose()

bool pcl::visualization::PCLVisualizer::updatePointCloudPose ( const std::string &  id,
const Eigen::Affine3f &  pose 
)

Set the pose of an existing point cloud.

Returns false if the point cloud doesn't exist, true if the pose was successfully updated.

Parameters
[in]idthe point cloud object id (i.e., given on addPointCloud etc.)
[in]posethe new pose
Returns
false if no point cloud with the specified ID was found

◆ updatePolygonMesh() [1/2]

bool pcl::visualization::PCLVisualizer::updatePolygonMesh ( const pcl::PolygonMesh polymesh,
const std::string &  id = "polygon" 
)

Update a PolygonMesh object on screen.

Parameters
[in]polymeshthe polygonal mesh
[in]idthe polygon object id (default: "polygon")
Returns
false if no polygonmesh with the specified ID was found

◆ updatePolygonMesh() [2/2]

template<typename PointT >
bool pcl::visualization::PCLVisualizer::updatePolygonMesh ( const typename pcl::PointCloud< PointT >::ConstPtr cloud,
const std::vector< pcl::Vertices > &  vertices,
const std::string &  id = "polygon" 
)

Update a PolygonMesh object on screen.

Parameters
[in]cloudthe polygonal mesh point cloud
[in]verticesthe polygonal mesh vertices
[in]idthe polygon object id (default: "polygon")
Returns
false if no polygonmesh with the specified ID was found

Definition at line 1779 of file pcl_visualizer.hpp.

References pcl::visualization::details::fillCells(), pcl::PointCloud< PointT >::is_dense, pcl::isFinite(), pcl::console::print_error(), and pcl::PointCloud< PointT >::size().

◆ updateShapePose()

bool pcl::visualization::PCLVisualizer::updateShapePose ( const std::string &  id,
const Eigen::Affine3f &  pose 
)

Set the pose of an existing shape.

Returns false if the shape doesn't exist, true if the pose was successfully updated.

Parameters
[in]idthe shape or cloud object id (i.e., given on addLine etc.)
[in]posethe new pose
Returns
false if no shape or cloud with the specified ID was found

◆ updateSphere()

template<typename PointT >
bool pcl::visualization::PCLVisualizer::updateSphere ( const PointT center,
double  radius,
double  r,
double  g,
double  b,
const std::string &  id = "sphere" 
)

Update an existing sphere shape from a point and a radius.

Parameters
[in]centerthe center of the sphere
[in]radiusthe radius of the sphere
[in]rthe red channel of the color that the sphere should be rendered with
[in]gthe green channel of the color that the sphere should be rendered with
[in]bthe blue channel of the color that the sphere should be rendered with
[in]idthe sphere id/name (default: "sphere")

Definition at line 655 of file pcl_visualizer.hpp.

◆ updateText() [1/3]

bool pcl::visualization::PCLVisualizer::updateText ( const std::string &  text,
int  xpos,
int  ypos,
const std::string &  id = "" 
)

Update a text to screen.

Parameters
[in]textthe text to update
[in]xposthe new X position on screen
[in]yposthe new Y position on screen
[in]idthe text object id (default: equal to the "text" parameter)

◆ updateText() [2/3]

bool pcl::visualization::PCLVisualizer::updateText ( const std::string &  text,
int  xpos,
int  ypos,
double  r,
double  g,
double  b,
const std::string &  id = "" 
)

Update a text to screen.

Parameters
[in]textthe text to update
[in]xposthe new X position on screen
[in]yposthe new Y position on screen
[in]rthe red color value
[in]gthe green color value
[in]bthe blue color value
[in]idthe text object id (default: equal to the "text" parameter)

◆ updateText() [3/3]

bool pcl::visualization::PCLVisualizer::updateText ( const std::string &  text,
int  xpos,
int  ypos,
int  fontsize,
double  r,
double  g,
double  b,
const std::string &  id = "" 
)

Update a text to screen.

Parameters
[in]textthe text to update
[in]xposthe new X position on screen
[in]yposthe new Y position on screen
[in]fontsizethe fontsize of the text
[in]rthe red color value
[in]gthe green color value
[in]bthe blue color value
[in]idthe text object id (default: equal to the "text" parameter)

◆ wasStopped()

bool pcl::visualization::PCLVisualizer::wasStopped ( ) const

Returns true when the user tried to close the window.

Member Data Documentation

◆ interactor_

vtkSmartPointer<vtkRenderWindowInteractor> pcl::visualization::PCLVisualizer::interactor_
protected

The render window interactor.

Definition at line 2006 of file pcl_visualizer.h.


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