Yup, I can reproduce it. I've pushed a fix
(http://www.paraview.org/Bug/view.php?id=15367).

Attached is the patch against git/master.

On Mon, Mar 9, 2015 at 3:29 PM, Ondřej Čertík <[email protected]> wrote:
> Hi,
>
> I get a segfault with the git version
> f7aac037722d9d13b75d9fdb15a1053c0874c6c6. Here is a minimal set of
> steps to reproduce:
>
> $ wget -O mug.e
> https://github.com/idaholab/moose/blob/devel/examples/ex01_inputfile/mug.e?raw=true
> $ paraview mug.e
>
> Click "Apply"
> Click "View -> Multi-block Inspector"
> Right click the first line in the Multi-block Inspector (mug.e)
> Select "Unset Visibility"
>
> It will immediately segfault (just writes "Segmentation fault" into
> the terminal and ends, no other info is printed).
>
> This seems to happen with any ExodusII mesh that I tried (I just used
> some publicly available mesh so that you can reproduce it). Let me
> know if you can reproduce the problem.
>
> Ondrej
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: 
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
From 2f6570cd8d30d706023b86dce9ededa5dfba90d9 Mon Sep 17 00:00:00 2001
From: Utkarsh Ayachit <[email protected]>
Date: Tue, 10 Mar 2015 10:05:27 -0400
Subject: [PATCH] BUG #15367. Fixes segfault in pqMultiBlockInspectorPanel.

The issue was the code wasn't handling the "unset visbility" being
called on root node itself.

Also cleaned up logic to disable the "unset ..." items unless the
properties were indeed overridden.

Change-Id: I77660a78de5777098a48e4489766f149101d5029
---
 Qt/Components/pqMultiBlockInspectorPanel.cxx | 43 +++++++++++++++-------------
 1 file changed, 23 insertions(+), 20 deletions(-)

diff --git a/Qt/Components/pqMultiBlockInspectorPanel.cxx b/Qt/Components/pqMultiBlockInspectorPanel.cxx
index 02f1b50..4d9e013 100644
--- a/Qt/Components/pqMultiBlockInspectorPanel.cxx
+++ b/Qt/Components/pqMultiBlockInspectorPanel.cxx
@@ -920,6 +920,9 @@ void pqMultiBlockInspectorPanel::onCustomContextMenuRequested(
     return;
     }
 
+  bool hasOverriddenVisibilities = false;
+  bool hasOverridenColor = false;
+  bool hasOverriddenOpacity = false;
   int hiddenItemCount = 0;
   foreach(const QTreeWidgetItem *item, items)
     {
@@ -927,6 +930,12 @@ void pqMultiBlockInspectorPanel::onCustomContextMenuRequested(
       {
       hiddenItemCount++;
       }
+
+    unsigned int flat_index =
+      item->data(NAME_COLUMN, Qt::UserRole).value<unsigned int>();
+    hasOverriddenVisibilities = hasOverriddenVisibilities || this->BlockVisibilites.contains(flat_index);
+    hasOverridenColor = hasOverridenColor || this->BlockColors.contains(flat_index);
+    hasOverriddenOpacity = hasOverriddenOpacity || this->BlockOpacities.contains(flat_index);
     }
   int visibleItemCount = items.size() - hiddenItemCount;
 
@@ -935,38 +944,30 @@ void pqMultiBlockInspectorPanel::onCustomContextMenuRequested(
   QAction *hideAction = 0;
   if(visibleItemCount > 0)
     {
-    QString label;
-    if(visibleItemCount > 1)
-      {
-      label = QString("Hide %1 Blocks").arg(visibleItemCount);
-      }
-    else
-      {
-      label = "Hide Block";
-      }
+    QString label = (visibleItemCount > 1)?
+      QString("Hide %1 Blocks").arg(visibleItemCount) : QString("Hide Block");
     hideAction = menu.addAction(label);
     }
   QAction *showAction = 0;
   if(hiddenItemCount > 0)
     {
-    QString label;
-    if(hiddenItemCount > 1)
-      {
-      label = QString("Show %1 Blocks").arg(hiddenItemCount);
-      }
-    else
-      {
-      label = "Show Block";
-      }
+    QString label = (hiddenItemCount > 1)?
+      QString("Show %1 Blocks").arg(hiddenItemCount) : QString("Show Block");
     showAction = menu.addAction(label);
     }
+
   QAction *unsetVisibilityAction = menu.addAction("Unset Visibility");
+  unsetVisibilityAction->setEnabled(hasOverriddenVisibilities);
+
   menu.addSeparator();
   QAction *setColorAction = menu.addAction("Set Color...");
   QAction *unsetColorAction = menu.addAction("Unset Color");
+  unsetColorAction->setEnabled(hasOverridenColor);
+
   menu.addSeparator();
   QAction *setOpacityAction = menu.addAction("Set Opacity...");
   QAction *unsetOpacityAction = menu.addAction("Unset Opacity");
+  unsetOpacityAction->setEnabled(hasOverriddenOpacity);
 
   // show menu
   QAction *action = menu.exec(QCursor::pos());
@@ -1012,8 +1013,10 @@ void pqMultiBlockInspectorPanel::onCustomContextMenuRequested(
 
       this->clearBlockVisibility(flat_index);
       item->setData(
-        NAME_COLUMN, Qt::CheckStateRole, 
-        item->parent()->data(NAME_COLUMN, Qt::CheckStateRole));
+        NAME_COLUMN, Qt::CheckStateRole,
+        item->parent()?
+        item->parent()->data(NAME_COLUMN, Qt::CheckStateRole):
+        Qt::Checked);
       }
     }
   else if(action == setColorAction)
-- 
1.9.1

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to