Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TPave.cxx
Go to the documentation of this file.
1// @(#)root/graf:$Id$
2// Author: Rene Brun 16/10/95
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include <iostream>
13#include "TROOT.h"
14#include "TBuffer.h"
15#include "TPave.h"
16#include "TStyle.h"
17#include "TVirtualPad.h"
18#include "TClass.h"
19#include "TMath.h"
20
21
22/** \class TPave
23\ingroup BasicGraphics
24
25A TBox with a bordersize and a shadow option.
26The corners of a TPave can be rounded (option "arc")
27More functional objects like TPavelabel, TPaveText derive from TPave.
28
29\image html graf_pave.png
30*/
31
32////////////////////////////////////////////////////////////////////////////////
33/// Pave default constructor.
34
36{
37 fBorderSize = 4;
38 fOption = "brNDC";
39 fName = "";
40 fInit = 1;
41 fCornerRadius = 0;
42 fX1NDC = 0;
43 fY1NDC = 0;
44 fX2NDC = 0;
45 fY2NDC = 0;
51}
52
53////////////////////////////////////////////////////////////////////////////////
54/// Pave normal constructor.
55///
56/// a PAVE is a box with a bordersize and a shadow option the border
57/// size is in pixels.
58///
59/// - option = "TR" Top and Right shadows are drawn.
60/// - option = "TL" Top and Left shadows are drawn.
61/// - option = "BR" Bottom and Right shadows are drawn.
62/// - option = "BL" Bottom and Left shadows are drawn.
63///
64/// If none of these four above options is specified the default the
65/// option "BR" will be used to draw the border. To produces a pave
66/// without any border it is enough to specify the option "NB" (no border).
67///
68/// - option = "NDC" x1,y1,x2,y2 are given in NDC
69/// - option = "ARC" corners are rounded
70///
71/// In case of option "ARC", the corner radius is specified
72/// via TPave::SetCornerRadius(rad) where rad is given in percent
73/// of the pave height (default value is 0.2).
74
77 :TBox(x1,y1,x2,y2)
78{
81 fName = "";
82 fInit = 0;
83 fCornerRadius = 0;
84 fX1NDC = 0;
85 fY1NDC = 0;
86 fX2NDC = 0;
87 fY2NDC = 0;
88
89 if (fOption == "NDC" || fOption == "ndc") fOption = "brNDC";
90
95 SetName((char*)ClassName());
97}
98
99////////////////////////////////////////////////////////////////////////////////
100/// Pave default destructor.
101
103{
104 // Required since we overload TObject::Hash.
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Pave copy constructor.
110
112{
113 fX1NDC = 0.;
114 fY1NDC = 0.;
115 fX2NDC = 0.;
116 fY2NDC = 0.;
117 fCornerRadius = 0.;
118 fBorderSize = 0;
119 fInit = 0;
120 fShadowColor = 0;
121
122 pave.TPave::Copy(*this);
123}
124
125////////////////////////////////////////////////////////////////////////////////
126/// Assignment operator
127
129{
130 src.TPave::Copy(*this);
131 return *this;
132}
133
134
135////////////////////////////////////////////////////////////////////////////////
136/// Convert pave coordinates from NDC to Pad coordinates.
137
139{
140 if (!gPad) return;
141 Double_t dpx = gPad->GetX2() - gPad->GetX1();
142 Double_t dpy = gPad->GetY2() - gPad->GetY1();
143 Double_t xp1 = gPad->GetX1();
144 Double_t yp1 = gPad->GetY1();
145
146 // Check if pave initialisation has been done.
147 // This operation cannot take place in the Pave constructor because
148 // the Pad range may not be known at this time.
149 if (!fInit) {
150 fInit = 1;
151 if (fOption.Contains("NDC")) {
152 fX1NDC = fX1;
153 fY1NDC = fY1;
154 fX2NDC = fX2;
155 fY2NDC = fY2;
156 fX1 = xp1 + fX1NDC*dpx;
157 fY1 = yp1 + fY1NDC*dpy;
158 fX2 = xp1 + fX2NDC*dpx;
159 fY2 = yp1 + fY2NDC*dpy;
160 } else {
161 if (gPad->GetLogx()) {
162 if (fX1 > 0) fX1 = TMath::Log10(fX1);
163 if (fX2 > 0) fX2 = TMath::Log10(fX2);
164 }
165 if (gPad->GetLogy()) {
166 if (fY1 > 0) fY1 = TMath::Log10(fY1);
167 if (fY2 > 0) fY2 = TMath::Log10(fY2);
168 }
169 fX1NDC = (fX1-xp1)/dpx;
170 fY1NDC = (fY1-yp1)/dpy;
171 fX2NDC = (fX2-xp1)/dpx;
172 fY2NDC = (fY2-yp1)/dpy;
173 }
174 } else {
175 fX1 = xp1 + fX1NDC*dpx;
176 fY1 = yp1 + fY1NDC*dpy;
177 fX2 = xp1 + fX2NDC*dpx;
178 fY2 = yp1 + fY2NDC*dpy;
179 }
180}
181
182////////////////////////////////////////////////////////////////////////////////
183/// Copy this pave to pave.
184
185void TPave::Copy(TObject &obj) const
186{
187 TBox::Copy(obj);
188 ((TPave&)obj).fX1NDC = fX1NDC;
189 ((TPave&)obj).fY1NDC = fY1NDC;
190 ((TPave&)obj).fX2NDC = fX2NDC;
191 ((TPave&)obj).fY2NDC = fY2NDC;
192 ((TPave&)obj).fBorderSize = fBorderSize;
193 ((TPave&)obj).fInit = fInit;
194 ((TPave&)obj).fOption = fOption;
195 ((TPave&)obj).fName = fName;
196 ((TPave&)obj).fCornerRadius= fCornerRadius;
197 ((TPave&)obj).fShadowColor = fShadowColor;
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Compute distance from point px,py to a pave.
202///
203/// Compute the closest distance of approach from point px,py to the
204/// edges of this pave.
205/// The distance is computed in pixels units.
206
208{
209 if (!gPad) return 9999;
210 Int_t pxl, pyl, pxt, pyt;
211 Int_t px1 = gPad->XtoAbsPixel(fX1);
212 Int_t py1 = gPad->YtoAbsPixel(fY1);
213 Int_t px2 = gPad->XtoAbsPixel(fX2);
214 Int_t py2 = gPad->YtoAbsPixel(fY2);
215 if (px1 < px2) {pxl = px1; pxt = px2;}
216 else {pxl = px2; pxt = px1;}
217 if (py1 < py2) {pyl = py1; pyt = py2;}
218 else {pyl = py2; pyt = py1;}
219
220 // Are we inside the box?
221 if ( (px >= pxl && px <= pxt) && (py >= pyl && py <= pyt) ) return 0;
222 else return 9999;
223}
224
225////////////////////////////////////////////////////////////////////////////////
226/// Draw this pave with its current attributes.
227
229{
230 Option_t *opt;
231 if (option && strlen(option)) opt = option;
232 else opt = GetOption();
233
234 AppendPad(opt);
235}
236
237////////////////////////////////////////////////////////////////////////////////
238/// Draw this pave with new coordinates.
239
248
249////////////////////////////////////////////////////////////////////////////////
250/// Execute action corresponding to one event.
251///
252/// This member function is called when a PAVE object is clicked.
253
255{
256 if (!gPad) return;
257
258 if (!gPad->IsEditable()) return;
259
260 TBox::ExecuteEvent(event, px, py);
261
262 // In case pave coordinates have been modified, recompute NDC coordinates
263 SetX1(fX1);
264 SetX2(fX2);
265 SetY1(fY1);
266 SetY2(fY2);
267
268 // In case the bit NameIsAction is activated, execute the action
269 // in name via the interpreter.
270 if (event == kButton1Double) {
271 if (TestBit(kNameIsAction)) gROOT->ProcessLine(GetName());
272 }
273}
274
275////////////////////////////////////////////////////////////////////////////////
276/// List this pave with its attributes.
277
278void TPave::ls(Option_t *) const
279{
281 printf("OBJ: %s\t%s \tX1= %f Y1=%f X2=%f Y2=%f\n",IsA()->GetName(),GetName(),fX1,fY1,fX2,fY2);
282}
283
284////////////////////////////////////////////////////////////////////////////////
285/// Paint this pave with its current attributes.
286///
287/// - option = "TR" Top and Right shadows are drawn.
288/// - option = "TL" Top and Left shadows are drawn.
289/// - option = "BR" Bottom and Right shadows are drawn.
290/// - option = "BL" Bottom and Left shadows are drawn.
291///
292/// If none of these four above options is specified the default the
293/// option "BR" will be used to draw the border. To produces a pave
294/// without any border it is enough to specify the option "NB" (no border).
295///
296/// - option = "NDC" x1,y1,x2,y2 are given in NDC
297/// - option = "ARC" corners are rounded
298///
299/// In case of option "ARC", the corner radius is specified
300/// via TPave::SetCornerRadius(rad) where rad is given in percent
301/// of the pave height (default value is 0.2).
302
304{
305 // Convert from NDC to pad coordinates
307
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Draw this pave with new coordinates.
313
316{
317 if (!gPad) return;
318 Double_t x[7],y[7];
319 TString opt = option;
320 opt.ToLower();
321
322 // if pave drawn with the arc option, goes through dedicated function
323 if (opt.Contains("arc")) {
325 return;
326 }
327
328 // normal rectangular pave
332
333 // Draw first pave as a normal filled box
334 if (fBorderSize <= 0 && fillstyle <= 0)
335 return;
336 TBox::PaintBox(x1,y1,x2,y2, fBorderSize == 1 ? "l" : nullptr);
337 if ((fBorderSize <= 1) || opt.Contains("nb"))
338 return;
339
340 Double_t wy = gPad->PixeltoY(0) - gPad->PixeltoY(fBorderSize);
341 Double_t wx = gPad->PixeltoX(fBorderSize) - gPad->PixeltoX(0);
342
343 if (opt.Contains("tr")) {
344 // Draw the shadow top right
345 x[0] = x1 + 1.5*wx; y[0] = y2;
346 x[1] = x[0]; y[1] = y2 + wy;
347 x[2] = x2 + wx; y[2] = y[1];
348 x[3] = x[2]; y[3] = y1 + 1.5*wy;
349 x[4] = x2; y[4] = y[3];
350 x[5] = x[4]; y[5] = y2;
351 } else if (opt.Contains("tl")) {
352 // Draw the shadow top left
353 x[0] = x1 - wx; y[0] = y1 + 1.5*wy;
354 x[1] = x[0]; y[1] = y2 + wy;
355 x[2] = x2 - 1.5*wx; y[2] = y[1];
356 x[3] = x[2]; y[3] = y2;
357 x[4] = x1; y[4] = y[3];
358 x[5] = x1; y[5] = y[0];
359 } else if (opt.Contains("bl")) {
360 // Draw the shadow bottom left
361 x[0] = x1 - wx; y[0] = y2 - 1.5*wy;
362 x[1] = x[0]; y[1] = y1 - wy;
363 x[2] = x2 - 1.5*wx; y[2] = y[1];
364 x[3] = x[2]; y[3] = y1;
365 x[4] = x1; y[4] = y[3];
366 x[5] = x[4]; y[5] = y[0];
367 } else {
368 // Draw the shadow bottom right
369 x[0] = x1 + 1.5*wx; y[0] = y1;
370 x[1] = x[0]; y[1] = y1 - wy;
371 x[2] = x2 + wx; y[2] = y[1];
372 x[3] = x[2]; y[3] = y2 - 1.5*wy;
373 x[4] = x2; y[4] = y[3];
374 x[5] = x[4]; y[5] = y1;
375 }
376
377 for (Int_t i=0;i<6;i++) {
378 if (x[i] < gPad->GetX1()) x[i] = gPad->GetX1();
379 if (x[i] > gPad->GetX2()) x[i] = gPad->GetX2();
380 if (y[i] < gPad->GetY1()) y[i] = gPad->GetY1();
381 if (y[i] > gPad->GetY2()) y[i] = gPad->GetY2();
382 }
383 x[6] = x[0]; y[6] = y[0];
384 SetFillStyle(1001);
387 gPad->PaintFillArea(6,x,y);
388 x[0] = x1; y[0] = y1;
389 x[1] = x1; y[1] = y2;
390 x[2] = x2; y[2] = y2;
391 x[3] = x2; y[3] = y1;
392 x[4] = x1; y[4] = y1;
393 gPad->PaintPolyLine(5,x,y);
396}
397
398////////////////////////////////////////////////////////////////////////////////
399/// Draw this pave with rounded corners.
400
403{
404 if (!gPad) return;
405 const Int_t kNPARC = 10;
406 Double_t x[4*kNPARC+10], y[4*kNPARC+10];
407 Double_t px[4*kNPARC+10], py[4*kNPARC+10];
408 Int_t i;
409 TString opt = option;
410 opt.ToLower();
411
415
416 static Double_t cosa[kNPARC], sina[kNPARC];
417 static Bool_t done = kFALSE;
418 if (!done) {
419 done = kTRUE;
420 Double_t dtheta = 0.5*3.141592/(kNPARC+1);
421 Double_t theta = 0;
422 for (i=0;i<kNPARC;i++) {
423 theta += dtheta;
424 cosa[i] = TMath::Cos(theta);
425 sina[i] = TMath::Sin(theta);
426 }
427 }
428 Int_t px1 = gPad->XtoAbsPixel(x1);
429 Int_t py1 = gPad->YtoAbsPixel(y1);
430 Int_t px2 = gPad->XtoAbsPixel(x2);
431 Int_t py2 = gPad->YtoAbsPixel(y2);
432 // compute rounded corner radius
434 if (rad > 0 && rad < 0.5) rad = fCornerRadius;
435 else rad = 0.2;
436 Double_t r = rad*TMath::Abs(py1-py2);
437 if (r > 0.5*TMath::Abs(px2-px1)) r = 0.5*TMath::Abs(px2-px1);
438 if (r == 0) r = 1;
439
440 // Draw rounded box outline and fill area
441 px[0] = px2; py[0] = py1 - r; //starts at bottom right
442 px[1] = px2; py[1] = py2 + r;
443 Int_t np = 2;
444 for (i=0;i<kNPARC;i++) { //top right corner
445 px[np] = px2 - r + r*cosa[i];
446 py[np] = py2 + r - r*sina[i];
447 np++;
448 }
449 px[np] = px2 - r; py[np] = py2;
450 px[np+1] = px1 + r; py[np+1] = py2;
451 np += 2;
452 for (i=kNPARC-1;i>=0;i--) { //top left corner
453 px[np] = px1 + r - r*cosa[i];
454 py[np] = py2 + r - r*sina[i];
455 np++;
456 }
457 px[np] = px1; py[np] = py2 + r;
458 px[np+1] = px1; py[np+1] = py1 - r;
459 np += 2;
460 for (i=0;i<kNPARC;i++) { //bottom left corner
461 px[np] = px1 + r - r*cosa[i];
462 py[np] = py1 - r + r*sina[i];
463 np++;
464 }
465 px[np] = px1 + r; py[np] = py1;
466 px[np+1] = px2 - r; py[np+1] = py1;
467 np += 2;
468 for (i=kNPARC-1;i>=0;i--) { //bottom right corner
469 px[np] = px2 - r + r*cosa[i];
470 py[np] = py1 - r + r*sina[i];
471 np++;
472 }
473 px[np] = px[0]; py[np] =py[0];
476 for (i=0;i<=np;i++) {
477 x[i] = gPad->AbsPixeltoX(Int_t(px[i]));
478 y[i] = gPad->AbsPixeltoY(Int_t(py[i]));
479 }
480 gPad->PaintFillArea(np , x, y);
481 gPad->PaintPolyLine(np+1, x, y);
482
483 if (fBorderSize <= 0 || opt.Contains("nb")) return;
484
487
488 if (opt.Contains("tr")) {
489 // Draw the shadow top right
490 px[0] = px2; py[0] = py1 - r;
491 px[1] = px2; py[1] = py2 + r;
492 np = 2;
493 for (i=0;i<kNPARC;i++) { //top right corner inside
494 px[np] = px2 - r + r*cosa[i];
495 py[np] = py2 + r - r*sina[i];
496 np++;
497 }
498 px[np] = px2 - r; py[np] = py2;
499 px[np+1] = px1 + r; py[np+1] = py2;
500 px[np+2] = px1 + r; py[np+2] = py2 - wy;
501 px[np+3] = px2 - r; py[np+3] = py2 - wy;
502 np += 4;
503 for (i=kNPARC-1;i>=0;i--) { //top right corner outside
504 px[np] = px2 - r + r*cosa[i]*(1+wx/r);
505 py[np] = py2 + r - r*sina[i]*(1+wy/r);
506 np++;
507 }
508 px[np] = px2 + wx; py[np] = py2 + r;
509 px[np+1] = px2 + wx; py[np+1] = py1 - r;
510 px[np+2] = px[0]; py[np+2] = py[0];
511 np += 3;
512 } else if (opt.Contains("tl")) {
513 // Draw the shadow top left
514 px[0] = px2 - r; py[0] = py2;
515 px[1] = px1 + r; py[1] = py2;
516 np = 2;
517 for (i=kNPARC-1;i>=0;i--) { //top left corner inside
518 px[np] = px1 + r - r*cosa[i];
519 py[np] = py2 + r - r*sina[i];
520 np++;
521 }
522 px[np] = px1; py[np] = py2 + r;
523 px[np+1] = px1; py[np+1] = py1 - r;
524 px[np+2] = px1 - wx; py[np+2] = py1 - r;
525 px[np+3] = px1 - wx; py[np+3] = py2 + r;
526 np += 4;
527 for (i=0;i<kNPARC;i++) { //top left corner outside
528 px[np] = px1 + r - r*cosa[i]*(1+wx/r);
529 py[np] = py2 + r - r*sina[i]*(1+wy/r);
530 np++;
531 }
532 px[np] = px1 + r; py[np] = py2 - wy;
533 px[np+1] = px2 - r; py[np+1] = py2 - wy;
534 px[np+2] = px[0]; py[np+2] = y[0];
535 np += 3;
536 } else if (opt.Contains("bl")) {
537 // Draw the shadow bottom left
538 px[0] = px1; py[0] = py2 + r;
539 px[1] = px1; py[1] = py1 - r;
540 np = 2;
541 for (i=0;i<kNPARC;i++) { //bottom left corner inside
542 px[np] = px1 + r - r*cosa[i];
543 py[np] = py1 + r - r*sina[i];
544 np++;
545 }
546 px[np] = px1 + r; py[np] = py1;
547 px[np+1] = px2 - r; py[np+1] = py1;
548 px[np+2] = px2 - r; py[np+2] = py1 + wy;
549 px[np+3] = px1 + r; py[np+3] = py1 + wy;
550 np += 4;
551 for (i=kNPARC-1;i>=0;i--) { //bottom left corner outside
552 px[np] = px1 + r - r*cosa[i]*(1+wx/r);
553 py[np] = py1 - r + r*sina[i]*(1+wy/r);
554 np++;
555 }
556 px[np] = px1 - wx; py[np] = py1 - r;
557 px[np+1] = px1 - wx; py[np+1] = py[0];
558 px[np+2] = px[0]; py[np+2] = py[0];
559 np += 3;
560 } else {
561 // Draw the shadow bottom right (default)
562 px[0] = px1 + r; py[0] = py1;
563 px[1] = px2 - r; py[1] = py1;
564 np = 2;
565 for (i=kNPARC-1;i>=0;i--) { //bottom right corner inside
566 px[np] = px2 - r + r*cosa[i];
567 py[np] = py1 - r + r*sina[i];
568 np++;
569 }
570 px[np] = px2; py[np] = py1 - r;
571 px[np+1] = px2; py[np+1] = py2 + r;
572 px[np+2] = px2 + wx; py[np+2] = py2 + r;
573 px[np+3] = px2 + wx; py[np+3] = py1 - r;
574 np += 4;
575 for (i=0;i<kNPARC;i++) { //bottom right corner outside
576 px[np] = px2 - r + r*cosa[i]*(1+wx/r);
577 py[np] = py1 - r + r*sina[i]*(1+wy/r);
578 np++;
579 }
580 px[np] = px2 - r; py[np] = py1 + wy;
581 px[np+1] = px[0]; py[np+1] = py[0] + wy;
582 px[np+2] = px[0]; py[np+2] = py[0];
583 np += 3;
584 }
585
586 SetFillStyle(1001);
589 for (i=0;i<=np;i++) {
590 x[i] = gPad->AbsPixeltoX(Int_t(px[i]));
591 y[i] = gPad->AbsPixeltoY(Int_t(py[i]));
592 }
593 gPad->PaintFillArea(np,x,y);
596}
597
598////////////////////////////////////////////////////////////////////////////////
599/// Dump this pave with its attributes.
600
602{
604}
605
606////////////////////////////////////////////////////////////////////////////////
607/// Returns arguments which should be used when saving primitive constructor
608/// Check if coordinates are initialized, add extra arguments and options
609
611{
612 Double_t x1 = fX1, y1 = fY1, x2 = fX2, y2 = fY2;
613 if (fOption.Contains("NDC")) {
614 // in some cases coordinates may not be initialized but were already set via direct call
615 // then one should store such modified coordinates
616 if (fInit || fX1NDC != 0.)
617 x1 = fX1NDC;
618 if (fInit || fY1NDC != 0.)
619 y1 = fY1NDC;
620 if (fInit || fX2NDC != 0.)
621 x2 = fX2NDC;
622 if (fInit || fY2NDC != 0.)
623 y2 = fY2NDC;
624 }
625
626 TString args = TString::Format("%g, %g, %g, %g", x1, y1, x2, y2);
627 if (extra_arg && *extra_arg) {
628 args.Append(", ");
629 args.Append(extra_arg);
630 }
631 if (save_option) {
632 args.Append(", \"");
633 args.Append(TString(fOption).ReplaceSpecialCppChars());
634 args.Append("\"");
635 }
636 return args;
637}
638
639////////////////////////////////////////////////////////////////////////////////
640/// Save primitive as a C++ statement(s) on output stream out
641
642void TPave::SavePrimitive(std::ostream &out, Option_t *option)
643{
645 SaveFillAttributes(out, "pave", -1, -1);
646 SaveLineAttributes(out, "pave", 1, 1, 1);
647 if (strcmp(GetName(), "TPave"))
648 out << " pave->SetName(\"" << GetName() << "\");\n";
649 if (fCornerRadius)
650 out << " pave->SetCornerRadius(" << fCornerRadius << ");\n";
651 SavePrimitiveDraw(out, "pave", option);
652}
653
654////////////////////////////////////////////////////////////////////////////////
655/// Set the X1 value
656
658{
659 fX1 = x1;
660 if (gPad) {
661 Double_t dpx = gPad->GetX2() - gPad->GetX1();
662 Double_t xp1 = gPad->GetX1();
663 fX1NDC = (fX1-xp1)/dpx;
664 }
665}
666
667////////////////////////////////////////////////////////////////////////////////
668/// Set the X2 value
669
671{
672 fX2 = x2;
673 if (gPad) {
674 Double_t dpx = gPad->GetX2() - gPad->GetX1();
675 Double_t xp1 = gPad->GetX1();
676 fX2NDC = (fX2-xp1)/dpx;
677 }
678}
679
680////////////////////////////////////////////////////////////////////////////////
681/// Set the Y1 value
682
684{
685 fY1 = y1;
686 if (gPad) {
687 Double_t dpy = gPad->GetY2() - gPad->GetY1();
688 Double_t yp1 = gPad->GetY1();
689 fY1NDC = (fY1-yp1)/dpy;
690 }
691}
692
693////////////////////////////////////////////////////////////////////////////////
694/// Set the Y2 value
695
697{
698 fY2 = y2;
699 if (gPad) {
700 Double_t dpy = gPad->GetY2() - gPad->GetY1();
701 Double_t yp1 = gPad->GetY1();
702 fY2NDC = (fY2-yp1)/dpy;
703 }
704}
705
706////////////////////////////////////////////////////////////////////////////////
707/// Stream an object of class TPave.
708
710{
711 if (R__b.IsReading()) {
713 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
714 if (R__v > 1) {
715 R__b.ReadClassBuffer(TPave::Class(), this, R__v, R__s, R__c);
716 return;
717 }
718 //====process old versions before automatic schema evolution
721 R__b >> x1ndc; fX1NDC = x1ndc;
722 R__b >> y1ndc; fY1NDC = y1ndc;
723 R__b >> x2ndc; fX2NDC = x2ndc;
724 R__b >> y2ndc; fY2NDC = y2ndc;
725 R__b >> fBorderSize;
726 R__b >> fInit;
727 R__b >> rad; fCornerRadius = rad;
730 R__b.CheckByteCount(R__s, R__c, TPave::IsA());
731 //====end of old versions
732
733 } else {
734 R__b.WriteClassBuffer(TPave::Class(),this);
735 }
736}
@ kButton1Double
Definition Buttons.h:24
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Version_t
Class version identifier (short)
Definition RtypesCore.h:79
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
Option_t Option_t SetFillStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t SetLineColor
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char y1
#define gROOT
Definition TROOT.h:414
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
#define gPad
virtual Color_t GetFillColor() const
Return the fill area color.
Definition TAttFill.h:31
virtual Style_t GetFillStyle() const
Return the fill area style.
Definition TAttFill.h:32
virtual void Modify()
Change current fill area attributes if necessary.
Definition TAttFill.cxx:215
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
Definition TAttFill.cxx:238
virtual Color_t GetLineColor() const
Return the line color.
Definition TAttLine.h:35
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:44
virtual Style_t GetLineStyle() const
Return the line style.
Definition TAttLine.h:36
virtual void Modify()
Change current line attributes if necessary.
Definition TAttLine.cxx:246
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition TAttLine.cxx:274
Create a Box.
Definition TBox.h:22
virtual void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="")
Draw this box with new coordinates.
Definition TBox.cxx:677
void Streamer(TBuffer &) override
Stream an object of class TBox.
Definition TBox.cxx:745
Double_t fX1
X of 1st point.
Definition TBox.h:28
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition TBox.cxx:231
void Print(Option_t *option="") const override
Dump this box with its attributes.
Definition TBox.cxx:697
Double_t fY2
Y of 2nd point.
Definition TBox.h:31
Double_t fX2
X of 2nd point.
Definition TBox.h:30
Double_t fY1
Y of 1st point.
Definition TBox.h:29
void Copy(TObject &box) const override
Copy a Box.
Definition TBox.cxx:111
Buffer base class used for serializing objects.
Definition TBuffer.h:43
Mother of all ROOT objects.
Definition TObject.h:42
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:226
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:203
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition TObject.cxx:840
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
Definition TObject.cxx:772
@ kCanDelete
if object in a list can be deleted
Definition TObject.h:70
A TBox with a bordersize and a shadow option.
Definition TPave.h:19
TPave()
Pave default constructor.
Definition TPave.cxx:35
void Print(Option_t *option="") const override
Dump this pave with its attributes.
Definition TPave.cxx:601
void SetX2(Double_t x2) override
Set the X2 value.
Definition TPave.cxx:670
TPave & operator=(const TPave &src)
Assignment operator.
Definition TPave.cxx:128
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Definition TPave.cxx:138
virtual void PaintPaveArc(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with rounded corners.
Definition TPave.cxx:401
const char * GetName() const override
Returns name of object.
Definition TPave.h:58
TString GetSavePaveArgs(const char *extra_arg=nullptr, Bool_t save_option=kTRUE)
Returns arguments which should be used when saving primitive constructor Check if coordinates are ini...
Definition TPave.cxx:610
void Copy(TObject &pave) const override
Copy this pave to pave.
Definition TPave.cxx:185
void Streamer(TBuffer &) override
Stream an object of class TPave.
Definition TPave.cxx:709
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition TPave.cxx:254
Int_t fBorderSize
window box bordersize in pixels
Definition TPave.h:26
TClass * IsA() const override
Definition TPave.h:93
void Draw(Option_t *option="") override
Draw this pave with its current attributes.
Definition TPave.cxx:228
void ls(Option_t *option="") const override
List this pave with its attributes.
Definition TPave.cxx:278
virtual void SetName(const char *name="")
Definition TPave.h:81
void SetX1(Double_t x1) override
Set the X1 value.
Definition TPave.cxx:657
Double_t fX2NDC
X2 point in NDC coordinates.
Definition TPave.h:24
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Definition TPave.cxx:642
Int_t fShadowColor
Color of the pave's shadow.
Definition TPave.h:28
void SetY1(Double_t y1) override
Set the Y1 value.
Definition TPave.cxx:683
Int_t fInit
(=0 if transformation to NDC not yet done)
Definition TPave.h:27
TString fOption
Pave style.
Definition TPave.h:30
Double_t fY2NDC
Y2 point in NDC coordinates.
Definition TPave.h:25
static TClass * Class()
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a pave.
Definition TPave.cxx:207
Double_t fX1NDC
X1 point in NDC coordinates.
Definition TPave.h:22
TString fName
Pave name.
Definition TPave.h:31
void SetY2(Double_t y2) override
Set the Y2 value.
Definition TPave.cxx:696
@ kNameIsAction
double clicking on TPave will execute action
Definition TPave.h:38
Double_t fCornerRadius
Corner radius in case of option arc.
Definition TPave.h:29
Option_t * GetOption() const override
Definition TPave.h:59
Double_t fY1NDC
Y1 point in NDC coordinates.
Definition TPave.h:23
void Paint(Option_t *option="") override
Paint this pave with its current attributes.
Definition TPave.cxx:303
~TPave() override
Pave default destructor.
Definition TPave.cxx:102
virtual TPave * DrawPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with new coordinates.
Definition TPave.cxx:240
Int_t GetShadowColor() const
Definition TPave.h:60
virtual void PaintPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with new coordinates.
Definition TPave.cxx:314
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition TROOT.cxx:2902
Basic string class.
Definition TString.h:138
void ToLower()
Change string to lower-case.
Definition TString.cxx:1189
virtual void Streamer(TBuffer &)
Stream a string object.
Definition TString.cxx:1418
TString & Append(const char *cs)
Definition TString.h:581
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2384
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:641
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:403
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Definition TMath.h:773
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:122