Logo ROOT  
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 #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  static Int_t fgLineJoin; ///< Appearance of joining lines
31  static Int_t fgLineCap; ///< Appearance of line caps
32 
33 public:
34  TSVG();
35  TSVG(const char *filename, Int_t type=-113);
36  virtual ~TSVG();
37 
39  void CellArrayFill(Int_t r, Int_t g, Int_t b);
40  void CellArrayEnd();
41  void Close(Option_t *opt="");
42  Double_t CMtoSVG(Double_t u) {return 0.5 + 72*u/2.54;}
44  void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
45  Int_t mode, Int_t border, Int_t dark, Int_t light);
46  void DrawPolyLine(Int_t n, TPoints *xy);
47  void DrawPolyLineNDC(Int_t n, TPoints *uv);
50  void DrawPS(Int_t n, Float_t *xw, Float_t *yw);
51  void DrawPS(Int_t n, Double_t *xw, Double_t *yw);
52  void Initialize();
53  void MovePS(Double_t x, Double_t y);
54  void NewPage();
55  void Off();
56  void On();
57  void Open(const char *filename, Int_t type=-111);
58  void Range(Float_t xrange, Float_t yrange);
59  void SetColorAlpha(Int_t color = 1);
60  void SetColor(Int_t color = 1);
62  void SetFillColor( Color_t cindex=1);
63  void SetLineColor( Color_t cindex=1);
64  void SetLineJoin(Int_t linejoin=0);
65  void SetLineCap(Int_t linecap=0);
66  void SetLineStyle(Style_t linestyle = 1);
67  void SetLineWidth(Width_t linewidth = 1);
68  void SetLineScale(Float_t =3) { }
69  void SetMarkerColor( Color_t cindex=1);
70  void SetTextColor( Color_t cindex=1);
71  void Text(Double_t x, Double_t y, const char *string);
72  void Text(Double_t, Double_t, const wchar_t *){}
73  void TextNDC(Double_t u, Double_t v, const char *string);
74  void TextNDC(Double_t, Double_t, const wchar_t *){}
79 
80  ClassDef(TSVG, 0); //SVG driver
81 };
82 
83 #endif
TVirtualPS
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:30
TSVG::fXsize
Float_t fXsize
Page size along X.
Definition: TSVG.h:23
n
const Int_t n
Definition: legend1.C:16
TSVG::fgLineJoin
static Int_t fgLineJoin
Appearance of joining lines.
Definition: TSVG.h:30
TSVG::~TSVG
virtual ~TSVG()
Default SVG destructor.
Definition: TSVG.cxx:163
TSVG::DrawPS
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Not needed in SVG case.
Definition: TSVG.cxx:2107
Style_t
short Style_t
Definition: RtypesCore.h:80
H
#define H(x, y, z)
TSVG
Interface to SVG.
Definition: TSVG.h:20
Option_t
const char Option_t
Definition: RtypesCore.h:66
TSVG::CellArrayFill
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
Definition: TSVG.cxx:2091
TSVG::DrawPolyMarker
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Paint PolyMarker.
Definition: TSVG.cxx:582
TSVG::fBoundingBox
Bool_t fBoundingBox
True when the SVG header is printed.
Definition: TSVG.h:26
TSVG::SetColor
void SetColor(Int_t color=1)
Set RGB (without alpha channel) color with its color index.
Definition: TSVG.cxx:1759
r
ROOT::R::TRInterface & r
Definition: Object.C:4
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
TSVG::Text
void Text(Double_t, Double_t, const wchar_t *)
Definition: TSVG.h:72
TSVG::Open
void Open(const char *filename, Int_t type=-111)
Open a SVG file.
Definition: TSVG.cxx:113
x
Double_t x[n]
Definition: legend1.C:17
TSVG::CellArrayEnd
void CellArrayEnd()
End the Cell Array painting.
Definition: TSVG.cxx:2099
TSVG::fRange
Bool_t fRange
True when a range has been defined.
Definition: TSVG.h:27
TVirtualPS.h
TSVG::TextNDC
void TextNDC(Double_t, Double_t, const wchar_t *)
Definition: TSVG.h:74
TSVG::DrawPolyLineNDC
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
Definition: TSVG.cxx:518
TSVG::Range
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimetres.
Definition: TSVG.cxx:1596
Color_t
short Color_t
Definition: RtypesCore.h:83
v
@ v
Definition: rootcling_impl.cxx:3635
b
#define b(i)
Definition: RSha256.hxx:100
bool
TSVG::fgLineCap
static Int_t fgLineCap
Appearance of line caps.
Definition: TSVG.h:31
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
xy
XPoint xy[kMAXMK]
Definition: TGX11.cxx:123
TSVG::Initialize
void Initialize()
Initialize the SVG file.
Definition: TSVG.cxx:1508
TSVG::DrawPolyLine
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Definition: TSVG.cxx:447
TSVG::MovePS
void MovePS(Double_t x, Double_t y)
Move to a new position (ix, iy).
Definition: TSVG.cxx:1543
TSVG::SetLineColor
void SetLineColor(Color_t cindex=1)
Set color index for lines.
Definition: TSVG.cxx:1658
TSVG::Text
void Text(Double_t x, Double_t y, const char *string)
Draw text.
Definition: TSVG.cxx:1807
TSVG::On
void On()
Activate an already open SVG file.
Definition: TSVG.cxx:187
TSVG::SetLineJoin
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TSVG::fgLineJoin.
Definition: TSVG.cxx:1680
Width_t
short Width_t
Definition: RtypesCore.h:82
TSVG::fYsize
Float_t fYsize
Page size along Y.
Definition: TSVG.h:24
TSVG::VtoSVG
Double_t VtoSVG(Double_t v)
Convert V from NDC coordinate to SVG.
Definition: TSVG.cxx:2055
TSVG::YtoSVG
Double_t YtoSVG(Double_t y)
Convert Y from world coordinate to SVG.
Definition: TSVG.cxx:2073
y
Double_t y[n]
Definition: legend1.C:17
TSVG::DrawFrame
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:291
TSVG::fType
Int_t fType
Workstation type used to know if the SVG is open.
Definition: TSVG.h:25
TSVG::DrawBox
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
Definition: TSVG.cxx:211
TSVG::UtoSVG
Double_t UtoSVG(Double_t u)
Convert U from NDC coordinate to SVG.
Definition: TSVG.cxx:2046
TSVG::CellArrayBegin
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:2082
TSVG::NewPage
void NewPage()
Start the SVG page.
Definition: TSVG.cxx:1564
TSVG::SetFillColor
void SetFillColor(Color_t cindex=1)
Set color index for fill areas.
Definition: TSVG.cxx:1649
Double_t
double Double_t
Definition: RtypesCore.h:59
TSVG::Off
void Off()
Deactivate an already open SVG file.
Definition: TSVG.cxx:203
TSVG::CMtoSVG
Double_t CMtoSVG(Double_t u)
Definition: TSVG.h:42
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TSVG::XtoSVG
Double_t XtoSVG(Double_t x)
Convert X from world coordinate to SVG.
Definition: TSVG.cxx:2064
TSVG::TSVG
TSVG()
Default SVG constructor.
Definition: TSVG.cxx:81
TSVG::SetLineStyle
void SetLineStyle(Style_t linestyle=1)
Change the line style.
Definition: TSVG.cxx:1719
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
TSVG::fYsizeSVG
Double_t fYsizeSVG
Page's Y size in SVG units.
Definition: TSVG.h:28
TSVG::SetLineScale
void SetLineScale(Float_t=3)
Definition: TSVG.h:68
TSVG::SetColorAlpha
void SetColorAlpha(Int_t color=1)
Set RGBa color with its color index.
Definition: TSVG.cxx:1743
type
int type
Definition: TGX11.cxx:121
TSVG::SetLineWidth
void SetLineWidth(Width_t linewidth=1)
Set the lines width.
Definition: TSVG.cxx:1727
TSVG::SetMarkerColor
void SetMarkerColor(Color_t cindex=1)
Set color index for markers.
Definition: TSVG.cxx:1735
TSVG::TextNDC
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Definition: TSVG.cxx:2036
TSVG::Close
void Close(Option_t *opt="")
Close a SVG file.
Definition: TSVG.cxx:171
int
TSVG::SetLineCap
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TSVG::fgLineCap.
Definition: TSVG.cxx:1704
TSVG::SetTextColor
void SetTextColor(Color_t cindex=1)
Set color index for text.
Definition: TSVG.cxx:1795
TPoints
2-D graphics point (world coordinates).
Definition: TPoints.h:19
g
#define g(i)
Definition: RSha256.hxx:105