本文整理汇总了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)