From 6cd33ef0cb2926a4a34f86a9d5248ed35f13f464 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Wed, 27 Jul 2016 15:51:09 +0200 Subject: [PATCH] [MeL/ME] Use mesh internal property data structure. --- .../MeshEditing/Mesh2MeshPropertyInterpolation.cpp | 11 ++++------- MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h | 7 ++----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp index 0984a58a1a2..09f236b1daa 100644 --- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp +++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp @@ -31,11 +31,8 @@ namespace MeshLib { Mesh2MeshPropertyInterpolation::Mesh2MeshPropertyInterpolation( - Mesh const*const src_mesh, - std::string const& property_name, - std::vector<double> const*const src_properties) - : _src_mesh(src_mesh), _property_name(property_name), - _src_properties(src_properties) + Mesh const*const src_mesh, std::string const& property_name) + : _src_mesh(src_mesh), _property_name(property_name) {} bool Mesh2MeshPropertyInterpolation::setPropertiesForMesh(Mesh *dest_mesh, std::vector<double>& dest_properties) const @@ -156,7 +153,7 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(Mesh *dest_mes } void Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties( - std::vector<double> &interpolated_node_properties) const + std::vector<double> &interpolated_properties) const { auto materialIds = _src_mesh->getProperties().getPropertyVector<int>("MaterialIDs"); if (!materialIds) @@ -183,7 +180,7 @@ void Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodePropertie { interpolated_properties[k] += elem_props[(src_nodes[k]->getElement(j))->getID()]; } - interpolated_node_properties[k] /= n_con_elems; + interpolated_properties[k] /= n_con_elems; } } diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h index 63b6565386a..5abcc03df0e 100644 --- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h +++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h @@ -34,10 +34,8 @@ public: * @param property_name is the name of a PropertyVector in the \c * source_mesh */ - Mesh2MeshPropertyInterpolation( - Mesh const* const source_mesh, - std::string const& property_name, - std::vector<double> const* const source_properties); + Mesh2MeshPropertyInterpolation(Mesh const* const source_mesh, + std::string const& property_name); /** * Calculates entries for the property vector and sets appropriate indices in the @@ -66,7 +64,6 @@ private: Mesh const*const _src_mesh; std::string const& _property_name; - std::vector<double> const*const _src_properties; }; } // end namespace MeshLib -- GitLab