library: libPostscript #include "TSVG.h" |
Inheritance Chart: | |||||||||||||||||||||||||
|
public:
TSVG() TSVG(const char* filename, Int_t type = -113) TSVG(const TSVG&) virtual ~TSVG() virtual void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) virtual void CellArrayEnd() virtual void CellArrayFill(Int_t r, Int_t g, Int_t b) static TClass* Class() virtual void Close(Option_t* opt) Int_t CMtoSVG(Double_t u) virtual void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) virtual 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) void DrawPolyLine(Int_t n, TPoints* xy) void DrawPolyLineNDC(Int_t n, TPoints* uv) virtual void DrawPolyMarker(Int_t n, Float_t* x, Float_t* y) virtual void DrawPolyMarker(Int_t n, Double_t* x, Double_t* y) virtual void DrawPS(Int_t n, Float_t* xw, Float_t* yw) virtual void DrawPS(Int_t n, Double_t* xw, Double_t* yw) void Initialize() virtual TClass* IsA() const void MovePS(Int_t x, Int_t y) virtual void NewPage() void Off() void On() virtual void Open(const char* filename, Int_t type = -111) TSVG& operator=(const TSVG&) void Range(Float_t xrange, Float_t yrange) void SetColor(Int_t color = 1) virtual void SetColor(Float_t r, Float_t g, Float_t b) virtual void SetFillColor(Color_t cindex = 1) virtual void SetLineColor(Color_t cindex = 1) void SetLineScale(Float_t = 3) virtual void SetLineStyle(Style_t linestyle = 1) virtual void SetLineWidth(Width_t linewidth = 1) virtual void SetMarkerColor(Color_t cindex = 1) virtual void SetTextColor(Color_t cindex = 1) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual void Text(Double_t x, Double_t y, const char* string) void TextNDC(Double_t u, Double_t v, const char* string) Int_t UtoSVG(Double_t u) Int_t VtoSVG(Double_t v) Int_t XtoSVG(Double_t x) Int_t YtoSVG(Double_t y)
protected:
Float_t fXsize Page size along X Float_t fYsize Page size along Y Int_t fType Workstation type used to know if the SVG is open Bool_t fBoundingBox True when the SVG header is printed Bool_t fRange True when a range has been defined Int_t fYsizeSVG Page's Y size in SVG units
The way to access SVG in ROOT (in my private version only) is the following:
TSVG mysvg("myfile.svg") object->Draw(); mysvg.Close();The result is the ASCII file myfile.svg, it is best viewed with Internet Explorer and you need the Adobe SVG Viewer. To zoom using the Adobe SVG Viewer, position the mouse over the area you want to zoom and click the right button. To define the zoom area, use Control+drag to mark the boundaries of the zoom area. To pan, use Alt+drag. By clicking with the right mouse button on the SVG graphics you will get a pop-up menu giving other ways to interact with the image.
SVG files can be used directly in compressed mode to minimize the time transfer over the network. Compressed SVG files should be created using gzip on a normal ASCII SVG file and should then be renamed using the file extension .svgz. */
Default SVG constructor
Initialize the SVG interface fname : SVG file name wtype : SVG workstation type. Not used in the SVG driver. But as TSVG inherits from TVirtualPS it should be kept. Anyway it is not necessary to specify this parameter at creation time because it has a default value (which is ignore in the SVG case).
Open a SVG file
Default SVG destructor
Close a SVG file
Activate an already open SVG file
Deactivate an already open SVG file
Draw a Box
Draw a Frame around a box mode = -1 the box looks as it is behind the screen mode = 1 the box looks as it is in front of the screen border is the border size in already pre-computed SVG units dark is the color for the dark part of the frame light is the color for the light part of the frame
Draw a PolyLine Draw a polyline through the points xy. If NN=1 moves only to point x,y. If NN=0 the x,y are written in the SVG file according to the current transformation. If NN>0 the line is clipped as a line. If NN<0 the line is clipped as a fill area.
Draw a PolyLine in NDC space Draw a polyline through the points xy. If NN=1 moves only to point x,y. If NN=0 the x,y are written in the SVG file according to the current transformation. If NN>0 the line is clipped as a line. If NN<0 the line is clipped as a fill area.
This function defines a path with xw and yw and draw it according the value of nn: If nn>0 a line is drawn. If nn<0 a closed polygon is drawn.
Initialize the SVG file. The main task of the function is to ouput the SVG header file which consist in <title>, <desc> and <defs>. The HeaderPS provided by the user program is written in the <defs> part.
Move to a new position (ix, iy). The move is done in relative coordinates which allows to have short numbers which decrease the size of the file. This function use the full power of the SVG's paths by using the horizontal and vertical move whenever it is possible.
Start the SVG page. This function initialize the pad conversion coefficients and ouput the <svg> directive which is close later in the the function Close.
Set the range for the paper in centimetres
Set color index for fill areas
Set color index for lines
Change the line style linestyle = 2 dashed = 3 dotted = 4 dash-dotted = else solid (1 in is used most of the time)
Set the lines width.
Set color index for markers.
Set color with its color index
Set color with its R G B components r: % of red in [0,1] g: % of green in [0,1] b: % of blue in [0,1]
Set color index for text
Draw text xx: x position of the text yy: y position of the text chars: text to be drawn
Write a string of characters in NDC
Convert U from NDC coordinate to SVG
Convert V from NDC coordinate to SVG
Convert X from world coordinate to SVG
Convert Y from world coordinate to SVG
Int_t CMtoSVG(Double_t u) void SetLineScale(Float_t = 3) TClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) TSVG TSVG(const TSVG&) TSVG& operator=(const TSVG&)