Logo ROOT  
Reference Guide
TPDF.h
Go to the documentation of this file.
1 // @(#)root/postscript:$Id: TPDF.h,v 1.0
2 // Author: Olivier Couet
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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_TPDF
13 #define ROOT_TPDF
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPDF //
19 // //
20 // PDF driver. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TVirtualPS.h"
25 #include <vector>
26 
27 
28 class TPoints;
29 
30 class TPDF : public TVirtualPS {
31 
32 protected:
33  Float_t fRed; ///< Per cent of red
34  Float_t fGreen; ///< Per cent of green
35  Float_t fBlue; ///< Per cent of blue
36  Float_t fAlpha; ///< Per cent of transparency
37  std::vector<float> fAlphas; ///< List of alpha values used
38  Float_t fXsize; ///< Page size along X
39  Float_t fYsize; ///< Page size along Y
40  Int_t fType; ///< Workstation type used to know if the PDF is open
41  Int_t fPageFormat; ///< Page format (A4, Letter etc ...)
42  Int_t fPageOrientation; ///< Page orientation (Portrait, Landscape)
44  Float_t fLineScale; ///< Line width scale factor
45  Int_t *fObjPos; ///< Objets position
46  Int_t fObjPosSize; ///< Real size of fObjPos
47  Int_t fNbObj; ///< Number of objects
48  Int_t fNbPage; ///< Number of pages
49  Bool_t fPageNotEmpty; ///< True if the current page is not empty
50  Bool_t fCompress; ///< True when fBuffer must be compressed
51  Bool_t fRange; ///< True when a range has been defined
52 
53  static Int_t fgLineJoin; ///< Appearance of joining lines
54  static Int_t fgLineCap; ///< Appearance of line caps
55 
56 public:
57  TPDF();
58  TPDF(const char *filename, Int_t type=-111);
59  virtual ~TPDF();
60 
62  void CellArrayFill(Int_t r, Int_t g, Int_t b);
63  void CellArrayEnd();
64  void Close(Option_t *opt="");
65  Double_t CMtoPDF(Double_t u) {return Int_t(0.5 + 72*u/2.54);}
67  void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
68  Int_t mode, Int_t border, Int_t dark, Int_t light);
69  void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y);
70  void DrawHatch(Float_t dy, Float_t angle, Int_t n, Double_t *x, Double_t *y);
71  void DrawPolyLine(Int_t n, TPoints *xy);
72  void DrawPolyLineNDC(Int_t n, TPoints *uv);
75  void DrawPS(Int_t n, Float_t *xw, Float_t *yw);
76  void DrawPS(Int_t n, Double_t *xw, Double_t *yw);
77  void LineTo(Double_t x, Double_t y);
78  void MoveTo(Double_t x, Double_t y);
79  void FontEncode();
80  void NewObject(Int_t n);
81  void NewPage();
82  void Off();
83  void On();
84  void Open(const char *filename, Int_t type=-111);
85  void PatternEncode();
86  void PrintFast(Int_t nch, const char *string="");
87  void PrintStr(const char *string="");
88  void Range(Float_t xrange, Float_t yrange);
89  void SetAlpha(Float_t alpha = 1.);
90  void SetColor(Int_t color = 1);
92  void SetFillColor( Color_t cindex=1);
93  void SetFillPatterns(Int_t ipat, Int_t color);
94  void SetLineColor( Color_t cindex=1);
95  void SetLineJoin(Int_t linejoin=0);
96  void SetLineCap(Int_t linecap=0);
97  void SetLineScale(Float_t scale=1) {fLineScale = scale;}
98  void SetLineStyle(Style_t linestyle = 1);
99  void SetLineWidth(Width_t linewidth = 1);
100  void SetMarkerColor( Color_t cindex=1);
101  void SetTextColor( Color_t cindex=1);
102  void Text(Double_t x, Double_t y, const char *string);
103  void Text(Double_t, Double_t, const wchar_t *);
104  void TextNDC(Double_t u, Double_t v, const char *string);
105  void TextNDC(Double_t, Double_t, const wchar_t *);
106  void WriteCompressedBuffer();
107  virtual void WriteReal(Float_t r, Bool_t space=kTRUE);
112 
113  ClassDef(TPDF, 0); //PDF driver
114 };
115 
116 #endif
TVirtualPS
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:30
TPDF::fPageFormat
Int_t fPageFormat
Page format (A4, Letter etc ...)
Definition: TPDF.h:41
TPDF::Close
void Close(Option_t *opt="")
Close a PDF file.
Definition: TPDF.cxx:201
TPDF::PrintFast
void PrintFast(Int_t nch, const char *string="")
Fast version of Print.
Definition: TPDF.cxx:1843
TPDF::Text
void Text(Double_t x, Double_t y, const char *string)
Draw text.
Definition: TPDF.cxx:2167
n
const Int_t n
Definition: legend1.C:16
TPDF::SetLineStyle
void SetLineStyle(Style_t linestyle=1)
Change the line style.
Definition: TPDF.cxx:2115
TPDF::DrawPolyLineNDC
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
Definition: TPDF.cxx:537
TPDF::VtoPDF
Double_t VtoPDF(Double_t v)
Convert V from NDC coordinate to PDF.
Definition: TPDF.cxx:2396
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:89
Style_t
short Style_t
Definition: RtypesCore.h:78
H
#define H(x, y, z)
Option_t
const char Option_t
Definition: RtypesCore.h:64
TPDF::fgLineCap
static Int_t fgLineCap
Appearance of line caps.
Definition: TPDF.h:54
TPDF::SetMarkerColor
void SetMarkerColor(Color_t cindex=1)
Set color index for markers.
Definition: TPDF.cxx:2147
TPDF::YtoPDF
Double_t YtoPDF(Double_t y)
Convert Y from world coordinate to PDF.
Definition: TPDF.cxx:2414
TPDF::SetLineWidth
void SetLineWidth(Width_t linewidth=1)
Change the line width.
Definition: TPDF.cxx:2134
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TPDF::SetLineCap
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TPDF::fgLineCap.
Definition: TPDF.cxx:2100
TPDF::fGreen
Float_t fGreen
Per cent of green.
Definition: TPDF.h:34
TPDF::SetLineColor
void SetLineColor(Color_t cindex=1)
Set color index for lines.
Definition: TPDF.cxx:2054
TPDF::DrawPolyMarker
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Draw markers at the n WC points xw, yw.
Definition: TPDF.cxx:583
Float_t
float Float_t
Definition: RtypesCore.h:55
TPDF::TextNDC
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Definition: TPDF.cxx:2367
TPDF::CellArrayEnd
void CellArrayEnd()
End the Cell Array painting.
Definition: TPDF.cxx:193
Int_t
int Int_t
Definition: RtypesCore.h:43
TPDF::CellArrayBegin
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
Begin the Cell Array painting.
Definition: TPDF.cxx:176
x
Double_t x[n]
Definition: legend1.C:17
TVirtualPS.h
TPDF::PatternEncode
void PatternEncode()
Patterns encoding.
Definition: TPDF.cxx:2486
TPDF::WriteReal
virtual void WriteReal(Float_t r, Bool_t space=kTRUE)
Write a Real number to the file.
Definition: TPDF.cxx:2470
TPDF::fObjPos
Int_t * fObjPos
Objets position.
Definition: TPDF.h:45
Bool_t
bool Bool_t
Definition: RtypesCore.h:61
TPDF::SetFillColor
void SetFillColor(Color_t cindex=1)
Set color index for fill areas.
Definition: TPDF.cxx:2008
Color_t
short Color_t
Definition: RtypesCore.h:81
v
@ v
Definition: rootcling_impl.cxx:3624
b
#define b(i)
Definition: RSha256.hxx:100
bool
TPDF::DrawBox
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
Definition: TPDF.cxx:353
TPDF::fgLineJoin
static Int_t fgLineJoin
Appearance of joining lines.
Definition: TPDF.h:53
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
xy
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
TPDF::UtoPDF
Double_t UtoPDF(Double_t u)
Convert U from NDC coordinate to PDF.
Definition: TPDF.cxx:2387
TPDF::DrawFrame
void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t mode, Int_t border, Int_t dark, Int_t light)
Draw a Frame around a box.
Definition: TPDF.cxx:419
TPDF
Interface to PDF.
Definition: TPDF.h:30
TPDF::SetLineScale
void SetLineScale(Float_t scale=1)
Definition: TPDF.h:97
TPDF::LineTo
void LineTo(Double_t x, Double_t y)
Draw a line to a new position.
Definition: TPDF.cxx:1409
TPDF::fLineScale
Float_t fLineScale
Line width scale factor.
Definition: TPDF.h:44
TPDF::fYsize
Float_t fYsize
Page size along Y.
Definition: TPDF.h:39
TPDF::fPageOrientation
Int_t fPageOrientation
Page orientation (Portrait, Landscape)
Definition: TPDF.h:42
TPDF::MoveTo
void MoveTo(Double_t x, Double_t y)
Move to a new position.
Definition: TPDF.cxx:1419
TPDF::Open
void Open(const char *filename, Int_t type=-111)
Open a PDF file.
Definition: TPDF.cxx:1653
TPDF::On
void On()
Activate an already open PDF file.
Definition: TPDF.cxx:1637
TPDF::~TPDF
virtual ~TPDF()
Default PDF destructor.
Definition: TPDF.cxx:166
TPDF::SetFillPatterns
void SetFillPatterns(Int_t ipat, Int_t color)
Set the fill patterns (1 to 25) for fill areas.
Definition: TPDF.cxx:2017
Width_t
short Width_t
Definition: RtypesCore.h:80
TPDF::SetTextColor
void SetTextColor(Color_t cindex=1)
Set color index for text.
Definition: TPDF.cxx:2155
TPDF::SetColor
void SetColor(Int_t color=1)
Set color with its color index.
Definition: TPDF.cxx:1935
TPDF::SetLineJoin
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPDF::fgLineJoin.
Definition: TPDF.cxx:2076
y
Double_t y[n]
Definition: legend1.C:17
TPDF::TPDF
TPDF()
Default PDF constructor.
Definition: TPDF.cxx:105
TPDF::PrintStr
void PrintStr(const char *string="")
Output the string str in the output buffer.
Definition: TPDF.cxx:1821
TPDF::fXsize
Float_t fXsize
Page size along X.
Definition: TPDF.h:38
TPDF::DrawPS
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
Definition: TPDF.cxx:1211
TPDF::fCompress
Bool_t fCompress
True when fBuffer must be compressed.
Definition: TPDF.h:50
TPDF::WriteCompressedBuffer
void WriteCompressedBuffer()
Write the buffer in a compressed way.
Definition: TPDF.cxx:2423
Double_t
double Double_t
Definition: RtypesCore.h:57
TPDF::XtoPDF
Double_t XtoPDF(Double_t x)
Convert X from world coordinate to PDF.
Definition: TPDF.cxx:2405
TPDF::fType
Int_t fType
Workstation type used to know if the PDF is open.
Definition: TPDF.h:40
TPDF::DrawHatch
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
Definition: TPDF.cxx:459
TPDF::fStartStream
Int_t fStartStream
Definition: TPDF.h:43
TPDF::fNbObj
Int_t fNbObj
Number of objects.
Definition: TPDF.h:47
TPDF::fObjPosSize
Int_t fObjPosSize
Real size of fObjPos.
Definition: TPDF.h:46
TPDF::FontEncode
void FontEncode()
Font encoding.
Definition: TPDF.cxx:1377
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:322
TPDF::fPageNotEmpty
Bool_t fPageNotEmpty
True if the current page is not empty.
Definition: TPDF.h:49
TPDF::SetAlpha
void SetAlpha(Float_t alpha=1.)
Set the alpha channel value.
Definition: TPDF.cxx:1915
TPDF::Off
void Off()
Deactivate an already open PDF file.
Definition: TPDF.cxx:1629
TPDF::NewPage
void NewPage()
Start a new PDF page.
Definition: TPDF.cxx:1452
TPDF::fBlue
Float_t fBlue
Per cent of blue.
Definition: TPDF.h:35
TPDF::fNbPage
Int_t fNbPage
Number of pages.
Definition: TPDF.h:48
TPDF::fRange
Bool_t fRange
True when a range has been defined.
Definition: TPDF.h:51
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
TPDF::fAlpha
Float_t fAlpha
Per cent of transparency.
Definition: TPDF.h:36
TPDF::fAlphas
std::vector< float > fAlphas
List of alpha values used.
Definition: TPDF.h:37
TPDF::Range
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimetres.
Definition: TPDF.cxx:1862
type
int type
Definition: TGX11.cxx:120
TPDF::DrawPolyLine
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Definition: TPDF.cxx:483
TPDF::CMtoPDF
Double_t CMtoPDF(Double_t u)
Definition: TPDF.h:65
TPDF::CellArrayFill
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
Definition: TPDF.cxx:185
TPDF::fRed
Float_t fRed
Per cent of red.
Definition: TPDF.h:33
TPDF::NewObject
void NewObject(Int_t n)
Create a new object in the PDF file.
Definition: TPDF.cxx:1429
int
TPoints
2-D graphics point (world coordinates).
Definition: TPoints.h:19
g
#define g(i)
Definition: RSha256.hxx:105