Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:20

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 fLineScale;       ///< Line width scale factor
0052    Int_t   fSave;            ///< Number of gsave for restore
0053    Int_t   fNXzone;          ///< Number of zones along X
0054    Int_t   fNYzone;          ///< Number of zones along Y
0055    Int_t   fIXzone;          ///< Current zone along X
0056    Int_t   fIYzone;          ///< Current zone along Y
0057    Float_t fMarkerSizeCur;   ///< current transformed value of marker size
0058    Int_t   fCurrentColor;    ///< current Postscript color index
0059    Int_t   fNpages;          ///< number of pages
0060    Int_t   fType;            ///< PostScript workstation type
0061    Int_t   fMode;            ///< PostScript mode
0062    Int_t   fClip;            ///< Clipping mode
0063    Bool_t  fBoundingBox;     ///< True for Encapsulated PostScript
0064    Bool_t  fClear;           ///< True when page must be cleared
0065    Bool_t  fClipStatus;      ///< Clipping Indicator
0066    Bool_t  fRange;           ///< True when a range has been defined
0067    Bool_t  fZone;            ///< Zone indicator
0068    char    fPatterns[32];    ///< Indicate if pattern n is defined
0069    Int_t   fNbinCT;          ///< Number of entries in the current Cell Array
0070    Int_t   fNbCellW;         ///< Number of boxes per line
0071    Int_t   fNbCellLine;      ///< Number of boxes in the current line
0072    Int_t   fMaxLines;        ///< Maximum number of lines in a PS array
0073    Int_t   fLastCellRed;     ///< Last red value
0074    Int_t   fLastCellGreen;   ///< Last green value
0075    Int_t   fLastCellBlue;    ///< Last blue value
0076    Int_t   fNBSameColorCell; ///< Number of boxes with the same color
0077    TString fFileName;        ///< PS file name
0078    Bool_t  fFontEmbed;       ///< True is FontEmbed has been called
0079 
0080    static Int_t fgLineJoin;  ///< Appearance of joining lines
0081    static Int_t fgLineCap;   ///< Appearance of line caps
0082 
0083 public:
0084    TPostScript();
0085    TPostScript(const char *filename, Int_t type=-111);
0086    ~TPostScript() override;
0087 
0088    void  CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2,
0089                                           Double_t y1, Double_t y2) override;
0090    void  CellArrayFill(Int_t r, Int_t g, Int_t b) override;
0091    void  CellArrayEnd() override;
0092    void  Close(Option_t *opt="") override;
0093    Int_t CMtoPS(Double_t u) {return Int_t(0.5 + 72*u/2.54);}
0094    void  DefineMarkers();
0095    void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override;
0096    void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t mode, Int_t border, Int_t dark,
0097                   Int_t light) override;
0098    void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y);
0099    void DrawHatch(Float_t dy, Float_t angle, Int_t n, Double_t *x, Double_t *y);
0100    void DrawPolyLine(Int_t n, TPoints *xy);
0101    void  DrawPolyLineNDC(Int_t n, TPoints *uv);
0102    void  DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override;
0103    void  DrawPolyMarker(Int_t n, Double_t *x, Double_t *y) override;
0104    void  DrawPS(Int_t n, Float_t *xw, Float_t *yw) override;
0105    void  DrawPS(Int_t n, Double_t *xw, Double_t *yw) override;
0106    bool  FontEmbedType1(const char *filename);
0107    bool  FontEmbedType2(const char *filename);
0108    bool  FontEmbedType42(const char *filename);
0109    void  FontEmbed();
0110    void  FontEncode();
0111    void  Initialize();
0112    void  NewPage() override;
0113    void  Off();
0114    void  On();
0115    void  Open(const char *filename, Int_t type=-111) override;
0116    void  SaveRestore(Int_t flag);
0117    void  SetFillColor(Color_t cindex=1) override;
0118    void  SetFillPatterns(Int_t ipat, Int_t color);
0119    void  SetLineColor(Color_t cindex=1) override;
0120    void  SetLineJoin(Int_t linejoin=0);
0121    void  SetLineCap(Int_t linecap=0);
0122    void  SetLineStyle(Style_t linestyle = 1) override;
0123    void  SetLineWidth(Width_t linewidth = 1) override;
0124    void  SetLineScale(Float_t scale=3) {fLineScale = scale;}
0125    void  SetMarkerColor(Color_t cindex=1) override;
0126    void  SetTextColor(Color_t cindex=1) override;
0127    void  MovePS(Int_t x, Int_t y);
0128    void  Range(Float_t xrange, Float_t yrange);
0129    void  SetColor(Int_t color = 1);
0130    void  SetColor(Float_t r, Float_t g, Float_t b) override;
0131    void  Text(Double_t x, Double_t y, const char *string) override;
0132    void  Text(Double_t x, Double_t y, const wchar_t *string) override;
0133    void  TextNDC(Double_t u, Double_t v, const char *string);
0134    void  TextNDC(Double_t u, Double_t v, const wchar_t *string);
0135    Int_t UtoPS(Double_t u);
0136    Int_t VtoPS(Double_t v);
0137    Int_t XtoPS(Double_t x);
0138    Int_t YtoPS(Double_t y);
0139    void  Zone();
0140 
0141    ClassDefOverride(TPostScript,0)  //PostScript driver
0142 };
0143 
0144 #endif