Example #1
0
 def _roi(self, p0, type, buttons, modifiers):
     for plot in self._lstPlot:
         roi = plot.getROI(p0)
         if roi:
             if roi.regionType == RegionOfInterest.LEGEND:
                 eventObj = LegendEvent
             else:
                 eventObj = ROIEvent
             coords = DeviceCoordConverter(self.dwidth, self.dheight)
             coords.setNDC(p0.x, p0.y)
             p0dc = coords.getDC()
             QtGui.QApplication.sendEvent(
                 self,
                 eventObj(type, self.dwidth, self.dheight, p0dc.x, p0dc.y,
                          buttons, modifiers, roi))
Example #2
0
    def paintEvent(self, event):
        super(InteractiveGRWidget, self).paintEvent(event)
        self._painter.begin(self)
        if self.getMouseSelectionEnabled() and self._tselect:
            p0, p1 = self._tselect
            coords = DeviceCoordConverter(self.dwidth, self.dheight)
            coords.setNDC(p0.x, p0.y)
            p0dc = coords.getDC()
            coords.setNDC(p1.x, p1.y)
            p1dc = coords.getDC()
            if self._getPlotsForPoint(p0):
                rect = QtCore.QRect(QtCore.QPoint(p0dc.x, p0dc.y),
                                    QtCore.QPoint(p1dc.x, p1dc.y)).normalized()
                self._painter.setOpacity(.75)
                self._painter.drawRect(rect)
                self._painter.setOpacity(1.)

        self._painter.end()
Example #3
0
    def paintEvent(self, event):
        super(InteractiveGRWidget, self).paintEvent(event)
        self._painter.begin(self)
        if self.getMouseSelectionEnabled() and self._tselect:
            p0, p1 = self._tselect
            coords = DeviceCoordConverter(self.dwidth, self.dheight)
            coords.setNDC(p0.x, p0.y)
            p0dc = coords.getDC()
            coords.setNDC(p1.x, p1.y)
            p1dc = coords.getDC()
            if self._getPlotsForPoint(p0):
                rect = QtCore.QRect(QtCore.QPoint(p0dc.x, p0dc.y),
                                    QtCore.QPoint(p1dc.x, p1dc.y)).normalized()
                self._painter.setOpacity(.75)
                self._painter.drawRect(rect)
                self._painter.setOpacity(1.)

        self._painter.end()
Example #4
0
 def _roi(self, p0, type, buttons, modifiers):
     for plot in self._lstPlot:
         roi = plot.getROI(p0)
         if roi:
             if roi.regionType == RegionOfInterest.LEGEND:
                 eventObj = LegendEvent
             else:
                 eventObj = ROIEvent
             coords = DeviceCoordConverter(self.dwidth, self.dheight)
             coords.setNDC(p0.x, p0.y)
             p0dc = coords.getDC()
             QtGui.QApplication.sendEvent(self,
                                          eventObj(type,
                                                   self.dwidth,
                                                   self.dheight,
                                                   p0dc.x, p0dc.y,
                                                   buttons, modifiers,
                                                   roi))