#include <BesPaveText.h>
Public Member Functions | |
BesPaveText () | |
BesPaveText (Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="br") | |
BesPaveText (const BesPaveText &pavetext) | |
virtual void | SetText (std::vector< TString > infoCon) |
virtual void | SetPos (Int_t px, Int_t py) |
Protected Attributes | |
Double_t | fTextSize |
Double_t | fdxNDC |
Double_t | fdyNDC |
Definition at line 11 of file BesPaveText.h.
BesPaveText::BesPaveText | ( | ) |
BesPaveText::BesPaveText | ( | Double_t | x1, | |
Double_t | y1, | |||
Double_t | x2, | |||
Double_t | y2, | |||
Option_t * | option = "br" | |||
) |
Definition at line 18 of file BesPaveText.cxx.
References fTextSize.
00019 :TPaveText(x1,y1,x2,y2,option) 00020 { 00021 SetFillColor(1001); 00022 SetBorderSize(1); 00023 SetCornerRadius(0.2); 00024 00025 fTextSize = 0.025; 00026 }
BesPaveText::BesPaveText | ( | const BesPaveText & | pavetext | ) |
void BesPaveText::SetPos | ( | Int_t | px, | |
Int_t | py | |||
) | [virtual] |
Definition at line 76 of file BesPaveText.cxx.
References fdxNDC, fdyNDC, and x.
Referenced by Tof2DScin::ExecuteEvent(), Muc2DStrip::ExecuteEvent(), Mdc2DWire::ExecuteEvent(), Emc2DCrystal::ExecuteEvent(), and BesGeoTrack::ExecuteEvent().
00077 { 00078 if (!gPad) { 00079 cout << "BesPaveText::SetPos, gPad does not exist" << endl; 00080 return; 00081 } 00082 00083 Double_t x = gPad->AbsPixeltoX(px+10); 00084 Double_t y = gPad->AbsPixeltoY(py-10); 00085 Double_t x1, y1, x2, y2, xNDC, yNDC; 00086 gPad->GetRange(x1, y1, x2, y2); 00087 xNDC = (x-x1)/(x2-x1); 00088 yNDC = (y-y1)/(y2-y1); 00089 //cout << xNDC << " " << yNDC << endl; 00090 00091 x1 = xNDC; 00092 y1 = yNDC; 00093 x2 = xNDC + fdxNDC; 00094 y2 = yNDC + fdyNDC; 00095 00096 Double_t delta = 0.02; 00097 if (x2 > 1.0 && y2 > 1.0) { 00098 x1 -= (fdxNDC+delta); 00099 x2 -= (fdxNDC+delta); 00100 y1 -= (fdyNDC+delta); 00101 y2 -= (fdyNDC+delta); 00102 } 00103 else if (x2 > 1.0) { 00104 x1 -= fdxNDC; 00105 x2 -= fdxNDC; 00106 } 00107 if (y2 > 1.0) { 00108 y1 -= fdyNDC; 00109 y2 -= fdyNDC; 00110 } 00111 00112 SetX1NDC(x1); 00113 SetY1NDC(y1); 00114 SetX2NDC(x2); 00115 SetY2NDC(y2); 00116 ConvertNDCtoPad(); 00117 }
virtual void BesPaveText::SetText | ( | std::vector< TString > | infoCon | ) | [virtual] |
Double_t BesPaveText::fdxNDC [protected] |
Double_t BesPaveText::fdyNDC [protected] |
Double_t BesPaveText::fTextSize [protected] |