119 if (!
gPad || !
gPad->IsEditable())
return;
121 auto &parent = *
gPad;
138 parent.Interactive(
this,
inter);
148 if (!
inter->SelectDiamondCorner(px, py)) {
150 parent.Interactive();
165 if (!
inter->ProcessMouseMove(parent, px, py))
168 inter->ApplyChanges(parent);
170 if (
inter->IsOpaque(parent)) {
172 parent.ShowGuidelines(
this,
event,
inter->GetGuideChar(),
true);
173 parent.Modified(
kTRUE);
182 parent.ShowGuidelines(
this,
event);
184 if (
gROOT->IsEscaped()) {
197 parent.Interactive();
208 event = parent.GetCanvasImp()->RequestLocator(px, py);
277 x[4] =
x[0];
y[4] =
y[0];
281 gPad->PaintFillArea(4,
x,
y);
289 x[4] =
x[0];
y[4] =
y[0];
294 gPad->PaintFillArea(4,
x,
y);
295 gPad->PaintPolyLine(5,
x,
y);
306 SavePrimitiveConstructor(out,
Class(),
"diamond",
TString::Format(
"%g, %g, %g, %g",
fX1,
fY1,
fX2,
fY2));
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.
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 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.
TBoxInteractive(Bool_t bx=kTRUE, Double_t x1=0., Double_t y1=0., Double_t x2=0., Double_t y2=0.)
Constructor.
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
void PaintOutline(TVirtualPad &parent) override
Paint object outline.
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.
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.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void PaintPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="")=0
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...