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