FOUND
Loading...
Searching...
No Matches
options.hpp
Go to the documentation of this file.
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// 8. Documentation
15
16// To properly align these fields, I recommend using an editor plugin. In Vim, try `vim-lion`; in
17// Emacs, try `evil-lion`. With your cursor inside any of the blocks, type `glip,` to aLign the
18// Inside of the current Paragraph to comma.
19
20#include <string>
21
22#include "common/style.hpp"
25#include "datafile/datafile.hpp"
27
29#define emptyDFVer 0U
31#define defaultDFHead {{'L','O','S','T'}, emptyDFVer}
32
33// NOLINTBEGIN
34
36#define CALIBRATION \
37FOUND_CLI_OPTION("local-orientation" , found::EulerAngles, lclOrientation , found::EulerAngles(0, 0, 0), found::strtoea(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The local orientation (deg)" ) \
38FOUND_CLI_OPTION("reference-orientation", found::EulerAngles, refOrientation , found::EulerAngles(0, 0, 0), found::strtoea(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The reference orientation (deg)") \
39FOUND_CLI_OPTION("output-file" , std::string , outputFile , "" , optarg , kNoDefaultArgument, REQ_ASSIGN, "The output file (*.found)" )
40
41
43#define SEDA "SEDA" // The SimpleEdgeDetectionAlgorithm (SEDA)
44#define SDDA "SDDA" // The SphericalDistance DeterminationAlgorithm (SDDA)
45#define ISDDA "ISDDA" // The IterativeSphericalDistanceDeterminationAlgorithm (ISDDA)
46
48#define DISTANCE \
49FOUND_CLI_OPTION("image" , found::Image , image , {} , found::strtoimage(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The image to process (JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC)") \
50FOUND_CLI_OPTION("calibration-data" , found::DataFile , calibrationData , {defaultDFHead} , found::strtodf(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The calibration data (*.found)" ) \
51FOUND_CLI_OPTION("reference-as-orientation", bool , refAsOrientation, false , found::strtobool(optarg) , true , OPT_ASSIGN, "Use reference-orientation as the orientation of the camera" ) \
52FOUND_CLI_OPTION("camera-focal-length" , decimal , focalLength , 0.012 , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The camera focal length (m)" ) \
53FOUND_CLI_OPTION("camera-pixel-size" , decimal , pixelSize , 20E-6 , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The camera pixel size (m)" ) \
54FOUND_CLI_OPTION("reference-orientation" , found::EulerAngles, refOrientation , found::EulerAngles(0, 0, 0), found::strtoea(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The reference orientation (deg)" ) \
55FOUND_CLI_OPTION("relative-orientation" , found::EulerAngles, relOrientation , found::EulerAngles(0, 0, 0), found::strtoea(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The relative orientation to use (if no calibration) (deg)" ) \
56FOUND_CLI_OPTION("planetary-radius" , decimal , radius , DECIMAL_M_R_E , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The planetary radius to use (m)" ) \
57FOUND_CLI_OPTION("seda-threshold" , unsigned char , SEDAThreshold , 25 , found::strtouc(optarg) , kNoDefaultArgument, REQ_ASSIGN, "Threshold for the SEDA Algorithm ([0,255])" ) \
58FOUND_CLI_OPTION("seda-border-len" , int , SEDABorderLen , 1 , atoi(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The border thickness for SEDA (pixels)" ) \
59FOUND_CLI_OPTION("seda-offset" , decimal , SEDAOffset , 0.0 , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The edge offset for SEDA (pixels)" ) \
60FOUND_CLI_OPTION("distance-algo" , std::string , distanceAlgo , SDDA , optarg , kNoDefaultArgument, REQ_ASSIGN, "The distance algorithm to use (SDDA or ISDDA)" ) \
61FOUND_CLI_OPTION("isdda-min-iterations" , size_t , ISDDAMinIters , 0 , found::strtosize(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The number of iterations for ISDDA" ) \
62FOUND_CLI_OPTION("isdda-dist-ratio" , decimal , ISDDADistRatio , DECIMAL_INF , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The distance ratio for calculated positions for ISDDA (m)" ) \
63FOUND_CLI_OPTION("isdda-discrim-ratio" , decimal , ISDDADiscimRatio, DECIMAL_INF , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The loss discrimination ratio for ISSDA" ) \
64FOUND_CLI_OPTION("isdda-pdf-order" , int , ISDDAPdfOrd , 2 , atoi(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The Probability Density Function Order for ISSDA (even int)" ) \
65FOUND_CLI_OPTION("isdda-radius-loss-order" , int , ISDDARadLossOrd , 4 , atoi(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The Radius Loss Order ISSDA (even int)" ) \
66FOUND_CLI_OPTION("output-file" , std::string , outputFile , "" , optarg , kNoDefaultArgument, REQ_ASSIGN, "The output file (*.found)" ) \
67
68
69// Orbit Flags
70// TODO: Fix these all to correct parameters/outputs
71#define ORBIT \
72FOUND_CLI_OPTION("position-data", found::LocationRecords, positionData, {} , found::strtolr(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The position data (*.found)" ) \
73FOUND_CLI_OPTION("output-form" , std::string , output , "" , optarg , kNoDefaultArgument, REQ_ASSIGN, "The desired form of the output" ) \
74FOUND_CLI_OPTION("total-time" , decimal , totalTime , 3600.0 , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The total time to predict for (s)" ) \
75FOUND_CLI_OPTION("time-step" , decimal , dt , 0.01 , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The time step to use (s)" ) \
76FOUND_CLI_OPTION("radius" , decimal , radius , DECIMAL_M_R_E, found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The planetary radius to use (m)" ) \
77FOUND_CLI_OPTION("mu" , decimal , mu , 398600.4418 , found::strtodecimal(optarg), kNoDefaultArgument, REQ_ASSIGN, "The standard gravitational parameter (m^3/s^2)")
78
79// NOLINTEND
80
82 public:
83#define FOUND_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg, ASSIGN, doc) \
84 type prop = defaultVal;
86#undef FOUND_CLI_OPTION
87};
88
90 public:
91#define FOUND_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg, ASSIGN, doc) \
92 type prop = defaultVal;
94#undef FOUND_CLI_OPTION
95};
96
98 public:
99#define FOUND_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg, ASSIGN, doc) \
100 type prop = defaultVal;
101 ORBIT
102#undef FOUND_CLI_OPTION
103};
104
105#endif // OPTIONS_H
Definition options.hpp:81
Definition options.hpp:89
Definition options.hpp:97
Declares data structures for serialized spatial data files, including headers, location records,...
#define CALIBRATION
Calibration Flags.
Definition options.hpp:36
#define ORBIT
Definition options.hpp:71
#define DISTANCE
Distance Flags.
Definition options.hpp:48