Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TPDF.cxx
Go to the documentation of this file.
1// @(#)root/postscript:$Id: TPDF.cxx,v 1.0
2// Author: Olivier Couet
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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/** \class TPDF
13\ingroup PS
14
15\brief Interface to PDF.
16
17Like PostScript, PDF is a vector graphics output format allowing a very high
18graphics output quality. The functionalities provided by this class are very
19similar to those provided by `TPostScript`.
20
21Compare to PostScript output, the PDF files are usually smaller because some
22parts of them can be compressed.
23
24PDF also allows to define table of contents. This facility can be used in ROOT.
25The following example shows how to proceed:
26~~~ {.cpp}
27{
28 TCanvas* canvas = new TCanvas("canvas");
29 TH1F* histo = new TH1F("histo","test 1",10,0.,10.);
30 histo->SetFillColor(2);
31 histo->Fill(2.);
32 histo->Draw();
33 canvas->Print("plots.pdf(","Title:One bin filled");
34 histo->Fill(4.);
35 histo->Draw();
36 canvas->Print("plots.pdf","Title:Two bins filled");
37 histo->Fill(6.);
38 histo->Draw();
39 canvas->Print("plots.pdf","Title:Three bins filled");
40 histo->Fill(8.);
41 histo->Draw();
42 canvas->Print("plots.pdf","Title:Four bins filled");
43 histo->Fill(8.);
44 histo->Draw();
45 canvas->Print("plots.pdf)","Title:The fourth bin content is 2");
46}
47~~~
48Each character string following the keyword "Title:" makes a new entry in
49the table of contents.
50*/
51
52#ifdef WIN32
53#pragma optimize("",off)
54#endif
55
56#include <cstdlib>
57#include <cstring>
58#include <cctype>
59#include <fstream>
60
61#include "TROOT.h"
62#include "TDatime.h"
63#include "TColor.h"
64#include "TVirtualPad.h"
65#include "TPoints.h"
66#include "TPDF.h"
67#include "TStyle.h"
68#include "TMath.h"
69#include "TStorage.h"
70#include "TText.h"
71#include "zlib.h"
72#include "TObjString.h"
73#include "TObjArray.h"
74#include "snprintf.h"
75
76// To scale fonts to the same size as the old TT version
77const Float_t kScale = 0.93376068;
78
79// Objects numbers
80const Int_t kObjRoot = 1; // Root object
81const Int_t kObjInfo = 2; // Info object
82const Int_t kObjOutlines = 3; // Outlines object
83const Int_t kObjPages = 4; // Pages object (pages index)
84const Int_t kObjPageResources = 5; // Pages Resources object
85const Int_t kObjContents = 6; // Table of content
86const Int_t kObjFont = 7; // First Font object (14 in total)
87const Int_t kObjColorSpace = 22; // ColorSpace object
88const Int_t kObjPatternResourses = 23; // Pattern Resources object
89const Int_t kObjPatternList = 24; // Pattern list object
90const Int_t kObjTransList = 25; // List of transparencies
91const Int_t kObjPattern = 26; // First pattern object (25 in total)
92const Int_t kObjFirstPage = 51; // First page object
93
94// Number of fonts
96
99
101
102////////////////////////////////////////////////////////////////////////////////
103/// Default PDF constructor
104
106{
107 fStream = nullptr;
110 gVirtualPS = this;
111 fRed = 0.;
112 fGreen = 0.;
113 fBlue = 0.;
114 fAlpha = 1.;
115 fXsize = 0.;
116 fYsize = 0.;
117 fType = 0;
118 fPageFormat = 0;
120 fStartStream = 0;
121 fLineScale = 0.;
122 fNbPage = 0;
123 fRange = kFALSE;
124 SetTitle("PDF");
125}
126
127////////////////////////////////////////////////////////////////////////////////
128/// Initialize the PDF interface
129///
130/// - fname : PDF file name
131/// - wtype : PDF workstation type. Not used in the PDF driver. But as TPDF
132/// inherits from TVirtualPS it should be kept. Anyway it is not
133/// necessary to specify this parameter at creation time because it
134/// has a default value (which is ignore in the PDF case).
135
136TPDF::TPDF(const char *fname, Int_t wtype) : TVirtualPS(fname, wtype)
137{
138 fStream = nullptr;
141 fRed = 0.;
142 fGreen = 0.;
143 fBlue = 0.;
144 fAlpha = 1.;
145 fXsize = 0.;
146 fYsize = 0.;
147 fType = 0;
148 fPageFormat = 0;
150 fStartStream = 0;
151 fLineScale = 0.;
152 fNbPage = 0;
153 fRange = kFALSE;
154 SetTitle("PDF");
155 Open(fname, wtype);
156}
157
158////////////////////////////////////////////////////////////////////////////////
159/// Default PDF destructor
160
162{
163 Close();
164
165 if (fObjPos) delete [] fObjPos;
166}
167
168////////////////////////////////////////////////////////////////////////////////
169/// Begin the Cell Array painting
170
172 Double_t)
173{
174 Warning("TPDF::CellArrayBegin", "not yet implemented");
175}
176
177////////////////////////////////////////////////////////////////////////////////
178/// Paint the Cell Array
179
181{
182 Warning("TPDF::CellArrayFill", "not yet implemented");
183}
184
185////////////////////////////////////////////////////////////////////////////////
186/// End the Cell Array painting
187
189{
190 Warning("TPDF::CellArrayEnd", "not yet implemented");
191}
192
193////////////////////////////////////////////////////////////////////////////////
194/// Close a PDF file
195
197{
198 Int_t i;
199
200 if (!gVirtualPS) return;
201 if (!fStream) return;
202 if (gPad) gPad->Update();
203
204 // Close the currently opened page
206 PrintStr("endstream@");
207 Int_t streamLength = fNByte-fStartStream-10;
208 PrintStr("endobj@");
210 WriteInteger(streamLength, 0);
211 PrintStr("@");
212 PrintStr("endobj@");
214 PrintStr("<<@");
215 if (!strstr(GetTitle(),"PDF")) {
216 PrintStr("/Title (");
218 PrintStr(")@");
219 } else {
220 PrintStr("/Title (Page");
222 PrintStr(")@");
223 }
224 PrintStr("/Dest [");
226 PrintStr(" 0 R /XYZ null null 0]@");
227 PrintStr("/Parent");
229 PrintStr(" 0 R");
230 PrintStr("@");
231 if (fNbPage > 1) {
232 PrintStr("/Prev");
234 PrintStr(" 0 R");
235 PrintStr("@");
236 }
237 PrintStr(">>@");
238
240 PrintStr("<<@");
241 PrintStr("/Type /Outlines@");
242 PrintStr("/Count");
244 PrintStr("@");
245 PrintStr("/First");
247 PrintStr(" 0 R");
248 PrintStr("@");
249 PrintStr("/Last");
251 PrintStr(" 0 R");
252 PrintStr("@");
253 PrintStr(">>@");
254 PrintStr("endobj@");
255
257 PrintStr("<<@");
258 PrintStr("/Title (Contents)@");
259 PrintStr("/Dest [");
261 PrintStr(" 0 R /XYZ null null 0]@");
262 PrintStr("/Count");
264 PrintStr("@");
265 PrintStr("/Parent");
267 PrintStr(" 0 R");
268 PrintStr("@");
269 PrintStr("/First");
271 PrintStr(" 0 R");
272 PrintStr("@");
273 PrintStr("/Last");
275 PrintStr(" 0 R");
276 PrintStr("@");
277 PrintStr(">>@");
278
279 // List of all the pages
281 PrintStr("<<@");
282 PrintStr("/Type /Pages@");
283 PrintStr("/Count");
285 PrintStr("@");
286 PrintStr("/Kids [");
287 for (i=1; i<=fNbPage; i++) {
289 PrintStr(" 0 R");
290 }
291 PrintStr(" ]");
292 PrintStr("@");
293 PrintStr(">>@");
294 PrintStr("endobj@");
295
297 PrintStr("<<@");
298 for (i=0; i<(int)fAlphas.size(); i++) {
299 PrintStr(
300 Form("/ca%3.2f << /Type /ExtGState /ca %3.2f >> /CA%3.2f << /Type /ExtGState /CA %3.2f >>@",
301 fAlphas[i],fAlphas[i],fAlphas[i],fAlphas[i]));
302 }
303 PrintStr(">>@");
304 PrintStr("endobj@");
305 if (fAlphas.size()) fAlphas.clear();
306
307 // Cross-Reference Table
308 Int_t refInd = fNByte;
309 PrintStr("xref@");
310 PrintStr("0");
312 PrintStr("@");
313 PrintStr("0000000000 65535 f @");
314 char str[21];
315 for (i=0; i<fNbObj; i++) {
316 snprintf(str,21,"%10.10d 00000 n @",fObjPos[i]);
317 PrintStr(str);
318 }
319
320 // Trailer
321 PrintStr("trailer@");
322 PrintStr("<<@");
323 PrintStr("/Size");
325 PrintStr("@");
326 PrintStr("/Root");
328 PrintStr(" 0 R");
329 PrintStr("@");
330 PrintStr("/Info");
332 PrintStr(" 0 R@");
333 PrintStr(">>@");
334 PrintStr("startxref@");
335 WriteInteger(refInd, 0);
336 PrintStr("@");
337 PrintStr("%%EOF@");
338
339 // Close file stream
340 if (fStream) { fStream->close(); delete fStream; fStream = nullptr;}
341
342 gVirtualPS = nullptr;
343}
344
345////////////////////////////////////////////////////////////////////////////////
346/// Draw a Box
347
349{
350 static Double_t x[4], y[4];
351 Double_t ix1 = XtoPDF(x1);
352 Double_t ix2 = XtoPDF(x2);
353 Double_t iy1 = YtoPDF(y1);
354 Double_t iy2 = YtoPDF(y2);
355 Int_t fillis = fFillStyle/1000;
356 Int_t fillsi = fFillStyle%1000;
357
358 if (fillis == 3 || fillis == 2) {
359 if (fillsi > 99) {
360 x[0] = x1; y[0] = y1;
361 x[1] = x2; y[1] = y1;
362 x[2] = x2; y[2] = y2;
363 x[3] = x1; y[3] = y2;
364 return;
365 }
366 if (fillsi > 0 && fillsi < 26) {
367 x[0] = x1; y[0] = y1;
368 x[1] = x2; y[1] = y1;
369 x[2] = x2; y[2] = y2;
370 x[3] = x1; y[3] = y2;
371 DrawPS(-4, &x[0], &y[0]);
372 }
373 if (fillsi == -3) {
374 SetColor(5);
375 if (fAlpha == 1) PrintFast(15," q 0.4 w [] 0 d");
376 WriteReal(ix1);
377 WriteReal(iy1);
378 WriteReal(ix2 - ix1);
379 WriteReal(iy2 - iy1);
380 if (fAlpha == 1) PrintFast(8," re b* Q");
381 else PrintFast(6," re f*");
382 }
383 }
384 if (fillis == 1) {
386 if (fAlpha == 1) PrintFast(15," q 0.4 w [] 0 d");
387 WriteReal(ix1);
388 WriteReal(iy1);
389 WriteReal(ix2 - ix1);
390 WriteReal(iy2 - iy1);
391 if (fAlpha == 1) PrintFast(8," re b* Q");
392 else PrintFast(6," re f*");
393 }
394 if (fillis == 0) {
395 if (fLineWidth<=0) return;
397 WriteReal(ix1);
398 WriteReal(iy1);
399 WriteReal(ix2 - ix1);
400 WriteReal(iy2 - iy1);
401 PrintFast(5," re S");
402 }
403}
404
405////////////////////////////////////////////////////////////////////////////////
406/// Draw a Frame around a box
407///
408/// - mode = -1 box looks as it is behind the screen
409/// - mode = 1 box looks as it is in front of the screen
410/// - border is the border size in already precomputed PDF units
411/// - dark is the color for the dark part of the frame
412/// - light is the color for the light part of the frame
413
415 Int_t mode, Int_t border, Int_t dark, Int_t light)
416{
417 static Double_t xps[7], yps[7];
418 Int_t i;
419
420 // Draw top&left part of the box
421 if (mode == -1) SetColor(dark);
422 else SetColor(light);
423 xps[0] = XtoPDF(xl); yps[0] = YtoPDF(yl);
424 xps[1] = xps[0] + border; yps[1] = yps[0] + border;
425 xps[2] = xps[1]; yps[2] = YtoPDF(yt) - border;
426 xps[3] = XtoPDF(xt) - border; yps[3] = yps[2];
427 xps[4] = XtoPDF(xt); yps[4] = YtoPDF(yt);
428 xps[5] = xps[0]; yps[5] = yps[4];
429 xps[6] = xps[0]; yps[6] = yps[0];
430
431 MoveTo(xps[0], yps[0]);
432 for (i=1;i<7;i++) LineTo(xps[i], yps[i]);
433 PrintFast(3," f*");
434
435 // Draw bottom&right part of the box
436 if (mode == -1) SetColor(light);
437 else SetColor(dark);
438 xps[0] = XtoPDF(xl); yps[0] = YtoPDF(yl);
439 xps[1] = xps[0] + border; yps[1] = yps[0] + border;
440 xps[2] = XtoPDF(xt) - border; yps[2] = yps[1];
441 xps[3] = xps[2]; yps[3] = YtoPDF(yt) - border;
442 xps[4] = XtoPDF(xt); yps[4] = YtoPDF(yt);
443 xps[5] = xps[4]; yps[5] = yps[0];
444 xps[6] = xps[0]; yps[6] = yps[0];
445
446 MoveTo(xps[0], yps[0]);
447 for (i=1;i<7;i++) LineTo(xps[i], yps[i]);
448 PrintFast(3," f*");
449}
450
451////////////////////////////////////////////////////////////////////////////////
452/// Draw Fill area with hatch styles
453
455{
456 Warning("DrawHatch", "hatch fill style not yet implemented");
457}
458
459////////////////////////////////////////////////////////////////////////////////
460/// Draw Fill area with hatch styles
461
463{
464 Warning("DrawHatch", "hatch fill style not yet implemented");
465}
466
467////////////////////////////////////////////////////////////////////////////////
468/// Draw a PolyLine
469///
470/// Draw a polyline through the points xy.
471///
472/// - If NN=1 moves only to point x,y.
473/// - If NN=0 the x,y are written in the PDF file
474/// according to the current transformation.
475/// - If NN>0 the line is clipped as a line.
476/// - If NN<0 the line is clipped as a fill area.
477
479{
480 Int_t n;
481
482 Style_t linestylesav = fLineStyle;
483 Width_t linewidthsav = fLineWidth;
484
485 if (nn > 0) {
486 if (fLineWidth<=0) return;
487 n = nn;
491 } else {
492 n = -nn;
493 SetLineStyle(1);
494 SetLineWidth(1);
496 }
497
498 WriteReal(XtoPDF(xy[0].GetX()));
499 WriteReal(YtoPDF(xy[0].GetY()));
500 if (n <= 1) {
501 if (n == 0) return;
502 PrintFast(2," m");
503 return;
504 }
505
506 PrintFast(2," m");
507
508 for (Int_t i=1;i<n;i++) LineTo(XtoPDF(xy[i].GetX()), YtoPDF(xy[i].GetY()));
509
510 if (nn > 0) {
511 if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY()) PrintFast(3," cl");
512 PrintFast(2," S");
513 } else {
514 PrintFast(3," f*");
515 }
516
517 SetLineStyle(linestylesav);
518 SetLineWidth(linewidthsav);
519}
520
521////////////////////////////////////////////////////////////////////////////////
522/// Draw a PolyLine in NDC space
523///
524/// Draw a polyline through the points xy.
525///
526/// - If NN=1 moves only to point x,y.
527/// - If NN=0 the x,y are written in the PDF file
528/// according to the current transformation.
529/// - If NN>0 the line is clipped as a line.
530/// - If NN<0 the line is clipped as a fill area.
531
533{
534 Int_t n;
535
536 Style_t linestylesav = fLineStyle;
537 Width_t linewidthsav = fLineWidth;
538
539 if (nn > 0) {
540 if (fLineWidth<=0) return;
541 n = nn;
545 } else {
546 n = -nn;
547 SetLineStyle(1);
548 SetLineWidth(1);
550 }
551
552 WriteReal(UtoPDF(xy[0].GetX()));
553 WriteReal(VtoPDF(xy[0].GetY()));
554 if (n <= 1) {
555 if (n == 0) return;
556 PrintFast(2," m");
557 return;
558 }
559
560 PrintFast(2," m");
561
562 for (Int_t i=1;i<n;i++) LineTo(UtoPDF(xy[i].GetX()), VtoPDF(xy[i].GetY()));
563
564 if (nn > 0) {
565 if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY()) PrintFast(3," cl");
566 PrintFast(2," S");
567 } else {
568 PrintFast(3," f*");
569 }
570
571 SetLineStyle(linestylesav);
572 SetLineWidth(linewidthsav);
573}
574
575////////////////////////////////////////////////////////////////////////////////
576/// Draw markers at the n WC points xw, yw
577
579{
581 Style_t linestylesav = fLineStyle;
582 Width_t linewidthsav = fLineWidth;
583 SetLineStyle(1);
587
588 if (ms == 4)
589 ms = 24;
590 else if (ms >= 6 && ms <= 8)
591 ms = 20;
592 else if (ms >= 9 && ms <= 19)
593 ms = 1;
594
595 // Define the marker size
597 if (fMarkerStyle == 1 || (fMarkerStyle >= 9 && fMarkerStyle <= 19)) {
598 msize = 1.;
599 } else if (fMarkerStyle == 6) {
600 msize = 1.;
601 } else if (fMarkerStyle == 7) {
602 msize = 1.5;
603 } else {
604 const Int_t kBASEMARKER = 8;
605 Float_t sbase = msize*kBASEMARKER;
606 Float_t s2x = sbase / Float_t(gPad->GetWw() * gPad->GetAbsWNDC());
607 msize = this->UtoPDF(s2x) - this->UtoPDF(0);
608 }
609
610 Double_t m = msize;
611 Double_t m2 = m/2;
612 Double_t m3 = m/3;
613 Double_t m4 = m2*1.333333333333;
614 Double_t m6 = m/6;
615 Double_t m0 = m/10.;
616 Double_t m8 = m/4;
617 Double_t m9 = m/8;
618
619 // Draw the marker according to the type
620 Double_t ix,iy;
621 for (Int_t i=0;i<n;i++) {
622 ix = XtoPDF(xw[i]);
623 iy = YtoPDF(yw[i]);
624 // Dot (.)
625 if (ms == 1) {
626 MoveTo(ix-1, iy);
627 LineTo(ix , iy);
628 // Plus (+)
629 } else if (ms == 2) {
630 MoveTo(ix-m2, iy);
631 LineTo(ix+m2, iy);
632 MoveTo(ix , iy-m2);
633 LineTo(ix , iy+m2);
634 // X shape (X)
635 } else if (ms == 5) {
636 MoveTo(ix-m2*0.707, iy-m2*0.707);
637 LineTo(ix+m2*0.707, iy+m2*0.707);
638 MoveTo(ix-m2*0.707, iy+m2*0.707);
639 LineTo(ix+m2*0.707, iy-m2*0.707);
640 // Asterisk shape (*)
641 } else if (ms == 3 || ms == 31) {
642 MoveTo(ix-m2, iy);
643 LineTo(ix+m2, iy);
644 MoveTo(ix , iy-m2);
645 LineTo(ix , iy+m2);
646 MoveTo(ix-m2*0.707, iy-m2*0.707);
647 LineTo(ix+m2*0.707, iy+m2*0.707);
648 MoveTo(ix-m2*0.707, iy+m2*0.707);
649 LineTo(ix+m2*0.707, iy-m2*0.707);
650 // Circle
651 } else if (ms == 24 || ms == 20) {
652 MoveTo(ix-m2, iy);
653 WriteReal(ix-m2); WriteReal(iy+m4);
654 WriteReal(ix+m2); WriteReal(iy+m4);
655 WriteReal(ix+m2); WriteReal(iy) ; PrintFast(2," c");
656 WriteReal(ix+m2); WriteReal(iy-m4);
657 WriteReal(ix-m2); WriteReal(iy-m4);
658 WriteReal(ix-m2); WriteReal(iy) ; PrintFast(4," c h");
659 // Square
660 } else if (ms == 25 || ms == 21) {
661 WriteReal(ix-m2); WriteReal(iy-m2);
662 WriteReal(m) ; WriteReal(m) ; PrintFast(3," re");
663 // Down triangle
664 } else if (ms == 23 || ms == 32) {
665 MoveTo(ix , iy-m2);
666 LineTo(ix+m2, iy+m2);
667 LineTo(ix-m2, iy+m2);
668 PrintFast(2," h");
669 // Up triangle
670 } else if (ms == 26 || ms == 22) {
671 MoveTo(ix-m2, iy-m2);
672 LineTo(ix+m2, iy-m2);
673 LineTo(ix , iy+m2);
674 PrintFast(2," h");
675 } else if (ms == 27 || ms == 33) {
676 MoveTo(ix , iy-m2);
677 LineTo(ix+m3, iy);
678 LineTo(ix , iy+m2);
679 LineTo(ix-m3, iy) ;
680 PrintFast(2," h");
681 } else if (ms == 28 || ms == 34) {
682 MoveTo(ix-m6, iy-m6);
683 LineTo(ix-m6, iy-m2);
684 LineTo(ix+m6, iy-m2);
685 LineTo(ix+m6, iy-m6);
686 LineTo(ix+m2, iy-m6);
687 LineTo(ix+m2, iy+m6);
688 LineTo(ix+m6, iy+m6);
689 LineTo(ix+m6, iy+m2);
690 LineTo(ix-m6, iy+m2);
691 LineTo(ix-m6, iy+m6);
692 LineTo(ix-m2, iy+m6);
693 LineTo(ix-m2, iy-m6);
694 PrintFast(2," h");
695 } else if (ms == 29 || ms == 30) {
696 MoveTo(ix , iy+m2);
697 LineTo(ix+0.112255*m, iy+0.15451*m);
698 LineTo(ix+0.47552*m , iy+0.15451*m);
699 LineTo(ix+0.181635*m, iy-0.05902*m);
700 LineTo(ix+0.29389*m , iy-0.40451*m);
701 LineTo(ix , iy-0.19098*m);
702 LineTo(ix-0.29389*m , iy-0.40451*m);
703 LineTo(ix-0.181635*m, iy-0.05902*m);
704 LineTo(ix-0.47552*m , iy+0.15451*m);
705 LineTo(ix-0.112255*m, iy+0.15451*m);
706 PrintFast(2," h");
707 } else if (ms == 35 ) {
708 // diamond with cross
709 MoveTo(ix-m2, iy );
710 LineTo(ix , iy-m2);
711 LineTo(ix+m2, iy );
712 LineTo(ix , iy+m2);
713 LineTo(ix-m2, iy );
714 LineTo(ix+m2, iy );
715 LineTo(ix , iy+m2);
716 LineTo(ix , iy-m2);
717 PrintFast(2," h");
718 } else if (ms == 36 ) {
719 // square with diagonal cross
720 MoveTo(ix-m2, iy-m2);
721 LineTo(ix+m2, iy-m2);
722 LineTo(ix+m2, iy+m2);
723 LineTo(ix-m2, iy+m2);
724 LineTo(ix-m2, iy-m2);
725 LineTo(ix+m2, iy+m2);
726 LineTo(ix-m2, iy+m2);
727 LineTo(ix+m2, iy-m2);
728 PrintFast(2," h");
729 } else if (ms == 37 || ms == 39 ) {
730 // square with cross
731 MoveTo(ix , iy );
732 LineTo(ix-m8, iy+m2);
733 LineTo(ix-m2, iy );
734 LineTo(ix , iy );
735 LineTo(ix-m8, iy-m2);
736 LineTo(ix+m8, iy-m2);
737 LineTo(ix , iy );
738 LineTo(ix+m2, iy );
739 LineTo(ix+m8, iy+m2);
740 LineTo(ix , iy );
741 PrintFast(2," h");
742 } else if (ms == 38 ) {
743 // + shaped marker with octagon
744 MoveTo(ix-m2, iy );
745 LineTo(ix-m2, iy-m8);
746 LineTo(ix-m8, iy-m2);
747 LineTo(ix+m8, iy-m2);
748 LineTo(ix+m2, iy-m8);
749 LineTo(ix+m2, iy+m8);
750 LineTo(ix+m8, iy+m2);
751 LineTo(ix-m8, iy+m2);
752 LineTo(ix-m2, iy+m8);
753 LineTo(ix-m2, iy );
754 LineTo(ix+m2, iy );
755 LineTo(ix , iy );
756 LineTo(ix , iy-m2);
757 LineTo(ix , iy+m2);
758 LineTo(ix , iy);
759 PrintFast(2," h");
760 } else if (ms == 40 || ms == 41 ) {
761 // four triangles X
762 MoveTo(ix , iy );
763 LineTo(ix+m8, iy+m2);
764 LineTo(ix+m2, iy+m8);
765 LineTo(ix , iy );
766 LineTo(ix+m2, iy-m8);
767 LineTo(ix+m8, iy-m2);
768 LineTo(ix , iy );
769 LineTo(ix-m8, iy-m2);
770 LineTo(ix-m2, iy-m8);
771 LineTo(ix , iy );
772 LineTo(ix-m2, iy+m8);
773 LineTo(ix-m8, iy+m2);
774 LineTo(ix , iy );
775 PrintFast(2," h");
776 } else if (ms == 42 || ms == 43 ) {
777 // double diamonds
778 MoveTo(ix , iy+m2);
779 LineTo(ix-m9, iy+m9);
780 LineTo(ix-m2, iy );
781 LineTo(ix-m9, iy-m9);
782 LineTo(ix , iy-m2);
783 LineTo(ix+m9, iy-m9);
784 LineTo(ix+m2, iy );
785 LineTo(ix+m9, iy+m9);
786 LineTo(ix , iy+m2);
787 PrintFast(2," h");
788 } else if (ms == 44 ) {
789 // open four triangles plus
790 MoveTo(ix , iy );
791 LineTo(ix+m8, iy+m2);
792 LineTo(ix-m8, iy+m2);
793 LineTo(ix+m8, iy-m2);
794 LineTo(ix-m8, iy-m2);
795 LineTo(ix , iy );
796 LineTo(ix+m2, iy+m8);
797 LineTo(ix+m2, iy-m8);
798 LineTo(ix-m2, iy+m8);
799 LineTo(ix-m2, iy-m8);
800 LineTo(ix , iy );
801 PrintFast(2," h");
802 } else if (ms == 45 ) {
803 // filled four triangles plus
804 MoveTo(ix+m0, iy+m0);
805 LineTo(ix+m8, iy+m2);
806 LineTo(ix-m8, iy+m2);
807 LineTo(ix-m0, iy+m0);
808 LineTo(ix-m2, iy+m8);
809 LineTo(ix-m2, iy-m8);
810 LineTo(ix-m0, iy-m0);
811 LineTo(ix-m8, iy-m2);
812 LineTo(ix+m8, iy-m2);
813 LineTo(ix+m0, iy-m0);
814 LineTo(ix+m2, iy-m8);
815 LineTo(ix+m2, iy+m8);
816 LineTo(ix+m0, iy+m0);
817 PrintFast(2," h");
818 } else if (ms == 46 || ms == 47 ) {
819 // four triangles X
820 MoveTo(ix , iy+m8);
821 LineTo(ix-m8, iy+m2);
822 LineTo(ix-m2, iy+m8);
823 LineTo(ix-m8, iy );
824 LineTo(ix-m2, iy-m8);
825 LineTo(ix-m8, iy-m2);
826 LineTo(ix , iy-m8);
827 LineTo(ix+m8, iy-m2);
828 LineTo(ix+m2, iy-m8);
829 LineTo(ix+m8, iy );
830 LineTo(ix+m2, iy+m8);
831 LineTo(ix+m8, iy+m2);
832 LineTo(ix , iy+m8);
833 PrintFast(2," h");
834 } else if (ms == 48 ) {
835 // four filled squares X
836 MoveTo(ix , iy+m8*1.01);
837 LineTo(ix-m8, iy+m2);
838 LineTo(ix-m2, iy+m8);
839 LineTo(ix-m8, iy );
840 LineTo(ix-m2, iy-m8);
841 LineTo(ix-m8, iy-m2);
842 LineTo(ix , iy-m8);
843 LineTo(ix+m8, iy-m2);
844 LineTo(ix+m2, iy-m8);
845 LineTo(ix+m8, iy );
846 LineTo(ix+m2, iy+m8);
847 LineTo(ix+m8, iy+m2);
848 LineTo(ix , iy+m8*0.99);
849 LineTo(ix+m8*0.99, iy );
850 LineTo(ix , iy-m8*0.99);
851 LineTo(ix-m8*0.99, iy );
852 LineTo(ix , iy+m8*0.99);
853 PrintFast(2," h");
854 } else if (ms == 49 ) {
855 // four filled squares plus
856 MoveTo(ix-m6, iy-m6*1.01);
857 LineTo(ix-m6, iy-m2);
858 LineTo(ix+m6, iy-m2);
859 LineTo(ix+m6, iy-m6);
860 LineTo(ix+m2, iy-m6);
861 LineTo(ix+m2, iy+m6);
862 LineTo(ix+m6, iy+m6);
863 LineTo(ix+m6, iy+m2);
864 LineTo(ix-m6, iy+m2);
865 LineTo(ix-m6, iy+m6);
866 LineTo(ix-m2, iy+m6);
867 LineTo(ix-m2, iy-m6);
868 LineTo(ix-m6, iy-m6*0.99);
869 LineTo(ix-m6, iy+m6);
870 LineTo(ix+m6, iy+m6);
871 LineTo(ix+m6, iy-m6);
872 PrintFast(2," h");
873 } else {
874 MoveTo(ix-m6, iy-m6);
875 LineTo(ix-m6, iy-m2);
876 }
877
878 if ((ms > 19 && ms < 24) || ms == 29 || ms == 33 || ms == 34 ||
879 ms == 39 || ms == 41 || ms == 43 || ms == 45 ||
880 ms == 47 || ms == 48 || ms == 49) {
881 PrintFast(2," f");
882 } else {
883 PrintFast(2," S");
884 }
885 }
886
887 SetLineStyle(linestylesav);
888 SetLineWidth(linewidthsav);
889}
890
891////////////////////////////////////////////////////////////////////////////////
892/// Draw markers at the n WC points xw, yw
893
895{
897 Style_t linestylesav = fLineStyle;
898 Width_t linewidthsav = fLineWidth;
899 SetLineStyle(1);
903
904 if (ms == 4)
905 ms = 24;
906 else if (ms >= 6 && ms <= 8)
907 ms = 20;
908 else if (ms >= 9 && ms <= 19)
909 ms = 1;
910
911 // Define the marker size
913 if (fMarkerStyle == 1 || (fMarkerStyle >= 9 && fMarkerStyle <= 19)) {
914 msize = 1.;
915 } else if (fMarkerStyle == 6) {
916 msize = 1.5;
917 } else if (fMarkerStyle == 7) {
918 msize = 3.;
919 } else {
920 const Int_t kBASEMARKER = 8;
921 Float_t sbase = msize*kBASEMARKER;
922 Float_t s2x = sbase / Float_t(gPad->GetWw() * gPad->GetAbsWNDC());
923 msize = this->UtoPDF(s2x) - this->UtoPDF(0);
924 }
925
926 Double_t m = msize;
927 Double_t m2 = m/2;
928 Double_t m3 = m/3;
929 Double_t m4 = m2*1.333333333333;
930 Double_t m6 = m/6;
931 Double_t m8 = m/4;
932 Double_t m9 = m/8;
933
934 // Draw the marker according to the type
935 Double_t ix,iy;
936 for (Int_t i=0;i<n;i++) {
937 ix = XtoPDF(xw[i]);
938 iy = YtoPDF(yw[i]);
939 // Dot (.)
940 if (ms == 1) {
941 MoveTo(ix-1, iy);
942 LineTo(ix , iy);
943 // Plus (+)
944 } else if (ms == 2) {
945 MoveTo(ix-m2, iy);
946 LineTo(ix+m2, iy);
947 MoveTo(ix , iy-m2);
948 LineTo(ix , iy+m2);
949 // X shape (X)
950 } else if (ms == 5) {
951 MoveTo(ix-m2*0.707, iy-m2*0.707);
952 LineTo(ix+m2*0.707, iy+m2*0.707);
953 MoveTo(ix-m2*0.707, iy+m2*0.707);
954 LineTo(ix+m2*0.707, iy-m2*0.707);
955 // Asterisk shape (*)
956 } else if (ms == 3 || ms == 31) {
957 MoveTo(ix-m2, iy);
958 LineTo(ix+m2, iy);
959 MoveTo(ix , iy-m2);
960 LineTo(ix , iy+m2);
961 MoveTo(ix-m2*0.707, iy-m2*0.707);
962 LineTo(ix+m2*0.707, iy+m2*0.707);
963 MoveTo(ix-m2*0.707, iy+m2*0.707);
964 LineTo(ix+m2*0.707, iy-m2*0.707);
965 // Circle
966 } else if (ms == 24 || ms == 20) {
967 MoveTo(ix-m2, iy);
968 WriteReal(ix-m2); WriteReal(iy+m4);
969 WriteReal(ix+m2); WriteReal(iy+m4);
970 WriteReal(ix+m2); WriteReal(iy) ; PrintFast(2," c");
971 WriteReal(ix+m2); WriteReal(iy-m4);
972 WriteReal(ix-m2); WriteReal(iy-m4);
973 WriteReal(ix-m2); WriteReal(iy) ; PrintFast(4," c h");
974 // Square
975 } else if (ms == 25 || ms == 21) {
976 WriteReal(ix-m2); WriteReal(iy-m2);
977 WriteReal(m) ; WriteReal(m) ; PrintFast(3," re");
978 // Down triangle
979 } else if (ms == 23 || ms == 32) {
980 MoveTo(ix , iy-m2);
981 LineTo(ix+m2, iy+m2);
982 LineTo(ix-m2, iy+m2);
983 PrintFast(2," h");
984 // Up triangle
985 } else if (ms == 26 || ms == 22) {
986 MoveTo(ix-m2, iy-m2);
987 LineTo(ix+m2, iy-m2);
988 LineTo(ix , iy+m2);
989 PrintFast(2," h");
990 } else if (ms == 27 || ms == 33) {
991 MoveTo(ix , iy-m2);
992 LineTo(ix+m3, iy);
993 LineTo(ix , iy+m2);
994 LineTo(ix-m3, iy) ;
995 PrintFast(2," h");
996 } else if (ms == 28 || ms == 34) {
997 MoveTo(ix-m6, iy-m6);
998 LineTo(ix-m6, iy-m2);
999 LineTo(ix+m6, iy-m2);
1000 LineTo(ix+m6, iy-m6);
1001 LineTo(ix+m2, iy-m6);
1002 LineTo(ix+m2, iy+m6);
1003 LineTo(ix+m6, iy+m6);
1004 LineTo(ix+m6, iy+m2);
1005 LineTo(ix-m6, iy+m2);
1006 LineTo(ix-m6, iy+m6);
1007 LineTo(ix-m2, iy+m6);
1008 LineTo(ix-m2, iy-m6);
1009 PrintFast(2," h");
1010 } else if (ms == 29 || ms == 30) {
1011 MoveTo(ix , iy-m2);
1012 LineTo(ix-0.112255*m, iy-0.15451*m);
1013 LineTo(ix-0.47552*m , iy-0.15451*m);
1014 LineTo(ix-0.181635*m, iy+0.05902*m);
1015 LineTo(ix-0.29389*m , iy+0.40451*m);
1016 LineTo(ix , iy+0.19098*m);
1017 LineTo(ix+0.29389*m , iy+0.40451*m);
1018 LineTo(ix+0.181635*m, iy+0.05902*m);
1019 LineTo(ix+0.47552*m , iy-0.15451*m);
1020 LineTo(ix+0.112255*m, iy-0.15451*m);
1021 PrintFast(2," h");
1022 } else if (ms == 35 ) {
1023 MoveTo(ix-m2, iy );
1024 LineTo(ix , iy-m2);
1025 LineTo(ix+m2, iy );
1026 LineTo(ix , iy+m2);
1027 LineTo(ix-m2, iy );
1028 LineTo(ix+m2, iy );
1029 LineTo(ix , iy+m2);
1030 LineTo(ix , iy-m2);
1031 PrintFast(2," h");
1032 } else if (ms == 36 ) {
1033 MoveTo(ix-m2, iy-m2);
1034 LineTo(ix+m2, iy-m2);
1035 LineTo(ix+m2, iy+m2);
1036 LineTo(ix-m2, iy+m2);
1037 LineTo(ix-m2, iy-m2);
1038 LineTo(ix+m2, iy+m2);
1039 LineTo(ix-m2, iy+m2);
1040 LineTo(ix+m2, iy-m2);
1041 PrintFast(2," h");
1042 } else if (ms == 37 || ms == 39 ) {
1043 MoveTo(ix , iy );
1044 LineTo(ix-m8, iy+m2);
1045 LineTo(ix-m2, iy );
1046 LineTo(ix , iy );
1047 LineTo(ix-m8, iy-m2);
1048 LineTo(ix+m8, iy-m2);
1049 LineTo(ix , iy );
1050 LineTo(ix+m2, iy );
1051 LineTo(ix+m8, iy+m2);
1052 LineTo(ix , iy );
1053 PrintFast(2," h");
1054 } else if (ms == 38 ) {
1055 MoveTo(ix-m2, iy );
1056 LineTo(ix-m2, iy-m8);
1057 LineTo(ix-m8, iy-m2);
1058 LineTo(ix+m8, iy-m2);
1059 LineTo(ix+m2, iy-m8);
1060 LineTo(ix+m2, iy+m8);
1061 LineTo(ix+m8, iy+m2);
1062 LineTo(ix-m8, iy+m2);
1063 LineTo(ix-m2, iy+m8);
1064 LineTo(ix-m2, iy );
1065 LineTo(ix+m2, iy );
1066 LineTo(ix , iy );
1067 LineTo(ix , iy-m2);
1068 LineTo(ix , iy+m2);
1069 LineTo(ix , iy );
1070 PrintFast(2," h");
1071 } else if (ms == 40 || ms == 41 ) {
1072 MoveTo(ix , iy );
1073 LineTo(ix+m8, iy+m2);
1074 LineTo(ix+m2, iy+m8);
1075 LineTo(ix , iy );
1076 LineTo(ix+m2, iy-m8);
1077 LineTo(ix+m8, iy-m2);
1078 LineTo(ix , iy );
1079 LineTo(ix-m8, iy-m2);
1080 LineTo(ix-m2, iy-m8);
1081 LineTo(ix , iy );
1082 LineTo(ix-m2, iy+m8);
1083 LineTo(ix-m8, iy+m2);
1084 LineTo(ix , iy );
1085 PrintFast(2," h");
1086 } else if (ms == 42 || ms == 43 ) {
1087 MoveTo(ix , iy+m2);
1088 LineTo(ix-m9, iy+m9);
1089 LineTo(ix-m2, iy );
1090 LineTo(ix-m9, iy-m9);
1091 LineTo(ix , iy-m2);
1092 LineTo(ix+m9, iy-m9);
1093 LineTo(ix+m2, iy );
1094 LineTo(ix+m9, iy+m9);
1095 LineTo(ix , iy+m2);
1096 PrintFast(2," h");
1097 } else if (ms == 44 ) {
1098 MoveTo(ix , iy );
1099 LineTo(ix+m8, iy+m2);
1100 LineTo(ix-m8, iy+m2);
1101 LineTo(ix+m8, iy-m2);
1102 LineTo(ix-m8, iy-m2);
1103 LineTo(ix , iy );
1104 LineTo(ix+m2, iy+m8);
1105 LineTo(ix+m2, iy-m8);
1106 LineTo(ix-m2, iy+m8);
1107 LineTo(ix-m2, iy-m8);
1108 LineTo(ix , iy );
1109 PrintFast(2," h");
1110 } else if (ms == 45 ) {
1111 MoveTo(ix+m6/2., iy+m6/2.);
1112 LineTo(ix+m8, iy+m2);
1113 LineTo(ix-m8, iy+m2);
1114 LineTo(ix-m6/2., iy+m6/2.);
1115 LineTo(ix-m2, iy+m8);
1116 LineTo(ix-m2, iy-m8);
1117 LineTo(ix-m6/2., iy-m6/2.);
1118 LineTo(ix-m8, iy-m2);
1119 LineTo(ix+m8, iy-m2);
1120 LineTo(ix+m6/2., iy-m6/2.);
1121 LineTo(ix+m2, iy-m8);
1122 LineTo(ix+m2, iy+m8);
1123 LineTo(ix+m6/2., iy+m6/2.);
1124 PrintFast(2," h");
1125 } else if (ms == 46 || ms == 47 ) {
1126 MoveTo(ix , iy+m8);
1127 LineTo(ix-m8, iy+m2);
1128 LineTo(ix-m2, iy+m8);
1129 LineTo(ix-m8, iy );
1130 LineTo(ix-m2, iy-m8);
1131 LineTo(ix-m8, iy-m2);
1132 LineTo(ix , iy-m8);
1133 LineTo(ix+m8, iy-m2);
1134 LineTo(ix+m2, iy-m8);
1135 LineTo(ix+m8, iy );
1136 LineTo(ix+m2, iy+m8);
1137 LineTo(ix+m8, iy+m2);
1138 LineTo(ix , iy+m8);
1139 PrintFast(2," h");
1140 } else if (ms == 48 ) {
1141 MoveTo(ix , iy+m8*1.005);
1142 LineTo(ix-m8, iy+m2);
1143 LineTo(ix-m2, iy+m8);
1144 LineTo(ix-m8, iy );
1145 LineTo(ix-m2, iy-m8);
1146 LineTo(ix-m8, iy-m2);
1147 LineTo(ix , iy-m8);
1148 LineTo(ix+m8, iy-m2);
1149 LineTo(ix+m2, iy-m8);
1150 LineTo(ix+m8, iy );
1151 LineTo(ix+m2, iy+m8);
1152 LineTo(ix+m8, iy+m2);
1153 LineTo(ix , iy+m8*0.995);
1154 LineTo(ix+m8*0.995, iy );
1155 LineTo(ix , iy-m8*0.995);
1156 LineTo(ix-m8*0.995, iy );
1157 LineTo(ix , iy+m8*0.995);
1158 PrintFast(2," h");
1159 } else if (ms == 49 ) {
1160 MoveTo(ix-m6, iy-m6*1.01);
1161 LineTo(ix-m6, iy-m2);
1162 LineTo(ix+m6, iy-m2);
1163 LineTo(ix+m6, iy-m6);
1164 LineTo(ix+m2, iy-m6);
1165 LineTo(ix+m2, iy+m6);
1166 LineTo(ix+m6, iy+m6);
1167 LineTo(ix+m6, iy+m2);
1168 LineTo(ix-m6, iy+m2);
1169 LineTo(ix-m6, iy+m6);
1170 LineTo(ix-m2, iy+m6);
1171 LineTo(ix-m2, iy-m6);
1172 LineTo(ix-m6, iy-m6*0.99);
1173 LineTo(ix-m6, iy+m6);
1174 LineTo(ix+m6, iy+m6);
1175 LineTo(ix+m6, iy-m6);
1176 MoveTo(ix-m6, iy-m6*1.01);
1177 PrintFast(2," h");
1178 } else {
1179 MoveTo(ix-1, iy);
1180 LineTo(ix , iy);
1181 }
1182 if ((ms > 19 && ms < 24) || ms == 29 || ms == 33 || ms == 34 ||
1183 ms == 39 || ms == 41 || ms == 43 || ms == 45 ||
1184 ms == 47 || ms == 48 || ms == 49) {
1185 PrintFast(2," f");
1186 } else {
1187 PrintFast(2," S");
1188 }
1189 }
1190
1191 SetLineStyle(linestylesav);
1192 SetLineWidth(linewidthsav);
1193}
1194
1195////////////////////////////////////////////////////////////////////////////////
1196/// Draw a PolyLine
1197///
1198/// Draw a polyline through the points xw,yw.
1199///
1200/// - If nn=1 moves only to point xw,yw.
1201/// - If nn=0 the XW(1) and YW(1) are written in the PDF file
1202/// according to the current NT.
1203/// - If nn>0 the line is clipped as a line.
1204/// - If nn<0 the line is clipped as a fill area.
1205
1207{
1208 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1209 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1210 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1211 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1212 180, 90,135, 45,150, 30,120, 60,
1213 180, 90,135, 45,150, 30,120, 60};
1214 Int_t n = 0, fais = 0 , fasi = 0;
1215
1216 Style_t linestylesav = fLineStyle;
1217 Width_t linewidthsav = fLineWidth;
1218
1219 if (nn > 0) {
1220 if (fLineWidth<=0) return;
1221 n = nn;
1225 }
1226 if (nn < 0) {
1227 n = -nn;
1228 SetLineStyle(1);
1229 SetLineWidth(1);
1231 fais = fFillStyle/1000;
1232 fasi = fFillStyle%1000;
1233 if (fais == 3 || fais == 2) {
1234 if (fasi > 100 && fasi <125) {
1235 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1236 SetLineStyle(linestylesav);
1237 SetLineWidth(linewidthsav);
1238 return;
1239 }
1240 if (fasi > 0 && fasi < 26) {
1242 }
1243 }
1244 }
1245
1246 WriteReal(XtoPDF(xw[0]));
1247 WriteReal(YtoPDF(yw[0]));
1248 if (n <= 1) {
1249 if (n == 0) return;
1250 PrintFast(2," m");
1251 return;
1252 }
1253
1254 PrintFast(2," m");
1255
1256 for (Int_t i=1;i<n;i++) LineTo(XtoPDF(xw[i]), YtoPDF(yw[i]));
1257
1258 if (nn > 0) {
1259 if (xw[0] == xw[n-1] && yw[0] == yw[n-1]) PrintFast(2," h");
1260 PrintFast(2," S");
1261 } else {
1262 if (fais == 0) {PrintFast(2," s"); return;}
1263 if (fais == 3 || fais == 2) {
1264 if (fasi > 0 && fasi < 26) {
1265 PrintFast(3," f*");
1266 fRed = -1;
1267 fGreen = -1;
1268 fBlue = -1;
1269 fAlpha = -1.;
1270 }
1271 SetLineStyle(linestylesav);
1272 SetLineWidth(linewidthsav);
1273 return;
1274 }
1275 PrintFast(3," f*");
1276 }
1277
1278 SetLineStyle(linestylesav);
1279 SetLineWidth(linewidthsav);
1280}
1281
1282////////////////////////////////////////////////////////////////////////////////
1283/// Draw a PolyLine
1284///
1285/// Draw a polyline through the points xw,yw.
1286///
1287/// - If nn=1 moves only to point xw,yw.
1288/// - If nn=0 the xw(1) and YW(1) are written in the PDF file
1289/// according to the current NT.
1290/// - If nn>0 the line is clipped as a line.
1291/// - If nn<0 the line is clipped as a fill area.
1292
1294{
1295 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1296 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1297 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1298 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1299 180, 90,135, 45,150, 30,120, 60,
1300 180, 90,135, 45,150, 30,120, 60};
1301 Int_t n = 0, fais = 0, fasi = 0;
1302
1303 Style_t linestylesav = fLineStyle;
1304 Width_t linewidthsav = fLineWidth;
1305
1306 if (nn > 0) {
1307 if (fLineWidth<=0) return;
1308 n = nn;
1312 }
1313 if (nn < 0) {
1314 n = -nn;
1315 SetLineStyle(1);
1316 SetLineWidth(1);
1318 fais = fFillStyle/1000;
1319 fasi = fFillStyle%1000;
1320 if (fais == 3 || fais == 2) {
1321 if (fasi > 100 && fasi <125) {
1322 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1323 SetLineStyle(linestylesav);
1324 SetLineWidth(linewidthsav);
1325 return;
1326 }
1327 if (fasi > 0 && fasi < 26) {
1329 }
1330 }
1331 }
1332
1333 WriteReal(XtoPDF(xw[0]));
1334 WriteReal(YtoPDF(yw[0]));
1335 if (n <= 1) {
1336 if (n == 0) return;
1337 PrintFast(2," m");
1338 return;
1339 }
1340
1341 PrintFast(2," m");
1342
1343 for (Int_t i=1;i<n;i++) LineTo(XtoPDF(xw[i]), YtoPDF(yw[i]));
1344
1345 if (nn > 0) {
1346 if (xw[0] == xw[n-1] && yw[0] == yw[n-1]) PrintFast(2," h");
1347 PrintFast(2," S");
1348 } else {
1349 if (fais == 0) {PrintFast(2," s"); return;}
1350 if (fais == 3 || fais == 2) {
1351 if (fasi > 0 && fasi < 26) {
1352 PrintFast(3," f*");
1353 fRed = -1;
1354 fGreen = -1;
1355 fBlue = -1;
1356 fAlpha = -1.;
1357 }
1358 SetLineStyle(linestylesav);
1359 SetLineWidth(linewidthsav);
1360 return;
1361 }
1362 PrintFast(3," f*");
1363 }
1364
1365 SetLineStyle(linestylesav);
1366 SetLineWidth(linewidthsav);
1367}
1368
1369////////////////////////////////////////////////////////////////////////////////
1370/// Font encoding
1371
1373{
1374 static const char *sdtfonts[] = {
1375 "/Times-Italic" , "/Times-Bold" , "/Times-BoldItalic",
1376 "/Helvetica" , "/Helvetica-Oblique" , "/Helvetica-Bold" ,
1377 "/Helvetica-BoldOblique", "/Courier" , "/Courier-Oblique" ,
1378 "/Courier-Bold" , "/Courier-BoldOblique", "/Symbol" ,
1379 "/Times-Roman" , "/ZapfDingbats" , "/Symbol"};
1380
1381 for (Int_t i=0; i<kNumberOfFonts; i++) {
1383 PrintStr("<<@");
1384 PrintStr("/Type /Font@");
1385 PrintStr("/Subtype /Type1@");
1386 PrintStr("/Name /F");
1387 WriteInteger(i+1,0);
1388 PrintStr("@");
1389 PrintStr("/BaseFont ");
1390 PrintStr(sdtfonts[i]);
1391 PrintStr("@");
1392 if (i!=11 && i!=13 && i!=14) {
1393 PrintStr("/Encoding /WinAnsiEncoding");
1394 PrintStr("@");
1395 }
1396 PrintStr(">>@");
1397 PrintStr("endobj@");
1398 }
1399}
1400
1401////////////////////////////////////////////////////////////////////////////////
1402/// Draw a line to a new position
1403
1405{
1406 WriteReal(x);
1407 WriteReal(y);
1408 PrintFast(2," l");
1409}
1410
1411////////////////////////////////////////////////////////////////////////////////
1412/// Move to a new position
1413
1415{
1416 WriteReal(x);
1417 WriteReal(y);
1418 PrintFast(2," m");
1419}
1420
1421////////////////////////////////////////////////////////////////////////////////
1422/// Create a new object in the PDF file
1423
1425{
1426 if (!fObjPos || n >= fObjPosSize) {
1427 Int_t newN = TMath::Max(2*fObjPosSize,n+1);
1428 Int_t *saveo = new Int_t [newN];
1429 if (fObjPos && fObjPosSize) {
1430 memcpy(saveo,fObjPos,fObjPosSize*sizeof(Int_t));
1431 memset(&saveo[fObjPosSize],0,(newN-fObjPosSize)*sizeof(Int_t));
1432 delete [] fObjPos;
1433 }
1434 fObjPos = saveo;
1435 fObjPosSize = newN;
1436 }
1437 fObjPos[n-1] = fNByte;
1439 WriteInteger(n, 0);
1440 PrintStr(" 0 obj");
1441 PrintStr("@");
1442}
1443
1444////////////////////////////////////////////////////////////////////////////////
1445/// Start a new PDF page.
1446
1448{
1449 if (!fPageNotEmpty) return;
1450
1451 // Compute pad conversion coefficients
1452 if (gPad) {
1453 Double_t ww = gPad->GetWw();
1454 Double_t wh = gPad->GetWh();
1455 fYsize = fXsize*wh/ww;
1456 } else {
1457 fYsize = 27;
1458 }
1459
1460 fNbPage++;
1461
1462 if (fNbPage>1) {
1463 // Close the currently opened page
1465 PrintStr("endstream@");
1466 Int_t streamLength = fNByte-fStartStream-10;
1467 PrintStr("endobj@");
1469 WriteInteger(streamLength, 0);
1470 PrintStr("@");
1471 PrintStr("endobj@");
1473 PrintStr("<<@");
1474 if (!strstr(GetTitle(),"PDF")) {
1475 PrintStr("/Title (");
1476 PrintStr(GetTitle());
1477 PrintStr(")@");
1478 } else {
1479 PrintStr("/Title (Page");
1481 PrintStr(")@");
1482 }
1483 PrintStr("/Dest [");
1485 PrintStr(" 0 R /XYZ null null 0]@");
1486 PrintStr("/Parent");
1488 PrintStr(" 0 R");
1489 PrintStr("@");
1490 PrintStr("/Next");
1492 PrintStr(" 0 R");
1493 PrintStr("@");
1494 if (fNbPage>2) {
1495 PrintStr("/Prev");
1497 PrintStr(" 0 R");
1498 PrintStr("@");
1499 }
1500 PrintStr(">>@");
1501 }
1502
1503 // Start a new page
1505 PrintStr("<<@");
1506 PrintStr("/Type /Page@");
1507 PrintStr("@");
1508 PrintStr("/Parent");
1510 PrintStr(" 0 R");
1511 PrintStr("@");
1512
1513 Double_t xlow=0, ylow=0, xup=1, yup=1;
1514 if (gPad) {
1515 xlow = gPad->GetAbsXlowNDC();
1516 xup = xlow + gPad->GetAbsWNDC();
1517 ylow = gPad->GetAbsYlowNDC();
1518 yup = ylow + gPad->GetAbsHNDC();
1519 }
1520
1521 PrintStr("/MediaBox [");
1523 switch (fPageFormat) {
1524 case 100 :
1525 width = 8.5*2.54;
1526 height = 11.*2.54;
1527 break;
1528 case 200 :
1529 width = 8.5*2.54;
1530 height = 14.*2.54;
1531 break;
1532 case 300 :
1533 width = 11.*2.54;
1534 height = 17.*2.54;
1535 break;
1536 default :
1539 };
1540 WriteReal(CMtoPDF(fXsize*xlow));
1541 WriteReal(CMtoPDF(fYsize*ylow));
1544 PrintStr("]");
1545 PrintStr("@");
1546
1547 Double_t xmargin = CMtoPDF(0.7);
1548 Double_t ymargin = 0;
1549 if (fPageOrientation == 1) ymargin = CMtoPDF(TMath::Sqrt(2.)*0.7);
1550 if (fPageOrientation == 2) ymargin = CMtoPDF(height)-CMtoPDF(0.7);
1551
1552 PrintStr("/CropBox [");
1553 if (fPageOrientation == 1) {
1554 WriteReal(xmargin);
1555 WriteReal(ymargin);
1556 WriteReal(xmargin+CMtoPDF(fXsize*xup));
1557 WriteReal(ymargin+CMtoPDF(fYsize*yup));
1558 }
1559 if (fPageOrientation == 2) {
1560 WriteReal(xmargin);
1561 WriteReal(CMtoPDF(height)-CMtoPDF(fXsize*xup)-xmargin);
1562 WriteReal(xmargin+CMtoPDF(fYsize*yup));
1563 WriteReal(CMtoPDF(height)-xmargin);
1564 }
1565 PrintStr("]");
1566 PrintStr("@");
1567
1568 if (fPageOrientation == 1) PrintStr("/Rotate 0@");
1569 if (fPageOrientation == 2) PrintStr("/Rotate 90@");
1570
1571 PrintStr("/Resources");
1573 PrintStr(" 0 R");
1574 PrintStr("@");
1575
1576 PrintStr("/Contents");
1578 PrintStr(" 0 R@");
1579 PrintStr(">>@");
1580 PrintStr("endobj@");
1581
1583 PrintStr("<<@");
1584 PrintStr("/Length");
1586 PrintStr(" 0 R@");
1587 PrintStr("/Filter [/FlateDecode]@");
1588 PrintStr(">>@");
1589 PrintStr("stream@");
1591 fCompress = kTRUE;
1592
1593 // Force the line width definition next time TPDF::SetLineWidth will be called.
1594 fLineWidth = -1;
1595
1596 // Force the color definition next time TPDF::SetColor will be called.
1597 fRed = -1;
1598 fGreen = -1;
1599 fBlue = -1;
1600 fAlpha = -1.;
1601
1602 PrintStr("1 0 0 1");
1603 if (fPageOrientation == 2) {
1604 ymargin = CMtoPDF(height)-CMtoPDF(fXsize*xup)-xmargin;
1605 xmargin = xmargin+CMtoPDF(fYsize*yup);
1606 }
1607 WriteReal(xmargin);
1608 WriteReal(ymargin);
1609 PrintStr(" cm");
1610 if (fPageOrientation == 2) PrintStr(" 0 1 -1 0 0 0 cm");
1611 if (fgLineJoin) {
1613 PrintFast(2," j");
1614 }
1615 if (fgLineCap) {
1617 PrintFast(2," J");
1618 }
1619}
1620
1621////////////////////////////////////////////////////////////////////////////////
1622/// Deactivate an already open PDF file
1623
1625{
1626 gVirtualPS = nullptr;
1627}
1628
1629////////////////////////////////////////////////////////////////////////////////
1630/// Activate an already open PDF file
1631
1633{
1634 // fType is used to know if the PDF file is open. Unlike TPostScript, TPDF
1635 // has no "workstation type".
1636
1637 if (!fType) {
1638 Error("On", "no PDF file open");
1639 Off();
1640 return;
1641 }
1642 gVirtualPS = this;
1643}
1644
1645////////////////////////////////////////////////////////////////////////////////
1646/// Open a PDF file
1647
1648void TPDF::Open(const char *fname, Int_t wtype)
1649{
1650 Int_t i;
1651
1652 if (fStream) {
1653 Warning("Open", "PDF file already open");
1654 return;
1655 }
1656
1657 fLenBuffer = 0;
1658 fRed = -1;
1659 fGreen = -1;
1660 fBlue = -1;
1661 fAlpha = -1.;
1662 fType = abs(wtype);
1667 Float_t xrange, yrange;
1668 if (gPad) {
1669 Double_t ww = gPad->GetWw();
1670 Double_t wh = gPad->GetWh();
1671 if (fType == 113) {
1672 ww *= gPad->GetWNDC();
1673 wh *= gPad->GetHNDC();
1674 }
1675 Double_t ratio = wh/ww;
1676 xrange = fXsize;
1677 yrange = fXsize*ratio;
1678 if (yrange > fYsize) { yrange = fYsize; xrange = yrange/ratio;}
1679 fXsize = xrange; fYsize = yrange;
1680 }
1681
1682 // Open OS file
1683 fStream = new std::ofstream();
1684#ifdef R__WIN32
1685 fStream->open(fname, std::ofstream::out | std::ofstream::binary);
1686#else
1687 fStream->open(fname, std::ofstream::out);
1688#endif
1689 if (!fStream || !fStream->good()) {
1690 printf("ERROR in TPDF::Open: Cannot open file:%s\n",fname);
1691 if (!fStream) return;
1692 }
1693
1694 gVirtualPS = this;
1695
1696 for (i=0; i<fSizBuffer; i++) fBuffer[i] = ' ';
1697
1698 // The page orientation is last digit of PDF workstation type
1699 // orientation = 1 for portrait
1700 // orientation = 2 for landscape
1702 if (fPageOrientation < 1 || fPageOrientation > 2) {
1703 Error("Open", "Invalid page orientation %d", fPageOrientation);
1704 return;
1705 }
1706
1707 // format = 0-99 is the European page format (A4,A3 ...)
1708 // format = 100 is the US format 8.5x11.0 inch
1709 // format = 200 is the US format 8.5x14.0 inch
1710 // format = 300 is the US format 11.0x17.0 inch
1711 fPageFormat = fType/1000;
1712 if (fPageFormat == 0) fPageFormat = 4;
1713 if (fPageFormat == 99) fPageFormat = 0;
1714
1715 fRange = kFALSE;
1716
1717 // Set a default range
1719
1720 fObjPos = nullptr;
1721 fObjPosSize = 0;
1722 fNbObj = 0;
1723 fNbPage = 0;
1724
1725 PrintStr("%PDF-1.4@");
1726 PrintStr("%\342\343\317\323");
1727 PrintStr("@");
1728
1730 PrintStr("<<@");
1731 PrintStr("/Type /Catalog@");
1732 PrintStr("/Pages");
1734 PrintStr(" 0 R@");
1735 PrintStr("/Outlines");
1737 PrintStr(" 0 R@");
1738 PrintStr("/PageMode /UseOutlines@");
1739 PrintStr(">>@");
1740 PrintStr("endobj@");
1741
1743 PrintStr("<<@");
1744 PrintStr("/Creator (ROOT Version ");
1745 PrintStr(gROOT->GetVersion());
1746 PrintStr(")");
1747 PrintStr("@");
1748 PrintStr("/CreationDate (");
1749 TDatime t;
1750 Int_t toff = t.Convert(kFALSE) - t.Convert(kTRUE); // time zone and dst offset
1751 toff = toff/60;
1752 char str[24];
1753 snprintf(str,24,"D:%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d%c%2.2d'%2.2d'",
1754 t.GetYear() , t.GetMonth(),
1755 t.GetDay() , t.GetHour(),
1756 t.GetMinute(), t.GetSecond(),
1757 toff < 0 ? '-' : '+',
1758 // TMath::Abs(toff/60), TMath::Abs(toff%60)); // format-truncation warning
1759 TMath::Abs(toff/60) & 0x3F, TMath::Abs(toff%60) & 0x3F); // now 2 digits
1760 PrintStr(str);
1761 PrintStr(")");
1762 PrintStr("@");
1763 PrintStr("/ModDate (");
1764 PrintStr(str);
1765 PrintStr(")");
1766 PrintStr("@");
1767 PrintStr("/Title (");
1768 if (strlen(GetName())<=80) PrintStr(GetName());
1769 PrintStr(")");
1770 PrintStr("@");
1771 PrintStr("/Keywords (ROOT)@");
1772 PrintStr(">>@");
1773 PrintStr("endobj@");
1774
1776 PrintStr("<<@");
1777 PrintStr("/ProcSet [/PDF /Text]@");
1778
1779 PrintStr("/Font@");
1780 PrintStr("<<@");
1781 for (i=0; i<kNumberOfFonts; i++) {
1782 PrintStr(" /F");
1783 WriteInteger(i+1,0);
1785 PrintStr(" 0 R");
1786 }
1787 PrintStr("@");
1788 PrintStr(">>@");
1789
1790 PrintStr("/ExtGState");
1792 PrintStr(" 0 R @");
1793 if (fAlphas.size()) fAlphas.clear();
1794
1795 PrintStr("/ColorSpace << /Cs8");
1797 PrintStr(" 0 R >>");
1798 PrintStr("@");
1799 PrintStr("/Pattern");
1801 PrintStr(" 0 R");
1802 PrintStr("@");
1803 PrintStr(">>@");
1804 PrintStr("endobj@");
1805
1806 FontEncode();
1807 PatternEncode();
1808
1809 NewPage();
1811}
1812
1813////////////////////////////////////////////////////////////////////////////////
1814/// Output the string str in the output buffer
1815
1816void TPDF::PrintStr(const char *str)
1817{
1818 Int_t len = strlen(str);
1819 if (len == 0) return;
1821
1822 if (fCompress) {
1823 if (fLenBuffer+len >= fSizBuffer) {
1826 }
1827 strcpy(fBuffer + fLenBuffer, str);
1828 fLenBuffer += len;
1829 return;
1830 }
1831
1833}
1834
1835////////////////////////////////////////////////////////////////////////////////
1836/// Fast version of Print
1837
1838void TPDF::PrintFast(Int_t len, const char *str)
1839{
1841 if (fCompress) {
1842 if (fLenBuffer+len >= fSizBuffer) {
1845 }
1846 strcpy(fBuffer + fLenBuffer, str);
1847 fLenBuffer += len;
1848 return;
1849 }
1850
1852}
1853
1854////////////////////////////////////////////////////////////////////////////////
1855/// Set the range for the paper in centimetres
1856
1857void TPDF::Range(Float_t xsize, Float_t ysize)
1858{
1859 fXsize = xsize;
1860 fYsize = ysize;
1861 fRange = kTRUE;
1862}
1863
1864////////////////////////////////////////////////////////////////////////////////
1865/// Set the alpha channel value.
1866
1868{
1869 if (a == fAlpha) return;
1870 fAlpha = a;
1871 if (fAlpha <= 0.000001) fAlpha = 0;
1872
1873 Bool_t known = kFALSE;
1874 for (int i=0; i<(int)fAlphas.size(); i++) {
1875 if (fAlpha == fAlphas[i]) {
1876 known = kTRUE;
1877 break;
1878 }
1879 }
1880 if (!known) fAlphas.push_back(fAlpha);
1881 PrintStr(Form(" /ca%3.2f gs /CA%3.2f gs",fAlpha,fAlpha));
1882}
1883
1884////////////////////////////////////////////////////////////////////////////////
1885/// Set color with its color index.
1886
1888{
1889 if (color < 0) color = 0;
1890 TColor *col = gROOT->GetColor(color);
1891
1892 if (col) {
1893 SetColor(col->GetRed(), col->GetGreen(), col->GetBlue());
1894 SetAlpha(col->GetAlpha());
1895 } else {
1896 SetColor(1., 1., 1.);
1897 SetAlpha(1.);
1898 }
1899}
1900
1901////////////////////////////////////////////////////////////////////////////////
1902/// Set color with its R G B components:
1903///
1904/// - r: % of red in [0,1]
1905/// - g: % of green in [0,1]
1906/// - b: % of blue in [0,1]
1907
1909{
1910 if (r == fRed && g == fGreen && b == fBlue) return;
1911
1912 fRed = r;
1913 fGreen = g;
1914 fBlue = b;
1915 if (fRed <= 0.000001) fRed = 0;
1916 if (fGreen <= 0.000001) fGreen = 0;
1917 if (fBlue <= 0.000001) fBlue = 0;
1918
1919 if (gStyle->GetColorModelPS()) {
1920 Double_t colCyan, colMagenta, colYellow;
1921 Double_t colBlack = TMath::Min(TMath::Min(1-fRed,1-fGreen),1-fBlue);
1922 if (colBlack==1) {
1923 colCyan = 0;
1924 colMagenta = 0;
1925 colYellow = 0;
1926 } else {
1927 colCyan = (1-fRed-colBlack)/(1-colBlack);
1928 colMagenta = (1-fGreen-colBlack)/(1-colBlack);
1929 colYellow = (1-fBlue-colBlack)/(1-colBlack);
1930 }
1931 if (colCyan <= 0.000001) colCyan = 0;
1932 if (colMagenta <= 0.000001) colMagenta = 0;
1933 if (colYellow <= 0.000001) colYellow = 0;
1934 if (colBlack <= 0.000001) colBlack = 0;
1935 WriteReal(colCyan);
1936 WriteReal(colMagenta);
1937 WriteReal(colYellow);
1938 WriteReal(colBlack);
1939 PrintFast(2," K");
1940 WriteReal(colCyan);
1941 WriteReal(colMagenta);
1942 WriteReal(colYellow);
1943 WriteReal(colBlack);
1944 PrintFast(2," k");
1945 } else {
1946 WriteReal(fRed);
1949 PrintFast(3," RG");
1950 WriteReal(fRed);
1953 PrintFast(3," rg");
1954 }
1955}
1956
1957////////////////////////////////////////////////////////////////////////////////
1958/// Set color index for fill areas
1959
1961{
1963}
1964
1965////////////////////////////////////////////////////////////////////////////////
1966/// Set the fill patterns (1 to 25) for fill areas
1967
1969{
1970 char cpat[10];
1971 TColor *col = gROOT->GetColor(color);
1972 if (!col) return;
1973 PrintStr(" /Cs8 cs");
1974 Double_t colRed = col->GetRed();
1975 Double_t colGreen = col->GetGreen();
1976 Double_t colBlue = col->GetBlue();
1977 if (gStyle->GetColorModelPS()) {
1978 Double_t colBlack = TMath::Min(TMath::Min(1-colRed,1-colGreen),1-colBlue);
1979 if (colBlack==1) {
1980 WriteReal(0);
1981 WriteReal(0);
1982 WriteReal(0);
1983 WriteReal(colBlack);
1984 } else {
1985 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
1986 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
1987 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
1988 WriteReal(colCyan);
1989 WriteReal(colMagenta);
1990 WriteReal(colYellow);
1991 WriteReal(colBlack);
1992 }
1993 } else {
1994 WriteReal(colRed);
1995 WriteReal(colGreen);
1996 WriteReal(colBlue);
1997 }
1998
1999 if (fPageOrientation == 2) {
2000 switch (ipat) {
2001 case 4: ipat = 5; break;
2002 case 5: ipat = 4; break;
2003 case 6: ipat = 7; break;
2004 case 7: ipat = 6; break;
2005 case 17: ipat = 18; break;
2006 case 18: ipat = 17; break;
2007 case 20: ipat = 16; break;
2008 case 16: ipat = 20; break;
2009 case 21: ipat = 22; break;
2010 case 22: ipat = 21; break;
2011 }
2012 }
2013 snprintf(cpat,10," /P%2.2d scn", ipat);
2014 PrintStr(cpat);
2015}
2016
2017////////////////////////////////////////////////////////////////////////////////
2018/// Set color index for lines
2019
2021{
2023}
2024
2025////////////////////////////////////////////////////////////////////////////////
2026/// Set the value of the global parameter TPDF::fgLineJoin.
2027/// This parameter determines the appearance of joining lines in a PDF
2028/// output.
2029/// It takes one argument which may be:
2030/// - 0 (miter join)
2031/// - 1 (round join)
2032/// - 2 (bevel join)
2033/// The default value is 0 (miter join).
2034///
2035/// \image html postscript_1.png
2036///
2037/// To change the line join behaviour just do:
2038/// ~~~ {.cpp}
2039/// gStyle->SetJoinLinePS(2); // Set the PDF line join to bevel.
2040/// ~~~
2041
2042void TPDF::SetLineJoin( Int_t linejoin )
2043{
2044 fgLineJoin = linejoin;
2045 if (fgLineJoin<0) fgLineJoin=0;
2046 if (fgLineJoin>2) fgLineJoin=2;
2047}
2048
2049////////////////////////////////////////////////////////////////////////////////
2050/// Set the value of the global parameter TPDF::fgLineCap.
2051/// This parameter determines the appearance of line caps in a PDF
2052/// output.
2053/// It takes one argument which may be:
2054/// - 0 (butt caps)
2055/// - 1 (round caps)
2056/// - 2 (projecting caps)
2057/// The default value is 0 (butt caps).
2058///
2059/// \image html postscript_2.png
2060///
2061/// To change the line cap behaviour just do:
2062/// ~~~ {.cpp}
2063/// gStyle->SetCapLinePS(2); // Set the PDF line cap to projecting.
2064/// ~~~
2065
2067{
2068 fgLineCap = linecap;
2069 if (fgLineCap<0) fgLineCap=0;
2070 if (fgLineCap>2) fgLineCap=2;
2071}
2072
2073////////////////////////////////////////////////////////////////////////////////
2074/// Change the line style
2075///
2076/// - linestyle = 2 dashed
2077/// - linestyle = 3 dotted
2078/// - linestyle = 4 dash-dotted
2079/// - linestyle = else solid (1 in is used most of the time)
2080
2082{
2083 if ( linestyle == fLineStyle) return;
2084 fLineStyle = linestyle;
2085 TString st = (TString)gStyle->GetLineStyleString(linestyle);
2086 PrintFast(2," [");
2087 TObjArray *tokens = st.Tokenize(" ");
2088 for (Int_t j = 0; j<tokens->GetEntries(); j++) {
2089 Int_t it;
2090 sscanf(((TObjString*)tokens->At(j))->GetName(), "%d", &it);
2091 WriteInteger((Int_t)(it/4));
2092 }
2093 delete tokens;
2094 PrintFast(5,"] 0 d");
2095}
2096
2097////////////////////////////////////////////////////////////////////////////////
2098/// Change the line width
2099
2101{
2102 if (linewidth == fLineWidth) return;
2103 fLineWidth = linewidth;
2104 if (fLineWidth!=0) {
2106 PrintFast(2," w");
2107 }
2108}
2109
2110////////////////////////////////////////////////////////////////////////////////
2111/// Set color index for markers.
2112
2114{
2116}
2117
2118////////////////////////////////////////////////////////////////////////////////
2119/// Set color index for text
2120
2122{
2124}
2125
2126////////////////////////////////////////////////////////////////////////////////
2127/// Draw text
2128///
2129/// - xx: x position of the text
2130/// - yy: y position of the text
2131/// - chars: text to be drawn
2132
2133void TPDF::Text(Double_t xx, Double_t yy, const char *chars)
2134{
2135 if (fTextSize <= 0) return;
2136
2137 const Double_t kDEGRAD = TMath::Pi()/180.;
2138 char str[8];
2139 Double_t x = xx;
2140 Double_t y = yy;
2141
2142 // Font and text size
2143 Int_t font = abs(fTextFont)/10;
2144 if (font > kNumberOfFonts || font < 1) font = 1;
2145
2146 Double_t wh = (Double_t)gPad->XtoPixel(gPad->GetX2());
2147 Double_t hh = (Double_t)gPad->YtoPixel(gPad->GetY1());
2148 Float_t tsize, ftsize;
2149 if (wh < hh) {
2150 tsize = fTextSize*wh;
2151 Int_t sizeTTF = (Int_t)(tsize*kScale+0.5); // TTF size
2152 ftsize = (sizeTTF*fXsize*gPad->GetAbsWNDC())/wh;
2153 } else {
2154 tsize = fTextSize*hh;
2155 Int_t sizeTTF = (Int_t)(tsize*kScale+0.5); // TTF size
2156 ftsize = (sizeTTF*fYsize*gPad->GetAbsHNDC())/hh;
2157 }
2158 Double_t fontsize = 72*(ftsize)/2.54;
2159 if (fontsize <= 0) return;
2160
2161 // Text color
2163
2164 // Clipping
2165 PrintStr(" q");
2166 Double_t x1 = XtoPDF(gPad->GetX1());
2167 Double_t x2 = XtoPDF(gPad->GetX2());
2168 Double_t y1 = YtoPDF(gPad->GetY1());
2169 Double_t y2 = YtoPDF(gPad->GetY2());
2170 WriteReal(x1);
2171 WriteReal(y1);
2172 WriteReal(x2 - x1);
2173 WriteReal(y2 - y1);
2174 PrintStr(" re W n");
2175
2176 // Start the text
2177 if (!fCompress) PrintStr("@");
2178
2179 // Text alignment
2180 Float_t tsizex = gPad->AbsPixeltoX(Int_t(tsize))-gPad->AbsPixeltoX(0);
2181 Float_t tsizey = gPad->AbsPixeltoY(0)-gPad->AbsPixeltoY(Int_t(tsize));
2182 Int_t txalh = fTextAlign/10;
2183 if (txalh < 1) txalh = 1; else if (txalh > 3) txalh = 3;
2184 Int_t txalv = fTextAlign%10;
2185 if (txalv < 1) txalv = 1; else if (txalv > 3) txalv = 3;
2186 if (txalv == 3) {
2187 y -= 0.8*tsizey*TMath::Cos(kDEGRAD*fTextAngle);
2188 x += 0.8*tsizex*TMath::Sin(kDEGRAD*fTextAngle);
2189 } else if (txalv == 2) {
2190 y -= 0.4*tsizey*TMath::Cos(kDEGRAD*fTextAngle);
2191 x += 0.4*tsizex*TMath::Sin(kDEGRAD*fTextAngle);
2192 }
2193
2194 if (txalh > 1) {
2195 TText t;
2196 UInt_t w=0, h;
2199 t.GetTextExtent(w, h, chars);
2200 Double_t twx = gPad->AbsPixeltoX(w)-gPad->AbsPixeltoX(0);
2201 Double_t twy = gPad->AbsPixeltoY(0)-gPad->AbsPixeltoY(w);
2202 if (txalh == 2) {
2203 x = x-(twx/2)*TMath::Cos(kDEGRAD*fTextAngle);
2204 y = y-(twy/2)*TMath::Sin(kDEGRAD*fTextAngle);
2205 }
2206 if (txalh == 3) {
2207 x = x-twx*TMath::Cos(kDEGRAD*fTextAngle);
2208 y = y-twy*TMath::Sin(kDEGRAD*fTextAngle);
2209 }
2210 }
2211
2212 // Text angle
2213 if (fTextAngle == 0) {
2214 PrintStr(" 1 0 0 1");
2215 WriteReal(XtoPDF(x));
2216 WriteReal(YtoPDF(y));
2217 } else if (fTextAngle == 90) {
2218 PrintStr(" 0 1 -1 0");
2219 WriteReal(XtoPDF(x));
2220 WriteReal(YtoPDF(y));
2221 } else if (fTextAngle == 270) {
2222 PrintStr(" 0 -1 1 0");
2223 WriteReal(XtoPDF(x));
2224 WriteReal(YtoPDF(y));
2225 } else {
2228 WriteReal(-TMath::Sin(kDEGRAD*fTextAngle));
2230 WriteReal(XtoPDF(x));
2231 WriteReal(YtoPDF(y));
2232 }
2233 PrintStr(" cm");
2234
2235 // Symbol Italic tan(15) = .26794
2236 if (font == 15) PrintStr(" 1 0 0.26794 1 0 0 cm");
2237
2238 PrintStr(" BT");
2239
2240 snprintf(str,8," /F%d",font);
2241 PrintStr(str);
2242 WriteReal(fontsize);
2243 PrintStr(" Tf");
2244
2245 const Int_t len=strlen(chars);
2246
2247 // Calculate the individual character placements.
2248 // Otherwise, if a string is printed in one line the kerning is not
2249 // performed. In order to measure the precise character positions we need to
2250 // trick FreeType into rendering high-resolution characters otherwise it will
2251 // stick to the screen pixel grid which is far worse than we can achieve on
2252 // print.
2253 const Float_t scale = 16.0;
2254 // Save current text attributes.
2255 TText saveAttText;
2256 saveAttText.TAttText::operator=(*this);
2257 TText t;
2258 t.SetTextSize(fTextSize * scale);
2260 UInt_t wa1=0, wa0=0;
2261 t.GetTextAdvance(wa0, chars, kFALSE);
2262 t.GetTextAdvance(wa1, chars);
2263 t.TAttText::Modify();
2265 if (wa0-wa1 != 0) kerning = kTRUE;
2266 else kerning = kFALSE;
2267 Int_t *charDeltas = nullptr;
2268 if (kerning) {
2269 charDeltas = new Int_t[len];
2270 for (Int_t i = 0;i < len;i++) {
2271 UInt_t ww=0;
2272 t.GetTextAdvance(ww, chars + i);
2273 charDeltas[i] = wa1 - ww;
2274 }
2275 for (Int_t i = len - 1;i > 0;i--) {
2276 charDeltas[i] -= charDeltas[i-1];
2277 }
2278 char tmp[2];
2279 tmp[1] = 0;
2280 for (Int_t i = 1;i < len;i++) {
2281 tmp[0] = chars[i-1];
2282 UInt_t width=0;
2283 t.GetTextAdvance(width, &tmp[0], kFALSE);
2284 Double_t wwl = gPad->AbsPixeltoX(width - charDeltas[i]) - gPad->AbsPixeltoX(0);
2285 wwl -= 0.5*(gPad->AbsPixeltoX(1) - gPad->AbsPixeltoX(0)); // half a pixel ~ rounding error
2286 charDeltas[i] = (Int_t)((1000.0/Float_t(fontsize))*(XtoPDF(wwl) - XtoPDF(0))/scale);
2287 }
2288 }
2289 // Restore text attributes.
2290 saveAttText.TAttText::Modify();
2291
2292 // Output the text. Escape some characters if needed
2293 if (kerning) PrintStr(" [");
2294 else PrintStr(" (");
2295
2296 for (Int_t i=0; i<len;i++) {
2297 if (chars[i]!='\n') {
2298 if (kerning) PrintStr("(");
2299 if (chars[i]=='(' || chars[i]==')') {
2300 snprintf(str,8,"\\%c",chars[i]);
2301 } else {
2302 snprintf(str,8,"%c",chars[i]);
2303 }
2304 PrintStr(str);
2305 if (kerning) {
2306 PrintStr(") ");
2307 if (i < len-1) {
2308 WriteInteger(charDeltas[i+1]);
2309 }
2310 }
2311 }
2312 }
2313
2314 if (kerning) PrintStr("] TJ ET Q");
2315 else PrintStr(") Tj ET Q");
2316 if (!fCompress) PrintStr("@");
2317 if (kerning) delete [] charDeltas;
2318}
2319
2320////////////////////////////////////////////////////////////////////////////////
2321/// Write a string of characters
2322///
2323/// This method writes the string chars into a PDF file
2324/// at position xx,yy in world coordinates.
2325
2326void TPDF::Text(Double_t, Double_t, const wchar_t *)
2327{
2328}
2329
2330////////////////////////////////////////////////////////////////////////////////
2331/// Write a string of characters in NDC
2332
2333void TPDF::TextNDC(Double_t u, Double_t v, const char *chars)
2334{
2335 Double_t x = gPad->GetX1() + u*(gPad->GetX2() - gPad->GetX1());
2336 Double_t y = gPad->GetY1() + v*(gPad->GetY2() - gPad->GetY1());
2337 Text(x, y, chars);
2338}
2339
2340////////////////////////////////////////////////////////////////////////////////
2341/// Write a string of characters in NDC
2342
2343void TPDF::TextNDC(Double_t u, Double_t v, const wchar_t *chars)
2344{
2345 Double_t x = gPad->GetX1() + u*(gPad->GetX2() - gPad->GetX1());
2346 Double_t y = gPad->GetY1() + v*(gPad->GetY2() - gPad->GetY1());
2347 Text(x, y, chars);
2348}
2349
2350////////////////////////////////////////////////////////////////////////////////
2351/// Convert U from NDC coordinate to PDF
2352
2354{
2355 Double_t cm = fXsize*(gPad->GetAbsXlowNDC() + u*gPad->GetAbsWNDC());
2356 return 72*cm/2.54;
2357}
2358
2359////////////////////////////////////////////////////////////////////////////////
2360/// Convert V from NDC coordinate to PDF
2361
2363{
2364 Double_t cm = fYsize*(gPad->GetAbsYlowNDC() + v*gPad->GetAbsHNDC());
2365 return 72*cm/2.54;
2366}
2367
2368////////////////////////////////////////////////////////////////////////////////
2369/// Convert X from world coordinate to PDF
2370
2372{
2373 Double_t u = (x - gPad->GetX1())/(gPad->GetX2() - gPad->GetX1());
2374 return UtoPDF(u);
2375}
2376
2377////////////////////////////////////////////////////////////////////////////////
2378/// Convert Y from world coordinate to PDF
2379
2381{
2382 Double_t v = (y - gPad->GetY1())/(gPad->GetY2() - gPad->GetY1());
2383 return VtoPDF(v);
2384}
2385
2386////////////////////////////////////////////////////////////////////////////////
2387/// Write the buffer in a compressed way
2388
2390{
2391 z_stream stream;
2392 int err;
2393 char *out = new char[2*fLenBuffer];
2394
2395 stream.next_in = (Bytef*)fBuffer;
2396 stream.avail_in = (uInt)fLenBuffer;
2397 stream.next_out = (Bytef*)out;
2398 stream.avail_out = (uInt)2*fLenBuffer;
2399 stream.zalloc = (alloc_func)0;
2400 stream.zfree = (free_func)0;
2401 stream.opaque = (voidpf)0;
2402
2403 err = deflateInit(&stream, Z_DEFAULT_COMPRESSION);
2404 if (err != Z_OK) {
2405 Error("WriteCompressedBuffer", "error in deflateInit (zlib)");
2406 delete [] out;
2407 return;
2408 }
2409
2410 err = deflate(&stream, Z_FINISH);
2411 if (err != Z_STREAM_END) {
2412 deflateEnd(&stream);
2413 Error("WriteCompressedBuffer", "error in deflate (zlib)");
2414 delete [] out;
2415 return;
2416 }
2417
2418 err = deflateEnd(&stream);
2419 if (err != Z_OK) {
2420 Error("WriteCompressedBuffer", "error in deflateEnd (zlib)");
2421 }
2422
2423 fStream->write(out, stream.total_out);
2424
2425 fNByte += stream.total_out;
2426 fStream->write("\n",1); fNByte++;
2427 fLenBuffer = 0;
2428 delete [] out;
2429 fCompress = kFALSE;
2430}
2431
2432////////////////////////////////////////////////////////////////////////////////
2433/// Write a Real number to the file.
2434/// This method overwrites TVirtualPS::WriteReal. Some PDF reader like
2435/// Acrobat do not work when a PDF file contains reals with exponent. This
2436/// method writes the real number "z" using the format "%f" instead of the
2437/// format "%g" when writing it with "%g" generates a number with exponent.
2438
2440{
2441 char str[15];
2442 if (space) {
2443 snprintf(str,15," %g", z);
2444 if (strstr(str,"e") || strstr(str,"E")) snprintf(str,15," %10.8f", z);
2445 } else {
2446 snprintf(str,15,"%g", z);
2447 if (strstr(str,"e") || strstr(str,"E")) snprintf(str,15,"%10.8f", z);
2448 }
2449 PrintStr(str);
2450}
2451
2452////////////////////////////////////////////////////////////////////////////////
2453/// Patterns encoding
2454
2456{
2457 Int_t patternNb = kObjPattern;
2458
2460 if (gStyle->GetColorModelPS()) {
2461 PrintStr("[/Pattern /DeviceCMYK]@");
2462 } else {
2463 PrintStr("[/Pattern /DeviceRGB]@");
2464 }
2465 PrintStr("endobj@");
2467 PrintStr("<</ProcSet[/PDF]>>@");
2468 PrintStr("endobj@");
2469
2471 PrintStr("<<@");
2472 PrintStr(" /P01");
2473 WriteInteger(patternNb++);
2474 PrintStr(" 0 R");
2475 PrintStr(" /P02");
2476 WriteInteger(patternNb++);
2477 PrintStr(" 0 R");
2478 PrintStr(" /P03");
2479 WriteInteger(patternNb++);
2480 PrintStr(" 0 R");
2481 PrintStr(" /P04");
2482 WriteInteger(patternNb++);
2483 PrintStr(" 0 R");
2484 PrintStr(" /P05");
2485 WriteInteger(patternNb++);
2486 PrintStr(" 0 R");
2487 PrintStr(" /P06");
2488 WriteInteger(patternNb++);
2489 PrintStr(" 0 R");
2490 PrintStr(" /P07");
2491 WriteInteger(patternNb++);
2492 PrintStr(" 0 R");
2493 PrintStr(" /P08");
2494 WriteInteger(patternNb++);
2495 PrintStr(" 0 R");
2496 PrintStr(" /P09");
2497 WriteInteger(patternNb++);
2498 PrintStr(" 0 R");
2499 PrintStr(" /P10");
2500 WriteInteger(patternNb++);
2501 PrintStr(" 0 R");
2502 PrintStr(" /P11");
2503 WriteInteger(patternNb++);
2504 PrintStr(" 0 R");
2505 PrintStr(" /P12");
2506 WriteInteger(patternNb++);
2507 PrintStr(" 0 R");
2508 PrintStr(" /P13");
2509 WriteInteger(patternNb++);
2510 PrintStr(" 0 R");
2511 PrintStr(" /P14");
2512 WriteInteger(patternNb++);
2513 PrintStr(" 0 R");
2514 PrintStr(" /P15");
2515 WriteInteger(patternNb++);
2516 PrintStr(" 0 R");
2517 PrintStr(" /P16");
2518 WriteInteger(patternNb++);
2519 PrintStr(" 0 R");
2520 PrintStr(" /P17");
2521 WriteInteger(patternNb++);
2522 PrintStr(" 0 R");
2523 PrintStr(" /P18");
2524 WriteInteger(patternNb++);
2525 PrintStr(" 0 R");
2526 PrintStr(" /P19");
2527 WriteInteger(patternNb++);
2528 PrintStr(" 0 R");
2529 PrintStr(" /P20");
2530 WriteInteger(patternNb++);
2531 PrintStr(" 0 R");
2532 PrintStr(" /P21");
2533 WriteInteger(patternNb++);
2534 PrintStr(" 0 R");
2535 PrintStr(" /P22");
2536 WriteInteger(patternNb++);
2537 PrintStr(" 0 R");
2538 PrintStr(" /P23");
2539 WriteInteger(patternNb++);
2540 PrintStr(" 0 R");
2541 PrintStr(" /P24");
2542 WriteInteger(patternNb++);
2543 PrintStr(" 0 R");
2544 PrintStr(" /P25");
2545 WriteInteger(patternNb++);
2546 PrintStr(" 0 R@");
2547 PrintStr(">>@");
2548 PrintStr("endobj@");
2549
2550 patternNb = kObjPattern;
2551
2552 // P01
2553 NewObject(patternNb++);
2554 PrintStr("<</Type/Pattern/Matrix[1 0 0 1 20 28]/PatternType 1/Resources");
2556 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 98 4]/XStep 98/YStep 4/Length 91/Filter/FlateDecode>>");
2557 PrintStr("@");
2558 fStream->write("stream",6); fNByte += 6;
2559 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301P\241\034(\254\340\253\020m\250\020k\240\220\302e\244`\242\220\313ei\t\244r\200\272\215A\034\v \225\003\2241\202\310\030\201e\f!2\206@N0W \027@\200\001\0|c\024\357\n", 93);
2560 fNByte += 93;
2561 PrintStr("endstream@");
2562 PrintStr("endobj@");
2563
2564 // P02
2565 NewObject(patternNb++);
2566 PrintStr("<</Type/Pattern/Matrix[0.75 0 0 0.75 20 28]/PatternType 1/Resources");
2568 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 96 4]/XStep 96/YStep 4/Length 92/Filter/FlateDecode>>@");
2569 PrintStr("@");
2570 fStream->write("stream",6); fNByte += 6;
2571 fStream->write("\r\nH\211$\2121\n\2000\024C\367\234\"G\370\277\025\321+\b\016\342\340P\334tP\252\240\213\3277\332!\204\274\227\v\316\2150\032\335J\356\025\023O\241Np\247\363\021f\317\344\214\234\215\v\002+\036h\033U\326/~\243Ve\231PL\370\215\027\343\032#\006\274\002\f\0\242`\025:\n", 94);
2572 fNByte += 94;
2573 PrintStr("endstream@");
2574 PrintStr("endobj@");
2575
2576 // P03
2577 NewObject(patternNb++);
2578 PrintStr("<</Type/Pattern/Matrix[0.5 0 0 0.5 20 28]/PatternType 1/Resources");
2580 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 96 16]/XStep 96/YStep 16/Length 93/Filter/FlateDecode>>@");
2581 PrintStr("@");
2582 fStream->write("stream",6); fNByte += 6;
2583 fStream->write("\r\nH\211$\2121\n\2000\024C\367\234\"G\370\261(\366\n\202\20388\210\233\016J\025t\361\372\376\332!\204\274\227\033\342N\030\215\262\222g\303\304\313Q\347\360\240\370:f\317Y\f\\\214+**\360Dls'\177\306\274\032\257\344\256.\252\376\215\212\221\217\021\003>\001\006\0\317\243\025\254\n", 95);
2584 fNByte += 95;
2585 PrintStr("endstream@");
2586 PrintStr("endobj@");
2587
2588 // P04
2589 NewObject(patternNb++);
2590 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2592 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 63/Filter/FlateDecode>>");
2593 PrintStr("@");
2594 fStream->write("stream",6); fNByte += 6;
2595 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002V\231\313\005S\233\303\025\314\025\310\005\020`\0\344\270\r\274\n", 65);
2596 fNByte += 65;
2597 PrintStr("endstream@");
2598 PrintStr("endobj@");
2599
2600 // P05
2601 NewObject(patternNb++);
2602 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2604 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 66/Filter/FlateDecode>>");
2605 PrintStr("@");
2606 fStream->write("stream",6); fNByte += 6;
2607 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\302\005Q\223\313\005\"\r\024r\270\202\271\002\271\0\002\f\0\344\320\r\274\n", 68);
2608 fNByte += 68;
2609 PrintStr("endstream@");
2610 PrintStr("endobj@");
2611
2612 // P06
2613 NewObject(patternNb++);
2614 PrintStr("<</Type/Pattern/Matrix[0.03 0 0 0.03 20 28]/PatternType 1/Resources");
2616 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 66/Filter/FlateDecode>>");
2617 PrintStr("@");
2618 fStream->write("stream",6); fNByte += 6;
2619 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\302e\nR\232\v\242@js\270\202\271\002\271\0\002\f\0\345X\r\305\n", 68);
2620 fNByte += 68;
2621 PrintStr("endstream@");
2622 PrintStr("endobj@");
2623
2624 // P07
2625 NewObject(patternNb++);
2626 PrintStr("<</Type/Pattern/Matrix[0.03 0 0 0.03 20 28]/PatternType 1/Resources");
2628 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 68/Filter/FlateDecode>>");
2629 PrintStr("@");
2630 fStream->write("stream",6); fNByte += 6;
2631 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002\02465P\310\345\002)\0042r\270\202\271\002\271\0\002\f\0\345=\r\305\n", 70);
2632 fNByte += 70;
2633 PrintStr("endstream@");
2634 PrintStr("endobj@");
2635
2636 // P08
2637 NewObject(patternNb++);
2638 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2640 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 101 101]/XStep 100/YStep 100/Length 139/Filter/FlateDecode>>");
2641 PrintStr("@");
2642 fStream->write("stream",6); fNByte += 6;
2643 fStream->write("\r\nH\211D\217\261\016\3020\fDw\177\305\315L6Q\225|\003\022C\305\300Puk+\201\032$\272\360\373\330\265\323\016\271\330\367\234\344\"x\201\030\214\252\232\030+%\353VZ.jd\367\205\003x\241({]\311\324]\323|\342\006\033J\201:\306\325\230Jg\226J\261\275D\257#\337=\220\260\354k\233\351\211\217Z75\337\020\374\324\306\035\303\310\230\342x=\303\371\275\307o\332s\331\223\224\240G\330\a\365\364\027`\0\nX1}\n",141);
2644 fNByte += 141;
2645 PrintStr("endstream@");
2646 PrintStr("endobj@");
2647
2648 // P09
2649 NewObject(patternNb++);
2650 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2652 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 108/Filter/FlateDecode>>");
2653 PrintStr("@");
2654 fStream->write("stream",6); fNByte += 6;
2655 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002\02465P\310\005RFFz&\020\002,d\240\220\314en\256g\0065\b,\001b\230\202$\240\232\214@\362\246`\2169H\336\024\2426\231\v&\200,\n\326\030\314\025\310\005\020`\0\f@\036\227\n", 110);
2656 fNByte += 110;
2657 PrintStr("endstream@");
2658 PrintStr("endobj@");
2659
2660 // P10
2661 NewObject(patternNb++);
2662 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2664 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 93/Filter/FlateDecode>>");
2665 PrintStr("@");
2666 fStream->write("stream",6); fNByte += 6;
2667 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002\02465P\310\345\002)\0042r\200\332\r\241\\C \017dN.\027L\312\0\302\205\2535\205j6\205X\224\303\025\314\025\310\005\020`\0\2127\031\t\n", 95);
2668 fNByte += 95;
2669 PrintStr("endstream@");
2670 PrintStr("endobj@");
2671
2672 // P11
2673 NewObject(patternNb++);
2674 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2676 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 164/Filter/FlateDecode>>");
2677 PrintStr("@");
2678 fStream->write("stream",6); fNByte += 6;
2679 fStream->write("\r\nH\211\\\2171\016\3020\fEw\237\342\037\301ip\223^\001\211\001u`@l0\200(\022,\\\037;v\204\332\241\211\336\373\337V\363\246\204;\210\301H\354\337\347F'\274T\355U>\220\360U\215\003\316\027\306\2655\027=\a\306\223\304I\002m\332\330\356&\030\325\333fZ\275F\337\205\235\265O\270\032\004\331\214\336\305\270\004\227`\357i\256\223\342;]\344\255(!\372\356\205j\030\377K\335\220\344\377\210\274\306\022\330\337T{\214,\212;\301\3508\006\346\206\021O=\216|\212|\246#\375\004\030\0\216FF\207\n", 166);
2680 fNByte += 166;
2681 PrintStr("endstream@");
2682 PrintStr("endobj@");
2683
2684 // P12
2685 NewObject(patternNb++);
2686 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2688 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 226/Filter/FlateDecode>>");
2689 PrintStr("@");
2690 fStream->write("stream",6); fNByte += 6;
2691 fStream->write("\r\nH\211<P;n\3030\f\335y\n\236 \220DK\242\256P\240C\321\241C\221\311\311\220\242\016\220.\275~D\221/\203I\342}\370(?(\363\215)q\342\234\374\373\273\322\027\337'\3646\301\037\316\374?a~\347\357s\342\313\2045\361A9\237\322fc\231\200\236F\263\301\334;\211\017\207\rN\311\252S\\\227{\247\006w\207\244\303\255p+(\205\333\360e/v\356a\315\317\360\272\320b|w\276\203o\340k\b\004\027\v$b\226\235,\242\254t(\024\nu\305Vm\313\021\375\327\272\257\227fuf\226ju\356\222x\030\024\313\261S\215\377\341\274,\203\254\253Z\\\262A\262\205eD\350\210\320\201\225\212\320\036\241\355\025\372JE,\2266\344\366\310U\344\016HFx>\351\203\236\002\f\0d}e\216\n", 228);
2692 fNByte += 228;
2693 PrintStr("endstream@");
2694 PrintStr("endobj@");
2695
2696 // P13
2697 NewObject(patternNb++);
2698 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2700 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 69/Filter/FlateDecode>>");
2701 PrintStr("@");
2702 fStream->write("stream",6); fNByte += 6;
2703 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002V\231\313\005S\233\303\005\241!\" ~0W \027@\200\001\0\331\227\020\253\n", 71);
2704 fNByte += 71;
2705 PrintStr("endstream@");
2706 PrintStr("endobj@");
2707
2708 // P14
2709 NewObject(patternNb++);
2710 PrintStr("<</Type/Pattern/Matrix[0.15 0 0 0.15 20 28]/PatternType 1/Resources");
2712 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 80/YStep 80/Length 114/Filter/FlateDecode>>");
2713 PrintStr("@");
2714 fStream->write("stream",6); fNByte += 6;
2715 fStream->write("\r\nH\2114\214=\n\2000\f\205\367\234\342\035!-\241\364\f\202\20388\210\233\016J+\350\342\365M\3723\224\327\367}I\036r8A\f\206\343\372\336\203\026\334\212\006\205\027\004\237b\214X7\306\256\33032\331\240~\022y[\315\026\206\222\372\330}\264\036\253\217\335\353\240\030\b%\223\245o=X\227\346\245\355K\341\345@\3613M\364\v0\0\207o\"\261\n", 116);
2716 fNByte += 116;
2717 PrintStr("endstream@");
2718 PrintStr("endobj@");
2719
2720 // P15
2721 NewObject(patternNb++);
2722 PrintStr("<</Type/Pattern/Matrix[0.102 0 0 0.102 20 28]/PatternType 1/Resources");
2724 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 60 60]/XStep 60/YStep 60/Length 218/Filter/FlateDecode>>");
2725 PrintStr("@");
2726 fStream->write("stream",6); fNByte += 6;
2727 fStream->write("\r\nH\211<\2211\016\3020\fEw\237\302'@\211c\267w@b@\f\f\210\2510\200(\022,\\\037\347\307\256Z\325\221\375\337\377\225\363\241\312\017\246\302\205'\274\337;\235\371\355\215\275\267\236\\\371\307\265\360\201/\327\3027o\233\361J\262\233\247~\362g\336\211zur!A]{\035}\031S\343\006p\241\226dKI\v\326\202\265\3153\331)X)\335fE\205M\235\373\327\r*\374\026\252\022\216u\223\200\361I\211\177\031\022\001#``\342GI\211\004c\221gi\246\231\247\221\247\231\247\233$XM3\315<\215<\315<K\211e\036#\215a4\366\344\035lm\214Z\314b\211Xj\337K\\\201$\332\325\v\365\2659\204\362\242\274'\v\221\r\321\211\216\364\027`\0\212'_\215\n", 220);
2728 fNByte += 220;
2729 PrintStr("endstream@");
2730 PrintStr("endobj@");
2731
2732 // P16
2733 NewObject(patternNb++);
2734 PrintStr("<</Type/Pattern/Matrix[0.1 0 0 0.05 20 28]/PatternType 1/Resources");
2736 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 123/Filter/FlateDecode>>");
2737 PrintStr("@");
2738 fStream->write("stream",6); fNByte += 6;
2739 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\302ej\240\0D\271 \332\314X\317B\301\330\002H\230\233*\030\231\202\310d.CC=#\020\v*\rV\235\214\254\v\210r@\264\261\031P\241\031H5D\253\021H\267\005\3104 \v\344\016\260\002\020\003lB0W \027@\200\001\0hU \305\n", 125);
2740 fNByte += 125;
2741 PrintStr("endstream@");
2742 PrintStr("endobj@");
2743
2744 // P17
2745 NewObject(patternNb++);
2746 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2748 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 66/Filter/FlateDecode>>");
2749 PrintStr("@");
2750 fStream->write("stream",6); fNByte += 6;
2751 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020md\242\020k\240\220\002V\234\313\005S\236\303\025\314\025\310\005\020`\0\r\351\016B\n", 68);
2752 fNByte += 68;
2753 PrintStr("endstream@");
2754 PrintStr("endobj@");
2755
2756 // P18
2757 NewObject(patternNb++);
2758 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2760 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 69/Filter/FlateDecode>>");
2761 PrintStr("@");
2762 fStream->write("stream",6); fNByte += 6;
2763 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020md\242\020k\240\220\302\005Q\226\313\005\"\r\024r\270\202\271\002\271\0\002\f\0\016\001\016B\n", 71);
2764 fNByte += 71;
2765 PrintStr("endstream@");
2766 PrintStr("endobj@");
2767
2768 // P19
2769 NewObject(patternNb++);
2770 PrintStr("<</Type/Pattern/Matrix[0.117 0 0 0.117 20 28]/PatternType 1/Resources");
2772 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 149/Filter/FlateDecode>>");
2773 PrintStr("@");
2774 fStream->write("stream",6); fNByte += 6;
2775 fStream->write("\r\nH\211L\216;\016\302@\fD{\237bN\020\331+6a\257\200D\201((P\252@\001R\220\240\341\372\370\263\216(\326\266f\336\330\373&\301\003\304`\b\307\373\334\351\202\227J\a\025\237\020|U\306\021\327\231q\243\306\250\214\325\372T\006\336\367\032\262\326\205\3124\264b\243$\"n.\244=\314\250!\2139\033\327\022i=\323\317\2518\332T}\347.\202\346W\373\372j\315\221\344\266\213=\237\241\344\034\361\264!\236w\344\177\271o8\323\211~\002\f\0\366\3026\233\n", 151);
2776 fNByte += 151;
2777 PrintStr("endstream@");
2778 PrintStr("endobj@");
2779
2780 // P20
2781 NewObject(patternNb++);
2782 PrintStr("<</Type/Pattern/Matrix[0.05 0 0 0.1 20 28]/PatternType 1/Resources");
2784 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 122/Filter/FlateDecode>>");
2785 PrintStr("@");
2786 fStream->write("stream",6); fNByte += 6;
2787 fStream->write("\r\nH\211<L;\016\2030\f\335}\212w\002\344$M\2323 1 \006\006\304\224vhU\220`\341\372<\aT\311\366\263\336o\023\207\017D\241pz\355\376\226\021+\251\226\344\027\017\034\244\321a\232\025/\211\n\316r\343ORh\262}\317\210\344\032o\310)\302\2233\245\252[m\274\332\313\277!$\332\371\371\210`N\242\267$\217\263\246\252W\257\245\006\351\345\024`\0o\347 \305\n", 124);
2788 fNByte += 124;
2789 PrintStr("endstream@");
2790 PrintStr("endobj@");
2791
2792 // P21
2793 NewObject(patternNb++);
2794 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2796 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 101 101]/XStep 100/YStep 100/Length 117/Filter/FlateDecode>>");
2797 PrintStr("@");
2798 fStream->write("stream",6); fNByte += 6;
2799 fStream->write("\r\nH\211D\2151\n\2000\fE\367\234\342\037!)\224\336Ap\020\a\aq\323A\251\202.^\337$-\025\022^\372\033^n\022\354 \006CX\274\237\215&\\\032u\032\036\020\274\032\243\307\2740V]\027\234\024\242\"\033\2642En\324\312\224bc\262\\\230\377\301\332WM\224\212(U\221\375\265\301\025\016?\350\317P\215\221\033\213o\244\201>\001\006\0\031I'f\n", 119);
2800 fNByte += 119;
2801 PrintStr("endstream@");
2802 PrintStr("endobj@");
2803
2804 // P22
2805 NewObject(patternNb++);
2806 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2808 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 101 101]/XStep 100/YStep 100/Length 118/Filter/FlateDecode>>");
2809 PrintStr("@");
2810 fStream->write("stream",6); fNByte += 6;
2811 fStream->write("\r\nH\211<\215=\n\204P\f\204\373\234b\216\220<\b\357\016\302\026ba!vZ(\273\v\332x}\223\274\237\"|\223a\230\271Hp\200\030\fa\211\273w\232\3617k0\363\204\3401\033\037,+c#\3170~\2244\304\327EV\243r\247\272oOcr\337\323]H\t\226\252\334\252r\255\362\257\213(\t\304\250\326\315T\267\032\275q\242\221^\001\006\0\272\367(&\n", 120);
2812 fNByte += 120;
2813 PrintStr("endstream@");
2814 PrintStr("endobj@");
2815
2816 // P23
2817 NewObject(patternNb++);
2818 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2820 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 169/Filter/FlateDecode>>");
2821 PrintStr("@");
2822 fStream->write("stream",6); fNByte += 6;
2823 fStream->write("\r\nH\211<\220\273\n\0021\020E\373\371\212[[M\326\331\354\344\027\004\v\261\260\020;\025\224D\320\306\337w\036\254p\363\230\223\341$\344M\005\017\020\203Q8\307\347F'\274\f\355\f>Q\3605\214=\316\005\v.\214kt\217\230;)\324\366\245Fa\213e\320v\212r\022X\006\211Fi\3242\250J\224\302\020\367h\212\254I\\\325R\225o\03143\346U\235@a\t[\202Za\tA\202E`\351~O\002\235`\351~S\202\306h.m\253\264)\232K\217t\310\017q\354\a\353\247\364\377C\356\033\372\t0\0\bm:\375\n", 171);
2824 fNByte += 171;
2825 PrintStr("endstream@");
2826 PrintStr("endobj@");
2827
2828 // P24
2829 NewObject(patternNb++);
2830 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2832 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 280/Filter/FlateDecode>>");
2833 PrintStr("@");
2834 fStream->write("stream",6); fNByte += 6;
2835 fStream->write("\r\nH\211DQ9N\004A\f\314\373\025\216\211\326\343v\037_@\"@\004\004\210\f\220@\003\022$|\177\335\345j\220v\345\251\303\343*\215\312\273\024\275\\d\375?\361dM\3162\306\337\214\337Y\336n\240m\217\036\301y\343\\<,i\250\0038F\035)\347l\322\026o\377\023\353|[\254\177\343\005;\315\317ky\224\257\240n\203\374\020\225\337\240\345N\236T\272<_\344\245\304^\3238\030\tc\236E\233xO\034\363\204>\251\317\324\233\023{\352\235\376\336S\357Fl\251\017\372\207\247>xoh&_\366Ud\331\253\314D\023\332\241\211\016\205\246\235\326\236*\275\307\204z8!s\031\335\306\\\306C\306\\\225\376\312\\\225\307\252\246\356\364\273Q\347\271:\371\341l\177\311e\210\3571\211\251#\374\302H\037:\342c\241\323\2617\320 \034\250\0\302\323a{\005%\302a\373(Zx\313\026\213@\215p\324}\026=\274e\217E8s\326}\026M\036\312}\271\n0\0\215\263\207\016\n", 282);
2836 fNByte += 282;
2837 PrintStr("endstream@");
2838 PrintStr("endobj@");
2839
2840 // P25
2841 NewObject(patternNb++);
2842 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2844 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 101 101]/XStep 100/YStep 100/Length 54/Filter/FlateDecode>>");
2845 PrintStr("@");
2846 fStream->write("stream",6); fNByte += 6;
2847 fStream->write("\r\nH\2112T\310T\3402P0P\310\34526P\0\242\034.s\004m\016\242\r\r\f\024@\030\302\002\321iZP\305`M\346\310\212\201R\0\001\006\0\206\322\017\200\n", 56);
2848 fNByte += 56;
2849 PrintStr("endstream@");
2850 PrintStr("endobj@");
2851}
#define b(i)
Definition RSha256.hxx:100
#define g(i)
Definition RSha256.hxx:105
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
short Style_t
Definition RtypesCore.h:89
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:92
short Width_t
Definition RtypesCore.h:91
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
const Float_t kScale
Definition TASImage.cxx:135
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 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 width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char y1
const Int_t kObjFont
Definition TPDF.cxx:86
const Int_t kObjPatternList
Definition TPDF.cxx:89
const Int_t kObjInfo
Definition TPDF.cxx:81
const Int_t kObjRoot
Definition TPDF.cxx:80
const Float_t kScale
Definition TPDF.cxx:77
const Int_t kObjColorSpace
Definition TPDF.cxx:87
const Int_t kNumberOfFonts
Definition TPDF.cxx:95
const Int_t kObjPattern
Definition TPDF.cxx:91
const Int_t kObjContents
Definition TPDF.cxx:85
const Int_t kObjFirstPage
Definition TPDF.cxx:92
const Int_t kObjPages
Definition TPDF.cxx:83
const Int_t kObjPageResources
Definition TPDF.cxx:84
const Int_t kObjPatternResourses
Definition TPDF.cxx:88
const Int_t kObjTransList
Definition TPDF.cxx:90
const Int_t kObjOutlines
Definition TPDF.cxx:82
#define gROOT
Definition TROOT.h:405
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
R__EXTERN TStyle * gStyle
Definition TStyle.h:414
R__EXTERN TVirtualPS * gVirtualPS
Definition TVirtualPS.h:81
#define gPad
#define snprintf
Definition civetweb.c:1540
Style_t fFillStyle
Fill area style.
Definition TAttFill.h:23
Color_t fFillColor
Fill area color.
Definition TAttFill.h:22
Width_t fLineWidth
Line width.
Definition TAttLine.h:23
Style_t fLineStyle
Line style.
Definition TAttLine.h:22
Color_t fLineColor
Line color.
Definition TAttLine.h:21
Color_t fMarkerColor
Marker color.
Definition TAttMarker.h:22
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.
Definition TAttMarker.h:24
Style_t fMarkerStyle
Marker style.
Definition TAttMarker.h:23
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.
Definition TAttText.h:24
Float_t fTextAngle
Text angle.
Definition TAttText.h:21
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:46
Font_t fTextFont
Text font.
Definition TAttText.h:25
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:47
Short_t fTextAlign
Text alignment.
Definition TAttText.h:23
Float_t fTextSize
Text size.
Definition TAttText.h:22
The color creation and management class.
Definition TColor.h:19
Float_t GetRed() const
Definition TColor.h:58
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1823
Float_t GetAlpha() const
Definition TColor.h:64
Float_t GetBlue() const
Definition TColor.h:60
Float_t GetGreen() const
Definition TColor.h:59
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition TDatime.h:37
Int_t GetMonth() const
Definition TDatime.h:66
Int_t GetDay() const
Definition TDatime.h:67
Int_t GetHour() const
Definition TDatime.h:69
Int_t GetSecond() const
Definition TDatime.h:71
Int_t GetYear() const
Definition TDatime.h:65
Int_t GetMinute() const
Definition TDatime.h:70
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.
Definition TDatime.cxx:182
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
An array of TObjects.
Definition TObjArray.h:31
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
Collectable string class.
Definition TObjString.h:28
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:956
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:970
Interface to PDF.
Definition TPDF.h:30
void SetLineStyle(Style_t linestyle=1) override
Change the line style.
Definition TPDF.cxx:2081
void Off()
Deactivate an already open PDF file.
Definition TPDF.cxx:1624
void SetMarkerColor(Color_t cindex=1) override
Set color index for markers.
Definition TPDF.cxx:2113
Int_t fType
Workstation type used to know if the PDF is open.
Definition TPDF.h:40
void SetColor(Int_t color=1)
Set color with its color index.
Definition TPDF.cxx:1887
Double_t YtoPDF(Double_t y)
Convert Y from world coordinate to PDF.
Definition TPDF.cxx:2380
void Open(const char *filename, Int_t type=-111) override
Open a PDF file.
Definition TPDF.cxx:1648
void Close(Option_t *opt="") override
Close a PDF file.
Definition TPDF.cxx:196
TPDF()
Default PDF constructor.
Definition TPDF.cxx:105
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimetres.
Definition TPDF.cxx:1857
void LineTo(Double_t x, Double_t y)
Draw a line to a new position.
Definition TPDF.cxx:1404
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TPDF::fgLineCap.
Definition TPDF.cxx:2066
Double_t XtoPDF(Double_t x)
Convert X from world coordinate to PDF.
Definition TPDF.cxx:2371
void WriteReal(Float_t r, Bool_t space=kTRUE) override
Write a Real number to the file.
Definition TPDF.cxx:2439
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPDF::fgLineJoin.
Definition TPDF.cxx:2042
Double_t CMtoPDF(Double_t u)
Definition TPDF.h:65
void CellArrayEnd() override
End the Cell Array painting.
Definition TPDF.cxx:188
Int_t fObjPosSize
Real size of fObjPos.
Definition TPDF.h:46
void NewPage() override
Start a new PDF page.
Definition TPDF.cxx:1447
Float_t fAlpha
Per cent of transparency.
Definition TPDF.h:36
Float_t fLineScale
Line width scale factor.
Definition TPDF.h:44
virtual ~TPDF()
Default PDF destructor.
Definition TPDF.cxx:161
void SetFillColor(Color_t cindex=1) override
Set color index for fill areas.
Definition TPDF.cxx:1960
Float_t fGreen
Per cent of green.
Definition TPDF.h:34
Int_t fPageOrientation
Page orientation (Portrait, Landscape)
Definition TPDF.h:42
void On()
Activate an already open PDF file.
Definition TPDF.cxx:1632
Int_t fStartStream
Definition TPDF.h:43
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
Definition TPDF.cxx:348
void SetLineColor(Color_t cindex=1) override
Set color index for lines.
Definition TPDF.cxx:2020
void FontEncode()
Font encoding.
Definition TPDF.cxx:1372
Bool_t fCompress
True when fBuffer must be compressed.
Definition TPDF.h:50
static Int_t fgLineCap
Appearance of line caps.
Definition TPDF.h:54
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
Draw a PolyLine.
Definition TPDF.cxx:1206
Float_t fYsize
Page size along Y.
Definition TPDF.h:39
Double_t UtoPDF(Double_t u)
Convert U from NDC coordinate to PDF.
Definition TPDF.cxx:2353
void SetAlpha(Float_t alpha=1.)
Set the alpha channel value.
Definition TPDF.cxx:1867
Float_t fRed
Per cent of red.
Definition TPDF.h:33
Int_t fPageFormat
Page format (A4, Letter etc ...)
Definition TPDF.h:41
Bool_t fRange
True when a range has been defined.
Definition TPDF.h:51
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override
Draw markers at the n WC points xw, yw.
Definition TPDF.cxx:578
Float_t fBlue
Per cent of blue.
Definition TPDF.h:35
std::vector< float > fAlphas
List of alpha values used.
Definition TPDF.h:37
void MoveTo(Double_t x, Double_t y)
Move to a new position.
Definition TPDF.cxx:1414
void SetLineScale(Float_t scale=1)
Definition TPDF.h:97
Int_t fNbObj
Number of objects.
Definition TPDF.h:47
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 TPDF.cxx:414
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Paint the Cell Array.
Definition TPDF.cxx:180
void PrintStr(const char *string="") override
Output the string str in the output buffer.
Definition TPDF.cxx:1816
Int_t fNbPage
Number of pages.
Definition TPDF.h:48
void SetFillPatterns(Int_t ipat, Int_t color)
Set the fill patterns (1 to 25) for fill areas.
Definition TPDF.cxx:1968
void SetTextColor(Color_t cindex=1) override
Set color index for text.
Definition TPDF.cxx:2121
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
Definition TPDF.cxx:532
Float_t fXsize
Page size along X.
Definition TPDF.h:38
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 TPDF.cxx:171
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
Definition TPDF.cxx:454
void SetLineWidth(Width_t linewidth=1) override
Change the line width.
Definition TPDF.cxx:2100
Double_t VtoPDF(Double_t v)
Convert V from NDC coordinate to PDF.
Definition TPDF.cxx:2362
Bool_t fPageNotEmpty
True if the current page is not empty.
Definition TPDF.h:49
void NewObject(Int_t n)
Create a new object in the PDF file.
Definition TPDF.cxx:1424
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Definition TPDF.cxx:478
void Text(Double_t x, Double_t y, const char *string) override
Draw text.
Definition TPDF.cxx:2133
void PatternEncode()
Patterns encoding.
Definition TPDF.cxx:2455
Int_t * fObjPos
Objects position.
Definition TPDF.h:45
void WriteCompressedBuffer()
Write the buffer in a compressed way.
Definition TPDF.cxx:2389
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Definition TPDF.cxx:2333
static Int_t fgLineJoin
Appearance of joining lines.
Definition TPDF.h:53
void PrintFast(Int_t nch, const char *string="") override
Fast version of Print.
Definition TPDF.cxx:1838
2-D graphics point (world coordinates).
Definition TPoints.h:19
static char * ReAllocChar(char *vp, size_t size, size_t oldsize)
Reallocate (i.e.
Definition TStorage.cxx:269
Basic string class.
Definition TString.h:139
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition TString.cxx:2242
Int_t GetJoinLinePS() const
Returns the line join method used for PostScript, PDF and SVG output. See TPostScript::SetLineJoin fo...
Definition TStyle.h:279
Int_t GetColorModelPS() const
Definition TStyle.h:189
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition TStyle.cxx:1114
Int_t GetCapLinePS() const
Returns the line cap method used for PostScript, PDF and SVG output. See TPostScript::SetLineCap for ...
Definition TStyle.h:280
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
Definition TStyle.cxx:1132
Float_t GetLineScalePS() const
Definition TStyle.h:281
Base class for several text objects.
Definition TText.h:22
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Return text extent for string text.
Definition TText.cxx:587
virtual void GetTextAdvance(UInt_t &a, const char *text, const Bool_t kern=kTRUE) const
Return text advance for string text if kern is true (default) kerning is taken into account.
Definition TText.cxx:615
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition TVirtualPS.h:30
Int_t fSizBuffer
Definition TVirtualPS.h:39
Int_t fLenBuffer
Definition TVirtualPS.h:38
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.
std::ofstream * fStream
Definition TVirtualPS.h:41
char * fBuffer
Definition TVirtualPS.h:42
Int_t fNByte
Definition TVirtualPS.h:37
TCanvas * kerning()
Definition kerning.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:250
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Definition TMath.h:678
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:660
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Definition TMath.h:719
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:198
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:592
constexpr Double_t Pi()
Definition TMath.h:37
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:586
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123
TMarker m
Definition textangle.C:8