Skip to content
Snippets Groups Projects
Commit b32d6005 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL] clang-format MeshInformation files.

parent 88c8a5fa
No related branches found
No related tags found
No related merge requests found
...@@ -17,17 +17,17 @@ ...@@ -17,17 +17,17 @@
namespace MeshLib 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()); 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}}; 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) for (auto element : elements)
{ {
MeshElemType t = element->getGeomType(); MeshElemType t = element->getGeomType();
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#pragma once #pragma once
#include <array> #include <array>
#include <string>
#include <limits> #include <limits>
#include <string>
#include "GeoLib/AABB.h" #include "GeoLib/AABB.h"
#include "MeshLib/Mesh.h" #include "MeshLib/Mesh.h"
...@@ -25,49 +25,49 @@ ...@@ -25,49 +25,49 @@
namespace MeshLib namespace MeshLib
{ {
/** /**
* \brief A set of tools for extracting information from a mesh * \brief A set of tools for extracting information from a mesh
*/ */
class MeshInformation class MeshInformation
{ {
public: public:
/// Returns the smallest and largest value of a scalar array with the given name. /// Returns the smallest and largest value of a scalar array with the given
template<typename T> /// name.
static std::pair<T, T> const template <typename T>
getValueBounds(MeshLib::Mesh const& mesh, std::string const& name) static std::pair<T, T> const getValueBounds(MeshLib::Mesh const& mesh,
std::string const& name)
{ {
if (!mesh.getProperties().existsPropertyVector<T>(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 = auto const* const data_vec =
mesh.getProperties().getPropertyVector<T>(name); mesh.getProperties().getPropertyVector<T>(name);
if (data_vec->empty()) { if (data_vec->empty())
{
INFO("Mesh does not contain values for the property '%s'.", INFO("Mesh does not contain values for the property '%s'.",
name.c_str()); 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)}; return {*(vec_bounds.first), *(vec_bounds.second)};
} }
/// Returns the bounding box of the mesh. /// 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. * Returns an array with the number of elements of each type in the given
* On completion, n_element_types array contains the number of elements of each of the seven * mesh. On completion, n_element_types array contains the number of
* supported types. The index to element type conversion is this: * elements of each of the seven supported types. The index to element type
* 0: \#lines * conversion is this: 0: \#lines 1: \#triangles 2: \#quads 3: \#tetrahedra
* 1: \#triangles
* 2: \#quads
* 3: \#tetrahedra
* 4: \#hexahedra * 4: \#hexahedra
* 5: \#pyramids * 5: \#pyramids
* 6: \#prisms * 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 } // namespace MeshLib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment