Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-active scalars to be modified in python operators #2061

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Check number of scalars in properties panel update
When live updates are performed on data that contains multiple
scalars, the number of scalars can change in between updates.

Add in a safety check in the DataPropertiesPanel to account for
this. This prevents a crash.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
  • Loading branch information
psavery committed Apr 9, 2020
commit 42c8ea0b433b010ad1b7132c9c14c001e98c0be3
6 changes: 5 additions & 1 deletion tomviz/DataPropertiesPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,15 @@ QList<ArrayInfo> DataPropertiesPanel::getArraysInfo(DataSource* dataSource)
{
QList<ArrayInfo> arraysInfo;

// If the number of scalar arrays has changed, reset the indexes.
auto scalars = dataSource->listScalars();
if (scalars.size() != m_scalarIndexes.size())
m_scalarIndexes.clear();

// If we don't have the scalar indexes, we sort the names and then save the
// indexes, these will be used to preserve the displayed order even after
// a rename.
if (m_scalarIndexes.isEmpty()) {
auto scalars = dataSource->listScalars();
auto sortedScalars = scalars;

// sort the scalars names
Expand Down