My Project
Loading...
Searching...
No Matches
options.hpp
1#ifndef OPTIONS_H
2#define OPTIONS_H
3
4// this file uses the "X" pattern.
5
6// Arguments to FOUND_CLI_OPTION:
7// 1. String used as the command line option.
8// 2. Type of the option value.
9// 3. Property name
10// 4. Default value
11// 5. Code to convert optarg into the value.
12// 6. The default value if the flag is specified
13// 7. The macro to use to assign a value to the variable
14
15// To properly align these fields, I recommend using an editor plugin. In Vim, try `vim-lion`; in
16// Emacs, try `evil-lion`. With your cursor inside any of the blocks, type `glip,` to aLign the
17// Inside of the current Paragraph to comma.
18
19#include <string>
20
21#include "style/style.hpp"
22#include "spatial/attitude-utils.hpp"
23#include "command-line/converters.hpp"
24
25// TODO(nguy8tri): Change std::string values to proper values
26
27// NOLINTBEGIN
28
30#define CALIBRATION \
31FOUND_CLI_OPTION("local-orientation" , found::EulerAngles, lclOrientation , found::EulerAngles(0, 0, 0), found::strtoea(optarg) , kNoDefaultArgument, REQ_ASSIGN) \
32FOUND_CLI_OPTION("reference-orientation", found::EulerAngles, refOrientation , found::EulerAngles(0, 0, 0), found::strtoea(optarg) , kNoDefaultArgument, REQ_ASSIGN) \
33FOUND_CLI_OPTION("use-same-orientation" , bool , useSameOrientation, false , found::strtobool(optarg), true , OPT_ASSIGN) \
34FOUND_CLI_OPTION("output-file" , std::string , outputFile , "" , optarg , kNoDefaultArgument, REQ_ASSIGN)
35
36
38#define DISTANCE \
39FOUND_CLI_OPTION("png" , std::string , png , "" , optarg , kNoDefaultArgument, REQ_ASSIGN) \
40FOUND_CLI_OPTION("calibration-data" , std::string , calibrationData , "" , optarg , kNoDefaultArgument, REQ_ASSIGN) \
41FOUND_CLI_OPTION("reference-as-orientation", bool , refAsOrientation, false , found::strtobool(optarg) , true , OPT_ASSIGN) \
42FOUND_CLI_OPTION("camera-focal-length" , decimal , focalLength , 0.012 , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN) \
43FOUND_CLI_OPTION("camera-pixel-size" , decimal , pixelSize , 20E-6 , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN) \
44FOUND_CLI_OPTION("reference-orientation" , found::EulerAngles, refOrientation , found::EulerAngles(0, 0, 0), found::strtoea(optarg) , kNoDefaultArgument, REQ_ASSIGN)
45
46
47// Orbit Flags
48#define ORBIT \
49FOUND_CLI_OPTION("position-data", std::string, positionData, "", optarg, kNoDefaultArgument, REQ_ASSIGN) \
50FOUND_CLI_OPTION("output-form" , std::string, output , "", optarg, kNoDefaultArgument, REQ_ASSIGN)
51
52// NOLINTEND
53
55 public:
56#define FOUND_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg, ASSIGN) \
57 type prop = defaultVal;
58 CALIBRATION
59#undef FOUND_CLI_OPTION
60};
61
63 public:
64#define FOUND_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg, ASSIGN) \
65 type prop = defaultVal;
66 DISTANCE
67#undef FOUND_CLI_OPTION
68};
69
71 public:
72#define FOUND_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg, ASSIGN) \
73 type prop = defaultVal;
74 ORBIT
75#undef FOUND_CLI_OPTION
76};
77
78#endif // OPTIONS_H
Definition options.hpp:54
Definition options.hpp:62
Definition options.hpp:70