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