当前位置: 首页>>代码示例>>Python>>正文


Python QGLWidget.__init__方法代码示例

本文整理汇总了Python中PySide.QtOpenGL.QGLWidget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QGLWidget.__init__方法的具体用法?Python QGLWidget.__init__怎么用?Python QGLWidget.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtOpenGL.QGLWidget的用法示例。


在下文中一共展示了QGLWidget.__init__方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
    def __init__(self, dimension, textureAtlas=None, geometryCache=None, sharedGLWidget=None):
        """

        :param dimension:
        :type dimension: WorldEditorDimension
        :param textureAtlas:
        :type textureAtlas: TextureAtlas
        :param geometryCache:
        :type geometryCache: GeometryCache
        :param sharedGLWidget:
        :type sharedGLWidget: QGLWidget
        :return:
        :rtype:
        """
        QGLWidget.__init__(self, shareWidget=sharedGLWidget)
        self.setSizePolicy(QtGui.QSizePolicy.Policy.Expanding, QtGui.QSizePolicy.Policy.Expanding)
        self.setFocusPolicy(Qt.ClickFocus)

        self.layerToggleGroup = LayerToggleGroup()
        self.layerToggleGroup.layerToggled.connect(self.setLayerVisible)

        self.dimension = None
        self.worldScene = None
        self.loadableChunksNode = None
        self.textureAtlas = None

        self.mouseRay = Ray(Vector(0, 1, 0), Vector(0, -1, 0))

        self.setMouseTracking(True)

        self.lastAutoUpdate = time.time()
        self.autoUpdateInterval = 0.5  # frequency of screen redraws in response to loaded chunks

        self.compassNode = self.createCompass()
        self.compassOrthoNode = scenegraph.OrthoNode((1, float(self.height()) / self.width()))
        self.compassOrthoNode.addChild(self.compassNode)

        self.viewActions = []
        self.pressedKeys = set()

        self.setTextureAtlas(textureAtlas)

        if geometryCache is None and sharedGLWidget is not None:
            geometryCache = sharedGLWidget.geometryCache
        if geometryCache is None:
            geometryCache = GeometryCache()
        self.geometryCache = geometryCache

        self.matrixNode = None
        self.overlayNode = scenegraph.Node()

        self.sceneGraph = None
        self.renderGraph = None

        self.frameSamples = deque(maxlen=500)
        self.frameSamples.append(time.time())

        self.cursorNode = None

        self.setDimension(dimension)
开发者ID:cagatayikim,项目名称:mcedit2,代码行数:62,代码来源:worldview.py

示例2: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
    def __init__(self, **kwargs):
        QGLWidget.__init__(self, **kwargs)
        self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)

        self.opengl_resize = kwargs.get('resize', True)
        self.opengl_keep_aspect = kwargs.get('keep_aspect', True)
        self.opengl_data = None
开发者ID:duke-iml,项目名称:ece490-s2016,代码行数:9,代码来源:numpy_widget.py

示例3: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
    def __init__(self, debug_mode=None):
        '''
        Constructor
        '''
        QGLWidget.__init__(self)
        
        self.DEBUG_MODE = debug_mode
        
        self.texture_manager = TextureManager()
        self.render_state = RenderState()
        
        self.projection_matrix = None
        self.view_matrix = None
        
        self.update_closures = []

        self.all_managers = []
        self.managers_to_reload = []
        self.layers_to_managers = {}
        
        def queue_for_reload(rom, full_reload):
            self.managers_to_reload.append(self.ManagerReloadData(rom, full_reload))
        
        self.update_listener = queue_for_reload
    
        # The skybox should go behind everything.
        self.sky_box = SkyBox(0x10000000, self.texture_manager)
        self.sky_box.enabled = False
        self.add_object_manager(self.sky_box)
    
        #The overlays go on top of everything.
        self.overlay_manager = OverlayManager(0xEFFFFFFF, self.texture_manager)
        self.add_object_manager(self.overlay_manager)
        
        
开发者ID:NBor,项目名称:SkyPython,代码行数:35,代码来源:SkyRenderer.py

示例4: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
 def __init__(self, parent=None):
     QGLWidget.__init__(self, parent)
     self.timer = QTimer(self)
     # the timer, which drives the animation
     self.timer.timeout.connect(self.update)
     # the angle, by which the spiral is rotated
     self.angle = 0
     self.spiral = self.update_spiral()
开发者ID:MiguelCarrilhoGT,项目名称:snippets,代码行数:10,代码来源:painting.py

示例5: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
 def __init__(self, parent=None):
     QGLWidget.__init__(self, parent)
     self.setAutoBufferSwap(False)
     self.resize(640, 480)
     self.opengl_thread = QThread()
     QCoreApplication.instance().aboutToQuit.connect(self.clean_up_before_quit)
     self.trackball = Trackball()
     self.preferredSize = None
     self.setFocusPolicy(Qt.WheelFocus)
开发者ID:harry159821,项目名称:cinemol,代码行数:11,代码来源:cinemol_canvas.py

示例6: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
  def __init__(self, parent=None):

      QGLWidget.__init__(self, parent)
      self.object = 0
      self.xRot = 0
      self.yRot = 0
      self.zRot = 0
      self.lastPos = QtCore.QPoint()
      self.trolltechGreen = QtGui.QColor.fromCmykF(0.40, 0.0, 1.0, 0.0)
      self.trolltechPurple = QtGui.QColor.fromCmykF(0.39, 0.39, 0.0, 0.0)
开发者ID:futureneer,项目名称:wallframe_apps,代码行数:12,代码来源:python_example_app_opengl.py

示例7: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
    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()
        self.setFocusPolicy(Qt.ClickFocus)
        #self.Parser = self.

        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)
        
        # inFile = "./data/scTIM.pdb"
        
        if(File[-9:-1] == "scTIM.pdb"):
            self.cmd.show("cartoon", "chain B")
            self.cmd.hide("lines", "chain B")
        else:
            self.cmd.hide("all")
            self.cmd.cartoon("tube")
            self.cmd.show("cartoon")
            
        
        #self.cmd.show("cartoon")
        #self.cmd.cartoon("putty")
        self.cmd.set("cartoon_highlight_color", 1)
        #self.cmd.hide("lines")
        #self.cmd.hide("chain ")
        self.color_obj(0)
        #self.cmd.color("marine")
        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()
        define_color(self.cmd.set_color)

        # used for save the color of residues
        self._color_cache = {}
        self._selected =[]
开发者ID:cadmuxe,项目名称:biovis,代码行数:57,代码来源:pymolWidget.py

示例8: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
    def __init__(self):
        QGLWidget.__init__(self)
        self.triangleCount = 0
        self.edgeCount = 0
        self.pointCount = 0
        self.triangleVertexArrayObject = None
        self.edgeVertexArrayObject = None
        self.pointVertexArrayObject = None

        self.drawTriangles = False
        self.drawLines = False
        self.drawPoints = False

        self.lastMouseX = 0
        self.lastMouseY = 0
        self.camera = Camera([0.0, 0.0, -1.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0])
        self.WVPMatrix = None
        self.setProperty("class", "AlgorithmVisualizerWidget")
        self.UpdateWVPMatrix()
开发者ID:olinord,项目名称:AlgorithmVisualizer,代码行数:21,代码来源:app.py

示例9: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
    def __init__(self, dimension, textureAtlas=None, geometryCache=None, sharedGLWidget=None):
        """

        :param dimension:
        :type dimension: WorldEditorDimension
        :param textureAtlas:
        :type textureAtlas: TextureAtlas
        :param geometryCache:
        :type geometryCache: GeometryCache
        :param sharedGLWidget:
        :type sharedGLWidget: QGLWidget
        :return:
        :rtype:
        """
        QGLWidget.__init__(self, shareWidget=sharedGLWidget)
        self.dimension = None
        self.worldScene = None
        self.loadableChunksNode = None
        self.textureAtlas = None

        validateWidgetQGLContext(self)


        self.bufferSwapDone = True

        if THREADED_BUFFER_SWAP:
            self.setAutoBufferSwap(False)
            self.bufferSwapThread = QtCore.QThread()
            self.bufferSwapper = BufferSwapper(self)
            self.bufferSwapper.moveToThread(self.bufferSwapThread)
            self.doSwapBuffers.connect(self.bufferSwapper.swap)
            self.bufferSwapThread.start()

        self.setAcceptDrops(True)
        self.setSizePolicy(QtGui.QSizePolicy.Policy.Expanding, QtGui.QSizePolicy.Policy.Expanding)
        self.setFocusPolicy(Qt.ClickFocus)

        self.layerToggleGroup = LayerToggleGroup()
        self.layerToggleGroup.layerToggled.connect(self.setLayerVisible)

        self.mouseRay = Ray(Vector(0, 1, 0), Vector(0, -1, 0))

        self.setMouseTracking(True)

        self.lastAutoUpdate = time.time()
        self.autoUpdateInterval = 0.5  # frequency of screen redraws in response to loaded chunks

        self.compassNode = self.createCompass()
        self.compassOrtho = Ortho((1, float(self.height()) / self.width()))
        self.compassNode.addState(self.compassOrtho)

        self.viewActions = []
        self.pressedKeys = set()

        self.setTextureAtlas(textureAtlas)

        if geometryCache is None and sharedGLWidget is not None:
            geometryCache = sharedGLWidget.geometryCache
        if geometryCache is None:
            geometryCache = GeometryCache()
        self.geometryCache = geometryCache

        self.worldNode = None
        self.skyNode = None
        self.overlayNode = scenenode.Node("WorldView Overlay")

        self.sceneGraph = None
        self.renderGraph = None

        self.frameSamples = deque(maxlen=500)
        self.frameSamples.append(time.time())

        self.cursorNode = None

        self.setDimension(dimension)
开发者ID:qtx0213,项目名称:mcedit2,代码行数:77,代码来源:worldview.py

示例10: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
 def __init__(self, parent):
     QGLWidget.__init__(self, parent)
开发者ID:reilleya,项目名称:pyFractals,代码行数:4,代码来源:fractalwidget.py

示例11: __init__

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import __init__ [as 别名]
 def __init__(self, _keyframe, _object, parent=None):
     QGLWidget.__init__(self, parent)
     self.frame = _keyframe
     self.object = _object
     self.texture = None
     self.object_drawer = None
开发者ID:ReptoidBusters,项目名称:object-detection,代码行数:8,代码来源:preview.py


注:本文中的PySide.QtOpenGL.QGLWidget.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。