src/tools/lvr2_kaboom/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 
44 
45 using std::ostream;
46 using std::cout;
47 using std::endl;
48 using std::string;
49 using std::vector;
50 
51 
52 namespace kaboom
53 {
54 
55 using namespace boost::program_options;
56 
61 class Options : public lvr2::BaseOption
62 {
63 public:
64 
69  Options(int argc, char** argv);
70  virtual ~Options();
71 
72  string getInputDir() const;
73  string getOutputDir() const;
74  string getOutputFormat() const;
75  string getInputFile() const;
76  string getOutputFile() const;
77 
78  bool exportScanPositions() const;
79  bool filter() const;
80  bool transformBefore() const;
81  int getK() const;
82  float getSigma() const;
83  int getTargetSize() const;
84  double getVoxelSize() const;
85  size_t getMinPointsPerVoxel() const;
86 
87  bool convertToLVR() const;
88 
92  int r() const { return m_variables["rPos"].as<int>() ;}
93 
97  int g() const { return m_variables["gPos"].as<int>();}
98 
102  int b() const { return m_variables["bPos"].as<int>();}
103 
107  int i() const { return m_variables["iPos"].as<int>();}
108 
109  int getStart() const { return m_variables["start"].as<int>(); }
110 
111  int getEnd() const { return m_variables["end"].as<int>(); }
112 
113  std::string getScanPrefix() const { return m_variables["scanPrefix"].as<std::string>(); }
114  std::string getPosePrefix() const { return m_variables["posePrefix"].as<std::string>(); }
115  std::string getScanExtension() const { return m_variables["scanExtension"].as<std::string>(); }
116  std::string getPoseExtension() const { return m_variables["poseExtension"].as<std::string>(); }
117 
118 private:
119 
121  string m_outputFile;
122 
124  variables_map m_variables;
125 
127  options_description m_descr;
128 
130  positional_options_description m_pdescr;
131 
132 };
133 
134 
136 inline ostream& operator<<(ostream& os, const Options &o)
137 {
138  cout << "##### Program options: " << endl;
139  cout << "##### Input dir \t\t: " << o.getInputDir() << endl;
140  cout << "##### Output dir \t\t: " << o.getOutputDir() << endl;
141  if(o.filter())
142  {
143  cout << "##### Filter \t\t\t: YES" << endl;
144  cout << "##### K \t\t\t\t: " << o.getK() << endl;
145  cout << "##### Sigma \t\t\t: " << o.getSigma() << endl;
146  }
147  else
148  {
149  cout << "##### Filter \t\t\t: NO" << endl;
150  }
151  cout << "##### Target Size \t: " << o.getTargetSize() << endl;
152  return os;
153 }
154 
155 } // namespace reconstruct
156 
157 
158 #endif /* OPTIONS_H_ */
BaseOption.hpp
kaboom::Options::m_variables
variables_map m_variables
The internally used variable map.
Definition: src/tools/lvr2_kaboom/Options.hpp:124
kaboom::Options::g
int g() const
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_kaboom/Options.hpp:97
kaboom::Options::getPosePrefix
std::string getPosePrefix() const
Definition: src/tools/lvr2_kaboom/Options.hpp:114
kaboom::Options::getInputDir
string getInputDir() const
Definition: src/tools/lvr2_kaboom/Options.cpp:98
kaboom::Options::getPoseExtension
std::string getPoseExtension() const
Definition: src/tools/lvr2_kaboom/Options.hpp:116
lvr2::BaseOption
Definition: BaseOption.hpp:48
kaboom::Options::m_descr
options_description m_descr
The internally used option description.
Definition: src/tools/lvr2_kaboom/Options.hpp:127
kaboom::Options::getEnd
int getEnd() const
Definition: src/tools/lvr2_kaboom/Options.hpp:111
kaboom::Options::filter
bool filter() const
Definition: src/tools/lvr2_kaboom/Options.cpp:124
kaboom::Options::m_outputFile
string m_outputFile
Output file name.
Definition: src/tools/lvr2_kaboom/Options.hpp:121
kaboom::Options::i
int i() const
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_kaboom/Options.hpp:107
kaboom
Definition: src/tools/lvr2_kaboom/Options.cpp:37
kaboom::Options::getScanPrefix
std::string getScanPrefix() const
Definition: src/tools/lvr2_kaboom/Options.hpp:113
filter
void filter(lvr2::PointBufferPtr &cloud, lvr2::indexArray &inlier, size_t j)
Definition: src/tools/lvr2_cl_sor/Main.cpp:40
argc
int argc
Definition: tests_high_five_parallel.cpp:27
kaboom::Options::getSigma
float getSigma() const
Definition: src/tools/lvr2_kaboom/Options.cpp:139
kaboom::Options::getK
int getK() const
Definition: src/tools/lvr2_kaboom/Options.cpp:134
kaboom::Options::getScanExtension
std::string getScanExtension() const
Definition: src/tools/lvr2_kaboom/Options.hpp:115
kaboom::Options::getTargetSize
int getTargetSize() const
Definition: src/tools/lvr2_kaboom/Options.cpp:144
kaboom::Options::r
int r() const
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_kaboom/Options.hpp:92
kaboom::Options
A class to parse the program options for the reconstruction executable.
Definition: src/tools/lvr2_kaboom/Options.hpp:61
kaboom::Options::m_pdescr
positional_options_description m_pdescr
The internally used positional option desription.
Definition: src/tools/lvr2_kaboom/Options.hpp:130
kaboom::Options::getOutputDir
string getOutputDir() const
Definition: src/tools/lvr2_kaboom/Options.cpp:103
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28
kaboom::Options::b
int b() const
Returns the position of the x coordinate in the data.
Definition: src/tools/lvr2_kaboom/Options.hpp:102
kaboom::operator<<
ostream & operator<<(ostream &os, const Options &o)
Overlaoeded outpur operator.
Definition: src/tools/lvr2_kaboom/Options.hpp:136
kaboom::Options::getStart
int getStart() const
Definition: src/tools/lvr2_kaboom/Options.hpp:109


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