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;
54 class vtkRenderWindowInteractor;
59 #include <vtkCommand.h>
64 namespace visualization
91 PCLPlotter (
char const * name =
"PCL Plotter");
105 addPlotData (
double const *array_X,
106 double const *array_Y,
108 char const * name =
"Y Axis",
109 int type = vtkChart::LINE ,
110 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> ());
133 addPlotData (std::vector<std::pair<double, double> >
const &plot_data,
134 char const * name =
"Y Axis",
135 int type = vtkChart::LINE,
136 std::vector<char>
const &color = std::vector<char>());
149 double x_min,
double x_max,
150 char const *name =
"Y Axis",
151 int num_points = 100,
152 int type = vtkChart::LINE,
153 std::vector<char>
const &color = std::vector<char>());
166 double x_min,
double x_max,
167 char const *name =
"Y Axis",
168 int num_points = 100,
169 int type = vtkChart::LINE,
170 std::vector<char>
const &color = std::vector<char>());
182 addPlotData (
double (*
function)(
double),
183 double x_min,
double x_max,
184 char const *name =
"Y Axis",
185 int num_points = 100,
186 int type = vtkChart::LINE,
187 std::vector<char>
const &color = std::vector<char>());
194 addPlotData (
char const * filename,
195 int type = vtkChart::LINE);
204 addHistogramData (std::vector<double>
const & data,
205 int const nbins = 10,
206 char const * name =
"Histogram",
207 std::vector<char>
const &color = std::vector<char>());
217 template <
typename Po
intT>
bool
220 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
231 const std::string &field_name,
232 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
242 template <
typename Po
intT>
bool
244 const std::string &field_name,
246 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
258 const std::string &field_name,
260 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
270 spinOnce (
const int spin_time = 1);
284 setColorScheme (
int scheme);
298 setBackgroundColor (
const double r,
const double g,
const double b);
304 setBackgroundColor (
const double color[3]);
310 getBackgroundColor ();
317 setXRange (
double min,
double max);
324 setYRange (
double min,
double max);
330 setTitle (
const char *title);
336 setXTitle (
const char *title);
342 setYTitle (
const char *title);
348 setShowLegend (
bool flag);
355 setWindowSize (
int w,
int h);
393 int win_width_, win_height_;
394 double bkg_color_[3];
397 struct ExitMainLoopTimerCallback :
public vtkCommand
399 static ExitMainLoopTimerCallback* New ()
401 return (
new ExitMainLoopTimerCallback);
404 Execute (vtkObject*,
unsigned long event_id,
void* call_data);
407 #if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 4))
410 vtkRenderWindowInteractor *interactor;
414 struct ExitCallback :
public vtkCommand
416 static ExitCallback* New ()
418 return new ExitCallback;
421 Execute (vtkObject*,
unsigned long event_id,
void*);
439 compute (PolynomialFunction
const & p_function,
double val);
446 compute (RationalFunction
const & r_function,
double val);
454 computeHistogram (std::vector<double>
const & data,
int const nbins, std::vector<std::pair<double, double> > &histogram);
459 #include <pcl/visualization/impl/pcl_plotter.hpp>