void SWTrack::drawButtons(QPainter *pnt) { drawClose(pnt); drawMore (pnt); TrTrackR *trk = rEvent->pTrTrack(tID); if (!trk) return; QString str[NPAR] = { "L1-7", "+L8", "+L9", "+L89" }; int bdw[NPAR] = { 5, 11, 11, 2 }; int ifc = focusStatus/FOCUS_OPT/2-1; for (int i = 0; i < NPAR; i++) { int x = BFP_X+BFP_W*i; int y = tHei-MORE_H-MORE_Y; if (fitPar[i]) pnt->setPen(QColor(255, 50, 50, 200)); else pnt->setPen(QColor(150, 100, 100, 200)); if (fitPar[i] && (focusStatus & FOCUS_OPT) && ifc == i && i != fID) { pnt->fillRect(x-3, y+1, BFP_W-bdw[i], MORE_H, QColor(255, 255, 255, 50)); pnt->setPen(Qt::red); } drawText(pnt, x+15, y+1, str[i].toAscii().data()); pnt->drawRect(x, y+3, 10, MORE_H-4); if (i == fID) pnt->fillRect(x+2, y+5, 6, MORE_H-8, Qt::red); drawStatus |= FOCUS_OPT*(1 << i); } for (int i = 0; i < 2; i++) { int x = BLY_X+BLY_W*i; int y = tHei-MORE_H-MORE_Y; pnt->setPen(QColor(255, 50, 50, 200)); if ((focusStatus & FOCUS_OPT) && ifc == i+NPAR) { pnt->setPen(Qt::red); pnt->drawRect(x, y+1, BLY_W, MORE_H); pnt->fillRect(x, y+1, BLY_W, MORE_H, QColor(255, 255, 255, 50)); } if (i == 0) { if (lyrConf == 0 || lyrConf == 1) drawText(pnt, x+2, y+1, "<"); if (lyrConf == 2 || lyrConf == 3) drawText(pnt, x+2, y+1, ">"); } if (i == 1) { if (lyrConf == 0 || lyrConf == 2) drawText(pnt, x+2, y+1, ">"); if (lyrConf == 1 || lyrConf == 3) drawText(pnt, x+2, y+1, "<"); } } }
void SWLadder::drawInfobar(QPainter *pnt) { pnt->fillRect(0, 0, wWid-2, tHei, QColor(0, 0, 0, 200)); drawClose(pnt); drawMore (pnt); pnt->setPen(Qt::white); drawText(pnt, 28, 10, "Ladder"); drawText(pnt, 80, 10, Form(" TkID: %d", tkID)); drawText(pnt, 170, 10, Form("nClsX: %d", nClsX)); drawText(pnt, 240, 10, Form("nClsY: %d", nClsY)); drawText(pnt, 78, 30, Form(" nSen: %d", nSen )); drawText(pnt, 175, 30, Form(" nHit: %d", nHit )); drawText(pnt, 241, 30, Form("nHitT: %d", nHitT)); drawText(pnt, 310, 30, Form("nHitG: %d", nHitG)); if (focusStatus & FOCUS_DOBJ) { DrawObj dobj = drawObj.at(focusStatus/FOCUS_DOBJ/2-1); if ((dobj.atrb & ATR_CLSX) || (dobj.atrb & ATR_CLSY)) { TrClusterR *cls = rEvent->pTrCluster(dobj.idx); double sig = cls->GetTotSignal(TrClusterR::kAsym); drawText(pnt, 27, 50, Form("Cluster Side: %d", cls->GetSide())); drawText(pnt, 140, 50, Form("Seed: %d", cls->GetAddress() +cls->GetSeedIndex())); drawText(pnt, 220, 50, Form("Len: %d", cls->GetLength())); drawText(pnt, 270, 50, Form("Signal: %.0f", sig)); if (dobj.atrb & ATR_CLSX) drawText(pnt, 350, 50, Form("Mult: %d", dobj.mult)); } else if (dobj.atrb & ATR_HIT) { TrRecHitR *hit = rEvent->pTrRecHit(dobj.idx); char cf1 = (hit->OnlyY()) ? 'G' : '_'; char cf2 = (hit->checkstatus(AMSDBc::USED)) ? 'T' : '_'; AMSPoint coo = hit->GetCoord(dobj.mult); drawText(pnt, 48, 50, Form("Hit Flag: %c%c", cf1, cf2)); drawText(pnt, 150, 50, Form("Coo: (%.2f, %.2f, %.2f)", coo.x(), coo.y(), coo.z())); drawText(pnt, 350, 50, Form("Mult: %d", dobj.mult)); } else if (dobj.atrb & ATR_TRK) { TrTrackR *trk = rEvent->pTrTrack(dobj.idx); int fpat[8]; for (int i = 0; i < 8; i++) fpat[i] = 0; TString hpat; for (int i = 0; i < trk->GetNhits(); i++) { TrRecHitR *hit = trk->GetHit(i); int ily = hit->GetLayer()-1; fpat[ily] = (hit->OnlyY()) ? 1 : 2; } for (int i = 0; i < 8; i++) { if (fpat[i] == 1) hpat += "Y"; else if (fpat[i] == 2) hpat += "O"; else hpat += "_"; } drawText(pnt, 48, 50, "Track"); drawText(pnt, 100, 50, Form("nHit: %d", trk->GetNhits())); drawText(pnt, 170, 50, Form("nHitXY: %d", trk->GetNhitsXY())); drawText(pnt, 270, 50, Form("fPat: %s", hpat.Data())); } } }
void DragFrameShape::draw_Close(const DrawBuf &buf) const { drawClose(buf,btnClose); }