Screen annotations

class postprocess.xcVtk.screen_annotation.ScreenAnnotation

Bases: object

captionWidth = 80
getVtkCornerAnnotation(caption='', unitDescription='')

Create the corner annotations.

Parameters

caption – caption of the image.

lowerLeft = 0
lowerRight = 1
upperLeft = 2
upperRight = 3

Graphic base

Display nice images of the model.

class postprocess.xcVtk.vtk_graphic_base.CameraParameters(viewNm='XYZPos', cameraPosition=[0, 0, 100], hCamF=1.0, zoom=1.0)

Bases: object

Provides the parameters to define the camera.

Variables
  • viewName – name of the view that contains the renderer (defaults to “XYZPos”)

  • viewUpVc – vector defined as [x,y,z] to orient the view. This vector of the model is placed in vertical orientation in the display

  • posCVc – vector defined as [x,y,z] that points to the camera position.

  • zoom – scale factor, a value greater than 1 is a zoom-in, a value less than 1 is a zoom-out (defaults to 1.0).

  • hCamFct – factor that applies to the height of the camera position in order to change perspective of isometric views (defaults to 1, usual values 0.1 to 10)

  • focalPoint – focal of the camera in world coordinates.

defineViewParametersFromViewName()

Sets the values of the view parameters from the following predefined viewNames: “ZPos”,”ZNeg”,”YPos”,”YNeg”,”XPos”,”XNeg”,”XYZPos” Zpos: View from positive Z axis (Z+) Zneg: View from negative Z axis (Z-) Ypos: View from positive Y axis (Y+) Yneg: View from negative Y axis (Y-) Xpos: View from positive X axis (X+) Xneg: View from negative X axis (X-) XYZPos or +X+Y+Z: View from point (1,1,1) +X+Y-Z: View from point (1,1,-1) +X-Y+Z: View from point (1,-1,1) +X-Y-Z: View from point (1,-1,-1) -X+Y+Z: View from point (-1,1,1) -X+Y-Z: View from point (-1,1,-1) -X-Y+Z: View from point (-1,-1,1) XYZNeg or -X-Y-Z: View from point (-1,-1,-1)

setFocalPoint(focalPoint)

Set the focal point for the camera.

Parameters

focalPoint – position of the focal point.

setView(vtkCamera)

Sets the camera parameters.

Parameters

vtkCamera – VTK camera object whose parameters will be changed according to the information stored in this object.

class postprocess.xcVtk.vtk_graphic_base.DisplaySettings

Bases: object

Provides the variables to define the output device.

Variables
  • renderer – specification of renderer. A renderer is an object that controls the rendering process for objects. Rendering is the process of converting geometry, a specification for lights, and a camera view into an image. (defaults to None)

  • renWin – rendering window (defaults to None). A rendering window is a window in a graphical user interface where renderers draw their images.

  • windowWidth – resolution expresed in pixels in the width direction of the window (defaults to 800)

  • windowHeight – resolution expresed in pixels in the height direction of the window (defaults to 600)

  • cameraParameters – parameters that define the camera position, zoom, etc.

  • bgRComp – background color red component (defaults to 0.65)

  • bgGComp – background color green component (defaults to 0.65)

  • bgBComp – background color blue component (defaults to 0.65)

  • lineWidth – with of the lines in screen units.

closeWindow(iren)

Close the current render window.

displayScene(caption='', unitDescription='', fileName=None)

Displaying scene

Parameters
  • caption – caption to display with the scene.

  • unitDescription – description of the units.

  • fileName – name of the image file, in none -> screen window.

getLineWidth()

Return the value of the width for the displayed lines.

plot(fileName)

Plots window contents

Parameters

fileName – name of the image file, in none -> screen window.

setBackgroundColor(rgbComponents=(0.65, 0.65, 0.65))

Sets the background color for the renderer.

Parameters

rgbComponents – (red, green, blue) components of the background color.

setLineWidth(lineWidth)

Set the width for the displayed lines.

Parameters

lineWidth – width of the lines in screen units.

setView()

Sets the view

setupAxes()

Add an vtkAxesActor to the renderer.

setupGrid(xcSet)

Parameters: xcSet: set to be represented

setupWindow(caption='XC window', unitDescription='')
sets the rendering window. A rendering window is a window in a

graphical user interface where renderers draw their images.

Parameters
  • caption – caption of the image.

  • unitDescription – description of the units.

setupWindowInteractor()

sets the window interactor, which provides a platform-independent interaction mechanism for mouse/key/time events.

class postprocess.xcVtk.vtk_graphic_base.RecordDefGrid

Bases: object

Provide the variables involved in the VTK grid representation

Variables
  • xcSet – set to be represented

  • entToLabel – entities to be labeled (defaults to “nodes”)

  • cellType – specifies the type of data cells (defaults to “nil”). Data cells are simple topological elements like points, lines, polygons and tetrahedra of which visualization data sets are composed.

  • uGrid – unstructure grid (defaults to None). An unstructure grid is a concrete implementation of a vtk data set; represents any combination of any cell types. This includes 0D (e.g. points), 1D (e.g., lines, polylines), 2D (e.g., triangles, polygons), and 3D (e.g., hexahedron, tetrahedron, polyhedron, etc.).

getDiagonalLength()

Return the length of the diagonal of the bounding box.

getGridBND()

Returns the grid boundary

getSetBND()

Returns the set boundary

setupSet(setToDisplay)

Prepares the set to be displayed.

Parameters

setToDisplay – set to be displayed.

postprocess.xcVtk.vtk_graphic_base.setup_render_window(windowName, actors, backgroundColor, xSize=800, ySize=600)

Setup render window, renderer, and interactor.

Parameters
  • windowName – window name.

  • actors – actors that will be added to the renderer.

  • backgroundColor – color for the window background.

  • xSize – horizontal size in pixels.

  • ySize – vertical size in pixels.