10#include <tclap/CmdLine.h>
35int main(
int argc,
char* argv[])
38 "Converts TIN file into VTU file.\n\n"
39 "OpenGeoSys-6 software, version " +
42 "Copyright (c) 2012-2025, OpenGeoSys Community "
43 "(http://www.opengeosys.org)",
45 TCLAP::ValueArg<std::string> inArg(
"i",
"input-tin-file",
46 "Input (.tin). The name "
48 "containing the input TIN ",
49 true,
"",
"INPUT_FILE");
51 TCLAP::ValueArg<std::string> outArg(
52 "o",
"output-vtu-file",
53 "Output (.vtu). The name of the output file "
54 "the mesh will be written to",
55 true,
"",
"OUTPUT_FILE");
58 cmd.add(log_level_arg);
59 cmd.parse(argc, argv);
64 INFO(
"reading the TIN file...");
65 const std::string tinFileName(inArg.getValue());
66 std::string point_vec_name{
"SurfacePoints"};
69 std::unique_ptr<GeoLib::Surface> sfc(
75 INFO(
"TIN read: {:d} points, {:d} triangles", point_vec.size(),
76 sfc->getNumberOfTriangles());
78 INFO(
"converting to mesh data");
81 std::numeric_limits<double>::epsilon()));
82 INFO(
"Mesh created: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(),
83 mesh->getNumberOfElements());
85 INFO(
"Write it into VTU");
Definition of the Point class.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the Mesh class.
Definition of the PointVec class.
int main(int argc, char *argv[])
Implementation of the VtuInterface class.
static GeoLib::Surface * readTIN(std::string const &fname, GeoLib::PointVec &pnt_vec, std::vector< std::string > *errors=nullptr)
This class manages pointers to Points in a std::vector along with a name. It also handles the deletio...
std::map< std::string, std::size_t > NameIdMap
Reads and writes VtkXMLUnstructuredGrid-files (vtu) to and from OGS data structures....
bool writeToFile(std::filesystem::path const &file_path)
Definition of mesh to geometry conversion.
TCLAP::ValueArg< std::string > makeLogLevelArg()
void initOGSLogger(std::string const &log_level)
std::string extractBaseNameWithoutExtension(std::string const &pathname)
GITINFOLIB_EXPORT const std::string ogs_version