From b32d60056f3501c17e78b6b59b2863a92a288611 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Wed, 22 May 2019 18:04:24 +0200 Subject: [PATCH] [MeL] clang-format MeshInformation files. --- MeshLib/MeshInformation.cpp | 10 ++++----- MeshLib/MeshInformation.h | 42 ++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/MeshLib/MeshInformation.cpp b/MeshLib/MeshInformation.cpp index 57b1f31ec6b..e3b60aa2ba5 100644 --- a/MeshLib/MeshInformation.cpp +++ b/MeshLib/MeshInformation.cpp @@ -17,17 +17,17 @@ namespace MeshLib { - -const GeoLib::AABB MeshInformation::getBoundingBox(const MeshLib::Mesh &mesh) +const GeoLib::AABB MeshInformation::getBoundingBox(const MeshLib::Mesh& mesh) { - const std::vector<MeshLib::Node*> &nodes (mesh.getNodes()); + const std::vector<MeshLib::Node*>& nodes(mesh.getNodes()); return GeoLib::AABB(nodes.begin(), nodes.end()); } -const std::array<unsigned, 7> MeshInformation::getNumberOfElementTypes(const MeshLib::Mesh &mesh) +const std::array<unsigned, 7> MeshInformation::getNumberOfElementTypes( + const MeshLib::Mesh& mesh) { std::array<unsigned, 7> n_element_types = {{0, 0, 0, 0, 0, 0, 0}}; - const std::vector<MeshLib::Element*> &elements (mesh.getElements()); + const std::vector<MeshLib::Element*>& elements(mesh.getElements()); for (auto element : elements) { MeshElemType t = element->getGeomType(); diff --git a/MeshLib/MeshInformation.h b/MeshLib/MeshInformation.h index c59bb97a14b..da3101d9ddc 100644 --- a/MeshLib/MeshInformation.h +++ b/MeshLib/MeshInformation.h @@ -15,8 +15,8 @@ #pragma once #include <array> -#include <string> #include <limits> +#include <string> #include "GeoLib/AABB.h" #include "MeshLib/Mesh.h" @@ -25,49 +25,49 @@ namespace MeshLib { - /** * \brief A set of tools for extracting information from a mesh */ class MeshInformation { public: - /// Returns the smallest and largest value of a scalar array with the given name. - template<typename T> - static std::pair<T, T> const - getValueBounds(MeshLib::Mesh const& mesh, std::string const& name) + /// Returns the smallest and largest value of a scalar array with the given + /// name. + template <typename T> + static std::pair<T, T> const getValueBounds(MeshLib::Mesh const& mesh, + std::string const& name) { if (!mesh.getProperties().existsPropertyVector<T>(name)) - return {std::numeric_limits<T>::max(), std::numeric_limits<T>::max()}; + return {std::numeric_limits<T>::max(), + std::numeric_limits<T>::max()}; auto const* const data_vec = mesh.getProperties().getPropertyVector<T>(name); - if (data_vec->empty()) { + if (data_vec->empty()) + { INFO("Mesh does not contain values for the property '%s'.", name.c_str()); - return {std::numeric_limits<T>::max(), std::numeric_limits<T>::max()}; + return {std::numeric_limits<T>::max(), + std::numeric_limits<T>::max()}; } - auto vec_bounds = std::minmax_element(data_vec->cbegin(), data_vec->cend()); + auto vec_bounds = + std::minmax_element(data_vec->cbegin(), data_vec->cend()); return {*(vec_bounds.first), *(vec_bounds.second)}; } /// Returns the bounding box of the mesh. - static const GeoLib::AABB getBoundingBox(const MeshLib::Mesh &mesh); + static const GeoLib::AABB getBoundingBox(const MeshLib::Mesh& mesh); /** - * Returns an array with the number of elements of each type in the given mesh. - * On completion, n_element_types array contains the number of elements of each of the seven - * supported types. The index to element type conversion is this: - * 0: \#lines - * 1: \#triangles - * 2: \#quads - * 3: \#tetrahedra + * Returns an array with the number of elements of each type in the given + * mesh. On completion, n_element_types array contains the number of + * elements of each of the seven supported types. The index to element type + * conversion is this: 0: \#lines 1: \#triangles 2: \#quads 3: \#tetrahedra * 4: \#hexahedra * 5: \#pyramids * 6: \#prisms */ - static const std::array<unsigned, 7> getNumberOfElementTypes(const MeshLib::Mesh &mesh); - - + static const std::array<unsigned, 7> getNumberOfElementTypes( + const MeshLib::Mesh& mesh); }; } // namespace MeshLib -- GitLab