OGS
|
Element search class.
Definition at line 27 of file ElementSearch.h.
#include <ElementSearch.h>
Public Member Functions | |
ElementSearch (const MeshLib::Mesh &mesh) | |
const std::vector< std::size_t > & | getSearchedElementIDs () const |
return marked elements | |
template<typename PROPERTY_TYPE > | |
std::size_t | searchByPropertyValue (std::string const &property_name, PROPERTY_TYPE const property_value) |
template<typename PROPERTY_TYPE > | |
std::size_t | searchByPropertyValueRange (std::string const &property_name, PROPERTY_TYPE const min_property_value, PROPERTY_TYPE const max_property_value, bool outside_of) |
std::size_t | searchByElementType (MeshElemType eleType) |
Marks all elements of the given element type. | |
std::size_t | searchByContent (double eps=std::numeric_limits< double >::epsilon()) |
Marks all elements with a volume smaller than eps. | |
std::size_t | searchByBoundingBox (GeoLib::AABB const &aabb, bool const invert=false) |
std::size_t | searchByNodeIDs (const std::vector< std::size_t > &nodes) |
Marks all elements connecting to any of the given nodes. | |
Private Member Functions | |
void | updateUnion (const std::vector< std::size_t > &vec) |
Updates the vector of marked elements with values from vec. | |
Private Attributes | |
const MeshLib::Mesh & | _mesh |
The mesh from which elements should be removed. | |
std::vector< std::size_t > | _marked_elements |
The vector of element indices that should be removed. | |
|
explicit |
Definition at line 24 of file ElementSearch.cpp.
|
inline |
return marked elements
Definition at line 33 of file ElementSearch.h.
References _marked_elements.
Referenced by MeshGeoToolsLib::BoundaryElementsAlongPolyline::BoundaryElementsAlongPolyline(), MeshGeoToolsLib::BoundaryElementsOnSurface::BoundaryElementsOnSurface(), MeshElementRemovalDialog::accept(), MeshToolsLib::RasterToMesh::convert(), LayeredVolume::createRasterLayers(), main(), MeshToolsLib::removeNodes(), and MeshToolsLib::MeshGenerator::VoxelGridFromMesh::removeUnusedGridCells().
std::size_t MeshLib::ElementSearch::searchByBoundingBox | ( | GeoLib::AABB const & | aabb, |
bool const | invert = false ) |
Marks all elements with at least one node outside the bounding box AABB. If the invert-flag is set, all elements with at least one node inside AABB are marked instead.
Definition at line 52 of file ElementSearch.cpp.
References _mesh, MeshLib::filter(), and MeshLib::Mesh::getElements().
Referenced by MeshElementRemovalDialog::accept(), and main().
std::size_t MeshLib::ElementSearch::searchByContent | ( | double | eps = std::numeric_limits<double>::epsilon() | ) |
Marks all elements with a volume smaller than eps.
Definition at line 42 of file ElementSearch.cpp.
References _mesh, MeshLib::filter(), MeshLib::Mesh::getElements(), and updateUnion().
Referenced by MeshElementRemovalDialog::accept(), and main().
std::size_t MeshLib::ElementSearch::searchByElementType | ( | MeshElemType | eleType | ) |
Marks all elements of the given element type.
Definition at line 33 of file ElementSearch.cpp.
References _mesh, MeshLib::filter(), MeshLib::Mesh::getElements(), and updateUnion().
Referenced by MeshElementRemovalDialog::accept(), LayeredVolume::createRasterLayers(), and main().
std::size_t MeshLib::ElementSearch::searchByNodeIDs | ( | const std::vector< std::size_t > & | nodes | ) |
Marks all elements connecting to any of the given nodes.
Definition at line 70 of file ElementSearch.cpp.
References MeshLib::Element::getID(), and BaseLib::makeVectorUnique().
Referenced by MeshGeoToolsLib::BoundaryElementsAlongPolyline::BoundaryElementsAlongPolyline(), MeshGeoToolsLib::BoundaryElementsOnSurface::BoundaryElementsOnSurface(), and MeshToolsLib::removeNodes().
|
inline |
PROPERTY_TYPE | type of the property Different properties can be assigned to the elements of the mesh. These properties can be accessed by the name of the property. The method marks all elements of the mesh for the property property_name with a property value equal to property_value . |
property_name | the name of the property the searching/marking is based on |
property_value | value required for the element to be marked |
Definition at line 46 of file ElementSearch.h.
Referenced by MeshToolsLib::RasterToMesh::convert(), and searchByPropertyValue().
|
inline |
PROPERTY_TYPE | type of the property Different properties can be assigned to the elements of the mesh. These properties can be accessed by the name of the property. The method marks all elements of the mesh for the property property_name with a property value outside of the interval [min_property_value, max_property_value]. |
property_name | the name of the property the searching/marking is based on |
min_property_value | minimum value of the given property for the element not to be marked |
max_property_value | maximum value of the given property for the element not to be marked |
outside_of | if true, all values outside of the given range are marked, if false, all values inside the given range are marked |
Definition at line 70 of file ElementSearch.h.
References _mesh, MeshLib::Cell, ERR(), MeshLib::PropertyVector< PROP_VAL_TYPE >::getNumberOfTuples(), MeshLib::Mesh::getProperties(), MeshLib::Properties::getPropertyVector(), updateUnion(), and WARN().
Referenced by MeshElementRemovalDialog::accept(), MeshToolsLib::MeshGenerator::VoxelGridFromMesh::removeUnusedGridCells(), and searchByPropertyRange().
|
private |
Updates the vector of marked elements with values from vec.
Definition at line 88 of file ElementSearch.cpp.
Referenced by searchByContent(), searchByElementType(), and searchByPropertyValueRange().
|
private |
The vector of element indices that should be removed.
Definition at line 141 of file ElementSearch.h.
Referenced by getSearchedElementIDs().
|
private |
The mesh from which elements should be removed.
Definition at line 139 of file ElementSearch.h.
Referenced by searchByBoundingBox(), searchByContent(), searchByElementType(), and searchByPropertyValueRange().