Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMathText.h
Go to the documentation of this file.
1// @(#)root/graf:$Id: TMathText.h 20882 2007-11-19 11:31:26Z rdm $
2// Author: Yue Shi Lai 12/12/09
3
4/*************************************************************************
5 * Copyright (C) 2009, Yue Shi Lai. *
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#ifndef ROOT_TMathText
12#define ROOT_TMathText
13
14#include "TText.h"
15#include "TAttFill.h"
16
18
19class TMathText : public TText, public TAttFill {
20protected:
21
22 friend class TMathTextRenderer;
23
24 TMathTextRenderer *fRenderer{nullptr}; //!TMathText Painter
26
27 void Render(const Double_t x, const Double_t y,
28 const Double_t size, const Double_t angle,
29 const Char_t *t, const Int_t length);
30 void GetSize(Double_t &x0, Double_t &y0,
32 const Double_t size, const Double_t angle,
33 const Char_t *t, const Int_t length);
34 void GetAlignPoint(Double_t &x0, Double_t &y0,
35 const Double_t size, const Double_t angle,
36 const Char_t *t, const Int_t length,
37 const Short_t align);
38public:
39 enum {
40 kTextNDC = BIT(14)
41 };
42 TMathText();
43 TMathText(Double_t x, Double_t y, const char *text);
44 TMathText(const TMathText &text);
45 ~TMathText() override;
46 void Copy(TObject &text) const override;
48 void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle = kFALSE) override;
51 void Paint(Option_t *option = "") override;
52 virtual void PaintMathText(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text);
53 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
54
55 ClassDefOverride(TMathText,2) //TeX mathematical formula
56};
57
58#endif
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
char Char_t
Definition RtypesCore.h:37
unsigned int UInt_t
Definition RtypesCore.h:46
short Short_t
Definition RtypesCore.h:39
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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 Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
Fill Area Attributes class.
Definition TAttFill.h:19
To draw TeX Mathematical Formula.
Definition TMathText.h:19
void Paint(Option_t *option="") override
Paint text.
Double_t GetYsize()
Get Y size.
TMathText & operator=(const TMathText &)
TMathText Painter.
void GetSize(Double_t &x0, Double_t &y0, Double_t &x1, Double_t &y1, const Double_t size, const Double_t angle, const Char_t *t, const Int_t length)
Get the text bounding box.
void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle=kFALSE) override
Get the text width and height.
TMathTextRenderer * fRenderer
Definition TMathText.h:24
Double_t GetXsize()
Get X size.
void GetAlignPoint(Double_t &x0, Double_t &y0, const Double_t size, const Double_t angle, const Char_t *t, const Int_t length, const Short_t align)
Alignment.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
void Render(const Double_t x, const Double_t y, const Double_t size, const Double_t angle, const Char_t *t, const Int_t length)
Render the text.
~TMathText() override
Destructor.
TMathText * DrawMathText(Double_t x, Double_t y, const char *text)
Make a copy of this object with the new parameters and copy object attributes.
TMathText()
Default constructor.
virtual void PaintMathText(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Paint text (used by Paint()).
void Copy(TObject &text) const override
Copy.
Mother of all ROOT objects.
Definition TObject.h:41
Base class for several text objects.
Definition TText.h:22
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17