Helios++
Helios software for LiDAR simulations
VHCanvas.h
1 #ifdef PCL_BINDING
2 
3 #pragma once
4 
5 #include <string>
6 
7 #include <pcl/common/common_headers.h>
8 #include <pcl/visualization/pcl_visualizer.h>
9 
10 namespace visualhelios{
11 
12 using std::string;
13 
14 using pcl::visualization::PCLVisualizer;
15 
29 class VHCanvas{
30 protected:
31  // *** ATTRIBUTES *** //
32  // ******************** //
36  string const title;
40  PCLVisualizer::Ptr viewer;
50 
51 public:
52  // *** CONSTRUCTION / DESTRUCTION *** //
53  // ************************************ //
57  VHCanvas() : VHCanvas("Visual Helios canvas") {}
63  VHCanvas(string const title);
64  virtual ~VHCanvas() = default;
65 
66 protected:
67  // *** CANVAS METHODS *** //
68  // ************************ //
73  virtual void configure();
77  virtual void start();
81  virtual void update();
86  virtual void postUpdate();
91  virtual void onStop();
92 public:
96  virtual void show();
97 
98  // *** GETTERS and SETTERS *** //
99  // ***************************** //
105  inline int getTimeBetweenUpdates() const {return timeBetweenUpdates;}
113  {this->timeBetweenUpdates = timeBetweenUpdates;}
119  inline bool isForceRedraw() const {return forceRedraw;}
125  inline void setForceRedraw(bool const forceRedraw)
126  {this->forceRedraw = forceRedraw;}
131  inline string const & getTitle() const {return title;}
132 };
133 }
134 
135 #endif
Visual Helios Canvas is a class which provides the base mechanisms to implement Helios visualizations...
Definition: VHCanvas.h:29
VHCanvas()
Default constructor for the visual helios canvas.
Definition: VHCanvas.h:57
PCLVisualizer::Ptr viewer
The PCL visualizer which is used to render graphics.
Definition: VHCanvas.h:40
virtual void show()
Make the visualization effective.
Definition: VHCanvas.cpp:36
bool forceRedraw
Force redraw even when it is not required if true. Try to avoid unnecessary redraws if false.
Definition: VHCanvas.h:49
bool isForceRedraw() const
Check if force redraw is enabled or not.
Definition: VHCanvas.h:119
int getTimeBetweenUpdates() const
Obtain milliseconds between canvas updates.
Definition: VHCanvas.h:105
virtual void start()
Start method which initializes the visualization.
Definition: VHCanvas.cpp:29
virtual void update()
Update method which handles graphics updating over time.
Definition: VHCanvas.cpp:30
void setTimeBetweenUpdates(int const timeBetweenUpdates)
Set the milliseconds between canvas updates.
Definition: VHCanvas.h:112
virtual void onStop()
Method to handle the behavior of the canvas after visualization has finished.
Definition: VHCanvas.cpp:32
string const title
The title of the visual Helios canvas.
Definition: VHCanvas.h:36
virtual void postUpdate()
Post-update method which handles the behavior of the canvas immediately after the update stage has be...
Definition: VHCanvas.cpp:31
string const & getTitle() const
Obtain the visual helios canvas title.
Definition: VHCanvas.h:131
void setForceRedraw(bool const forceRedraw)
Enable or disable force redraw.
Definition: VHCanvas.h:125
int timeBetweenUpdates
How many milliseconds must elapsed between canvas updates.
Definition: VHCanvas.h:44
virtual void configure()
Configure method where visualizer configuration must be implemented.
Definition: VHCanvas.cpp:23