From ae6212cb8f910c121e3bc8f1d8064ba49fdb44ff Mon Sep 17 00:00:00 2001 From: davidboening Date: Fri, 21 Jul 2023 19:33:00 +0200 Subject: [PATCH] reflecting vcglib changes --- .../filter_geodesic/filter_geodesic.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index 5a73e102d..dd600f699 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -263,25 +263,26 @@ std::map FilterGeodesic::applyFilter(const QAction *filte if (seedVec.size() > 0){ // cache factorizations to reduce runtime on successive computations - std::pair cache; + std::pair::GeodesicHeatCache> cache; if (!vcg::tri::HasPerMeshAttribute(m.cm, "GeodesicHeatCache")){ - cb(10, "Building Cache: Computing Factorizations."); + cb(20, "Building Cache: Computing Factorizations..."); cache = std::make_pair(param_m, tri::GeodesicHeat::BuildCache(m.cm, param_m)); // save cache for next compute - auto GeodesicHeatCacheHandle = tri::Allocator::GetPerMeshAttribute>(m.cm, std::string("GeodesicHeatCache")); + auto GeodesicHeatCacheHandle = tri::Allocator::GetPerMeshAttribute::GeodesicHeatCache>>(m.cm, std::string("GeodesicHeatCache")); GeodesicHeatCacheHandle() = cache; } else { - cb(70, "Recovering Cache."); + cb(10, "Recovering Cache..."); // recover cache - auto GeodesicHeatCacheHandle = vcg::tri::Allocator::GetPerMeshAttribute>(m.cm, std::string("GeodesicHeatCache")); + auto GeodesicHeatCacheHandle = vcg::tri::Allocator::GetPerMeshAttribute::GeodesicHeatCache>>(m.cm, std::string("GeodesicHeatCache")); // if m has changed rebuild everything if (std::get<0>(GeodesicHeatCacheHandle()) != param_m){ + cb(20, "Parameter Changed: Rebuilding Factorizations..."); GeodesicHeatCacheHandle() = std::make_pair(param_m, tri::GeodesicHeat::BuildCache(m.cm, param_m)); } cache = GeodesicHeatCacheHandle(); } - cb(80, "Computing Geodesic Distance."); + cb(80, "Computing Geodesic Distance..."); if (tri::GeodesicHeat::ComputeFromCache(m.cm, seedVec, std::get<1>(cache))){ tri::UpdateColor::PerVertexQualityRamp(m.cm); @@ -289,8 +290,8 @@ std::map FilterGeodesic::applyFilter(const QAction *filte else{ log("Warning: heat method has failed. The mesh is most likely badly conditioned (e.g. angles ~ 0deg) or has disconnected components"); // delete cache as its most likely useless after failure - auto GeodesicHeatCacheHandle = vcg::tri::Allocator::GetPerMeshAttribute>(m.cm, std::string("GeodesicHeatCache")); - tri::Allocator::DeletePerMeshAttribute>(m.cm, GeodesicHeatCacheHandle); + auto GeodesicHeatCacheHandle = vcg::tri::Allocator::GetPerMeshAttribute::GeodesicHeatCache>>(m.cm, std::string("GeodesicHeatCache")); + tri::Allocator::DeletePerMeshAttribute::GeodesicHeatCache>>(m.cm, GeodesicHeatCacheHandle); } } else