50 fShadowColor = GetLineColor();
115 ((
TPave&)pave).TPave::Copy(*
this);
143 if (
gPad->GetLogx()) {
147 if (
gPad->GetLogy()) {
191 Int_t pxl, pyl, pxt, pyt;
196 if (px1 < px2) {pxl = px1; pxt = px2;}
197 else {pxl = px2; pxt = px1;}
198 if (py1 < py2) {pyl = py1; pyt = py2;}
199 else {pyl = py2; pyt = py1;}
202 if ( (px >= pxl && px <= pxt) && (py >= pyl && py <= pyt) )
return 0;
212 if (option && strlen(option)) opt = option;
224 TPave *newpave =
new TPave(x1,y1,x2,y2,bordersize,option);
238 if (!
gPad->IsEditable())
return;
307 if (opt.
Length() == 0) opt =
"br";
317 gPad->PaintLine(x1,y1,x2,y1);
318 gPad->PaintLine(x2,y1,x2,y2);
319 gPad->PaintLine(x2,y2,x1,y2);
320 gPad->PaintLine(x1,y2,x1,y1);
330 x[0] = x1 + 1.5*wx; y[0] = y2;
331 x[1] = x[0]; y[1] = y2 + wy;
332 x[2] = x2 + wx; y[2] = y[1];
333 x[3] = x[2]; y[3] = y1 + 1.5*wy;
334 x[4] =
x2; y[4] = y[3];
335 x[5] = x[4]; y[5] = y2;
340 x[0] = x1 - wx; y[0] = y1 + 1.5*wy;
341 x[1] = x[0]; y[1] = y2 + wy;
342 x[2] = x2 - 1.5*wx; y[2] = y[1];
343 x[3] = x[2]; y[3] = y2;
344 x[4] =
x1; y[4] = y[3];
345 x[5] =
x1; y[5] = y[0];
350 x[0] = x1 + 1.5*wx; y[0] = y1;
351 x[1] = x[0]; y[1] = y1 - wy;
352 x[2] = x2 + wx; y[2] = y[1];
353 x[3] = x[2]; y[3] = y2 - 1.5*wy;
354 x[4] =
x2; y[4] = y[3];
355 x[5] = x[4]; y[5] = y1;
360 x[0] = x1 - wx; y[0] = y2 - 1.5*wy;
361 x[1] = x[0]; y[1] = y1 - wy;
362 x[2] = x2 - 1.5*wx; y[2] = y[1];
363 x[3] = x[2]; y[3] = y1;
364 x[4] =
x1; y[4] = y[3];
365 x[5] = x[4]; y[5] = y[0];
368 for (
Int_t i=0;i<6;i++) {
369 if (x[i] <
gPad->GetX1()) x[i] =
gPad->GetX1();
370 if (x[i] >
gPad->GetX2()) x[i] =
gPad->GetX2();
371 if (y[i] <
gPad->GetY1()) y[i] =
gPad->GetY1();
372 if (y[i] >
gPad->GetY2()) y[i] =
gPad->GetY2();
374 x[6] = x[0]; y[6] = y[0];
378 gPad->PaintFillArea(6,x,y);
379 x[0] =
x1; y[0] = y1;
380 x[1] =
x1; y[1] = y2;
381 x[2] =
x2; y[2] = y2;
382 x[3] =
x2; y[3] = y1;
383 x[4] =
x1; y[4] = y1;
384 gPad->PaintPolyLine(5,x,y);
395 const Int_t kNPARC = 10;
397 Double_t px[4*kNPARC+10], py[4*kNPARC+10];
401 if (opt.
Length() == 0) opt =
"br";
406 static Double_t cosa[kNPARC], sina[kNPARC];
410 Double_t dtheta = 0.5*3.141592/(kNPARC+1);
412 for (i=0;i<kNPARC;i++) {
427 if (r > 0.5*TMath::Abs(px2-px1)) r = 0.5*
TMath::Abs(px2-px1);
431 px[0] = px2; py[0] = py1 -
r;
432 px[1] = px2; py[1] = py2 +
r;
434 for (i=0;i<kNPARC;i++) {
435 px[np] = px2 - r + r*cosa[i];
436 py[np] = py2 + r - r*sina[i];
439 px[np] = px2 -
r; py[np] = py2;
440 px[np+1] = px1 +
r; py[np+1] = py2;
442 for (i=kNPARC-1;i>=0;i--) {
443 px[np] = px1 + r - r*cosa[i];
444 py[np] = py2 + r - r*sina[i];
447 px[np] = px1; py[np] = py2 +
r;
448 px[np+1] = px1; py[np+1] = py1 -
r;
450 for (i=0;i<kNPARC;i++) {
451 px[np] = px1 + r - r*cosa[i];
452 py[np] = py1 - r + r*sina[i];
455 px[np] = px1 +
r; py[np] = py1;
456 px[np+1] = px2 -
r; py[np+1] = py1;
458 for (i=kNPARC-1;i>=0;i--) {
459 px[np] = px2 - r + r*cosa[i];
460 py[np] = py1 - r + r*sina[i];
463 px[np] = px[0]; py[np] =py[0];
466 for (i=0;i<=np;i++) {
470 gPad->PaintFillArea(np , x, y);
471 gPad->PaintPolyLine(np+1, x, y);
480 px[0] = px2; py[0] = py1 -
r;
481 px[1] = px2; py[1] = py2 +
r;
483 for (i=0;i<kNPARC;i++) {
484 px[np] = px2 - r + r*cosa[i];
485 py[np] = py2 + r - r*sina[i];
488 px[np] = px2 -
r; py[np] = py2;
489 px[np+1] = px1 +
r; py[np+1] = py2;
490 px[np+2] = px1 +
r; py[np+2] = py2 - wy;
491 px[np+3] = px2 -
r; py[np+3] = py2 - wy;
493 for (i=kNPARC-1;i>=0;i--) {
494 px[np] = px2 - r + r*cosa[i]*(1+wx/
r);
495 py[np] = py2 + r - r*sina[i]*(1+wy/
r);
498 px[np] = px2 + wx; py[np] = py2 +
r;
499 px[np+1] = px2 + wx; py[np+1] = py1 -
r;
500 px[np+2] = px[0]; py[np+2] = py[0];
505 px[0] = px2 -
r; py[0] = py2;
506 px[1] = px1 +
r; py[1] = py2;
508 for (i=kNPARC-1;i>=0;i--) {
509 px[np] = px1 + r - r*cosa[i];
510 py[np] = py2 + r - r*sina[i];
513 px[np] = px1; py[np] = py2 +
r;
514 px[np+1] = px1; py[np+1] = py1 -
r;
515 px[np+2] = px1 - wx; py[np+2] = py1 -
r;
516 px[np+3] = px1 - wx; py[np+3] = py2 +
r;
518 for (i=0;i<kNPARC;i++) {
519 px[np] = px1 + r - r*cosa[i]*(1+wx/
r);
520 py[np] = py2 + r - r*sina[i]*(1+wy/
r);
523 px[np] = px1 +
r; py[np] = py2 - wy;
524 px[np+1] = px2 -
r; py[np+1] = py2 - wy;
525 px[np+2] = px[0]; py[np+2] = y[0];
530 px[0] = px1 +
r; py[0] = py1;
531 px[1] = px2 -
r; py[1] = py1;
533 for (i=kNPARC-1;i>=0;i--) {
534 px[np] = px2 - r + r*cosa[i];
535 py[np] = py1 - r + r*sina[i];
538 px[np] = px2; py[np] = py1 -
r;
539 px[np+1] = px2; py[np+1] = py2 +
r;
540 px[np+2] = px2 + wx; py[np+2] = py2 +
r;
541 px[np+3] = px2 + wx; py[np+3] = py1 -
r;
543 for (i=0;i<kNPARC;i++) {
544 px[np] = px2 - r + r*cosa[i]*(1+wx/
r);
545 py[np] = py1 - r + r*sina[i]*(1+wy/
r);
548 px[np] = px2 -
r; py[np] = py1 + wy;
549 px[np+1] = px[0]; py[np+1] = py[0] + wy;
550 px[np+2] = px[0]; py[np+2] = py[0];
555 px[0] = px1; py[0] = py2 +
r;
556 px[1] = px1; py[1] = py1 -
r;
558 for (i=0;i<kNPARC;i++) {
559 px[np] = px1 + r - r*cosa[i];
560 py[np] = py1 + r - r*sina[i];
563 px[np] = px1 +
r; py[np] = py1;
564 px[np+1] = px2 -
r; py[np+1] = py1;
565 px[np+2] = px2 -
r; py[np+2] = py1 + wy;
566 px[np+3] = px1 +
r; py[np+3] = py1 + wy;
568 for (i=kNPARC-1;i>=0;i--) {
569 px[np] = px1 + r - r*cosa[i]*(1+wx/
r);
570 py[np] = py1 - r + r*sina[i]*(1+wy/
r);
573 px[np] = px1 - wx; py[np] = py1 -
r;
574 px[np+1] = px1 - wx; py[np+1] = py[0];
575 px[np+2] = px[0]; py[np+2] = py[0];
581 for (i=0;i<=np;i++) {
585 gPad->PaintFillArea(np,x,y);
613 out<<
"pave = new TPave("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2 616 if (strcmp(
GetName(),
"TPave")) {
617 out<<
" pave->SetName("<<quote<<
GetName()<<quote<<
");"<<std::endl;
620 out<<
" pave->SetCornerRadius("<<
fCornerRadius<<
");"<<std::endl;
624 out<<
" pave->Draw();"<<std::endl;
682 void TPave::Streamer(
TBuffer &R__b)
692 TBox::Streamer(R__b);
693 Float_t x1ndc,y1ndc,x2ndc,y2ndc,rad;
694 R__b >> x1ndc;
fX1NDC = x1ndc;
695 R__b >> y1ndc;
fY1NDC = y1ndc;
696 R__b >> x2ndc;
fX2NDC = x2ndc;
697 R__b >> y2ndc;
fY2NDC = y2ndc;
702 fName.Streamer(R__b);
void Copy(TObject &box) const
Copy a Box.
Option_t * GetOption() const
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void SetName(const char *name="")
virtual void Print(Option_t *option="") const
Dump this pave with its attributes.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
R__EXTERN TStyle * gStyle
Bool_t TestBit(UInt_t f) const
Double_t fY2
Y of 2nd point.
Buffer base class used for serializing objects.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
void Copy(TObject &pave) const
Copy this pave to pave.
void ToLower()
Change string to lower-case.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
double clicking on TPave will execute action
virtual void Modify()
Change current line attributes if necessary.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
if object in a list can be deleted
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
A TBox with a bordersize and a shadow option.
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Double_t fY1
Y of 1st point.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void SetY2(Double_t y2)
Set the Y2 value.
static const double x2[5]
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Double_t fX1NDC
X1 point in NDC coordinates.
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 Modify()
Change current fill area attributes if necessary.
Double_t Log10(Double_t x)
virtual ~TPave()
Pave default destructor.
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 SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Double_t fX2
X of 2nd point.
virtual void SetX1(Double_t x1)
Set the X1 value.
virtual void Print(Option_t *option="") const
Dump this box with its attributes.
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.
Double_t fX1
X of 1st point.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
virtual void Paint(Option_t *option="")
Paint this pave with its current attributes.
Option_t * GetName() const
Returns name of object.
Int_t fBorderSize
window box bordersize in pixels
virtual void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="")
Draw this box with new coordinates.
Double_t fCornerRadius
Corner radius in case of option arc.
virtual Color_t GetLineColor() const
Return the line color.
Int_t GetShadowColor() const
virtual void Draw(Option_t *option="")
Draw this pave with its current attributes.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual void SetY1(Double_t y1)
Set the Y1 value.
Double_t fY2NDC
Y2 point in NDC coordinates.
static const double x1[5]
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.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a pave.
virtual Color_t GetFillColor() const
Return the fill area color.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Double_t fX2NDC
X2 point in NDC coordinates.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetX2(Double_t x2)
Set the X2 value.
Mother of all ROOT objects.
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.
TPave()
Pave default constructor.
virtual void ls(Option_t *option="") const
List this pave with its attributes.
Int_t fInit
(=0 if transformation to NDC not yet done)
Double_t fY1NDC
Y1 point in NDC coordinates.
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.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
TString fOption
Pave style.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0