Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/postscript:$Id$
0002 // Author: Olivier Couet
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_TSVG
0013 #define ROOT_TSVG
0014 
0015 
0016 #include "TVirtualPS.h"
0017 
0018 class TPoints;
0019 
0020 class TSVG : public TVirtualPS {
0021 
0022 protected:
0023    Float_t      fXsize;           ///< Page size along X
0024    Float_t      fYsize;           ///< Page size along Y
0025    Int_t        fType;            ///< Workstation type used to know if the SVG is open
0026    Bool_t       fBoundingBox;     ///< True when the SVG header is printed
0027    Bool_t       fRange;           ///< True when a range has been defined
0028    Double_t     fYsizeSVG;        ///< Page's Y size in SVG units
0029 
0030    static Int_t fgLineJoin;       ///< Appearance of joining lines
0031    static Int_t fgLineCap;        ///< Appearance of line caps
0032 
0033 public:
0034    TSVG();
0035    TSVG(const char *filename, Int_t type=-113);
0036    ~TSVG() override;
0037 
0038    void  CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override;
0039    void  CellArrayFill(Int_t r, Int_t g, Int_t b) override;
0040    void  CellArrayEnd() override;
0041    void  Close(Option_t *opt="") override;
0042    Double_t CMtoSVG(Double_t u) { return 0.5 + 72*u/2.54; }
0043    void  DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t  y2) override;
0044    void  DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t  yt,
0045                    Int_t mode, Int_t border, Int_t dark, Int_t light) override;
0046    void  DrawPolyLine(Int_t n, TPoints *xy);
0047    void  DrawPolyLineNDC(Int_t n, TPoints *uv);
0048    void  DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override;
0049    void  DrawPolyMarker(Int_t n, Double_t *x, Double_t *y) override;
0050    void  DrawPS(Int_t n, Float_t *xw, Float_t *yw) override;
0051    void  DrawPS(Int_t n, Double_t *xw, Double_t *yw) override;
0052    void  Initialize();
0053    void  MovePS(Double_t x, Double_t y);
0054    void  NewPage() override;
0055    void  Off();
0056    void  On();
0057    void  Open(const char *filename, Int_t type=-111) override;
0058    void  Range(Float_t xrange, Float_t yrange);
0059    void  SetColorAlpha(Int_t color = 1);
0060    void  SetColor(Int_t color = 1);
0061    void  SetColor(Float_t r, Float_t g, Float_t b) override;
0062    void  SetFillColor(Color_t cindex=1) override;
0063    void  SetLineColor(Color_t cindex=1) override;
0064    void  SetLineJoin(Int_t linejoin=0);
0065    void  SetLineCap(Int_t linecap=0);
0066    void  SetLineStyle(Style_t linestyle = 1) override;
0067    void  SetLineWidth(Width_t linewidth = 1) override;
0068    void  SetLineScale(Float_t =3) { }
0069    void  SetMarkerColor(Color_t cindex=1) override;
0070    void  SetTextColor(Color_t cindex=1) override;
0071    void  Text(Double_t x, Double_t y, const char *string)  override;
0072    void  Text(Double_t, Double_t, const wchar_t *) override {}
0073    void  TextNDC(Double_t u, Double_t v, const char *string);
0074    void  TextNDC(Double_t, Double_t, const wchar_t *) {}
0075    Double_t UtoSVG(Double_t u);
0076    Double_t VtoSVG(Double_t v);
0077    Double_t XtoSVG(Double_t x);
0078    Double_t YtoSVG(Double_t y);
0079 
0080    ClassDefOverride(TSVG, 0);  //SVG driver
0081 };
0082 
0083 #endif