Loading [MathJax]/extensions/tex2jax.js
OGS
MeshInformation.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <array>
18#include <limits>
19#include <map>
20#include <optional>
21#include <range/v3/algorithm/minmax.hpp>
22#include <string>
23
24#include "GeoLib/AABB.h"
25#include "MeshLib/Mesh.h"
26#include "MeshLib/Node.h"
27#include "MeshLib/Properties.h"
28
29namespace MeshToolsLib
30{
35{
36public:
39 template <typename T>
40 static std::optional<std::pair<T, T>> const getValueBounds(
41 MeshLib::PropertyVector<T> const& property)
42 {
43 if (property.empty())
44 {
45 INFO("Mesh property vector '{:s}' is empty.",
46 property.getPropertyName());
47 return std::nullopt;
48 }
49
50 auto [min, max] = ranges::minmax(property);
51 return {{min, max}};
52 }
53
55 static GeoLib::AABB getBoundingBox(const MeshLib::Mesh& mesh);
56
66 static std::map<MeshLib::MeshElemType, unsigned> getNumberOfElementTypes(
67 const MeshLib::Mesh& mesh);
68
70 static void writeAllNumbersOfElementTypes(const MeshLib::Mesh& mesh);
71
73 static void writePropertyVectorInformation(const MeshLib::Mesh& mesh);
74
78
80 static std::vector<int> getMaterialIDs(const MeshLib::Mesh& mesh);
81};
82
83} // namespace MeshToolsLib
Definition of the AABB class.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
Definition of the class Properties that implements a container of properties.
Definition of the Mesh class.
Definition of the Node class.
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
Definition AABB.h:56
std::string const & getPropertyName() const
A set of tools for extracting information from a mesh.
static GeoLib::AABB getBoundingBox(const MeshLib::Mesh &mesh)
Returns the bounding box of the mesh.
static void writeMeshValidationResults(MeshLib::Mesh &mesh)
static std::optional< std::pair< T, T > > const getValueBounds(MeshLib::PropertyVector< T > const &property)
static std::vector< int > getMaterialIDs(const MeshLib::Mesh &mesh)
writes out a list of all material IDs that occur in the mesh.
static void writeAllNumbersOfElementTypes(const MeshLib::Mesh &mesh)
writes all numbers of element types
static std::map< MeshLib::MeshElemType, unsigned > getNumberOfElementTypes(const MeshLib::Mesh &mesh)
static void writePropertyVectorInformation(const MeshLib::Mesh &mesh)
writes out property vector information