122 pave.TPave::Copy(*
this);
130 src.TPave::Copy(*
this);
161 if (
gPad->GetLogx()) {
165 if (
gPad->GetLogy()) {
209 if (!
gPad)
return 9999;
210 Int_t pxl, pyl, pxt, pyt;
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;}
221 if ( (px >= pxl && px <= pxt) && (py >= pyl && py <= pyt) )
return 0;
231 if (option && strlen(option)) opt = option;
243 TPave *newpave =
new TPave(x1,y1,x2,y2,bordersize,option);
258 if (!
gPad->IsEditable())
return;
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;
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];
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];
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;
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();
383 x[6] =
x[0];
y[6] =
y[0];
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);
405 const Int_t kNPARC = 10;
407 Double_t px[4*kNPARC+10], py[4*kNPARC+10];
416 static Double_t cosa[kNPARC], sina[kNPARC];
420 Double_t dtheta = 0.5*3.141592/(kNPARC+1);
422 for (i=0;i<kNPARC;i++) {
441 px[0] = px2; py[0] = py1 -
r;
442 px[1] = px2; py[1] = py2 +
r;
444 for (i=0;i<kNPARC;i++) {
445 px[np] = px2 -
r +
r*cosa[i];
446 py[np] = py2 +
r -
r*sina[i];
449 px[np] = px2 -
r; py[np] = py2;
450 px[np+1] = px1 +
r; py[np+1] = py2;
452 for (i=kNPARC-1;i>=0;i--) {
453 px[np] = px1 +
r -
r*cosa[i];
454 py[np] = py2 +
r -
r*sina[i];
457 px[np] = px1; py[np] = py2 +
r;
458 px[np+1] = px1; py[np+1] = py1 -
r;
460 for (i=0;i<kNPARC;i++) {
461 px[np] = px1 +
r -
r*cosa[i];
462 py[np] = py1 -
r +
r*sina[i];
465 px[np] = px1 +
r; py[np] = py1;
466 px[np+1] = px2 -
r; py[np+1] = py1;
468 for (i=kNPARC-1;i>=0;i--) {
469 px[np] = px2 -
r +
r*cosa[i];
470 py[np] = py1 -
r +
r*sina[i];
473 px[np] = px[0]; py[np] =py[0];
476 for (i=0;i<=np;i++) {
480 gPad->PaintFillArea(np ,
x,
y);
481 gPad->PaintPolyLine(np+1,
x,
y);
490 px[0] = px2; py[0] = py1 -
r;
491 px[1] = px2; py[1] = py2 +
r;
493 for (i=0;i<kNPARC;i++) {
494 px[np] = px2 -
r +
r*cosa[i];
495 py[np] = py2 +
r -
r*sina[i];
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;
503 for (i=kNPARC-1;i>=0;i--) {
504 px[np] = px2 -
r +
r*cosa[i]*(1+wx/
r);
505 py[np] = py2 +
r -
r*sina[i]*(1+wy/
r);
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];
514 px[0] = px2 -
r; py[0] = py2;
515 px[1] = px1 +
r; py[1] = py2;
517 for (i=kNPARC-1;i>=0;i--) {
518 px[np] = px1 +
r -
r*cosa[i];
519 py[np] = py2 +
r -
r*sina[i];
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;
527 for (i=0;i<kNPARC;i++) {
528 px[np] = px1 +
r -
r*cosa[i]*(1+wx/
r);
529 py[np] = py2 +
r -
r*sina[i]*(1+wy/
r);
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];
538 px[0] = px1; py[0] = py2 +
r;
539 px[1] = px1; py[1] = py1 -
r;
541 for (i=0;i<kNPARC;i++) {
542 px[np] = px1 +
r -
r*cosa[i];
543 py[np] = py1 +
r -
r*sina[i];
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;
551 for (i=kNPARC-1;i>=0;i--) {
552 px[np] = px1 +
r -
r*cosa[i]*(1+wx/
r);
553 py[np] = py1 -
r +
r*sina[i]*(1+wy/
r);
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];
562 px[0] = px1 +
r; py[0] = py1;
563 px[1] = px2 -
r; py[1] = py1;
565 for (i=kNPARC-1;i>=0;i--) {
566 px[np] = px2 -
r +
r*cosa[i];
567 py[np] = py1 -
r +
r*sina[i];
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;
575 for (i=0;i<kNPARC;i++) {
576 px[np] = px2 -
r +
r*cosa[i]*(1+wx/
r);
577 py[np] = py1 -
r +
r*sina[i]*(1+wy/
r);
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];
589 for (i=0;i<=np;i++) {
593 gPad->PaintFillArea(np,
x,
y);
627 if (extra_arg && *extra_arg) {
647 if (strcmp(
GetName(),
"TPave"))
648 out <<
" pave->SetName(\"" <<
GetName() <<
"\");\n";
720 Float_t x1ndc,y1ndc,x2ndc,y2ndc,rad;
721 R__b >> x1ndc;
fX1NDC = x1ndc;
722 R__b >> y1ndc;
fY1NDC = y1ndc;
723 R__b >> x2ndc;
fX2NDC = x2ndc;
724 R__b >> y2ndc;
fY2NDC = y2ndc;
729 fName.Streamer(R__b);
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
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)
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="")
Draw this box with new coordinates.
void Streamer(TBuffer &) override
Stream an object of class TBox.
Double_t fX1
X of 1st point.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
TBox()
Box default constructor.
void Print(Option_t *option="") const override
Dump this box with its attributes.
Double_t fY2
Y of 2nd point.
Double_t fX2
X of 2nd point.
Double_t fY1
Y of 1st point.
void Copy(TObject &box) const override
Copy a Box.
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
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.
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.
TObject()
TObject constructor.
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".
@ kCanDelete
if object in a list can be deleted
TPave()
Pave default constructor.
void Print(Option_t *option="") const override
Dump this pave with its attributes.
void SetX2(Double_t x2) override
Set the X2 value.
TPave & operator=(const TPave &src)
Assignment operator.
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
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.
const char * GetName() const override
Returns name of object.
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...
void Copy(TObject &pave) const override
Copy this pave to pave.
@ kNameIsAction
double clicking on TPave will execute action
void Streamer(TBuffer &) override
Stream an object of class TPave.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Int_t fBorderSize
window box bordersize in pixels
TClass * IsA() const override
void Draw(Option_t *option="") override
Draw this pave with its current attributes.
void ls(Option_t *option="") const override
List this pave with its attributes.
virtual void SetName(const char *name="")
void SetX1(Double_t x1) override
Set the X1 value.
Double_t fX2NDC
X2 point in NDC coordinates.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Int_t fShadowColor
Color of the pave's shadow.
void SetY1(Double_t y1) override
Set the Y1 value.
Int_t fInit
(=0 if transformation to NDC not yet done)
TString fOption
Pave style.
Double_t fY2NDC
Y2 point in NDC coordinates.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a pave.
Double_t fX1NDC
X1 point in NDC coordinates.
void SetY2(Double_t y2) override
Set the Y2 value.
Double_t fCornerRadius
Corner radius in case of option arc.
Option_t * GetOption() const override
Double_t fY1NDC
Y1 point in NDC coordinates.
void Paint(Option_t *option="") override
Paint this pave with its current attributes.
~TPave() override
Pave default destructor.
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.
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.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
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.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.