Logo ROOT  
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 #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 fSave; ///< Number of gsave for restore
53  Int_t fNXzone; ///< Number of zones along X
54  Int_t fNYzone; ///< Number of zones along Y
55  Int_t fIXzone; ///< Current zone along X
56  Int_t fIYzone; ///< Current zone along Y
57  Float_t fMarkerSizeCur; ///< current transformed value of marker size
58  Int_t fCurrentColor; ///< current Postscript color index
59  Int_t fNpages; ///< number of pages
60  Int_t fType; ///< PostScript workstation type
61  Int_t fMode; ///< PostScript mode
62  Int_t fClip; ///< Clipping mode
63  Bool_t fBoundingBox; ///< True for Encapsulated PostScript
64  Bool_t fClear; ///< True when page must be cleared
65  Bool_t fClipStatus; ///< Clipping Indicator
66  Bool_t fRange; ///< True when a range has been defined
67  Bool_t fZone; ///< Zone indicator
68  char fPatterns[32]; ///< Indicate if pattern n is defined
69  Int_t fNbinCT; ///< Number of entries in the current Cell Array
70  Int_t fNbCellW; ///< Number of boxes per line
71  Int_t fNbCellLine; ///< Number of boxes in the current line
72  Int_t fMaxLines; ///< Maximum number of lines in a PS array
73  Int_t fLastCellRed; ///< Last red value
74  Int_t fLastCellGreen; ///< Last green value
75  Int_t fLastCellBlue; ///< Last blue value
76  Int_t fNBSameColorCell; ///< Number of boxes with the same color
77  TString fFileName; ///< PS file name
78  Bool_t fFontEmbed; ///< True is FontEmbed has been called
79 
80  static Int_t fgLineJoin; ///< Appearance of joining lines
81  static Int_t fgLineCap; ///< Appearance of line caps
82 
83 public:
84  TPostScript();
85  TPostScript(const char *filename, Int_t type=-111);
86  virtual ~TPostScript();
87 
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();
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);
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 SetLineCap(Int_t linecap=0);
124  void SetLineStyle(Style_t linestyle = 1);
125  void SetLineWidth(Width_t linewidth = 1);
126  void SetLineScale(Float_t scale=3) {fLineScale = scale;}
127  void SetMarkerColor( Color_t cindex=1);
128  void SetTextColor( Color_t cindex=1);
129  void MovePS(Int_t x, Int_t y);
130  void Range(Float_t xrange, Float_t yrange);
131  void SetColor(Int_t color = 1);
132  void SetColor(Float_t r, Float_t g, Float_t b);
133  void Text(Double_t x, Double_t y, const char *string);
134  void Text(Double_t x, Double_t y, const wchar_t *string);
135  void TextNDC(Double_t u, Double_t v, const char *string);
136  void TextNDC(Double_t u, Double_t v, const wchar_t *string);
137  Int_t UtoPS(Double_t u);
141  void Zone();
142 
143  ClassDef(TPostScript,0) //PostScript driver
144 };
145 
146 #endif
TVirtualPS
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:30
TPostScript::fGreen
Float_t fGreen
Per cent of green.
Definition: TPostScript.h:49
TPostScript::fMaxLines
Int_t fMaxLines
Maximum number of lines in a PS array.
Definition: TPostScript.h:72
n
const Int_t n
Definition: legend1.C:16
TPostScript::fBlue
Float_t fBlue
Per cent of blue.
Definition: TPostScript.h:50
TPostScript::NewPage
void NewPage()
Move to a new PostScript page.
Definition: TPostScript.cxx:2020
TPostScript::fLastCellRed
Int_t fLastCellRed
Last red value.
Definition: TPostScript.h:73
Style_t
short Style_t
Definition: RtypesCore.h:78
TPostScript::fYVS1
Float_t fYVS1
Definition: TPostScript.h:43
TPostScript::fMarkerSizeCur
Float_t fMarkerSizeCur
current transformed value of marker size
Definition: TPostScript.h:57
H
#define H(x, y, z)
TPostScript::fPatterns
char fPatterns[32]
Indicate if pattern n is defined.
Definition: TPostScript.h:68
TPostScript::FontEmbed
void FontEmbed()
Embed font in PS file.
Definition: TPostScript.cxx:1584
TPostScript::DrawBox
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
Definition: TPostScript.cxx:758
TPostScript::CellArrayFill
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
Definition: TPostScript.cxx:629
TPostScript::FontEmbedType42
bool FontEmbedType42(const char *filename)
Definition: TPostScript.cxx:1550
TPostScript::SetTextColor
void SetTextColor(Color_t cindex=1)
Set color index for text.
Definition: TPostScript.cxx:2606
Option_t
const char Option_t
Definition: RtypesCore.h:64
TPostScript::SetLineColor
void SetLineColor(Color_t cindex=1)
Set color index for lines.
Definition: TPostScript.cxx:2460
TPostScript::fYVP2
Float_t fYVP2
Definition: TPostScript.h:40
TPostScript::fBoundingBox
Bool_t fBoundingBox
True for Encapsulated PostScript.
Definition: TPostScript.h:63
TPostScript::On
void On()
Activate an already open PostScript file.
Definition: TPostScript.cxx:516
TPostScript::~TPostScript
virtual ~TPostScript()
Default PostScript destructor.
Definition: TPostScript.cxx:432
TPostScript::SetLineStyle
void SetLineStyle(Style_t linestyle=1)
Change the line style.
Definition: TPostScript.cxx:2524
TPostScript::CMtoPS
Int_t CMtoPS(Double_t u)
Definition: TPostScript.h:93
TPostScript::DrawPS
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
Definition: TPostScript.cxx:1254
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TPostScript::fNXzone
Int_t fNXzone
Number of zones along X.
Definition: TPostScript.h:53
TPostScript::fXsize
Float_t fXsize
Page size along X.
Definition: TPostScript.h:45
TPostScript::fNYzone
Int_t fNYzone
Number of zones along Y.
Definition: TPostScript.h:54
TPostScript::fY2w
Float_t fY2w
Definition: TPostScript.h:30
Float_t
float Float_t
Definition: RtypesCore.h:55
TPostScript::fgLineCap
static Int_t fgLineCap
Appearance of line caps.
Definition: TPostScript.h:81
TPostScript::fClipStatus
Bool_t fClipStatus
Clipping Indicator.
Definition: TPostScript.h:65
Int_t
int Int_t
Definition: RtypesCore.h:43
TPostScript::fClear
Bool_t fClear
True when page must be cleared.
Definition: TPostScript.h:64
TPostScript::fDYC
Float_t fDYC
Definition: TPostScript.h:32
TPostScript::DrawPolyLineNDC
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
Definition: TPostScript.cxx:1022
TPostScript::fType
Int_t fType
PostScript workstation type.
Definition: TPostScript.h:60
x
Double_t x[n]
Definition: legend1.C:17
TPostScript::DefineMarkers
void DefineMarkers()
Define the markers.
Definition: TPostScript.cxx:678
TPostScript::fSave
Int_t fSave
Number of gsave for restore.
Definition: TPostScript.h:52
TVirtualPS.h
TPostScript::fFontEmbed
Bool_t fFontEmbed
True is FontEmbed has been called.
Definition: TPostScript.h:78
TPostScript::SetLineWidth
void SetLineWidth(Width_t linewidth=1)
Change the line width.
Definition: TPostScript.cxx:2538
TPostScript::fNbCellLine
Int_t fNbCellLine
Number of boxes in the current line.
Definition: TPostScript.h:71
TPostScript
Interface to PostScript.
Definition: TPostScript.h:20
TPostScript::fXVP2
Float_t fXVP2
Definition: TPostScript.h:38
TPostScript::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: TPostScript.cxx:820
TPostScript::fNbCellW
Int_t fNbCellW
Number of boxes per line.
Definition: TPostScript.h:70
TString
Basic string class.
Definition: TString.h:131
TPostScript::UtoPS
Int_t UtoPS(Double_t u)
Convert U from NDC coordinate to PostScript.
Definition: TPostScript.cxx:3007
TPostScript::fCurrentColor
Int_t fCurrentColor
current Postscript color index
Definition: TPostScript.h:58
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
TPostScript::fXC
Float_t fXC
Definition: TPostScript.h:33
TPostScript::fX2v
Float_t fX2v
X top right corner of paper.
Definition: TPostScript.h:25
TPostScript::fMaxsize
Float_t fMaxsize
Largest dimension of X and Y.
Definition: TPostScript.h:47
TPostScript::Range
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimeters.
Definition: TPostScript.cxx:2060
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
xy
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
TPostScript::TPostScript
TPostScript()
Default PostScript constructor.
Definition: TPostScript.cxx:267
TPostScript::fNpages
Int_t fNpages
number of pages
Definition: TPostScript.h:59
TPostScript::Open
void Open(const char *filename, Int_t type=-111)
Open a PostScript file.
Definition: TPostScript.cxx:355
TPostScript::fIYzone
Int_t fIYzone
Current zone along Y.
Definition: TPostScript.h:56
TPostScript::fFileName
TString fFileName
PS file name.
Definition: TPostScript.h:77
TPostScript::fFY
Float_t fFY
Definition: TPostScript.h:36
TPostScript::FontEmbedType2
bool FontEmbedType2(const char *filename)
Definition: TPostScript.cxx:1518
TPostScript::MovePS
void MovePS(Int_t x, Int_t y)
Move to a new position.
Definition: TPostScript.cxx:2002
TPostScript::fLastCellBlue
Int_t fLastCellBlue
Last blue value.
Definition: TPostScript.h:75
TPostScript::FontEncode
void FontEncode()
Font Re-encoding.
Definition: TPostScript.cxx:1673
TPostScript::fgLineJoin
static Int_t fgLineJoin
Appearance of joining lines.
Definition: TPostScript.h:80
TPostScript::fDXC
Float_t fDXC
Definition: TPostScript.h:31
TPostScript::fFX
Float_t fFX
Definition: TPostScript.h:35
TPostScript::DrawPolyMarker
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Draw markers at the n WC points x, y.
Definition: TPostScript.cxx:1099
Width_t
short Width_t
Definition: RtypesCore.h:80
TPostScript::fYVS2
Float_t fYVS2
Definition: TPostScript.h:44
TPostScript::Off
void Off()
Deactivate an already open PostScript file.
Definition: TPostScript.cxx:529
TPostScript::SetMarkerColor
void SetMarkerColor(Color_t cindex=1)
Set color index for markers.
Definition: TPostScript.cxx:2551
TPostScript::fX1v
Float_t fX1v
X bottom left corner of paper.
Definition: TPostScript.h:23
TPostScript::SetLineJoin
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
Definition: TPostScript.cxx:2483
TPostScript::fRed
Float_t fRed
Per cent of red.
Definition: TPostScript.h:48
TPostScript::CellArrayBegin
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
Draw a Cell Array.
Definition: TPostScript.cxx:556
y
Double_t y[n]
Definition: legend1.C:17
TPostScript::CellArrayEnd
void CellArrayEnd()
End the Cell Array painting.
Definition: TPostScript.cxx:667
TPostScript::YtoPS
Int_t YtoPS(Double_t y)
Convert Y from world coordinate to PostScript.
Definition: TPostScript.cxx:3034
TPostScript::fXVP1
Float_t fXVP1
Definition: TPostScript.h:37
TPostScript::SetFillPatterns
void SetFillPatterns(Int_t ipat, Int_t color)
Patterns definition.
Definition: TPostScript.cxx:2149
TPostScript::fY2v
Float_t fY2v
Y top right corner of paper.
Definition: TPostScript.h:26
TPostScript::fZone
Bool_t fZone
Zone indicator.
Definition: TPostScript.h:67
TPostScript::fRange
Bool_t fRange
True when a range has been defined.
Definition: TPostScript.h:66
TPostScript::Initialize
void Initialize()
PostScript Initialisation.
Definition: TPostScript.cxx:1735
TPostScript::Zone
void Zone()
Initialize the PostScript page in zones.
Definition: TPostScript.cxx:3043
TPostScript::fY1w
Float_t fY1w
Definition: TPostScript.h:28
Double_t
double Double_t
Definition: RtypesCore.h:57
TPostScript::TextNDC
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Definition: TPostScript.cxx:2987
TPostScript::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: TPostScript.cxx:1469
TPostScript::fNbinCT
Int_t fNbinCT
Number of entries in the current Cell Array.
Definition: TPostScript.h:69
TPostScript::fXVS2
Float_t fXVS2
Definition: TPostScript.h:42
TPostScript::SetLineCap
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TPostScript::fgLineCap.
Definition: TPostScript.cxx:2507
TPostScript::SetFillColor
void SetFillColor(Color_t cindex=1)
Set color index for fill areas.
Definition: TPostScript.cxx:2127
TPostScript::FontEmbedType1
bool FontEmbedType1(const char *filename)
Definition: TPostScript.cxx:1484
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:322
TPostScript::fY1v
Float_t fY1v
Y bottom left corner of paper.
Definition: TPostScript.h:24
TPostScript::fClip
Int_t fClip
Clipping mode.
Definition: TPostScript.h:62
TPostScript::fYC
Float_t fYC
Definition: TPostScript.h:34
TPostScript::fMode
Int_t fMode
PostScript mode.
Definition: TPostScript.h:61
TPostScript::SaveRestore
void SaveRestore(Int_t flag)
Compute number of gsaves for restore This allows to write the correct number of grestore at the end o...
Definition: TPostScript.cxx:2118
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
TPostScript::SetLineScale
void SetLineScale(Float_t scale=3)
Definition: TPostScript.h:126
TPostScript::fX1w
Float_t fX1w
Definition: TPostScript.h:27
TPostScript::fNBSameColorCell
Int_t fNBSameColorCell
Number of boxes with the same color.
Definition: TPostScript.h:76
TPostScript::VtoPS
Int_t VtoPS(Double_t v)
Convert V from NDC coordinate to PostScript.
Definition: TPostScript.cxx:3016
TPostScript::Text
void Text(Double_t x, Double_t y, const char *string)
Write a string of characters.
Definition: TPostScript.cxx:2619
type
int type
Definition: TGX11.cxx:120
TPostScript::fXVS1
Float_t fXVS1
Definition: TPostScript.h:41
TPostScript::fIXzone
Int_t fIXzone
Current zone along X.
Definition: TPostScript.h:55
TPostScript::fYVP1
Float_t fYVP1
Definition: TPostScript.h:39
TPostScript::fX2w
Float_t fX2w
Definition: TPostScript.h:29
TPostScript::fLastCellGreen
Int_t fLastCellGreen
Last green value.
Definition: TPostScript.h:74
TPostScript::SetColor
void SetColor(Int_t color=1)
Set the current color.
Definition: TPostScript.cxx:2560
TPostScript::fLineScale
Float_t fLineScale
Line width scale factor.
Definition: TPostScript.h:51
TPostScript::DrawPolyLine
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Definition: TPostScript.cxx:938
TPostScript::XtoPS
Int_t XtoPS(Double_t x)
Convert X from world coordinate to PostScript.
Definition: TPostScript.cxx:3025
int
TPostScript::Close
void Close(Option_t *opt="")
Close a PostScript file.
Definition: TPostScript.cxx:440
TPoints
2-D graphics point (world coordinates).
Definition: TPoints.h:19
TPostScript::fYsize
Float_t fYsize
Page size along Y.
Definition: TPostScript.h:46
g
#define g(i)
Definition: RSha256.hxx:105