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...
 
std::string parseTestDir ()
 Parse test directory specification (not necessary, default one will be relative path "data/test/") More...
 
std::string parseSurveyPath ()
 Parse the survery 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...
 
std::size_t parseNJobs ()
 Parse the number of jobs 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 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...
 

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 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

◆ 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.

◆ parseHelpRequest()

bool ArgumentsParser::parseHelpRequest ( )

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

Returns
true if help 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

◆ parseRebuildScene()

bool ArgumentsParser::parseRebuildScene ( )

Parse the rebuild scene flag from invocation arguments.

Returns
True if rebuild scene flag was specified, False otherwise

◆ parseSeed()

std::string ArgumentsParser::parseSeed ( )

Parse the seed for RandomnessGenerator from invocation arguments.

Returns
Seed for RandomnessGenerator

◆ parseSurveyPath()

std::string ArgumentsParser::parseSurveyPath ( )

Parse the survery 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.

◆ 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: