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 <string>
22 
23 #include "GeoLib/AABB.h"
24 #include "MeshLib/Mesh.h"
25 #include "MeshLib/Node.h"
26 #include "MeshLib/Properties.h"
27 
28 namespace MeshLib
29 {
34 {
35 public:
38  template <typename T>
39  static std::optional<std::pair<T, T>> const getValueBounds(
40  PropertyVector<T> const& property)
41  {
42  if (property.empty())
43  {
44  INFO("Mesh property vector '{:s}' is empty.",
45  property.getPropertyName());
46  return std::nullopt;
47  }
48 
49  auto const [min, max] =
50  std::minmax_element(begin(property), end(property));
51  return {{*min, *max}};
52  }
53 
55  static GeoLib::AABB getBoundingBox(const MeshLib::Mesh& mesh);
56 
66  static std::map<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 
77  static void writeMeshValidationResults(MeshLib::Mesh& mesh);
78 };
79 
80 } // namespace MeshLib
Definition of the AABB class.
void INFO(char const *fmt, Args const &... args)
Definition: Logging.h:32
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:49
A set of tools for extracting information from a mesh.
static std::map< MeshElemType, unsigned > getNumberOfElementTypes(const MeshLib::Mesh &mesh)
static std::optional< std::pair< T, T > > const getValueBounds(PropertyVector< T > const &property)
static void writePropertyVectorInformation(const MeshLib::Mesh &mesh)
writes out property vector information
static GeoLib::AABB getBoundingBox(const MeshLib::Mesh &mesh)
Returns the bounding box of the mesh.
static void writeMeshValidationResults(MeshLib::Mesh &mesh)
static void writeAllNumbersOfElementTypes(const MeshLib::Mesh &mesh)
writes all numbers of element types
std::string const & getPropertyName() const