Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TBox.cxx
Go to the documentation of this file.
1// @(#)root/graf:$Id$
2// Author: Rene Brun 12/12/94
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include <cstdlib>
13
14#include <iostream>
15#include "TROOT.h"
16#include "TBuffer.h"
17#include "TBox.h"
18#include "TBoxInteractive.h"
19#include "TVirtualPad.h"
20#include "TCanvasImp.h"
21#include "TClass.h"
22#include "TMath.h"
23
24
25/** \class TBox
26\ingroup BasicGraphics
27
28Create a Box.
29
30A box is defined by :
31
32- Its bottom left coordinates x1,y1
33- Its top right coordinates x2,y2
34
35A box has line attributes (see TAttLine) and fill area attributes (see TAttFill).
36*/
37
38////////////////////////////////////////////////////////////////////////////////
39/// Box default constructor.
40
42{
43 fTip = nullptr;
44 fX1 = 0.;
45 fY1 = 0.;
46 fX2 = 0.;
47 fY2 = 0.;
49}
50
51////////////////////////////////////////////////////////////////////////////////
52/// Box standard constructor.
53
55 : TObject(), TAttLine(), TAttFill()
56{
57 if (x2 >= x1) {fX1 =x1; fX2 = x2;}
58 else {fX1 = x2; fX2 = x1;}
59 if (y2 >= y1) {fY1 =y1; fY2 = y2;}
60 else {fY1 = y2; fY2 = y1;}
62 fTip = nullptr;
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// Box destructor.
67
69{
70 if (fTip && gPad) {
71 gPad->CloseToolTip(fTip);
72 gPad->DeleteToolTip(fTip);
73 }
74}
75
76////////////////////////////////////////////////////////////////////////////////
77/// Box copy constructor.
78
80{
81 fX1 = 0.;
82 fY1 = 0.;
83 fX2 = 0.;
84 fY2 = 0.;
86 ((TBox&)box).TBox::Copy(*this);
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// Assignment operator.
91
93{
94 if(this!=&b) {
96 TAttLine::operator=(b);
97 TAttFill::operator=(b);
98 fTip=b.fTip;
99 fX1=b.fX1;
100 fY1=b.fY1;
101 fX2=b.fX2;
102 fY2=b.fY2;
103 fResizing=b.fResizing;
104 }
105 return *this;
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Copy a Box.
110
111void TBox::Copy(TObject &obj) const
112{
113 TObject::Copy(obj);
114 TAttLine::Copy(((TBox&)obj));
115 TAttFill::Copy(((TBox&)obj));
116 ((TBox&)obj).fX1 = fX1;
117 ((TBox&)obj).fY1 = fY1;
118 ((TBox&)obj).fX2 = fX2;
119 ((TBox&)obj).fY2 = fY2;
120 ((TBox&)obj).fResizing = fResizing;
121 ((TBox&)obj).fTip = nullptr; //FIXME
122}
123
124////////////////////////////////////////////////////////////////////////////////
125/// Compute distance from point px,py to a box.
126///
127/// Compute the closest distance of approach from point px,py to the
128/// edges of this box.
129/// The distance is computed in pixels units.
130///
131/// In case of a filled box the distance returned is 0 if the point
132/// (px,py) is inside the box, and is huge if the point is outside.
133
135{
136 if (!gPad) return 9999;
137 Int_t pxl, pyl, pxt, pyt;
138 Int_t px1 = gPad->XtoAbsPixel(fX1);
139 Int_t py1 = gPad->YtoAbsPixel(fY1);
140 Int_t px2 = gPad->XtoAbsPixel(fX2);
141 Int_t py2 = gPad->YtoAbsPixel(fY2);
142
143 Bool_t isBox = !(InheritsFrom("TPave") || InheritsFrom("TWbox"));
144
145 if (isBox) {
146 if (gPad->GetLogx()) {
147 if (fX1>0) px1 = gPad->XtoAbsPixel(TMath::Log10(fX1));
148 if (fX2>0) px2 = gPad->XtoAbsPixel(TMath::Log10(fX2));
149 }
150 if (gPad->GetLogy()) {
151 if (fY1>0) py1 = gPad->YtoAbsPixel(TMath::Log10(fY1));
152 if (fY2>0) py2 = gPad->YtoAbsPixel(TMath::Log10(fY2));
153 }
154 }
155
156 if (px1 < px2) {pxl = px1; pxt = px2;}
157 else {pxl = px2; pxt = px1;}
158 if (py1 < py2) {pyl = py1; pyt = py2;}
159 else {pyl = py2; pyt = py1;}
160
161 // Are we inside the box?
162 if (GetFillStyle()) {
163 if ( (px >= pxl && px <= pxt) && (py >= pyl && py <= pyt) ) return 0;
164 else return 9999;
165 }
166
167 // Are we on the edges?
168 Int_t dxl = TMath::Abs(px - pxl);
169 if (py < pyl) dxl += pyl - py;
170 if (py > pyt) dxl += py - pyt;
171 Int_t dxt = TMath::Abs(px - pxt);
172 if (py < pyl) dxt += pyl - py;
173 if (py > pyt) dxt += py - pyt;
174 Int_t dyl = TMath::Abs(py - pyl);
175 if (px < pxl) dyl += pxl - px;
176 if (px > pxt) dyl += px - pxt;
177 Int_t dyt = TMath::Abs(py - pyt);
178 if (px < pxl) dyt += pxl - px;
179 if (px > pxt) dyt += px - pxt;
180
182 if (dxt < distance) distance = dxt;
183 if (dyl < distance) distance = dyl;
184 if (dyt < distance) distance = dyt;
185
186 return distance - Int_t(0.5*fLineWidth);
187}
188
189////////////////////////////////////////////////////////////////////////////////
190/// Draw this box with its current attributes.
191/// if the box has no fill style (ie fill style=0), the box contour is drawn
192/// if the box has a fill style, the box contour is not drawn by default.
193/// to force the contour to be drawn, specify option "l"
194
196{
198
199}
200
201////////////////////////////////////////////////////////////////////////////////
202/// Draw this box with new coordinates.
203
205{
206 TBox *newbox = new TBox(x1,y1,x2,y2);
209 newbox->SetBit(kCanDelete);
210 newbox->AppendPad();
211 return newbox;
212}
213
214
215////////////////////////////////////////////////////////////////////////////////
216/// Execute action corresponding to one event.
217///
218/// This member function is called when a BOX/WBOX/PAD object is clicked.
219///
220/// If the mouse is clicked in one of the 4 corners of the box (pA,pB,pC,pD)
221/// the box is resized with the rubber rectangle.
222///
223/// If the mouse is clicked inside the box, the box is moved.
224///
225/// If the mouse is clicked on the 4 edges (pL,pR,pTop,pBot), the box is
226/// rescaled parallel to this edge (same as Motif window manager).
227///
228/// Note that this function is duplicated on purpose by TPad::ExecuteEvent.
229/// If somebody modifies this function, may be similar changes should also
230/// be applied to TPad::ExecuteEvent.
231
233{
234 if (TestBit(kCannotMove)) return;
235
236 if (!gPad) return;
237
238 auto &parent = *gPad;
239
240 if (!parent.IsEditable() && event != kMouseEnter) return;
241
242 Bool_t isBox = !(InheritsFrom("TPave") || InheritsFrom("TWbox"));
244
245 if (event >= 10000) {
246 // special config from TSliderBox, where only single dimension can be changed
247 Int_t mask = event / 10000;
249 canX = mask & 1;
250 canY = mask & 2;
251 event = event % 10000;
252 }
253
254 auto inter = dynamic_cast<TBoxInteractive *>(parent.Interactive(this));
255
256 auto setNewValues = [&inter, this, canX, canY]() {
257 if (canX) {
258 SetX1(inter->newX1);
259 SetX2(inter->newX2);
260 }
261 if (canY) {
262 SetY1(inter->newY1);
263 SetY2(inter->newY2);
264 }
265 };
266
268
269 switch (event) {
270
271 case kMouseEnter:
272 if (fTip)
273 parent.ResetToolTip(fTip);
274 break;
275
276 case kArrowKeyPress:
277 case kButton1Down:
278 inter = new TBoxInteractive(isBox, GetX1(), GetY1(), GetX2(), GetY2());
279 parent.Interactive(this, inter);
280 // No break !!!
281
282 case kMouseMotion: {
283 // use dummy when simple motion without mouse down performed
284 TBoxInteractive dummy(isBox);
285 if (!inter) inter = &dummy;
286 inter->CalcPixelCoord(parent, GetX1(), GetY1(), GetX2(), GetY2());
287
288 if (!inter->SelectCorner(px, py, canX, canY)) {
289 // refuse interactive changes
290 parent.Interactive();
291 } else {
292 inter->SetCursor(parent, event == kButton1Down);
293 fResizing = inter->IsResizing() && (event != kMouseMotion);
294 }
295
296 break;
297 }
298
299 case kArrowKeyRelease:
300 case kButton1Motion: {
301 if (!inter)
302 return;
303
304 if (!inter->ProcessMouseMove(parent, px, py, canX, canY))
305 return;
306
307 inter->ApplyChanges(parent);
308
309 if (liveUpdate)
310 setNewValues();
311
312 if (inter->IsOpaque(parent)) {
313 setNewValues();
314 parent.ShowGuidelines(this, event, inter->GetGuideChar(), true);
315 parent.Modified(kTRUE);
316 }
317
318 break;
319 }
320
321 case kButton1Up: {
322 if (inter && inter->IsOpaque(parent))
323 parent.ShowGuidelines(this, event);
324
325 if (gROOT->IsEscaped()) {
326 gROOT->SetEscape(kFALSE);
327 if (inter && inter->IsOpaque(parent)) {
328 SetX1(inter->oldX1);
329 SetY1(inter->oldY1);
330 SetX2(inter->oldX2);
331 SetY2(inter->oldY2);
332 }
333 } else if (inter && !inter->IsOpaque(parent) && (inter->newX1 != inter->newX2)) {
334 setNewValues();
335 }
336
337 parent.Modified();
338 parent.Interactive(); // delete interactive object
340
341 break;
342 }
343
344 case kButton1Locate:
345 // Sergey: code is never used, has to be removed in ROOT7
346
347 ExecuteEvent(kButton1Down, px, py);
348
349 while (true) {
350 px = py = 0;
351 event = parent.GetCanvasImp()->RequestLocator(px, py);
352
354
355 if (event != -1) { // button is released
356 ExecuteEvent(kButton1Up, px, py);
357 return;
358 }
359 }
360 }
361}
362
363////////////////////////////////////////////////////////////////////////////////
364/// Hide tool tip depending on the event type. Typically tool tips
365/// are hidden when event is not a kMouseEnter and not a kMouseMotion
366/// event.
367
369{
370 if (event != kMouseEnter && event != kMouseMotion && fTip && gPad)
371 gPad->CloseToolTip(fTip);
372}
373
374////////////////////////////////////////////////////////////////////////////////
375/// Function which returns 1 if point x,y lies inside the box, 0 otherwise.
376
378{
379 if (x < fX1 || x > fX2) return 0;
380 if (y < fY1 || y > fY2) return 0;
381 return 1;
382}
383
384////////////////////////////////////////////////////////////////////////////////
385/// List this box with its attributes.
386
387void TBox::ls(Option_t *) const
388{
390 printf("%s X1= %f Y1=%f X2=%f Y2=%f\n",IsA()->GetName(),fX1,fY1,fX2,fY2);
391}
392
393////////////////////////////////////////////////////////////////////////////////
394/// Paint this box with its current attributes.
395
397{
398 if(gPad) PaintBox(gPad->XtoPad(fX1),gPad->YtoPad(fY1),gPad->XtoPad(fX2),gPad->YtoPad(fY2),option);
399}
400
401////////////////////////////////////////////////////////////////////////////////
402/// Draw this box with new coordinates.
403
405{
406 if (!gPad) return;
407
408 TAttLine::Modify(); //Change line attributes only if necessary
409 TAttFill::Modify(); //Change fill area attributes only if necessary
410
411 if (option) {
412 TString opt = option;
413 opt.ToLower();
414 if (opt.Contains("l")) gPad->PaintBox(x1,y1,x2,y2,"l");
415 else gPad->PaintBox(x1,y1,x2,y2);
416 } else {
417 gPad->PaintBox(x1,y1,x2,y2);
418 }
419}
420
421////////////////////////////////////////////////////////////////////////////////
422/// Dump this box with its attributes.
423
425{
426 printf("%s X1=%f Y1=%f X2=%f Y2=%f",IsA()->GetName(),fX1,fY1,fX2,fY2);
427 if (GetLineColor() != 1) printf(" Color=%d",GetLineColor());
428 if (GetLineStyle() != 1) printf(" Style=%d",GetLineStyle());
429 if (GetLineWidth() != 1) printf(" Width=%d",GetLineWidth());
430 if (GetFillColor() != 0) printf(" FillColor=%d",GetFillColor());
431 if (GetFillStyle() != 0) printf(" FillStyle=%d",GetFillStyle());
432 printf("\n");
433}
434
435////////////////////////////////////////////////////////////////////////////////
436/// Save primitive as a C++ statement(s) on output stream out
437
438void TBox::SavePrimitive(std::ostream &out, Option_t *option)
439{
440 SavePrimitiveConstructor(out, Class(), "box", TString::Format("%g, %g, %g, %g", fX1, fY1, fX2, fY2));
441
442 SaveFillAttributes(out, "box", -1, -1);
443 SaveLineAttributes(out, "box", 1, 1, 1);
444
445 SavePrimitiveDraw(out, "box", option);
446}
447
448////////////////////////////////////////////////////////////////////////////////
449/// Set tool tip text associated with this box. The delay is in
450/// milliseconds (minimum 250). To remove tool tip call method with
451/// text = 0.
452
454{
455 if (!gPad) {
456 Warning("SetToolTipText", "a canvas must exist before setting the tool tip text");
457 return;
458 }
459
460 if (fTip) {
461 gPad->DeleteToolTip(fTip);
462 fTip = nullptr;
463 }
464
465 if (text && strlen(text))
466 fTip = gPad->CreateToolTip(this, text, delayms);
467}
468
469////////////////////////////////////////////////////////////////////////////////
470/// Stream an object of class TBox.
471
473{
474 if (R__b.IsReading()) {
476 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
477 if (R__v > 1) {
478 R__b.ReadClassBuffer(TBox::Class(), this, R__v, R__s, R__c);
479 return;
480 }
481 //====process old versions before automatic schema evolution
485 Float_t x1,y1,x2,y2;
486 R__b >> x1; fX1 = x1;
487 R__b >> y1; fY1 = y1;
488 R__b >> x2; fX2 = x2;
489 R__b >> y2; fY2 = y2;
490 R__b.CheckByteCount(R__s, R__c, TBox::IsA());
491 //====end of old versions
492
493 } else {
494 R__b.WriteClassBuffer(TBox::Class(),this);
495 }
496}
497
498////////////////////////////////////////////////////////////////////////////////
499/// Return the "bounding Box" of the Box
500
502{
503 Rectangle_t BBox{0,0,0,0};
504 if (gPad) {
505 Int_t px1 = gPad->XtoPixel(fX1);
506 Int_t px2 = gPad->XtoPixel(fX2);
507 Int_t py1 = gPad->YtoPixel(fY1);
508 Int_t py2 = gPad->YtoPixel(fY2);
509
510 if (px1 > px2)
511 std::swap(px1, px2);
512 if (py1 > py2)
513 std::swap(py1, py2);
514
515 BBox.fX = px1;
516 BBox.fY = py1;
517 BBox.fWidth = px2 - px1;
518 BBox.fHeight = py2 - py1;
519 }
520
521 return BBox;
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// Set X coordinate of the center of the Box
526
528{
529 Double_t w2 = 0.5* (fX2 - fX1);
531 SetX1(midx - w2);
532 SetX2(midx + w2);
533}
534
535////////////////////////////////////////////////////////////////////////////////
536/// Set Y coordinate of the center of the Box
537
539{
540 Double_t h2 = 0.5 * (fY2 - fY1);
542 SetY1(midy - h2);
543 SetY2(midy + h2);
544}
545
546////////////////////////////////////////////////////////////////////////////////
547/// Set left hand side of BoundingBox to a value
548/// (resize in x direction on left)
549
551{
552 SetX1(GetXCoord(x));
553}
554
555////////////////////////////////////////////////////////////////////////////////
556/// Set right hand side of BoundingBox to a value
557/// (resize in x direction on right)
558
560{
561 SetX2(GetXCoord(x));
562}
563
564////////////////////////////////////////////////////////////////////////////////
565/// Set top of BoundingBox to a value (resize in y direction on top)
566
568{
569 SetY2(GetYCoord(y));
570}
571
572////////////////////////////////////////////////////////////////////////////////
573/// Set bottom of BoundingBox to a value
574/// (resize in y direction on bottom)
575
577{
578 SetY1(GetYCoord(y));
579}
@ kMouseMotion
Definition Buttons.h:23
@ kArrowKeyRelease
Definition Buttons.h:21
@ kButton1Motion
Definition Buttons.h:20
@ kButton1Up
Definition Buttons.h:19
@ kArrowKeyPress
Definition Buttons.h:21
@ kButton1Down
Definition Buttons.h:17
@ kButton1Locate
Definition Buttons.h:22
@ kMouseEnter
Definition Buttons.h:23
#define b(i)
Definition RSha256.hxx:100
cudaEvent_t event
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
short Version_t
Class version identifier (short)
Definition RtypesCore.h:80
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:69
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
const char Option_t
Option string (const char)
Definition RtypesCore.h:81
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
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
#define gROOT
Definition TROOT.h:417
#define gPad
Abstract base class for elements drawn in the editor.
Definition TAttBBox2D.h:19
Double_t GetYCoord(const Int_t y, Bool_t is_ndc=kFALSE, Bool_t is_absolute=kFALSE)
Can return ndc or normal values Also one can specify to use absolute coordinates for input parameter ...
Double_t GetXCoord(const Int_t x, Bool_t is_ndc=kFALSE, Bool_t is_absolute=kFALSE)
Return user X coordinate for pixel X value Can return ndc or normal values Also one can specify to us...
Fill Area Attributes class.
Definition TAttFill.h:21
virtual void Streamer(TBuffer &)
virtual Color_t GetFillColor() const
Return the fill area color.
Definition TAttFill.h:32
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
Definition TAttFill.cxx:203
virtual Style_t GetFillStyle() const
Return the fill area style.
Definition TAttFill.h:33
virtual void Modify()
Change current fill area attributes if necessary.
Definition TAttFill.cxx:212
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.
Definition TAttFill.cxx:240
Line Attributes class.
Definition TAttLine.h:21
virtual void Streamer(TBuffer &)
virtual Color_t GetLineColor() const
Return the line color.
Definition TAttLine.h:36
virtual Width_t GetLineWidth() const
Return the line width.
Definition TAttLine.h:38
Width_t fLineWidth
Line width.
Definition TAttLine.h:26
virtual Style_t GetLineStyle() const
Return the line style.
Definition TAttLine.h:37
virtual void Modify()
Change current line attributes if necessary.
Definition TAttLine.cxx:246
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
Definition TAttLine.cxx:176
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.
Definition TAttLine.cxx:289
Create a Box.
Definition TBox.h:22
void Draw(Option_t *option="") override
Draw this box with its current attributes.
Definition TBox.cxx:195
Double_t GetX1() const
Definition TBox.h:51
virtual void SetToolTipText(const char *text, Long_t delayms=1000)
Set tool tip text associated with this box.
Definition TBox.cxx:453
virtual void SetY2(Double_t y2)
Definition TBox.h:65
virtual void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="")
Draw this box with new coordinates.
Definition TBox.cxx:404
static TClass * Class()
void Streamer(TBuffer &) override
Stream an object of class TBox.
Definition TBox.cxx:472
void SetBBoxX1(const Int_t x) override
Set left hand side of BoundingBox to a value (resize in x direction on left)
Definition TBox.cxx:550
~TBox() override
Box destructor.
Definition TBox.cxx:68
TBox & operator=(const TBox &)
Assignment operator.
Definition TBox.cxx:92
void SetBBoxY2(const Int_t y) override
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition TBox.cxx:576
void SetBBoxY1(const Int_t y) override
Set top of BoundingBox to a value (resize in y direction on top)
Definition TBox.cxx:567
Double_t fX1
X of 1st point.
Definition TBox.h:28
TClass * IsA() const override
Definition TBox.h:75
virtual void HideToolTip(Int_t event)
Hide tool tip depending on the event type.
Definition TBox.cxx:368
void SetBBoxCenterY(const Int_t y) override
Set Y coordinate of the center of the Box.
Definition TBox.cxx:538
Double_t GetX2() const
Definition TBox.h:52
void ls(Option_t *option="") const override
List this box with its attributes.
Definition TBox.cxx:387
Double_t GetY1() const
Definition TBox.h:53
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition TBox.cxx:232
virtual void SetX1(Double_t x1)
Definition TBox.h:62
void Paint(Option_t *option="") override
Paint this box with its current attributes.
Definition TBox.cxx:396
Double_t GetY2() const
Definition TBox.h:54
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.
Definition TBox.cxx:377
virtual void SetX2(Double_t x2)
Definition TBox.h:63
TBox()
Box default constructor.
Definition TBox.cxx:41
virtual TBox * DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this box with new coordinates.
Definition TBox.cxx:204
Rectangle_t GetBBox() override
Return the "bounding Box" of the Box.
Definition TBox.cxx:501
void Print(Option_t *option="") const override
Dump this box with its attributes.
Definition TBox.cxx:424
TObject * fTip
! tool tip associated with box
Definition TBox.h:25
Double_t fY2
Y of 2nd point.
Definition TBox.h:31
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Definition TBox.cxx:438
Double_t fX2
X of 2nd point.
Definition TBox.h:30
Double_t fY1
Y of 1st point.
Definition TBox.h:29
@ kCannotMove
Definition TBox.h:37
void Copy(TObject &box) const override
Copy a Box.
Definition TBox.cxx:111
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a box.
Definition TBox.cxx:134
Bool_t fResizing
! True if box is being resized
Definition TBox.h:32
void SetBBoxX2(const Int_t x) override
Set right hand side of BoundingBox to a value (resize in x direction on right)
Definition TBox.cxx:559
virtual void SetY1(Double_t y1)
Definition TBox.h:64
void SetBBoxCenterX(const Int_t x) override
Set X coordinate of the center of the Box.
Definition TBox.cxx:527
Buffer base class used for serializing objects.
Definition TBuffer.h:43
Mother of all ROOT objects.
Definition TObject.h:42
TObject & operator=(const TObject &rhs) noexcept
TObject assignment operator.
Definition TObject.h:305
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:461
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
Definition TObject.cxx:995
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1082
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:203
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:548
virtual void Copy(TObject &object) const
Copy this to obj.
Definition TObject.cxx:158
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.
Definition TObject.cxx:844
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".
Definition TObject.cxx:776
@ kCanDelete
if object in a list can be deleted
Definition TObject.h:71
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition TROOT.cxx:3067
Basic string class.
Definition TString.h:137
void ToLower()
Change string to lower-case.
Definition TString.cxx:1190
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2460
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:642
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Definition TMath.h:775
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:122
Rectangle structure (maps to the X11 XRectangle structure)
Definition GuiTypes.h:362