void AspFrame::draw() { if(annoTop) set_top_frame_on_top(1); else set_top_frame_on_top(0); drawSpec(); // currently do nothing callAspDisplayListeners(); displayTop(); }
void AspFrame::modifyRoi(spAspRoi_t roi, int x, int y) { if(roi == nullAspRoi) return; spAspCell_t cell = selectCell(x,y); if(cell == nullAspCell) return; roi->modify(cell,x, y, AspMouse::prevX, AspMouse::prevY); displayTop(); }
// c1, c2 are in ppm, c1 is downfield, bigger ppm. void AspFrame::addRoiFromCursors(double c1, double c2) { if(c1<c2) {double tmp=c1; c1=c2; c2=tmp;} spAspDataInfo_t dataInfo = getDefaultDataInfo(); spAspCursor_t cursor1 = spAspCursor_t(new AspCursor(c1,dataInfo->haxis.name)); spAspCursor_t cursor2 = spAspCursor_t(new AspCursor(c2,dataInfo->haxis.name)); spAspRoi_t roi = spAspRoi_t(new AspRoi(cursor1,cursor2,roiList->getRoiMap()->size())); roiList->addRoi(roi); setAnnoFlag(ANN_ROIS); displayTop(); }
spAspRoi_t AspFrame::selectRoi(int x, int y, bool handle) { spAspCell_t cell = selectCell(x,y); if(cell == nullAspCell) return nullAspRoi; spAspRoi_t roi = roiList->selectRoi(cell, x,y,handle); if(roi != prevRoi || (roi != nullAspRoi && roi->mouseOverChanged)) displayTop(); prevRoi = roi; return roi; }
void AspFrame::deleteRoi() { double c1,c2; double reffrq = getDefaultDataInfo()->haxis.scale; if(getCursorMode() == 2) { P_getreal(CURRENT, "cr", &c1, 1); P_getreal(CURRENT, "delta", &c2, 1); c2 = c1 -c2; if (reffrq>0) { c1 /= reffrq; c2 /= reffrq; } roiList->deleteRoi(c1,c2); } else { P_getreal(CURRENT, "cr", &c1, 1); if (reffrq>0) { c1 /= reffrq; } roiList->deleteRoi(c1); } displayTop(); }
void AspFrame::selectRoiHandle(spAspRoi_t roi, int x, int y,bool handle) { spAspCell_t cell = selectCell(x,y); if(cell == nullAspCell) return; bool creating = AspMouse::creating; int prevX=AspMouse::prevX; int prevY=AspMouse::prevY; if(creating && roi->getRank() > 1) { if(x >= prevX && y >= prevY) roi->mouseOver = HANDLE3; else if(x >= prevX) roi->mouseOver = HANDLE2; else if(y >= prevY) roi->mouseOver = HANDLE4; else roi->mouseOver = HANDLE1; } else if(creating) { if(x >= prevX) roi->mouseOver = LINE2; else roi->mouseOver = LINE1; } else { roi->selectHandle(cell,x, y,handle); } displayTop(); }
void TopSceneParameter::displayLanguageTop(const QString &_value) { QString sql = "SELECT a.* FROM Song AS a where a.songLanguage='%1' ORDER BY a.songPlayCount DESC"; displayTop(sql.arg(_value)); }
void TopSceneParameter::displayNewSongTop() { QString sql = "SELECT a.* FROM Song AS a where a.newsong=1 ORDER BY a.songPlayCount DESC"; displayTop(sql); }
void TopSceneParameter::displayAllTop() { QString sql = "SELECT a.* FROM Song AS a ORDER BY a.songPlayCount DESC"; displayTop(sql); }
void AspFrame::setRoiHeight(int h) { roiList->setRoiHeight(h); displayTop(); }
void AspFrame::setRoiOpaque(int op) { roiList->setRoiOpaque(op); displayTop(); }
void AspFrame::setRoiColor(char *name) { roiList->setRoiColor(name); displayTop(); }
void AspFrame::showRois(bool b) { getRoiList()->setShowRois(b); setAnnoFlag(ANN_ROIS,b); displayTop(); }
void AspFrame::deleteRoi(spAspRoi_t roi) { roiList->deleteRoi(roi); displayTop(); }