Beispiel #1
0
    def __init__(self, layer, parent=None):

        super(ScatterLayerStyleEditor, self).__init__(parent=parent)

        self.ui = load_ui('layer_style_editor.ui',
                          self,
                          directory=os.path.dirname(__file__))

        connect_kwargs = {
            'alpha': dict(value_range=(0, 1)),
            'size_scaling': dict(value_range=(0.1, 10), log=True),
            'density_contrast': dict(value_range=(0, 1)),
            'vector_scaling': dict(value_range=(0.1, 10), log=True)
        }
        autoconnect_callbacks_to_qt(layer.state, self.ui, connect_kwargs)

        connect_value(layer.state.viewer_state,
                      'dpi',
                      self.ui.value_dpi,
                      value_range=(12, 144),
                      log=True)

        fix_tab_widget_fontsize(self.ui.tab_widget)

        self.layer_state = layer.state

        self.layer_state.add_callback('markers_visible',
                                      self._update_markers_visible)
        self.layer_state.add_callback('line_visible',
                                      self._update_line_visible)
        self.layer_state.add_callback('xerr_visible',
                                      self._update_xerr_visible)
        self.layer_state.add_callback('yerr_visible',
                                      self._update_yerr_visible)
        self.layer_state.add_callback('vector_visible',
                                      self._update_vectors_visible)

        self.layer_state.add_callback('cmap_mode', self._update_cmap_mode)
        self.layer_state.add_callback('size_mode', self._update_size_mode)
        self.layer_state.add_callback('vector_mode', self._update_vector_mode)

        self.layer_state.add_callback('density_map', self._update_size_mode)
        self.layer_state.add_callback('density_map', self._update_warnings)

        self.layer_state.add_callback('layer', self._update_warnings)

        self._update_markers_visible()
        self._update_line_visible()
        self._update_xerr_visible()
        self._update_yerr_visible()
        self._update_vectors_visible()

        self._update_size_mode()
        self._update_vector_mode()
        self._update_cmap_mode()

        self._update_warnings()
Beispiel #2
0
    def __init__(self, layer, parent=None):

        super(ScatterLayerStyleEditor, self).__init__(parent=parent)

        self.ui = load_ui('layer_style_editor.ui', self,
                          directory=os.path.dirname(__file__))

        connect_kwargs = {'alpha': dict(value_range=(0, 1)),
                          'size_scaling': dict(value_range=(0.1, 10), log=True),
                          'density_contrast': dict(value_range=(0, 1)),
                          'vector_scaling': dict(value_range=(0.1, 10), log=True)}
        autoconnect_callbacks_to_qt(layer.state, self.ui, connect_kwargs)

        connect_value(layer.state.viewer_state, 'dpi', self.ui.value_dpi,
                      value_range=(12, 144), log=True)

        fix_tab_widget_fontsize(self.ui.tab_widget)

        self.layer_state = layer.state

        self.layer_state.add_callback('markers_visible', self._update_markers_visible)
        self.layer_state.add_callback('line_visible', self._update_line_visible)
        self.layer_state.add_callback('xerr_visible', self._update_xerr_visible)
        self.layer_state.add_callback('yerr_visible', self._update_yerr_visible)
        self.layer_state.add_callback('vector_visible', self._update_vectors_visible)

        self.layer_state.add_callback('cmap_mode', self._update_cmap_mode)
        self.layer_state.add_callback('size_mode', self._update_size_mode)
        self.layer_state.add_callback('vector_mode', self._update_vector_mode)

        self.layer_state.add_callback('density_map', self._update_size_mode)
        self.layer_state.add_callback('density_map', self._update_warnings)

        self.layer_state.add_callback('layer', self._update_warnings)

        self._update_markers_visible()
        self._update_line_visible()
        self._update_xerr_visible()
        self._update_yerr_visible()
        self._update_vectors_visible()

        self._update_size_mode()
        self._update_vector_mode()
        self._update_cmap_mode()

        self._update_warnings()