Ignore:
Timestamp:
11/24/03 01:34:31 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r2563 r2566  
    465465        max += 1;
    466466
    467     if (!TestBit(kNoLegend))
    468         UpdateLegend(min, max, islog);
     467    UpdateLegend(min, max, islog);
    469468
    470469    MHexagon hex;
     
    670669        }
    671670
     671        // FIXME: Should depend on the color of the pixel...
     672        //(GetColor(GetBinContent(i+1), min, max, 0));
     673        txt.SetTextColor(kRed);
    672674        txt.SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
    673675        txt.PaintText(h.GetX(), h.GetY(), num);
     
    926928void MHCamera::UpdateLegend(Float_t min, Float_t max, Bool_t islog)
    927929{
     930    const Float_t range = fGeomCam->GetMaxRadius()*1.05;
     931
     932    TArrow arr;
     933    arr.PaintArrow(-range*.9, -range*.9, -range*.6, -range*.9, 0.025);
     934    arr.PaintArrow(-range*.9, -range*.9, -range*.9, -range*.6, 0.025);
     935
     936    TString text;
     937    text += (int)(range*.3);
     938    text += "mm";
     939
     940    TText newtxt2;
     941    newtxt2.SetTextSize(0.04);
     942    newtxt2.PaintText(-range*.85, -range*.85, text);
     943
     944    text = "";
     945    text += (float)((int)(range*.3*fGeomCam->GetConvMm2Deg()*10))/10;
     946    text += "\\circ";
     947    text = text.Strip(TString::kLeading);
     948
     949    TLatex latex;
     950    latex.PaintLatex(-range*.85, -range*.75, 0, 0.04, text);
     951
     952    if (TestBit(kNoLegend))
     953        return;
     954
    928955    TPaveStats *stats = GetStatisticBox();
    929956
    930957    const Float_t hndc   = 0.92 - (stats ? stats->GetY1NDC() : 1);
    931     const Float_t range  = fGeomCam->GetMaxRadius()*1.05;
    932958    const Float_t H      = (0.75-hndc)*range;
    933959    const Float_t offset = hndc*range;
     
    966992        newbox.PaintBox(range, H*(i*h-1)-offset, range+w, H*((i+1)*h-1)-offset);
    967993    }
    968 
    969     TArrow arr;
    970     arr.PaintArrow(-range*.9, -range*.9, -range*.6, -range*.9, 0.025);
    971     arr.PaintArrow(-range*.9, -range*.9, -range*.9, -range*.6, 0.025);
    972 
    973     TString text;
    974     text += (int)(range*.3);
    975     text += "mm";
    976 
    977     TText newtxt2;
    978     newtxt2.SetTextSize(0.04);
    979     newtxt2.PaintText(-range*.85, -range*.85, text);
    980 
    981     text = "";
    982     text += (float)((int)(range*.3*fGeomCam->GetConvMm2Deg()*10))/10;
    983     text += "\\circ";
    984     text = text.Strip(TString::kLeading);
    985 
    986     TLatex latex;
    987     latex.PaintLatex(-range*.85, -range*.75, 0, 0.04, text);
    988994}
    989995
Note: See TracChangeset for help on using the changeset viewer.