diff options
author | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
commit | a763e5d1b3921b3194f3d4e94ab9de3fbe08bbdd (patch) | |
tree | 45d462ed36a5522e9f3b9fde6c4ec4918c2ae8e3 /silx/gui/plot3d/items/mixins.py | |
parent | cebdc9244c019224846cb8d2668080fe386a6adc (diff) |
New upstream version 0.10.1+dfsg
Diffstat (limited to 'silx/gui/plot3d/items/mixins.py')
-rw-r--r-- | silx/gui/plot3d/items/mixins.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/silx/gui/plot3d/items/mixins.py b/silx/gui/plot3d/items/mixins.py index 8e96441..40b8438 100644 --- a/silx/gui/plot3d/items/mixins.py +++ b/silx/gui/plot3d/items/mixins.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2017-2018 European Synchrotron Radiation Facility +# Copyright (c) 2017-2019 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -114,19 +114,17 @@ class ColormapMixIn(_ColormapMixIn): self.__sceneColormap = sceneColormap self._syncSceneColormap() - self.sigItemChanged.connect(self.__colormapUpdated) - - def __colormapUpdated(self, event): + def _colormapChanged(self): """Handle colormap updates""" - if event == ItemChangedType.COLORMAP: - self._syncSceneColormap() + self._syncSceneColormap() + super(ColormapMixIn, self)._colormapChanged() def _setRangeFromData(self, data=None): """Compute the data range the colormap should use from provided data. :param data: Data set from which to compute the range or None """ - if data is None or len(data) == 0: + if data is None or data.size == 0: dataRange = None else: dataRange = min_max(data, min_positive=True, finite=True) @@ -144,6 +142,13 @@ class ColormapMixIn(_ColormapMixIn): if self.getColormap().isAutoscale(): self._syncSceneColormap() + def _getDataRange(self): + """Returns the data range as used in the scene for colormap + + :rtype: Union[List[float],None] + """ + return self._dataRange + def _setSceneColormap(self, sceneColormap): """Set the scene colormap to sync with Colormap object. @@ -171,8 +176,6 @@ class ColormapMixIn(_ColormapMixIn): class SymbolMixIn(_SymbolMixIn): """Mix-in class for symbol and symbolSize properties for Item3D""" - _DEFAULT_SYMBOL = 'o' - _DEFAULT_SYMBOL_SIZE = 7.0 _SUPPORTED_SYMBOLS = collections.OrderedDict(( ('o', 'Circle'), ('d', 'Diamond'), |