Ejemplo n.º 1
0
 def menuToggleSelectCallback(self, cbdata):
    print 'Application.menuToggleSelectCallback'
    print ' -- toggle name={0}'.format(cbdata.toggle.getName())
 
    name = cbdata.toggle.getName()
 
    if name == 'ShowSurfaceToggle':
       self.showSurface = cbdata.set
    elif name == 'ShowGridToggle':
       self.showGrid = cbdata.set
    elif name == 'SurfaceTransparentToggle':
       self.surfaceTransparent = cbdata.set
    elif name == 'ShowOuterCoreToggle':
       self.showOuterCore = cbdata.set
    elif name == 'ShowOuterCoreTransparentToggle':
       self.outerCoreTransparent = cbdata.set
    elif name == 'ShowInnerCoreToggle':
       self.showInnerCore = cbdata.set
    elif name == 'ShowInnerCoreTransparentToggle':
       self.innerCoreTransparent = cbdata.set
    elif name == 'RotateEarthToggle':
       self.rotateEarth = cbdata.set
       if self.rotateEarth:
          self.lastFrameTime = pyvrui.getApplicationTime()
       print ' -- self.rotateEarth={0}'.format(self.rotateEarth)
    elif name == 'ShowRenderDialogToggle':
       if cbdata.set:
          print ' -- pop up dialog'
          pyvrui.getWidgetManager().popupPrimaryWidget(
                                     self.renderDialog,
                                     pyvrui.getWidgetManager().calcWidgetTransformation(self.mainMenu))
       else:
          print ' -- pop down dialog'
          pyvrui.popdownPrimaryWidget(self.renderDialog)
Ejemplo n.º 2
0
   def frame(self):
      newFrameTime = pyvrui.getApplicationTime()

      if self.rotateEarth:
         self.rotationAngle += self.rotationSpeed*(newFrameTime-self.lastFrameTime)
         if self.rotationAngle >= 360.0:
            self.rotationAngle -= 360.0

      pyvrui.requestUpdate()

      self.lastFrameTime = newFrameTime