示例#1
0
    def initDirectionGraphicsView(self):
        '''
            Draw the coordinate-axes in the QGraphicsView that is responsible
            for visualization of the gradient direction for a single selected
            timestep
        '''
        view = self.graphicsView_direction
        scene = QtGui.QGraphicsScene()
        scene.setSceneRect(
            -40, -40, 80,
            80)  #set scene to be 100x100 with 0, 0 beeing the center point
        view.setScene(scene)
        view.scale(
            1, -1
        )  #reverse positive directions to match those in a common mathematical x/y plane

        xAxes = myArrow(QtCore.QPointF(0, -40),
                        QtCore.QPointF(0, 40),
                        arrowHeadSize=5,
                        lineWidth=0.5)
        yAxes = myArrow(QtCore.QPointF(-40, 0),
                        QtCore.QPointF(40, 0),
                        arrowHeadSize=5,
                        lineWidth=0.5)
        scene.addItem(xAxes)
        scene.addItem(yAxes)

        self._arrow = None  #pointer to the arrow object that will be created later
示例#2
0
 def on_singleGradientChanged(self, magnitude, direction):
     """  Update QGraphicsView with the gradient data"""
     self.clearSingleGradientDirectionArrow()
     
     angle = angle2bearing(direction)[0]
     self._arrow = myArrow(QtCore.QPointF(0, 0), None, angle=angle, length=40, lineWidth=1.5, arrowHeadSize=8, color=QtCore.Qt.blue)
     #print 'adding item', self._arrow, '  >>> ',
     self.graphicsView_direction.scene().addItem(self._arrow)
示例#3
0
    def initDirectionGraphicsView(self):
        '''
            Draw the coordinate-axes in the QGraphicsView that is responsible
            for visualization of the gradient direction for a single selected
            timestep
        '''
        view = self.graphicsView_direction
        scene = QtGui.QGraphicsScene()
        scene.setSceneRect(-40, -40, 80, 80)  #set scene to be 100x100 with 0, 0 beeing the center point
        view.setScene(scene)
        view.scale(1, -1)  #reverse positive directions to match those in a common mathematical x/y plane
        
        xAxes = myArrow(QtCore.QPointF(0, -40), QtCore.QPointF(0, 40), arrowHeadSize=5, lineWidth=0.5)
        yAxes = myArrow(QtCore.QPointF(-40, 0), QtCore.QPointF(40, 0), arrowHeadSize=5, lineWidth=0.5)
        scene.addItem(xAxes)
        scene.addItem(yAxes)

        self._arrow = None  #pointer to the arrow object that will be created later
示例#4
0
    def on_singleGradientChanged(self, magnitude, direction):
        """  Update QGraphicsView with the gradient data"""
        self.clearSingleGradientDirectionArrow()

        angle = angle2bearing(direction)[0]
        self._arrow = myArrow(QtCore.QPointF(0, 0),
                              None,
                              angle=angle,
                              length=40,
                              lineWidth=1.5,
                              arrowHeadSize=8,
                              color=QtCore.Qt.blue)
        #print 'adding item', self._arrow, '  >>> ',
        self.graphicsView_direction.scene().addItem(self._arrow)