Skip to content
Snippets Groups Projects
Commit e0b2d68c authored by Karsten Rink's avatar Karsten Rink
Browse files

renamed element removal class to ElementExtraction

parent a8ad8918
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
#include "Elements/Hex.h"
#include "Elements/Pyramid.h"
#include "Elements/Prism.h"
#include "MeshEditing/removeMeshNodes.h"
#include "MeshSurfaceExtraction.h"
#include "MathTools.h"
......@@ -219,7 +220,7 @@ int MshLayerMapper::LayerMapping(MeshLib::Mesh* new_mesh, const std::string &ras
if (noData_nodes.size() < (nNodes - 2))
{
WARN("MshLayerMapper::LayerMapping(): Removing %d mesh nodes at NoData values.", noData_nodes.size());
MeshLib::Mesh* red_mesh = MeshLib::removeMeshNodes(new_mesh, noData_nodes);
MeshLib::Mesh* red_mesh = MeshLib::removeMeshNodes(*new_mesh, noData_nodes);
if (new_mesh->getNElements() == 0)
{
delete new_mesh;
......
......@@ -2,7 +2,7 @@
* \file
* \author Karsten Rink
* \date 2013-04-04
* \brief Implementation of removeMeshEntities.
* \brief Implementation of ElementExtraction.
*
* \copyright
* Copyright (c) 2013, OpenGeoSys Community (http://www.opengeosys.org)
......@@ -12,7 +12,7 @@
*
*/
#include "removeMeshEntities.h"
#include "ElementExtraction.h"
#include "Mesh.h"
#include "Elements/Element.h"
#include "AABB.h"
......@@ -21,16 +21,16 @@
namespace MeshLib {
MeshElementRemoval::MeshElementRemoval(const MeshLib::Mesh &mesh)
ElementExtraction::ElementExtraction(const MeshLib::Mesh &mesh)
: _mesh(mesh)
{
}
MeshElementRemoval::~MeshElementRemoval()
ElementExtraction::~ElementExtraction()
{
}
MeshLib::Mesh* MeshElementRemoval::removeMeshElements() const
MeshLib::Mesh* ElementExtraction::removeMeshElements() const
{
INFO("Removing total %d elements...", _marked_elements.size());
std::vector<MeshLib::Element*> tmp_elems = excludeElements(_mesh.getElements(), _marked_elements);
......@@ -43,7 +43,7 @@ MeshLib::Mesh* MeshElementRemoval::removeMeshElements() const
return new MeshLib::Mesh(_mesh.getName(), new_nodes, new_elems);
}
void MeshElementRemoval::searchByMaterialID(const std::vector<MeshLib::Element*> & ele_vec, unsigned matID)
void ElementExtraction::searchByMaterialID(const std::vector<MeshLib::Element*> & ele_vec, unsigned matID)
{
std::vector<std::size_t> matchedIDs;
std::size_t i = 0;
......@@ -55,7 +55,7 @@ void MeshElementRemoval::searchByMaterialID(const std::vector<MeshLib::Element*>
this->updateUnion(matchedIDs);
}
void MeshElementRemoval::searchByElementType(const std::vector<MeshLib::Element*> & ele_vec, MeshElemType eleType)
void ElementExtraction::searchByElementType(const std::vector<MeshLib::Element*> & ele_vec, MeshElemType eleType)
{
std::vector<std::size_t> matchedIDs;
std::size_t i = 0;
......@@ -67,7 +67,7 @@ void MeshElementRemoval::searchByElementType(const std::vector<MeshLib::Element*
this->updateUnion(matchedIDs);
}
void MeshElementRemoval::searchByZeroContent(const std::vector<MeshLib::Element*> & ele_vec)
void ElementExtraction::searchByZeroContent(const std::vector<MeshLib::Element*> & ele_vec)
{
std::vector<std::size_t> matchedIDs;
std::size_t i = 0;
......@@ -79,7 +79,7 @@ void MeshElementRemoval::searchByZeroContent(const std::vector<MeshLib::Element*
this->updateUnion(matchedIDs);
}
void MeshElementRemoval::searchByBoundingBox(const std::vector<MeshLib::Element*> & ele_vec, const MeshLib::Node &x1, const MeshLib::Node &x2)
void ElementExtraction::searchByBoundingBox(const std::vector<MeshLib::Element*> & ele_vec, const MeshLib::Node &x1, const MeshLib::Node &x2)
{
std::vector<MeshLib::Node> extent;
extent.push_back(x1); extent.push_back(x2);
......@@ -101,7 +101,7 @@ void MeshElementRemoval::searchByBoundingBox(const std::vector<MeshLib::Element*
this->updateUnion(matchedIDs);
}
void MeshElementRemoval::updateUnion(const std::vector<std::size_t> &vec)
void ElementExtraction::updateUnion(const std::vector<std::size_t> &vec)
{
std::vector<std::size_t> vec_temp(vec.size() + _marked_elements.size());
auto it = std::set_union(vec.begin(), vec.end(), _marked_elements.begin(), _marked_elements.end(), vec_temp.begin());
......@@ -109,7 +109,7 @@ void MeshElementRemoval::updateUnion(const std::vector<std::size_t> &vec)
_marked_elements.assign(vec_temp.begin(), vec_temp.end());
}
std::vector<MeshLib::Element*> MeshElementRemoval::excludeElements(const std::vector<MeshLib::Element*> & vec_src_eles, const std::vector<std::size_t> &vec_removed) const
std::vector<MeshLib::Element*> ElementExtraction::excludeElements(const std::vector<MeshLib::Element*> & vec_src_eles, const std::vector<std::size_t> &vec_removed) const
{
std::vector<MeshLib::Element*> vec_dest_eles(vec_src_eles.size() - vec_removed.size());
std::size_t k=0;
......@@ -122,7 +122,7 @@ std::vector<MeshLib::Element*> MeshElementRemoval::excludeElements(const std::ve
return vec_dest_eles;
}
void MeshElementRemoval::copyNodesElements( const std::vector<MeshLib::Node*> &src_nodes, const std::vector<MeshLib::Element*> &src_elems,
void ElementExtraction::copyNodesElements( const std::vector<MeshLib::Node*> &src_nodes, const std::vector<MeshLib::Element*> &src_elems,
std::vector<MeshLib::Node*> &dst_nodes, std::vector<MeshLib::Element*> &dst_elems) const
{
// copy nodes
......
......@@ -2,7 +2,7 @@
* \file
* \author Karsten Rink
* \date 2013-04-04
* \brief Definition of the removeMeshEntities
* \brief Definition of the ElementExtraction
*
* \copyright
* Copyright (c) 2013, OpenGeoSys Community (http://www.opengeosys.org)
......@@ -12,8 +12,8 @@
*
*/
#ifndef REMOVEMESHENTITIES_H
#define REMOVEMESHENTITIES_H
#ifndef ELEMENTEXTRACTION_H
#define ELEMENTEXTRACTION_H
#include <vector>
#include "MeshEnums.h"
......@@ -25,12 +25,12 @@ namespace MeshLib {
class Mesh;
class Element;
class MeshElementRemoval
class ElementExtraction
{
public:
MeshElementRemoval::MeshElementRemoval(const MeshLib::Mesh &mesh);
ElementExtraction(const MeshLib::Mesh &mesh);
MeshElementRemoval::~MeshElementRemoval();
~ElementExtraction();
/// Removes all mesh elements marked by search-methods.
MeshLib::Mesh* removeMeshElements() const;
......@@ -65,4 +65,4 @@ private:
} // end namespace MeshLib
#endif //REMOVEMESHENTITIES_H
#endif //ELEMENTEXTRACTION_H
......@@ -22,7 +22,7 @@
#include "PointWithID.h"
#include "Mesh.h"
#include "MeshEditing/removeMeshEntities.h"
#include "MeshEditing/removeMeshNodes.h"
#include "MeshSurfaceExtraction.h"
#ifdef OGS_BUILD_GUI
#include "../Gui/DataView/MshLayerMapper.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment