parameters: (self, restore = False)
return_statement: return x_max, y_max, z_max
docstring: Compute a scale factor and a translation to fit and center 
          the whole geometry on the screen.
docstring_summary: Compute a scale factor and a translation to fit and center 
          the whole geometry on the screen.
docstring_tokens: Compute a scale factor and a translation to fit and center the whole geometry on the screen .
function: def fit_scene(self, restore = False):
          """ Compute a scale factor and a translation to fit and center 
          the whole geometry on the screen.
          """
  
          x_max = self.bb_max[0] - self.bb_min[0]
          y_max = self.bb_max[1] - self.bb_min[1]
          tmp = max(x_max, y_max)
          z_max = self.bb_max[2] - self.bb_min[2]
          tmp = max(z_max, tmp)
  
          if not restore:
              tmp = 1. / tmp
  
          logger.info("Scaling the scene by %.03f" % tmp)
          glScalef(tmp, tmp, tmp)
  
          # center the model
          direction = -1 if not restore else 1
          glTranslatef( direction * self.scene_center[0], 
                        direction * self.scene_center[1], 
                        direction * self.scene_center[2] )
  
          return x_max, y_max, z_max
function_tokens: def fit_scene ( self , restore = False ) : x_max = self . bb_max [ 0 ] - self . bb_min [ 0 ] y_max = self . bb_max [ 1 ] - self . bb_min [ 1 ] tmp = max ( x_max , y_max ) z_max = self . bb_max [ 2 ] - self . bb_min [ 2 ] tmp = max ( z_max , tmp ) if not restore : tmp = 1. / tmp logger . info ( "Scaling the scene by %.03f" % tmp ) glScalef ( tmp , tmp , tmp ) # center the model direction = - 1 if not restore else 1 glTranslatef ( direction * self . scene_center [ 0 ] , direction * self . scene_center [ 1 ] , direction * self . scene_center [ 2 ] ) return x_max , y_max , z_max