yade.qt module

Common initialization core for yade.

This file is executed when anything is imported from yade for the first time. It loads yade plugins and injects c++ class constructors to the __builtins__ (that might change in the future, though) namespace, making them available everywhere.

class yade.qt._GLViewer.GLViewer
__init__()

Raises an exception This class cannot be instantiated from Python

axes

Show arrows for axes.

center((GLViewer)arg1[, (bool)median=True[, (float)suggestedRadius=-1.0]]) → None :

Center view. View is centered either so that all bodies fit inside (median = False), or so that 75% of bodies fit inside (median = True). If radius cannot be determined automatically then suggestedRadius is used.

close((GLViewer)arg1) → None
eyePosition

Camera position.

fitAABB((GLViewer)arg1, (Vector3)mn, (Vector3)mx) → None :

Adjust scene bounds so that Axis-aligned bounding box given by its lower and upper corners mn, mx fits in.

fitSphere((GLViewer)arg1, (Vector3)center, (float)radius) → None :

Adjust scene bounds so that sphere given by center and radius fits in.

fps

Show frames per second indicator.

grid

Display square grid in zero planes, as 3-tuple of bools for yz, xz, xy planes.

loadState((GLViewer)arg1[, (str)stateFilename='.qglviewer.xml']) → None :

Load display parameters from file saved previously into.

lookAt

Point at which camera is directed.

ortho

Whether orthographic projection is used; if false, use perspective projection.

saveSnapshot((GLViewer)arg1, (str)filename) → None :

Save the current view to image file

saveState((GLViewer)arg1[, (str)stateFilename='.qglviewer.xml']) → None :

Save display parameters into a file. Saves state for both GLViewer and associated OpenGLRenderer.

scale

Scale of the view (?)

sceneRadius

Visible scene radius.

screenSize

Size of the viewer’s window, in scree pixels

selection
showEntireScene((GLViewer)arg1) → None
timeDisp

Time displayed on in the vindow; is a string composed of characters r, v, i standing respectively for real time, virtual time, iteration number.

upVector

Vector that will be shown oriented up on the screen.

viewDir

Camera orientation (as vector).

yade.qt._GLViewer.Renderer() → OpenGLRenderer

Return the active OpenGLRenderer object.

yade.qt._GLViewer.View() → GLViewer

Create a new 3d view.

yade.qt._GLViewer.center([(float)suggestedRadius=-1.0[, (Vector3)gridOrigin=Vector3(0, 0, 0)[, (Vector3)suggestedCenter=Vector3(0, 0, 0)[, (int)gridDecimalPlaces=4]]]]) → None

Center all views.

Parameters:
  • suggestedRadius – optional parameter, if provided and positive then it will be used instead of automatic radius detection. This parameter affects the (1) size of grid being drawn (2) the Z-clipping distance in OpenGL, it means that if clipping is too large and some of your scene is not being drawn but is “cut” or “sliced” then this parameter needs to be bigger.
  • gridOrigin – optional parameter, if provided it will be used as the origin for drawing the grid. Meaning the intersection of all three grids will not be at 0,0,0; but at the provided coordinate rounded to the nearest gridStep.
  • suggestedCenter – optional parameter, if provided other than (0,0,0) then it will be used instead of automatic calculation of scene center using bounding boxes. This parameter affects the drawn rotation-center. If you try to rotate the view, and the rotation is around some strange point, then this parameter needs to be changed.
  • gridDecimalPlaces – default value=4, determines the number of decimal places to be shown on grid labels using stringstream (extra zeros are not shown).

Hint

You can get the current values of all these four arguments by invoking command: yade.qt.centerValues()

yade.qt._GLViewer.centerValues() → dict
Returns:a dictionary with all parameters currently used by yade.qt.center(…), see qt.center or type yade.qt.center? for details. Returns zeros if view is closed.
yade.qt._GLViewer.views() → list

Return list of all open qt.GLViewer objects