From f85e0ed3aba9836fdcaad8efa2cd674c2ca6092c Mon Sep 17 00:00:00 2001 From: Karsten Rink <karsten.rink@ufz.de> Date: Tue, 29 Oct 2013 12:44:20 +0100 Subject: [PATCH] changed getMatBounds() to getValueBounds(), changed copies of bounding box points to references --- Gui/DataView/ElementTreeModel.cpp | 6 +++--- MeshLib/MeshInformation.cpp | 2 +- MeshLib/MeshInformation.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gui/DataView/ElementTreeModel.cpp b/Gui/DataView/ElementTreeModel.cpp index b0868e8f79b..20294302293 100644 --- a/Gui/DataView/ElementTreeModel.cpp +++ b/Gui/DataView/ElementTreeModel.cpp @@ -141,8 +141,8 @@ void ElementTreeModel::setMesh(MeshLib::Mesh const*const mesh) _rootItem->appendChild(aabb_item); const GeoLib::AABB<MeshLib::Node> aabb (MeshInformation::getBoundingBox(mesh)); - const MeshLib::Node min = aabb.getMinPoint(); - const MeshLib::Node max = aabb.getMaxPoint(); + const MeshLib::Node& min = aabb.getMinPoint(); + const MeshLib::Node& max = aabb.getMaxPoint(); QList<QVariant> min_aabb; min_aabb << "Min:" << QString::number(min[0], 'f') << QString::number(min[1], 'f') << QString::number(min[2], 'f'); @@ -154,7 +154,7 @@ void ElementTreeModel::setMesh(MeshLib::Mesh const*const mesh) TreeItem* max_item = new TreeItem(max_aabb, aabb_item); aabb_item->appendChild(max_item); - std::pair<unsigned, unsigned> mat_bounds (MeshInformation::getMatBounds(mesh)); + std::pair<unsigned, unsigned> mat_bounds (MeshInformation::getValueBounds(mesh)); QList<QVariant> materials; materials << "MaterialIDs: " << "[" + QString::number(mat_bounds.first) << QString::number(mat_bounds.second) + "]" << ""; TreeItem* mat_item = new TreeItem(materials, _rootItem); diff --git a/MeshLib/MeshInformation.cpp b/MeshLib/MeshInformation.cpp index 4e47444d6c6..629d4b45920 100644 --- a/MeshLib/MeshInformation.cpp +++ b/MeshLib/MeshInformation.cpp @@ -17,7 +17,7 @@ #include "Elements/Element.h" -const std::pair<unsigned, unsigned> MeshInformation::getMatBounds(MeshLib::Mesh const*const mesh) +const std::pair<unsigned, unsigned> MeshInformation::getValueBounds(MeshLib::Mesh const*const mesh) { const std::vector<MeshLib::Element*> elements (mesh->getElements()); const auto minmax = std::minmax_element(elements.cbegin(), elements.cend(), diff --git a/MeshLib/MeshInformation.h b/MeshLib/MeshInformation.h index 688bcb67b5f..59785a831e1 100644 --- a/MeshLib/MeshInformation.h +++ b/MeshLib/MeshInformation.h @@ -31,7 +31,7 @@ class MeshInformation { public: /// Returns the smallest and largest MaterialID of the mesh. - static const std::pair<unsigned, unsigned> getMatBounds(MeshLib::Mesh const*const mesh); + static const std::pair<unsigned, unsigned> getValueBounds(MeshLib::Mesh const*const mesh); /// Returns the bounding box of the mesh. static const GeoLib::AABB<MeshLib::Node> getBoundingBox(MeshLib::Mesh const*const mesh); -- GitLab