src/tools/lvr2_asciiconverter/Options.hpp
Go to the documentation of this file.
1 
28  /*
29  * Options.h
30  *
31  * Created on: Nov 21, 2010
32  * Author: Thomas Wiemann
33  */
34 
35 #ifndef OPTIONS_H_
36 #define OPTIONS_H_
37 
38 #include <iostream>
39 #include <string>
40 #include <vector>
41 #include <boost/program_options.hpp>
42 
43 using std::ostream;
44 using std::cout;
45 using std::endl;
46 using std::string;
47 using std::vector;
48 
49 
50 namespace ascii_convert
51 {
52 
53 using namespace boost::program_options;
54 
59 class Options {
60 public:
61 
66  Options(int argc, char** argv);
67  virtual ~Options();
68 
72  int x() { return m_variables["xPos"].as<int>();}
73 
77  int y() { return m_variables["yPos"].as<int>();}
78 
82  int z() { return m_variables["zPos"].as<int>();}
83 
87  int r() { return m_variables["rPos"].as<int>() ;}
88 
92  int g() { return m_variables["gPos"].as<int>();}
93 
97  int b() { return m_variables["bPos"].as<int>();}
98 
102  int i() { return m_variables["iPos"].as<int>();}
103 
104 
108  float sx() { return m_variables["sx"].as<float>();}
109 
113  float sy() { return m_variables["sy"].as<float>();}
114 
118  float sz() { return m_variables["sz"].as<float>();}
119 
120 
124  string inputFile() const;
125 
129  string outputFile() const;
130 
134  bool printUsage() const;
135 
139  bool convertRemission() const;
140 
141 private:
142 
144  string m_outputFile;
145 
147  variables_map m_variables;
148 
150  options_description m_descr;
151 
153  positional_options_description m_pdescr;
154 
155 };
156 
157 
159 inline ostream& operator<<(ostream& os, const Options &o)
160 {
161  cout << "##### Program options: " << endl;
162  cout << "##### Input file \t\t: " << o.inputFile() << endl;
163  cout << "##### Output file \t\t: " << o.outputFile() << endl;
164  return os;
165 }
166 
167 } // namespace reconstruct
168 
169 
170 #endif /* OPTIONS_H_ */
ascii_convert::Options::m_variables
variables_map m_variables
The internally used variable map.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:147
ascii_convert::Options::m_descr
options_description m_descr
The internally used option description.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:150
ascii_convert::Options::m_outputFile
string m_outputFile
Output file name.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:144
ascii_convert::Options::g
int g()
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:92
ascii_convert::Options::outputFile
string outputFile() const
Retuns the input file.
Definition: src/tools/lvr2_asciiconverter/Options.cpp:86
ascii_convert::Options::m_pdescr
positional_options_description m_pdescr
The internally used positional option desription.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:153
ascii_convert::Options::inputFile
string inputFile() const
Retuns the input file.
Definition: src/tools/lvr2_asciiconverter/Options.cpp:81
ascii_convert::Options::x
int x()
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:72
ascii_convert::Options::y
int y()
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:77
ascii_convert::Options::b
int b()
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:97
ascii_convert::Options::i
int i()
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:102
ascii_convert::Options::r
int r()
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:87
ascii_convert::Options::z
int z()
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:82
ascii_convert::Options
A class to parse the program options for the reconstruction executable.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:59
ascii_convert::operator<<
ostream & operator<<(ostream &os, const Options &o)
Overlaoeded outpur operator.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:159
ascii_convert
Definition: src/tools/lvr2_asciiconverter/Options.cpp:37
argc
int argc
Definition: tests_high_five_parallel.cpp:27
ascii_convert::Options::sx
float sx()
Returns the scaling factor for the x coordinates.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:108
ascii_convert::Options::sy
float sy()
Returns the scaling factor for the y coordinates.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:113
ascii_convert::Options::sz
float sz()
Returns the scaling factor for the z coordinates.
Definition: src/tools/lvr2_asciiconverter/Options.hpp:118
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:24