97 TAttLine::operator=(
b);
98 TAttFill::operator=(
b);
122 ((
TBox&)obj).fTip =
nullptr;
137 if (!
gPad)
return 9999;
138 Int_t pxl, pyl, pxt, pyt;
147 if (
gPad->GetLogx()) {
151 if (
gPad->GetLogy()) {
157 if (px1 < px2) {pxl = px1; pxt = px2;}
158 else {pxl = px2; pxt = px1;}
159 if (py1 < py2) {pyl = py1; pyt = py2;}
160 else {pyl = py2; pyt = py1;}
164 if ( (px >= pxl && px <= pxt) && (py >= pyl && py <= pyt) )
return 0;
170 if (py < pyl) dxl += pyl - py;
171 if (py > pyt) dxl += py - pyt;
173 if (py < pyl) dxt += pyl - py;
174 if (py > pyt) dxt += py - pyt;
176 if (px < pxl) dyl += pxl - px;
177 if (px > pxt) dyl += px - pxt;
179 if (px < pxl) dyt += pxl - px;
180 if (px > pxt) dyt += px - pxt;
182 Int_t distance = dxl;
183 if (dxt < distance) distance = dxt;
184 if (dyl < distance) distance = dyl;
185 if (dyt < distance) distance = dyt;
241 const Int_t kMaxDiff = 7;
242 const Int_t kMinSize = 20;
244 static Int_t px1, px2, py1, py2, pxl, pyl, pxt, pyt, pxold, pyold;
245 static Int_t px1p, px2p, py1p, py2p, pxlp, pylp, pxtp, pytp;
246 static Double_t oldX1, oldY1, oldX2, oldY2;
247 static Bool_t pA, pB, pC, pD, pTop, pL, pR, pBot, pINSIDE;
290 if (
gPad->GetLogx()) {
294 if (
gPad->GetLogy()) {
335 pA = pB = pC = pD = pTop = pL = pR = pBot = pINSIDE =
kFALSE;
339 pxold = pxl; pyold = pyl; pA =
kTRUE;
344 pxold = pxt; pyold = pyl; pB =
kTRUE;
349 pxold = pxt; pyold = pyt; pC =
kTRUE;
354 pxold = pxl; pyold = pyt; pD =
kTRUE;
358 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
360 pxold = pxl; pyold = pyl; pTop =
kTRUE;
364 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
366 pxold = pxt; pyold = pyt; pBot =
kTRUE;
370 if ((py > pyl+kMaxDiff && py < pyt-kMaxDiff) &&
372 pxold = pxl; pyold = pyl; pL =
kTRUE;
376 if ((py > pyl+kMaxDiff && py < pyt-kMaxDiff) &&
378 pxold = pxt; pyold = pyt; pR =
kTRUE;
382 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
383 (py > pyl+kMaxDiff && py < pyt-kMaxDiff)) {
384 pxold = px; pyold = py; pINSIDE =
kTRUE;
392 if (pA || pB || pC || pD || pTop || pL || pR || pBot)
395 if (!pA && !pB && !pC && !pD && !pTop && !pL && !pR && !pBot && !pINSIDE)
407 if (px > pxt-kMinSize) { px = pxt-kMinSize; wx = px; }
408 if (py > pyt-kMinSize) { py = pyt-kMinSize; wy = py; }
409 if (px < pxlp) { px = pxlp; wx = px; }
410 if (py < pylp) { py = pylp; wy = py; }
415 if (px < pxl+kMinSize) { px = pxl+kMinSize; wx = px; }
416 if (py > pyt-kMinSize) { py = pyt-kMinSize; wy = py; }
417 if (px > pxtp) { px = pxtp; wx = px; }
418 if (py < pylp) { py = pylp; wy = py; }
423 if (px < pxl+kMinSize) { px = pxl+kMinSize; wx = px; }
424 if (py < pyl+kMinSize) { py = pyl+kMinSize; wy = py; }
425 if (px > pxtp) { px = pxtp; wx = px; }
426 if (py > pytp) { py = pytp; wy = py; }
431 if (px > pxt-kMinSize) { px = pxt-kMinSize; wx = px; }
432 if (py < pyl+kMinSize) { py = pyl+kMinSize; wy = py; }
433 if (px < pxlp) { px = pxlp; wx = px; }
434 if (py > pytp) { py = pytp; wy = py; }
440 if (py2 > py1-kMinSize) { py2 = py1-kMinSize; wy = py2; }
441 if (py2 < py2p) { py2 = py2p; wy = py2; }
447 if (py1 < py2+kMinSize) { py1 = py2+kMinSize; wy = py1; }
448 if (py1 > py1p) { py1 = py1p; wy = py1; }
454 if (px1 > px2-kMinSize) { px1 = px2-kMinSize; wx = px1; }
455 if (px1 < px1p) { px1 = px1p; wx = px1; }
461 if (px2 < px1+kMinSize) { px2 = px1+kMinSize; wx = px2; }
462 if (px2 > px2p) { px2 = px2p; wx = px2; }
467 Int_t dx = px - pxold;
468 Int_t dy = py - pyold;
469 px1 += dx; py1 += dy; px2 += dx; py2 += dy;
470 if (px1 < px1p) { dx = px1p - px1; px1 += dx; px2 += dx; wx = px+dx; }
471 if (px2 > px2p) { dx = px2 - px2p; px1 -= dx; px2 -= dx; wx = px-dx; }
472 if (py1 > py1p) { dy = py1 - py1p; py1 -= dy; py2 -= dy; wy = py-dy; }
473 if (py2 < py2p) { dy = py2p - py2; py1 += dy; py2 += dy; wy = py+dy; }
487 if ((pINSIDE && opaque) || (
fResizing && ropaque)) {
489 fX1 =
gPad->AbsPixeltoX(pxold);
492 fY2 =
gPad->AbsPixeltoY(pyold);
497 fX2 =
gPad->AbsPixeltoX(pxold);
498 fY2 =
gPad->AbsPixeltoY(pyold);
502 fY1 =
gPad->AbsPixeltoY(pyold);
503 fX2 =
gPad->AbsPixeltoX(pxold);
507 fX1 =
gPad->AbsPixeltoX(pxold);
508 fY1 =
gPad->AbsPixeltoY(pyold);
512 if (pTop || pBot || pL || pR || pINSIDE) {
520 if (
gPad->GetLogx()) {
524 if (
gPad->GetLogy()) {
530 if (pINSIDE)
gPad->ShowGuidelines(
this,
event,
'i',
true);
531 if (pTop)
gPad->ShowGuidelines(
this,
event,
't',
true);
532 if (pBot)
gPad->ShowGuidelines(
this,
event,
'b',
true);
533 if (pL)
gPad->ShowGuidelines(
this,
event,
'l',
true);
534 if (pR)
gPad->ShowGuidelines(
this,
event,
'r',
true);
535 if (pA)
gPad->ShowGuidelines(
this,
event,
'1',
true);
536 if (pB)
gPad->ShowGuidelines(
this,
event,
'2',
true);
537 if (pC)
gPad->ShowGuidelines(
this,
event,
'3',
true);
538 if (pD)
gPad->ShowGuidelines(
this,
event,
'4',
true);
545 if (
gROOT->IsEscaped()) {
558 if (opaque || ropaque) {
563 fX1 =
gPad->AbsPixeltoX(pxold);
566 fY2 =
gPad->AbsPixeltoY(pyold);
571 fX2 =
gPad->AbsPixeltoX(pxold);
572 fY2 =
gPad->AbsPixeltoY(pyold);
576 fY1 =
gPad->AbsPixeltoY(pyold);
577 fX2 =
gPad->AbsPixeltoX(pxold);
581 fX1 =
gPad->AbsPixeltoX(pxold);
582 fY1 =
gPad->AbsPixeltoY(pyold);
586 if (pTop || pBot || pL || pR || pINSIDE) {
594 if (
gPad->GetLogx()) {
598 if (
gPad->GetLogy()) {
610 if (pA || pB || pC || pD || pTop || pL || pR || pBot)
gPad->Modified(
kTRUE);
625 event =
gVirtualX->RequestLocator(1, 1, px, py);
653 if (x < fX1 || x >
fX2)
return 0;
654 if (y < fY1 || y >
fY2)
return 0;
719 out<<
"box = new TBox("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2<<
");"<<std::endl;
724 out<<
" box->Draw();"<<std::endl;
735 Warning(
"SetToolTipText",
"a canvas must exist before setting the tool tip text");
783 if (!
gPad)
return BBox;
784 Int_t px1, py1, px2, py2;
791 if (px1>px2) { tmp = px1; px1 = px2; px2 = tmp;}
792 if (py1>py2) { tmp = py1; py1 = py2; py2 = tmp;}
796 BBox.fWidth = px2-px1;
797 BBox.fHeight = py2-py1;
808 if (!
gPad)
return (
p);
winID h TVirtualViewer3D TVirtualGLPainter p
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 TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
Abstract base class for elements drawn in the editor.
Fill Area Attributes class.
virtual void Streamer(TBuffer &)
virtual Color_t GetFillColor() const
Return the fill area color.
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
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 void Streamer(TBuffer &)
virtual Color_t GetLineColor() const
Return the line color.
virtual Width_t GetLineWidth() const
Return the line width.
Width_t fLineWidth
Line width.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void Modify()
Change current line attributes if necessary.
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
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.
void Draw(Option_t *option="") override
Draw this box with its current attributes.
virtual void SetToolTipText(const char *text, Long_t delayms=1000)
Set tool tip text associated with this box.
virtual void SetY2(Double_t y2)
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.
void SetBBoxX1(const Int_t x) override
Set left hand side of BoundingBox to a value (resize in x direction on left)
~TBox() override
Box destructor.
TBox & operator=(const TBox &)
Assignment operator.
void SetBBoxY2(const Int_t y) override
Set bottom of BoundingBox to a value (resize in y direction on bottom)
void SetBBoxY1(const Int_t y) override
Set top of BoundingBox to a value (resize in y direction on top)
Double_t fX1
X of 1st point.
TClass * IsA() const override
virtual void HideToolTip(Int_t event)
Hide tool tip depending on the event type.
void SetBBoxCenterY(const Int_t y) override
Set Y coordinate of the center of the Box.
void ls(Option_t *option="") const override
List this box with its attributes.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
virtual void SetX1(Double_t x1)
void Paint(Option_t *option="") override
Paint this box with its current attributes.
virtual Int_t IsInside(Double_t x, Double_t y) const
Function which returns 1 if point x,y lies inside the box, 0 otherwise.
TPoint GetBBoxCenter() override
Return the center of the Box as TPoint in pixels.
virtual void SetX2(Double_t x2)
TBox()
Box default constructor.
virtual TBox * DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this box with new coordinates.
Rectangle_t GetBBox() override
Return the "bounding Box" of the Box.
void Print(Option_t *option="") const override
Dump this box with its attributes.
TObject * fTip
! tool tip associated with box
void SetBBoxCenter(const TPoint &p) override
Set center of the Box.
Double_t fY2
Y of 2nd point.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Double_t fX2
X of 2nd point.
Double_t fY1
Y of 1st point.
void Copy(TObject &box) const override
Copy a Box.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a box.
Bool_t fResizing
! True if box is being resized
void SetBBoxX2(const Int_t x) override
Set right hand side of BoundingBox to a value (resize in x direction on right)
virtual void SetY1(Double_t y1)
void SetBBoxCenterX(const Int_t x) override
Set X coordinate of the center of the 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
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Copy(TObject &object) const
Copy this to obj.
@ kCanDelete
if object in a list can be deleted
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
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual Int_t YtoAbsPixel(Double_t y) const =0
virtual Double_t GetX2() const =0
virtual Int_t XtoAbsPixel(Double_t x) const =0
virtual Double_t GetY1() const =0
virtual Double_t GetY2() const =0
virtual Short_t GetBorderSize() const =0
virtual Double_t GetX1() const =0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
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.
Rectangle structure (maps to the X11 XRectangle structure)