forked from commontk/CTK
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fixed ctkVTKDataSetArrayComboBox crashing and not updating
1. ctkVTKDataSetArrayComboBox caused application crash when it is used for a VTK data set that is generated by a pipeline and the combobox was used for setting active scalar. When a data set is changed due to a pipeline change, the data set is first reset and then recomputed. During reset the scalars are removed therefore the selection in the combobox is changed to item (-1), which triggers a data update. During update all the scalars are removed (again, so there is no change) but then the scalars are re-added when the data is recomputed. Qt combobox automatically selects the first item if an item is added, therefore the selection changes to the first active scalar. This change triggers a data set update, which starts with a reset. During reste the scalars are removed, therefore the selection in the combobox is changed to item (-1), which triggers a data update... This is an infinite loop, which causes application crash due to stack overflow. Solution was to add a NULL item (no active scalar). This is also useful because without a NULL item it is not possible to unselect scalars. For backward compatibility reasons, by default NULL item is not added (it is not needed if the combobox is not used for setting the active scalar). 2. ctkVTKDataSetArrayComboBox did not contain any arrays that were added after the data set and attribute types are added. vtkDataSet Modified event is not invoked if arrays are added/removed/renamed, only vtkDataSet.PointData and vtkDataset.CellData object Modified events are invoked. ctkVTKDataSetModel did not observe the point and cell data objects. Solution was to add observers to the point and cell data objects.
- Loading branch information
Showing
6 changed files
with
264 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.