src/tools/lvr2_cl_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 cl_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  string outputFile() const
64  {
65  return (m_variables["outputFile"].as<string>());
66  }
67 
68 
69 
70  string inputFile() const
71  {
72  return (m_variables["inputFile"].as< vector<string> >())[0];
73  }
74 
75  bool useRansac() const
76  {
77  return (m_variables.count("ransac"));
78  }
79 
80  bool usePCA() const
81  {
82  return (m_variables.count("pca"));
83  }
84 
85  float flipx() const
86  {
87  return m_variables["flipx"].as<float>();
88  }
89 
90  float flipy() const
91  {
92  return m_variables["flipy"].as<float>();
93  }
94 
95  float flipz() const
96  {
97  return m_variables["flipz"].as<float>();
98  }
99 
100  int kn() const
101  {
102  return m_variables["kn"].as<int>();
103  }
104 
105  int ki() const
106  {
107  return m_variables["ki"].as<int>();
108  }
109 
110  int kd() const
111  {
112  return m_variables["kd"].as<int>();
113  }
114 
115  float getVoxelsize() const
116  {
117  return m_variables["voxelsize"].as<float>();
118  }
119 
120  bool useVoxelSize() const
121  {
122  return m_variables.count("voxelsize");
123  }
124 
125  bool reconstruct() const
126  {
127  return m_variables.count("reconstruct");
128  }
129 
130  bool exportPointNormals() const
131  {
132  return m_variables.count("exportPointNormals");
133  }
134 
135 private:
136 
138  variables_map m_variables;
139 
141  options_description m_descr;
142 
144  positional_options_description m_pdescr;
145 
146  float m_flipx;
147  float m_flipy;
148  float m_flipz;
149  int m_kn;
150  int m_ki;
151  int m_kd;
152  float m_voxelsize;
153  string m_outputFile;
154 };
155 
156 inline ostream& operator<<(ostream& os, const Options& o)
157 {
158  os << "##### OpenCl normal estimation settings #####" << endl;
159  if(o.useRansac()){
160  os << "Normal Calculation with RANSAC" << endl;
161  }else if(o.usePCA()){
162  os << "Normal Calculation with PCA" << endl;
163  }else{
164  os << "Normal Calculation with PCA" << endl;
165  }
166  os << "Neighbors for normal estimation: "<< o.kn() << endl;
167  os << "Neighbors for normal interpolation: " << o.ki() << endl;
168  os << "Neighbors for distance function: " << o.kd() << endl;
169  os << "Flippoint x: " << o.flipx() << endl;
170  os << "Flippoint y: " << o.flipy() << endl;
171  os << "Flippoint z: " << o.flipz() << endl;
172 
173  return os;
174 }
175 
176 } // namespace normals
177 
178 #endif
positional_options_description m_pdescr
The internally used positional option desription.
ostream & operator<<(ostream &os, const Options &o)
variables_map m_variables
The internally used variable map.
A class to parse the program options for the reconstruction executable.
options_description m_descr
The internally used option description.
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