Helios++
Helios software for LiDAR simulations
visualhelios::VHDynCanvas Class Reference

Visual Helios Dynamic Canvas is a class which provides the basis layer to deal with dynamic objects rendering in a general purpose fashion. More...

#include <VHDynCanvas.h>

Inheritance diagram for visualhelios::VHDynCanvas:
Collaboration diagram for visualhelios::VHDynCanvas:

Public Member Functions

 VHDynCanvas ()
 Default constructor for the visual Helios dynamic canvas. More...
 
 VHDynCanvas (string const title)
 Constructor for the visual Helios dynamic canvas which allows for title specification. More...
 
virtual bool isNeedingUpdate () const
 Check whether the dynamic canvas needs an update no matter what (true) or not (false) More...
 
virtual void setNeedsUpdate (bool const needsUpdate)
 Specify if the dynamic canvas needs an update no matter what (true) or not (false) More...
 
- Public Member Functions inherited from visualhelios::VHCanvas
 VHCanvas ()
 Default constructor for the visual helios canvas.
 
 VHCanvas (string const title)
 Constructor for the visual helios canvas which allows for title specification. More...
 
virtual void show ()
 Make the visualization effective.
 
int getTimeBetweenUpdates () const
 Obtain milliseconds between canvas updates. More...
 
void setTimeBetweenUpdates (int const timeBetweenUpdates)
 Set the milliseconds between canvas updates. More...
 
bool isForceRedraw () const
 Check if force redraw is enabled or not. More...
 
void setForceRedraw (bool const forceRedraw)
 Enable or disable force redraw. More...
 
string const & getTitle () const
 Obtain the visual helios canvas title. More...
 

Protected Member Functions

void postUpdate () override
 Defines the default post update behavior for dynamic canvas and derived classes. More...
 
- Protected Member Functions inherited from visualhelios::VHCanvas
virtual void configure ()
 Configure method where visualizer configuration must be implemented.
 
virtual void start ()
 Start method which initializes the visualization.
 
virtual void update ()
 Update method which handles graphics updating over time.
 
virtual void onStop ()
 Method to handle the behavior of the canvas after visualization has finished.
 

Protected Attributes

bool needsUpdate = false
 Control whether an update is needed even when dynamic objects themselves have not been updated (true) or not (false)
 
- Protected Attributes inherited from visualhelios::VHCanvas
string const title
 The title of the visual Helios canvas.
 
PCLVisualizer::Ptr viewer
 The PCL visualizer which is used to render graphics.
 
int timeBetweenUpdates
 How many milliseconds must elapsed between canvas updates.
 
bool forceRedraw
 Force redraw even when it is not required if true. Try to avoid unnecessary redraws if false.
 

Detailed Description

Visual Helios Dynamic Canvas is a class which provides the basis layer to deal with dynamic objects rendering in a general purpose fashion.

Author
Alberto M. Esmoris Pena
Version
1.0

Constructor & Destructor Documentation

◆ VHDynCanvas() [1/2]

visualhelios::VHDynCanvas::VHDynCanvas ( )
inline

Default constructor for the visual Helios dynamic canvas.

See also
visualhelios::VHCanvas::VHCanvas

◆ VHDynCanvas() [2/2]

visualhelios::VHDynCanvas::VHDynCanvas ( string const  title)
inline

Constructor for the visual Helios dynamic canvas which allows for title specification.

Parameters
titleTitle for the visualizer
See also
visualhelios::VHCanvas::VHCanvas(string const)

Member Function Documentation

◆ isNeedingUpdate()

virtual bool visualhelios::VHDynCanvas::isNeedingUpdate ( ) const
inlinevirtual

Check whether the dynamic canvas needs an update no matter what (true) or not (false)

Returns
True if the dynamic canvas needs an update, false otherwise

◆ postUpdate()

void VHDynCanvas::postUpdate ( )
overrideprotectedvirtual

Defines the default post update behavior for dynamic canvas and derived classes.

The dynamic canvas uses postUpdate method to disable the need for updates from canvas side by default after update has been called. It is expected that if updates are needed, they are fully computed after one call of update method. This default behavior has been implemented because it feels quite intuitive to avoid forcing full updates at each step. Otherwise, efficient implementations will be impaired by default because selective update of rendered objects will be compromised.

In case the default behavior should be changed to the opposite, it could be easily done by overriding the postUpdate method and adding following peace of code inside:

void postUpdate() override{
}
void postUpdate() override
Defines the default post update behavior for dynamic canvas and derived classes.
Definition: VHDynCanvas.cpp:10
virtual void setNeedsUpdate(bool const needsUpdate)
Specify if the dynamic canvas needs an update no matter what (true) or not (false)
Definition: VHDynCanvas.h:87
See also
VHCanvas::postUpdate

Reimplemented from visualhelios::VHCanvas.

◆ setNeedsUpdate()

virtual void visualhelios::VHDynCanvas::setNeedsUpdate ( bool const  needsUpdate)
inlinevirtual

Specify if the dynamic canvas needs an update no matter what (true) or not (false)

Parameters
needsUpdateTrue to specify the dynamic canvas needs an update, false to specify it does not

The documentation for this class was generated from the following files: