From beab7de7a2b75c446ca1e41555c2730d404d9e93 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Thu, 21 May 2015 14:46:21 +0200 Subject: [PATCH] [U] CheckMesh prints out available mesh properties --- Applications/Utils/MeshEdit/checkMesh.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Applications/Utils/MeshEdit/checkMesh.cpp b/Applications/Utils/MeshEdit/checkMesh.cpp index 0314bf8647b..d4b696e1b9e 100644 --- a/Applications/Utils/MeshEdit/checkMesh.cpp +++ b/Applications/Utils/MeshEdit/checkMesh.cpp @@ -42,6 +42,8 @@ int main(int argc, char *argv[]) cmd.add( mesh_arg ); TCLAP::SwitchArg valid_arg("v","validation","validate the mesh"); cmd.add( valid_arg ); + TCLAP::SwitchArg print_properties_arg("p","print_properties","print properties stored in the mesh"); + cmd.add( print_properties_arg ); cmd.parse( argc, argv ); @@ -87,6 +89,14 @@ int main(int argc, char *argv[]) const std::pair<unsigned, unsigned> minmax_values(MeshLib::MeshInformation::getValueBounds(*mesh)); INFO("Material IDs: [%d, %d]", minmax_values.first, minmax_values.second); + if (print_properties_arg.isSet()) { + MeshLib::Properties const& properties = mesh->getProperties(); + std::vector<std::string> const& names = properties.getPropertyVectorNames(); + INFO("There are %d properties in the mesh", names.size()); + for (std::size_t i = 0; i < names.size(); ++i) + INFO("\t%d: %s", i, names[i].c_str()); + } + if (valid_arg.isSet()) { // Validation MeshLib::MeshValidation validation(*const_cast<MeshLib::Mesh*>(mesh)); // MeshValidation outputs error messages -- GitLab