Logo ROOT   6.08/07
Reference Guide
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 #ifndef ROOT_TVirtualPS
17 #include "TVirtualPS.h"
18 #endif
19 
20 class TPoints;
21 
22 class TSVG : public TVirtualPS {
23 
24 protected:
25  Float_t fXsize; ///< Page size along X
26  Float_t fYsize; ///< Page size along Y
27  Int_t fType; ///< Workstation type used to know if the SVG is open
28  Bool_t fBoundingBox; ///< True when the SVG header is printed
29  Bool_t fRange; ///< True when a range has been defined
30  Double_t fYsizeSVG; ///< Page's Y size in SVG units
31 
32 public:
33  TSVG();
34  TSVG(const char *filename, Int_t type=-113);
35  virtual ~TSVG();
36 
38  void CellArrayFill(Int_t r, Int_t g, Int_t b);
39  void CellArrayEnd();
40  void Close(Option_t *opt="");
41  Double_t CMtoSVG(Double_t u) {return 0.5 + 72*u/2.54;}
43  void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
44  Int_t mode, Int_t border, Int_t dark, Int_t light);
45  void DrawPolyLine(Int_t n, TPoints *xy);
46  void DrawPolyLineNDC(Int_t n, TPoints *uv);
47  void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y);
48  void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y);
49  void DrawPS(Int_t n, Float_t *xw, Float_t *yw);
50  void DrawPS(Int_t n, Double_t *xw, Double_t *yw);
51  void Initialize();
52  void MovePS(Double_t x, Double_t y);
53  void NewPage();
54  void Off();
55  void On();
56  void Open(const char *filename, Int_t type=-111);
57  void Range(Float_t xrange, Float_t yrange);
58  void SetColor(Int_t color = 1);
59  void SetColor(Float_t r, Float_t g, Float_t b);
60  void SetFillColor( Color_t cindex=1);
61  void SetLineColor( Color_t cindex=1);
62  void SetLineStyle(Style_t linestyle = 1);
63  void SetLineWidth(Width_t linewidth = 1);
64  void SetLineScale(Float_t =3) { }
65  void SetMarkerColor( Color_t cindex=1);
66  void SetTextColor( Color_t cindex=1);
67  void Text(Double_t x, Double_t y, const char *string);
68  void Text(Double_t, Double_t, const wchar_t *){}
69  void TextNDC(Double_t u, Double_t v, const char *string);
70  void TextNDC(Double_t, Double_t, const wchar_t *){}
75 
76  ClassDef(TSVG, 0); //SVG driver
77 };
78 
79 #endif
void SetLineColor(Color_t cindex=1)
Set color index for lines.
Definition: TSVG.cxx:1289
void On()
Activate an already open SVG file.
Definition: TSVG.cxx:181
short Style_t
Definition: RtypesCore.h:76
Double_t UtoSVG(Double_t u)
Convert U from NDC coordinate to SVG.
Definition: TSVG.cxx:1616
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
void SetFillColor(Color_t cindex=1)
Set color index for fill areas.
Definition: TSVG.cxx:1280
void Text(Double_t x, Double_t y, const char *string)
Draw text.
Definition: TSVG.cxx:1376
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)
Draw a Frame around a box.
Definition: TSVG.cxx:285
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
Definition: TSVG.cxx:205
Int_t fType
Workstation type used to know if the SVG is open.
Definition: TSVG.h:27
#define H(x, y, z)
Double_t fYsizeSVG
Page&#39;s Y size in SVG units.
Definition: TSVG.h:30
void Off()
Deactivate an already open SVG file.
Definition: TSVG.cxx:197
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Double_t CMtoSVG(Double_t u)
Definition: TSVG.h:41
void SetLineStyle(Style_t linestyle=1)
Change the line style.
Definition: TSVG.cxx:1302
void SetMarkerColor(Color_t cindex=1)
Set color index for markers.
Definition: TSVG.cxx:1318
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
Begin the Cell Array painting.
Definition: TSVG.cxx:1652
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Definition: TSVG.cxx:1606
void NewPage()
Start the SVG page.
Definition: TSVG.cxx:1195
static const double x2[5]
Double_t x[n]
Definition: legend1.C:17
void SetTextColor(Color_t cindex=1)
Set color index for text.
Definition: TSVG.cxx:1364
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t XtoSVG(Double_t x)
Convert X from world coordinate to SVG.
Definition: TSVG.cxx:1634
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Not needed in SVG case.
Definition: TSVG.cxx:1677
void SetLineScale(Float_t=3)
Definition: TSVG.h:64
TSVG()
Default SVG constructor.
Definition: TSVG.cxx:77
Float_t fXsize
Page size along X.
Definition: TSVG.h:25
short Color_t
Definition: RtypesCore.h:79
void Close(Option_t *opt="")
Close a SVG file.
Definition: TSVG.cxx:165
TRandom2 r(17)
void SetLineWidth(Width_t linewidth=1)
Set the lines width.
Definition: TSVG.cxx:1310
SVector< double, 2 > v
Definition: Dict.h:5
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Paint PolyMarker.
Definition: TSVG.cxx:568
Interface to SVG.
Definition: TSVG.h:22
short Width_t
Definition: RtypesCore.h:78
Bool_t fBoundingBox
True when the SVG header is printed.
Definition: TSVG.h:28
virtual ~TSVG()
Default SVG destructor.
Definition: TSVG.cxx:157
2-D graphics point (world coordinates).
Definition: TPoints.h:21
void SetColor(Int_t color=1)
Set color with its color index.
Definition: TSVG.cxx:1326
static const double x1[5]
double Double_t
Definition: RtypesCore.h:55
void CellArrayEnd()
End the Cell Array painting.
Definition: TSVG.cxx:1669
int type
Definition: TGX11.cxx:120
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
Definition: TSVG.cxx:1661
Double_t y[n]
Definition: legend1.C:17
void Text(Double_t, Double_t, const wchar_t *)
Definition: TSVG.h:68
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimetres.
Definition: TSVG.cxx:1227
void Open(const char *filename, Int_t type=-111)
Open a SVG file.
Definition: TSVG.cxx:109
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Definition: TSVG.cxx:433
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:40
void MovePS(Double_t x, Double_t y)
Move to a new position (ix, iy).
Definition: TSVG.cxx:1174
Float_t fYsize
Page size along Y.
Definition: TSVG.h:26
Bool_t fRange
True when a range has been defined.
Definition: TSVG.h:29
Double_t VtoSVG(Double_t v)
Convert V from NDC coordinate to SVG.
Definition: TSVG.cxx:1625
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
Definition: TSVG.cxx:504
const Int_t n
Definition: legend1.C:16
void TextNDC(Double_t, Double_t, const wchar_t *)
Definition: TSVG.h:70
void Initialize()
Initialize the SVG file.
Definition: TSVG.cxx:1139
Double_t YtoSVG(Double_t y)
Convert Y from world coordinate to SVG.
Definition: TSVG.cxx:1643