Beispiel #1
0
    def __init__(self, display):
        Tool.__init__(self, display)

        self.paths = []
        #min time difference to add a line to qpainterpath
        #when drawing in [ms]:
        self.MIN_DT = 25
        self._timer = QtCore.QTime()

        self.pa = self.setParameterMenu()
        self.pa.sigChildRemoved.connect(self._removePath)

        self.pType = self.pa.addChild({
            'name':
            'Type',
            'type':
            'list',
            'value':
            'Freehand',
            'limits': ['Freehand', 'Rectangle', 'Grid', 'Isolines', 'Ellipse']
        })

        self.pNew = self.pa.addChild({
            'name': 'New',
            'type': 'action',
            'value': True
        })
        self.pNew.sigActivated.connect(self._new)
        self.pNew.sigActivated.connect(self._menu.resizeToContent)

        pMask = self.pa.addChild({'name': 'Create Mask', 'type': 'action'})
        pMask.sigActivated.connect(self._createMaskFromSelection)

        pArea = self.pa.addChild({'name': 'Measure areas', 'type': 'action'})
        pArea.sigActivated.connect(self._measurePath)

        self.pMask = pArea.addChild({
            'name': 'Relative to selection',
            'type': 'list',
            'value': '-',
            'limits': ['-']
        })
        self.pMask.items.keys()[0].widget.showPopup = self._updatePMask
Beispiel #2
0
    def __init__(self, display):
        Tool.__init__(self, display)

        self.paths = []
        #min time difference to add a line to qpainterpath
        #when drawing in [ms]:
        self.MIN_DT = 25
        self._timer = QtCore.QTime()

        self.pa = self.setParameterMenu()
        self.pa.sigChildRemoved.connect(self._removePath)

        pNew = self.pa.addChild({
            'name': 'New',
            'type': 'action',
            'value': True
        })
        pNew.sigActivated.connect(self._newCurve)
        pNew.sigActivated.connect(self._menu.hide)