Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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)
43  Int_t fStartStream; ///<
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 
55 public:
56  TPDF();
57  TPDF(const char *filename, Int_t type=-111);
58  virtual ~TPDF();
59 
60  void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2);
61  void CellArrayFill(Int_t r, Int_t g, Int_t b);
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);}
65  void DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t y2);
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);
70  void DrawPolyLine(Int_t n, TPoints *xy);
71  void DrawPolyLineNDC(Int_t n, TPoints *uv);
72  void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y);
73  void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y);
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);
90  void SetColor(Float_t r, Float_t g, Float_t b);
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 *);
104  void WriteCompressedBuffer();
105  virtual void WriteReal(Float_t r, Bool_t space=kTRUE);
106  Double_t UtoPDF(Double_t u);
107  Double_t VtoPDF(Double_t v);
108  Double_t XtoPDF(Double_t x);
109  Double_t YtoPDF(Double_t y);
110 
111  ClassDef(TPDF, 0); //PDF driver
112 };
113 
114 #endif