parameters: (self, ts)
return_statement: return self.__cameras
docstring: returns a list of camera positions timestep is ignored.
docstring_summary: returns a list of camera positions timestep is ignored.
docstring_tokens: returns a list of camera positions timestep is ignored .
function: def get_cameras(self, ts):
          """returns a list of camera positions timestep is ignored."""
  
          # use cached cameras, if available.
          if 0 in self.__cameras:
              return self.__cameras
  
          # if not cached, read and cache.
          md = self.fs.metadata
  
          try:
              eye = md["camera_eye"][0][:3]
              at = md["camera_at"][0][:3]
              up = md["camera_up"][0][:3]
              nearfar = md["camera_nearfar"][0][:2]
              angle = md["camera_angle"][0]
  
          except KeyError:
              print("Warning: Cannot initialiaze cameras." +
                    " Interaction may not work correctly")
  
              return self.__cameras
  
          phis = [0]
          if "phi" in self.fs.parameter_list.keys():
              phis = self.fs.get_parameter("phi")["values"]
          thetas = [0]
          if "theta" in self.fs.parameter_list.keys():
              thetas = self.fs.get_parameter("theta")["values"]
  
          camera = vtk.vtkCamera()
          camera.SetPosition(eye)
          camera.SetFocalPoint(at)
          camera.SetViewUp(up)
          camera.SetViewAngle(angle)
          camera.SetClippingRange(nearfar[0], nearfar[1])
  
          for phi in phis:
              for theta in thetas:
                  c = vtk.vtkCamera()
                  c.DeepCopy(camera)
                  c.Azimuth(phi)
                  c.Elevation(theta)
                  c.OrthogonalizeViewUp()
                  self.__cameras.append(c)
  
          return self.__cameras
function_tokens: def get_cameras ( self , ts ) : # use cached cameras, if available. if 0 in self . __cameras : return self . __cameras # if not cached, read and cache. md = self . fs . metadata try : eye = md [ "camera_eye" ] [ 0 ] [ : 3 ] at = md [ "camera_at" ] [ 0 ] [ : 3 ] up = md [ "camera_up" ] [ 0 ] [ : 3 ] nearfar = md [ "camera_nearfar" ] [ 0 ] [ : 2 ] angle = md [ "camera_angle" ] [ 0 ] except KeyError : print ( "Warning: Cannot initialiaze cameras." + " Interaction may not work correctly" ) return self . __cameras phis = [ 0 ] if "phi" in self . fs . parameter_list . keys ( ) : phis = self . fs . get_parameter ( "phi" ) [ "values" ] thetas = [ 0 ] if "theta" in self . fs . parameter_list . keys ( ) : thetas = self . fs . get_parameter ( "theta" ) [ "values" ] camera = vtk . vtkCamera ( ) camera . SetPosition ( eye ) camera . SetFocalPoint ( at ) camera . SetViewUp ( up ) camera . SetViewAngle ( angle ) camera . SetClippingRange ( nearfar [ 0 ] , nearfar [ 1 ] ) for phi in phis : for theta in thetas : c = vtk . vtkCamera ( ) c . DeepCopy ( camera ) c . Azimuth ( phi ) c . Elevation ( theta ) c . OrthogonalizeViewUp ( ) self . __cameras . append ( c ) return self . __cameras