Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BesPaveText Class Reference

#include <BesPaveText.h>

List of all members.

Public Member Functions

 BesPaveText (const BesPaveText &pavetext)
 BesPaveText (Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="br")
 BesPaveText ()
 BesPaveText (const BesPaveText &pavetext)
 BesPaveText (Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="br")
 BesPaveText ()
virtual void SetPos (Int_t px, Int_t py)
virtual void SetPos (Int_t px, Int_t py)
virtual void SetText (vector< TString > infoCon)
virtual void SetText (vector< TString > infoCon)

Protected Attributes

Double_t fdxNDC
Double_t fdyNDC
Double_t fTextSize


Constructor & Destructor Documentation

BesPaveText::BesPaveText  ) 
 

BesPaveText::BesPaveText Double_t  x1,
Double_t  y1,
Double_t  x2,
Double_t  y2,
Option_t *  option = "br"
 

00018         :TPaveText(x1,y1,x2,y2,option)
00019 {
00020     SetFillColor(1001);
00021     SetBorderSize(1);
00022     SetCornerRadius(0.2);
00023 
00024     fTextSize = 0.025;
00025 }

BesPaveText::BesPaveText const BesPaveText pavetext  ) 
 

00028                                                     : TPaveText()
00029 {
00030 
00031 }

BesPaveText::BesPaveText  ) 
 

BesPaveText::BesPaveText Double_t  x1,
Double_t  y1,
Double_t  x2,
Double_t  y2,
Option_t *  option = "br"
 

BesPaveText::BesPaveText const BesPaveText pavetext  ) 
 


Member Function Documentation

virtual void BesPaveText::SetPos Int_t  px,
Int_t  py
[virtual]
 

void BesPaveText::SetPos Int_t  px,
Int_t  py
[virtual]
 

00076 {
00077     if (!gPad) {
00078         cout << "BesPaveText::SetPos, gPad does not exist" << endl;
00079         return;
00080     }
00081 
00082     Double_t x = gPad->AbsPixeltoX(px+10);
00083     Double_t y = gPad->AbsPixeltoY(py-10);
00084     Double_t x1, y1, x2, y2, xNDC, yNDC;
00085     gPad->GetRange(x1, y1, x2, y2);
00086     xNDC = (x-x1)/(x2-x1);
00087     yNDC = (y-y1)/(y2-y1);
00088     //cout << xNDC << " " << yNDC << endl;
00089 
00090     x1 = xNDC;
00091     y1 = yNDC;
00092     x2 = xNDC + fdxNDC;
00093     y2 = yNDC + fdyNDC;
00094 
00095     Double_t delta = 0.02;
00096     if (x2 > 1.0 && y2 > 1.0) {
00097         x1 -= (fdxNDC+delta);
00098         x2 -= (fdxNDC+delta);
00099         y1 -= (fdyNDC+delta);
00100         y2 -= (fdyNDC+delta);
00101     }
00102     else if (x2 > 1.0) {
00103         x1 -= fdxNDC;
00104         x2 -= fdxNDC;
00105     }
00106     if (y2 > 1.0) {
00107         y1 -= fdyNDC;
00108         y2 -= fdyNDC;
00109     }
00110 
00111     SetX1NDC(x1);
00112     SetY1NDC(y1);
00113     SetX2NDC(x2);
00114     SetY2NDC(y2);
00115     ConvertNDCtoPad();
00116 }

virtual void BesPaveText::SetText vector< TString >  infoCon  )  [virtual]
 

void BesPaveText::SetText vector< TString >  infoCon  )  [virtual]
 

00035 {
00036     Int_t n = infoCon.size();
00037     Double_t margin = GetMargin();
00038     Double_t dy = (1.0-margin*2)/n;
00039 
00040     Double_t coordx = 0.0;
00041     Double_t coordy = 0.0;
00042     for (Int_t i = 0; i < n; i++) {
00043         coordy = 1.0 - (i+1)*dy;
00044         if (n == 1) coordy = 1.0;
00045 
00046         TText* tdata = AddText(coordx, coordy, infoCon[i].Data());
00047         tdata->SetTextSize(fTextSize/1.2);
00048         tdata->SetTextFont(42);
00049         if (i == 0 && n > 4) {
00050             tdata->SetTextSize(fTextSize);
00051             tdata->SetTextFont(62);
00052         }
00053         tdata->SetTextColor(1);
00054         tdata->SetTextAlign(12);
00055 
00056         if (infoCon[i] == TString("Fired")) {
00057             tdata->SetTextColor(kRed);
00058             //tdata->SetTextSize(fTextSize);
00059             tdata->SetTextFont(72);
00060         }
00061     }
00062 
00063     fdxNDC = fTextSize * fLongest / 2.2;
00064     fdyNDC = fTextSize * n * 1.2; //fLines->GetSize() * 1.2;
00065 
00066     ConvertNDCtoPad();
00067     // This is necessary, or when fTip was drawn the first time, it will in center, as its fX1 fX2 fY1 fY2 have not been changed.
00068     SetX1NDC(0.0);
00069     SetY1NDC(0.0);
00070     SetX2NDC(fdxNDC);
00071     SetY2NDC(fdyNDC);
00072 }


Member Data Documentation

Double_t BesPaveText::fdxNDC [protected]
 

Double_t BesPaveText::fdyNDC [protected]
 

Double_t BesPaveText::fTextSize [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 15:53:02 2011 for BOSS6.5.5 by  doxygen 1.3.9.1