70 fWcsTitle =
new std::wstring(
text);
88 text.TText::Copy(*
this);
96 src.TText::Copy(*
this);
111 *
reinterpret_cast<std::wstring*
>(((
TText&)obj).fWcsTitle) = *
reinterpret_cast<const std::wstring*
>(
fWcsTitle);
113 delete reinterpret_cast<std::wstring*
>(((
TText&)obj).fWcsTitle);
129 return reinterpret_cast<std::wstring *
>(
fWcsTitle)->c_str();
142 if (!
gPad)
return 9999;
156 Int_t cBoxX[5], cBoxY[5];
225 static Int_t px1, py1, pxold, pyold,
Size, height, width;
226 static Bool_t resize,turn;
237 static Bool_t right, ndcsav;
239 Int_t ax, ay, bx, by, cx, cy;
243 Int_t cBoxX[4], cBoxY[4], part;
247 if (!
gPad->IsEditable())
return;
272 div = ((cBoxX[3]-cBoxX[0])*co-(cBoxY[3]-cBoxY[0])*si);
273 if (
TMath::Abs(div) > 1
e-8) part = (
Int_t)(3*((px-cBoxX[0])*co-(py-cBoxY[0])*si)/ div);
313 if (dtheta<0) theta = -theta;
315 if (theta<0) theta += 360;
316 if (right) {theta = theta+180;
if (theta>=360) theta -= 360;}
324 case 1 : ax = px1; ay = py1;
break;
344 else {bx = ax; by = ay;}
346 lambda =
Double_t(((px-bx)*(cx-bx)+(py-by)*(cy-by)))/
Double_t(((cx-bx)*(cx-bx)+(cy-by)*(cy-by)));
350 if (Size<4)
Size = 4;
355 dx = px - pxold; px1 +=
dx;
356 dy = py - pyold; py1 +=
dy;
362 if (resize)
gPad->ShowGuidelines(
this, event,
't',
false);
363 if ((!resize)&&(!turn))
gPad->ShowGuidelines(
this, event,
'i',
true);
364 gPad->ShowGuidelines(
this, event, !resize&!turn);
370 pxold = px; pyold = py;
380 gPad->ShowGuidelines(
this, event, !resize&!turn);
383 dpx =
gPad->GetX2() -
gPad->GetX1();
384 dpy =
gPad->GetY2() -
gPad->GetY1();
387 fX = (
gPad->AbsPixeltoX(px1)-xp1)/dpx;
388 fY = (
gPad->AbsPixeltoY(py1)-yp1)/dpy;
403 event =
gVirtualX->RequestLocator(1, 1, px, py);
432 case 1 : Dx = 0 ;
break;
433 case 2 : Dx = cBoxW/2;
break;
434 case 3 : Dx = cBoxW ;
break;
437 case 1 : Dy = 0 ;
break;
438 case 2 : Dy = cBoxH/2;
break;
439 case 3 : Dy = cBoxH ;
break;
446 cBoxY[1] =
y-cBoxH+Dy;
447 cBoxX[2] =
x+cBoxW-Dx;
448 cBoxY[2] =
y-cBoxH+Dy;
449 cBoxX[3] =
x+cBoxW-Dx;
456 for (
int i=0; i<4 ; i++) {
457 Int_t hcBoxX = cBoxX[i];
458 Int_t hcBoxY = cBoxY[i];
459 cBoxX[i] = (
Int_t)((hcBoxX-
x)*cosTheta-(hcBoxY-
y)*sinTheta+
x);
460 cBoxY[i] = (
Int_t)((hcBoxX-
x)*sinTheta+(hcBoxY-
y)*cosTheta+
y);
481 Int_t cBoxX[4], cBoxY[4];
495 for (
Int_t i=1; i<4; i++) {
496 if (cBoxX[i] < x1) x1 = cBoxX[i];
497 if (cBoxX[i] > x2) x2 = cBoxX[i];
498 if (cBoxY[i] < y1) y1 = cBoxY[i];
499 if (cBoxY[i] > y2) y2 = cBoxY[i];
505 auto pp =
gPad->GetPainter();
523 auto pp =
gPad->GetPainter();
541 auto pp =
gPad->GetPainter();
558 auto pp =
gPad->GetPainter();
575 auto pp =
gPad->GetPainter();
592 auto pp =
gPad->GetPainter();
623 Int_t cBoxX[4], cBoxY[4];
632 gVirtualX->DrawLine(cBoxX[0], cBoxY[0], cBoxX[1], cBoxY[1]);
633 gVirtualX->DrawLine(cBoxX[1], cBoxY[1], cBoxX[2], cBoxY[2]);
634 gVirtualX->DrawLine(cBoxX[2], cBoxY[2], cBoxX[3], cBoxY[3]);
635 gVirtualX->DrawLine(cBoxX[3], cBoxY[3], cBoxX[0], cBoxY[0]);
639 Int_t ix = 0, iy = 0;
643 case 1 : ix = 0 ; iy = 0 ;
break;
644 case 2 : ix = 0 ; iy = 1 ;
break;
645 case 3 : ix = 1 ; iy = 1 ;
break;
650 case 1 : ix = 0 ; iy = 3 ;
break;
651 case 2 : ix = 0 ; iy = 2 ;
break;
652 case 3 : ix = 1 ; iy = 2 ;
break;
657 case 1 : ix = 3 ; iy = 3 ;
break;
658 case 2 : ix = 2 ; iy = 3 ;
break;
659 case 3 : ix = 2 ; iy = 2 ;
break;
663 p.
fX = (cBoxX[ix]+cBoxX[iy])/2;
664 p.
fY = (cBoxY[ix]+cBoxY[iy])/2;
725 out,
Class(),
"text",
731 out <<
" text->SetNDC();\n";
749 char *mb_title =
new char[MB_CUR_MAX * wcslen(title) + 1]();
751 size_t length = wcslen(title);
752 for (
size_t i = 0; i <
length; i++) {
753 const int n = wctomb(p, title[i]);
790 Rectangle_t BBox{0, 0, 0, 0};
793 Int_t Dx = 0, Dy = 0;
800 case 1: Dx = 0;
break;
801 case 2: Dx = w / 2;
break;
802 case 3: Dx = w;
break;
806 case 1: Dy =
h;
break;
807 case 2: Dy =
h / 2;
break;
808 case 3: Dy = 0;
break;
826 p.SetX(
gPad->XtoPixel(
fX));
827 p.SetY(
gPad->YtoPixel(
fY));
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).
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
short Style_t
Style number (short).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
Abstract base class for elements drawn in the editor.
virtual Float_t GetTextSize() const
Return the text size.
virtual Short_t GetTextAlign() const
Return the text alignment.
virtual Font_t GetTextFont() const
Return the text font.
Float_t fTextAngle
Text angle.
virtual Color_t GetTextColor() const
Return the text color.
virtual void Streamer(TBuffer &)
virtual Float_t GetTextSizePixels(TVirtualPad &pad) const
Return the text size in pixels for specified pad.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual Float_t GetTextAngle() const
Return the text angle.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Short_t fTextAlign
Text alignment.
void Copy(TAttText &atttext) const
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)
Float_t fTextSize
Text size.
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 ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
The TNamed class is the base class for all named ROOT classes.
void Copy(TObject &named) const override
Copy this to obj.
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
Bool_t TestBit(UInt_t f) const
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.
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
@ kMustCleanup
if object destructor must call RecursiveRemove()
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
virtual void GetControlBox(Int_t x, Int_t y, Double_t theta, Int_t cBoxX[4], Int_t cBoxY[4])
virtual void GetTextAdvance(UInt_t &a, const char *text, const Bool_t kern=kTRUE) const
Double_t fY
Y position of text (left,center,etc..).
const void * GetWcsTitle(void) const
void SetBBoxCenter(const TPoint &p) override
Rectangle_t GetBBox() override
void Copy(TObject &text) const override
Copy this to obj.
TText & operator=(const TText &src)
virtual void PaintTextNDC(Double_t u, Double_t v, const char *text)
virtual void SetNDC(Bool_t isNDC=kTRUE)
virtual void PaintText(Double_t x, Double_t y, const char *text)
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
virtual void SetY(Double_t y)
virtual void SetMbTitle(const wchar_t *title=L"")
void * fWcsTitle
!Used by TMathText
Double_t fX
X position of text (left,center,etc..).
virtual void GetTextAscentDescent(UInt_t &a, UInt_t &d, const char *text) const
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void ls(Option_t *option="") const override
List TNamed name and title.
virtual void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle=kFALSE)
virtual TText * DrawTextNDC(Double_t x, Double_t y, const char *text)
void SetBBoxY2(const Int_t) override
virtual void PaintControlBox(Int_t x, Int_t y, Double_t theta)
@ kTextNDC
The text position is in the NDC space.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
TPoint GetBBoxCenter() override
virtual void SetX(Double_t x)
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
void SetBBoxCenterY(const Int_t y) override
void Print(Option_t *option="") const override
Print TNamed name and title.
void SetBBoxY1(const Int_t) override
void SetBBoxX2(const Int_t) override
void SetBBoxCenterX(const Int_t x) override
virtual TText * DrawText(Double_t x, Double_t y, const char *text)
void SetBBoxX1(const Int_t) override
void Streamer(TBuffer &) override
Stream an object of class TObject.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to an event at (px,py).
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
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...
Double_t ASin(Double_t)
Returns the principal value of the arc sine of x, expressed in radians.
Double_t Sqrt(Double_t x)
Returns the square root of x.
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.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
BVH_ALWAYS_INLINE T length(const Vec< T, N > &v)
Rectangle structure (maps to the X11 XRectangle structure).