OptionsGS.cpp
Go to the documentation of this file.
1 /*
2 * OptionsGSS.cpp
3 *
4 * Created on: Feb 09, 2019
5 * Author: Patrick Hoffmann
6 */
7 
8 #include "OptionsGS.hpp"
9 
10 
11 using namespace boost::program_options;
13  Options::Options(int argc, char **argv) : BaseOption(argc, argv) {
14  m_descr.add_options()
15  ("help", "Produce help message")
16  ("inputFile",value<vector<string>>(), "Input file name. Supported formats are ASCII (.pts, .xyz) and .ply")
17  ("runtime", value<int>(&m_runtime)->default_value(3000), "Overall runtime of the Algorithm. The longer, the (better), default: 3000")
18  ("basicSteps",value<int>(&m_basicSteps)->default_value(10), "Basics step until split, default: 10")
19  ("numSplits",value<int>(&m_numSplits)->default_value(5), "splits per runtime, default: 5")
20  ("boxFactor",value<float>(&m_boxFactor)->default_value(0.2), "scale of initial mesh, default: 1")
21  ("withCollapse",value<bool>(&m_withCollapse)->default_value(true), "with edge collapse? default: true")
22  ("learningRate",value<float>(&m_learningRate)->default_value(0.1),"learning rate of winner vertex, default: 1")
23  ("neighborLearningRate",value<float>(&m_neighborLearningRate)->default_value(0.08),"learning rate of winner vertex neighbours, default: 0.08")
24  ("decreaseFactor",value<float>(&m_decreaseFactor)->default_value(0.999),"dynamic decrease factor, default start: 1.0")
25  ("allowMiss",value<int>(&m_allowMiss)->default_value(7), "allow miss of vertex, default: 7")
26  ("collapseThreshold",value<float>(&m_collapseThreshold)->default_value(0.3), "threshold for collapse, default: 0.3")
27  ("filterChain",value<bool>(&m_filterChain)->default_value(false),"should the filter chain run? default: false")
28  ("deleteLongEdgesFactor",value<int>(&m_deleteLongEdgesFactor)->default_value(10), "0 = no deleting, default: 10")
29  ("interior",value<bool>(&m_interior)->default_value(false), "false: reconstruct exterior, true: reconstruct interior")
30  ("balances",value<int>(&m_balances)->default_value(20), "Number of TumbleTree-Balances during the reconstruction. default: 20")
31  ("kd", value<int>(&m_kd)->default_value(5), "Number of normals used for distance function evaluation")
32  ("ki", value<int>(&m_ki)->default_value(10), "Number of normals used in the normal interpolation process")
33  ("kn", value<int>(&m_kn)->default_value(10), "Size of k-neighborhood used for normal estimation")
34  ("pcm,p", value<string>(&m_pcm)->default_value("FLANN"), "Point cloud manager used for point handling and normal estimation. Choose from {STANN, PCL, NABO}.")
35  ;
36  setup();
37  }
38 
40  //TODO: Auto-generated destructor stub
41  }
42 
43  string Options::getInputFileName() const {
44  return (m_variables["inputFile"].as<vector<string>>())[0];
45  }
46 
47  int Options::getRuntime() const {
48  return m_variables["runtime"].as<int>();
49  }
50 
51  int Options::getBasicSteps() const {
52  return m_variables["basicSteps"].as<int>();
53  }
54 
55  int Options::getNumSplits() const {
56  return m_variables["numSplits"].as<int>();
57  }
58 
59  float Options::getBoxFactor() const {
60  return m_variables["boxFactor"].as<float>();
61  }
62 
63  bool Options::getWithCollapse() const {
64  return m_variables["withCollapse"].as<bool>();
65  }
66 
67  float Options::getLearningRate() const {
68  return m_variables["learningRate"].as<float>();
69  }
70 
72  return m_variables["neighborLearningRate"].as<float>();
73  }
74 
76  return m_variables["decreaseFactor"].as<float>();
77 
78  }
79  int Options::getAllowMiss() const {
80  return m_variables["allowMiss"].as<int>();
81  }
82 
84  return m_variables["collapseThreshold"].as<float>();
85  }
86 
87  bool Options::isFilterChain() const {
88  return m_variables["filterChain"].as<bool>();
89  }
90 
92  return m_variables["deleteLongEdgesFactor"].as<int>();
93  }
94 
95  bool Options::isInterior() const {
96  return m_variables["interior"].as<bool>();
97  }
98 
100  return m_variables["balances"].as<int>();
101  }
102 
103 
104 
105 
106 
107  bool Options::printUsage() const {
108  if (m_variables.count("help"))
109  {
110  cout << endl;
111  cout << m_descr << endl;
112  return true;
113  }
114  else if (!m_variables.count("inputFile"))
115  {
116  cout << "Error: You must specify an input file." << endl;
117  cout << endl;
118  cout << m_descr << endl;
119  return true;
120  }
121  return false;
122  }
123 
124 
125  int Options::getKd() const {
126  return m_variables["kd"].as<int>();
127  }
128 
129  int Options::getKn() const {
130  return m_variables["kn"].as<int>();
131  }
132 
133  int Options::getKi() const {
134  return m_variables["ki"].as<int>();
135  }
136 
137  string Options::getPcm() const {
138  return (m_variables["pcm"].as<string>());
139  }
140 }
141 
virtual void setup()
Setup internal data structures.
Definition: BaseOption.cpp:84
float getNeighborLearningRate() const
Definition: OptionsGS.cpp:71
int m_kn
The number of neighbors for normal estimation.
Definition: OptionsGS.hpp:123
options_description m_descr
The internally used option description.
Definition: BaseOption.hpp:107
bool getWithCollapse() const
Definition: OptionsGS.cpp:63
bool isFilterChain() const
Definition: OptionsGS.cpp:87
float getBoxFactor() const
Definition: OptionsGS.cpp:59
int getDeleteLongEdgesFactor() const
Definition: OptionsGS.cpp:91
string m_pcm
The used point cloud manager.
Definition: OptionsGS.hpp:129
variables_map m_variables
The internally used variable map.
Definition: BaseOption.hpp:104
float getLearningRate() const
Definition: OptionsGS.cpp:67
int m_ki
The number of neighbors for normal interpolation.
Definition: OptionsGS.hpp:126
float getDecreaseFactor() const
Definition: OptionsGS.cpp:75
float getCollapseThreshold() const
Definition: OptionsGS.cpp:83
int m_kd
The number of neighbors for distance function evaluation.
Definition: OptionsGS.hpp:120
string getInputFileName() const
Definition: OptionsGS.cpp:43
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