Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TPostScript.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/postscript:$Id$
0002 // Author: O.Couet   16/07/99
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TPostScript
0013 #define ROOT_TPostScript
0014 
0015 
0016 #include "TVirtualPS.h"
0017 
0018 class TPoints;
0019 
0020 class TPostScript : public TVirtualPS {
0021 
0022 protected:
0023    Float_t fX1v;             ///< X bottom left corner of paper
0024    Float_t fY1v;             ///< Y bottom left corner of paper
0025    Float_t fX2v;             ///< X top right corner of paper
0026    Float_t fY2v;             ///< Y top right corner of paper
0027    Float_t fX1w;             ///<
0028    Float_t fY1w;             ///<
0029    Float_t fX2w;             ///<
0030    Float_t fY2w;             ///<
0031    Float_t fDXC;             ///<
0032    Float_t fDYC;             ///<
0033    Float_t fXC;              ///<
0034    Float_t fYC;              ///<
0035    Float_t fFX;              ///<
0036    Float_t fFY;              ///<
0037    Float_t fXVP1;            ///<
0038    Float_t fXVP2;            ///<
0039    Float_t fYVP1;            ///<
0040    Float_t fYVP2;            ///<
0041    Float_t fXVS1;            ///<
0042    Float_t fXVS2;            ///<
0043    Float_t fYVS1;            ///<
0044    Float_t fYVS2;            ///<
0045    Float_t fXsize;           ///< Page size along X
0046    Float_t fYsize;           ///< Page size along Y
0047    Float_t fMaxsize;         ///< Largest dimension of X and Y
0048    Float_t fRed;             ///< Per cent of red
0049    Float_t fGreen;           ///< Per cent of green
0050    Float_t fBlue;            ///< Per cent of blue
0051    Float_t fWidth;           ///< Current line width
0052    Int_t   fStyle;           ///< Current line style
0053    Float_t fLineScale;       ///< Line width scale factor
0054    Int_t   fSave;            ///< Number of gsave for restore
0055    Int_t   fNXzone;          ///< Number of zones along X
0056    Int_t   fNYzone;          ///< Number of zones along Y
0057    Int_t   fIXzone;          ///< Current zone along X
0058    Int_t   fIYzone;          ///< Current zone along Y
0059    Float_t fMarkerSizeCur;   ///< current transformed value of marker size
0060    Int_t   fNpages;          ///< number of pages
0061    Int_t   fType;            ///< PostScript workstation type
0062    Int_t   fMode;            ///< PostScript mode
0063    Int_t   fClip;            ///< Clipping mode
0064    Bool_t  fBoundingBox;     ///< True for Encapsulated PostScript
0065    Bool_t  fClear;           ///< True when page must be cleared
0066    Bool_t  fClipStatus;      ///< Clipping Indicator
0067    Bool_t  fRange;           ///< True when a range has been defined
0068    Bool_t  fZone;            ///< Zone indicator
0069    char    fPatterns[32];    ///< Indicate if pattern n is defined
0070    Int_t   fNbinCT;          ///< Number of entries in the current Cell Array
0071    Int_t   fNbCellW;         ///< Number of boxes per line
0072    Int_t   fNbCellLine;      ///< Number of boxes in the current line
0073    Int_t   fMaxLines;        ///< Maximum number of lines in a PS array
0074    Int_t   fLastCellRed;     ///< Last red value
0075    Int_t   fLastCellGreen;   ///< Last green value
0076    Int_t   fLastCellBlue;    ///< Last blue value
0077    Int_t   fNBSameColorCell; ///< Number of boxes with the same color
0078    TString fFileName;        ///< PS file name
0079    Bool_t  fFontEmbed;       ///< True is FontEmbed has been called
0080 
0081    static Int_t fgLineJoin;  ///< Appearance of joining lines
0082    static Int_t fgLineCap;   ///< Appearance of line caps
0083 
0084 public:
0085    TPostScript();
0086    TPostScript(const char *filename, Int_t type=-111);
0087    ~TPostScript() override;
0088 
0089    void  CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2,
0090                                           Double_t y1, Double_t y2) override;
0091    void  CellArrayFill(Int_t r, Int_t g, Int_t b) override;
0092    void  CellArrayEnd() override;
0093    void  Close(Option_t *opt="") override;
0094    Int_t CMtoPS(Double_t u) {return Int_t(0.5 + 72*u/2.54);}
0095    void  DefineMarkers();
0096    void  DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override;
0097    void  DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t mode, Int_t border, Int_t dark,
0098                   Int_t light) override;
0099    void  DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y);
0100    void  DrawHatch(Float_t dy, Float_t angle, Int_t n, Double_t *x, Double_t *y);
0101    void  DrawPolyLine(Int_t n, TPoints *xy);
0102    void  DrawPolyLineNDC(Int_t n, TPoints *uv);
0103    void  DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override;
0104    void  DrawPolyMarker(Int_t n, Double_t *x, Double_t *y) override;
0105    void  DrawPS(Int_t n, Float_t *xw, Float_t *yw) override;
0106    void  DrawPS(Int_t n, Double_t *xw, Double_t *yw) override;
0107    bool  FontEmbedType1(const char *filename);
0108    bool  FontEmbedType2(const char *filename);
0109    bool  FontEmbedType42(const char *filename);
0110    void  FontEmbed();
0111    void  FontEncode();
0112    void  Initialize();
0113    void  NewPage() override;
0114    void  Off();
0115    void  On();
0116    void  Open(const char *filename, Int_t type=-111) override;
0117    void  SaveRestore(Int_t flag);
0118    void  SetFillColor(Color_t cindex=1) override;
0119    void  SetFillPatterns(Int_t ipat, Int_t color);
0120    void  SetLineColor(Color_t cindex=1) override;
0121    void  SetLineJoin(Int_t linejoin=0);
0122    void  SetLineCap(Int_t linecap=0);
0123    void  SetLineStyle(Style_t linestyle = 1) override;
0124    void  SetLineWidth(Width_t linewidth = 1) override;
0125    void  SetLineScale(Float_t scale=3) {fLineScale = scale;}
0126    void  SetMarkerColor(Color_t cindex=1) override;
0127    void  SetTextColor(Color_t cindex=1) override;
0128    void  SetWidth(Width_t linewidth = 1);
0129    void  SetStyle(Style_t linestyle = 1);
0130    void  MovePS(Int_t x, Int_t y);
0131    void  Range(Float_t xrange, Float_t yrange);
0132    void  SetColor(Int_t color = 1);
0133    void  SetColor(Float_t r, Float_t g, Float_t b) override;
0134    void  Text(Double_t x, Double_t y, const char *string) override;
0135    void  TextUrl(Double_t x, Double_t y, const char *string, const char *url) override;
0136    void  Text(Double_t x, Double_t y, const wchar_t *string) override;
0137    void  TextNDC(Double_t u, Double_t v, const char *string);
0138    void  TextNDC(Double_t u, Double_t v, const wchar_t *string);
0139    Int_t UtoPS(Double_t u);
0140    Int_t VtoPS(Double_t v);
0141    Int_t XtoPS(Double_t x);
0142    Int_t YtoPS(Double_t y);
0143    void  Zone();
0144 
0145    ClassDefOverride(TPostScript,1)  //PostScript driver
0146 };
0147 
0148 #endif