From a82b95de944efc58ded80bcdca467a915a149233 Mon Sep 17 00:00:00 2001 From: Nicholas Sharp Date: Mon, 13 Apr 2026 16:37:19 -0700 Subject: [PATCH] alias return type to workaround cuda error --- include/polyscope/scalar_quantity.h | 9 ++++++--- include/polyscope/scalar_quantity.ipp | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/polyscope/scalar_quantity.h b/include/polyscope/scalar_quantity.h index 5dc8d13c..037b20bd 100644 --- a/include/polyscope/scalar_quantity.h +++ b/include/polyscope/scalar_quantity.h @@ -11,6 +11,8 @@ #include "polyscope/scaled_value.h" #include "polyscope/standardize_data_array.h" +#include + namespace polyscope { // Encapsulates logic which is common to all scalar quantities @@ -50,10 +52,11 @@ class ScalarQuantity { std::string getColorMap(); // Data limits mapped in to colormap - QuantityT* setMapRange(std::pair val); - std::pair getMapRange(); + using ScalarRange = std::pair; + QuantityT* setMapRange(ScalarRange val); + ScalarRange getMapRange(); QuantityT* resetMapRange(); // reset to full range - std::pair getDataRange(); + ScalarRange getDataRange(); // Color bar options (it is always displayed inline in the structures panel) QuantityT* setOnscreenColorbarEnabled(bool newEnabled); diff --git a/include/polyscope/scalar_quantity.ipp b/include/polyscope/scalar_quantity.ipp index 1898a1cd..c286f740 100644 --- a/include/polyscope/scalar_quantity.ipp +++ b/include/polyscope/scalar_quantity.ipp @@ -354,7 +354,7 @@ glm::vec2 ScalarQuantity::getOnscreenColorbarLocation() { } template -QuantityT* ScalarQuantity::setMapRange(std::pair val) { +QuantityT* ScalarQuantity::setMapRange(ScalarRange val) { vizRangeMin = val.first; vizRangeMax = val.second; colorBar.colormapRange = std::pair(vizRangeMin.get(), vizRangeMax.get()); @@ -362,11 +362,11 @@ QuantityT* ScalarQuantity::setMapRange(std::pair val) return &quantity; } template -std::pair ScalarQuantity::getMapRange() { - return std::pair(vizRangeMin.get(), vizRangeMax.get()); +typename ScalarQuantity::ScalarRange ScalarQuantity::getMapRange() { + return ScalarRange(vizRangeMin.get(), vizRangeMax.get()); } template -std::pair ScalarQuantity::getDataRange() { +typename ScalarQuantity::ScalarRange ScalarQuantity::getDataRange() { return dataRange; }