Skip to content

Commit

Permalink
Use same active scalars as parent if possible
Browse files Browse the repository at this point in the history
For the internal pipeline, try to set the child data sources'
active scalars to match that of the parent if possible. This
prevents the active scalars changing due to operations that
produce child data sources.

Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
psavery committed Mar 7, 2020
1 parent a507458 commit 6018bca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tomviz/operators/OperatorPython.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,11 @@ void OperatorPython::updateChildDataSource(vtkSmartPointer<vtkDataObject> data)
if (dataSource->hasTiltAngles())
dataSource->setType(DataSource::TiltSeries);

// Keep the same active scalars that the parent had if possible
QString prevActiveScalars = this->dataSource()->activeScalars();
if (dataSource->listScalars().contains(prevActiveScalars))
dataSource->setActiveScalars(prevActiveScalars);

emit dataSource->dataChanged();
emit dataSource->dataPropertiesChanged();
ActiveObjects::instance().renderAllViews();
Expand Down

0 comments on commit 6018bca

Please sign in to comment.