def __init__(self, controller, parent=None): AbstractPathTool.__init__(self, controller, parent) self.dialog = QDialog() self.buttons = [] self.seqBox = None self.chosenStandardSequence = None # state for tab switching self.customSequenceIsValid = False # state for tab switching self.useCustomSequence = False # for applying sequence self.validatedSequenceToApply = None self.initDialog()
def updateLocation(self, pathHelix, scenePos, *args): AbstractPathTool.updateLocation(self, pathHelix, scenePos, *args) if pathHelix == None: return posItem = pathHelix.mapFromScene(scenePos) strandType, baseIdx = self.baseAtPoint(pathHelix, posItem) vh = pathHelix.vhelix() if strandType == StrandType.Scaffold: oppositeStrand = StrandType.Staple else: oppositeStrand = StrandType.Scaffold if vh.hasLoopOrSkipAt(strandType, baseIdx) > 0: loopBases = vh.hasLoopOrSkipAt(strandType, baseIdx) compLoopBases = vh.hasLoopOrSkipAt(oppositeStrand, baseIdx) if loopBases != compLoopBases and strandType == StrandType.Staple: newLoc = pathHelix.baseLocation(strandType, baseIdx) if self.pos() != newLoc: self.setPos(*newLoc) if not self.isVisible(): self.show() return if vh.hasEmptyAt(strandType, baseIdx): if self.isVisible(): self.hide() return fivePBase = pathHelix.vhelix().fivePEndOfSegmentThrough(StrandType.Scaffold, baseIdx) if fivePBase == None: self.hide() else: vh, strandType, idx = fivePBase phg = pathHelix.pathHelixGroup() ph2 = phg.pathHelixForVHelix(vh) fivePBaseLoc = QPointF(*ph2.baseLocation(strandType, idx)) fivePBaseLocSelfCoords = pathHelix.mapFromItem(ph2, fivePBaseLoc) self.setPos(fivePBaseLocSelfCoords) if not self.isVisible(): self.show()
def __init__(self, controller, parent=None): AbstractPathTool.__init__(self, controller, parent)
def hoverMovePathHelix(self, pathHelix, event): AbstractPathTool.hoverMovePathHelix(self, pathHelix, event) self.updateDrag(pathHelix, event)
def setActive(self, willBeActive): AbstractPathTool.setActive(self, willBeActive) self.updateDrag(None, None, mustEnd=True)