42 #include <pcl/visualization/interactor_style.h>
43 #include <pcl/visualization/common/common.h>
44 #include <pcl/visualization/common/ren_win_interact_map.h>
46 class vtkRenderWindowInteractor;
50 namespace visualization
59 using Ptr = shared_ptr<PCLHistogramVisualizer>;
60 using ConstPtr = shared_ptr<const PCLHistogramVisualizer>;
91 template <
typename Po
intT>
bool
94 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
105 const std::string &field_name,
106 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
116 template <
typename Po
intT>
bool
118 const std::string &field_name,
120 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
132 const std::string &field_name,
134 const std::string &
id =
"cloud",
int win_width = 640,
int win_height = 200);
141 template <
typename Po
intT>
bool
152 const std::string &field_name,
153 const std::string &
id =
"cloud");
162 template <
typename Po
intT>
bool
164 const int index,
const std::string &
id =
"cloud");
175 const std::string &field_name,
const int index,
176 const std::string &
id =
"cloud");
202 const std::string &
id,
const int win_width,
const int win_height);
217 struct ExitMainLoopTimerCallback :
public vtkCommand
219 static ExitMainLoopTimerCallback* New ()
221 return (
new ExitMainLoopTimerCallback);
224 Execute (vtkObject*,
unsigned long event_id,
void* call_data)
override;
227 vtkRenderWindowInteractor *interact;
230 struct ExitCallback :
public vtkCommand
232 ExitCallback () : his () {}
234 static ExitCallback* New ()
236 return (
new ExitCallback);
240 Execute (vtkObject*,
unsigned long event_id,
void*)
override;
242 PCLHistogramVisualizer *his;
254 #include <pcl/visualization/impl/histogram_visualizer.hpp>
PointCloud represents the base class in PCL for storing collections of 3D points.
PCL histogram visualizer main class.
bool updateFeatureHistogram(const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const int index, const std::string &id="cloud")
Update a histogram feature that is already on screen, with a cloud containing a single histogram.
void updateWindowPositions()
Update all window positions on screen so that they fit.
bool addFeatureHistogram(const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const int index, const std::string &id="cloud", int win_width=640, int win_height=200)
Add a histogram feature to screen as a separate window.
shared_ptr< const PCLHistogramVisualizer > ConstPtr
virtual ~PCLHistogramVisualizer()
void setGlobalYRange(float minp, float maxp)
Set the Y range to minp-maxp for all histograms.
void setBackgroundColor(const double &r, const double &g, const double &b)
Set the viewport's background color.
void createActor(const vtkSmartPointer< vtkDoubleArray > &xy_array, RenWinInteract &renwinint, const std::string &id, const int win_width, const int win_height)
Create a 2D actor from the given vtkDoubleArray histogram and add it to the screen.
void reCreateActor(const vtkSmartPointer< vtkDoubleArray > &xy_array, RenWinInteract *renwinupd, const int hsize)
Remove the current 2d actor and create a new 2D actor from the given vtkDoubleArray histogram and add...
PCLHistogramVisualizer()
PCL histogram visualizer constructor.
void spinOnce(int time=1)
Spin once method.
shared_ptr< PCLHistogramVisualizer > Ptr
bool updateFeatureHistogram(const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const std::string &id="cloud")
Update a histogram feature that is already on screen, with a cloud containing a single histogram.
bool addFeatureHistogram(const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const std::string &id="cloud", int win_width=640, int win_height=200)
Add a histogram feature to screen as a separate window from a cloud containing a single histogram.
std::map< std::string, RenWinInteract > RenWinInteractMap