Classes | Public Types | Public Member Functions | Public Attributes | Protected Attributes

pcl::visualization::PCLVisualizer Class Reference
[Module visualization]

PCL Visualizer main class. More...

#include <pcl/visualization/pcl_visualizer.h>

Collaboration diagram for pcl::visualization::PCLVisualizer:
Collaboration graph
[legend]

List of all members.

Classes

struct  ExitCallback
struct  ExitMainLoopTimerCallback

Public Types

typedef
PointCloudGeometryHandler
< sensor_msgs::PointCloud2
GeometryHandler
typedef GeometryHandler::Ptr GeometryHandlerPtr
typedef GeometryHandler::ConstPtr GeometryHandlerConstPtr
typedef PointCloudColorHandler
< sensor_msgs::PointCloud2
ColorHandler
typedef ColorHandler::Ptr ColorHandlerPtr
typedef ColorHandler::ConstPtr ColorHandlerConstPtr

Public Member Functions

 PCLVisualizer (const std::string &name="")
 PCL Visualizer constructor.
 PCLVisualizer (int &argc, char **argv, const std::string &name="", PCLVisualizerInteractorStyle *style=PCLVisualizerInteractorStyle::New())
 PCL Visualizer constructor.
virtual ~PCLVisualizer ()
 PCL Visualizer destructor.
void spin ()
 Spin method.
void spinOnce (int time=1, bool force_redraw=false)
 Spin once method.
void addCoordinateSystem (double scale=1.0, int viewport=0)
 Adds 3D axes describing a coordinate system to screen at 0,0,0.
void addCoordinateSystem (double scale, float x, float y, float z, int viewport=0)
 Adds 3D axes describing a coordinate system to screen at x, y, z.
void removeCoordinateSystem (int viewport=0)
 Removes a previously added 3D axes (coordinate system).
bool removePointCloud (const std::string &id="cloud", int viewport=0)
 Removes a Point Cloud from screen, based on a given ID.
bool removeShape (const std::string &id="cloud", int viewport=0)
 Removes an added shape from screen (line, polygon, etc.
void setBackgroundColor (const double &r, const double &g, const double &b, int viewport=0)
 Set the viewport's background color.
bool addText (const std::string &text, int xpos, int ypos, const std::string &id="", int viewport=0)
 Add a text to screen.
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.
template<typename PointNT >
bool addPointCloudNormals (const typename pcl::PointCloud< PointNT >::ConstPtr &cloud, int level=100, double scale=0.02, const std::string &id="cloud", int viewport=0)
 Add the estimated surface normals of a Point Cloud to screen.
template<typename PointT , typename PointNT >
bool addPointCloudNormals (const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const typename pcl::PointCloud< PointNT >::ConstPtr &normals, int level=100, double scale=0.02, const std::string &id="cloud", int viewport=0)
 Add the estimated surface normals of a Point Cloud to screen.
bool addPointCloudPrincipalCurvatures (const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud, const pcl::PointCloud< pcl::Normal >::ConstPtr &normals, const pcl::PointCloud< pcl::PrincipalCurvatures >::ConstPtr &pcs, int level=100, double scale=1.0, const std::string &id="cloud", int viewport=0)
 Add the estimated principal curvatures of a Point Cloud to screen.
bool addPointCloud (const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud, const std::string &id="cloud", int viewport=0)
 Add a Point Cloud to screen.
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.
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.
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.
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.
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.
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.
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.
bool addPolygonMesh (const pcl::PolygonMesh &polymesh, const std::string &id="polygon", int viewport=0)
 Add a PolygonMesh object to screen.
bool addPolylineFromPolygonMesh (const pcl::PolygonMesh &polymesh, const std::string &id="polyline", int viewport=0)
 Add a Polygonline from a polygonMesh object to screen.
int getColorHandlerIndex (const std::string &id)
 Get the color handler index of a rendered PointCloud based on its ID.
int getGeometryHandlerIndex (const std::string &id)
 Get the geometry handler index of a rendered PointCloud based on its ID.
bool updateColorHandlerIndex (const std::string &id, int index)
 Update/set the color index of a renderered PointCloud based on its ID.
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).
bool setPointCloudRenderingProperties (int property, double value, const std::string &id="cloud", int viewport=0)
 Set the rendering properties of a PointCloud.
bool getPointCloudRenderingProperties (int property, double &value, const std::string &id="cloud")
 Get the rendering properties of a PointCloud.
bool setShapeRenderingProperties (int property, double value, const std::string &id, int viewport=0)
 Set the rendering properties of a shape.
bool wasStopped () const
 Returns true when the user tried to close the window.
void resetStoppedFlag ()
 Set the stopped flag back to false.
void createViewPort (double xmin, double ymin, double xmax, double ymax, int &viewport)
 Create a new viewport from [xmin,ymin] -> [xmax,ymax].
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).
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).
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.
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.
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.
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.
bool addModelFromPolyData (vtkSmartPointer< vtkPolyData > polydata, const std::string &id="PolyData", int viewport=0)
 Add a vtkPolydata as a mesh.
bool addModelFromPolyData (vtkSmartPointer< vtkPolyData > polydata, vtkSmartPointer< vtkTransform > transform, const std::string &id="PolyData", int viewport=0)
 Add a vtkPolydata as a mesh.
bool addModelFromPLYFile (const std::string &filename, const std::string &id="PLYModel", int viewport=0)
 Add a PLYmodel as a mesh.
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.
bool addCylinder (const pcl::ModelCoefficients &coefficients, const std::string &id="cylinder", int viewport=0)
 Add a cylinder from a set of given model coefficients.
bool addSphere (const pcl::ModelCoefficients &coefficients, const std::string &id="sphere", int viewport=0)
 Add a sphere from a set of given model coefficients.
bool addLine (const pcl::ModelCoefficients &coefficients, const std::string &id="line", int viewport=0)
 Add a line from a set of given model coefficients.
bool addPlane (const pcl::ModelCoefficients &coefficients, const std::string &id="plane", int viewport=0)
 Add a plane from a set of given model coefficients.
bool addCircle (const pcl::ModelCoefficients &coefficients, const std::string &id="circle", int viewport=0)
 Add a circle from a set of given model coefficients.
bool addCone (const pcl::ModelCoefficients &coefficients, const std::string &id="cone", int viewport=0)
 Add a cone from a set of given model coefficients.
void initCameraParameters ()
 Initialize camera parameters with some default values.
bool getCameraParameters (int argc, char **argv)
 Search for camera parameters at the command line and set them internally.
void updateCamera ()
 Update camera parameters and render.
void resetCamera ()
 Reset camera parameters and render.

Public Attributes

Camera camera_
 Camera view, window position and size.

Protected Attributes

vtkSmartPointer
< PCLVisualizerInteractor
interactor_
 The render window interactor.

Detailed Description

PCL Visualizer main class.

Author:
Radu Bogdan Rusu

Definition at line 74 of file pcl_visualizer.h.


Member Typedef Documentation

Definition at line 81 of file pcl_visualizer.h.

Definition at line 83 of file pcl_visualizer.h.

Definition at line 82 of file pcl_visualizer.h.

Definition at line 77 of file pcl_visualizer.h.

Definition at line 79 of file pcl_visualizer.h.

Definition at line 78 of file pcl_visualizer.h.


Constructor & Destructor Documentation

pcl::visualization::PCLVisualizer::PCLVisualizer ( const std::string &  name = ""  ) 

PCL Visualizer constructor.

Parameters:
name the window name (empty by default)
pcl::visualization::PCLVisualizer::PCLVisualizer ( int &  argc,
char **  argv,
const std::string &  name = "",
PCLVisualizerInteractorStyle style = PCLVisualizerInteractorStyle::New() 
)

PCL Visualizer constructor.

Parameters:
argc 
argv 
name the window name (empty by default)
style interactor style (defaults to PCLVisualizerInteractorStyle)
virtual pcl::visualization::PCLVisualizer::~PCLVisualizer (  )  [virtual]

PCL Visualizer destructor.


Member Function Documentation

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:
coefficients the model coefficients (x, y, radius)
id the circle id/name (default: "circle")
viewport (optional) the id of the new viewport (default: 0)
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:
coefficients the model coefficients (point_on_axis, axis_direction, radiu)
id the cone id/name (default: "cone")
viewport (optional) the id of the new viewport (default: 0)
void pcl::visualization::PCLVisualizer::addCoordinateSystem ( double  scale,
float  x,
float  y,
float  z,
int  viewport = 0 
)

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

Parameters:
scale the scale of the axes (default: 1)
x the X position of the axes
y the Y position of the axes
z the Z position of the axes
viewport the view port where the 3D axes should be added (default: all)
void pcl::visualization::PCLVisualizer::addCoordinateSystem ( double  scale = 1.0,
int  viewport = 0 
)

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

Parameters:
scale the scale of the axes (default: 1)
viewport the view port where the 3D axes should be added (default: all)
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:
coefficients the model coefficients (point_on_axis, axis_direction, radius)
id the cylinder id/name (default: "cylinder")
viewport (optional) the id of the new viewport (default: 0)
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:
pt1 the first (start) point on the line
pt2 the second (end) point on the line
id the line id/name (default: "line")
viewport (optional) the id of the new viewport (default: 0)

Definition at line 532 of file pcl_visualizer.hpp.

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:
pt1 the first (start) point on the line
pt2 the second (end) point on the line
r the red channel of the color that the line should be rendered with
g the green channel of the color that the line should be rendered with
b the blue channel of the color that the line should be rendered with
id the line id/name (default: "line")
viewport (optional) the id of the new viewport (default: 0)

Definition at line 557 of file pcl_visualizer.hpp.

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:
coefficients the model coefficients (point_on_line, direction)
id the line id/name (default: "line")
viewport (optional) the id of the new viewport (default: 0)
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:
filename of the ply file
transform transformation to apply
id the model id/name (default: "PLYModel")
viewport (optional) the id of the new viewport (default: 0)
bool pcl::visualization::PCLVisualizer::addModelFromPLYFile ( const std::string &  filename,
const std::string &  id = "PLYModel",
int  viewport = 0 
)

Add a PLYmodel as a mesh.

Parameters:
filename of the ply file
id the model id/name (default: "PLYModel")
viewport (optional) the id of the new viewport (default: 0)
bool pcl::visualization::PCLVisualizer::addModelFromPolyData ( vtkSmartPointer< vtkPolyData >  polydata,
const std::string &  id = "PolyData",
int  viewport = 0 
)

Add a vtkPolydata as a mesh.

Parameters:
polydata vtkPolyData
id the model id/name (default: "PolyData")
viewport (optional) the id of the new viewport (default: 0)
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:
polydata vtkPolyData
transform transformation to apply
id the model id/name (default: "PolyData")
viewport (optional) the id of the new viewport (default: 0)
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:
coefficients the model coefficients (a, b, c, d with ax+by+cz+d=0)
id the plane id/name (default: "plane")
viewport (optional) the id of the new viewport (default: 0)
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.

Parameters:
cloud the input point cloud dataset
geometry_handler use a geometry handler object to extract the XYZ data
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 140 of file pcl_visualizer.hpp.

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:
cloud the input point cloud dataset
geometry_handler use a geometry handler object to extract the XYZ data
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 91 of file pcl_visualizer.hpp.

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:
cloud the input point cloud dataset
color_handler a specific PointCloud visualizer handler for colors
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 192 of file pcl_visualizer.hpp.

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.

Parameters:
cloud the input point cloud dataset
color_handler a specific PointCloud visualizer handler for colors
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 252 of file pcl_visualizer.hpp.

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.

Parameters:
cloud the input point cloud dataset
geometry_handler a specific PointCloud visualizer handler for geometry
color_handler a specific PointCloud visualizer handler for colors
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 313 of file pcl_visualizer.hpp.

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:
cloud the input point cloud dataset
color_handler a specific PointCloud visualizer handler for colors
geometry_handler use a geometry handler object to extract the XYZ data
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 376 of file pcl_visualizer.hpp.

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

Add a Point Cloud to screen.

Parameters:
cloud the input point cloud dataset
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)
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:
cloud the input point cloud dataset
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 42 of file pcl_visualizer.hpp.

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

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

Parameters:
cloud the input point cloud dataset containing XYZ data and normals
level display only every level'th point (default: 100)
scale the normal arrow scale (default: 0.02m)
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 655 of file pcl_visualizer.hpp.

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,
double  scale = 0.02,
const std::string &  id = "cloud",
int  viewport = 0 
)

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

Parameters:
cloud the input point cloud dataset containing the XYZ data
normals the input point cloud dataset containing the normal data
level display only every level'th point (default: 100)
scale the normal arrow scale (default: 0.02m)
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)

Definition at line 664 of file pcl_visualizer.hpp.

bool pcl::visualization::PCLVisualizer::addPointCloudPrincipalCurvatures ( const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &  cloud,
const pcl::PointCloud< pcl::Normal >::ConstPtr &  normals,
const pcl::PointCloud< pcl::PrincipalCurvatures >::ConstPtr &  pcs,
int  level = 100,
double  scale = 1.0,
const std::string &  id = "cloud",
int  viewport = 0 
)

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

Parameters:
cloud the input point cloud dataset containing the XYZ data
normals the input point cloud dataset containing the normal data
pcs the input point cloud dataset containing the principal curvatures data
level display only every level'th point (default: 100)
scale the normal arrow scale (default: 1.0))
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud should be added (default: all)
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:
cloud the point cloud dataset representing the polygon
r the red channel of the color that the polygon should be rendered with
g the green channel of the color that the polygon should be rendered with
b the blue channel of the color that the polygon should be rendered with
id (optional) the polygon id/name (default: "polygon")
viewport (optional) the id of the new viewport (default: 0)

Definition at line 516 of file pcl_visualizer.hpp.

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:
cloud the point cloud dataset representing the polygon
id the polygon id/name (default: "polygon")
viewport (optional) the id of the new viewport (default: 0)

Definition at line 489 of file pcl_visualizer.hpp.

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

Add a PolygonMesh object to screen.

Parameters:
polymesh the polygonal mesh
id the polygon object id (default: "polygon")
viewport the view port where the PolygonMesh should be added (default: all)
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:
polymesh the polygonal mesh from where the polylines will be extracted
id the polygon object id (default: "polygon")
viewport the view port where the PolygonMesh should be added (default: all)
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:
center the center of the sphere
radius the radius of the sphere
id the line id/name (default: "sphere")
viewport (optional) the id of the new viewport (default: 0)

Definition at line 616 of file pcl_visualizer.hpp.

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:
center the center of the sphere
radius the radius of the sphere
r the red channel of the color that the sphere should be rendered with
g the green channel of the color that the sphere should be rendered with
b the blue channel of the color that the sphere should be rendered with
id the line id/name (default: "sphere")
viewport (optional) the id of the new viewport (default: 0)

Definition at line 641 of file pcl_visualizer.hpp.

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:
coefficients the model coefficients (sphere center, radius)
id the sphere id/name (default: "sphere")
viewport (optional) the id of the new viewport (default: 0)
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:
text the text to add
xpos the X position on screen where the text should be added
ypos the Y position on screen where the text should be added
id the text object id (default: equal to the "text" parameter)
viewport the view port (default: all)
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:
text the text to add
xpos the X position on screen where the text should be added
ypos the Y position on screen where the text should be added
r the red color value
g the green color value
b the blue color vlaue
id the text object id (default: equal to the "text" parameter)
viewport the view port (default: all)
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:
xmin the minimum X coordinate for the viewport (0.0 <= 1.0)
ymin the minimum Y coordinate for the viewport (0.0 <= 1.0)
xmax the maximum X coordinate for the viewport (0.0 <= 1.0)
ymax the maximum Y coordinate for the viewport (0.0 <= 1.0)
viewport the id of the new viewport
bool pcl::visualization::PCLVisualizer::getCameraParameters ( int  argc,
char **  argv 
)

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

Parameters:
argc 
argv 
int pcl::visualization::PCLVisualizer::getColorHandlerIndex ( const std::string &  id  )  [inline]

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

Parameters:
id the point cloud object id

Definition at line 338 of file pcl_visualizer.h.

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

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

Parameters:
id the point cloud object id

Definition at line 351 of file pcl_visualizer.h.

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

Get the rendering properties of a PointCloud.

Parameters:
property the property type
value the resultant property value
id the point cloud object id (default: cloud)
void pcl::visualization::PCLVisualizer::initCameraParameters (  ) 

Initialize camera parameters with some default values.

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

Removes a previously added 3D axes (coordinate system).

Parameters:
viewport view port where the 3D axes should be removed from (default: all)
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:
id the point cloud object id (i.e., given on addPointCloud)
viewport view port from where the Point Cloud should be removed (default: all)
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

Parameters:
id the shape object id (i.e., given on addLine etc.)
viewport view port from where the Point Cloud should be removed (default: all)
void pcl::visualization::PCLVisualizer::resetCamera (  ) 

Reset camera parameters and render.

void pcl::visualization::PCLVisualizer::resetStoppedFlag (  )  [inline]

Set the stopped flag back to false.

Definition at line 413 of file pcl_visualizer.h.

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

Set the viewport's background color.

Parameters:
r the red component of the RGB color
g the green component of the RGB color
b the blue component of the RGB color
viewport the view port (default: all)
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:
property the property type
val1 the first value to be set
val2 the second value to be set
val3 the third value to be set
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud's rendering properties should be modified (default: all)
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:
property the property type
value the value to be set
id the point cloud object id (default: cloud)
viewport the view port where the Point Cloud's rendering properties should be modified (default: all)
bool pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( int  property,
double  value,
const std::string &  id,
int  viewport = 0 
)

Set the rendering properties of a shape.

Parameters:
property the property type
value the value to be set
id the shape object id
viewport the view port where the shape's properties should be modified (default: all)
void pcl::visualization::PCLVisualizer::spin (  ) 

Spin method.

Calls the interactor and runs an internal loop.

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

Spin once method.

Calls the interactor and updates the screen once.

Parameters:
time - How long (in ms) should the visualization loop be allowed to run.
force_redraw - if false it might return without doing anything if the interactor's framerate does not require a redraw yet.
void pcl::visualization::PCLVisualizer::updateCamera (  ) 

Update camera parameters and render.

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

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

Parameters:
id the point cloud object id
index the color handler index to use
bool pcl::visualization::PCLVisualizer::wasStopped (  )  const [inline]

Returns true when the user tried to close the window.

Definition at line 410 of file pcl_visualizer.h.


Member Data Documentation

Camera view, window position and size.

Definition at line 588 of file pcl_visualizer.h.

The render window interactor.

Definition at line 611 of file pcl_visualizer.h.


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