exporters, multiprocess, opengl
This commit is contained in:
parent
a2e8290d8e
commit
7777240d89
@ -1,8 +1,7 @@
|
|||||||
import pyqtgraph as pg
|
from ..Qt import QtGui, QtCore
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
|
||||||
from .Exporter import Exporter
|
from .Exporter import Exporter
|
||||||
from pyqtgraph.parametertree import Parameter
|
from ..parametertree import Parameter
|
||||||
|
from .. import PlotItem
|
||||||
|
|
||||||
__all__ = ['CSVExporter']
|
__all__ = ['CSVExporter']
|
||||||
|
|
||||||
@ -22,7 +21,7 @@ class CSVExporter(Exporter):
|
|||||||
|
|
||||||
def export(self, fileName=None):
|
def export(self, fileName=None):
|
||||||
|
|
||||||
if not isinstance(self.item, pg.PlotItem):
|
if not isinstance(self.item, PlotItem):
|
||||||
raise Exception("Must have a PlotItem selected for CSV export.")
|
raise Exception("Must have a PlotItem selected for CSV export.")
|
||||||
|
|
||||||
if fileName is None:
|
if fileName is None:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from pyqtgraph.widgets.FileDialog import FileDialog
|
from ..widgets.FileDialog import FileDialog
|
||||||
import pyqtgraph as pg
|
from ..Qt import QtGui, QtCore, QtSvg
|
||||||
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
|
from ..python2_3 import asUnicode
|
||||||
from pyqtgraph.python2_3 import asUnicode
|
from ..GraphicsScene import GraphicsScene
|
||||||
import os, re
|
import os, re
|
||||||
LastExportDirectory = None
|
LastExportDirectory = None
|
||||||
|
|
||||||
@ -77,20 +77,20 @@ class Exporter(object):
|
|||||||
self.export(fileName=fileName, **self.fileDialog.opts)
|
self.export(fileName=fileName, **self.fileDialog.opts)
|
||||||
|
|
||||||
def getScene(self):
|
def getScene(self):
|
||||||
if isinstance(self.item, pg.GraphicsScene):
|
if isinstance(self.item, GraphicsScene):
|
||||||
return self.item
|
return self.item
|
||||||
else:
|
else:
|
||||||
return self.item.scene()
|
return self.item.scene()
|
||||||
|
|
||||||
def getSourceRect(self):
|
def getSourceRect(self):
|
||||||
if isinstance(self.item, pg.GraphicsScene):
|
if isinstance(self.item, GraphicsScene):
|
||||||
w = self.item.getViewWidget()
|
w = self.item.getViewWidget()
|
||||||
return w.viewportTransform().inverted()[0].mapRect(w.rect())
|
return w.viewportTransform().inverted()[0].mapRect(w.rect())
|
||||||
else:
|
else:
|
||||||
return self.item.sceneBoundingRect()
|
return self.item.sceneBoundingRect()
|
||||||
|
|
||||||
def getTargetRect(self):
|
def getTargetRect(self):
|
||||||
if isinstance(self.item, pg.GraphicsScene):
|
if isinstance(self.item, GraphicsScene):
|
||||||
return self.item.getViewWidget().rect()
|
return self.item.getViewWidget().rect()
|
||||||
else:
|
else:
|
||||||
return self.item.mapRectToDevice(self.item.boundingRect())
|
return self.item.mapRectToDevice(self.item.boundingRect())
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from .Exporter import Exporter
|
from .Exporter import Exporter
|
||||||
from pyqtgraph.parametertree import Parameter
|
from ..parametertree import Parameter
|
||||||
from pyqtgraph.Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
|
from ..Qt import QtGui, QtCore, QtSvg, USE_PYSIDE\
|
||||||
import pyqtgraph as pg
|
from .. import functions as fn
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
__all__ = ['ImageExporter']
|
__all__ = ['ImageExporter']
|
||||||
@ -73,7 +73,7 @@ class ImageExporter(Exporter):
|
|||||||
bg[:,:,1] = color.green()
|
bg[:,:,1] = color.green()
|
||||||
bg[:,:,2] = color.red()
|
bg[:,:,2] = color.red()
|
||||||
bg[:,:,3] = color.alpha()
|
bg[:,:,3] = color.alpha()
|
||||||
self.png = pg.makeQImage(bg, alpha=True)
|
self.png = fn.makeQImage(bg, alpha=True)
|
||||||
|
|
||||||
## set resolution of image:
|
## set resolution of image:
|
||||||
origTargetRect = self.getTargetRect()
|
origTargetRect = self.getTargetRect()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import pyqtgraph as pg
|
from ..Qt import QtGui, QtCore
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
|
||||||
from .Exporter import Exporter
|
from .Exporter import Exporter
|
||||||
|
from .. import PlotItem
|
||||||
|
from .. import functions as fn
|
||||||
|
|
||||||
__all__ = ['MatplotlibExporter']
|
__all__ = ['MatplotlibExporter']
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ class MatplotlibExporter(Exporter):
|
|||||||
|
|
||||||
def export(self, fileName=None):
|
def export(self, fileName=None):
|
||||||
|
|
||||||
if isinstance(self.item, pg.PlotItem):
|
if isinstance(self.item, PlotItem):
|
||||||
mpw = MatplotlibWindow()
|
mpw = MatplotlibWindow()
|
||||||
MatplotlibExporter.windows.append(mpw)
|
MatplotlibExporter.windows.append(mpw)
|
||||||
fig = mpw.getFigure()
|
fig = mpw.getFigure()
|
||||||
@ -29,23 +29,23 @@ class MatplotlibExporter(Exporter):
|
|||||||
for item in self.item.curves:
|
for item in self.item.curves:
|
||||||
x, y = item.getData()
|
x, y = item.getData()
|
||||||
opts = item.opts
|
opts = item.opts
|
||||||
pen = pg.mkPen(opts['pen'])
|
pen = fn.mkPen(opts['pen'])
|
||||||
if pen.style() == QtCore.Qt.NoPen:
|
if pen.style() == QtCore.Qt.NoPen:
|
||||||
linestyle = ''
|
linestyle = ''
|
||||||
else:
|
else:
|
||||||
linestyle = '-'
|
linestyle = '-'
|
||||||
color = tuple([c/255. for c in pg.colorTuple(pen.color())])
|
color = tuple([c/255. for c in fn.colorTuple(pen.color())])
|
||||||
symbol = opts['symbol']
|
symbol = opts['symbol']
|
||||||
if symbol == 't':
|
if symbol == 't':
|
||||||
symbol = '^'
|
symbol = '^'
|
||||||
symbolPen = pg.mkPen(opts['symbolPen'])
|
symbolPen = fn.mkPen(opts['symbolPen'])
|
||||||
symbolBrush = pg.mkBrush(opts['symbolBrush'])
|
symbolBrush = fn.mkBrush(opts['symbolBrush'])
|
||||||
markeredgecolor = tuple([c/255. for c in pg.colorTuple(symbolPen.color())])
|
markeredgecolor = tuple([c/255. for c in fn.colorTuple(symbolPen.color())])
|
||||||
markerfacecolor = tuple([c/255. for c in pg.colorTuple(symbolBrush.color())])
|
markerfacecolor = tuple([c/255. for c in fn.colorTuple(symbolBrush.color())])
|
||||||
|
|
||||||
if opts['fillLevel'] is not None and opts['fillBrush'] is not None:
|
if opts['fillLevel'] is not None and opts['fillBrush'] is not None:
|
||||||
fillBrush = pg.mkBrush(opts['fillBrush'])
|
fillBrush = fn.mkBrush(opts['fillBrush'])
|
||||||
fillcolor = tuple([c/255. for c in pg.colorTuple(fillBrush.color())])
|
fillcolor = tuple([c/255. for c in fn.colorTuple(fillBrush.color())])
|
||||||
ax.fill_between(x=x, y1=y, y2=opts['fillLevel'], facecolor=fillcolor)
|
ax.fill_between(x=x, y1=y, y2=opts['fillLevel'], facecolor=fillcolor)
|
||||||
|
|
||||||
ax.plot(x, y, marker=symbol, color=color, linewidth=pen.width(), linestyle=linestyle, markeredgecolor=markeredgecolor, markerfacecolor=markerfacecolor)
|
ax.plot(x, y, marker=symbol, color=color, linewidth=pen.width(), linestyle=linestyle, markeredgecolor=markeredgecolor, markerfacecolor=markerfacecolor)
|
||||||
@ -62,7 +62,7 @@ MatplotlibExporter.register()
|
|||||||
|
|
||||||
class MatplotlibWindow(QtGui.QMainWindow):
|
class MatplotlibWindow(QtGui.QMainWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
import pyqtgraph.widgets.MatplotlibWidget
|
from .. import widgets.MatplotlibWidget
|
||||||
QtGui.QMainWindow.__init__(self)
|
QtGui.QMainWindow.__init__(self)
|
||||||
self.mpl = pyqtgraph.widgets.MatplotlibWidget.MatplotlibWidget()
|
self.mpl = pyqtgraph.widgets.MatplotlibWidget.MatplotlibWidget()
|
||||||
self.setCentralWidget(self.mpl)
|
self.setCentralWidget(self.mpl)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from .Exporter import Exporter
|
from .Exporter import Exporter
|
||||||
from pyqtgraph.parametertree import Parameter
|
from ..parametertree import Parameter
|
||||||
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
|
from ..Qt import QtGui, QtCore, QtSvg
|
||||||
import re
|
import re
|
||||||
|
|
||||||
__all__ = ['PrintExporter']
|
__all__ = ['PrintExporter']
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
from .Exporter import Exporter
|
from .Exporter import Exporter
|
||||||
from pyqtgraph.python2_3 import asUnicode
|
from ..python2_3 import asUnicode
|
||||||
from pyqtgraph.parametertree import Parameter
|
from ..parametertree import Parameter
|
||||||
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
|
from ..Qt import QtGui, QtCore, QtSvg
|
||||||
import pyqtgraph as pg
|
from .. import debug
|
||||||
|
from .. import functions as fn
|
||||||
import re
|
import re
|
||||||
import xml.dom.minidom as xml
|
import xml.dom.minidom as xml
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -156,7 +157,7 @@ def _generateItemSvg(item, nodes=None, root=None):
|
|||||||
##
|
##
|
||||||
## Both 2 and 3 can be addressed by drawing all items in world coordinates.
|
## Both 2 and 3 can be addressed by drawing all items in world coordinates.
|
||||||
|
|
||||||
profiler = pg.debug.Profiler()
|
profiler = debug.Profiler()
|
||||||
|
|
||||||
if nodes is None: ## nodes maps all node IDs to their XML element.
|
if nodes is None: ## nodes maps all node IDs to their XML element.
|
||||||
## this allows us to ensure all elements receive unique names.
|
## this allows us to ensure all elements receive unique names.
|
||||||
@ -196,17 +197,12 @@ def _generateItemSvg(item, nodes=None, root=None):
|
|||||||
tr2 = QtGui.QTransform()
|
tr2 = QtGui.QTransform()
|
||||||
tr2.translate(-rootPos.x(), -rootPos.y())
|
tr2.translate(-rootPos.x(), -rootPos.y())
|
||||||
tr = tr * tr2
|
tr = tr * tr2
|
||||||
#print item, pg.SRTTransform(tr)
|
|
||||||
|
|
||||||
#tr.translate(item.pos().x(), item.pos().y())
|
|
||||||
#tr = tr * item.transform()
|
|
||||||
arr = QtCore.QByteArray()
|
arr = QtCore.QByteArray()
|
||||||
buf = QtCore.QBuffer(arr)
|
buf = QtCore.QBuffer(arr)
|
||||||
svg = QtSvg.QSvgGenerator()
|
svg = QtSvg.QSvgGenerator()
|
||||||
svg.setOutputDevice(buf)
|
svg.setOutputDevice(buf)
|
||||||
dpi = QtGui.QDesktopWidget().physicalDpiX()
|
dpi = QtGui.QDesktopWidget().physicalDpiX()
|
||||||
### not really sure why this works, but it seems to be important:
|
|
||||||
#self.svg.setSize(QtCore.QSize(self.params['width']*dpi/90., self.params['height']*dpi/90.))
|
|
||||||
svg.setResolution(dpi)
|
svg.setResolution(dpi)
|
||||||
|
|
||||||
p = QtGui.QPainter()
|
p = QtGui.QPainter()
|
||||||
@ -350,7 +346,7 @@ def correctCoordinates(node, item):
|
|||||||
if ch.tagName == 'polyline':
|
if ch.tagName == 'polyline':
|
||||||
removeTransform = True
|
removeTransform = True
|
||||||
coords = np.array([[float(a) for a in c.split(',')] for c in ch.getAttribute('points').strip().split(' ')])
|
coords = np.array([[float(a) for a in c.split(',')] for c in ch.getAttribute('points').strip().split(' ')])
|
||||||
coords = pg.transformCoordinates(tr, coords, transpose=True)
|
coords = fn.transformCoordinates(tr, coords, transpose=True)
|
||||||
ch.setAttribute('points', ' '.join([','.join([str(a) for a in c]) for c in coords]))
|
ch.setAttribute('points', ' '.join([','.join([str(a) for a in c]) for c in coords]))
|
||||||
elif ch.tagName == 'path':
|
elif ch.tagName == 'path':
|
||||||
removeTransform = True
|
removeTransform = True
|
||||||
@ -365,7 +361,7 @@ def correctCoordinates(node, item):
|
|||||||
x = x[1:]
|
x = x[1:]
|
||||||
else:
|
else:
|
||||||
t = ''
|
t = ''
|
||||||
nc = pg.transformCoordinates(tr, np.array([[float(x),float(y)]]), transpose=True)
|
nc = fn.transformCoordinates(tr, np.array([[float(x),float(y)]]), transpose=True)
|
||||||
newCoords += t+str(nc[0,0])+','+str(nc[0,1])+' '
|
newCoords += t+str(nc[0,0])+','+str(nc[0,1])+' '
|
||||||
ch.setAttribute('d', newCoords)
|
ch.setAttribute('d', newCoords)
|
||||||
elif ch.tagName == 'text':
|
elif ch.tagName == 'text':
|
||||||
@ -375,7 +371,7 @@ def correctCoordinates(node, item):
|
|||||||
#[float(ch.getAttribute('x')), float(ch.getAttribute('y'))],
|
#[float(ch.getAttribute('x')), float(ch.getAttribute('y'))],
|
||||||
#[float(ch.getAttribute('font-size')), 0],
|
#[float(ch.getAttribute('font-size')), 0],
|
||||||
#[0,0]])
|
#[0,0]])
|
||||||
#c = pg.transformCoordinates(tr, c, transpose=True)
|
#c = fn.transformCoordinates(tr, c, transpose=True)
|
||||||
#ch.setAttribute('x', str(c[0,0]))
|
#ch.setAttribute('x', str(c[0,0]))
|
||||||
#ch.setAttribute('y', str(c[0,1]))
|
#ch.setAttribute('y', str(c[0,1]))
|
||||||
#fs = c[1]-c[2]
|
#fs = c[1]-c[2]
|
||||||
@ -397,7 +393,7 @@ def correctCoordinates(node, item):
|
|||||||
## correct line widths if needed
|
## correct line widths if needed
|
||||||
if removeTransform and ch.getAttribute('vector-effect') != 'non-scaling-stroke':
|
if removeTransform and ch.getAttribute('vector-effect') != 'non-scaling-stroke':
|
||||||
w = float(grp.getAttribute('stroke-width'))
|
w = float(grp.getAttribute('stroke-width'))
|
||||||
s = pg.transformCoordinates(tr, np.array([[w,0], [0,0]]), transpose=True)
|
s = fn.transformCoordinates(tr, np.array([[w,0], [0,0]]), transpose=True)
|
||||||
w = ((s[0]-s[1])**2).sum()**0.5
|
w = ((s[0]-s[1])**2).sum()**0.5
|
||||||
ch.setAttribute('stroke-width', str(w))
|
ch.setAttribute('stroke-width', str(w))
|
||||||
|
|
||||||
@ -443,36 +439,10 @@ def itemTransform(item, root):
|
|||||||
tr = item.sceneTransform()
|
tr = item.sceneTransform()
|
||||||
else:
|
else:
|
||||||
tr = itemTransform(nextRoot, root) * item.itemTransform(nextRoot)[0]
|
tr = itemTransform(nextRoot, root) * item.itemTransform(nextRoot)[0]
|
||||||
#pos = QtGui.QTransform()
|
|
||||||
#pos.translate(root.pos().x(), root.pos().y())
|
|
||||||
#tr = pos * root.transform() * item.itemTransform(root)[0]
|
|
||||||
|
|
||||||
|
|
||||||
return tr
|
return tr
|
||||||
|
|
||||||
|
|
||||||
#def correctStroke(node, item, root, width=1):
|
|
||||||
##print "==============", item, node
|
|
||||||
#if node.hasAttribute('stroke-width'):
|
|
||||||
#width = float(node.getAttribute('stroke-width'))
|
|
||||||
#if node.getAttribute('vector-effect') == 'non-scaling-stroke':
|
|
||||||
#node.removeAttribute('vector-effect')
|
|
||||||
#if isinstance(root, QtGui.QGraphicsScene):
|
|
||||||
#w = item.mapFromScene(pg.Point(width,0))
|
|
||||||
#o = item.mapFromScene(pg.Point(0,0))
|
|
||||||
#else:
|
|
||||||
#w = item.mapFromItem(root, pg.Point(width,0))
|
|
||||||
#o = item.mapFromItem(root, pg.Point(0,0))
|
|
||||||
#w = w-o
|
|
||||||
##print " ", w, o, w-o
|
|
||||||
#w = (w.x()**2 + w.y()**2) ** 0.5
|
|
||||||
##print " ", w
|
|
||||||
#node.setAttribute('stroke-width', str(w))
|
|
||||||
|
|
||||||
#for ch in node.childNodes:
|
|
||||||
#if isinstance(ch, xml.Element):
|
|
||||||
#correctStroke(ch, item, root, width)
|
|
||||||
|
|
||||||
def cleanXml(node):
|
def cleanXml(node):
|
||||||
## remove extraneous text; let the xml library do the formatting.
|
## remove extraneous text; let the xml library do the formatting.
|
||||||
hasElement = False
|
hasElement = False
|
||||||
|
@ -1,16 +1,3 @@
|
|||||||
#Exporters = []
|
|
||||||
#from pyqtgraph import importModules
|
|
||||||
#import os
|
|
||||||
#d = os.path.split(__file__)[0]
|
|
||||||
#for mod in importModules('', globals(), locals(), excludes=['Exporter']).values():
|
|
||||||
#if hasattr(mod, '__all__'):
|
|
||||||
#names = mod.__all__
|
|
||||||
#else:
|
|
||||||
#names = [n for n in dir(mod) if n[0] != '_']
|
|
||||||
#for k in names:
|
|
||||||
#if hasattr(mod, k):
|
|
||||||
#Exporters.append(getattr(mod, k))
|
|
||||||
|
|
||||||
from .Exporter import Exporter
|
from .Exporter import Exporter
|
||||||
from .ImageExporter import *
|
from .ImageExporter import *
|
||||||
from .SVGExporter import *
|
from .SVGExporter import *
|
||||||
|
@ -63,8 +63,8 @@ class Parallelize(object):
|
|||||||
self.showProgress = True
|
self.showProgress = True
|
||||||
if isinstance(progressDialog, basestring):
|
if isinstance(progressDialog, basestring):
|
||||||
progressDialog = {'labelText': progressDialog}
|
progressDialog = {'labelText': progressDialog}
|
||||||
import pyqtgraph as pg
|
from ..widgets.ProgressDialog import ProgressDialog
|
||||||
self.progressDlg = pg.ProgressDialog(**progressDialog)
|
self.progressDlg = ProgressDialog(**progressDialog)
|
||||||
|
|
||||||
if workers is None:
|
if workers is None:
|
||||||
workers = self.suggestedWorkerCount()
|
workers = self.suggestedWorkerCount()
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
from .remoteproxy import RemoteEventHandler, ClosedError, NoResultError, LocalObjectProxy, ObjectProxy
|
from .remoteproxy import RemoteEventHandler, ClosedError, NoResultError, LocalObjectProxy, ObjectProxy
|
||||||
import subprocess, atexit, os, sys, time, random, socket, signal
|
import subprocess, atexit, os, sys, time, random, socket, signal
|
||||||
import multiprocessing.connection
|
import multiprocessing.connection
|
||||||
import pyqtgraph as pg
|
from ..Qt import USE_PYSIDE
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -118,7 +119,7 @@ class Process(RemoteEventHandler):
|
|||||||
ppid=pid,
|
ppid=pid,
|
||||||
targetStr=targetStr,
|
targetStr=targetStr,
|
||||||
path=sysPath,
|
path=sysPath,
|
||||||
pyside=pg.Qt.USE_PYSIDE,
|
pyside=USE_PYSIDE,
|
||||||
debug=debug
|
debug=debug
|
||||||
)
|
)
|
||||||
pickle.dump(data, self.proc.stdin)
|
pickle.dump(data, self.proc.stdin)
|
||||||
@ -337,7 +338,7 @@ class RemoteQtEventHandler(RemoteEventHandler):
|
|||||||
RemoteEventHandler.__init__(self, *args, **kwds)
|
RemoteEventHandler.__init__(self, *args, **kwds)
|
||||||
|
|
||||||
def startEventTimer(self):
|
def startEventTimer(self):
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
self.timer = QtCore.QTimer()
|
self.timer = QtCore.QTimer()
|
||||||
self.timer.timeout.connect(self.processRequests)
|
self.timer.timeout.connect(self.processRequests)
|
||||||
self.timer.start(10)
|
self.timer.start(10)
|
||||||
@ -346,7 +347,7 @@ class RemoteQtEventHandler(RemoteEventHandler):
|
|||||||
try:
|
try:
|
||||||
RemoteEventHandler.processRequests(self)
|
RemoteEventHandler.processRequests(self)
|
||||||
except ClosedError:
|
except ClosedError:
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
QtGui.QApplication.instance().quit()
|
QtGui.QApplication.instance().quit()
|
||||||
self.timer.stop()
|
self.timer.stop()
|
||||||
#raise SystemExit
|
#raise SystemExit
|
||||||
@ -384,7 +385,7 @@ class QtProcess(Process):
|
|||||||
self.startEventTimer()
|
self.startEventTimer()
|
||||||
|
|
||||||
def startEventTimer(self):
|
def startEventTimer(self):
|
||||||
from pyqtgraph.Qt import QtGui, QtCore ## avoid module-level import to keep bootstrap snappy.
|
from ..Qt import QtGui, QtCore ## avoid module-level import to keep bootstrap snappy.
|
||||||
self.timer = QtCore.QTimer()
|
self.timer = QtCore.QTimer()
|
||||||
if self._processRequests:
|
if self._processRequests:
|
||||||
app = QtGui.QApplication.instance()
|
app = QtGui.QApplication.instance()
|
||||||
@ -415,7 +416,7 @@ def startQtEventLoop(name, port, authkey, ppid, debug=False):
|
|||||||
conn = multiprocessing.connection.Client(('localhost', int(port)), authkey=authkey)
|
conn = multiprocessing.connection.Client(('localhost', int(port)), authkey=authkey)
|
||||||
if debug:
|
if debug:
|
||||||
print('[%d] connected; starting remote proxy.' % os.getpid())
|
print('[%d] connected; starting remote proxy.' % os.getpid())
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
#from PyQt4 import QtGui, QtCore
|
#from PyQt4 import QtGui, QtCore
|
||||||
app = QtGui.QApplication.instance()
|
app = QtGui.QApplication.instance()
|
||||||
#print app
|
#print app
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from pyqtgraph import Transform3D
|
from .. import Transform3D
|
||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from OpenGL import GL
|
from OpenGL import GL
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from pyqtgraph.Qt import QtCore, QtGui, QtOpenGL
|
from ..Qt import QtCore, QtGui, QtOpenGL
|
||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
import OpenGL.GL.framebufferobjects as glfbo
|
import OpenGL.GL.framebufferobjects as glfbo
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from pyqtgraph import Vector
|
from .. import Vector
|
||||||
import pyqtgraph.functions as fn
|
from .. import functions as fn
|
||||||
|
|
||||||
##Vector = QtGui.QVector3D
|
##Vector = QtGui.QVector3D
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ class GLViewWidget(QtOpenGL.QGLWidget):
|
|||||||
self._itemNames[id(i)] = i
|
self._itemNames[id(i)] = i
|
||||||
i.paint()
|
i.paint()
|
||||||
except:
|
except:
|
||||||
import pyqtgraph.debug
|
from .. import debug
|
||||||
pyqtgraph.debug.printExc()
|
pyqtgraph.debug.printExc()
|
||||||
msg = "Error while drawing item %s." % str(item)
|
msg = "Error while drawing item %s." % str(item)
|
||||||
ver = glGetString(GL_VERSION)
|
ver = glGetString(GL_VERSION)
|
||||||
@ -345,7 +345,7 @@ class GLViewWidget(QtOpenGL.QGLWidget):
|
|||||||
## Only to be called from within exception handler.
|
## Only to be called from within exception handler.
|
||||||
ver = glGetString(GL_VERSION).split()[0]
|
ver = glGetString(GL_VERSION).split()[0]
|
||||||
if int(ver.split('.')[0]) < 2:
|
if int(ver.split('.')[0]) < 2:
|
||||||
import pyqtgraph.debug
|
from .. import debug
|
||||||
pyqtgraph.debug.printExc()
|
pyqtgraph.debug.printExc()
|
||||||
raise Exception(msg + " The original exception is printed above; however, pyqtgraph requires OpenGL version 2.0 or greater for many of its 3D features and your OpenGL version is %s. Installing updated display drivers may resolve this issue." % ver)
|
raise Exception(msg + " The original exception is printed above; however, pyqtgraph requires OpenGL version 2.0 or greater for many of its 3D features and your OpenGL version is %s. Installing updated display drivers may resolve this issue." % ver)
|
||||||
else:
|
else:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from pyqtgraph.Qt import QtGui
|
from ..Qt import QtGui
|
||||||
import pyqtgraph.functions as fn
|
from .. import functions as fn
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
class MeshData(object):
|
class MeshData(object):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from .GLViewWidget import GLViewWidget
|
from .GLViewWidget import GLViewWidget
|
||||||
|
|
||||||
## dynamic imports cause too many problems.
|
## dynamic imports cause too many problems.
|
||||||
#from pyqtgraph import importAll
|
#from .. import importAll
|
||||||
#importAll('items', globals(), locals())
|
#importAll('items', globals(), locals())
|
||||||
|
|
||||||
from .items.GLGridItem import *
|
from .items.GLGridItem import *
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from pyqtgraph.Qt import QtCore, QtGui, QtOpenGL
|
from ..Qt import QtCore, QtGui, QtOpenGL
|
||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
app = QtGui.QApplication([])
|
app = QtGui.QApplication([])
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
from pyqtgraph import QtGui
|
from ... import QtGui
|
||||||
|
|
||||||
__all__ = ['GLAxisItem']
|
__all__ = ['GLAxisItem']
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
from pyqtgraph.Qt import QtGui
|
from ...Qt import QtGui
|
||||||
import pyqtgraph as pg
|
from ... import functions as fn
|
||||||
|
|
||||||
__all__ = ['GLBoxItem']
|
__all__ = ['GLBoxItem']
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ class GLBoxItem(GLGraphicsItem):
|
|||||||
|
|
||||||
def setColor(self, *args):
|
def setColor(self, *args):
|
||||||
"""Set the color of the box. Arguments are the same as those accepted by functions.mkColor()"""
|
"""Set the color of the box. Arguments are the same as those accepted by functions.mkColor()"""
|
||||||
self.__color = pg.Color(*args)
|
self.__color = fn.Color(*args)
|
||||||
|
|
||||||
def color(self):
|
def color(self):
|
||||||
return self.__color
|
return self.__color
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
from pyqtgraph import QtGui
|
from ... import QtGui
|
||||||
|
|
||||||
__all__ = ['GLGridItem']
|
__all__ = ['GLGridItem']
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
from pyqtgraph.Qt import QtGui
|
from ...Qt import QtGui
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
__all__ = ['GLImageItem']
|
__all__ = ['GLImageItem']
|
||||||
|
@ -2,7 +2,7 @@ from OpenGL.GL import *
|
|||||||
from OpenGL.arrays import vbo
|
from OpenGL.arrays import vbo
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
from .. import shaders
|
from .. import shaders
|
||||||
from pyqtgraph import QtGui
|
from ... import QtGui
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
__all__ = ['GLLinePlotItem']
|
__all__ = ['GLLinePlotItem']
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
from .. MeshData import MeshData
|
from .. MeshData import MeshData
|
||||||
from pyqtgraph.Qt import QtGui
|
from ...Qt import QtGui
|
||||||
import pyqtgraph as pg
|
|
||||||
from .. import shaders
|
from .. import shaders
|
||||||
|
from ... import functions as fn
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ class GLMeshItem(GLGraphicsItem):
|
|||||||
if self.colors is None:
|
if self.colors is None:
|
||||||
color = self.opts['color']
|
color = self.opts['color']
|
||||||
if isinstance(color, QtGui.QColor):
|
if isinstance(color, QtGui.QColor):
|
||||||
glColor4f(*pg.glColor(color))
|
glColor4f(*fn.glColor(color))
|
||||||
else:
|
else:
|
||||||
glColor4f(*color)
|
glColor4f(*color)
|
||||||
else:
|
else:
|
||||||
@ -209,7 +209,7 @@ class GLMeshItem(GLGraphicsItem):
|
|||||||
if self.edgeColors is None:
|
if self.edgeColors is None:
|
||||||
color = self.opts['edgeColor']
|
color = self.opts['edgeColor']
|
||||||
if isinstance(color, QtGui.QColor):
|
if isinstance(color, QtGui.QColor):
|
||||||
glColor4f(*pg.glColor(color))
|
glColor4f(*fn.glColor(color))
|
||||||
else:
|
else:
|
||||||
glColor4f(*color)
|
glColor4f(*color)
|
||||||
else:
|
else:
|
||||||
|
@ -2,7 +2,7 @@ from OpenGL.GL import *
|
|||||||
from OpenGL.arrays import vbo
|
from OpenGL.arrays import vbo
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
from .. import shaders
|
from .. import shaders
|
||||||
from pyqtgraph import QtGui
|
from ... import QtGui
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
__all__ = ['GLScatterPlotItem']
|
__all__ = ['GLScatterPlotItem']
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from .GLMeshItem import GLMeshItem
|
from .GLMeshItem import GLMeshItem
|
||||||
from .. MeshData import MeshData
|
from .. MeshData import MeshData
|
||||||
from pyqtgraph.Qt import QtGui
|
from ...Qt import QtGui
|
||||||
import pyqtgraph as pg
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
from pyqtgraph.Qt import QtGui
|
from ...Qt import QtGui
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
__all__ = ['GLVolumeItem']
|
__all__ = ['GLVolumeItem']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user