Esempio n. 1
0
 def create_layout_stuff(self):
     """ create grid layouts into which plotter widgets are inserted """
     if self.layout_parent is None or not self.layout_created:
         self.layout_parent = Qt.QWidget(self.wparent())
         self.layout = Qt.QGridLayout(self.layout_parent)
         self.set_widgets(self.layout_parent,
                          self.dataitem.caption,
                          icon=self.icon())
         self.layout_created = True
     self._wtop = self.layout_parent
Esempio n. 2
0
    def plot_3D_array(self, display_flag_3D):
        # first figure out the actual rank of the array we are plotting
        self.actual_rank = 0
        self.array_shape = self.dataitem.data.shape
        self.array_rank = self.dataitem.data.ndim
        for i in range(len(self.array_shape)):
            if self.array_shape[i] > 1:
                self.actual_rank = self.actual_rank + 1
        if display_flag_3D and self.actual_rank > 2:
            self.set_ND_controls(None, None, num_axes=3)
            self.array_selector = None
        else:
            if not self.ND_Controls is None:
                self.ND_Controls.setParent(Qt.QWidget())
                self.ND_Controls = None
# pass initial array to the plotter
        if self.array_rank > 2:
            self.data = self.dataitem.data
            if self.array_selector is None:
                third_axis = None
                second_axis = None
                first_axis = None
                for i in range(self.array_rank - 1, -1, -1):
                    if self.data.shape[i] > 1:
                        if third_axis is None:
                            third_axis = i
                        elif second_axis is None:
                            second_axis = i
                        else:
                            if first_axis is None:
                                first_axis = i
                if not first_axis is None and not second_axis is None and not third_axis is None:
                    self.array_selector = plot_func.create_array_selector(
                        None, self.array_rank, self.data.shape, first_axis,
                        second_axis, third_axis)
            self.array_tuple = tuple(self.array_selector)
            plot_array = self.data[self.array_tuple]
        else:
            plot_array = self.data
        if plot_array.min() == plot_array.max():
            return
        else:
            self.ND_plotter.array_plot(plot_array, data_label='data ')

# enable & highlight the cell
        self.enable()
        self.flash_refresh()
Esempio n. 3
0
    def show_3D_Display(self, display_flag_3D):
        if not has_vtk:
            return
        self.twoD_plotter = delete_2D_Plotters(self.colorbar,
                                               self.twoD_plotter)
        self.status_label.setParent(Qt.QWidget())
        self.status_label = None

        if self.ND_plotter is None:
            self.ND_plotter = plot_func.create_ND_Plotter(
                self.layout, self.layout_parent)
            self.ND_plotter.show_2D_Display.connect(self.show_2D_Display)
            self.ND_plotter.show_ND_Controller.connect(
                self.ND_controller_showDisplay)
        else:
            self.ND_plotter.delete_vtk_renderer()
            self.ND_plotter.show_vtk_controls()


# create 3-D Controller
        self.plot_3D_array(display_flag_3D)