Helios++
Helios software for LiDAR simulations
visualhelios::VHNormalsCanvas Class Referenceabstract

Abstract class providing some behaviors and defining the interface for all canvas which deal with normals. More...

#include <VHNormalsCanvas.h>

Inheritance diagram for visualhelios::VHNormalsCanvas:
Collaboration diagram for visualhelios::VHNormalsCanvas:

Public Member Functions

 VHNormalsCanvas ()
 Default constructor for the visual Helios normals canvas. More...
 
 VHNormalsCanvas (string const title, bool const normalsKeyboardCallbackEnabled=true, bool const normalsUsageTextEnabled=true, bool const renderingNormals=true, float const normalMagnitude=1.0)
 Main constructor for the visual helios normals canvas which allows for title specification, flags specification and normal magnitude specification too. More...
 
virtual bool isRenderingNormals () const
 Check whether the normals canvas is rendering normals or not. More...
 
virtual void setRenderingNormals (bool const renderingNormals)
 Enable or disable normals rendering. More...
 
virtual float getNormalMagnitude () const
 Obtain the magnitude for normal vectors visualization. More...
 
virtual void setNormalMagnitude (float const normalMagnitude)
 Set the magnitude for normal vectors visualization. More...
 
virtual bool isNormalsKeyboardCallbackEnabled () const
 Check whether normals keyboard callback is enabled (true) or not (false) More...
 
virtual bool isNormalsUsageTextEnabled () const
 Check whether normals usage text is enabled (true) or not (false) More...
 
virtual float const * getNormalDefColor () const
 Return the default color for normals visualization. More...
 
virtual void setNormalDefColor (float const color[3])
 Set the default color for normals visualization. More...
 
virtual void setNormalDefColor (float const r, float const g, float const b)
 Set the default color for normals visualization. More...
 
- Public Member Functions inherited from visualhelios::VHDynCanvas
 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 configure () override
 
void start () override
 
virtual void renderNormals (VHStaticObjectAdapter &dynObj)=0
 Render normals for each primitive of given dynamic object. This method implementation must be provided by concrete derived classes so the logic of the VHNormalCanvas can be computed. More...
 
virtual void unrenderAllNormals ()=0
 Remove all rendered normals. This method implementation must be provided by concrete derived classes so the logic of the VHNormalCanvas can be computed.
 
virtual void registerNormalsKeyboardCallback ()
 Register the keyboard callback to toggle normals rendering on/off. More...
 
virtual void addKeyboardCallbackUsageText ()
 Render text explaining how to use the normals keyboard callback. More...
 
- Protected Member Functions inherited from visualhelios::VHDynCanvas
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 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 normalsKeyboardCallbackEnabled
 Specify if the keyboard callback to toggle normals visualization is enabled (true) or not (false)
 
bool normalsUsageTextEnabled
 Specify if the normals keyboard callback usage text is enabled (true) or not (false)
 
bool renderingNormals
 Specify if the normals canvas must render normals (true) or not (false)
 
float normalMagnitude
 Specify the magnitude of normal vector for visualization.
 
float normalDefColor [3]
 Default color for normals in RGB format with components in \([0, 1]\).
 
- Protected Attributes inherited from visualhelios::VHDynCanvas
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

Abstract class providing some behaviors and defining the interface for all canvas which deal with normals.

Author
Alberto M. Esmoris Pena
Version
1.0

Constructor & Destructor Documentation

◆ VHNormalsCanvas() [1/2]

visualhelios::VHNormalsCanvas::VHNormalsCanvas ( )
inline

Default constructor for the visual Helios normals canvas.

See also
visualhelios::VHDynCanvas::VHDynCanvas

◆ VHNormalsCanvas() [2/2]

VHNormalsCanvas::VHNormalsCanvas ( string const  title,
bool const  normalsKeyboardCallbackEnabled = true,
bool const  normalsUsageTextEnabled = true,
bool const  renderingNormals = true,
float const  normalMagnitude = 1.0 
)

Member Function Documentation

◆ addKeyboardCallbackUsageText()

void VHNormalsCanvas::addKeyboardCallbackUsageText ( )
protectedvirtual

Render text explaining how to use the normals keyboard callback.

This method is called during the start stage

◆ configure()

void VHNormalsCanvas::configure ( )
overrideprotectedvirtual

◆ getNormalDefColor()

virtual float const* visualhelios::VHNormalsCanvas::getNormalDefColor ( ) const
inlinevirtual

Return the default color for normals visualization.

Returns
Default color for normals visualization
See also
visualhelios::VHNormalCanvas::normalDefColor

◆ getNormalMagnitude()

virtual float visualhelios::VHNormalsCanvas::getNormalMagnitude ( ) const
inlinevirtual

Obtain the magnitude for normal vectors visualization.

Returns
Magnitude for normal vectors visualization
See also
visualhelios::VHNormalCanvas::normalMagnitude

◆ isNormalsKeyboardCallbackEnabled()

virtual bool visualhelios::VHNormalsCanvas::isNormalsKeyboardCallbackEnabled ( ) const
inlinevirtual

Check whether normals keyboard callback is enabled (true) or not (false)

Returns
True if normals keyboard callback is enabled, false otherwise

◆ isNormalsUsageTextEnabled()

virtual bool visualhelios::VHNormalsCanvas::isNormalsUsageTextEnabled ( ) const
inlinevirtual

Check whether normals usage text is enabled (true) or not (false)

Returns
True if normals usage text is enabled, false otherwise

◆ isRenderingNormals()

virtual bool visualhelios::VHNormalsCanvas::isRenderingNormals ( ) const
inlinevirtual

Check whether the normals canvas is rendering normals or not.

Returns
True if normals canvas is rendering normals, false otherwise
See also
visualhelios::VHNormalsCanvas::renderingNormals

◆ registerNormalsKeyboardCallback()

void VHNormalsCanvas::registerNormalsKeyboardCallback ( )
protectedvirtual

Register the keyboard callback to toggle normals rendering on/off.

This method is called during configure stage

◆ renderNormals()

virtual void visualhelios::VHNormalsCanvas::renderNormals ( VHStaticObjectAdapter dynObj)
protectedpure virtual

Render normals for each primitive of given dynamic object. This method implementation must be provided by concrete derived classes so the logic of the VHNormalCanvas can be computed.

Parameters
dynObjDynamic object which normals will be rendered if enabled

Implemented in visualhelios::VHSimpleCanvas, and visualhelios::VHSceneCanvas.

◆ setNormalDefColor() [1/2]

virtual void visualhelios::VHNormalsCanvas::setNormalDefColor ( float const  color[3])
inlinevirtual

Set the default color for normals visualization.

Parameters
colorDefault color for normals visualization
See also
visualhelios::VHNormalCanvas::normalDefColor

◆ setNormalDefColor() [2/2]

virtual void visualhelios::VHNormalsCanvas::setNormalDefColor ( float const  r,
float const  g,
float const  b 
)
inlinevirtual

Set the default color for normals visualization.

Parameters
rRed component for normals default color
gGreen component for normals default color
bBlue component for normals default color

◆ setNormalMagnitude()

virtual void visualhelios::VHNormalsCanvas::setNormalMagnitude ( float const  normalMagnitude)
inlinevirtual

Set the magnitude for normal vectors visualization.

Parameters
normalMagnitudeNew magnitude for normal vectors visualization
See also
visualhelios::VHNormalCanvas::normalMagnitude

◆ setRenderingNormals()

virtual void visualhelios::VHNormalsCanvas::setRenderingNormals ( bool const  renderingNormals)
inlinevirtual

Enable or disable normals rendering.

Parameters
renderingNormalsTrue to enable rendering normals, false to disable it
See also
visualhelios::VHNormalsCanvas::renderingNormals

◆ start()

void VHNormalsCanvas::start ( )
overrideprotectedvirtual

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