Ignore:
Timestamp:
11/22/03 21:14:14 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2550 r2557  
    568568    Update(gPad->GetLogy(), isbox, iscol);
    569569    PaintAxisTitle();
     570
     571    if (opt.Contains("pixelindex"))
     572        PaintIndices(kFALSE);
     573    if (opt.Contains("sectorindex"))
     574        PaintIndices(kTRUE);
    570575}
    571576
     
    627632}
    628633
    629 void MHCamera::DrawPixelIndices()
     634void MHCamera::PaintIndices(Bool_t sector)
    630635{
    631636    if (fNcells<=1)
    632637        return;
    633 
    634     // FIXME: Is this correct?
    635     for (int i=0; i<kItemsLegend; i++)
    636         fColors[i] = 16;
    637 
    638     if (!gPad)
    639         Draw();
    640638
    641639    TText txt;
     
    645643    for (Int_t i=0; i<fNcells-2; i++)
    646644    {
     645        const MGeomPix &h = (*fGeomCam)[i];
     646
    647647        TString num;
    648         num += i;
    649 
    650         const MGeomPix &h = (*fGeomCam)[i];
    651         TText *nt = txt.DrawText(h.GetX(), h.GetY(), num);
    652         nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
    653     }
    654 }
    655 
    656 void MHCamera::DrawSectorIndices()
    657 {
    658     if (fNcells<=1)
    659         return;
    660 
    661     for (int i=0; i<kItemsLegend; i++)
    662         fColors[i] = 16;
    663 
    664     if (!gPad)
    665         Draw();
    666 
    667     TText txt;
    668     txt.SetTextFont(122);
    669     txt.SetTextAlign(22);   // centered/centered
    670 
    671     for (Int_t i=0; i<fNcells-2; i++)
    672     {
    673         TString num;
    674         num += (*fGeomCam)[i].GetSector();
    675 
    676         const MGeomPix &h = (*fGeomCam)[i];
    677         TText *nt = txt.DrawText(h.GetX(), h.GetY(), num);
    678         nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
     648        num += sector ? h.GetSector() : i;
     649
     650        txt.SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
     651        txt.PaintText(h.GetX(), h.GetY(), num);
    679652    }
    680653}
Note: See TracChangeset for help on using the changeset viewer.