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 More... | |
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. More... | |
std::size_t | searchByContent (double eps=std::numeric_limits< double >::epsilon()) |
Marks all elements with a volume smaller than eps. More... | |
std::size_t | searchByBoundingBox (GeoLib::AABB const &aabb) |
Marks all elements with at least one node outside the bounding box spanned by x1 and x2;. More... | |
std::size_t | searchByNodeIDs (const std::vector< std::size_t > &nodes) |
Marks all elements connecting to any of the given nodes. More... | |
Private Member Functions | |
void | updateUnion (const std::vector< std::size_t > &vec) |
Updates the vector of marked elements with values from vec. More... | |
Private Attributes | |
const MeshLib::Mesh & | _mesh |
The mesh from which elements should be removed. More... | |
std::vector< std::size_t > | _marked_elements |
The vector of element indices that should be removed. More... | |
|
explicit |
Definition at line 19 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(), MeshLib::RasterToMesh::convert(), LayeredVolume::createRasterLayers(), main(), MeshLib::removeNodes(), and removeUnusedGridCells().
std::size_t MeshLib::ElementSearch::searchByBoundingBox | ( | GeoLib::AABB const & | aabb | ) |
Marks all elements with at least one node outside the bounding box spanned by x1 and x2;.
Definition at line 55 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 46 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 37 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 76 of file ElementSearch.cpp.
References MeshLib::Element::getID(), and BaseLib::makeVectorUnique().
Referenced by MeshGeoToolsLib::BoundaryElementsAlongPolyline::BoundaryElementsAlongPolyline(), MeshGeoToolsLib::BoundaryElementsOnSurface::BoundaryElementsOnSurface(), and MeshLib::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 MeshLib::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(), removeUnusedGridCells(), and searchByPropertyRange().
|
private |
Updates the vector of marked elements with values from vec.
Definition at line 94 of file ElementSearch.cpp.
Referenced by searchByContent(), searchByElementType(), and searchByPropertyValueRange().
|
private |
The vector of element indices that should be removed.
Definition at line 138 of file ElementSearch.h.
Referenced by getSearchedElementIDs().
|
private |
The mesh from which elements should be removed.
Definition at line 136 of file ElementSearch.h.
Referenced by searchByBoundingBox(), searchByContent(), searchByElementType(), and searchByPropertyValueRange().