38 #ifndef PCL_VISUALUALIZATION_PCL_PLOTTER_H_
39 #define PCL_VISUALUALIZATION_PCL_PLOTTER_H_
46 #include <pcl/visualization/common/common.h>
47 #include <pcl/point_types.h>
48 #include <pcl/correspondence.h>
49 #include <pcl/point_cloud.h>
50 #include <pcl/common/io.h>
52 class PCLVisualizerInteractor;
53 class vtkRenderWindow;
54 class vtkRenderWindowInteractor;
59 #include <vtkSmartPointer.h>
60 #include <vtkCommand.h>
65 namespace visualization
92 PCLPlotter (
char const * name =
"PCL Plotter");
106 addPlotData (
double const *array_X,
107 double const *array_Y,
109 char const * name =
"Y Axis",
110 int type = vtkChart::LINE ,
111 char const *color=NULL);
121 addPlotData (std::vector<double>
const &array_x,
122 std::vector<double>
const &array_y,
123 char const * name =
"Y Axis",
124 int type = vtkChart::LINE,
125 std::vector<char>
const &color = std::vector<char> ());
134 addPlotData (std::vector<std::pair<double, double> >
const &plot_data,
135 char const * name =
"Y Axis",
136 int type = vtkChart::LINE,
137 std::vector<char>
const &color = std::vector<char>());
149 addPlotData (PolynomialFunction
const & p_function,
150 double x_min,
double x_max,
151 char const *name =
"Y Axis",
152 int num_points = 100,
153 int type = vtkChart::LINE,
154 std::vector<char>
const &color = std::vector<char>());
166 addPlotData (RationalFunction
const & r_function,
167 double x_min,
double x_max,
168 char const *name =
"Y Axis",
169 int num_points = 100,
170 int type = vtkChart::LINE,
171 std::vector<char>
const &color = std::vector<char>());
183 addPlotData (
double (*
function)(
double),
184 double x_min,
double x_max,
185 char const *name =
"Y Axis",
186 int num_points = 100,
187 int type = vtkChart::LINE,
188 std::vector<char>
const &color = std::vector<char>());
195 addPlotData (
char const * filename,
196 int type = vtkChart::LINE);
205 addHistogramData (std::vector<double>
const & data,
206 int const nbins = 10,
207 char const * name =
"Histogram",
208 std::vector<char>
const &color = std::vector<char>());
218 template <
typename Po
intT>
bool
221 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
232 const std::string &field_name,
233 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
243 template <
typename Po
intT>
bool
245 const std::string &field_name,
247 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
259 const std::string &field_name,
261 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
271 spinOnce (
const int spin_time = 1);
285 setColorScheme (
int scheme);
299 setBackgroundColor (
const double r,
const double g,
const double b);
305 setBackgroundColor (
const double color[3]);
311 getBackgroundColor ();
318 setXRange (
double min,
double max);
325 setYRange (
double min,
double max);
331 setTitle (
const char *title);
337 setXTitle (
const char *title);
343 setYTitle (
const char *title);
349 setShowLegend (
bool flag);
356 setWindowSize (
int w,
int h);
363 setWindowPosition (
int x,
int y);
369 setWindowName (
const std::string &name);
407 int win_width_, win_height_;
409 double bkg_color_[3];
410 std::string win_name_;
413 struct ExitMainLoopTimerCallback :
public vtkCommand
415 static ExitMainLoopTimerCallback* New ()
417 return (
new ExitMainLoopTimerCallback);
420 Execute (vtkObject*,
unsigned long event_id,
void* call_data);
423 #if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 4))
426 vtkRenderWindowInteractor *interactor;
430 struct ExitCallback :
public vtkCommand
432 static ExitCallback* New ()
434 return new ExitCallback;
437 Execute (vtkObject*,
unsigned long event_id,
void*);
455 compute (PolynomialFunction
const & p_function,
double val);
462 compute (RationalFunction
const & r_function,
double val);
471 computeHistogram (std::vector<double>
const & data,
int const nbins, std::vector<std::pair<double, double> > &histogram);
476 #include <pcl/visualization/impl/pcl_plotter.hpp>
This file defines compatibility wrappers for low level I/O functions.
The PCLVisualizer interactor.
std::pair< PolynomialFunction, PolynomialFunction > RationalFunction
A representation of rational function, defined as the ratio of two polynomial functions.
std::vector< double > PolynomialFunction
A representation of polynomial function.
PointCloud represents the base class in PCL for storing collections of 3D points. ...