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
cl_normals::Options::getVoxelsize
float getVoxelsize() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:115
cl_normals::Options::usePCA
bool usePCA() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:80
cl_normals::Options::useVoxelSize
bool useVoxelSize() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:120
cl_normals
Definition: src/tools/lvr2_cl_normals/Options.cpp:30
cl_normals::Options::flipz
float flipz() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:95
cl_normals::Options::outputFile
string outputFile() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:63
cl_normals::Options::m_voxelsize
float m_voxelsize
Definition: src/tools/lvr2_cl_normals/Options.hpp:152
cl_normals::Options::kn
int kn() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:100
cl_normals::Options::flipy
float flipy() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:90
cl_normals::Options::m_ki
int m_ki
Definition: src/tools/lvr2_cl_normals/Options.hpp:150
cl_normals::Options::m_kn
int m_kn
Definition: src/tools/lvr2_cl_normals/Options.hpp:149
cl_normals::Options::m_flipy
float m_flipy
Definition: src/tools/lvr2_cl_normals/Options.hpp:147
cl_normals::Options::kd
int kd() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:110
cl_normals::Options::flipx
float flipx() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:85
cl_normals::Options::m_pdescr
positional_options_description m_pdescr
The internally used positional option desription.
Definition: src/tools/lvr2_cl_normals/Options.hpp:144
cl_normals::Options::useRansac
bool useRansac() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:75
cl_normals::Options::m_descr
options_description m_descr
The internally used option description.
Definition: src/tools/lvr2_cl_normals/Options.hpp:141
cl_normals::Options::m_flipz
float m_flipz
Definition: src/tools/lvr2_cl_normals/Options.hpp:148
cl_normals::operator<<
ostream & operator<<(ostream &os, const Options &o)
Definition: src/tools/lvr2_cl_normals/Options.hpp:156
cl_normals::Options::reconstruct
bool reconstruct() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:125
argc
int argc
Definition: tests_high_five_parallel.cpp:27
cl_normals::Options
A class to parse the program options for the reconstruction executable.
Definition: src/tools/lvr2_cl_normals/Options.hpp:52
cl_normals::Options::ki
int ki() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:105
cl_normals::Options::m_kd
int m_kd
Definition: src/tools/lvr2_cl_normals/Options.hpp:151
cl_normals::Options::exportPointNormals
bool exportPointNormals() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:130
cl_normals::Options::m_outputFile
string m_outputFile
Definition: src/tools/lvr2_cl_normals/Options.hpp:153
cl_normals::Options::inputFile
string inputFile() const
Definition: src/tools/lvr2_cl_normals/Options.hpp:70
cl_normals::Options::m_flipx
float m_flipx
Definition: src/tools/lvr2_cl_normals/Options.hpp:146
cl_normals::Options::m_variables
variables_map m_variables
The internally used variable map.
Definition: src/tools/lvr2_cl_normals/Options.hpp:138
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