ROOT  6.06/09
Reference Guide
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 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPostScript //
19 // //
20 // PostScript driver. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #ifndef ROOT_TVirtualPS
26 #include "TVirtualPS.h"
27 #endif
28 
29 class TPoints;
30 
31 class TPostScript : public TVirtualPS {
32 
33 protected:
34  Float_t fX1v; //X bottom left corner of paper
35  Float_t fY1v; //Y bottom left corner of paper
36  Float_t fX2v; //X top right corner of paper
37  Float_t fY2v; //Y top right corner of paper
56  Float_t fXsize; //Page size along X
57  Float_t fYsize; //Page size along Y
58  Float_t fMaxsize; //Largest dimension of X and Y
59  Float_t fRed; //Per cent of red
60  Float_t fGreen; //Per cent of green
61  Float_t fBlue; //Per cent of blue
62  Float_t fLineScale; //Line width scale factor
63  Int_t fLineJoin; //Appearance of joining lines
64  Int_t fSave; //Number of gsave for restore
65  Int_t fNXzone; //Number of zones along X
66  Int_t fNYzone; //Number of zones along Y
67  Int_t fIXzone; //Current zone along X
68  Int_t fIYzone; //Current zone along Y
69  Float_t fMarkerSizeCur; //current transformed value of marker size
70  Int_t fCurrentColor; //current Postscript color index
71  Int_t fNpages; //number of pages
72  Int_t fType; //PostScript workstation type
73  Int_t fMode; //PostScript mode
74  Int_t fClip; //Clipping mode
75  Bool_t fBoundingBox; //True for Encapsulated PostScript
76  Bool_t fClear; //True when page must be cleared
77  Bool_t fClipStatus; //Clipping Indicator
78  Bool_t fRange; //True when a range has been defined
79  Bool_t fZone; //Zone indicator
80  char fPatterns[32]; //Indicate if pattern n is defined
81  Int_t fNbinCT; //Number of entries in the current Cell Array
82  Int_t fNbCellW; //Number of boxes per line
83  Int_t fNbCellLine; //Number of boxes in the current line
84  Int_t fMaxLines; //Maximum number of lines in a PS array
85  Int_t fLastCellRed; //Last red value
86  Int_t fLastCellGreen; //Last green value
87  Int_t fLastCellBlue; //Last blue value
88  Int_t fNBSameColorCell; //Number of boxes with the same color
89  TString fFileName; //PS file name
90  Bool_t fFontEmbed; //True is FontEmbed has been called
91 
92  static Int_t fgLineJoin; //Appearance of joining lines
93 
94 public:
95  TPostScript();
96  TPostScript(const char *filename, Int_t type=-111);
97  virtual ~TPostScript();
98 
100  Double_t y1, Double_t y2);
101  void CellArrayFill(Int_t r, Int_t g, Int_t b);
102  void CellArrayEnd();
103  void Close(Option_t *opt="");
104  Int_t CMtoPS(Double_t u) {return Int_t(0.5 + 72*u/2.54);}
105  void DefineMarkers();
107  void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
108  Int_t mode, Int_t border, Int_t dark, Int_t light);
109  void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x,
110  Float_t *y);
111  void DrawHatch(Float_t dy, Float_t angle, Int_t n, Double_t *x,
112  Double_t *y);
113  void DrawPolyLine(Int_t n, TPoints *xy);
114  void DrawPolyLineNDC(Int_t n, TPoints *uv);
115  void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y);
117  void DrawPS(Int_t n, Float_t *xw, Float_t *yw);
118  void DrawPS(Int_t n, Double_t *xw, Double_t *yw);
119  bool FontEmbedType1(const char *filename);
120  bool FontEmbedType2(const char *filename);
121  bool FontEmbedType42(const char *filename);
122  void FontEmbed();
123  void FontEncode();
124  void Initialize();
125  void NewPage();
126  void Off();
127  void On();
128  void Open(const char *filename, Int_t type=-111);
129  void SaveRestore(Int_t flag);
130  void SetFillColor( Color_t cindex=1);
131  void SetFillPatterns(Int_t ipat, Int_t color);
132  void SetLineColor( Color_t cindex=1);
133  void SetLineJoin(Int_t linejoin=0);
134  void SetLineStyle(Style_t linestyle = 1);
135  void SetLineWidth(Width_t linewidth = 1);
136  void SetLineScale(Float_t scale=3) {fLineScale = scale;}
137  void SetMarkerColor( Color_t cindex=1);
138  void SetTextColor( Color_t cindex=1);
139  void MovePS(Int_t x, Int_t y);
140  void Range(Float_t xrange, Float_t yrange);
141  void SetColor(Int_t color = 1);
142  void SetColor(Float_t r, Float_t g, Float_t b);
143  void Text(Double_t x, Double_t y, const char *string);
144  void Text(Double_t x, Double_t y, const wchar_t *string);
145  void TextNDC(Double_t u, Double_t v, const char *string);
146  void TextNDC(Double_t u, Double_t v, const wchar_t *string);
147  Int_t UtoPS(Double_t u);
151  void Zone();
152 
153  ClassDef(TPostScript,0) //PostScript driver
154 };
155 
156 #endif
Interface to PostScript.
Definition: TPostScript.h:31
virtual ~TPostScript()
Default PostScript destructor.
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Int_t fNBSameColorCell
Definition: TPostScript.h:88
void Text(Double_t x, Double_t y, const char *string)
Write a string of characters.
Float_t fXsize
Definition: TPostScript.h:56
Float_t fYVP2
Definition: TPostScript.h:51
short Style_t
Definition: RtypesCore.h:76
Bool_t fClear
Definition: TPostScript.h:76
void On()
Activate an already open PostScript file.
float Float_t
Definition: RtypesCore.h:53
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
const char Option_t
Definition: RtypesCore.h:62
Int_t CMtoPS(Double_t u)
Definition: TPostScript.h:104
void DefineMarkers()
Define the markers.
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
Float_t fYsize
Definition: TPostScript.h:57
Float_t fXVP2
Definition: TPostScript.h:49
Bool_t fBoundingBox
Definition: TPostScript.h:75
static const char * filename()
Int_t fCurrentColor
Definition: TPostScript.h:70
#define H(x, y, z)
Basic string class.
Definition: TString.h:137
Int_t fLastCellRed
Definition: TPostScript.h:85
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Float_t fMarkerSizeCur
Definition: TPostScript.h:69
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
Int_t fNXzone
Definition: TPostScript.h:65
char fPatterns[32]
Definition: TPostScript.h:80
Bool_t fFontEmbed
Definition: TPostScript.h:90
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
void FontEmbed()
Embed font in PS file.
bool FontEmbedType42(const char *filename)
Int_t fType
Definition: TPostScript.h:72
void SetLineStyle(Style_t linestyle=1)
Change the line style.
Int_t fSave
Definition: TPostScript.h:64
Float_t fXC
Definition: TPostScript.h:44
Float_t fX2v
Definition: TPostScript.h:36
static const double x2[5]
Float_t fMaxsize
Definition: TPostScript.h:58
Int_t fNpages
Definition: TPostScript.h:71
Double_t x[n]
Definition: legend1.C:17
void SetLineWidth(Width_t linewidth=1)
Change the line width.
void Open(const char *filename, Int_t type=-111)
Open a PostScript file.
static Int_t fgLineJoin
Definition: TPostScript.h:92
Float_t fDXC
Definition: TPostScript.h:42
Float_t fFY
Definition: TPostScript.h:47
Float_t fFX
Definition: TPostScript.h:46
TString fFileName
Definition: TPostScript.h:89
Int_t fNYzone
Definition: TPostScript.h:66
Float_t fY2w
Definition: TPostScript.h:41
bool FontEmbedType2(const char *filename)
Int_t fNbCellW
Definition: TPostScript.h:82
Bool_t fClipStatus
Definition: TPostScript.h:77
Float_t fDYC
Definition: TPostScript.h:43
ClassDef(TAttLine, 2)
Int_t fIYzone
Definition: TPostScript.h:68
Int_t fNbCellLine
Definition: TPostScript.h:83
short Color_t
Definition: RtypesCore.h:79
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.
void CellArrayEnd()
End the Cell Array painting.
void MovePS(Int_t x, Int_t y)
Move to a new position.
Int_t UtoPS(Double_t u)
Convert U from NDC coordinate to PostScript.
Float_t fX1v
Definition: TPostScript.h:34
ROOT::R::TRInterface & r
Definition: Object.C:4
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimeters.
SVector< double, 2 > v
Definition: Dict.h:5
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Draw markers at the n WC points x, y.
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Float_t fXVP1
Definition: TPostScript.h:48
Int_t fLastCellBlue
Definition: TPostScript.h:87
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
void SetMarkerColor(Color_t cindex=1)
Set color index for markers.
Float_t fY2v
Definition: TPostScript.h:37
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
void FontEncode()
Font Re-encoding.
Float_t fRed
Definition: TPostScript.h:59
Bool_t fRange
Definition: TPostScript.h:78
short Width_t
Definition: RtypesCore.h:78
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
Draw a Cell Array.
Float_t fY1w
Definition: TPostScript.h:39
2-D graphics point (world coordinates).
Definition: TPoints.h:29
void SaveRestore(Int_t flag)
Compute number of gsaves for restore This allows to write the correct number of grestore at the end o...
Int_t YtoPS(Double_t y)
Convert Y from world coordinate to PostScript.
Float_t fYVS2
Definition: TPostScript.h:55
static const double x1[5]
Int_t fNbinCT
Definition: TPostScript.h:81
void Off()
Deactivate an already open PostScript file.
void SetFillPatterns(Int_t ipat, Int_t color)
Patterns definition.
Float_t fX1w
Definition: TPostScript.h:38
double Double_t
Definition: RtypesCore.h:55
Float_t fXVS2
Definition: TPostScript.h:53
int type
Definition: TGX11.cxx:120
Bool_t fZone
Definition: TPostScript.h:79
bool FontEmbedType1(const char *filename)
Double_t y[n]
Definition: legend1.C:17
Int_t fIXzone
Definition: TPostScript.h:67
void Zone()
Initialize the PostScript page in zones.
void SetColor(Int_t color=1)
Set the current color.
void SetLineScale(Float_t scale=3)
Definition: TPostScript.h:136
Int_t VtoPS(Double_t v)
Convert V from NDC coordinate to PostScript.
void Close(Option_t *opt="")
Close a PostScript file.
void SetFillColor(Color_t cindex=1)
Set color index for fill areas.
Int_t fLineJoin
Definition: TPostScript.h:63
Int_t fClip
Definition: TPostScript.h:74
void Initialize()
PostScript Initialisation.
Float_t fX2w
Definition: TPostScript.h:40
Int_t fMode
Definition: TPostScript.h:73
Int_t fLastCellGreen
Definition: TPostScript.h:86
void NewPage()
Move to a new PostScript page.
Float_t fLineScale
Definition: TPostScript.h:62
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:40
Float_t fYVS1
Definition: TPostScript.h:54
Int_t XtoPS(Double_t x)
Convert X from world coordinate to PostScript.
void SetTextColor(Color_t cindex=1)
Set color index for text.
const Int_t n
Definition: legend1.C:16
Float_t fXVS1
Definition: TPostScript.h:52
void SetLineColor(Color_t cindex=1)
Set color index for lines.
Float_t fY1v
Definition: TPostScript.h:35
Float_t fGreen
Definition: TPostScript.h:60
Float_t fYVP1
Definition: TPostScript.h:50
Int_t fMaxLines
Definition: TPostScript.h:84
Float_t fBlue
Definition: TPostScript.h:61
Float_t fYC
Definition: TPostScript.h:45