def __init__(self, nCells=(3, 4), nSublines=(0, 0), pos=(0, 0), size=(1, 1), width=(0, 0), **kwargs): QuadROI.__init__(self, pos=pos, size=size, removable=True, **kwargs) self.nCells = list(nCells) self.nSublines = list(nSublines) self._shape = None self._size = size self.width = width self.circleOffs = QtCore.QSizeF(0, 0) self.homography() self._hCellSize = HH(self.setWidth2, self.handleSize, typ='s', pen={ 'color': 'b', 'width': 3 }, parent=self) self._hCellShape = HH(self.setCircle, self.handleSize, typ='s', pos=(0.5, 1), pen={ 'color': 'c', 'width': 3 }, parent=self)
def setCircle(self, _dx, dy): n = self.nCells[1] o = max(0, 2 * (dy - (0.5 / n))) return self.setCircleOffs(QtCore.QSizeF(0, o))