void AspInteg::modify(spAspCell_t cell, int x, int y, int prevX, int prevY) { if(selectedHandle == 2) { // upfield, right, modify is pCoord[1].x += (x-prevX); sCoord[1].x=cell->pix2val(HORIZ,pCoord[1].x); double is = AspUtil::getReal("is",100.0); is += (prevY-y)*(0.01*is); AspUtil::setReal("is",is, false); } else if(selectedHandle == 1) { // modify both io and is pCoord[0].x += (x-prevX); sCoord[0].x=cell->pix2val(HORIZ,pCoord[0].x); double io = AspUtil::getReal("io",0); io += (prevY-y)/cell->getCali(VERT); AspUtil::setReal("io",io, false); double is = AspUtil::getReal("is",100.0); is -= (prevY-y)*(0.01*is); AspUtil::setReal("is",is, false); } else if(selected == ROI_SELECTED) { // change io double io = AspUtil::getReal("io",0); io += (prevY-y)/cell->getCali(VERT); AspUtil::setReal("io",io, false); for(int i=0; i<npts; i++) { pCoord[i].x += (x-prevX); sCoord[i].x=cell->pix2val(HORIZ,pCoord[i].x); } } else if(selected == LABEL_SELECTED) { labelLoc.x += (x - prevX); labelLoc.y += (y - prevY); } }
void AspRegion::modify(spAspCell_t cell, int x, int y, int prevX, int prevY) { // for now, modify both points if(selectedHandle) { pCoord[0].x += (x-prevX); pCoord[0].y += (y-prevY); sCoord[0].x=cell->pix2val(HORIZ,pCoord[0].x); sCoord[0].y=cell->pix2val(VERT,pCoord[0].y); } }
void AspRoi::modify(spAspCell_t cell, int x, int y, int prevx, int prevy) { if(cell == nullAspCell) return; double vx = cell->pix2val(HORIZ,x); double vy = cell->pix2val(VERT,y); double vxPrev = cell->pix2val(HORIZ,prevx); double vyPrev = cell->pix2val(VERT,prevy); mouseOverChanged=true; modifyRoi(vx,vy,vxPrev,vyPrev); }
void AspPolygon::create(spAspCell_t cell, int x, int y) { npts=2; if(sCoord) delete[] sCoord; if(pCoord) delete[] pCoord; sCoord = new Dpoint_t[npts]; pCoord = new Dpoint_t[npts]; pCoord[0].x=pCoord[1].x = x; pCoord[0].y=pCoord[1].y = y; sCoord[0].x=sCoord[1].x=cell->pix2val(HORIZ,x,mmbind); sCoord[0].y=sCoord[1].y=cell->pix2val(VERT,y,mmbind); disFlag = ANN_SHOW_ROI; created_type = ANNO_POLYGON; }
void AspPoint::create(spAspCell_t cell, int x, int y) { npts=1; if(sCoord) delete[] sCoord; if(pCoord) delete[] pCoord; sCoord = new Dpoint_t[npts]; pCoord = new Dpoint_t[npts]; pCoord[0].x = x; pCoord[0].y = y; sCoord[0].x = cell->pix2val(HORIZ,x,mmbind); sCoord[0].y = cell->pix2val(VERT,y,mmbind); disFlag = ANN_SHOW_ROI | ANN_SHOW_LABEL | ANN_SHOW_LINK; created_type = ANNO_POINT; }