22int main(
int argc,
char* argv[])
25 "Moves the points of a geometry by a given displacement vector\n\n"
26 "OpenGeoSys-6 software, version " +
29 "Copyright (c) 2012-2024, OpenGeoSys Community "
30 "(http://www.opengeosys.org)",
32 TCLAP::ValueArg<double> z_arg(
"z",
"z",
"displacement in z direction",
33 false, 0.0,
"z-displacement");
35 TCLAP::ValueArg<double> y_arg(
"y",
"y",
"displacement in y direction",
36 false, 0.0,
"y-displacement");
38 TCLAP::ValueArg<double> x_arg(
"x",
"x",
"displacement in x direction",
39 false, 0.0,
"x-displacement");
41 TCLAP::ValueArg<std::string> geo_output_arg(
42 "o",
"output",
"output geometry file (*.gml)",
true,
"",
"output file");
43 cmd.add(geo_output_arg);
44 TCLAP::ValueArg<std::string> geo_input_arg(
45 "i",
"input",
"input geometry file (*.gml)",
true,
"",
"input file");
46 cmd.add(geo_input_arg);
47 cmd.parse(argc, argv);
55 if (!xml.
readFile(geo_input_arg.getValue()))
60 catch (std::runtime_error
const& err)
62 ERR(
"Failed to read file `{:s}'.", geo_input_arg.getValue());
63 ERR(
"{:s}", err.what());
67 Eigen::Vector3d displacement = Eigen::Vector3d::Zero();
70 displacement[0] = x_arg.getValue();
74 displacement[1] = y_arg.getValue();
78 displacement[2] = z_arg.getValue();
83 std::vector<GeoLib::Point*>
const* point_vec =
85 std::size_t
const n_points = point_vec->size();
86 for (std::size_t i = 0; i < n_points; ++i)
88 for (std::size_t c = 0; c < 3; ++c)
90 (*(*point_vec)[i])[c] += displacement[c];
96 geo_output_arg.getValue());