bindings/python/dionysus/viewer/__init__.py
author Dmitriy Morozov <dmitriy@mrzv.org>
Thu, 07 Jun 2012 11:57:33 -0700
branchdev
changeset 262 ee064472dc1f
parent 261 7b846a522bed
child 263 185923889ab4
permissions -rw-r--r--
Added pan + zoom to diagram viewer; show_diagram() didn't return; added PyQt, PyOpenGL, NumPy as dependencies in the docs

from    diagram     import show_diagram as _show_diagram
from    complex2d   import show_complex_2D
from    complex3d   import show_complex_3D

from    PyQt4       import QtGui

_app = QtGui.QApplication([])

def show_complex(points, complex = None, values = None):
    if len(points[0]) == 2:
        show_complex_2D(points, complex, values, app = _app)
    if len(points[0]) == 3:
        show_complex_3D(points, complex, values, app = _app)

def show_diagram(dgm):
    return _show_diagram(dgm, _app)