OGS
|
A set of methods for manipulating mesh element values.
Definition at line 36 of file ElementValueModification.h.
#include <ElementValueModification.h>
Static Public Member Functions | |
static std::size_t | condense (MeshLib::Mesh &mesh) |
static bool | replace (MeshLib::Mesh &mesh, int const old_value, int const new_value, bool replace_if_exists=false) |
static bool | replace (MeshLib::Mesh &mesh, std::string const &property_name, int const old_value, int const new_value, bool replace_if_exists=false) |
static std::size_t | setByElementType (MeshLib::Mesh &mesh, MeshLib::MeshElemType ele_type, int const new_value) |
Static Private Member Functions | |
template<typename T > | |
static std::vector< T > | getSortedPropertyValues (MeshLib::PropertyVector< T > const &property_vector) |
|
static |
Reduces the values assigned the elements of mesh to the smallest possible range. Returns the number of different values.
Definition at line 81 of file ElementValueModification.cpp.
References MeshLib::Cell, ERR(), MeshLib::Mesh::getProperties(), MeshLib::Properties::getPropertyVector(), getSortedPropertyValues(), and MeshLib::PropertyVector< PROP_VAL_TYPE >::size().
Referenced by MeshValueEditDialog::accept(), main(), and FileIO::GMSH::readGMSHMesh().
|
inlinestaticprivate |
Returns sorted values of properties within the PropertyVector These values are stored in a vector.
Definition at line 63 of file ElementValueModification.h.
References MeshLib::PropertyVector< PROP_VAL_TYPE >::size().
Referenced by condense().
|
static |
Replaces for all elements of mesh with the value old_value with new_value if possible. Returns true if successful or false if the value is already taken.
Definition at line 73 of file ElementValueModification.cpp.
References replace().
Referenced by MeshValueEditDialog::accept(), main(), and replace().
|
static |
Definition at line 26 of file ElementValueModification.cpp.
References MeshLib::Cell, ERR(), MeshLib::PropertyVector< PROP_VAL_TYPE >::getNumberOfTuples(), MeshLib::Mesh::getProperties(), MeshLib::Properties::getPropertyVector(), and WARN().
|
static |
Sets new value for all elements having the given element type Returns the number of elements having the given element type
Definition at line 115 of file ElementValueModification.cpp.
References MeshLib::Cell, ERR(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getProperties(), and MeshLib::Properties::getPropertyVector().
Referenced by main().