Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPostScript.h
Go to the documentation of this file.
1 // @(#)root/postscript:$Id$
2 // Author: O.Couet 16/07/99
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_TPostScript
13 #define ROOT_TPostScript
14 
15 
16 #include "TVirtualPS.h"
17 
18 class TPoints;
19 
20 class TPostScript : public TVirtualPS {
21 
22 protected:
23  Float_t fX1v; ///< X bottom left corner of paper
24  Float_t fY1v; ///< Y bottom left corner of paper
25  Float_t fX2v; ///< X top right corner of paper
26  Float_t fY2v; ///< Y top right corner of paper
27  Float_t fX1w; ///<
28  Float_t fY1w; ///<
29  Float_t fX2w; ///<
30  Float_t fY2w; ///<
31  Float_t fDXC; ///<
32  Float_t fDYC; ///<
33  Float_t fXC; ///<
34  Float_t fYC; ///<
35  Float_t fFX; ///<
36  Float_t fFY; ///<
37  Float_t fXVP1; ///<
38  Float_t fXVP2; ///<
39  Float_t fYVP1; ///<
40  Float_t fYVP2; ///<
41  Float_t fXVS1; ///<
42  Float_t fXVS2; ///<
43  Float_t fYVS1; ///<
44  Float_t fYVS2; ///<
45  Float_t fXsize; ///< Page size along X
46  Float_t fYsize; ///< Page size along Y
47  Float_t fMaxsize; ///< Largest dimension of X and Y
48  Float_t fRed; ///< Per cent of red
49  Float_t fGreen; ///< Per cent of green
50  Float_t fBlue; ///< Per cent of blue
51  Float_t fLineScale; ///< Line width scale factor
52  Int_t fLineJoin; ///< Appearance of joining lines
53  Int_t fSave; ///< Number of gsave for restore
54  Int_t fNXzone; ///< Number of zones along X
55  Int_t fNYzone; ///< Number of zones along Y
56  Int_t fIXzone; ///< Current zone along X
57  Int_t fIYzone; ///< Current zone along Y
58  Float_t fMarkerSizeCur; ///< current transformed value of marker size
59  Int_t fCurrentColor; ///< current Postscript color index
60  Int_t fNpages; ///< number of pages
61  Int_t fType; ///< PostScript workstation type
62  Int_t fMode; ///< PostScript mode
63  Int_t fClip; ///< Clipping mode
64  Bool_t fBoundingBox; ///< True for Encapsulated PostScript
65  Bool_t fClear; ///< True when page must be cleared
66  Bool_t fClipStatus; ///< Clipping Indicator
67  Bool_t fRange; ///< True when a range has been defined
68  Bool_t fZone; ///< Zone indicator
69  char fPatterns[32]; ///< Indicate if pattern n is defined
70  Int_t fNbinCT; ///< Number of entries in the current Cell Array
71  Int_t fNbCellW; ///< Number of boxes per line
72  Int_t fNbCellLine; ///< Number of boxes in the current line
73  Int_t fMaxLines; ///< Maximum number of lines in a PS array
74  Int_t fLastCellRed; ///< Last red value
75  Int_t fLastCellGreen; ///< Last green value
76  Int_t fLastCellBlue; ///< Last blue value
77  Int_t fNBSameColorCell; ///< Number of boxes with the same color
78  TString fFileName; ///< PS file name
79  Bool_t fFontEmbed; ///< True is FontEmbed has been called
80 
81  static Int_t fgLineJoin; ///< Appearance of joining lines
82 
83 public:
84  TPostScript();
85  TPostScript(const char *filename, Int_t type=-111);
86  virtual ~TPostScript();
87 
88  void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2,
89  Double_t y1, Double_t y2);
90  void CellArrayFill(Int_t r, Int_t g, Int_t b);
91  void CellArrayEnd();
92  void Close(Option_t *opt="");
93  Int_t CMtoPS(Double_t u) {return Int_t(0.5 + 72*u/2.54);}
94  void DefineMarkers();
95  void DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t y2);
96  void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
97  Int_t mode, Int_t border, Int_t dark, Int_t light);
98  void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x,
99  Float_t *y);
100  void DrawHatch(Float_t dy, Float_t angle, Int_t n, Double_t *x,
101  Double_t *y);
102  void DrawPolyLine(Int_t n, TPoints *xy);
103  void DrawPolyLineNDC(Int_t n, TPoints *uv);
104  void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y);
105  void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y);
106  void DrawPS(Int_t n, Float_t *xw, Float_t *yw);
107  void DrawPS(Int_t n, Double_t *xw, Double_t *yw);
108  bool FontEmbedType1(const char *filename);
109  bool FontEmbedType2(const char *filename);
110  bool FontEmbedType42(const char *filename);
111  void FontEmbed();
112  void FontEncode();
113  void Initialize();
114  void NewPage();
115  void Off();
116  void On();
117  void Open(const char *filename, Int_t type=-111);
118  void SaveRestore(Int_t flag);
119  void SetFillColor( Color_t cindex=1);
120  void SetFillPatterns(Int_t ipat, Int_t color);
121  void SetLineColor( Color_t cindex=1);
122  void SetLineJoin(Int_t linejoin=0);
123  void SetLineStyle(Style_t linestyle = 1);
124  void SetLineWidth(Width_t linewidth = 1);
125  void SetLineScale(Float_t scale=3) {fLineScale = scale;}
126  void SetMarkerColor( Color_t cindex=1);
127  void SetTextColor( Color_t cindex=1);
128  void MovePS(Int_t x, Int_t y);
129  void Range(Float_t xrange, Float_t yrange);
130  void SetColor(Int_t color = 1);
131  void SetColor(Float_t r, Float_t g, Float_t b);
132  void Text(Double_t x, Double_t y, const char *string);
133  void Text(Double_t x, Double_t y, const wchar_t *string);
134  void TextNDC(Double_t u, Double_t v, const char *string);
135  void TextNDC(Double_t u, Double_t v, const wchar_t *string);
136  Int_t UtoPS(Double_t u);
137  Int_t VtoPS(Double_t v);
138  Int_t XtoPS(Double_t x);
139  Int_t YtoPS(Double_t y);
140  void Zone();
141 
142  ClassDef(TPostScript,0) //PostScript driver
143 };
144 
145 #endif