Logo ROOT  
Reference Guide
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 
17 class TMathTextRenderer;
18 
19 class TMathText : public TText, public TAttFill {
20 protected:
21  void *fRenderer; //!TMathText Painter
22  TMathText &operator=(const TMathText &);
23 
24  void Render(const Double_t x, const Double_t y,
25  const Double_t size, const Double_t angle,
26  const Char_t *t, const Int_t length);
27  void GetSize(Double_t &x0, Double_t &y0,
28  Double_t &x1, Double_t &y1,
29  const Double_t size, const Double_t angle,
30  const Char_t *t, const Int_t length);
31  void GetAlignPoint(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  const Short_t align);
35 public:
36  enum {
37  kTextNDC = BIT(14)
38  };
39  TMathText(void);
40  TMathText(
41  Double_t x, Double_t y, const char *text);
42  TMathText(const TMathText &text);
43  virtual ~TMathText(void);
44  void Copy(TObject &text) const;
46  Double_t x, Double_t y, const char *text);
47  void GetBoundingBox(
48  UInt_t &w, UInt_t &h, Bool_t angle = kFALSE);
49  Double_t GetXsize(void);
50  Double_t GetYsize(void);
51  virtual void Paint(Option_t *option = "");
52  virtual void PaintMathText(
53  Double_t x, Double_t y, Double_t angle, Double_t size,
54  const char *text);
55  virtual void SavePrimitive(
56  std::ostream &out, Option_t *option = "");
57  friend class TMathTextRenderer;
58 
59  ClassDef(TMathText,2) //TeX mathematical formula
60 };
61 
62 #endif
TMathText::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TMathText.cxx:682
TMathText::DrawMathText
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.
Definition: TMathText.cxx:549
TMathText::fRenderer
void * fRenderer
Definition: TMathText.h:21
x
Double_t x[n]
Definition: legend1.C:17
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
text
TText * text
Definition: entrylist_figure1.C:10
TMathText::GetXsize
Double_t GetXsize(void)
Get X size.
Definition: TMathText.cxx:506
TMathText::Copy
void Copy(TObject &text) const
Copy.
Definition: TMathText.cxx:392
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
TMathText::GetAlignPoint
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.
Definition: TMathText.cxx:450
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TAttFill.h
TMathText::Render
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.
Definition: TMathText.cxx:403
h
#define h(i)
Definition: RSha256.hxx:124
TMathText::Paint
virtual void Paint(Option_t *option="")
Paint text.
Definition: TMathText.cxx:564
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
BIT
#define BIT(n)
Definition: Rtypes.h:85
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
y
Double_t y[n]
Definition: legend1.C:17
Short_t
short Short_t
Definition: RtypesCore.h:39
TMathText::GetBoundingBox
void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle=kFALSE)
Get the text width and height.
Definition: TMathText.cxx:486
TMathText::TMathTextRenderer
friend class TMathTextRenderer
Definition: TMathText.h:57
TText
Definition: TText.h:22
Double_t
double Double_t
Definition: RtypesCore.h:59
TMathText::GetSize
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.
Definition: TMathText.cxx:417
TMathText::GetYsize
Double_t GetYsize(void)
Get Y size.
Definition: TMathText.cxx:527
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMathText::operator=
TMathText & operator=(const TMathText &)
TMathText Painter.
Definition: TMathText.cxx:380
TMathText::PaintMathText
virtual void PaintMathText(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Paint text (used by Paint()).
Definition: TMathText.cxx:584
TAttFill
Definition: TAttFill.h:19
TMathText::TMathText
TMathText(void)
Default constructor.
Definition: TMathText.cxx:345
Char_t
char Char_t
Definition: RtypesCore.h:33
TText.h
TMathText::kTextNDC
@ kTextNDC
Definition: TMathText.h:37
TMathText::~TMathText
virtual ~TMathText(void)
Destructor.
Definition: TMathText.cxx:363
TMathText
Definition: TMathText.h:19
int