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

Abstract class defining core mechanism to adapt scanners to the visual Helios context based on PCL and VTK libraries. More...

#include <VHScannerAdapter.h>

Collaboration diagram for visualhelios::VHScannerAdapter:

Public Member Functions

 VHScannerAdapter (Scanner &scanner, Survey &survey)
 Constructor for the visual Helios scanner adapter. More...
 
void start ()
 Start the scanner.
 
void nextStep ()
 Compute the next step for the scanner, with respect to the current one.
 
void startLeg (unsigned int const legIndex, bool const manual)
 Start specified leg. More...
 
void stopAndTurn (unsigned int legIndex, shared_ptr< Leg > leg)
 Perform stop and turn operation to advance to next leg. More...
 
ScannergetScanner ()
 Obtain the scanner object. More...
 
glm::dvec3 const & getRayOrigin () const
 Return a constant reference to the origin of the current ray. More...
 
glm::dvec3 const & getRayDir () const
 Return a constant reference to the director vector of the current ray. More...
 
double getOriginRadius () const
 Obtain the ray's origin radius. More...
 
void setOriginRadius (double const originRadius)
 Set the ray's origin radius. More...
 
double const * getOriginColor () const
 Obtain the ray's origin color. More...
 
double getOriginColorRed () const
 Obtain the ray's origin red color component. More...
 
double getOriginColorBlue () const
 Obtain the ray's origin blue color component. More...
 
double getOriginColorGreen () const
 Obtain the ray's origin green color component. More...
 
void setOriginColor (double const *rgb)
 Set the ray's origin color. More...
 
void setOriginColor (double const r, double const g, double const b)
 Set the ray's origin color. More...
 
double getRayLength () const
 Obtain the ray's length. More...
 
void setRayLength (double const rayLength)
 Set the ray's length. More...
 
double const * getRayColor () const
 Obtain the ray's color. More...
 
double getRayColorRed () const
 Obtain the ray's red color component. More...
 
double getRayColorGreen () const
 Obtain the ray's green color component. More...
 
double getRayColorBlue () const
 Obtain the ray's blue color component. More...
 
void setRayColor (double const *rgb)
 Set the ray's color. More...
 
void setRayColor (double const r, double const g, double const b)
 Set the ray's color. More...
 
double const * getNonReturningRayColor () const
 Obtain the non returning ray's color. More...
 
double getNonReturningRayColorRed () const
 Obtain the non returning ray's red color component. More...
 
double getNonReturningRayColorGreen () const
 Obtain the non returning ray's green color component. More...
 
double getNonReturningRayColorBlue () const
 Obtain the non returning ray's blue color component. More...
 
void setNonReturningRayColor (double const *rgb)
 Set the non returning ray's color. More...
 
void setNonReturningRayColor (double const r, double const g, double const b)
 Set the non returning ray's color. More...
 
int getPulseFreq_Hz () const
 Obtain the scanner's pulse frequency, in Hertz. More...
 
void setPulseFreq_Hz (int const pulseFreq_Hz)
 Set the scanner's pulse frequency, in Hertz. More...
 
double const * getCurrentRayColor () const
 Obtain the ray color depending on if the ray is expected to return an echo or not. More...
 

Protected Attributes

Scannerscanner
 The adapted scanner. More...
 
Surveysurvey
 The survey to which the adapted scanner belongs to. More...
 
unsigned int currentLegIndex = 0
 The index of the current scanning leg. More...
 
glm::dvec3 origin
 The coordinates of the origin for the current ray.
 
glm::dvec3 dir
 The director vector of the current ray.
 
double originRadius = 1.0
 The radius of the sphere representing the origin of the ray.
 
double originColor [3] = {0.6, 0.1, 0.1}
 The RGB color of the sphere representing the origin of the ray.
 
double rayLength = 1.0
 The length of the ray. It specifies the magnitude of the vector representing the ray.
 
double rayColor [3] = {0.9, 0.1, 0.15}
 The color of the line representing the ray.
 
double nonReturningRayColor [3] = {0.3, 0.2, 0.9}
 The color of the line representing the ray when it is not returning an echo.
 

Detailed Description

Abstract class defining core mechanism to adapt scanners to the visual Helios context based on PCL and VTK libraries.

Author
Alberto M. Esmoris Pena
Version
1.0

Constructor & Destructor Documentation

◆ VHScannerAdapter()

visualhelios::VHScannerAdapter::VHScannerAdapter ( Scanner scanner,
Survey survey 
)
inline

Constructor for the visual Helios scanner adapter.

Parameters
scannerThe scanner object to be adapter for visual Helios

Member Function Documentation

◆ getCurrentRayColor()

double const* visualhelios::VHScannerAdapter::getCurrentRayColor ( ) const
inline

Obtain the ray color depending on if the ray is expected to return an echo or not.

NOTE that it is not the ray color depending on if the ray returns an encho or not, but if it is EXPECTED to so or not. This means that the ray intersection check is not computed. Instead, only the angular domain restrictions are applied to check whether the ray is expected to return an echo or not.

Returns
The ray color depending on if the ray is expected to return an echo or not

◆ getNonReturningRayColor()

double const* visualhelios::VHScannerAdapter::getNonReturningRayColor ( ) const
inline

Obtain the non returning ray's color.

Returns
The non returning ray's color
See also
VHScannerAdapter::nonReturningRayColor

◆ getNonReturningRayColorBlue()

double visualhelios::VHScannerAdapter::getNonReturningRayColorBlue ( ) const
inline

Obtain the non returning ray's blue color component.

Returns
The non returning ray's blue color component
See also
VHScannerAdapter::nonReturningRayColor

◆ getNonReturningRayColorGreen()

double visualhelios::VHScannerAdapter::getNonReturningRayColorGreen ( ) const
inline

Obtain the non returning ray's green color component.

Returns
The non returning ray's green color component
See also
VHScannerAdapter::nonReturningRayColor

◆ getNonReturningRayColorRed()

double visualhelios::VHScannerAdapter::getNonReturningRayColorRed ( ) const
inline

Obtain the non returning ray's red color component.

Returns
The non returning ray's red color component
See also
VHScannerAdapter::nonReturningRayColor

◆ getOriginColor()

double const* visualhelios::VHScannerAdapter::getOriginColor ( ) const
inline

Obtain the ray's origin color.

Returns
The ray's origin color
See also
VHScannerAdapter::originColor

◆ getOriginColorBlue()

double visualhelios::VHScannerAdapter::getOriginColorBlue ( ) const
inline

Obtain the ray's origin blue color component.

Returns
They ray's origin blue color component
See also
VHScannerAdapter::originColor

◆ getOriginColorGreen()

double visualhelios::VHScannerAdapter::getOriginColorGreen ( ) const
inline

Obtain the ray's origin green color component.

Returns
They ray's origin green color component
See also
VHScannerAdapter::originColor

◆ getOriginColorRed()

double visualhelios::VHScannerAdapter::getOriginColorRed ( ) const
inline

Obtain the ray's origin red color component.

Returns
They ray's origin red color component
See also
VHScannerAdapter::originColor

◆ getOriginRadius()

double visualhelios::VHScannerAdapter::getOriginRadius ( ) const
inline

Obtain the ray's origin radius.

Returns
The ray's origin radius
See also
VHScannerAdapter::originRadius

◆ getPulseFreq_Hz()

int visualhelios::VHScannerAdapter::getPulseFreq_Hz ( ) const
inline

Obtain the scanner's pulse frequency, in Hertz.

Returns
The scanner's pulse frequency, in Hertz
See also
Scanner::getPulseFreq_Hz

◆ getRayColor()

double const* visualhelios::VHScannerAdapter::getRayColor ( ) const
inline

Obtain the ray's color.

Returns
The ray's color
See also
VHScannerAdapter::rayColor

◆ getRayColorBlue()

double visualhelios::VHScannerAdapter::getRayColorBlue ( ) const
inline

Obtain the ray's blue color component.

Returns
The ray's blue color component
See also
VHScannerAdapter::rayColor

◆ getRayColorGreen()

double visualhelios::VHScannerAdapter::getRayColorGreen ( ) const
inline

Obtain the ray's green color component.

Returns
The ray's green color component
See also
VHScannerAdapter::rayColor

◆ getRayColorRed()

double visualhelios::VHScannerAdapter::getRayColorRed ( ) const
inline

Obtain the ray's red color component.

Returns
The ray's red color component
See also
VHScannerAdapter::rayColor

◆ getRayDir()

glm::dvec3 const& visualhelios::VHScannerAdapter::getRayDir ( ) const
inline

Return a constant reference to the director vector of the current ray.

Returns
Constant reference to the director vector of the current ray

◆ getRayLength()

double visualhelios::VHScannerAdapter::getRayLength ( ) const
inline

Obtain the ray's length.

Returns
The ray's length
See also
VHScannerAdapter::rayLength

◆ getRayOrigin()

glm::dvec3 const& visualhelios::VHScannerAdapter::getRayOrigin ( ) const
inline

Return a constant reference to the origin of the current ray.

Returns
Constant reference to the origin of the current ray

◆ getScanner()

Scanner& visualhelios::VHScannerAdapter::getScanner ( )
inline

Obtain the scanner object.

WARNING this getter returns the scanner object reference allowing modifications. Use with caution

Returns
Scanner object

◆ setNonReturningRayColor() [1/2]

void visualhelios::VHScannerAdapter::setNonReturningRayColor ( double const *  rgb)
inline

Set the non returning ray's color.

Parameters
rgbPointer to an array with at least 3 components such that the first one is the red color, the second one is the green color and the third one is the blue color.
See also
VHScannerAdapter::nonReturningRayColor

◆ setNonReturningRayColor() [2/2]

void visualhelios::VHScannerAdapter::setNonReturningRayColor ( double const  r,
double const  g,
double const  b 
)
inline

Set the non returning ray's color.

Parameters
rThe red
rThe red component for the ray's color
gThe green component for the ray's color
bThe blue component for the ray's color
See also
VHScannerAdapter::nonReturningRayColor

◆ setOriginColor() [1/2]

void visualhelios::VHScannerAdapter::setOriginColor ( double const *  rgb)
inline

Set the ray's origin color.

Parameters
rgbPointer to an array with at least 3 components such that the first one is the red color, the second one is the green color and the third one is the blue color.
See also
VHScannerAdapter::originColor

◆ setOriginColor() [2/2]

void visualhelios::VHScannerAdapter::setOriginColor ( double const  r,
double const  g,
double const  b 
)
inline

Set the ray's origin color.

Parameters
rThe red component for the ray's origin color
gThe green component for the ray's origin color
bThe blue component for the ray's origin color
See also
VHScannerAdapter::originColor

◆ setOriginRadius()

void visualhelios::VHScannerAdapter::setOriginRadius ( double const  originRadius)
inline

Set the ray's origin radius.

Parameters
originRadiusThe new radius for the visualization of ray's origin
See also
VHScannerAdapter::originRadius

◆ setPulseFreq_Hz()

void visualhelios::VHScannerAdapter::setPulseFreq_Hz ( int const  pulseFreq_Hz)
inline

Set the scanner's pulse frequency, in Hertz.

Parameters
pulseFreq_HzThe new pulse frequency (in Hertz) for the scanner
See also
Scanner::setPulseFreq_Hz

◆ setRayColor() [1/2]

void visualhelios::VHScannerAdapter::setRayColor ( double const *  rgb)
inline

Set the ray's color.

Parameters
rgbPointer to an array with at least 3 components such that the first one is the red color, the second one is the green color and the third one is the blue color.
See also
VHScannerAdapter::rayColor

◆ setRayColor() [2/2]

void visualhelios::VHScannerAdapter::setRayColor ( double const  r,
double const  g,
double const  b 
)
inline

Set the ray's color.

Parameters
rThe red component for the ray's color
gThe green component for the ray's color
bThe blue component for the ray's color
See also
VHScannerAdapter::rayColor

◆ setRayLength()

void visualhelios::VHScannerAdapter::setRayLength ( double const  rayLength)
inline

Set the ray's length.

Parameters
rayLengthThe new length for the visualization of rays
See also
VHScannerAdapter::rayLength

◆ startLeg()

void VHScannerAdapter::startLeg ( unsigned int const  legIndex,
bool const  manual 
)

Start specified leg.

This method is a lighter version of the SurveyPlayback::startLeg method which only considers those features which are relevant for ray casting visualization.

See also
SurveyPlayback::startLeg

◆ stopAndTurn()

void VHScannerAdapter::stopAndTurn ( unsigned int  legIndex,
shared_ptr< Leg leg 
)

Perform stop and turn operation to advance to next leg.

See also
SurveyPlayback::stopAndTurn

Member Data Documentation

◆ currentLegIndex

unsigned int visualhelios::VHScannerAdapter::currentLegIndex = 0
protected

The index of the current scanning leg.

See also
Simulation::mCurrentLegIndex
Leg

◆ scanner

Scanner& visualhelios::VHScannerAdapter::scanner
protected

The adapted scanner.

See also
Scanner

◆ survey

Survey& visualhelios::VHScannerAdapter::survey
protected

The survey to which the adapted scanner belongs to.

See also
Survey

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