Helios++
Helios software for LiDAR simulations
ArgumentsParser Class Reference

Parser for helios-plusplus invocation arguments. More...

#include <ArgumentsParser.h>

Public Member Functions

 ArgumentsParser (int argc, char **argv)
 Instantiate an ArgumentsParser. More...
 
bool parseHelpRequest ()
 Parse help request argument if any (-h or –help) More...
 
bool parseTestRequest ()
 Parse test request argument if any (–test) More...
 
bool parseVersionRequest ()
 Parse version request argument if any (–version) More...
 
std::string parseTestDir ()
 Parse test directory specification (not necessary, default one will be relative path "data/test/") More...
 
std::string parseDemoRequest ()
 Parse demo request argument if any (–demo) More...
 
std::string parseDemoSurveyPath ()
 Parse the demo survey path from invocation arguments. More...
 
std::string parseDemoAssetsPath ()
 Parse the demo assets path from invocation arguments. More...
 
std::string parseSurveyPath ()
 Parse the survey path from invocation arguments. More...
 
std::string parseAssetsPath ()
 Parse the assets path from invocation arguments. More...
 
std::string parseOutputPath ()
 Parse the output path from invocation arguments. More...
 
bool parseWriteWaveform ()
 Parse the write waveform flag specification. More...
 
bool parseCalcEchowidth ()
 Parse the calc echo width flag specification. More...
 
std::string parseSeed ()
 Parse the seed for RandomnessGenerator from invocation arguments. More...
 
int parseParallelizationStrategy ()
 Parse the parallelization strategy from invocation arguments. More...
 
std::size_t parseNJobs ()
 Parse the number of jobs from invocation arguments. More...
 
int parseChunkSize ()
 Parse the chunk size for the pulse task dropper from invocation arguments. More...
 
int parseWarehouseFactor ()
 Parse the warehouse factor for the warehouse based parallelization strategy from invocation arguments. More...
 
bool parseDisablePlatformNoise ()
 Parse the disable platform noise flag from invocation arguments. More...
 
bool parseDisableLegNoise ()
 Parse the disable leg noise flag from invocation arguments. More...
 
bool parseRebuildScene ()
 Parse the rebuild scene flag from invocation arguments. More...
 
void parseLoggingVerbosity ()
 Parse the verbosity level for logging from invocation arguments.
 
std::string parseLoggingOutputMode ()
 Parse the logging output mode from invocation arguments. More...
 
bool parseFullWaveNoise ()
 Parse the full wave noise specification. More...
 
bool parseLasOutput ()
 Parse the LAS output specification. More...
 
bool parseLas10 ()
 Parse the LAS version output specification. More...
 
bool parseZipOutput ()
 Parse the ZIP output specification. More...
 
double parseLasScale ()
 Parse the scale factor to be used by the LasSyncFileWriter. More...
 
bool parseUnzip (std::string *inputPath, std::string *outputPath)
 Parse an unzip request for given input and output path. More...
 
bool parseFixedIncidenceAngle ()
 Parse the fixed incidence angle specification. When fixed incidence angle is requested, incidence angle for all primitives will be exactly 1.0. More...
 
std::string parseGpsStartTime ()
 Parse the fixed GPS time start for Simulation. More...
 
int parseKDTreeType ()
 Parse the type of KDTree. More...
 
size_t parseKDTreeJobs ()
 Parse how many KDTree jobs must be used to build the KDTree. More...
 
size_t parseKDTreeGeometricJobs ()
 Parse how many KDTree geometry-level jobs must be used to build the KDTree upper nodes. More...
 
size_t parseSAHLossNodes ()
 Parse on how many nodes the loss function of the surface area heuristic must be evaluated when building the KDTree. For the Fast SAH it is the number of iterations computed to approximate SAH. More...
 
bool parseSplitByChannel ()
 Parse whether the output point clouds must be exported on a different file per channel or not. More...
 

Private Member Functions

int findIndexOfArgument (std::string &&arg)
 Find the index of received argument. More...
 

Private Attributes

int argc
 Number of arguments in array or arguments (argv) More...
 
char ** argv
 Array of arguments. More...
 

Detailed Description

Parser for helios-plusplus invocation arguments.

Author
Alberto M. Esmoris Pena @verison 1.0

Constructor & Destructor Documentation

◆ ArgumentsParser()

ArgumentsParser::ArgumentsParser ( int  argc,
char **  argv 
)
inline

Instantiate an ArgumentsParser.

Parameters
argcNumber of arguments
argvArray of arguments

Member Function Documentation

◆ findIndexOfArgument()

int ArgumentsParser::findIndexOfArgument ( std::string &&  arg)
private

Find the index of received argument.

Parameters
argArgument to be found
Returns
Index Index of the argument to be found, -1 if it was not found

◆ parseAssetsPath()

std::string ArgumentsParser::parseAssetsPath ( )

Parse the assets path from invocation arguments.

Returns
Parsed assets path or default value if none was found

◆ parseCalcEchowidth()

bool ArgumentsParser::parseCalcEchowidth ( )

Parse the calc echo width flag specification.

Returns
True if calc echo width flag was enabled, False otherwise

◆ parseChunkSize()

int ArgumentsParser::parseChunkSize ( )

Parse the chunk size for the pulse task dropper from invocation arguments.

Returns
Parsed chunk size. If no chunk size was specified, 32 will be returned as default value

◆ parseDemoAssetsPath()

std::string ArgumentsParser::parseDemoAssetsPath ( )

Parse the demo assets path from invocation arguments.

Returns
Parsed demo assets path if any, empty string "" otherwise

◆ parseDemoRequest()

std::string ArgumentsParser::parseDemoRequest ( )

Parse demo request argument if any (–demo)

Returns
Parsed demo if any or "NULL" if no demo was requested

◆ parseDemoSurveyPath()

std::string ArgumentsParser::parseDemoSurveyPath ( )

Parse the demo survey path from invocation arguments.

Returns
Parsed demo survey path if any, empty string "" otherwise

◆ parseDisableLegNoise()

bool ArgumentsParser::parseDisableLegNoise ( )

Parse the disable leg noise flag from invocation arguments.

Returns
True if disable leg noise flag was specified, False otherwise

◆ parseDisablePlatformNoise()

bool ArgumentsParser::parseDisablePlatformNoise ( )

Parse the disable platform noise flag from invocation arguments.

Returns
True if disable platform noise flag was specified, False otherwise

◆ parseFixedIncidenceAngle()

bool ArgumentsParser::parseFixedIncidenceAngle ( )

Parse the fixed incidence angle specification. When fixed incidence angle is requested, incidence angle for all primitives will be exactly 1.0.

Returns
True if fixed incidence angle was requested, False otherwise.

◆ parseFullWaveNoise()

bool ArgumentsParser::parseFullWaveNoise ( )

Parse the full wave noise specification.

Returns
True if full wave noise was setted, False otherwise.

◆ parseGpsStartTime()

std::string ArgumentsParser::parseGpsStartTime ( )

Parse the fixed GPS time start for Simulation.

Returns
Parsed fixed GPS time start. By default it is an empty string, which leads to use current local time.
See also
Simulation::fixedGpsTimeStart
Simulation::Simulation
Simulation

◆ parseHelpRequest()

bool ArgumentsParser::parseHelpRequest ( )

Parse help request argument if any (-h or –help)

Returns
True if help was requested, false otherwise.

◆ parseKDTreeGeometricJobs()

size_t ArgumentsParser::parseKDTreeGeometricJobs ( )

Parse how many KDTree geometry-level jobs must be used to build the KDTree upper nodes.

1 : Only node-level parallelization, which corresponds with only 1 node at geometry-level parallelization

0 (default) : As many threads as KDTree jobs

>1 : Exactly this number of threads for geometry-level parallel building

Returns
Number of jobs to be used at geometry-level parallelization of KDTree building

◆ parseKDTreeJobs()

size_t ArgumentsParser::parseKDTreeJobs ( )

Parse how many KDTree jobs must be used to build the KDTree.

1 : Sequential building

0 (default) : As many threads as available by the system

>1 : Exactly this number of threads for parallel building

Returns
Number of jobs to be used to build the KDTree

◆ parseKDTreeType()

int ArgumentsParser::parseKDTreeType ( )

Parse the type of KDTree.

1 : The simple KDTree built based on balancing through median heuristic

2 : The SAH KDTree built based on surface area heuristic

3 : The SAH KDTree built based on surface area heuristic and best axis

4 (default) : The Fast SAH KDtree built based on a fast iterative approximation of SAH

Returns
Number identifying the type of KDTree to be built if necessary

◆ parseLas10()

bool ArgumentsParser::parseLas10 ( )

Parse the LAS version output specification.

Returns
True if LAS v1.0 was requested, False otherwise.

◆ parseLasOutput()

bool ArgumentsParser::parseLasOutput ( )

Parse the LAS output specification.

Returns
True if LAS output was requested, False otherwise.

◆ parseLasScale()

double ArgumentsParser::parseLasScale ( )

Parse the scale factor to be used by the LasSyncFileWriter.

Returns
Scale factor to be used by the LasSyncFileWriter

◆ parseLoggingOutputMode()

std::string ArgumentsParser::parseLoggingOutputMode ( )

Parse the logging output mode from invocation arguments.

Returns
Translated parsed logging output mode. By default "std_out"

◆ parseNJobs()

std::size_t ArgumentsParser::parseNJobs ( )

Parse the number of jobs from invocation arguments.

Returns
Parsed number of jobs. If no number of jobs was specified, 0 will be returned.

◆ parseOutputPath()

std::string ArgumentsParser::parseOutputPath ( )

Parse the output path from invocation arguments.

Returns
Parsed output path or default value if none was found

◆ parseParallelizationStrategy()

int ArgumentsParser::parseParallelizationStrategy ( )

Parse the parallelization strategy from invocation arguments.

Returns
0 for chunk based parallelization, 1 for warehouse based parallelization (default)

◆ parseRebuildScene()

bool ArgumentsParser::parseRebuildScene ( )

Parse the rebuild scene flag from invocation arguments.

Returns
True if rebuild scene flag was specified, False otherwise

◆ parseSAHLossNodes()

size_t ArgumentsParser::parseSAHLossNodes ( )

Parse on how many nodes the loss function of the surface area heuristic must be evaluated when building the KDTree. For the Fast SAH it is the number of iterations computed to approximate SAH.

Returns
Number of nodes to evaluate loss function when building KDTree with a surface area heuristic approach. Number of iterations to approximate SAH when using Fast SAH strategy

◆ parseSeed()

std::string ArgumentsParser::parseSeed ( )

Parse the seed for RandomnessGenerator from invocation arguments.

Returns
Seed for RandomnessGenerator

◆ parseSplitByChannel()

bool ArgumentsParser::parseSplitByChannel ( )

Parse whether the output point clouds must be exported on a different file per channel or not.

Returns
True if the output point clouds must be exported on a different file par channel, False if the output point clouds must be exported on the same file with no concern for the channel

◆ parseSurveyPath()

std::string ArgumentsParser::parseSurveyPath ( )

Parse the survey path from invocation arguments.

Returns
Parsed survey path

◆ parseTestDir()

std::string ArgumentsParser::parseTestDir ( )

Parse test directory specification (not necessary, default one will be relative path "data/test/")

Returns
Parsed test directory path

◆ parseTestRequest()

bool ArgumentsParser::parseTestRequest ( )

Parse test request argument if any (–test)

Returns
True if test was requested, false otherwise.

◆ parseUnzip()

bool ArgumentsParser::parseUnzip ( std::string *  inputPath,
std::string *  outputPath 
)

Parse an unzip request for given input and output path.

Parameters
inputPathWhere the input path will be stored
outputPathWhere the output path will be stored
Returns
True if unzip was requested, False otherwise.

◆ parseVersionRequest()

bool ArgumentsParser::parseVersionRequest ( )

Parse version request argument if any (–version)

Returns
True if version was requested, false otherwise.

◆ parseWarehouseFactor()

int ArgumentsParser::parseWarehouseFactor ( )

Parse the warehouse factor for the warehouse based parallelization strategy from invocation arguments.

Returns
Parsed warehouse factor. If no warehouse factor was specified, 4 will be returned as default value

◆ parseWriteWaveform()

bool ArgumentsParser::parseWriteWaveform ( )

Parse the write waveform flag specification.

Returns
True if write waveform flag was enabled, False otherwise

◆ parseZipOutput()

bool ArgumentsParser::parseZipOutput ( )

Parse the ZIP output specification.

Returns
True if ZIP output was requested, False otherwise.

Member Data Documentation

◆ argc

int ArgumentsParser::argc
private

Number of arguments in array or arguments (argv)

See also
ArgumentsParser::argv

◆ argv

char** ArgumentsParser::argv
private

Array of arguments.

See also
ArgumentsParser::argc

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