42#include <pcl/visualization/interactor_style.h>
43#include <pcl/visualization/common/common.h>
44#include <pcl/visualization/common/ren_win_interact_map.h>
46class vtkRenderWindowInteractor;
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 pcl::index_t index,
const std::string &
id =
"cloud");
175 const std::string &field_name,
const pcl::index_t 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 () =
default;
234 static ExitCallback* New ()
236 return (
new ExitCallback);
240 Execute (vtkObject*,
unsigned long event_id,
void*)
override;
242 PCLHistogramVisualizer *his{
nullptr};
246 vtkSmartPointer<ExitMainLoopTimerCallback> exit_main_loop_timer_callback_;
247 vtkSmartPointer<ExitCallback> exit_callback_;
249 bool stopped_{
false};
254#include <pcl/visualization/impl/histogram_visualizer.hpp>
PointCloud represents the base class in PCL for storing collections of 3D points.
void updateWindowPositions()
Update all window positions on screen so that they fit.
bool addFeatureHistogram(const pcl::PointCloud< PointT > &cloud, int hsize, 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.
shared_ptr< const PCLHistogramVisualizer > ConstPtr
void setGlobalYRange(float minp, float maxp)
Set the Y range to minp-maxp for all histograms.
bool addFeatureHistogram(const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const pcl::index_t index, const std::string &id="cloud", int win_width=640, int win_height=200)
Add a histogram feature to screen as a separate window.
bool updateFeatureHistogram(const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const pcl::index_t index, const std::string &id="cloud")
Update a histogram feature that is already on screen, with a cloud containing a single histogram.
void setBackgroundColor(const double &r, const double &g, const double &b)
Set the viewport's background color.
bool updateFeatureHistogram(const pcl::PointCloud< PointT > &cloud, int hsize, const std::string &id="cloud")
Update a histogram feature that is already on screen, with a cloud containing a single histogram.
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.
virtual ~PCLHistogramVisualizer()=default
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
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.