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 */
lvr2::BaseOption::z
int z() const
Returns the position of the x coordinate in the data.
Definition: BaseOption.hpp:87
lvr2::CoordinateTransform::z
unsigned char z
Position of the z coordinate in the target system.
Definition: CoordinateTransform.hpp:81
BaseOption.hpp
lvr2::BaseOption::m_pdescr
positional_options_description m_pdescr
The internally used positional option desription.
Definition: BaseOption.hpp:110
lvr2::BaseOption::printTransformation
void printTransformation(std::ostream &out) const
Prints transformation information to the given output stream.
Definition: BaseOption.cpp:60
lvr2::BaseOption::x
int x() const
Returns the position of the x coordinate in the data.
Definition: BaseOption.hpp:77
lvr2::BaseOption::setupInputTransformation
void setupInputTransformation()
Setup transformation info for ModelIO.
Definition: BaseOption.cpp:79
lvr2::BaseOption::coordinateTransform
CoordinateTransform< float > coordinateTransform() const
Definition: BaseOption.cpp:55
lvr2::BaseOption::~BaseOption
virtual ~BaseOption()
Definition: BaseOption.cpp:105
lvr2::CoordinateTransform::x
unsigned char x
Position of the x coordinate in the target system.
Definition: CoordinateTransform.hpp:75
lvr2::BaseOption::m_variables
variables_map m_variables
The internally used variable map.
Definition: BaseOption.hpp:104
lvr2::CoordinateTransform::sy
T sy
Definition: CoordinateTransform.hpp:89
lvr2::BaseOption::y
int y() const
Returns the position of the x coordinate in the data.
Definition: BaseOption.hpp:82
options
const kaboom::Options * options
Definition: src/tools/lvr2_kaboom/Main.cpp:45
lvr2::CoordinateTransform::y
unsigned char y
Position of the y coordinate in the target system.
Definition: CoordinateTransform.hpp:78
lvr2::ModelFactory::m_transform
static CoordinateTransform< float > m_transform
Definition: ModelFactory.hpp:66
lvr2::CoordinateTransform::transforms
bool transforms()
Definition: CoordinateTransform.hpp:69
argc
int argc
Definition: tests_high_five_parallel.cpp:27
lvr2::CoordinateTransform::sx
T sx
Definition: CoordinateTransform.hpp:85
lvr2::BaseOption::sx
float sx() const
Returns the scaling factor for the x coordinates.
Definition: BaseOption.hpp:62
lvr2::BaseOption::BaseOption
BaseOption(int argc, char **argv)
Definition: BaseOption.cpp:41
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::BaseOption::sy
float sy() const
Returns the scaling factor for the y coordinates.
Definition: BaseOption.hpp:67
lvr2::BaseOption::printLogo
void printLogo() const
Definition: BaseOption.cpp:110
lvr2::BaseOption::m_argv
char ** m_argv
Argument values.
Definition: BaseOption.hpp:119
ModelFactory.hpp
lvr2::BaseOption::m_coordinateTransform
CoordinateTransform< float > * m_coordinateTransform
Coordinate transform information.
Definition: BaseOption.hpp:113
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
lvr2::CoordinateTransform::sz
T sz
Definition: CoordinateTransform.hpp:93
lvr2::CoordinateTransform< float >
lvr2::BaseOption::sz
float sz() const
Returns the scaling factor for the z coordinates.
Definition: BaseOption.hpp:72
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28
lvr2::BaseOption::m_argc
int m_argc
Argument count.
Definition: BaseOption.hpp:116


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:22