示例#1
0
    def setCurrent(self,canv):
        """Make the specified viewport the current one.

        canv can be either a viewport or viewport number.
        """
        if type(canv) == int and canv in range(len(self.all)):
            canv = self.all[canv]
        if canv == self.current:
            return  # already current

        if canv in self.all:
            if self.current:
                self.current.focus = False
                self.current.updateGL()
            self.current = canv
            self.current.focus = True
            self.current.updateGL()
            toolbar.updateTransparencyButton()
            toolbar.updatePerspectiveButton()
            toolbar.updateLightButton()
示例#2
0
def perspective(state=True):
    pf.canvas.camera.setPerspective(state)
    pf.canvas.update()
    toolbar.updatePerspectiveButton()
    pf.GUI.processEvents()