21 TBoxClipped(
double a,
double b,
double c,
double d) : TBox(a, b, c, d){}
22 virtual void Paint(Option_t* option)
24 const double ux1 = gPad->GetUxmin(), uy1 = gPad->GetUymin();
25 const double ux2 = gPad->GetUxmax(), uy2 = gPad->GetUymax();
28 if(fX1 < ux1 && fX2 < ux1)
return;
29 if(fX1 > ux2 && fX2 > ux2)
return;
32 if(fY1 < uy1 && fY2 < uy1)
return;
33 if(fY1 > uy2 && fY2 > uy2)
return;
37 const double x1 = fX1,
y1 = fY1,
x2 = fX2,
y2 = fY2;
42 if(fX1 < ux1) fX1 = ux1;
43 if(fX2 > ux2) fX2 = ux2;
46 if(fY1 < uy1) fY1 = uy1;
47 if(fY2 > uy2) fY2 = uy2;
53 fX1 =
x1; fX2 =
x2; fY1 =
y1; fY2 =
y2;
95 gPad->SetBit(TGraph::kClipFrame,
true);
99 for_each(fPolyLineL.begin(), fPolyLineL.end(),
draw_tobject());
101 for_each(fMarkerL.begin(), fMarkerL.end(),
draw_tobject());
102 for_each(fPolyMarkerL.begin(),fPolyMarkerL.end(),
draw_tobject());
104 for_each(fLatexL.begin(), fLatexL.end(),
draw_tobject());
112 fgMarkerL.splice(fgMarkerL.end(), fMarkerL);
113 fgArcL.splice(fgArcL.end(), fArcL);
114 fgBoxL.splice(fgBoxL.end(), fBoxL);
115 fgPolyLineL.splice(fgPolyLineL.end(), fPolyLineL);
116 fgLineL.splice(fgLineL.end(), fLineL);
117 fgPolyMarkerL.splice(fgPolyMarkerL.end(), fPolyMarkerL);
118 fgTextL.splice(fgTextL.end(), fTextL);
119 fgLatexL.splice(fgLatexL.end(), fLatexL);
132 if(fgMarkerL.empty()){
133 m =
new TMarker(x,y,st);
134 m->SetBit(kCanDelete,kFALSE);
135 m->SetMarkerColor(c);
136 m->SetMarkerSize(sz);
139 m = fgMarkerL.back();
140 fgMarkerL.pop_back();
144 m->SetMarkerSize(sz);
145 m->SetMarkerColor(c);
146 m->SetMarkerStyle(st);
151 fMarkerL.push_back(m);
160 if(fgPolyMarkerL.empty()){
161 pm =
new TPolyMarker(n);
162 pm->SetBit(kCanDelete,kFALSE);
163 pm->SetMarkerColor(c);
164 pm->SetMarkerStyle(st);
165 pm->SetMarkerSize(sz);
168 pm = fgPolyMarkerL.back();
169 fgPolyMarkerL.pop_back();
174 pm->SetPolyMarker(0);
175 pm->SetPolyMarker(n);
176 pm->SetMarkerColor(c);
177 pm->SetMarkerSize(sz);
178 pm->SetMarkerStyle(st);
181 fPolyMarkerL.push_back(pm);
191 ln =
new TLine(x1,y1,x2,y2);
192 ln->SetBit(kCanDelete,kFALSE);
204 fLineL.push_back(ln);
213 if(fgPolyLineL.empty()){
214 pl =
new TPolyLine(n);
215 pl->SetBit(kCanDelete,kFALSE);
221 pl = fgPolyLineL.back();
222 fgPolyLineL.pop_back();
232 fPolyLineL.push_back(pl);
242 a =
new TArc(x,y,r,p1,p2);
243 a->SetBit(kCanDelete,kFALSE);
268 b->SetBit(kCanDelete,kFALSE);
289 if(fgTextL.empty()) {
290 itxt =
new TText(x,y,text);
291 itxt->SetBit(kCanDelete,kFALSE);
294 itxt = fgTextL.back();
297 itxt->SetText(x,y,text);
298 itxt->SetTextAngle(0);
299 itxt->SetTextAlign(11);
302 fTextL.push_back(itxt);
311 if(fgLatexL.empty()){
312 itxt =
new TLatex(x,y,text);
313 itxt->SetBit(kCanDelete,kFALSE);
316 itxt = fgLatexL.back();
319 itxt->SetText(x,y,text);
320 itxt->SetTextAngle(0);
321 itxt->SetTextAlign(11);
324 fLatexL.push_back(itxt);
static std::list< TBox * > fgBoxL
Float_t y1[n_points_granero]
TPolyLine & AddPolyLine(int n, int c, int w, int s)
Float_t x1[n_points_granero]
TLine & AddLine(double x1, double y1, double x2, double y2)
A collection of drawable 2-D objects.
Manage all things related to colors for the event display.
virtual void Paint(Option_t *option)
static std::list< TPolyMarker * > fgPolyMarkerL
Float_t y2[n_points_geant4]
static std::list< TPolyLine * > fgPolyLineL
TBox & AddBox(double x1, double y1, double x2, double y2)
TPolyMarker & AddPolyMarker(int n, int c, int st, double sz)
TArc & AddArc(double x, double t, double r, double a=0., double b=360.)
TText & AddText(double x, double y, const char *text)
TLatex & AddLatex(double x, double y, const char *text)
static std::list< TLatex * > fgLatexL
static std::list< TMarker * > fgMarkerL
static std::list< TLine * > fgLineL
static std::list< TArc * > fgArcL
Float_t x2[n_points_geant4]
static std::list< TText * > fgTextL
TMarker & AddMarker(double x, double y, int c, int st, double sz)
TBoxClipped(double a, double b, double c, double d)