Logo ROOT   6.16/01
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
28class TPoints;
29
30class TPDF : public TVirtualPS {
31
32protected:
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
55public:
56 TPDF();
57 TPDF(const char *filename, Int_t type=-111);
58 virtual ~TPDF();
59
62 void CellArrayEnd();
63 void Close(Option_t *opt="");
64 Double_t CMtoPDF(Double_t u) {return Int_t(0.5 + 72*u/2.54);}
66 void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
67 Int_t mode, Int_t border, Int_t dark, Int_t light);
68 void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y);
69 void DrawHatch(Float_t dy, Float_t angle, Int_t n, Double_t *x, Double_t *y);
71 void DrawPolyLineNDC(Int_t n, TPoints *uv);
74 void DrawPS(Int_t n, Float_t *xw, Float_t *yw);
75 void DrawPS(Int_t n, Double_t *xw, Double_t *yw);
76 void LineTo(Double_t x, Double_t y);
77 void MoveTo(Double_t x, Double_t y);
78 void FontEncode();
79 void NewObject(Int_t n);
80 void NewPage();
81 void Off();
82 void On();
83 void Open(const char *filename, Int_t type=-111);
84 void PatternEncode();
85 void PrintFast(Int_t nch, const char *string="");
86 void PrintStr(const char *string="");
87 void Range(Float_t xrange, Float_t yrange);
88 void SetAlpha(Float_t alpha = 1.);
89 void SetColor(Int_t color = 1);
91 void SetFillColor( Color_t cindex=1);
92 void SetFillPatterns(Int_t ipat, Int_t color);
93 void SetLineColor( Color_t cindex=1);
94 void SetLineJoin(Int_t linejoin=0);
95 void SetLineScale(Float_t scale=1) {fLineScale = scale;}
96 void SetLineStyle(Style_t linestyle = 1);
97 void SetLineWidth(Width_t linewidth = 1);
98 void SetMarkerColor( Color_t cindex=1);
99 void SetTextColor( Color_t cindex=1);
100 void Text(Double_t x, Double_t y, const char *string);
101 void Text(Double_t, Double_t, const wchar_t *);
102 void TextNDC(Double_t u, Double_t v, const char *string);
103 void TextNDC(Double_t, Double_t, const wchar_t *);
105 virtual void WriteReal(Float_t r, Bool_t space=kTRUE);
110
111 ClassDef(TPDF, 0); //PDF driver
112};
113
114#endif
SVector< double, 2 > v
Definition: Dict.h:5
ROOT::R::TRInterface & r
Definition: Object.C:4
#define b(i)
Definition: RSha256.hxx:100
#define g(i)
Definition: RSha256.hxx:105
static const double x2[5]
static const double x1[5]
int Int_t
Definition: RtypesCore.h:41
short Width_t
Definition: RtypesCore.h:78
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
short Color_t
Definition: RtypesCore.h:79
short Style_t
Definition: RtypesCore.h:76
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
int type
Definition: TGX11.cxx:120
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
Interface to PDF.
Definition: TPDF.h:30
void Off()
Deactivate an already open PDF file.
Definition: TPDF.cxx:1614
Int_t fType
Workstation type used to know if the PDF is open.
Definition: TPDF.h:40
void SetColor(Int_t color=1)
Double_t YtoPDF(Double_t y)
TPDF()
Default PDF constructor.
Definition: TPDF.cxx:103
void Range(Float_t xrange, Float_t yrange)
void LineTo(Double_t x, Double_t y)
Draw a line to a new position.
Definition: TPDF.cxx:1398
Double_t XtoPDF(Double_t x)
void SetLineStyle(Style_t linestyle=1)
Set the line style.
void SetMarkerColor(Color_t cindex=1)
Set the marker color.
void SetLineJoin(Int_t linejoin=0)
void SetColor(Float_t r, Float_t g, Float_t b)
Double_t CMtoPDF(Double_t u)
Definition: TPDF.h:64
Int_t fObjPosSize
Real size of fObjPos.
Definition: TPDF.h:46
Float_t fAlpha
Per cent of transparency.
Definition: TPDF.h:36
Float_t fLineScale
Line width scale factor.
Definition: TPDF.h:44
virtual ~TPDF()
Default PDF destructor.
Definition: TPDF.cxx:164
Float_t fGreen
Per cent of green.
Definition: TPDF.h:34
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
Definition: TPDF.cxx:351
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:417
Int_t fPageOrientation
Page orientation (Portrait, Landscape)
Definition: TPDF.h:42
void On()
Activate an already open PDF file.
Definition: TPDF.cxx:1622
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:174
void PrintFast(Int_t nch, const char *string="")
Fast version of Print.
Int_t fStartStream
Definition: TPDF.h:43
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
Definition: TPDF.cxx:183
void FontEncode()
Font encoding.
Definition: TPDF.cxx:1366
Bool_t fCompress
True when fBuffer must be compressed.
Definition: TPDF.h:50
void CellArrayEnd()
End the Cell Array painting.
Definition: TPDF.cxx:191
virtual void WriteReal(Float_t r, Bool_t space=kTRUE)
Write a Real number to the file.
void SetLineWidth(Width_t linewidth=1)
Set the line width.
void NewPage()
Start a new PDF page.
Definition: TPDF.cxx:1441
void SetFillColor(Color_t cindex=1)
Set the fill area color.
Float_t fYsize
Page size along Y.
Definition: TPDF.h:39
void Text(Double_t x, Double_t y, const char *string)
void Text(Double_t, Double_t, const wchar_t *)
Double_t UtoPDF(Double_t u)
void SetTextColor(Color_t cindex=1)
Set the text color.
void SetAlpha(Float_t alpha=1.)
Float_t fRed
Per cent of red.
Definition: TPDF.h:33
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Draw markers at the n WC points xw, yw.
Definition: TPDF.cxx:581
void Open(const char *filename, Int_t type=-111)
Open a PDF file.
Definition: TPDF.cxx:1638
Int_t fPageFormat
Page format (A4, Letter etc ...)
Definition: TPDF.h:41
Bool_t fRange
True when a range has been defined.
Definition: TPDF.h:51
Float_t fBlue
Per cent of blue.
Definition: TPDF.h:35
std::vector< float > fAlphas
List of alpha values used.
Definition: TPDF.h:37
void MoveTo(Double_t x, Double_t y)
Move to a new position.
Definition: TPDF.cxx:1408
void SetLineScale(Float_t scale=1)
Definition: TPDF.h:95
Int_t fNbObj
Number of objects.
Definition: TPDF.h:47
void TextNDC(Double_t, Double_t, const wchar_t *)
Int_t fNbPage
Number of pages.
Definition: TPDF.h:48
void SetFillPatterns(Int_t ipat, Int_t color)
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
Definition: TPDF.cxx:1200
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
Definition: TPDF.cxx:535
Float_t fXsize
Page size along X.
Definition: TPDF.h:38
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:457
void SetLineColor(Color_t cindex=1)
Set the line color.
void Close(Option_t *opt="")
Close a PDF file.
Definition: TPDF.cxx:199
Double_t VtoPDF(Double_t v)
Bool_t fPageNotEmpty
True if the current page is not empty.
Definition: TPDF.h:49
void NewObject(Int_t n)
Create a new object in the PDF file.
Definition: TPDF.cxx:1418
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Definition: TPDF.cxx:481
void PrintStr(const char *string="")
Output the string str in the output buffer.
void PatternEncode()
Patterns encoding.
Definition: TPDF.cxx:1796
Int_t * fObjPos
Objets position.
Definition: TPDF.h:45
void WriteCompressedBuffer()
void TextNDC(Double_t u, Double_t v, const char *string)
static Int_t fgLineJoin
Appearance of joining lines.
Definition: TPDF.h:53
2-D graphics point (world coordinates).
Definition: TPoints.h:19
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:30
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
#define H(x, y, z)