Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
18class TPoints;
19
20class TPostScript : public TVirtualPS {
21
22protected:
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
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
83public:
85 TPostScript(const char *filename, Int_t type=-111);
86 ~TPostScript() override;
87
89 Double_t y1, Double_t y2) override;
90 void CellArrayFill(Int_t r, Int_t g, Int_t b) override;
91 void CellArrayEnd() override;
92 void Close(Option_t *opt="") override;
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, Int_t mode, Int_t border, Int_t dark,
97 Int_t light) override;
100 void DrawPolyLine(Int_t n, TPoints *xy);
101 void DrawPolyLineNDC(Int_t n, TPoints *uv);
102 void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override;
103 void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y) override;
104 void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override;
105 void DrawPS(Int_t n, Double_t *xw, Double_t *yw) override;
106 bool FontEmbedType1(const char *filename);
107 bool FontEmbedType2(const char *filename);
108 bool FontEmbedType42(const char *filename);
109 void FontEmbed();
110 void FontEncode();
111 void Initialize();
112 void NewPage() override;
113 void Off();
114 void On();
115 void Open(const char *filename, Int_t type=-111) override;
116 void SaveRestore(Int_t flag);
117 void SetFillColor(Color_t cindex=1) override;
118 void SetFillPatterns(Int_t ipat, Int_t color);
119 void SetLineColor(Color_t cindex=1) override;
120 void SetLineJoin(Int_t linejoin=0);
121 void SetLineCap(Int_t linecap=0);
122 void SetLineStyle(Style_t linestyle = 1) override;
123 void SetLineWidth(Width_t linewidth = 1) override;
124 void SetLineScale(Float_t scale=3) {fLineScale = scale;}
125 void SetMarkerColor(Color_t cindex=1) override;
126 void SetTextColor(Color_t cindex=1) override;
127 void MovePS(Int_t x, Int_t y);
128 void Range(Float_t xrange, Float_t yrange);
129 void SetColor(Int_t color = 1);
130 void SetColor(Float_t r, Float_t g, Float_t b) override;
131 void Text(Double_t x, Double_t y, const char *string) override;
132 void Text(Double_t x, Double_t y, const wchar_t *string) override;
133 void TextNDC(Double_t u, Double_t v, const char *string);
134 void TextNDC(Double_t u, Double_t v, const wchar_t *string);
139 void Zone();
140
141 ClassDefOverride(TPostScript,0) //PostScript driver
142};
143
144#endif
#define b(i)
Definition RSha256.hxx:100
#define g(i)
Definition RSha256.hxx:105
short Style_t
Definition RtypesCore.h:89
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:92
short Width_t
Definition RtypesCore.h:91
float Float_t
Definition RtypesCore.h:57
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t cindex
Option_t Option_t SetLineWidth
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t SetLineColor
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint DrawPolyMarker
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char y1
2-D graphics point (world coordinates).
Definition TPoints.h:19
Interface to PostScript.
Definition TPostScript.h:20
void DefineMarkers()
Define the markers.
Float_t fXsize
Page size along X.
Definition TPostScript.h:45
Int_t fIYzone
Current zone along Y.
Definition TPostScript.h:56
Int_t fType
PostScript workstation type.
Definition TPostScript.h:60
TPostScript()
Default PostScript constructor.
Int_t VtoPS(Double_t v)
Convert V from NDC coordinate to PostScript.
void CellArrayEnd() override
End the Cell Array painting.
static Int_t fgLineCap
Appearance of line caps.
Definition TPostScript.h:81
Float_t fX2w
Definition TPostScript.h:29
void SetMarkerColor(Color_t cindex=1) override
Set color index for markers.
Int_t fNBSameColorCell
Number of boxes with the same color.
Definition TPostScript.h:76
void SetColor(Int_t color=1)
Set the current color.
Int_t fMode
PostScript mode.
Definition TPostScript.h:61
Int_t fIXzone
Current zone along X.
Definition TPostScript.h:55
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
void FontEncode()
Font Re-encoding.
Float_t fXVP2
Definition TPostScript.h:38
Int_t fLastCellBlue
Last blue value.
Definition TPostScript.h:75
Float_t fY1w
Definition TPostScript.h:28
Int_t fNbCellW
Number of boxes per line.
Definition TPostScript.h:70
Float_t fX1v
X bottom left corner of paper.
Definition TPostScript.h:23
Float_t fYC
Definition TPostScript.h:34
Float_t fRed
Per cent of red.
Definition TPostScript.h:48
Float_t fXC
Definition TPostScript.h:33
Int_t fCurrentColor
current Postscript color index
Definition TPostScript.h:58
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
Draw a PolyLine.
Float_t fXVS1
Definition TPostScript.h:41
Bool_t fClipStatus
Clipping Indicator.
Definition TPostScript.h:65
Float_t fLineScale
Line width scale factor.
Definition TPostScript.h:51
Float_t fMarkerSizeCur
current transformed value of marker size
Definition TPostScript.h:57
Bool_t fZone
Zone indicator.
Definition TPostScript.h:67
void Open(const char *filename, Int_t type=-111) override
Open a PostScript file.
void SetFillPatterns(Int_t ipat, Int_t color)
Patterns definition.
Float_t fDXC
Definition TPostScript.h:31
Int_t fLastCellRed
Last red value.
Definition TPostScript.h:73
void Off()
Deactivate an already open PostScript file.
Int_t YtoPS(Double_t y)
Convert Y from world coordinate to PostScript.
Bool_t fRange
True when a range has been defined.
Definition TPostScript.h:66
Float_t fBlue
Per cent of blue.
Definition TPostScript.h:50
void Text(Double_t x, Double_t y, const char *string) override
Write a string of characters.
void MovePS(Int_t x, Int_t y)
Move to a new position.
void Initialize()
PostScript Initialisation.
bool FontEmbedType2(const char *filename)
Int_t fNbCellLine
Number of boxes in the current line.
Definition TPostScript.h:71
Float_t fMaxsize
Largest dimension of X and Y.
Definition TPostScript.h:47
Float_t fYVS1
Definition TPostScript.h:43
Int_t fClip
Clipping mode.
Definition TPostScript.h:62
TString fFileName
PS file name.
Definition TPostScript.h:77
Int_t fNYzone
Number of zones along Y.
Definition TPostScript.h:54
bool FontEmbedType1(const char *filename)
Float_t fGreen
Per cent of green.
Definition TPostScript.h:49
void SetLineStyle(Style_t linestyle=1) override
Change the line style.
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TPostScript::fgLineCap.
Float_t fYVP2
Definition TPostScript.h:40
void NewPage() override
Move to a new PostScript page.
Float_t fDYC
Definition TPostScript.h:32
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
Int_t UtoPS(Double_t u)
Convert U from NDC coordinate to PostScript.
Bool_t fFontEmbed
True is FontEmbed has been called.
Definition TPostScript.h:78
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) override
Draw a Frame around a box.
Float_t fX1w
Definition TPostScript.h:27
Float_t fYVP1
Definition TPostScript.h:39
Int_t fSave
Number of gsave for restore.
Definition TPostScript.h:52
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Paint the Cell Array.
void SetTextColor(Color_t cindex=1) override
Set color index for text.
void On()
Activate an already open PostScript file.
Int_t CMtoPS(Double_t u)
Definition TPostScript.h:93
bool FontEmbedType42(const char *filename)
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Float_t fFX
Definition TPostScript.h:35
Float_t fXVS2
Definition TPostScript.h:42
Int_t fNXzone
Number of zones along X.
Definition TPostScript.h:53
void SetLineScale(Float_t scale=3)
Bool_t fBoundingBox
True for Encapsulated PostScript.
Definition TPostScript.h:63
Float_t fY2w
Definition TPostScript.h:30
Int_t XtoPS(Double_t x)
Convert X from world coordinate to PostScript.
~TPostScript() override
Default PostScript destructor.
char fPatterns[32]
Indicate if pattern n is defined.
Definition TPostScript.h:68
Int_t fNbinCT
Number of entries in the current Cell Array.
Definition TPostScript.h:69
static Int_t fgLineJoin
Appearance of joining lines.
Definition TPostScript.h:80
Float_t fY2v
Y top right corner of paper.
Definition TPostScript.h:26
Int_t fLastCellGreen
Last green value.
Definition TPostScript.h:74
Float_t fFY
Definition TPostScript.h:36
Float_t fY1v
Y bottom left corner of paper.
Definition TPostScript.h:24
Float_t fYVS2
Definition TPostScript.h:44
void SaveRestore(Int_t flag)
Compute number of gsaves for restore This allows to write the correct number of grestore at the end o...
Bool_t fClear
True when page must be cleared.
Definition TPostScript.h:64
Int_t fMaxLines
Maximum number of lines in a PS array.
Definition TPostScript.h:72
void Zone()
Initialize the PostScript page in zones.
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimeters.
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override
Draw a Cell Array.
Float_t fX2v
X top right corner of paper.
Definition TPostScript.h:25
void FontEmbed()
Embed font in PS file.
void Close(Option_t *opt="") override
Close a PostScript file.
Float_t fXVP1
Definition TPostScript.h:37
Int_t fNpages
number of pages
Definition TPostScript.h:59
Float_t fYsize
Page size along Y.
Definition TPostScript.h:46
Basic string class.
Definition TString.h:139
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)