File indexing completed on 2025-01-18 10:12:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TPDF
0013 #define ROOT_TPDF
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TVirtualPS.h"
0025 #include <vector>
0026
0027
0028 class TPoints;
0029
0030 class TPDF : public TVirtualPS {
0031
0032 protected:
0033 Float_t fRed;
0034 Float_t fGreen;
0035 Float_t fBlue;
0036 Float_t fAlpha;
0037 std::vector<float> fAlphas;
0038 Float_t fXsize;
0039 Float_t fYsize;
0040 Int_t fType;
0041 Int_t fPageFormat;
0042 Int_t fPageOrientation;
0043 Int_t fStartStream;
0044 Float_t fLineScale;
0045 Int_t *fObjPos{nullptr};
0046 Int_t fObjPosSize{0};
0047 Int_t fNbObj{0};
0048 Int_t fNbPage;
0049 Bool_t fPageNotEmpty;
0050 Bool_t fCompress;
0051 Bool_t fRange;
0052
0053 static Int_t fgLineJoin;
0054 static Int_t fgLineCap;
0055 static Bool_t fgObjectIsOpen;
0056
0057 public:
0058 TPDF();
0059 TPDF(const char *filename, Int_t type=-111);
0060 ~TPDF() override;
0061
0062 void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override;
0063 void CellArrayFill(Int_t r, Int_t g, Int_t b) override;
0064 void CellArrayEnd() override;
0065 void Close(Option_t *opt="") override;
0066 Double_t CMtoPDF(Double_t u) { return Int_t(0.5 + 72*u/2.54); }
0067 void DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t y2) override;
0068 void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
0069 Int_t mode, Int_t border, Int_t dark, Int_t light) override;
0070 void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y);
0071 void DrawHatch(Float_t dy, Float_t angle, Int_t n, Double_t *x, Double_t *y);
0072 void DrawPolyLine(Int_t n, TPoints *xy);
0073 void DrawPolyLineNDC(Int_t n, TPoints *uv);
0074 void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override;
0075 void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y) override;
0076 void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override;
0077 void DrawPS(Int_t n, Double_t *xw, Double_t *yw) override;
0078 void LineTo(Double_t x, Double_t y);
0079 void MoveTo(Double_t x, Double_t y);
0080 void EndObject();
0081 void FontEncode();
0082 void NewObject(Int_t n);
0083 void NewPage() override;
0084 void Off();
0085 void On();
0086 void Open(const char *filename, Int_t type=-111) override;
0087 void PatternEncode();
0088 void PrintFast(Int_t nch, const char *string="") override;
0089 void PrintStr(const char *string="") override;
0090 void Range(Float_t xrange, Float_t yrange);
0091 void SetAlpha(Float_t alpha = 1.);
0092 void SetColor(Int_t color = 1);
0093 void SetColor(Float_t r, Float_t g, Float_t b) override;
0094 void SetFillColor( Color_t cindex=1) override;
0095 void SetFillPatterns(Int_t ipat, Int_t color);
0096 void SetLineColor( Color_t cindex=1) override;
0097 void SetLineJoin(Int_t linejoin=0);
0098 void SetLineCap(Int_t linecap=0);
0099 void SetLineScale(Float_t scale=1) {fLineScale = scale;}
0100 void SetLineStyle(Style_t linestyle = 1) override;
0101 void SetLineWidth(Width_t linewidth = 1) override;
0102 void SetMarkerColor(Color_t cindex=1) override;
0103 void SetTextColor(Color_t cindex=1) override;
0104 void Text(Double_t x, Double_t y, const char *string) override;
0105 void Text(Double_t, Double_t, const wchar_t *) override;
0106 void TextNDC(Double_t u, Double_t v, const char *string);
0107 void TextNDC(Double_t, Double_t, const wchar_t *);
0108 void WriteCompressedBuffer();
0109 void WriteReal(Float_t r, Bool_t space=kTRUE) override;
0110 Double_t UtoPDF(Double_t u);
0111 Double_t VtoPDF(Double_t v);
0112 Double_t XtoPDF(Double_t x);
0113 Double_t YtoPDF(Double_t y);
0114
0115 ClassDefOverride(TPDF, 0);
0116 };
0117
0118 #endif