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)
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
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)
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()
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)
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)
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 =[]
def __init__(self, verts_object): self.verts = verts_object self.vert_options = args_to_dict(self.verts.draw) self.gl_options = args_to_dict(self.set_options) fmt = QGLFormat() fmt.setRgba(True) fmt.setDoubleBuffer(False) QGLWidget.__init__(self, fmt) self.glInit() self.setMouseTracking(True) self.camera = camera() self.camera.setSceneRadius(2) self.camera.reset() self.isPressed = False self.oldx = self.oldy = 0
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()
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)
def __init__(self, parent): QGLWidget.__init__(self, parent)
def __init__(self): QGLWidget.__init__(self) self.camera = Camera(self) self.mouse = Mouse(self) self.clear_color = QColor.fromRgb(255, 255, 255)
def __init__(self, _keyframe, _object, parent=None): QGLWidget.__init__(self, parent) self.frame = _keyframe self.object = _object self.texture = None self.object_drawer = None