From a7d956880363e05cba24ed9f278224b11b56e8c0 Mon Sep 17 00:00:00 2001 From: StasJ Date: Thu, 25 Jan 2024 01:47:32 -0700 Subject: [PATCH] Fix #3525 --- apps/vaporgui/RendererList.cpp | 10 ++++++---- apps/vaporgui/RendererList.h | 2 +- apps/vaporgui/RenderersPanel.h | 3 --- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/vaporgui/RendererList.cpp b/apps/vaporgui/RendererList.cpp index 265142dae..34c7f1877 100644 --- a/apps/vaporgui/RendererList.cpp +++ b/apps/vaporgui/RendererList.cpp @@ -72,6 +72,7 @@ RendererList::RendererList(ControlExec *ce) : VContainer(_lw = new QListWidget), _rendererMetadata[rendererType] = { router->Supports2DVariables(), router->Supports3DVariables(), + router->SupportsParticleVariables(), router->GetDescription(), router->GetSmallIconImagePath(), router->GetIconImagePath() @@ -268,8 +269,9 @@ void RendererList::showContextMenu(const QPoint& localPos) for (const auto &dataset : datasets) { DataMgr *dm = _ce->GetDataStatus()->GetDataMgr(dataset); - bool has2D = !dm->GetDataVarNames(2).empty(); - bool has3D = !dm->GetDataVarNames(3).empty(); + bool has2D = dm->GetDataVarNames(2, DataMgr::VarType::Scalar).size(); + bool has3D = dm->GetDataVarNames(3, DataMgr::VarType::Scalar).size(); + bool hasParticle = dm->GetDataVarNames(3, DataMgr::VarType::Particle).size(); QMenu *datasetMenu = newRendererMenu; if (datasets.size() > 1) datasetMenu = newRendererMenu->addMenu(QString::fromStdString(dataset)); @@ -278,9 +280,9 @@ void RendererList::showContextMenu(const QPoint& localPos) _ce->ActivateRender(currentViz, dataset, rendererType, _ce->MakeRendererNameUnique(rendererType), false); }); const auto &meta = _rendererMetadata[rendererType]; - if (!(meta.supports2D && has2D) && !(meta.supports3D && has3D)) { + if (!((has2D && meta.supports2D) || (has3D && meta.supports3D) || (hasParticle && meta.supportsParticle))) { action->setEnabled(false); - action->setToolTip("This dataset has no 2D/3D variables"); + action->setToolTip(QString::fromStdString("Dataset \"" + dataset + "\" does not have data supported by this renderer")); } } } diff --git a/apps/vaporgui/RendererList.h b/apps/vaporgui/RendererList.h index 3d775597d..950689694 100644 --- a/apps/vaporgui/RendererList.h +++ b/apps/vaporgui/RendererList.h @@ -22,7 +22,7 @@ class RendererList : public VContainer { NewRendererDialogManager *_nrd; struct RendererMetadata { - bool supports2D, supports3D; + bool supports2D, supports3D, supportsParticle; string description; string iconPath; string imagePath; diff --git a/apps/vaporgui/RenderersPanel.h b/apps/vaporgui/RenderersPanel.h index ae3a999d5..f5fb76db6 100644 --- a/apps/vaporgui/RenderersPanel.h +++ b/apps/vaporgui/RenderersPanel.h @@ -23,7 +23,4 @@ class RenderersPanel : public VContainer { public: RenderersPanel(VAPoR::ControlExec *ce); void Update(); - -signals: - void ShowNewRendererModal(); }; \ No newline at end of file