Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TTeXDump.h
Go to the documentation of this file.
1// @(#)root/postscript:$Id$
2// Author: Olivier Couet, Sergey Linev
3
4/*************************************************************************
5 * Copyright (C) 1995-2026, 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_TTeXDump
13#define ROOT_TTeXDump
14
15
16#include "TVirtualPS.h"
17
18class TPoints;
19
20#include <map>
21
22class TTeXDump : public TVirtualPS {
23
24protected:
25 Float_t fXsize = 0.; ///< Page size along X
26 Float_t fYsize = 0.; ///< Page size along Y
27 Int_t fType = 0; ///< Workstation type used to know if the Tex is open
28 Bool_t fBoundingBox = kFALSE; ///< True when the TeX header is printed
29 Bool_t fRange = kFALSE; ///< True when a range has been defined
30 Bool_t fStandalone = kFALSE; ///< True when a TeX file should be standalone
31 Float_t fCurrentRed = -1.; ///< Current Red component
32 Float_t fCurrentGreen = -1.; ///< Current Green component
33 Float_t fCurrentBlue = -.1; ///< Current Blue component
34 Float_t fCurrentAlpha = 1.; ///< Current Alpha value
35 Float_t fLineScale = 0.; ///< Line width scale factor
36
37 std::map<Style_t,bool> fMarkers; ///< map of already defined markers
38
39 template<typename T>
40 void DrawPolyMarkerShape(Int_t n, T *xw, T *yw);
41
42public:
43 TTeXDump();
44 TTeXDump(const char *filename, Int_t type=-113);
45 ~TTeXDump() override;
46
48 void CellArrayFill(Int_t r, Int_t g, Int_t b) override;
49 void CellArrayEnd() override;
50 void Close(Option_t *opt="") override;
51 Int_t CMtoTeX(Double_t u) { return Int_t(0.5 + 72*u/2.54); }
54 Int_t mode, Int_t border, Int_t dark, Int_t light) override;
57 void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override;
58 void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y) override;
59 void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override;
60 void DrawPS(Int_t n, Double_t *xw, Double_t *yw) override;
61 void NewPage() override;
62 void Off();
63 void On();
64 void Open(const char *filename, Int_t type=-111) override;
66 void SetColor(Int_t color = 1);
67 void SetColor(Float_t r, Float_t g, Float_t b) override;
68 void SetFillColor(Color_t cindex=1) override;
69 void SetLineColor(Color_t cindex=1) override;
70 void SetLineStyle(Style_t linestyle = 1) override;
71 void SetLineWidth(Width_t linewidth = 1) override;
73 void SetMarkerSize(Size_t msize=1) override;
74 void SetMarkerColor(Color_t cindex=1) override;
75 void SetTextColor(Color_t cindex=1) override;
76 void Text(Double_t x, Double_t y, const char *string) override;
77 void Text(Double_t, Double_t, const wchar_t *) override {}
78 void TextUrl(Double_t x, Double_t y, const char *string, const char *url) override;
79 void TextNDC(Double_t u, Double_t v, const char *string);
80 void TextNDC(Double_t, Double_t, const wchar_t *) {}
85
86 ClassDefOverride(TTeXDump, 0); //Tex driver
87};
88
89#endif
#define b(i)
Definition RSha256.hxx:100
#define g(i)
Definition RSha256.hxx:105
short Style_t
Style number (short)
Definition RtypesCore.h:97
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
short Color_t
Color number (short)
Definition RtypesCore.h:100
float Size_t
Attribute size (float)
Definition RtypesCore.h:104
short Width_t
Line width (short)
Definition RtypesCore.h:99
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
double Double_t
Double 8 bytes.
Definition RtypesCore.h:74
const char Option_t
Option string (const char)
Definition RtypesCore.h:81
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t cindex
Option_t Option_t SetLineWidth
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 filename
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 SetLineColor
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 DrawPolyMarker
Option_t Option_t SetFillColor
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 type
Option_t Option_t TPoint TPoint const char y1
2-D graphics point (world coordinates).
Definition TPoints.h:19
Interface to TeX.
Definition TTeXDump.h:22
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Paint the Cell Array.
Definition TTeXDump.cxx:907
void SetLineStyle(Style_t linestyle=1) override
Change the line style.
Definition TTeXDump.cxx:692
void SetLineScale(Float_t scale=1)
Definition TTeXDump.h:72
std::map< Style_t, bool > fMarkers
map of already defined markers
Definition TTeXDump.h:37
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
Not needed in TeX case.
Definition TTeXDump.cxx:923
void Close(Option_t *opt="") override
Close a TeX file.
Definition TTeXDump.cxx:184
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
Definition TTeXDump.cxx:383
void On()
Activate an already open TeX file.
Definition TTeXDump.cxx:207
void Open(const char *filename, Int_t type=-111) override
Open a TeX file.
Definition TTeXDump.cxx:113
Bool_t fStandalone
True when a TeX file should be standalone.
Definition TTeXDump.h:30
Bool_t fBoundingBox
True when the TeX header is printed.
Definition TTeXDump.h:28
Float_t fCurrentRed
Current Red component.
Definition TTeXDump.h:31
void TextUrl(Double_t x, Double_t y, const char *string, const char *url) override
Draw text with URL.
Definition TTeXDump.cxx:844
Float_t fXsize
Page size along X.
Definition TTeXDump.h:25
Float_t VtoTeX(Double_t v)
Convert V from NDC coordinate to TeX.
Definition TTeXDump.cxx:871
void TextNDC(Double_t, Double_t, const wchar_t *)
Definition TTeXDump.h:80
void NewPage() override
Start the TeX page. This function starts the tikzpicture environment.
Definition TTeXDump.cxx:637
Bool_t fRange
True when a range has been defined.
Definition TTeXDump.h:29
~TTeXDump() override
Default TeX destructor.
Definition TTeXDump.cxx:176
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.
Definition TTeXDump.cxx:352
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimetres.
Definition TTeXDump.cxx:660
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
Definition TTeXDump.cxx:231
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.
Definition TTeXDump.cxx:898
void SetTextColor(Color_t cindex=1) override
Set color index for text.
Definition TTeXDump.cxx:765
Float_t fCurrentAlpha
Current Alpha value.
Definition TTeXDump.h:34
void CellArrayEnd() override
End the Cell Array painting.
Definition TTeXDump.cxx:915
Float_t fLineScale
Line width scale factor.
Definition TTeXDump.h:35
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Definition TTeXDump.cxx:852
Int_t fType
Workstation type used to know if the Tex is open.
Definition TTeXDump.h:27
void DrawPolyMarkerShape(Int_t n, T *xw, T *yw)
Paint PolyMarker.
Definition TTeXDump.cxx:392
Int_t CMtoTeX(Double_t u)
Definition TTeXDump.h:51
Float_t UtoTeX(Double_t u)
Convert U from NDC coordinate to TeX.
Definition TTeXDump.cxx:862
Float_t YtoTeX(Double_t y)
Convert Y from world coordinate to TeX.
Definition TTeXDump.cxx:889
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Definition TTeXDump.cxx:368
void Text(Double_t, Double_t, const wchar_t *) override
Definition TTeXDump.h:77
void Off()
Deactivate an already open TeX file.
Definition TTeXDump.cxx:223
TTeXDump()
Default TeX constructor.
Definition TTeXDump.cxx:89
Float_t fCurrentGreen
Current Green component.
Definition TTeXDump.h:32
Float_t fYsize
Page size along Y.
Definition TTeXDump.h:26
void Text(Double_t x, Double_t y, const char *string) override
Draw text.
Definition TTeXDump.cxx:777
void SetMarkerSize(Size_t msize=1) override
Set size for markers.
Definition TTeXDump.cxx:708
void SetColor(Int_t color=1)
Set color with its color index.
Definition TTeXDump.cxx:724
Float_t fCurrentBlue
Current Blue component.
Definition TTeXDump.h:33
Float_t XtoTeX(Double_t x)
Convert X from world coordinate to TeX.
Definition TTeXDump.cxx:880
void SetMarkerColor(Color_t cindex=1) override
Set color index for markers.
Definition TTeXDump.cxx:716
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition TVirtualPS.h:30
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16