Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TSVG.h
Go to the documentation of this file.
1 // @(#)root/postscript:$Id$
2 // Author: Olivier Couet
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_TSVG
13 #define ROOT_TSVG
14 
15 
16 #include "TVirtualPS.h"
17 
18 class TPoints;
19 
20 class TSVG : public TVirtualPS {
21 
22 protected:
23  Float_t fXsize; ///< Page size along X
24  Float_t fYsize; ///< Page size along Y
25  Int_t fType; ///< Workstation type used to know if the SVG is open
26  Bool_t fBoundingBox; ///< True when the SVG header is printed
27  Bool_t fRange; ///< True when a range has been defined
28  Double_t fYsizeSVG; ///< Page's Y size in SVG units
29 
30 public:
31  TSVG();
32  TSVG(const char *filename, Int_t type=-113);
33  virtual ~TSVG();
34 
35  void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2);
36  void CellArrayFill(Int_t r, Int_t g, Int_t b);
37  void CellArrayEnd();
38  void Close(Option_t *opt="");
39  Double_t CMtoSVG(Double_t u) {return 0.5 + 72*u/2.54;}
40  void DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t y2);
41  void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
42  Int_t mode, Int_t border, Int_t dark, Int_t light);
43  void DrawPolyLine(Int_t n, TPoints *xy);
44  void DrawPolyLineNDC(Int_t n, TPoints *uv);
45  void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y);
46  void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y);
47  void DrawPS(Int_t n, Float_t *xw, Float_t *yw);
48  void DrawPS(Int_t n, Double_t *xw, Double_t *yw);
49  void Initialize();
50  void MovePS(Double_t x, Double_t y);
51  void NewPage();
52  void Off();
53  void On();
54  void Open(const char *filename, Int_t type=-111);
55  void Range(Float_t xrange, Float_t yrange);
56  void SetColorAlpha(Int_t color = 1);
57  void SetColor(Int_t color = 1);
58  void SetColor(Float_t r, Float_t g, Float_t b);
59  void SetFillColor( Color_t cindex=1);
60  void SetLineColor( Color_t cindex=1);
61  void SetLineStyle(Style_t linestyle = 1);
62  void SetLineWidth(Width_t linewidth = 1);
63  void SetLineScale(Float_t =3) { }
64  void SetMarkerColor( Color_t cindex=1);
65  void SetTextColor( Color_t cindex=1);
66  void Text(Double_t x, Double_t y, const char *string);
67  void Text(Double_t, Double_t, const wchar_t *){}
68  void TextNDC(Double_t u, Double_t v, const char *string);
69  void TextNDC(Double_t, Double_t, const wchar_t *){}
70  Double_t UtoSVG(Double_t u);
71  Double_t VtoSVG(Double_t v);
72  Double_t XtoSVG(Double_t x);
73  Double_t YtoSVG(Double_t y);
74 
75  ClassDef(TSVG, 0); //SVG driver
76 };
77 
78 #endif