Logo ROOT  
Reference Guide
TVirtualPadPainter.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Timur Pocheptsov 6/5/2009
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2012, 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 #ifndef ROOT_TVirtualPadPainter
13 #define ROOT_TVirtualPadPainter
14 
15 #include "Rtypes.h"
16 
17 class TVirtualPad;
18 
20 public:
23 
24  virtual ~TVirtualPadPainter();
25 
26  //Line attributes to be set up in TPad.
27  virtual Color_t GetLineColor() const = 0;
28  virtual Style_t GetLineStyle() const = 0;
29  virtual Width_t GetLineWidth() const = 0;
30 
31  virtual void SetLineColor(Color_t lcolor) = 0;
32  virtual void SetLineStyle(Style_t lstyle) = 0;
33  virtual void SetLineWidth(Width_t lwidth) = 0;
34 
35  //Fill attributes to be set up in TPad.
36  virtual Color_t GetFillColor() const = 0;
37  virtual Style_t GetFillStyle() const = 0;
38  virtual Bool_t IsTransparent() const = 0;
39 
40  virtual void SetFillColor(Color_t fcolor) = 0;
41  virtual void SetFillStyle(Style_t fstyle) = 0;
42  virtual void SetOpacity(Int_t percent) = 0;
43 
44  //Text attributes.
45  virtual Short_t GetTextAlign() const = 0;
46  virtual Float_t GetTextAngle() const = 0;
47  virtual Color_t GetTextColor() const = 0;
48  virtual Font_t GetTextFont() const = 0;
49  virtual Float_t GetTextSize() const = 0;
50  virtual Float_t GetTextMagnitude() const = 0;
51 
52  virtual void SetTextAlign(Short_t align=11) = 0;
53  virtual void SetTextAngle(Float_t tangle=0) = 0;
54  virtual void SetTextColor(Color_t tcolor=1) = 0;
55  virtual void SetTextFont(Font_t tfont=62) = 0;
56  virtual void SetTextSize(Float_t tsize=1) = 0;
57  virtual void SetTextSizePixels(Int_t npixels) = 0;
58 
59  //This part is an interface to X11 pixmap management and to save sub-pads off-screens for OpenGL.
60  //Currently, must be implemented only for X11/GDI
61  virtual Int_t CreateDrawable(UInt_t w, UInt_t h) = 0;//gVirtualX->OpenPixmap
62  virtual void ClearDrawable() = 0;//gVirtualX->Clear()
63  virtual void CopyDrawable(Int_t device, Int_t px, Int_t py) = 0;
64  virtual void DestroyDrawable(Int_t device) = 0;//gVirtualX->CloseWindow
65  virtual void SelectDrawable(Int_t device) = 0;//gVirtualX->SelectWindow
66 
67  //TASImage support.
68  virtual void DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height,
69  Int_t dstX, Int_t dstY, Bool_t enableAlphaBlending) = 0;
70  //
71  //These functions are not required by X11/GDI.
72  virtual void InitPainter();
73  virtual void InvalidateCS();
74  virtual void LockPainter();
75 
76  //Now, drawing primitives.
77  virtual void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2) = 0;
78  virtual void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2) = 0;
79 
80  virtual void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode) = 0;
81 
82  virtual void DrawFillArea(Int_t n, const Double_t *x, const Double_t *y) = 0;
83  virtual void DrawFillArea(Int_t n, const Float_t *x, const Float_t *y) = 0;
84 
85  virtual void DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y) = 0;
86  virtual void DrawPolyLine(Int_t n, const Float_t *x, const Float_t *y) = 0;
87  virtual void DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v) = 0;
88 
89  virtual void DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y) = 0;
90  virtual void DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y) = 0;
91 
92  virtual void DrawText(Double_t x, Double_t y, const char *text, ETextMode mode) = 0;
93  virtual void DrawText(Double_t x, Double_t y, const wchar_t *text, ETextMode mode) = 0;
94  virtual void DrawTextNDC(Double_t u, Double_t v, const char *text, ETextMode mode) = 0;
95  virtual void DrawTextNDC(Double_t u, Double_t v, const wchar_t *text, ETextMode mode) = 0;
96 
97  //gif, jpg, png, bmp output.
98  virtual void SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const = 0;
99 
100 
101  static TVirtualPadPainter *PadPainter(Option_t *opt = "");
102 
103  ClassDef(TVirtualPadPainter, 0)//Painter interface for pad.
104 };
105 
106 #endif
TVirtualPadPainter::DrawPolyLine
virtual void DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y)=0
TVirtualPadPainter::DestroyDrawable
virtual void DestroyDrawable(Int_t device)=0
n
const Int_t n
Definition: legend1.C:16
TVirtualPadPainter::CopyDrawable
virtual void CopyDrawable(Int_t device, Int_t px, Int_t py)=0
TVirtualPadPainter::DrawFillArea
virtual void DrawFillArea(Int_t n, const Double_t *x, const Double_t *y)=0
TVirtualPadPainter::SetLineColor
virtual void SetLineColor(Color_t lcolor)=0
Style_t
short Style_t
Definition: RtypesCore.h:80
TVirtualPadPainter::DrawLine
virtual void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)=0
Option_t
const char Option_t
Definition: RtypesCore.h:66
TVirtualPadPainter::EBoxMode
EBoxMode
Definition: TVirtualPadPainter.h:21
TVirtualPadPainter::DrawText
virtual void DrawText(Double_t x, Double_t y, const wchar_t *text, ETextMode mode)=0
TVirtualPadPainter::GetTextFont
virtual Font_t GetTextFont() const =0
TVirtualPadPainter::DrawText
virtual void DrawText(Double_t x, Double_t y, const char *text, ETextMode mode)=0
TVirtualPadPainter::GetFillColor
virtual Color_t GetFillColor() const =0
TVirtualPadPainter::SetTextAngle
virtual void SetTextAngle(Float_t tangle=0)=0
TVirtualPadPainter::GetTextColor
virtual Color_t GetTextColor() const =0
TVirtualPadPainter::DrawPolyLine
virtual void DrawPolyLine(Int_t n, const Float_t *x, const Float_t *y)=0
TVirtualPadPainter::SetOpacity
virtual void SetOpacity(Int_t percent)=0
TVirtualPadPainter::SetTextAlign
virtual void SetTextAlign(Short_t align=11)=0
TVirtualPadPainter::IsTransparent
virtual Bool_t IsTransparent() const =0
Float_t
float Float_t
Definition: RtypesCore.h:57
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TVirtualPadPainter::SetTextSize
virtual void SetTextSize(Float_t tsize=1)=0
TVirtualPadPainter::GetTextAlign
virtual Short_t GetTextAlign() const =0
Font_t
short Font_t
Definition: RtypesCore.h:79
x
Double_t x[n]
Definition: legend1.C:17
TVirtualPadPainter::kHollow
@ kHollow
Definition: TVirtualPadPainter.h:21
TVirtualPadPainter::kOpaque
@ kOpaque
Definition: TVirtualPadPainter.h:22
TVirtualPadPainter::SetTextSizePixels
virtual void SetTextSizePixels(Int_t npixels)=0
Color_t
short Color_t
Definition: RtypesCore.h:83
v
@ v
Definition: rootcling_impl.cxx:3635
text
TText * text
Definition: entrylist_figure1.C:10
TVirtualPadPainter::GetTextAngle
virtual Float_t GetTextAngle() const =0
bool
TVirtualPadPainter::LockPainter
virtual void LockPainter()
Empty definition.
Definition: TVirtualPadPainter.cxx:51
TVirtualPadPainter::InvalidateCS
virtual void InvalidateCS()
Empty definition.
Definition: TVirtualPadPainter.cxx:44
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
TVirtualPadPainter::DrawBox
virtual void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode)=0
TVirtualPadPainter::SetFillStyle
virtual void SetFillStyle(Style_t fstyle)=0
TVirtualPadPainter::~TVirtualPadPainter
virtual ~TVirtualPadPainter()
Virtual dtor.
Definition: TVirtualPadPainter.cxx:30
TVirtualPadPainter::DrawPixels
virtual void DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height, Int_t dstX, Int_t dstY, Bool_t enableAlphaBlending)=0
TVirtualPadPainter::DrawPolyMarker
virtual void DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y)=0
h
#define h(i)
Definition: RSha256.hxx:106
TVirtualPadPainter::SaveImage
virtual void SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const =0
Width_t
short Width_t
Definition: RtypesCore.h:82
TVirtualPadPainter::SetLineStyle
virtual void SetLineStyle(Style_t lstyle)=0
TVirtualPadPainter::GetTextMagnitude
virtual Float_t GetTextMagnitude() const =0
TVirtualPadPainter::GetLineWidth
virtual Width_t GetLineWidth() const =0
TVirtualPadPainter::CreateDrawable
virtual Int_t CreateDrawable(UInt_t w, UInt_t h)=0
TVirtualPadPainter::DrawFillArea
virtual void DrawFillArea(Int_t n, const Float_t *x, const Float_t *y)=0
y
Double_t y[n]
Definition: legend1.C:17
Short_t
short Short_t
Definition: RtypesCore.h:39
unsigned int
TVirtualPadPainter::DrawTextNDC
virtual void DrawTextNDC(Double_t u, Double_t v, const wchar_t *text, ETextMode mode)=0
TVirtualPadPainter::GetLineColor
virtual Color_t GetLineColor() const =0
TVirtualPadPainter::PadPainter
static TVirtualPadPainter * PadPainter(Option_t *opt="")
Create a pad painter of specified type.
Definition: TVirtualPadPainter.cxx:58
TVirtualPadPainter::kFilled
@ kFilled
Definition: TVirtualPadPainter.h:21
TVirtualPadPainter::kClear
@ kClear
Definition: TVirtualPadPainter.h:22
v1
@ v1
Definition: rootcling_impl.cxx:3637
Double_t
double Double_t
Definition: RtypesCore.h:59
TVirtualPad
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
TVirtualPadPainter::InitPainter
virtual void InitPainter()
Empty definition.
Definition: TVirtualPadPainter.cxx:37
TVirtualPadPainter::DrawTextNDC
virtual void DrawTextNDC(Double_t u, Double_t v, const char *text, ETextMode mode)=0
TVirtualPadPainter::ClearDrawable
virtual void ClearDrawable()=0
v2
@ v2
Definition: rootcling_impl.cxx:3638
TVirtualPadPainter::GetFillStyle
virtual Style_t GetFillStyle() const =0
TVirtualPadPainter::GetTextSize
virtual Float_t GetTextSize() const =0
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TVirtualPadPainter::SetFillColor
virtual void SetFillColor(Color_t fcolor)=0
TVirtualPadPainter::DrawLineNDC
virtual void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)=0
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
TVirtualPadPainter::SetLineWidth
virtual void SetLineWidth(Width_t lwidth)=0
TVirtualPadPainter
To make it possible to use GL for 2D graphic in a TPad/TCanvas.
Definition: TVirtualPadPainter.h:19
type
int type
Definition: TGX11.cxx:121
TVirtualPadPainter::SetTextFont
virtual void SetTextFont(Font_t tfont=62)=0
TVirtualPadPainter::DrawPolyLineNDC
virtual void DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v)=0
TVirtualPadPainter::ETextMode
ETextMode
Definition: TVirtualPadPainter.h:22
TVirtualPadPainter::SelectDrawable
virtual void SelectDrawable(Int_t device)=0
TVirtualPadPainter::SetTextColor
virtual void SetTextColor(Color_t tcolor=1)=0
Rtypes.h
TVirtualPadPainter::GetLineStyle
virtual Style_t GetLineStyle() const =0
TVirtualPadPainter::DrawPolyMarker
virtual void DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y)=0
int