122 pave.TPave::Copy(*
this);
130 src.TPave::Copy(*
this);
160 if (
gPad->GetLogx()) {
164 if (
gPad->GetLogy()) {
208 Int_t pxl, pyl, pxt, pyt;
213 if (px1 < px2) {pxl = px1; pxt = px2;}
214 else {pxl = px2; pxt = px1;}
215 if (py1 < py2) {pyl = py1; pyt = py2;}
216 else {pyl = py2; pyt = py1;}
219 if ( (px >= pxl && px <= pxt) && (py >= pyl && py <= pyt) )
return 0;
229 if (option && strlen(option)) opt = option;
255 if (!
gPad->IsEditable())
return;
324 if (opt.
Length() == 0) opt =
"br";
347 x[0] =
x1 + 1.5*wx;
y[0] = y2;
348 x[1] =
x[0];
y[1] = y2 + wy;
349 x[2] =
x2 + wx;
y[2] =
y[1];
350 x[3] =
x[2];
y[3] = y1 + 1.5*wy;
351 x[4] =
x2;
y[4] =
y[3];
352 x[5] =
x[4];
y[5] = y2;
357 x[0] =
x1 - wx;
y[0] = y1 + 1.5*wy;
358 x[1] =
x[0];
y[1] = y2 + wy;
359 x[2] =
x2 - 1.5*wx;
y[2] =
y[1];
360 x[3] =
x[2];
y[3] = y2;
361 x[4] =
x1;
y[4] =
y[3];
362 x[5] =
x1;
y[5] =
y[0];
367 x[0] =
x1 + 1.5*wx;
y[0] = y1;
368 x[1] =
x[0];
y[1] = y1 - wy;
369 x[2] =
x2 + wx;
y[2] =
y[1];
370 x[3] =
x[2];
y[3] = y2 - 1.5*wy;
371 x[4] =
x2;
y[4] =
y[3];
372 x[5] =
x[4];
y[5] = y1;
377 x[0] =
x1 - wx;
y[0] = y2 - 1.5*wy;
378 x[1] =
x[0];
y[1] = y1 - wy;
379 x[2] =
x2 - 1.5*wx;
y[2] =
y[1];
380 x[3] =
x[2];
y[3] = y1;
381 x[4] =
x1;
y[4] =
y[3];
382 x[5] =
x[4];
y[5] =
y[0];
385 for (
Int_t i=0;i<6;i++) {
386 if (
x[i] <
gPad->GetX1())
x[i] =
gPad->GetX1();
387 if (
x[i] >
gPad->GetX2())
x[i] =
gPad->GetX2();
388 if (
y[i] <
gPad->GetY1())
y[i] =
gPad->GetY1();
389 if (
y[i] >
gPad->GetY2())
y[i] =
gPad->GetY2();
391 x[6] =
x[0];
y[6] =
y[0];
395 gPad->PaintFillArea(6,
x,
y);
396 x[0] =
x1;
y[0] = y1;
397 x[1] =
x1;
y[1] = y2;
398 x[2] =
x2;
y[2] = y2;
399 x[3] =
x2;
y[3] = y1;
400 x[4] =
x1;
y[4] = y1;
401 gPad->PaintPolyLine(5,
x,
y);
412 const Int_t kNPARC = 10;
414 Double_t px[4*kNPARC+10], py[4*kNPARC+10];
418 if (opt.
Length() == 0) opt =
"br";
423 static Double_t cosa[kNPARC], sina[kNPARC];
427 Double_t dtheta = 0.5*3.141592/(kNPARC+1);
429 for (i=0;i<kNPARC;i++) {
448 px[0] = px2; py[0] = py1 -
r;
449 px[1] = px2; py[1] = py2 +
r;
451 for (i=0;i<kNPARC;i++) {
452 px[np] = px2 -
r +
r*cosa[i];
453 py[np] = py2 +
r -
r*sina[i];
456 px[np] = px2 -
r; py[np] = py2;
457 px[np+1] = px1 +
r; py[np+1] = py2;
459 for (i=kNPARC-1;i>=0;i--) {
460 px[np] = px1 +
r -
r*cosa[i];
461 py[np] = py2 +
r -
r*sina[i];
464 px[np] = px1; py[np] = py2 +
r;
465 px[np+1] = px1; py[np+1] = py1 -
r;
467 for (i=0;i<kNPARC;i++) {
468 px[np] = px1 +
r -
r*cosa[i];
469 py[np] = py1 -
r +
r*sina[i];
472 px[np] = px1 +
r; py[np] = py1;
473 px[np+1] = px2 -
r; py[np+1] = py1;
475 for (i=kNPARC-1;i>=0;i--) {
476 px[np] = px2 -
r +
r*cosa[i];
477 py[np] = py1 -
r +
r*sina[i];
480 px[np] = px[0]; py[np] =py[0];
483 for (i=0;i<=np;i++) {
487 gPad->PaintFillArea(np ,
x,
y);
488 gPad->PaintPolyLine(np+1,
x,
y);
497 px[0] = px2; py[0] = py1 -
r;
498 px[1] = px2; py[1] = py2 +
r;
500 for (i=0;i<kNPARC;i++) {
501 px[np] = px2 -
r +
r*cosa[i];
502 py[np] = py2 +
r -
r*sina[i];
505 px[np] = px2 -
r; py[np] = py2;
506 px[np+1] = px1 +
r; py[np+1] = py2;
507 px[np+2] = px1 +
r; py[np+2] = py2 - wy;
508 px[np+3] = px2 -
r; py[np+3] = py2 - wy;
510 for (i=kNPARC-1;i>=0;i--) {
511 px[np] = px2 -
r +
r*cosa[i]*(1+wx/
r);
512 py[np] = py2 +
r -
r*sina[i]*(1+wy/
r);
515 px[np] = px2 + wx; py[np] = py2 +
r;
516 px[np+1] = px2 + wx; py[np+1] = py1 -
r;
517 px[np+2] = px[0]; py[np+2] = py[0];
522 px[0] = px2 -
r; py[0] = py2;
523 px[1] = px1 +
r; py[1] = py2;
525 for (i=kNPARC-1;i>=0;i--) {
526 px[np] = px1 +
r -
r*cosa[i];
527 py[np] = py2 +
r -
r*sina[i];
530 px[np] = px1; py[np] = py2 +
r;
531 px[np+1] = px1; py[np+1] = py1 -
r;
532 px[np+2] = px1 - wx; py[np+2] = py1 -
r;
533 px[np+3] = px1 - wx; py[np+3] = py2 +
r;
535 for (i=0;i<kNPARC;i++) {
536 px[np] = px1 +
r -
r*cosa[i]*(1+wx/
r);
537 py[np] = py2 +
r -
r*sina[i]*(1+wy/
r);
540 px[np] = px1 +
r; py[np] = py2 - wy;
541 px[np+1] = px2 -
r; py[np+1] = py2 - wy;
542 px[np+2] = px[0]; py[np+2] =
y[0];
547 px[0] = px1 +
r; py[0] = py1;
548 px[1] = px2 -
r; py[1] = py1;
550 for (i=kNPARC-1;i>=0;i--) {
551 px[np] = px2 -
r +
r*cosa[i];
552 py[np] = py1 -
r +
r*sina[i];
555 px[np] = px2; py[np] = py1 -
r;
556 px[np+1] = px2; py[np+1] = py2 +
r;
557 px[np+2] = px2 + wx; py[np+2] = py2 +
r;
558 px[np+3] = px2 + wx; py[np+3] = py1 -
r;
560 for (i=0;i<kNPARC;i++) {
561 px[np] = px2 -
r +
r*cosa[i]*(1+wx/
r);
562 py[np] = py1 -
r +
r*sina[i]*(1+wy/
r);
565 px[np] = px2 -
r; py[np] = py1 + wy;
566 px[np+1] = px[0]; py[np+1] = py[0] + wy;
567 px[np+2] = px[0]; py[np+2] = py[0];
572 px[0] = px1; py[0] = py2 +
r;
573 px[1] = px1; py[1] = py1 -
r;
575 for (i=0;i<kNPARC;i++) {
576 px[np] = px1 +
r -
r*cosa[i];
577 py[np] = py1 +
r -
r*sina[i];
580 px[np] = px1 +
r; py[np] = py1;
581 px[np+1] = px2 -
r; py[np+1] = py1;
582 px[np+2] = px2 -
r; py[np+2] = py1 + wy;
583 px[np+3] = px1 +
r; py[np+3] = py1 + wy;
585 for (i=kNPARC-1;i>=0;i--) {
586 px[np] = px1 +
r -
r*cosa[i]*(1+wx/
r);
587 py[np] = py1 -
r +
r*sina[i]*(1+wy/
r);
590 px[np] = px1 - wx; py[np] = py1 -
r;
591 px[np+1] = px1 - wx; py[np+1] = py[0];
592 px[np+2] = px[0]; py[np+2] = py[0];
598 for (i=0;i<=np;i++) {
602 gPad->PaintFillArea(np,
x,
y);
630 out<<
"pave = new TPave("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2
633 if (strcmp(
GetName(),
"TPave")) {
634 out<<
" pave->SetName("<<quote<<
GetName()<<quote<<
");"<<std::endl;
637 out<<
" pave->SetCornerRadius("<<
fCornerRadius<<
");"<<std::endl;
641 out<<
" pave->Draw();"<<std::endl;
699void TPave::Streamer(
TBuffer &R__b)
709 TBox::Streamer(R__b);
711 R__b >> x1ndc;
fX1NDC = x1ndc;
712 R__b >> y1ndc;
fY1NDC = y1ndc;
713 R__b >> x2ndc;
fX2NDC = x2ndc;
714 R__b >> y2ndc;
fY2NDC = y2ndc;
719 fName.Streamer(R__b);
static const double x2[5]
static const double x1[5]
R__EXTERN TStyle * gStyle
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void Modify()
Change current fill area attributes if necessary.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
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.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void Modify()
Change current line attributes if necessary.
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.
virtual void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="")
Draw this box with new coordinates.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Double_t fX1
X of 1st point.
void Copy(TObject &box) const
Copy a Box.
Double_t fY2
Y of 2nd point.
Double_t fX2
X of 2nd point.
Double_t fY1
Y of 1st point.
virtual void Print(Option_t *option="") const
Dump this box with its attributes.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
@ kCanDelete
if object in a list can be deleted
A TBox with a bordersize and a shadow option.
virtual void Print(Option_t *option="") const
Dump this pave with its attributes.
TPave()
Pave default constructor.
TPave & operator=(const TPave &src)
Assignment operator.
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
virtual void SetX2(Double_t x2)
Set the X2 value.
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.
virtual void ls(Option_t *option="") const
List this pave with its attributes.
Int_t fBorderSize
window box bordersize in pixels
virtual ~TPave()
Pave default destructor.
@ kNameIsAction
double clicking on TPave will execute action
virtual void SetY2(Double_t y2)
Set the Y2 value.
virtual void Draw(Option_t *option="")
Draw this pave with its current attributes.
virtual void SetName(const char *name="")
Double_t fX2NDC
X2 point in NDC coordinates.
Int_t fShadowColor
Color of the pave's shadow.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Option_t * GetOption() const
Option_t * GetName() const
Returns name of object.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a pave.
Int_t fInit
(=0 if transformation to NDC not yet done)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
TString fOption
Pave style.
Double_t fY2NDC
Y2 point in NDC coordinates.
void Copy(TObject &pave) const
Copy this pave to pave.
virtual void Paint(Option_t *option="")
Paint this pave with its current attributes.
virtual void SetX1(Double_t x1)
Set the X1 value.
Double_t fX1NDC
X1 point in NDC coordinates.
virtual void 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.
Double_t fCornerRadius
Corner radius in case of option arc.
Double_t fY1NDC
Y1 point in NDC coordinates.
virtual void SetY1(Double_t y1)
Set the Y1 value.
Int_t GetShadowColor() const
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.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
void ToLower()
Change string to lower-case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
static constexpr double rad
Double_t Log10(Double_t x)