fieldanimation.examples package

fieldanimation.examples.app

fieldanimation.examples.app.ElectricField(q, r0, x, y)[source]

Return the electric field vector E=(Ex, Ey) due to charge q at r0.

class fieldanimation.examples.app.GLApp(title, width, height, options)[source]

Bases: fieldanimation.examples.glfwBackend.glfwApp

__abstractmethods__ = frozenset({})
__init__(title, width, height, options)[source]

Create a new glfwApp instance.

Parameters
  • title (string) – window title

  • width (integer) – window width in pixels

  • height (integer) – window height in pixels

  • resizable (bool) – if True the window can be resized

makeGUI(gui)[source]

Create the GUI context and GlfwRenderer

Parameters

gui (bool) – if True create the GUI context and GlfwRenderer

onKeyboard(window, key, scancode, action, mode)[source]

Process keybord input. This method is called automatically when the user interacts with the keyboard.

Parameters
  • (class (window) – glfw.LP__GLFWwindow instance): window

  • key (integer) – the key that was pressed

  • scancode (integer) –

  • action (integer) – PRESS, RELEASE, REPEAT

  • mode (integer) – modifier

onResize(window, width, height)[source]

This method must be implemened. It is called automatically when the window gets resized.

Parameters
  • (class (window) – glfw.LP__GLFWwindow instance): window

  • width (int) – window width in pixels

  • height (int) – window height in pixels

renderScene()[source]

Render the scene. This method is called automatically in the run loop

setField(ifield)[source]
fieldanimation.examples.app.createField(eq='Spiral ccw', m=64, n=64)[source]

Equations are taken from http://reference.wolfram.com/language/ref/StreamPlot.html

Parameters
  • eq (string) – equation name

  • m (integer) – number of rows

  • n (integer) – number of columns

fieldanimation.examples.app.makeParser()[source]

Return the ArgumentParser instance for this script.

Returns

instance

Return type

ArgumentParser

fieldanimation.examples.app.userInterface(graphicItem, app)[source]

Control graphicItem parameters interactively