Python源码示例:pyqtgraph.opengl.GLAxisItem()

示例1
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
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
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) 
示例4
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)