src/tools/lvr2_image_normals/Options.hpp
Go to the documentation of this file.
1 
28 #ifndef OPTIONS_H_
29 #define OPTIONS_H_
30 
31 #include <iostream>
32 #include <string>
33 #include <vector>
34 #include <boost/program_options.hpp>
35 
36 using std::cout;
37 using std::endl;
38 using std::string;
39 using std::vector;
40 using std::ostream;
41 
42 
43 namespace image_normals
44 {
45 
46 using namespace boost::program_options;
47 
52 class Options
53 {
54 public:
55 
60  Options(int argc, char** argv);
61  virtual ~Options();
62 
63 
64  string inputFile() const
65  {
66  return (m_variables["inputFile"].as< vector<string> >())[0];
67  }
68 
69 
70  string imageFile() const
71  {
72  return m_variables["img"].as<string>();
73  }
74 
75  int minH() const
76  {
77  return m_variables["minH"].as<int>();
78  }
79 
80  int maxH() const
81  {
82  return m_variables["maxH"].as<int>();
83  }
84 
85 
86  int minV() const
87  {
88  return m_variables["minV"].as<int>();
89  }
90 
91  int maxV() const
92  {
93  return m_variables["maxV"].as<int>();
94  }
95 
96  int imageWidth() const
97  {
98  return m_variables["imageWidth"].as<int>();
99  }
100 
101 
102  int imageHeight() const
103  {
104  return m_variables["imageHeight"].as<int>();
105  }
106 
107  int regionWidth() const
108  {
109  return m_variables["regionWidth"].as<int>();
110  }
111 
112  int regionHeight() const
113  {
114  return m_variables["regionHeight"].as<int>();
115  }
116 
117  float maxZ() const
118  {
119  return m_variables["maxZ"].as<float>();
120  }
121 
122  float minZ() const
123  {
124  return m_variables["minZ"].as<float>();
125  }
126 
127  float maxZimg() const
128  {
129  return m_variables["maxZimg"].as<float>();
130  }
131 
132  float minZimg() const
133  {
134  return m_variables["minZimg"].as<float>();
135  }
136 
137  bool optimize() const
138  {
139  return m_variables.count("optimize");
140  }
141 
142  string coordinateSystem() const
143  {
144  return m_variables["system"].as<string>();
145  }
146 
147 private:
148 
150  variables_map m_variables;
151 
153  options_description m_descr;
154 
156  positional_options_description m_pdescr;
157 
158  int m_minH;
159  int m_maxH;
160  int m_minV;
161  int m_maxV;
162  int m_width;
163  int m_height;
166  float m_minZ;
167  float m_maxZ;
168  float m_minZimg;
169  float m_maxZimg;
170  string m_imageOut;
171  string m_system;
172 };
173 
174 inline ostream& operator<<(ostream& os, const Options& o)
175 {
176  os << "##### Panorama normal estimation settings #####" << endl;
177  os << "Horizontal field of view\t: " << o.minH() << " x " << o.maxH() << endl;
178  os << "Vertical field of view\t\t: " << o.minV() << " x " << o.maxV() << endl;
179  os << "Image Dimensions\t\t: " << o.imageWidth() << " x " << o.imageHeight() << endl;
180  os << "Z range (scan) \t\t\t: " << o.minZ() << " to " << o.maxZ() << endl;
181  os << "Z range (img)\t\t\t: " << o.minZimg() << " to " << o.maxZimg() << endl;
182  os << "Optimize aspect\t\t\t: " << o.optimize() << endl;
183  os << "Coordinate system\t\t: " << o.coordinateSystem() << endl;
184  return os;
185 }
186 
187 } // namespace normals
188 
189 #endif
190 
A class to parse the program options for the reconstruction executable.
positional_options_description m_pdescr
The internally used positional option desription.
options_description m_descr
The internally used option description.
variables_map m_variables
The internally used variable map.
ostream & operator<<(ostream &os, const Options &o)
char ** argv


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 Mon Feb 28 2022 22:46:08