111 if (!
gPad || !
gPad->IsEditable())
return;
113 auto &parent = *
gPad;
128 auto x1 = parent.AbsPixeltoX(px1);
129 auto y1 = parent.AbsPixeltoY(py1);
130 auto x2 = parent.AbsPixeltoX(px2);
131 auto y2 = parent.AbsPixeltoY(py2);
140 auto pp = parent.GetPainter();
163 px1 = parent.XtoAbsPixel(parent.XtoPad(
GetX1()));
164 py1 = parent.YtoAbsPixel(parent.YtoPad(
GetY1()));
165 px2 = parent.XtoAbsPixel(parent.XtoPad(
GetX2()));
166 py2 = parent.YtoAbsPixel(parent.YtoPad(
GetY2()));
184 }
else if (
IsInside(parent.PadtoX(parent.AbsPixeltoX(px)), parent.PadtoY(parent.AbsPixeltoY(py)))) {
201 Int_t px1p = parent.XtoAbsPixel(parent.GetX1()) + parent.GetBorderSize();
202 Int_t py1p = parent.YtoAbsPixel(parent.GetY1()) - parent.GetBorderSize();
203 Int_t px2p = parent.XtoAbsPixel(parent.GetX2()) - parent.GetBorderSize();
204 Int_t py2p = parent.YtoAbsPixel(parent.GetY2()) + parent.GetBorderSize();
235 px2 += px -
dpx1 - px1;
237 py1 += py -
dpy2 - py2;
249 case pINSIDE: parent.ShowGuidelines(
this, event,
'i',
true);
break;
250 case pL: parent.ShowGuidelines(
this, event,
'l',
true);
break;
251 case pR: parent.ShowGuidelines(
this, event,
'r',
true);
break;
252 case pTop: parent.ShowGuidelines(
this, event,
't',
true);
break;
253 case pBot: parent.ShowGuidelines(
this, event,
'b',
true);
break;
256 parent.Modified(
kTRUE);
265 parent.ShowGuidelines(
this, event);
267 if (
gROOT->IsEscaped()) {
279 parent.ModifiedUpdate();
288 parent.Modified(
kTRUE);
302 event = parent.GetCanvasImp()->RequestLocator(px, py);
371 x[4] =
x[0];
y[4] =
y[0];
375 gPad->PaintFillArea(4,
x,
y);
383 x[4] =
x[0];
y[4] =
y[0];
388 gPad->PaintFillArea(4,
x,
y);
389 gPad->PaintPolyLine(5,
x,
y);
400 SavePrimitiveConstructor(out,
Class(),
"diamond",
TString::Format(
"%g, %g, %g, %g",
fX1,
fY1,
fX2,
fY2));
short Color_t
Color number (short)
const char Option_t
Option string (const char)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t SetFillStyle
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 mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char y1
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 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 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 SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
Save text attributes as C++ statement(s) on output stream out.
Double_t fX1
X of 1st point.
Double_t fY2
Y of 2nd point.
Double_t fX2
X of 2nd point.
Double_t fY1
Y of 1st point.
Bool_t fResizing
! True if box is being resized
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
TDiamond()
Diamond default constructor.
void Draw(Option_t *option="") override
Draw this diamond with its current attributes.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
void Paint(Option_t *option="") override
Paint this diamond with its current attributes.
void Streamer(TBuffer &) override
Stream an object of class TBox.
Int_t IsInside(Double_t x, Double_t y) const override
Return 1 if the point (x,y) is inside the polygon defined by the diamond 0 otherwise.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a diamond.
~TDiamond() override
Diamond destructor.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
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.
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".
A Pave (see TPave) with text, lines or/and boxes inside.
virtual void SaveLines(std::ostream &out, const char *name, Bool_t)
Save lines of this pavetext as C++ statements on output stream out.
virtual void PaintPrimitives(Int_t mode)
Paint list of primitives in this pavetext.
void SetX2(Double_t x2) override
Set the X2 value.
Int_t fBorderSize
window box bordersize in pixels
void SetX1(Double_t x1) override
Set the X1 value.
void SetY1(Double_t y1) override
Set the Y1 value.
void SetY2(Double_t y2) override
Set the Y2 value.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
Function which returns kTRUE if point xp,yp lies inside the polygon defined by the np points in array...
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.