// @(#)root/graf:$Id: TMathText.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Yue Shi Lai   12/12/09

/*************************************************************************
 * Copyright (C) 2009, Yue Shi Lai.                                      *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
#ifndef ROOT_TMathText
#define ROOT_TMathText

#ifndef ROOT_Riosfwd
#include "Riosfwd.h"
#endif
#ifndef ROOT_TText
#include "TText.h"
#endif
#ifndef ROOT_TAttFill
#include "TAttFill.h"
#endif

class TMathTextRenderer;

class TMathText
	: public TText, public TAttFill {
protected:
		void *fRenderer; //!TMathText Painter
		TMathText &operator=(const TMathText &); 

		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);
		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);
		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);
public:
		enum {
			kTextNDC = BIT(14)
		};
		TMathText(void);
		TMathText(
			Double_t x, Double_t y, const char *text);
		TMathText(const TMathText &text);
		virtual ~TMathText(void);
		void Copy(TObject &text) const;
		TMathText *DrawMathText(
			Double_t x, Double_t y, const char *text);
		void GetBoundingBox(
			UInt_t &w, UInt_t &h, Bool_t angle = kFALSE);
		Double_t GetXsize(void);
		Double_t GetYsize(void);
		virtual void Paint(Option_t *option = "");
		virtual void PaintMathText(
			Double_t x, Double_t y, Double_t angle, Double_t size,
			const char *text);
		virtual void SavePrimitive(
			std::ostream &out, Option_t *option = "");
		friend class TMathTextRenderer;

		ClassDef(TMathText,2) //TeX mathematical formula
};

#endif
 TMathText.h:1
 TMathText.h:2
 TMathText.h:3
 TMathText.h:4
 TMathText.h:5
 TMathText.h:6
 TMathText.h:7
 TMathText.h:8
 TMathText.h:9
 TMathText.h:10
 TMathText.h:11
 TMathText.h:12
 TMathText.h:13
 TMathText.h:14
 TMathText.h:15
 TMathText.h:16
 TMathText.h:17
 TMathText.h:18
 TMathText.h:19
 TMathText.h:20
 TMathText.h:21
 TMathText.h:22
 TMathText.h:23
 TMathText.h:24
 TMathText.h:25
 TMathText.h:26
 TMathText.h:27
 TMathText.h:28
 TMathText.h:29
 TMathText.h:30
 TMathText.h:31
 TMathText.h:32
 TMathText.h:33
 TMathText.h:34
 TMathText.h:35
 TMathText.h:36
 TMathText.h:37
 TMathText.h:38
 TMathText.h:39
 TMathText.h:40
 TMathText.h:41
 TMathText.h:42
 TMathText.h:43
 TMathText.h:44
 TMathText.h:45
 TMathText.h:46
 TMathText.h:47
 TMathText.h:48
 TMathText.h:49
 TMathText.h:50
 TMathText.h:51
 TMathText.h:52
 TMathText.h:53
 TMathText.h:54
 TMathText.h:55
 TMathText.h:56
 TMathText.h:57
 TMathText.h:58
 TMathText.h:59
 TMathText.h:60
 TMathText.h:61
 TMathText.h:62
 TMathText.h:63
 TMathText.h:64
 TMathText.h:65
 TMathText.h:66
 TMathText.h:67
 TMathText.h:68
 TMathText.h:69
 TMathText.h:70