objs

Camera

class pvmacros.vis.objs.camera(cam=None)[source]

An object to store a single camera location/view. You can make a list/dict of these objects to save interesting views for your project. This object saves just a few parameters about the camera so that it can easily be reconstructed.

_getFocalPoint()[source]
_getOrientation()[source]
_getPosition()[source]
_getViewUp()[source]
static loadViews(path='/home/docs')[source]

Load a file containg a serialized camera objects. Dafault loads from home directory if relative path

Parameters:
  • filename (str) – The file basename for the serialized file (defualt is default for output def)
  • path (str) – The directory from which you wish to load the views. Defaults to user home directory for relative paths.
static saveViews(filename='views', path='/home/docs')[source]

Save a serialized dictionaty/list/whatever of views out to a file. Dafault saves to user’s home directory

Parameters:
  • lib (dict or list) – some iterable object containg multiple camera objects
  • filename (str) – The file basename for the serialized file
  • path (str) – The directory you wish to save the views. Defaults to user home directory
screenShot(cam=None, path='/home/docs', basenm='view')[source]

Save a screenshot of a single camera view

Parameters:
  • cam (vtkRenderingOpenGL2Python.vtkOpenGLCamera) – The camera you wish to view then save a screenshot
  • path (str) – The directory you wish to save the screenshot. Defaults to user home directory
  • basenm (str) – The file basename for the screenshot
static screenShotViews(cam=None, path='/home/docs', basenm='view')[source]

Save screenshots of many views/cameras

Parameters:
  • d (view) – some iterable object containg multiple camera objects
  • cam (vtkRenderingOpenGL2Python.vtkOpenGLCamera) – The camera you wish to view then save a screenshot
  • path (str) – The directory you wish to save the screenshot. Defaults to user home directory
  • basenm (str) – The file basename for the screenshot
update(cam=None)[source]

Updates the camera location to that which is in the currently activated view unless a vtkOpenGLCamera is specified.

Parameters:cam (vtkRenderingOpenGL2Python.vtkOpenGLCamera) – The camera you wish to update this object to. Totally optional
view(cam=None)[source]

Use this method to update the camera to the saved location

Parameters:cam (vtkRenderingOpenGL2Python.vtkOpenGLCamera) – The camera you wish to view/update in the current render view