Esempio n. 1
0
    def mousePressEvent(self, ev):
        regionSize = 5
        mousePos = ev.pos()
        self.mousePos1 = mousePos
        region = (mousePos.x(), mousePos.y(), regionSize, regionSize)

        items = self.itemsAt(region)
        for item in items:
            print(item)
            if isinstance(item, gl.GLMeshItem) and item.parentItem() == self.grabberElement:
                self.selectedGrabber = self.grabberElement
                return
        print("GLWidet mousePRess")
        super(GLViewWidget, self).mousePressEvent(ev)
        GLViewWidget.mousePressEvent(self, ev)
Esempio n. 2
0
    def mouseReleaseEvent(self, event):
        """
        The Qt event handler when the mouse is released

        Release potentially selected slicing planes.
        Then pass the event to the parent class

        :param QMouseEvent event: the qt mouse event
        """
        self._slice_planes.release()
        return GLViewWidget.mousePressEvent(self, event)
Esempio n. 3
0
    def mouseReleaseEvent(self, event):
        """
        The Qt event handler when the mouse is released

        Release potentially selected slicing planes.
        Then pass the event to the parent class

        :param QMouseEvent event: the qt mouse event
        """
        self._slice_planes.release()
        return GLViewWidget.mousePressEvent(self, event)
Esempio n. 4
0
    def mousePressEvent(self, event):
        """
        The Qt event handler when the mouse is pressed down

        If a slicing plane was clicked select it and save the mouse position.
        Otherwise pass the event to the parent class.

        :param QMouseEvent event: the qt mouse event
        """
        x, y = event.x(), event.y()
        hits = self.itemsAt((x - 10, y - 10, 20, 20))
        if hits:
            self._mouse_pos = x, y
            self._slice_planes.select(hits[0])
        return GLViewWidget.mousePressEvent(self, event)
Esempio n. 5
0
    def mousePressEvent(self, event):
        """
        The Qt event handler when the mouse is pressed down

        If a slicing plane was clicked select it and save the mouse position.
        Otherwise pass the event to the parent class.

        :param QMouseEvent event: the qt mouse event
        """
        x, y = event.x(), event.y()
        hits = self.itemsAt((x - 10, y - 10, 20, 20))
        if hits:
            self._mouse_pos = x, y
            self._slice_planes.select(hits[0])
        return GLViewWidget.mousePressEvent(self, event)