Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
QuartzMarker.mm
Go to the documentation of this file.
1// @(#)root/graf2d:$Id$
2// Author: Timur Pocheptsov, 14/8/2011
3
4/*************************************************************************
5 * Copyright (C) 1995-2011, 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#include "TAttMarker.h"
13
14#include "QuartzMarker.h"
15
16namespace ROOT {
17namespace Quartz {
18
19
20//______________________________________________________________________________
21void DrawMarkerDot(CGContextRef ctx, unsigned n, const TPoint *xy,
23{
24 for (unsigned i = 0; i < n; ++i)
26}
27
28
29//______________________________________________________________________________
30void DrawMarkerPlus(CGContextRef ctx, unsigned n, const TPoint *xy,
32{
33 const Double_t im = 4 * markerSize + 0.5;
34
35 for (UInt_t i = 0; i < n; ++i) {
36 const Double_t x = xy[i].fX;
37 const Double_t y = xy[i].fY;
38
40 CGContextMoveToPoint(ctx, -im + x, y);
43
45 CGContextMoveToPoint(ctx, x, -im + y);
48 }
49}
50
51
52//______________________________________________________________________________
53void DrawMarkerStar(CGContextRef ctx, unsigned n, const TPoint *xy,
55{
56 Double_t im = 4 * markerSize + 0.5;
57
58 TPoint star[8];
59 star[0].fX = -im; star[0].fY = 0;
60 star[1].fX = im; star[1].fY = 0;
61 star[2].fX = 0 ; star[2].fY = -im;
62 star[3].fX = 0 ; star[3].fY = im;
63
64 im = 0.707 * im + 0.5;
65 star[4].fX = -im; star[4].fY = -im;
66 star[5].fX = im; star[5].fY = im;
67 star[6].fX = -im; star[6].fY = im;
68 star[7].fX = im; star[7].fY = -im;
69
70 for (UInt_t i = 0; i < n; ++i) {
71 const Double_t x = xy[i].fX;
72 const Double_t y = xy[i].fY;
73
75 CGContextMoveToPoint(ctx, star[0].fX + x, star[0].fY + y);
76 CGContextAddLineToPoint(ctx, star[1].fX + x, star[1].fY + y);
78
80 CGContextMoveToPoint(ctx, star[2].fX + x, star[2].fY + y);
81 CGContextAddLineToPoint(ctx, star[3].fX + x, star[3].fY + y);
83
85 CGContextMoveToPoint(ctx, star[4].fX + x, star[4].fY + y);
86 CGContextAddLineToPoint(ctx, star[5].fX + x, star[5].fY + y);
88
90 CGContextMoveToPoint(ctx, star[6].fX + x, star[6].fY + y);
91 CGContextAddLineToPoint(ctx, star[7].fX + x, star[7].fY + y);
93 }
94}
95
96
97//______________________________________________________________________________
98void DrawMarkerOpenCircle(CGContextRef ctx, unsigned n, const TPoint *xy,
100{
101 Double_t r = 4 * markerSize + 0.5;
102 if (r > 100.)
103 r = 100.;//as in TGX11.
104
105 const Double_t d = 2 * r;
106
107 for (unsigned i = 0; i < n; ++i) {
108 const Double_t x = xy[i].fX;
109 const Double_t y = xy[i].fY;
110
111 const CGRect rect = CGRectMake(x - r, y - r, d, d);
113 }
114}
115
116
117//______________________________________________________________________________
118void DrawMarkerX(CGContextRef ctx, unsigned n, const TPoint *xy,
120{
121 const Double_t im = 0.707 * (4 * markerSize + 0.5) + 0.5;
122 for (unsigned i = 0; i < n; ++i) {
123 const Double_t x = xy[i].fX;
124 const Double_t y = xy[i].fY;
125
127 CGContextMoveToPoint(ctx, -im + x, -im + y);
128 CGContextAddLineToPoint(ctx, im + x, im + y);
130
132 CGContextMoveToPoint(ctx, -im + x, im + y);
133 CGContextAddLineToPoint(ctx, im + x, -im + y);
135 }
136}
137
138
139//______________________________________________________________________________
140void DrawMarkerFullDotSmall(CGContextRef ctx, unsigned n, const TPoint *xy)
141{
142 for (unsigned i = 0; i < n; ++i) {
143 const Double_t x = xy[i].fX;
144 const Double_t y = xy[i].fY;
145
147 CGContextMoveToPoint(ctx, -1. + x, y);
148 CGContextAddLineToPoint(ctx, x + 1., y);
150
152 CGContextMoveToPoint(ctx, x, -1. + y);
153 CGContextAddLineToPoint(ctx, x, 1. + y);
155 }
156}
157
158
159//______________________________________________________________________________
160void DrawMarkerFullDotMedium(CGContextRef ctx, unsigned n, const TPoint *xy)
161{
162 for (unsigned i = 0; i < n; ++i)
163 CGContextFillRect(ctx, CGRectMake(xy[i].fX - 1, xy[i].fY - 1, 3.f, 3.f));
164}
165
166
167//______________________________________________________________________________
168void DrawMarkerFullDotLarge(CGContextRef ctx, unsigned n, const TPoint *xy,
170{
171 Double_t radius = 4 * markerSize + 0.5;
172 if (radius > 100.)
173 radius = 100;//as in TGX11.
174
175 const Double_t d = 2 * radius;
176
177 for (unsigned i = 0; i < n; ++i) {
178 const Double_t x = xy[i].fX;
179 const Double_t y = xy[i].fY;
180
181 const CGRect rect = CGRectMake(x - radius, y - radius, d, d);
183 }
184}
185
186
187//______________________________________________________________________________
188void DrawMarkerFullSquare(CGContextRef ctx, unsigned n, const TPoint *xy,
190{
191 const Double_t im = 4 * markerSize + 0.5;
192 for (unsigned i = 0; i < n; ++i) {
193 const CGRect rect = CGRectMake(xy[i].fX - im, xy[i].fY - im, im * 2, im * 2);
195 }
196}
197
198
199//______________________________________________________________________________
200void DrawMarkerOpenSquare(CGContextRef ctx, unsigned n, const TPoint *xy,
202{
203 const Double_t im = 4 * markerSize + 0.5;
204 for (unsigned i = 0; i < n; ++i) {
205 const CGRect rect = CGRectMake(xy[i].fX - im, xy[i].fY - im, im * 2, im * 2);
207 }
208}
209
210
211//______________________________________________________________________________
214{
215 const Double_t im = 4 * markerSize + 0.5;
216 for (unsigned i = 0; i < n; ++i) {
217 const Double_t x = xy[i].fX;
218 const Double_t y = xy[i].fY;
220 CGContextMoveToPoint(ctx, x - im, y - im);
221 CGContextAddLineToPoint(ctx, x + im, y - im);
222 CGContextAddLineToPoint(ctx, x, im + y);
224 }
225}
226
227
228//______________________________________________________________________________
231{
232 const Double_t im = 4 * markerSize + 0.5;
233 for (unsigned i = 0; i < n; ++i) {
234 const Double_t x = xy[i].fX;
235 const Double_t y = xy[i].fY;
237 CGContextMoveToPoint(ctx, x - im, y - im);
238 CGContextAddLineToPoint(ctx, x + im, y - im);
239 CGContextAddLineToPoint(ctx, x, im + y);
240 CGContextAddLineToPoint(ctx, x - im, y - im);
242 }
243}
244
245
246//______________________________________________________________________________
249{
250 const Int_t im = Int_t(4 * markerSize + 0.5);
251 for (unsigned i = 0; i < n; ++i) {
252 const Double_t x = xy[i].fX;
253 const Double_t y = xy[i].fY;
254
256 CGContextMoveToPoint(ctx, x - im, y + im);
257 CGContextAddLineToPoint(ctx, x, y - im);
258 CGContextAddLineToPoint(ctx, im + x, y + im);
259 CGContextAddLineToPoint(ctx, x - im, y + im);
261 }
262}
263
264
265//______________________________________________________________________________
268{
269 const Int_t im = Int_t(4 * markerSize + 0.5);
270 for (unsigned i = 0; i < n; ++i) {
271 const Double_t x = xy[i].fX;
272 const Double_t y = xy[i].fY;
273
275 CGContextMoveToPoint(ctx, x - im, y + im);
276 CGContextAddLineToPoint(ctx, x, y - im);
277 CGContextAddLineToPoint(ctx, im + x, y + im);
279 }
280}
281
282
283//______________________________________________________________________________
284void DrawMarkerFullDiamond(CGContextRef ctx, unsigned n, const TPoint *xy,
286{
287 const Int_t im = Int_t(4 * markerSize + 0.5);
288 const Int_t imx = Int_t(2.66 * markerSize + 0.5);
289
290 for (unsigned i = 0; i < n; ++i) {
291 const Double_t x = xy[i].fX;
292 const Double_t y = xy[i].fY;
293
295 CGContextMoveToPoint(ctx, x - imx, y);
296 CGContextAddLineToPoint(ctx, x, y - im);
298 CGContextAddLineToPoint(ctx, x, y + im);
300 }
301}
302
303
304//______________________________________________________________________________
305void DrawMarkerOpenDiamond(CGContextRef ctx, unsigned n, const TPoint *xy,
307{
308 const Int_t im = Int_t(4 * markerSize + 0.5);
309 const Int_t imx = Int_t(2.66 * markerSize + 0.5);
310
311 for (unsigned i = 0; i < n; ++i) {
312 const Double_t x = xy[i].fX;
313 const Double_t y = xy[i].fY;
314
316 CGContextMoveToPoint(ctx, x - imx, y);
317 CGContextAddLineToPoint(ctx, x, y - im);
319 CGContextAddLineToPoint(ctx, x, y + im);
322 }
323}
324
325
326//______________________________________________________________________________
327void DrawMarkerFullCross(CGContextRef ctx, unsigned n, const TPoint *xy,
329{
330 const Int_t im = Int_t(4 * markerSize + 0.5);
331 const Int_t imx = Int_t(1.33 * markerSize + 0.5);
332
333 for (unsigned i = 0; i < n; ++i) {
334 const Double_t x = xy[i].fX;
335 const Double_t y = xy[i].fY;
336
338 CGContextMoveToPoint(ctx, x - im, y - imx);
339 CGContextAddLineToPoint(ctx, x - imx, y - imx);
340 CGContextAddLineToPoint(ctx, x - imx, y - im);
341 CGContextAddLineToPoint(ctx, x + imx, y - im);
342 CGContextAddLineToPoint(ctx, x + imx, y - imx);
343 CGContextAddLineToPoint(ctx, x + im, y - imx);
344 CGContextAddLineToPoint(ctx, x + im, y + imx);
345 CGContextAddLineToPoint(ctx, x + imx, y + imx);
346 CGContextAddLineToPoint(ctx, x + imx, y + im);
347 CGContextAddLineToPoint(ctx, x - imx, y + im);
348 CGContextAddLineToPoint(ctx, x - imx, y + imx);
349 CGContextAddLineToPoint(ctx, x - im, y + imx);
350 CGContextAddLineToPoint(ctx, x - im, y - imx);
352 }
353}
354
355
356//______________________________________________________________________________
357void DrawMarkerOpenCross(CGContextRef ctx, unsigned n, const TPoint *xy,
359{
360 const Int_t im = Int_t(4 * markerSize + 0.5);
361 const Int_t imx = Int_t(1.33 * markerSize + 0.5);
362
363 for (unsigned i = 0; i < n; ++i) {
364 const Double_t x = xy[i].fX;
365 const Double_t y = xy[i].fY;
366
368 CGContextMoveToPoint(ctx, x - im, y - imx);
369 CGContextAddLineToPoint(ctx, x - imx, y - imx);
370 CGContextAddLineToPoint(ctx, x - imx, y - im);
371 CGContextAddLineToPoint(ctx, x + imx, y - im);
372 CGContextAddLineToPoint(ctx, x + imx, y - imx);
373 CGContextAddLineToPoint(ctx, x + im, y - imx);
374 CGContextAddLineToPoint(ctx, x + im, y + imx);
375 CGContextAddLineToPoint(ctx, x + imx, y + imx);
376 CGContextAddLineToPoint(ctx, x + imx, y + im);
377 CGContextAddLineToPoint(ctx, x - imx, y + im);
378 CGContextAddLineToPoint(ctx, x - imx, y + imx);
379 CGContextAddLineToPoint(ctx, x - im, y + imx);
380 CGContextAddLineToPoint(ctx, x - im, y - imx);
382 }
383}
384
385
386//______________________________________________________________________________
387void DrawMarkerFullStar(CGContextRef ctx, unsigned n, const TPoint *xy,
389{
390 // HIGZ full star pentagone
391 const Int_t im = Int_t(4 * markerSize + 0.5);
392 const Int_t im1 = Int_t(0.66 * markerSize + 0.5);
393 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
394 const Int_t im3 = Int_t(2.66 * markerSize + 0.5);
395 const Int_t im4 = Int_t(1.33 * markerSize + 0.5);
396
397 for (unsigned i = 0; i < n; ++i) {
398 const Double_t x = xy[i].fX;
399 const Double_t y = xy[i].fY;
400
402 CGContextMoveToPoint(ctx, x - im, y - im4);
403 CGContextAddLineToPoint(ctx, x - im2, y + im1);
404 CGContextAddLineToPoint(ctx, x - im4, y - im4);
406
408 CGContextMoveToPoint(ctx, x - im2, y + im1);//1
409 CGContextAddLineToPoint(ctx, x - im3, y + im);//2
410 CGContextAddLineToPoint(ctx, x, y + im2);//3
412
414 CGContextMoveToPoint(ctx, x, y + im2);//3
415 CGContextAddLineToPoint(ctx, x + im3, y + im);//4
416 CGContextAddLineToPoint(ctx, x + im2, y + im1);//5
418
420 CGContextMoveToPoint(ctx, x + im2, y + im1);//5
421 CGContextAddLineToPoint(ctx, x + im, y - im4);//6
422 CGContextAddLineToPoint(ctx,x + im4, y - im4);//7
424
426 CGContextMoveToPoint(ctx, x + im4, y - im4);//7
427 CGContextAddLineToPoint(ctx, x, y - im);//8
428 CGContextAddLineToPoint(ctx, x - im4, y - im4);//9
430
432 CGContextMoveToPoint(ctx, x - im4, y - im4);//9
433 CGContextAddLineToPoint(ctx, x - im2, y + im1);//1
434 CGContextAddLineToPoint(ctx, x, y + im2);//3
436
438 CGContextMoveToPoint(ctx, x - im4, y - im4);//9
439 CGContextAddLineToPoint(ctx, x, y + im2);//3
440 CGContextAddLineToPoint(ctx, x + im2, y + im1);//5
442
444 CGContextMoveToPoint(ctx, x - im4, y - im4);//9
445 CGContextAddLineToPoint(ctx, x + im2, y + im1);//5
446 CGContextAddLineToPoint(ctx, x + im4, y - im4);//7
448 }
449}
450
451
452//______________________________________________________________________________
453void DrawMarkerOpenStar(CGContextRef ctx, unsigned n, const TPoint *xy,
455{
456 const Int_t im = Int_t(4 * markerSize + 0.5);
457 const Int_t im1 = Int_t(0.66 * markerSize + 0.5);
458 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
459 const Int_t im3 = Int_t(2.66 * markerSize + 0.5);
460 const Int_t im4 = Int_t(1.33 * markerSize + 0.5);
461
462 for (unsigned i = 0; i < n; ++i) {
463 const Double_t x = xy[i].fX;
464 const Double_t y = xy[i].fY;
465
467 CGContextMoveToPoint(ctx, x - im, y - im4);
468 CGContextAddLineToPoint(ctx, x - im2, y + im1);
469 CGContextAddLineToPoint(ctx, x - im3, y + im);
471 CGContextAddLineToPoint(ctx, x + im3, y + im);
472 CGContextAddLineToPoint(ctx, x + im2, y + im1);
473 CGContextAddLineToPoint(ctx, x + im, y - im4);
474 CGContextAddLineToPoint(ctx, x + im4, y - im4);
475 CGContextAddLineToPoint(ctx, x, y - im);
476 CGContextAddLineToPoint(ctx, x - im4, y - im4);
477 CGContextAddLineToPoint(ctx, x - im, y - im4);
479 }
480}
481
482//______________________________________________________________________________
485{
486 const Int_t im = Int_t(4 * markerSize + 0.5);
487
488 for (unsigned i = 0; i < n; ++i) {
489 const Double_t x = xy[i].fX;
490 const Double_t y = xy[i].fY;
491
493 CGContextMoveToPoint(ctx, x - im, y - im);
494 CGContextAddLineToPoint(ctx, x + im, y - im);
495 CGContextAddLineToPoint(ctx, x + im, y + im);
496 CGContextAddLineToPoint(ctx, x - im, y + im);
497 CGContextAddLineToPoint(ctx, x - im, y - im);
498 CGContextAddLineToPoint(ctx, x + im, y + im);
500
502 CGContextMoveToPoint(ctx, x - im, y + im);
503 CGContextAddLineToPoint(ctx, x + im, y - im);
505 }
506}
507
508//______________________________________________________________________________
511{
512 const Int_t im = Int_t(4 * markerSize + 0.5);
513
514 for (unsigned i = 0; i < n; ++i) {
515 const Double_t x = xy[i].fX;
516 const Double_t y = xy[i].fY;
517
519 CGContextMoveToPoint(ctx, x - im, y );
520 CGContextAddLineToPoint(ctx, x , y - im);
521 CGContextAddLineToPoint(ctx, x + im, y );
522 CGContextAddLineToPoint(ctx, x , y + im);
523 CGContextAddLineToPoint(ctx, x - im, y );
524 CGContextAddLineToPoint(ctx, x + im, y );
526
528 CGContextMoveToPoint(ctx, x , y + im);
529 CGContextAddLineToPoint(ctx, x , y - im);
531 }
532}
533
534//______________________________________________________________________________
537{
538 const Int_t im = Int_t(4 * markerSize + 0.5);
539 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
540
541 for (unsigned i = 0; i < n; ++i) {
542 const Double_t x = xy[i].fX;
543 const Double_t y = xy[i].fY;
544
546 CGContextMoveToPoint(ctx, x , y );
547 CGContextAddLineToPoint(ctx, x -im2, y + im);
548 CGContextAddLineToPoint(ctx, x - im, y );
549 CGContextAddLineToPoint(ctx, x , y );
550 CGContextAddLineToPoint(ctx, x -im2, y - im);
551 CGContextAddLineToPoint(ctx, x +im2, y - im);
552 CGContextAddLineToPoint(ctx, x , y );
553 CGContextAddLineToPoint(ctx, x + im, y );
554 CGContextAddLineToPoint(ctx, x +im2, y + im);
555 CGContextAddLineToPoint(ctx, x , y );
557 }
558}
559
560//______________________________________________________________________________
561void DrawMarkerOctagonCross(CGContextRef ctx, unsigned n, const TPoint *xy,
563{
564 const Int_t im = Int_t(4 * markerSize + 0.5);
565 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
566
567 for (unsigned i = 0; i < n; ++i) {
568 const Double_t x = xy[i].fX;
569 const Double_t y = xy[i].fY;
570
572 CGContextMoveToPoint(ctx, x - im, y );
573 CGContextAddLineToPoint(ctx, x - im, y -im2);
574 CGContextAddLineToPoint(ctx, x -im2, y - im);
575 CGContextAddLineToPoint(ctx, x +im2, y - im);
576 CGContextAddLineToPoint(ctx, x + im, y -im2);
577 CGContextAddLineToPoint(ctx, x + im, y +im2);
578 CGContextAddLineToPoint(ctx, x +im2, y + im);
579 CGContextAddLineToPoint(ctx, x -im2, y + im);
580 CGContextAddLineToPoint(ctx, x - im, y +im2);
581 CGContextAddLineToPoint(ctx, x - im, y );
582 CGContextAddLineToPoint(ctx, x + im, y );
584
586 CGContextMoveToPoint(ctx, x , y - im);
587 CGContextAddLineToPoint(ctx, x , y + im);
589 }
590}
591
592//______________________________________________________________________________
595{
596 const Int_t im = Int_t(4 * markerSize + 0.5);
597 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
598
599 for (unsigned i = 0; i < n; ++i) {
600 const Double_t x = xy[i].fX;
601 const Double_t y = xy[i].fY;
602
604 CGContextMoveToPoint(ctx, x , y );
605 CGContextAddLineToPoint(ctx, x -im2, y + im);
606 CGContextAddLineToPoint(ctx, x - im, y );
607 CGContextAddLineToPoint(ctx, x , y );
608 CGContextAddLineToPoint(ctx, x -im2, y - im);
609 CGContextAddLineToPoint(ctx, x +im2, y - im);
610 CGContextAddLineToPoint(ctx, x , y );
611 CGContextAddLineToPoint(ctx, x + im, y );
612 CGContextAddLineToPoint(ctx, x +im2, y + im);
613 CGContextAddLineToPoint(ctx, x , y );
615 }
616}
617
618//______________________________________________________________________________
621{
622 const Int_t im = Int_t(4 * markerSize + 0.5);
623 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
624
625 for (unsigned i = 0; i < n; ++i) {
626 const Double_t x = xy[i].fX;
627 const Double_t y = xy[i].fY;
628
630 CGContextMoveToPoint(ctx, x , y );
631 CGContextAddLineToPoint(ctx, x +im2, y + im);
632 CGContextAddLineToPoint(ctx, x + im, y +im2);
633 CGContextAddLineToPoint(ctx, x , y );
634 CGContextAddLineToPoint(ctx, x + im, y -im2);
635 CGContextAddLineToPoint(ctx, x +im2, y - im);
636 CGContextAddLineToPoint(ctx, x , y );
637 CGContextAddLineToPoint(ctx, x -im2, y - im);
638 CGContextAddLineToPoint(ctx, x - im, y -im2);
639 CGContextAddLineToPoint(ctx, x , y );
640 CGContextAddLineToPoint(ctx, x - im, y +im2);
641 CGContextAddLineToPoint(ctx, x -im2, y + im);
642 CGContextAddLineToPoint(ctx, x , y );
644 }
645}
646
647//______________________________________________________________________________
650{
651 const Int_t im = Int_t(4 * markerSize + 0.5);
652 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
653
654 for (unsigned i = 0; i < n; ++i) {
655 const Double_t x = xy[i].fX;
656 const Double_t y = xy[i].fY;
657
659 CGContextMoveToPoint(ctx, x , y );
660 CGContextAddLineToPoint(ctx, x +im2, y + im);
661 CGContextAddLineToPoint(ctx, x + im, y +im2);
662 CGContextAddLineToPoint(ctx, x , y );
663 CGContextAddLineToPoint(ctx, x + im, y -im2);
664 CGContextAddLineToPoint(ctx, x +im2, y - im);
665 CGContextAddLineToPoint(ctx, x , y );
666 CGContextAddLineToPoint(ctx, x -im2, y - im);
667 CGContextAddLineToPoint(ctx, x - im, y -im2);
668 CGContextAddLineToPoint(ctx, x , y );
669 CGContextAddLineToPoint(ctx, x - im, y +im2);
670 CGContextAddLineToPoint(ctx, x -im2, y + im);
671 CGContextAddLineToPoint(ctx, x , y );
673 }
674}
675
676//______________________________________________________________________________
679{
680 const Int_t im = Int_t(4 * markerSize + 0.5);
681 const Int_t im4 = Int_t(markerSize + 0.5);
682
683 for (unsigned i = 0; i < n; ++i) {
684 const Double_t x = xy[i].fX;
685 const Double_t y = xy[i].fY;
686
688 CGContextMoveToPoint(ctx, x , y + im);
690 CGContextAddLineToPoint(ctx, x - im, y );
692 CGContextAddLineToPoint(ctx, x , y - im);
694 CGContextAddLineToPoint(ctx, x + im, y );
696 CGContextAddLineToPoint(ctx, x , y + im);
698 }
699}
700
701//______________________________________________________________________________
704{
705 const Int_t im = Int_t(4 * markerSize + 0.5);
706 const Int_t im4 = Int_t( markerSize + 0.5);
707
708 for (unsigned i = 0; i < n; ++i) {
709 const Double_t x = xy[i].fX;
710 const Double_t y = xy[i].fY;
711
713 CGContextMoveToPoint(ctx, x , y + im);
715 CGContextAddLineToPoint(ctx, x - im, y );
717 CGContextAddLineToPoint(ctx, x , y - im);
719 CGContextAddLineToPoint(ctx, x + im, y );
721 CGContextAddLineToPoint(ctx, x , y + im);
723 }
724}
725
726//______________________________________________________________________________
729{
730 const Int_t im = Int_t(4 * markerSize + 0.5);
731 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
732
733 for (unsigned i = 0; i < n; ++i) {
734 const Double_t x = xy[i].fX;
735 const Double_t y = xy[i].fY;
736
738 CGContextMoveToPoint(ctx, x , y );
739 CGContextAddLineToPoint(ctx, x +im2, y + im);
740 CGContextAddLineToPoint(ctx, x -im2, y + im);
741 CGContextAddLineToPoint(ctx, x +im2, y - im);
742 CGContextAddLineToPoint(ctx, x -im2, y - im);
743 CGContextAddLineToPoint(ctx, x , y );
744 CGContextAddLineToPoint(ctx, x + im, y +im2);
745 CGContextAddLineToPoint(ctx, x + im, y -im2);
746 CGContextAddLineToPoint(ctx, x - im, y +im2);
747 CGContextAddLineToPoint(ctx, x - im, y -im2);
748 CGContextAddLineToPoint(ctx, x , y );
750 }
751}
752
753//______________________________________________________________________________
756{
757 const Int_t im = Int_t(4 * markerSize + 0.5);
758 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
759 const Int_t im4 = Int_t(0.2 * markerSize + 0.5);
760
761 for (unsigned i = 0; i < n; ++i) {
762 const Double_t x = xy[i].fX;
763 const Double_t y = xy[i].fY;
764
766 CGContextMoveToPoint(ctx, x +im4, y +im4);
767 CGContextAddLineToPoint(ctx, x +im2, y + im);
768 CGContextAddLineToPoint(ctx, x -im2, y + im);
770 CGContextAddLineToPoint(ctx, x - im, y +im2);
771 CGContextAddLineToPoint(ctx, x - im, y -im2);
773 CGContextAddLineToPoint(ctx, x -im2, y - im);
774 CGContextAddLineToPoint(ctx, x +im2, y - im);
776 CGContextAddLineToPoint(ctx, x + im, y -im2);
777 CGContextAddLineToPoint(ctx, x + im, y +im2);
780 }
781}
782
783//______________________________________________________________________________
784void DrawMarkerOpenCrossX(CGContextRef ctx, unsigned n, const TPoint *xy,
786{
787 const Int_t im = Int_t(4 * markerSize + 0.5);
788 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
789
790 for (unsigned i = 0; i < n; ++i) {
791 const Double_t x = xy[i].fX;
792 const Double_t y = xy[i].fY;
793
795 CGContextMoveToPoint(ctx, x , y + im2);
796 CGContextAddLineToPoint(ctx, x -im2, y + im);
797 CGContextAddLineToPoint(ctx, x - im, y +im2);
799 CGContextAddLineToPoint(ctx, x - im, y -im2);
800 CGContextAddLineToPoint(ctx, x -im2, y - im);
802 CGContextAddLineToPoint(ctx, x +im2, y - im);
803 CGContextAddLineToPoint(ctx, x + im, y -im2);
805 CGContextAddLineToPoint(ctx, x + im, y +im2);
806 CGContextAddLineToPoint(ctx, x +im2, y + im);
809 }
810}
811
812//______________________________________________________________________________
813void DrawMarkerFullCrossX(CGContextRef ctx, unsigned n, const TPoint *xy,
815{
816 const Int_t im = Int_t(4 * markerSize + 0.5);
817 const Int_t im2 = Int_t(2.0 * markerSize + 0.5);
818
819 for (unsigned i = 0; i < n; ++i) {
820 const Double_t x = xy[i].fX;
821 const Double_t y = xy[i].fY;
822
824 CGContextMoveToPoint(ctx, x , y + im2);
825 CGContextAddLineToPoint(ctx, x -im2, y + im);
826 CGContextAddLineToPoint(ctx, x - im, y +im2);
828 CGContextAddLineToPoint(ctx, x - im, y -im2);
829 CGContextAddLineToPoint(ctx, x -im2, y - im);
831 CGContextAddLineToPoint(ctx, x +im2, y - im);
832 CGContextAddLineToPoint(ctx, x + im, y -im2);
834 CGContextAddLineToPoint(ctx, x + im, y +im2);
835 CGContextAddLineToPoint(ctx, x +im2, y + im);
838 }
839}
840
841//______________________________________________________________________________
842void DrawMarkerFourSquaresX(CGContextRef ctx, unsigned n, const TPoint *xy,
844{
845 const Int_t im = Int_t(4 * markerSize + 0.5);
846 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
847
848 for (unsigned i = 0; i < n; ++i) {
849 const Double_t x = xy[i].fX;
850 const Double_t y = xy[i].fY;
851
853 CGContextMoveToPoint(ctx, x , y + im2*1.01);
854 CGContextAddLineToPoint(ctx, x -im2, y + im);
855 CGContextAddLineToPoint(ctx, x - im, y +im2);
857 CGContextAddLineToPoint(ctx, x - im, y -im2);
858 CGContextAddLineToPoint(ctx, x -im2, y - im);
860 CGContextAddLineToPoint(ctx, x +im2, y - im);
861 CGContextAddLineToPoint(ctx, x + im, y -im2);
863 CGContextAddLineToPoint(ctx, x + im, y +im2);
864 CGContextAddLineToPoint(ctx, x +im2, y + im);
865 CGContextAddLineToPoint(ctx, x , y +im2*0.99);
866 CGContextAddLineToPoint(ctx, x +im2*0.99, y );
867 CGContextAddLineToPoint(ctx, x , y -im2*0.99);
868 CGContextAddLineToPoint(ctx, x -im2*0.99, y );
869 CGContextAddLineToPoint(ctx, x , y +im2*0.99);
871 }
872}
873
874//______________________________________________________________________________
877{
878 const Int_t im = Int_t(4 * markerSize + 0.5);
879 const Int_t im2 = Int_t(1.33 * markerSize + 0.5);
880
881 for (unsigned i = 0; i < n; ++i) {
882 const Double_t x = xy[i].fX;
883 const Double_t y = xy[i].fY;
884
886 CGContextMoveToPoint(ctx, x -im2, y - im2*1.005);
887 CGContextAddLineToPoint(ctx, x -im2, y - im);
888 CGContextAddLineToPoint(ctx, x +im2, y - im);
890 CGContextAddLineToPoint(ctx, x + im, y -im2);
891 CGContextAddLineToPoint(ctx, x + im, y +im2);
893 CGContextAddLineToPoint(ctx, x +im2, y + im);
894 CGContextAddLineToPoint(ctx, x -im2, y + im);
896 CGContextAddLineToPoint(ctx, x - im, y +im2);
897 CGContextAddLineToPoint(ctx, x - im, y -im2);
898 CGContextAddLineToPoint(ctx, x -im2, y -im2*0.995);
902 CGContextAddLineToPoint(ctx, x -im2, y -im2*1.005);
904 }
905}
906
907//______________________________________________________________________________
908void DrawPolyMarker(CGContextRef ctx, unsigned nPoints, const TPoint *xy,
910{
911 switch (markerStyle) {
912 case kDot:
914 break;
915 case kPlus:
917 break;
918 case kStar:
919 case 31:
921 break;
922 case kCircle:
923 case kOpenCircle:
925 break;
926 case kMultiply:
928 break;
929 case kFullDotSmall:
931 break;
932 case kFullDotMedium:
934 break;
935 case kFullDotLarge:
936 case kFullCircle:
938 break;
939 case kFullSquare:
941 break;
942 case kFullTriangleUp:
944 break;
947 break;
948 case kOpenSquare:
950 break;
951 case kOpenTriangleUp:
953 break;
956 break;
957 case kOpenDiamond:
959 break;
960 case kFullDiamond:
962 break;
963 case kOpenCross:
965 break;
966 case kFullCross:
968 break;
969 case kFullStar:
971 break;
972 case kOpenStar:
974 break;
977 break;
980 break;
983 break;
984 case kOctagonCross:
986 break;
989 break;
992 break;
995 break;
998 break;
1001 break;
1004 break;
1007 break;
1008 case kOpenCrossX:
1010 break;
1011 case kFullCrossX:
1013 break;
1014 case kFourSquaresX:
1016 break;
1017 case kFourSquaresPlus:
1019 break;
1020 }
1021}
1022
1023
1024//______________________________________________________________________________
1025void DrawPolyMarker(CGContextRef ctx, const std::vector<TPoint> &xy,
1027{
1028 DrawPolyMarker(ctx, xy.size(), &xy[0], markerSize, markerStyle);
1029}
1030
1031}//namespace Quartz
1032}//namespace ROOT
#define d(i)
Definition RSha256.hxx:102
short Style_t
Definition RtypesCore.h:89
int Int_t
Definition RtypesCore.h:45
float Size_t
Definition RtypesCore.h:96
@ kOpenDoubleDiamond
Definition TAttMarker.h:63
@ kStar
Definition TAttMarker.h:53
@ kFullDotLarge
Definition TAttMarker.h:54
@ kFullDoubleDiamond
Definition TAttMarker.h:63
@ kOpenFourTrianglesX
Definition TAttMarker.h:62
@ kOpenSquare
Definition TAttMarker.h:56
@ kFullThreeTriangles
Definition TAttMarker.h:61
@ kOpenTriangleUp
Definition TAttMarker.h:57
@ kFourSquaresPlus
Definition TAttMarker.h:66
@ kFullDotSmall
Definition TAttMarker.h:54
@ kFullDotMedium
Definition TAttMarker.h:54
@ kOpenTriangleDown
Definition TAttMarker.h:58
@ kOpenThreeTriangles
Definition TAttMarker.h:60
@ kFullCrossX
Definition TAttMarker.h:65
@ kFullFourTrianglesX
Definition TAttMarker.h:62
@ kFullTriangleDown
Definition TAttMarker.h:56
@ kCircle
Definition TAttMarker.h:53
@ kOpenCrossX
Definition TAttMarker.h:65
@ kFullFourTrianglesPlus
Definition TAttMarker.h:64
@ kFullSquare
Definition TAttMarker.h:55
@ kOpenSquareDiagonal
Definition TAttMarker.h:60
@ kFullStar
Definition TAttMarker.h:58
@ kOpenDiamond
Definition TAttMarker.h:57
@ kFullTriangleUp
Definition TAttMarker.h:55
@ kOpenDiamondCross
Definition TAttMarker.h:59
@ kOpenFourTrianglesPlus
Definition TAttMarker.h:64
@ kMultiply
Definition TAttMarker.h:53
@ kPlus
Definition TAttMarker.h:53
@ kOctagonCross
Definition TAttMarker.h:61
@ kFullCircle
Definition TAttMarker.h:55
@ kDot
Definition TAttMarker.h:53
@ kOpenCross
Definition TAttMarker.h:57
@ kFourSquaresX
Definition TAttMarker.h:65
@ kOpenCircle
Definition TAttMarker.h:56
@ kFullCross
Definition TAttMarker.h:59
@ kOpenStar
Definition TAttMarker.h:58
@ kFullDiamond
Definition TAttMarker.h:59
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 rect
Option_t Option_t TPoint xy
Option_t Option_t TPoint DrawPolyMarker
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
void DrawMarkerOpenSquare(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerStar(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullTriangleDown(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerPlus(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullDotLarge(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenDiamond(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullFourTrianglesPlus(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenSquareDiagonal(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOctagonCross(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullDotSmall(CGContextRef ctx, unsigned n, const TPoint *xy)
void DrawMarkerFullTriangleUp(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullCrossX(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenCrossX(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerDot(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenDiamondCross(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenThreeTriangles(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenTriangleUp(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFourSquaresPlus(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullStar(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenFourTrianglesPlus(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFourSquaresX(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenCross(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullSquare(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenStar(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerX(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullDoubleDiamond(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullDiamond(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullThreeTriangles(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenDoubleDiamond(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullFourTrianglesX(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenCircle(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullCross(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenTriangleDown(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerOpenFourTrianglesX(CGContextRef ctx, unsigned n, const TPoint *xy, Size_t markerSize)
void DrawMarkerFullDotMedium(CGContextRef ctx, unsigned n, const TPoint *xy)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...