def _enable_for_right_dimension(self): """Enable array plots only if all selected objects are 1d arrays.""" enabled = True for leaf in plotutils.getSelectedLeafs(): if not isinstance(leaf, tables.array.Array) or len(leaf.shape) != 1: enabled = False break for action in self._array_actions: action.setEnabled(enabled) enabled = True for leaf in plotutils.getSelectedLeafs(): if not isinstance(leaf, tables.array.Array) or len(leaf.shape) != 2: enabled = False break for action in self._surf_actions: action.setEnabled(enabled)
def _plot_1d_array(self, unused): """Display one plot with crosshair ad statistics.""" index = plugin_utils.getVTGui().dbs_tree_view.currentIndex() leafs = plotutils.getSelectedLeafs() for leaf in leafs: if leaf.dtype.kind in 'cSUV': self._logger.error( 'Can not plot type: {0}'.format(str(leaf.dtype))) return plot_window = singleplot.SinglePlot(parent=self._mdiarea, index=index, leafs=leafs) self._mdiarea.addSubWindow(plot_window) plot_window.show()
def _plot_1d_array_with_zoom(self, unused): """Display two plots: overall view and zoomed to region.""" index = plugin_utils.getVTGui().dbs_tree_view.currentIndex() leafs = plotutils.getSelectedLeafs() for leaf in leafs: if leaf.dtype.kind in 'cSUV': self._logger.error( 'Can not plot type: {0}'.format(str(leaf.dtype))) return plot_window = dualplot.DualPlot(parent=self._mdiarea, index=index, leafs=leafs) self._mdiarea.addSubWindow(plot_window) plot_window.show()