Esempio n. 1
0
 def setCurrent(self,canv):
     if type(canv) == int and canv in range(len(self.all)):
         canv = self.all[canv]
     if canv in self.all:
         GD.canvas = self.current = canv
         toolbar.setTransparency(self.current.alphablend)
         toolbar.setPerspective(self.current.camera.perspective)
         toolbar.setLight(self.current.lighting)
         self.current.display()
Esempio n. 2
0
 def setCurrent(self,canv):
     if type(canv) == int and canv in range(len(self.all)):
         canv = self.all[canv]
     # TEST SKIP IF ALREADY CURRENT
     if self.current == canv:
         return
     if canv in self.all:
         GD.canvas = self.current = canv
         toolbar.setTransparency(self.current.alphablend)
         toolbar.setPerspective(self.current.camera.perspective)
         toolbar.setLight(self.current.lighting)
         #toolbar.setNormals(self.current.avgnormals)
         #
         # TEST WITHOUT DISPLAY
         GL.glFlush()
Esempio n. 3
0
    def setCurrent(self,canv):
        """Make the specified viewport the current  one.

        canv can be either a viewport or viewport number.
        """
#        GL.glFlush()
        if type(canv) == int and canv in range(len(self.all)):
            canv = self.all[canv]
        ## if self.current == canv:
        ##     # alreay current
        ##     return
        if GD.canvas:
            GD.canvas.focus = False
            GD.canvas.updateGL()
        if canv in self.all:
            GD.canvas = self.current = canv
            GD.canvas.focus = True
            toolbar.setTransparency(self.current.alphablend)
            toolbar.setPerspective(self.current.camera.perspective)
            toolbar.setLight(self.current.lighting)
            #toolbar.setNormals(self.current.avgnormals)
#            GL.glFlush()
            GD.canvas.updateGL()
Esempio n. 4
0
def lights(onoff):
    """Set the lights on or off"""
    toolbar.setLight(onoff)
Esempio n. 5
0
def renderMode(mode):
    GD.canvas.setRenderMode(mode)
    toolbar.setLight(GD.canvas.lighting)
    GD.canvas.update()
    GD.app.processEvents()
Esempio n. 6
0
def renderMode(mode,avg=False):
    pf.canvas.setRenderMode(mode)
    toolbar.setNormals(avg)
    toolbar.setLight(pf.canvas.lighting)
    pf.canvas.update()
    pf.app.processEvents()