예제 #1
0
    def __init__(self, parent=None, **kwargs):
        super(NavigationGraphicsView, self).__init__(parent, **kwargs)
        self._viewbox = None
        self._autoscale = True
        self.setMouseTracking(True)

        # default pen
        self._pen = QtGui.QPen()
        self._pen.setColor(self.BOXCOLOR)
        self._pen.setWidth(self.BOXWIDTH)
예제 #2
0
    def plot(self, polygon):
        #~ if points[0] != points[-1]:
            #~ poly.append(poly[0])

        # View box on the overview
        pen = QtGui.QPen(QtCore.Qt.SolidLine)
        pen.setColor(QtGui.QColor(QtCore.Qt.red))

        item = self.graphicsview.scene().addPolygon(polygon, pen)
        item.setZValue(1)

        return item