Example #1
0
    def _create_view_frame(self):
        """This will create the self._view_frame for this module.

        objectDict is a dictionary with VTK object descriptions as keys and
        the actual corresponding instances as values.  If you specify
        objectDict as none, the introspection controls won't get added.
        """

        parent_window = self._module_manager.get_module_view_parent_window()

        viewFrame = wx.Frame(parent_window, -1,
                             module_utils.create_module_view_frame_title(self))
        viewFrame.viewFramePanel = wx.Panel(viewFrame, -1)

        viewFramePanelSizer = wx.BoxSizer(wx.VERTICAL)
        # make sure there's a 7px border at the top
        # FIXME: changed 10, 7 to tuple for wxPython 2.6
        viewFramePanelSizer.Add((10, 7), 0, wx.EXPAND)
        viewFrame.viewFramePanel.SetAutoLayout(True)
        viewFrame.viewFramePanel.SetSizer(viewFramePanelSizer)

        viewFrameSizer = wx.BoxSizer(wx.VERTICAL)
        viewFrameSizer.Add(viewFrame.viewFramePanel, 1, wx.EXPAND, 0)
        viewFrame.SetAutoLayout(True)
        viewFrame.SetSizer(viewFrameSizer)

        if self._object_dict != None:
            module_utils.create_standard_object_introspection(
                self, viewFrame, viewFrame.viewFramePanel, self._object_dict,
                None)

        module_utils.create_eoca_buttons(self, viewFrame,
                                         viewFrame.viewFramePanel)

        # make sure that a close of that window does the right thing
        wx.EVT_CLOSE(viewFrame, lambda e: viewFrame.Show(False))

        # set cute icon
        viewFrame.SetIcon(module_utils.get_module_icon())

        # follow ModuleBase convention to indicate that view is
        # available
        self.view_initialised = True

        self._view_frame = viewFrame
        return viewFrame
Example #2
0
    def _create_view_frame(self):

        """This will create the self._view_frame for this module.

        objectDict is a dictionary with VTK object descriptions as keys and
        the actual corresponding instances as values.  If you specify
        objectDict as none, the introspection controls won't get added.
        """

        parent_window = self._module_manager.get_module_view_parent_window()

        viewFrame = wx.Frame(parent_window, -1, module_utils.create_module_view_frame_title(self))
        viewFrame.viewFramePanel = wx.Panel(viewFrame, -1)

        viewFramePanelSizer = wx.BoxSizer(wx.VERTICAL)
        # make sure there's a 7px border at the top
        # FIXME: changed 10, 7 to tuple for wxPython 2.6
        viewFramePanelSizer.Add((10, 7), 0, wx.EXPAND)
        viewFrame.viewFramePanel.SetAutoLayout(True)
        viewFrame.viewFramePanel.SetSizer(viewFramePanelSizer)

        viewFrameSizer = wx.BoxSizer(wx.VERTICAL)
        viewFrameSizer.Add(viewFrame.viewFramePanel, 1, wx.EXPAND, 0)
        viewFrame.SetAutoLayout(True)
        viewFrame.SetSizer(viewFrameSizer)

        if self._object_dict != None:
            module_utils.create_standard_object_introspection(
                self, viewFrame, viewFrame.viewFramePanel, self._object_dict, None
            )

        module_utils.create_eoca_buttons(self, viewFrame, viewFrame.viewFramePanel)

        # make sure that a close of that window does the right thing
        wx.EVT_CLOSE(viewFrame, lambda e: viewFrame.Show(False))

        # set cute icon
        viewFrame.SetIcon(module_utils.get_module_icon())

        # follow ModuleBase convention to indicate that view is
        # available
        self.view_initialised = True

        self._view_frame = viewFrame
        return viewFrame
Example #3
0
    def createOrthoView(self):
        """Create an accompanying orthographic view of the sliceDirection
        encapsulated by this object.
        """

        # there can be only one orthoPipeline
        if not self._orthoPipeline:

            import modules.resources.python.slice3dVWRFrames
            # import our wxGlade-generated frame
            ovf = modules.resources.python.slice3dVWRFrames.orthoViewFrame
            self._orthoViewFrame = ovf(
                self.sliceDirections.slice3dVWR.threedFrame,
                id=-1,
                title='dummy')

            self._orthoViewFrame.SetIcon(module_utils.get_module_icon())

            self._renderer = vtk.vtkRenderer()
            self._renderer.SetBackground(0.5, 0.5, 0.5)
            self._orthoViewFrame.RWI.GetRenderWindow().AddRenderer(
                self._renderer)
            istyle = vtk.vtkInteractorStyleImage()
            self._orthoViewFrame.RWI.SetInteractorStyle(istyle)

            wx.EVT_CLOSE(self._orthoViewFrame,
                         lambda e, s=self: s.destroyOrthoView)

            wx.EVT_BUTTON(self._orthoViewFrame,
                          self._orthoViewFrame.closeButtonId,
                          lambda e, s=self: s.destroyOrthoView)

            for ipw in self._ipws:
                self._createOrthoPipelineForNewIPW(ipw)

            if self._ipws:
                self._resetOrthoView()

            self._orthoViewFrame.Show(True)
Example #4
0
    def miscObjectConfigure(self, parentWindow, obj, objDescription=""):
        """This will instantiate and show a pythonShell with the object that
        is being examined.

        If it is called multiple times for the same object, it will merely
        bring the pertinent window to the top.
        """

        if not hasattr(self, "_python_shells"):
            self._python_shells = {}

        if obj not in self._python_shells:
            icon = module_utils.get_module_icon()

            self._python_shells[obj] = PythonShell(
                parentWindow, "Introspecting %s" % (objDescription,), icon, self._module_manager._devide_app
            )

            self._python_shells[obj].inject_locals({"obj": obj})
            self._python_shells[obj].set_statusbar_message("'obj' is bound to the introspected object")

        self._python_shells[obj].show()
Example #5
0
    def createOrthoView(self):
        """Create an accompanying orthographic view of the sliceDirection
        encapsulated by this object.
        """

        # there can be only one orthoPipeline
        if not self._orthoPipeline:

            import modules.resources.python.slice3dVWRFrames            
            # import our wxGlade-generated frame
            ovf = modules.resources.python.slice3dVWRFrames.orthoViewFrame
            self._orthoViewFrame = ovf(
                self.sliceDirections.slice3dVWR.threedFrame, id=-1,
                title='dummy')

            self._orthoViewFrame.SetIcon(module_utils.get_module_icon())

            self._renderer = vtk.vtkRenderer()
            self._renderer.SetBackground(0.5, 0.5, 0.5)
            self._orthoViewFrame.RWI.GetRenderWindow().AddRenderer(
                self._renderer)
            istyle = vtk.vtkInteractorStyleImage()
            self._orthoViewFrame.RWI.SetInteractorStyle(istyle)

            wx.EVT_CLOSE(self._orthoViewFrame,
                         lambda e, s=self: s.destroyOrthoView)

            wx.EVT_BUTTON(self._orthoViewFrame,
                          self._orthoViewFrame.closeButtonId,
                          lambda e, s=self: s.destroyOrthoView)

            for ipw in self._ipws:
                self._createOrthoPipelineForNewIPW(ipw)

            if self._ipws:
                self._resetOrthoView()

            self._orthoViewFrame.Show(True)
Example #6
0
    def miscObjectConfigure(self, parentWindow, obj, objDescription=''):
        """This will instantiate and show a pythonShell with the object that
        is being examined.

        If it is called multiple times for the same object, it will merely
        bring the pertinent window to the top.
        """

        if not hasattr(self, '_python_shells'):
            self._python_shells = {}

        if obj not in self._python_shells:
            icon = module_utils.get_module_icon()

            self._python_shells[obj] = PythonShell(
                parentWindow, 'Introspecting %s' % (objDescription, ), icon,
                self._module_manager._devide_app)

            self._python_shells[obj].inject_locals({'obj': obj})
            self._python_shells[obj].set_statusbar_message(
                "'obj' is bound to the introspected object")

        self._python_shells[obj].show()