src/tools/lvr2_dmc_reconstruction/Options.cpp
Go to the documentation of this file.
1 /*
2 * OptionsDMC.cpp
3 *
4 * Created on: May 13, 2020
5 * Author: Benedikt Schumacher
6 */
7 
8 #include "Options.hpp"
10 
11 
12 using namespace boost::program_options;
15  m_descr.add_options()
16  ("help", "Produce help message")
17  ("inputFile",value<vector<string>>(), "Input file name. Supported formats are ASCII (.pts, .xyz) and .ply")
18  ("ml", value<int>(&m_maxLevel)->default_value(8), "Maximum allowed octree levels")
19  ("e", value<float>(&m_maxError)->default_value(2.8), "Maximum allowed error between points and surfaces")
20  ("kd", value<int>(&m_kd)->default_value(5), "Number of normals used for distance function evaluation")
21  ("ki", value<int>(&m_ki)->default_value(10), "Number of normals used in the normal interpolation process")
22  ("kn", value<int>(&m_kn)->default_value(10), "Size of k-neighborhood used for normal estimation")
23  ("pcm,p", value<string>(&m_pcm)->default_value("FLANN"), "Point cloud manager used for point handling and normal estimation. Choose from {STANN, PCL, NABO}.")
24  ("ransac", "Set this flag for RANSAC based normal estimation.")
25  ("scanPoseFile", value<string>()->default_value(""), "ASCII file containing scan positions that can be used to flip normals")
26  ("threads", value<int>(&m_numThreads)->default_value( lvr2::OpenMPConfig::getNumThreads() ), "Number of threads")
27  ;
28  setup();
29  }
30 
32  //TODO: Auto-generated destructor stub
33  }
34 
35  string Options::getInputFileName() const {
36  return (m_variables["inputFile"].as<vector<string>>())[0];
37  }
38 
39  int Options::getMaxLevel() const {
40  return (m_variables["ml"].as<int>());
41  }
42 
43  float Options::getMaxError() const {
44  return (m_variables["e"].as<float>());
45  }
46 
47  bool Options::printUsage() const {
48  if (m_variables.count("help"))
49  {
50  cout << endl;
51  cout << m_descr << endl;
52  return true;
53  }
54  else if (!m_variables.count("inputFile"))
55  {
56  cout << "Error: You must specify an input file." << endl;
57  cout << endl;
58  cout << m_descr << endl;
59  return true;
60  }
61  return false;
62  }
63 
64 
65  int Options::getKd() const {
66  return m_variables["kd"].as<int>();
67  }
68 
69  int Options::getKn() const {
70  return m_variables["kn"].as<int>();
71  }
72 
73  int Options::getKi() const {
74  return m_variables["ki"].as<int>();
75  }
76 
77  int Options::getNumThreads() const {
78  return m_variables["threads"].as<int>();
79  }
80 
81  string Options::getPCM() const {
82  return (m_variables["pcm"].as<string>());
83  }
84 
85  bool Options::useRansac() const
86  {
87  return (m_variables.count("ransac"));
88  }
89 
90  string Options::getScanPoseFile() const
91  {
92  return (m_variables["scanPoseFile"].as<string>());
93  }
94 }
95 
dmc_reconstruction::Options::~Options
virtual ~Options()
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:31
dmc_reconstruction::Options::printUsage
bool printUsage() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:47
Options.hpp
dmc_reconstruction::Options::getMaxLevel
int getMaxLevel() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:39
dmc_reconstruction::Options::getKi
int getKi() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:73
dmc_reconstruction::Options::getInputFileName
string getInputFileName() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:35
lvr2::BaseOption
Definition: BaseOption.hpp:48
lvr2::BaseOption::m_variables
variables_map m_variables
The internally used variable map.
Definition: BaseOption.hpp:104
dmc_reconstruction::Options::m_kd
int m_kd
The number of neighbors for distance function evaluation.
Definition: src/tools/lvr2_dmc_reconstruction/Options.hpp:96
dmc_reconstruction::Options::m_maxLevel
int m_maxLevel
The maximum allows octree level.
Definition: src/tools/lvr2_dmc_reconstruction/Options.hpp:90
lvropenmp.hpp
dmc_reconstruction
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:13
dmc_reconstruction::Options::getPCM
string getPCM() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:81
dmc_reconstruction::Options::getKd
int getKd() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:65
dmc_reconstruction::Options::m_kn
int m_kn
The number of neighbors for normal estimation.
Definition: src/tools/lvr2_dmc_reconstruction/Options.hpp:99
dmc_reconstruction::Options::getKn
int getKn() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:69
dmc_reconstruction::Options::m_numThreads
int m_numThreads
The number of threads to use.
Definition: src/tools/lvr2_dmc_reconstruction/Options.hpp:105
dmc_reconstruction::Options::getNumThreads
int getNumThreads() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:77
argc
int argc
Definition: tests_high_five_parallel.cpp:27
dmc_reconstruction::Options::useRansac
bool useRansac() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:85
dmc_reconstruction::Options::m_ki
int m_ki
The number of neighbors for normal interpolation.
Definition: src/tools/lvr2_dmc_reconstruction/Options.hpp:102
dmc_reconstruction::Options::m_pcm
string m_pcm
The used point cloud manager.
Definition: src/tools/lvr2_dmc_reconstruction/Options.hpp:108
dmc_reconstruction::Options::getMaxError
float getMaxError() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:43
dmc_reconstruction::Options::m_maxError
float m_maxError
The max allowed error between points and surfaces in an octree cell.
Definition: src/tools/lvr2_dmc_reconstruction/Options.hpp:93
dmc_reconstruction::Options::getScanPoseFile
string getScanPoseFile() const
Definition: src/tools/lvr2_dmc_reconstruction/Options.cpp:90
lvr2::BaseOption::setup
virtual void setup()
Setup internal data structures.
Definition: BaseOption.cpp:84
lvr2::BaseOption::m_descr
options_description m_descr
The internally used option description.
Definition: BaseOption.hpp:107
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28
lvr2::OpenMPConfig::getNumThreads
static int getNumThreads()
Returns the number of supported threads (or 1 if OpenMP is not supported)
Definition: lvropenmp.cpp:70
Options::Options
Options()
Definition: src/tools/lvr2_riegl_project_converter/Options.cpp:32


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