13#pragma optimize("",off)
134 Warning(
"Open",
"TeX file already open");
148 ww *=
gPad->GetWNDC();
149 wh *=
gPad->GetHNDC();
153 if (yrange >
fYsize) { yrange =
fYsize; xrange = yrange/ratio;}
158 fStream =
new std::ofstream(fname,std::ios::out);
160 printf(
"ERROR in TTeXDump::Open: Cannot open file:%s\n",fname);
177 PrintStr(
"\\documentclass{standalone}@");
179 PrintStr(
"\\usetikzlibrary{patterns,plotmarks}@");
182 PrintStr(
"%\\documentclass{standalone}@");
184 PrintStr(
"%\\usetikzlibrary{patterns,plotmarks}@");
230 Error(
"On",
"no TeX file open");
261 PrintStr(
"\\draw [color=c, fill=c");
276 if (fillis>1 && fillis<4) {
307 PrintStr(
", draw=none, pattern color=c");
369 Warning(
"DrawFrame",
"not yet implemented");
384 Warning(
"DrawPolyLine",
"not yet implemented");
399 Warning(
"DrawPolyLineNDC",
"not yet implemented");
407 Warning(
"DrawPolyMarker",
"not yet implemented");
441 PrintStr(
"}{\\draw[mark options={color=c,fill=c");
516 PrintStr(
"] plot coordinates {\\P};}");
532 Error(
"DrawPS",
"Two points are needed");
551 tikzSpec.
Append(
",dash pattern=");
587 }
else if (fillis==0) {
619 PrintStr(
", draw=none, pattern color=c");
661 PrintStr(
"\\def\\CheckTikzLibraryLoaded#1{ \\ifcsname tikz@library@#1@loaded\\endcsname \\else \\PackageWarning{tikz}{usetikzlibrary{#1} is missing in the preamble.} \\fi }@");
662 PrintStr(
"\\CheckTikzLibraryLoaded{patterns}@");
663 PrintStr(
"\\CheckTikzLibraryLoaded{plotmarks}@");
738 if (color < 0) color = 0;
797 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
801 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
804 if (ftsize <= 0)
return;
820 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
822 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
826 if (txalh!=2 || txalv!=2) {
904 Warning(
"CellArrayBegin",
"not yet implemented");
912 Warning(
"CellArrayFill",
"not yet implemented");
920 Warning(
"CellArrayEnd",
"not yet implemented");
928 Warning(
"DrawPS",
"not yet implemented");
937 PrintStr(
"\\pgfdeclareplotmark{cross} {@");
938 PrintStr(
"\\pgfpathmoveto{\\pgfpoint{-0.3\\pgfplotmarksize}{\\pgfplotmarksize}}@");
939 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+0.3\\pgfplotmarksize}{\\pgfplotmarksize}}@");
940 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+0.3\\pgfplotmarksize}{0.3\\pgfplotmarksize}}@");
941 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+1\\pgfplotmarksize}{0.3\\pgfplotmarksize}}@");
942 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+1\\pgfplotmarksize}{-0.3\\pgfplotmarksize}}@");
943 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+0.3\\pgfplotmarksize}{-0.3\\pgfplotmarksize}}@");
944 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+0.3\\pgfplotmarksize}{-1.\\pgfplotmarksize}}@");
945 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-0.3\\pgfplotmarksize}{-1.\\pgfplotmarksize}}@");
946 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-0.3\\pgfplotmarksize}{-0.3\\pgfplotmarksize}}@");
947 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-1.\\pgfplotmarksize}{-0.3\\pgfplotmarksize}}@");
948 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-1.\\pgfplotmarksize}{0.3\\pgfplotmarksize}}@");
949 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-0.3\\pgfplotmarksize}{0.3\\pgfplotmarksize}}@");
955 PrintStr(
"\\pgfdeclareplotmark{cross*} {@");
956 PrintStr(
"\\pgfpathmoveto{\\pgfpoint{-0.3\\pgfplotmarksize}{\\pgfplotmarksize}}@");
957 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+0.3\\pgfplotmarksize}{\\pgfplotmarksize}}@");
958 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+0.3\\pgfplotmarksize}{0.3\\pgfplotmarksize}}@");
959 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+1\\pgfplotmarksize}{0.3\\pgfplotmarksize}}@");
960 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+1\\pgfplotmarksize}{-0.3\\pgfplotmarksize}}@");
961 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+0.3\\pgfplotmarksize}{-0.3\\pgfplotmarksize}}@");
962 PrintStr(
"\\pgfpathlineto{\\pgfpoint{+0.3\\pgfplotmarksize}{-1.\\pgfplotmarksize}}@");
963 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-0.3\\pgfplotmarksize}{-1.\\pgfplotmarksize}}@");
964 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-0.3\\pgfplotmarksize}{-0.3\\pgfplotmarksize}}@");
965 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-1.\\pgfplotmarksize}{-0.3\\pgfplotmarksize}}@");
966 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-1.\\pgfplotmarksize}{0.3\\pgfplotmarksize}}@");
967 PrintStr(
"\\pgfpathlineto{\\pgfpoint{-0.3\\pgfplotmarksize}{0.3\\pgfplotmarksize}}@");
969 PrintStr(
"\\pgfusepathqfillstroke@");
973 PrintStr(
"\\pgfdeclareplotmark{newstar} {@");
974 PrintStr(
"\\pgfpathmoveto{\\pgfqpoint{0pt}{\\pgfplotmarksize}}@");
975 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{44}{0.5\\pgfplotmarksize}}@");
976 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{18}{\\pgfplotmarksize}}@");
977 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{-20}{0.5\\pgfplotmarksize}}@");
978 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{-54}{\\pgfplotmarksize}}@");
979 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{-90}{0.5\\pgfplotmarksize}}@");
980 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{234}{\\pgfplotmarksize}}@");
981 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{198}{0.5\\pgfplotmarksize}}@");
982 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{162}{\\pgfplotmarksize}}@");
983 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{134}{0.5\\pgfplotmarksize}}@");
989 PrintStr(
"\\pgfdeclareplotmark{newstar*} {@");
990 PrintStr(
"\\pgfpathmoveto{\\pgfqpoint{0pt}{\\pgfplotmarksize}}@");
991 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{44}{0.5\\pgfplotmarksize}}@");
992 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{18}{\\pgfplotmarksize}}@");
993 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{-20}{0.5\\pgfplotmarksize}}@");
994 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{-54}{\\pgfplotmarksize}}@");
995 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{-90}{0.5\\pgfplotmarksize}}@");
996 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{234}{\\pgfplotmarksize}}@");
997 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{198}{0.5\\pgfplotmarksize}}@");
998 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{162}{\\pgfplotmarksize}}@");
999 PrintStr(
"\\pgfpathlineto{\\pgfqpointpolar{134}{0.5\\pgfplotmarksize}}@");
1001 PrintStr(
"\\pgfusepathqfillstroke@");
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 on
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
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.
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",...
const char * GetTitle() const override
Returns title of object.
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).
Int_t Atoi() const
Return integer value of string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Prepend(const char *cs)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
Float_t GetLineScalePS() const
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Paint the Cell Array.
void SetLineStyle(Style_t linestyle=1) override
Change the line style.
void SetLineScale(Float_t scale=1)
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
Not needed in TeX case.
void Close(Option_t *opt="") override
Close a TeX file.
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
void On()
Activate an already open TeX file.
void Open(const char *filename, Int_t type=-111) override
Open a TeX file.
Bool_t fStandalone
True when a TeX file should be standalone.
void DefineMarkers()
add additional pgfplotmarks
Bool_t fBoundingBox
True when the TeX header is printed.
Float_t fCurrentRed
Current Red component.
Float_t fXsize
Page size along X.
void SetLineWidth(Width_t linewidth=1) override
Set the lines width.
Float_t VtoTeX(Double_t v)
Convert V from NDC coordinate to TeX.
void NewPage() override
Start the TeX page. This function starts the tikzpicture environment.
Bool_t fRange
True when a range has been defined.
void SetFillColor(Color_t cindex=1) override
Set color index for fill areas.
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.
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override
Paint PolyMarker.
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimetres.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
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 SetTextColor(Color_t cindex=1) override
Set color index for text.
void SetLineColor(Color_t cindex=1) override
Set color index for lines.
Float_t fCurrentAlpha
Current Alpha value.
void CellArrayEnd() override
End the Cell Array painting.
virtual ~TTeXDump()
Default TeX destructor.
Float_t fLineScale
Line width scale factor.
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Int_t fType
Workstation type used to know if the Tex is open.
Float_t UtoTeX(Double_t u)
Convert U from NDC coordinate to TeX.
Float_t YtoTeX(Double_t y)
Convert Y from world coordinate to TeX.
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
void Off()
Deactivate an already open TeX file.
TTeXDump()
Default TeX constructor.
Float_t fCurrentGreen
Current Green component.
Float_t fYsize
Page size along Y.
void Text(Double_t x, Double_t y, const char *string) override
Draw text.
void SetMarkerSize(Size_t msize=1) override
Set size for markers.
void SetColor(Int_t color=1)
Set color with its color index.
Float_t fCurrentBlue
Current Blue component.
Float_t XtoTeX(Double_t x)
Convert X from world coordinate to TeX.
void SetMarkerColor(Color_t cindex=1) override
Set color index for markers.
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
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.
int iterate(rng_state_t *X)
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.