src/tools/lvr2_hdf5_builder_2/Options.cpp
Go to the documentation of this file.
1 
28 /*
29  * Options.cpp
30  *
31  * Created on: Nov 21, 2010
32  * Author: Thomas Wiemann
33  */
34 
35 #include "Options.hpp"
36 
37 namespace hdf5tool2
38 {
39 
40 Options::Options(int argc, char** argv) : m_descr("Supported options")
41 {
42 
43  // Create option descriptions
44 
45  m_descr.add_options()
46  ("help", "Produce help message")
47  ("inputDir", value<string>(), "Root of the raw data.")
48  ("outputDir", value<string>()->default_value("./"), "HDF5 file is written here.")
49  ("outputFile", value<string>()->default_value("data.h5"), "HDF5 file name.")
50  ("createPreview,p", value<bool>()->default_value(true), "Creates preview of the pointcloud.")
51  ("previewReduction,r", value<int>()->default_value(20), "Reduction ratio for the preview");
52 
53  // Parse command line and generate variables map
54  positional_options_description p;
55  p.add("inputDir", 1);
56  store(command_line_parser(argc, argv).options(m_descr).positional(p).run(), m_variables);
57  notify(m_variables);
58 
59  if (m_variables.count("help"))
60  {
61  ::std::cout << m_descr << ::std::endl;
62  exit(-1);
63  }
64  else if (!m_variables.count("inputDir"))
65  {
66  std::cout << "Error: You must specify an input directory." << std::endl;
67  std::cout << std::endl;
68  std::cout << m_descr << std::endl;
69  exit(-1);
70  }
71 }
72 
74 {
75  // TODO Auto-generated destructor stub
76 }
77 
78 } // namespace hdf5tool2
p
SharedPointer p
Definition: ConvertShared.hpp:42
options
const kaboom::Options * options
Definition: src/tools/lvr2_kaboom/Main.cpp:45
Options.hpp
hdf5tool2::Options::~Options
virtual ~Options()
Definition: src/tools/lvr2_hdf5_builder_2/Options.cpp:73
hdf5tool2
Definition: src/tools/lvr2_hdf5_builder_2/Options.cpp:37
argc
int argc
Definition: tests_high_five_parallel.cpp:27
hdf5tool2::Options::m_descr
options_description m_descr
The internally used option description.
Definition: src/tools/lvr2_hdf5_builder_2/Options.hpp:86
hdf5tool2::Options::Options
Options(int argc, char **argv)
Ctor. Parses the command parameters given to the main function of the program.
Definition: src/tools/lvr2_hdf5_builder_2/Options.cpp:40
hdf5tool2::Options::m_variables
variables_map m_variables
The internally used variable map.
Definition: src/tools/lvr2_hdf5_builder_2/Options.hpp:83
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