BaseOption.cpp
Go to the documentation of this file.
1 
28 /*
29  * BaseOption.cpp
30  *
31  * Created on: Feb 4, 2015
32  * Author: twiemann
33  */
34 
36 #include "lvr2/io/ModelFactory.hpp"
37 
38 namespace lvr2
39 {
40 
42  : m_descr("Supported options"), m_argc(argc), m_argv(argv)
43 {
44  m_descr.add_options()
45  ("xPos,x", value<int>()->default_value(0), "Position of the x-coordinates in the input point data (according to screen coordinates).")
46  ("yPos,y", value<int>()->default_value(1), "Position of the y-coordinates in the input data lines (according to screen coordinates).")
47  ("zPos,z", value<int>()->default_value(2), "Position of the z-coordinates in the input data lines (according to screen coordinates).")
48  ("sx", value<float>()->default_value(1.0f), "Scaling factor for the x coordinates.")
49  ("sy", value<float>()->default_value(1.0f), "Scaling factor for the y coordinates.")
50  ("sz", value<float>()->default_value(1.0f), "Scaling factor for the z coordinates.")
51  ;
53 }
54 
56 {
57  return CoordinateTransform<float>(x(), y(), z(), sx(), sy(), sz());
58 }
59 
60 void BaseOption::printTransformation(std::ostream& out) const
61 {
62  out << "##### Program options: " << std::endl;
64  {
65  out << "##### Transform input data\t: YES" << std::endl;
66  out << "##### Position of x coordinates\t: " << x() << std::endl;
67  out << "##### Position of y coordinates\t: " << y() << std::endl;
68  out << "##### Position of z coordinates\t: " << z() << std::endl;
69  out << "##### X-Scale\t\t\t: " << sx() << std::endl;
70  out << "##### Y-Scale\t\t\t: " << sy() << std::endl;
71  out << "##### Z-Scale\t\t\t: " << sz() << std::endl;
72  }
73  else
74  {
75  out << "##### Transform input data\t: NO" << std::endl;
76  }
77 }
78 
80 {
81 
82 }
83 
85 {
86  m_pdescr.add("inputFile", -1);
87 
88  // Parse command line and generate variables map
89  store(command_line_parser(m_argc, m_argv).options(m_descr).positional(m_pdescr).run(), m_variables);
90  notify(m_variables);
91 
92  if(sx() != 1.0 || sy() != 1.0 || sz() != 0 || x() != 1 || y() != 1 || z() != 1)
93  {
100 
102  }
103 }
104 
106 {
107 
108 }
109 
111 {
112  std::string logo = R"(
113  /\
114  / \ ## ## ## ####### ######
115  / \ ## ## ## ## ## ## ##
116  / \ ## ## ## ## ## ##
117  /________\ ## ## ## ## ## ##
118  /\ /\ ## ## ## ####### ##
119  / \ / \ ## ## ## ## ## ##
120  / \ / \ ## #### ## ## ##
121  / \ / \ ########## ## ## ## ##########
122 /________\/________\
123  )";
124 
125  std::cout << logo << std::endl;
126 }
127 
128 } /* namespace lvr2 */
char ** m_argv
Argument values.
Definition: BaseOption.hpp:119
float sz() const
Returns the scaling factor for the z coordinates.
Definition: BaseOption.hpp:72
unsigned char y
Position of the y coordinate in the target system.
virtual ~BaseOption()
Definition: BaseOption.cpp:105
const kaboom::Options * options
static CoordinateTransform< float > m_transform
virtual void setup()
Setup internal data structures.
Definition: BaseOption.cpp:84
float sy() const
Returns the scaling factor for the y coordinates.
Definition: BaseOption.hpp:67
void printTransformation(std::ostream &out) const
Prints transformation information to the given output stream.
Definition: BaseOption.cpp:60
BaseOption(int argc, char **argv)
Definition: BaseOption.cpp:41
CoordinateTransform< float > * m_coordinateTransform
Coordinate transform information.
Definition: BaseOption.hpp:113
options_description m_descr
The internally used option description.
Definition: BaseOption.hpp:107
void printLogo() const
Definition: BaseOption.cpp:110
int y() const
Returns the position of the x coordinate in the data.
Definition: BaseOption.hpp:82
float sx() const
Returns the scaling factor for the x coordinates.
Definition: BaseOption.hpp:62
unsigned char z
Position of the z coordinate in the target system.
void setupInputTransformation()
Setup transformation info for ModelIO.
Definition: BaseOption.cpp:79
positional_options_description m_pdescr
The internally used positional option desription.
Definition: BaseOption.hpp:110
variables_map m_variables
The internally used variable map.
Definition: BaseOption.hpp:104
CoordinateTransform< float > coordinateTransform() const
Definition: BaseOption.cpp:55
int z() const
Returns the position of the x coordinate in the data.
Definition: BaseOption.hpp:87
int x() const
Returns the position of the x coordinate in the data.
Definition: BaseOption.hpp:77
unsigned char x
Position of the x coordinate in the target system.
int m_argc
Argument count.
Definition: BaseOption.hpp:116
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:06