23int main(
int argc,
char* argv[])
26 "Moves the points of a geometry by a given displacement vector\n\n"
27 "OpenGeoSys-6 software, version " +
30 "Copyright (c) 2012-2025, OpenGeoSys Community "
31 "(http://www.opengeosys.org)",
33 TCLAP::ValueArg<double> z_arg(
"z",
"z",
"displacement in z direction",
34 false, 0.0,
"Z-DISPLACEMENT");
36 TCLAP::ValueArg<double> y_arg(
"y",
"y",
"displacement in y direction",
37 false, 0.0,
"Y-DISPLACEMENT");
39 TCLAP::ValueArg<double> x_arg(
"x",
"x",
"displacement in x direction",
40 false, 0.0,
"X-DISPLACEMENT");
42 TCLAP::ValueArg<std::string> geo_output_arg(
43 "o",
"output",
"Output (.gml) geometry file",
true,
"",
"OUTPUT_FILE");
44 cmd.add(geo_output_arg);
45 TCLAP::ValueArg<std::string> geo_input_arg(
46 "i",
"input",
"Input (.gml) geometry file",
true,
"",
"INPUT_FILE");
47 cmd.add(geo_input_arg);
49 cmd.add(log_level_arg);
50 cmd.parse(argc, argv);
59 if (!xml.
readFile(geo_input_arg.getValue()))
64 catch (std::runtime_error
const& err)
66 ERR(
"Failed to read file `{:s}'.", geo_input_arg.getValue());
67 ERR(
"{:s}", err.what());
71 Eigen::Vector3d displacement = Eigen::Vector3d::Zero();
74 displacement[0] = x_arg.getValue();
78 displacement[1] = y_arg.getValue();
82 displacement[2] = z_arg.getValue();
87 std::vector<GeoLib::Point*>
const* point_vec =
89 std::size_t
const n_points = point_vec->size();
90 for (std::size_t i = 0; i < n_points; ++i)
92 for (std::size_t c = 0; c < 3; ++c)
94 (*(*point_vec)[i])[c] += displacement[c];
100 geo_output_arg.getValue());