13#pragma optimize("",off)
119 Warning(
"Open",
"SVG file already open");
133 ww *=
gPad->GetWNDC();
145 printf(
"ERROR in TSVG::Open: Cannot open file:%s\n",
fname);
196 Error(
"On",
"no SVG file open");
279 PrintFast(21,
"\" fill=\"none\" stroke=");
322 for (i=1; i<7; i++) {
330 if( idx ) {
MovePS(idx,0); idx = 0; }
337 if( !idx ) { idx = ix;
continue;}
347 if( idx ) {
MovePS(idx,0); idx = 0; }
348 if( !
idy) {
idy = iy;
continue;}
398 if( idx ) {
MovePS(idx,0); idx = 0; }
405 if( !idx ) { idx = ix;
continue;}
415 if( idx ) {
MovePS(idx,0); idx = 0; }
416 if( !
idy) {
idy = iy;
continue;}
480 if( idx ) {
MovePS(idx,0); idx = 0; }
487 if( !idx ) { idx = ix;
continue;}
497 if( idx ) {
MovePS(idx,0); idx = 0; }
498 if( !
idy) {
idy = iy;
continue;}
554 if( idx ) {
MovePS(idx,0); idx = 0; }
561 if( !idx ) { idx = ix;
continue;}
571 if( idx ) {
MovePS(idx,0); idx = 0; }
572 if( !
idy) {
idy = iy;
continue;}
600 else if (ms >= 6 && ms <= 8)
602 else if (ms >= 9 && ms <= 19)
626 if ((ms > 19 && ms < 24) || ms == 29 || ms == 33 || ms == 34 ||
627 ms == 39 || ms == 41 || ms == 43 || ms == 45 ||
628 ms == 47 || ms == 48 || ms == 49) {
661 }
else if (ms == 2) {
682 }
else if (ms == 5) {
703 }
else if (ms == 3 || ms == 31) {
744 }
else if (ms == 24 || ms == 20) {
755 }
else if (ms == 25 || ms == 21) {
767 }
else if (ms == 26 || ms == 22) {
774 }
else if (ms == 23 || ms == 32) {
781 }
else if (ms == 27 || ms == 33) {
789 }
else if (ms == 28 || ms == 34) {
804 }
else if (ms == 29 || ms == 30) {
817 }
else if (ms == 35) {
828 }
else if (ms == 36) {
839 }
else if (ms == 37 || ms == 39) {
852 }
else if (ms == 38) {
870 }
else if (ms == 40 || ms == 41) {
886 }
else if (ms == 42 || ms == 43) {
898 }
else if (ms == 44) {
912 }
else if (ms == 45) {
928 }
else if (ms == 46 || ms == 47) {
944 }
else if (ms == 48) {
964 }
else if (ms == 49) {
1009 else if (ms >= 6 && ms <= 8)
1011 else if (ms >= 9 && ms <= 19)
1035 if ((ms > 19 && ms < 24) || ms == 29 || ms == 33 || ms == 34 ||
1036 ms == 39 || ms == 41 || ms == 43 || ms == 45 ||
1037 ms == 47 || ms == 48 || ms == 49) {
1054 for (
Int_t i=0;i<
n;i++) {
1070 }
else if (ms == 2) {
1091 }
else if (ms == 5) {
1112 }
else if (ms == 3 || ms == 31) {
1153 }
else if (ms == 24 || ms == 20) {
1163 }
else if (ms == 25 || ms == 21) {
1174 }
else if (ms == 26 || ms == 22) {
1181 }
else if (ms == 23 || ms == 32) {
1188 }
else if (ms == 27 || ms == 33) {
1196 }
else if (ms == 28 || ms == 34) {
1211 }
else if (ms == 29 || ms == 30) {
1224 }
else if (ms == 35) {
1235 }
else if (ms == 36) {
1246 }
else if (ms == 37 || ms == 39) {
1259 }
else if (ms == 38) {
1277 }
else if (ms == 40 || ms == 41) {
1293 }
else if (ms == 42 || ms == 43) {
1305 }
else if (ms == 44) {
1319 }
else if (ms == 45) {
1335 }
else if (ms == 46 || ms == 47) {
1351 }
else if (ms == 48) {
1371 }
else if (ms == 49) {
1436 Error(
"DrawPS",
"Two points are needed");
1450 for (
Int_t i=1;i<
n;i++) {
1462 if( idx ) {
MovePS(idx,0); idx = 0; }
1467 if( !idx ) { idx = ix;}
1469 else {
MovePS(idx,0); idx = ix;}
1471 if( idx ) {
MovePS(idx,0); idx = 0;}
1482 PrintFast(21,
"\" fill=\"none\" stroke=");
1562 auto a = std::abs(
r);
1569 snprintf(str, 15, (
a > 1) ?
"%3.1f" :
"%5.3f",
r);
1586 if (ix != 0 && iy != 0) {
1591 }
else if (ix != 0) {
1594 }
else if (iy != 0) {
1618 PrintStr(
"@<?xml version=\"1.0\" standalone=\"no\"?>");
1627 PrintStr(
"\" xmlns=\"http://www.w3.org/2000/svg\" shape-rendering=\"crispEdges\">");
1742 if (color < 0) color = 0;
1758 if (color < 0) color = 0;
1776 if (
r <= 0. &&
g <= 0. &&
b <= 0. ) {
1778 }
else if (
r >= 1. &&
g >= 1. &&
b >= 1. ) {
1807 "Times" ,
"Times" ,
"Times",
1808 "Helvetica",
"Helvetica",
"Helvetica" ,
"Helvetica",
1809 "Courier" ,
"Courier" ,
"Courier" ,
"Courier",
1810 "Times" ,
"Times" ,
"ZapfDingbats",
"Times"};
1813 "normal",
"bold",
"bold",
1814 "normal",
"normal",
"bold" ,
"bold",
1815 "normal",
"normal",
"bold" ,
"bold",
1816 "normal",
"normal",
"normal",
"normal"};
1819 "italic",
"normal" ,
"italic",
1820 "normal",
"oblique",
"normal",
"oblique",
1821 "normal",
"oblique",
"normal",
"oblique",
1822 "normal",
"normal" ,
"normal",
"italic"};
1837 if (font > 15 || font < 1)
1864 PrintFast(30,
"<text xml:space=\"preserve\" x=\"");
1870 PrintFast(21,
" text-anchor=\"middle\"");
1871 }
else if (
txalh == 3) {
1890 if (font == 12 || font == 15) {
2005 if (
chars[i]!=
'\n') {
2006 if (
chars[i]==
'<') {
2008 }
else if (
chars[i]==
'>') {
2010 }
else if (
chars[i]==
'\305') {
2012 }
else if (
chars[i]==
'\345') {
2014 }
else if (
chars[i]==
'&') {
2048 return 0.5 + 72*cm/2.54;
2057 return 0.5 + 72*cm/2.54;
2084 Warning(
"TSVG::CellArrayBegin",
"not yet implemented");
2092 Warning(
"TSVG::CellArrayFill",
"not yet implemented");
2100 Warning(
"TSVG::CellArrayEnd",
"not yet implemented");
2108 Warning(
"TSVG::DrawPS",
"not yet implemented");
short Style_t
Style number (short)
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
short Width_t
Line width (short)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TStyle * gStyle
R__EXTERN TVirtualPS * gVirtualPS
Style_t fFillStyle
Fill area style.
Color_t fFillColor
Fill area color.
Width_t fLineWidth
Line width.
Style_t fLineStyle
Line style.
Color_t fLineColor
Line color.
Color_t fMarkerColor
Marker color.
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
Size_t fMarkerSize
Marker size.
Style_t fMarkerStyle
Marker style.
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
Color_t fTextColor
Text color.
Float_t fTextAngle
Text angle.
Font_t fTextFont
Text font.
Short_t fTextAlign
Text alignment.
Float_t fTextSize
Text size.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsString() const
Return the date & time as a string (ctime() format).
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
Collectable string class.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
2-D graphics point (world coordinates).
static Int_t fgLineJoin
Appearance of joining lines.
Double_t UtoSVG(Double_t u)
Convert U from NDC coordinate to SVG.
void MovePS(Double_t x, Double_t y)
Move to a new position (ix, iy).
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) override
Draw a Frame around a box.
Double_t fYsizeSVG
Page's Y size in SVG units.
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override
Paint PolyMarker.
void Close(Option_t *opt="") override
Close a SVG file.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Bool_t fRange
True when a range has been defined.
void Text(Double_t x, Double_t y, const char *string) override
Draw text.
Double_t YtoSVG(Double_t y)
Convert Y from world coordinate to SVG.
void SetFillColor(Color_t cindex=1) override
Set color index for fill areas.
void SetLineWidth(Width_t linewidth=1) override
Set the lines width.
void Initialize()
Initialize the SVG file.
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
Not needed in SVG case.
void CellArrayEnd() override
End the Cell Array painting.
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Paint the Cell Array.
void NewPage() override
Start the SVG page.
void SetColor(Int_t color=1)
Set RGB (without alpha channel) color with its color index.
Int_t fType
Workstation type used to know if the SVG is open.
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TSVG::fgLineCap.
void Off()
Deactivate an already open SVG file.
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimetres.
void SetLineScale(Float_t=3)
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override
Begin the Cell Array painting.
void SetLineStyle(Style_t linestyle=1) override
Change the line style.
void On()
Activate an already open SVG file.
TSVG()
Default SVG constructor.
void SetTextColor(Color_t cindex=1) override
Set color index for text.
Double_t CMtoSVG(Double_t u)
Double_t XtoSVG(Double_t x)
Convert X from world coordinate to SVG.
Bool_t fCompact
True when the SVG header is printed.
Bool_t fBoundingBox
True when the SVG header is printed.
Float_t fXsize
Page size along X.
void SetMarkerColor(Color_t cindex=1) override
Set color index for markers.
Float_t fYsize
Page size along Y.
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
~TSVG() override
Default SVG destructor.
void SetColorAlpha(Int_t color=1)
Set RGBa color with its color index.
void SetLineColor(Color_t cindex=1) override
Set color index for lines.
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TSVG::fgLineJoin.
void Open(const char *filename, Int_t type=-111) override
Open a SVG file.
void WriteReal(Float_t r, Bool_t space=kTRUE) override
Write float value into output stream In compact form try to store only first 2-3 significant digits.
static Int_t fgLineCap
Appearance of line caps.
Double_t VtoSVG(Double_t v)
Convert V from NDC coordinate to SVG.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Int_t GetJoinLinePS() const
Returns the line join method used for PostScript, PDF and SVG output. See TPostScript::SetLineJoin fo...
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Int_t GetCapLinePS() const
Returns the line cap method used for PostScript, PDF and SVG output. See TPostScript::SetLineCap for ...
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
const char * GetHeaderPS() const
Float_t GetLineScalePS() const
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
virtual void PrintStr(const char *string="")
Output the string str in the output buffer.
virtual void PrintFast(Int_t nch, const char *string="")
Fast version of Print.
virtual void WriteReal(Float_t r, Bool_t space=kTRUE)
Write a Real number to the file.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.