本文整理匯總了Python中pyqtgraph.opengl.GLAxisItem方法的典型用法代碼示例。如果您正苦於以下問題:Python opengl.GLAxisItem方法的具體用法?Python opengl.GLAxisItem怎麽用?Python opengl.GLAxisItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyqtgraph.opengl
的用法示例。
在下文中一共展示了opengl.GLAxisItem方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLAxisItem [as 別名]
def __init__(self, parent=None):
super().__init__(parent=parent)
self._named_items = {}
self.noRepeatKeys.append(QtCore.Qt.Key_W)
self.noRepeatKeys.append(QtCore.Qt.Key_S)
self.noRepeatKeys.append(QtCore.Qt.Key_A)
self.noRepeatKeys.append(QtCore.Qt.Key_D)
self.w_gl_axis = gl.GLAxisItem(
size=None, antialias=True, glOptions='translucent')
self.addItem(self.w_gl_axis)
示例2: do_render
# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLAxisItem [as 別名]
def do_render(self, projected):
projected = self.rescale(projected)
x, y, z, _ = projected.shape
print(x, y, z)
d = float(max(x, y, z) * 2)
if self.plot is None:
self.plot = gl.GLVolumeItem(projected, smooth=False)
self.addItem(self.plot)
self.axis = gl.GLAxisItem(glOptions="opaque")
self.addItem(self.axis)
self.opts['distance'] = self.distance = d
else:
# Latest version has .setData but is not in PyPi
self.plot.data = projected
self.plot.initializeGL()
ratio = d / self.distance
self.opts['distance'] *= ratio
self.distance = d
self.plot.resetTransform()
self.plot.translate(-x/2, -y/2, -z/2)
self.axis.setSize(x, y, z)
self.axis.resetTransform()
self.axis.translate(-x/2, -y/2, -z/2)
# Give projectors a chance to register.
示例3: __init__
# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLAxisItem [as 別名]
def __init__(self):
self.app = pg.mkQApp()
self.view = gl.GLViewWidget()
coord = gl.GLAxisItem()
glLineWidth(3)
coord.setSize(3, 3, 3)
self.view.addItem(coord)