Ejemplo n.º 1
0
def _set_config(c):
    """Set the OpenGL configuration"""
    glformat = QGLFormat()
    glformat.setRedBufferSize(c['red_size'])
    glformat.setGreenBufferSize(c['green_size'])
    glformat.setBlueBufferSize(c['blue_size'])
    glformat.setAlphaBufferSize(c['alpha_size'])
    if QT5_NEW_API or PYSIDE6_API:
        # Qt5 >= 5.4.0 - below options automatically enabled if nonzero.
        glformat.setSwapBehavior(glformat.DoubleBuffer if c['double_buffer']
                                 else glformat.SingleBuffer)
    elif PYQT6_API:
        glformat.setSwapBehavior(
            glformat.SwapBehavior.DoubleBuffer
            if c['double_buffer'] else glformat.SwapBehavior.SingleBuffer)
    else:
        # Qt4 and Qt5 < 5.4.0 - buffers must be explicitly requested.
        glformat.setAccum(False)
        glformat.setRgba(True)
        glformat.setDoubleBuffer(True if c['double_buffer'] else False)
        glformat.setDepth(True if c['depth_size'] else False)
        glformat.setStencil(True if c['stencil_size'] else False)
        glformat.setSampleBuffers(True if c['samples'] else False)
    glformat.setDepthBufferSize(c['depth_size'] if c['depth_size'] else 0)
    glformat.setStencilBufferSize(
        c['stencil_size'] if c['stencil_size'] else 0)
    glformat.setSamples(c['samples'] if c['samples'] else 0)
    glformat.setStereo(c['stereo'])
    return glformat
Ejemplo n.º 2
0
def _set_config(c):
    """Set the OpenGL configuration"""
    glformat = QGLFormat()
    glformat.setRedBufferSize(c['red_size'])
    glformat.setGreenBufferSize(c['green_size'])
    glformat.setBlueBufferSize(c['blue_size'])
    glformat.setAlphaBufferSize(c['alpha_size'])
    if QT5_NEW_API:
        # Qt5 >= 5.4.0 - below options automatically enabled if nonzero.
        glformat.setSwapBehavior(glformat.DoubleBuffer if c['double_buffer']
                                 else glformat.SingleBuffer)
    else:
        # Qt4 and Qt5 < 5.4.0 - buffers must be explicitly requested.
        glformat.setAccum(False)
        glformat.setRgba(True)
        glformat.setDoubleBuffer(True if c['double_buffer'] else False)
        glformat.setDepth(True if c['depth_size'] else False)
        glformat.setStencil(True if c['stencil_size'] else False)
        glformat.setSampleBuffers(True if c['samples'] else False)
    glformat.setDepthBufferSize(c['depth_size'] if c['depth_size'] else 0)
    glformat.setStencilBufferSize(c['stencil_size'] if c['stencil_size']
                                  else 0)
    glformat.setSamples(c['samples'] if c['samples'] else 0)
    glformat.setStereo(c['stereo'])
    return glformat
Ejemplo n.º 3
0
     def __init__(self, parent, enableUi,File=""):
         f = QGLFormat()
         f.setStencil(True)
         f.setRgba(True)
         f.setDepth(True)
         f.setDoubleBuffer(True)
         QGLWidget.__init__(self, f, parent=parent)
         self.setMinimumSize(500, 500)
         self._enableUi=enableUi
         self.pymol = pymol2.PyMOL()# _pymolPool.getInstance()
         self.pymol.start()
         self.cmd = self.pymol.cmd
         # self.toPymolName = self.pymol.toPymolName ### Attribute Error
         self._pymolProcess()
         if not self._enableUi:
             self.pymol.cmd.set("internal_gui",0)
             self.pymol.cmd.set("internal_feedback",0)
             self.pymol.cmd.button("double_left","None","None")
             self.pymol.cmd.button("single_right","None","None")

         self.pymol.cmd.load(File)
         self.pymol.reshape(self.width(),self.height())
         self._timer = QtCore.QTimer()
         self._timer.setSingleShot(True)
         self._timer.timeout.connect(self._pymolProcess)
         self.resizeGL(self.width(),self.height())
         #globalSettings.settingsChanged.connect(self._updateGlobalSettings)
         self._updateGlobalSettings()
Ejemplo n.º 4
0
Archivo: _qt.py Proyecto: bdvd/vispy
def _set_config(c):
    """Set the OpenGL configuration"""
    glformat = QGLFormat()
    glformat.setRedBufferSize(c["red_size"])
    glformat.setGreenBufferSize(c["green_size"])
    glformat.setBlueBufferSize(c["blue_size"])
    glformat.setAlphaBufferSize(c["alpha_size"])
    glformat.setAccum(False)
    glformat.setRgba(True)
    glformat.setDoubleBuffer(True if c["double_buffer"] else False)
    glformat.setDepth(True if c["depth_size"] else False)
    glformat.setDepthBufferSize(c["depth_size"] if c["depth_size"] else 0)
    glformat.setStencil(True if c["stencil_size"] else False)
    glformat.setStencilBufferSize(c["stencil_size"] if c["stencil_size"] else 0)
    glformat.setSampleBuffers(True if c["samples"] else False)
    glformat.setSamples(c["samples"] if c["samples"] else 0)
    glformat.setStereo(c["stereo"])
    return glformat
Ejemplo n.º 5
0
def _set_config(c):
    """Set the OpenGL configuration"""
    glformat = QGLFormat()
    glformat.setRedBufferSize(c['red_size'])
    glformat.setGreenBufferSize(c['green_size'])
    glformat.setBlueBufferSize(c['blue_size'])
    glformat.setAlphaBufferSize(c['alpha_size'])
    glformat.setAccum(False)
    glformat.setRgba(True)
    glformat.setDoubleBuffer(True if c['double_buffer'] else False)
    glformat.setDepth(True if c['depth_size'] else False)
    glformat.setDepthBufferSize(c['depth_size'] if c['depth_size'] else 0)
    glformat.setStencil(True if c['stencil_size'] else False)
    glformat.setStencilBufferSize(
        c['stencil_size'] if c['stencil_size'] else 0)
    glformat.setSampleBuffers(True if c['samples'] else False)
    glformat.setSamples(c['samples'] if c['samples'] else 0)
    glformat.setStereo(c['stereo'])
    return glformat