ROOT logo
// @(#)root/postscript:$Id$
// Author: O.Couet   16/07/99

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TPostScript
#define ROOT_TPostScript


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TPostScript                                                          //
//                                                                      //
// PostScript driver.                                                   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TVirtualPS
#include "TVirtualPS.h"
#endif

class TPoints;

class TPostScript : public TVirtualPS {

protected:
   Float_t fX1v;             //X bottom left corner of paper
   Float_t fY1v;             //Y bottom left corner of paper
   Float_t fX2v;             //X top right corner of paper
   Float_t fY2v;             //Y top right corner of paper
   Float_t fX1w;             //
   Float_t fY1w;             //
   Float_t fX2w;             //
   Float_t fY2w;             //
   Float_t fDXC;             //
   Float_t fDYC;             //
   Float_t fXC;              //
   Float_t fYC;              //
   Float_t fFX;              //
   Float_t fFY;              //
   Float_t fXVP1;            //
   Float_t fXVP2;            //
   Float_t fYVP1;            //
   Float_t fYVP2;            //
   Float_t fXVS1;            //
   Float_t fXVS2;            //
   Float_t fYVS1;            //
   Float_t fYVS2;            //
   Float_t fXsize;           //Page size along X
   Float_t fYsize;           //Page size along Y
   Float_t fMaxsize;         //Largest dimension of X and Y
   Float_t fRed;             //Per cent of red
   Float_t fGreen;           //Per cent of green
   Float_t fBlue;            //Per cent of blue
   Float_t fLineScale;       //Line width scale factor
   Int_t   fLineJoin;        //Appearance of joining lines
   Int_t   fSave;            //Number of gsave for restore
   Int_t   fNXzone;          //Number of zones along X
   Int_t   fNYzone;          //Number of zones along Y
   Int_t   fIXzone;          //Current zone along X
   Int_t   fIYzone;          //Current zone along Y
   Float_t fMarkerSizeCur;   //current transformed value of marker size
   Int_t   fCurrentColor;    //current Postscript color index
   Int_t   fNpages;          //number of pages
   Int_t   fType;            //PostScript workstation type
   Int_t   fMode;            //PostScript mode
   Int_t   fClip;            //Clipping mode
   Bool_t  fBoundingBox;     //True for Encapsulated PostScript
   Bool_t  fClear;           //True when page must be cleared
   Bool_t  fClipStatus;      //Clipping Indicator
   Bool_t  fRange;           //True when a range has been defined
   Bool_t  fZone;            //Zone indicator
   char    fPatterns[32];    //Indicate if pattern n is defined
   Int_t   fNbinCT;          //Number of entries in the current Cell Array
   Int_t   fNbCellW;         //Number of boxes per line
   Int_t   fNbCellLine;      //Number of boxes in the current line
   Int_t   fMaxLines;        //Maximum number of lines in a PS array
   Int_t   fLastCellRed;     //Last red value
   Int_t   fLastCellGreen;   //Last green value
   Int_t   fLastCellBlue;    //Last blue value
   Int_t   fNBSameColorCell; //Number of boxes with the same color
   TString fFileName;        //PS file name
   Bool_t  fFontEmbed;       //True is FontEmbed has been called

   static Int_t fgLineJoin;  //Appearance of joining lines

public:
   TPostScript();
   TPostScript(const char *filename, Int_t type=-111);
   virtual ~TPostScript();

   void  CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2,
                                          Double_t y1, Double_t y2);
   void  CellArrayFill(Int_t r, Int_t g, Int_t b);
   void  CellArrayEnd();
   void  Close(Option_t *opt="");
   Int_t CMtoPS(Double_t u) {return Int_t(0.5 + 72*u/2.54);}
   void  DefineMarkers();
   void  DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t  y2);
   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);
   void  DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x,
                   Float_t *y);
   void  DrawHatch(Float_t dy, Float_t angle, Int_t n, Double_t *x,
                   Double_t *y);
   void  DrawPolyLine(Int_t n, TPoints *xy);
   void  DrawPolyLineNDC(Int_t n, TPoints *uv);
   void  DrawPolyMarker(Int_t n, Float_t *x, Float_t *y);
   void  DrawPolyMarker(Int_t n, Double_t *x, Double_t *y);
   void  DrawPS(Int_t n, Float_t *xw, Float_t *yw);
   void  DrawPS(Int_t n, Double_t *xw, Double_t *yw);
   bool  FontEmbedType1(const char *filename);
   bool  FontEmbedType2(const char *filename);
   bool  FontEmbedType42(const char *filename);
   void  FontEmbed();
   void  FontEncode();
   void  Initialize();
   void  NewPage();
   void  Off();
   void  On();
   void  Open(const char *filename, Int_t type=-111);
   void  SaveRestore(Int_t flag);
   void  SetFillColor( Color_t cindex=1);
   void  SetFillPatterns(Int_t ipat, Int_t color);
   void  SetLineColor( Color_t cindex=1);
   void  SetLineJoin(Int_t linejoin=0);
   void  SetLineStyle(Style_t linestyle = 1);
   void  SetLineWidth(Width_t linewidth = 1);
   void  SetLineScale(Float_t scale=3) {fLineScale = scale;}
   void  SetMarkerColor( Color_t cindex=1);
   void  SetTextColor( Color_t cindex=1);
   void  MovePS(Int_t x, Int_t y);
   void  Range(Float_t xrange, Float_t yrange);
   void  SetColor(Int_t color = 1);
   void  SetColor(Float_t r, Float_t g, Float_t b);
   void  Text(Double_t x, Double_t y, const char *string);
   void  Text(Double_t x, Double_t y, const wchar_t *string);
   void  TextNDC(Double_t u, Double_t v, const char *string);
   void  TextNDC(Double_t u, Double_t v, const wchar_t *string);
   Int_t UtoPS(Double_t u);
   Int_t VtoPS(Double_t v);
   Int_t XtoPS(Double_t x);
   Int_t YtoPS(Double_t y);
   void  Zone();

   ClassDef(TPostScript,0)  //PostScript driver
};

#endif
 TPostScript.h:1
 TPostScript.h:2
 TPostScript.h:3
 TPostScript.h:4
 TPostScript.h:5
 TPostScript.h:6
 TPostScript.h:7
 TPostScript.h:8
 TPostScript.h:9
 TPostScript.h:10
 TPostScript.h:11
 TPostScript.h:12
 TPostScript.h:13
 TPostScript.h:14
 TPostScript.h:15
 TPostScript.h:16
 TPostScript.h:17
 TPostScript.h:18
 TPostScript.h:19
 TPostScript.h:20
 TPostScript.h:21
 TPostScript.h:22
 TPostScript.h:23
 TPostScript.h:24
 TPostScript.h:25
 TPostScript.h:26
 TPostScript.h:27
 TPostScript.h:28
 TPostScript.h:29
 TPostScript.h:30
 TPostScript.h:31
 TPostScript.h:32
 TPostScript.h:33
 TPostScript.h:34
 TPostScript.h:35
 TPostScript.h:36
 TPostScript.h:37
 TPostScript.h:38
 TPostScript.h:39
 TPostScript.h:40
 TPostScript.h:41
 TPostScript.h:42
 TPostScript.h:43
 TPostScript.h:44
 TPostScript.h:45
 TPostScript.h:46
 TPostScript.h:47
 TPostScript.h:48
 TPostScript.h:49
 TPostScript.h:50
 TPostScript.h:51
 TPostScript.h:52
 TPostScript.h:53
 TPostScript.h:54
 TPostScript.h:55
 TPostScript.h:56
 TPostScript.h:57
 TPostScript.h:58
 TPostScript.h:59
 TPostScript.h:60
 TPostScript.h:61
 TPostScript.h:62
 TPostScript.h:63
 TPostScript.h:64
 TPostScript.h:65
 TPostScript.h:66
 TPostScript.h:67
 TPostScript.h:68
 TPostScript.h:69
 TPostScript.h:70
 TPostScript.h:71
 TPostScript.h:72
 TPostScript.h:73
 TPostScript.h:74
 TPostScript.h:75
 TPostScript.h:76
 TPostScript.h:77
 TPostScript.h:78
 TPostScript.h:79
 TPostScript.h:80
 TPostScript.h:81
 TPostScript.h:82
 TPostScript.h:83
 TPostScript.h:84
 TPostScript.h:85
 TPostScript.h:86
 TPostScript.h:87
 TPostScript.h:88
 TPostScript.h:89
 TPostScript.h:90
 TPostScript.h:91
 TPostScript.h:92
 TPostScript.h:93
 TPostScript.h:94
 TPostScript.h:95
 TPostScript.h:96
 TPostScript.h:97
 TPostScript.h:98
 TPostScript.h:99
 TPostScript.h:100
 TPostScript.h:101
 TPostScript.h:102
 TPostScript.h:103
 TPostScript.h:104
 TPostScript.h:105
 TPostScript.h:106
 TPostScript.h:107
 TPostScript.h:108
 TPostScript.h:109
 TPostScript.h:110
 TPostScript.h:111
 TPostScript.h:112
 TPostScript.h:113
 TPostScript.h:114
 TPostScript.h:115
 TPostScript.h:116
 TPostScript.h:117
 TPostScript.h:118
 TPostScript.h:119
 TPostScript.h:120
 TPostScript.h:121
 TPostScript.h:122
 TPostScript.h:123
 TPostScript.h:124
 TPostScript.h:125
 TPostScript.h:126
 TPostScript.h:127
 TPostScript.h:128
 TPostScript.h:129
 TPostScript.h:130
 TPostScript.h:131
 TPostScript.h:132
 TPostScript.h:133
 TPostScript.h:134
 TPostScript.h:135
 TPostScript.h:136
 TPostScript.h:137
 TPostScript.h:138
 TPostScript.h:139
 TPostScript.h:140
 TPostScript.h:141
 TPostScript.h:142
 TPostScript.h:143
 TPostScript.h:144
 TPostScript.h:145
 TPostScript.h:146
 TPostScript.h:147
 TPostScript.h:148
 TPostScript.h:149
 TPostScript.h:150
 TPostScript.h:151
 TPostScript.h:152
 TPostScript.h:153
 TPostScript.h:154
 TPostScript.h:155
 TPostScript.h:156