Skip to content

Commit

Permalink
Fix #3525 (#3528)
Browse files Browse the repository at this point in the history
  • Loading branch information
StasJ authored Jan 30, 2024
1 parent cac713d commit 2e4b88f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
10 changes: 6 additions & 4 deletions apps/vaporgui/RendererList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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));
Expand All @@ -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"));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/vaporgui/RendererList.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions apps/vaporgui/RenderersPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ class RenderersPanel : public VContainer {
public:
RenderersPanel(VAPoR::ControlExec *ce);
void Update();

signals:
void ShowNewRendererModal();
};

0 comments on commit 2e4b88f

Please sign in to comment.