21 void DrawMarkerDot(CGContextRef ctx,
unsigned n,
const TPoint *xy)
23 for (
unsigned i = 0; i < n; ++i)
24 CGContextFillRect(ctx, CGRectMake(xy[i].fX, xy[i].fY, 1.f, 1.f));
29 void DrawMarkerPlus(CGContextRef ctx,
unsigned n,
const TPoint *xy,
32 const Double_t im = 4 * markerSize + 0.5;
34 for (UInt_t i = 0; i < n; ++i) {
35 const Double_t x = xy[i].fX;
36 const Double_t y = xy[i].fY;
38 CGContextBeginPath(ctx);
39 CGContextMoveToPoint(ctx, -im + x, y);
40 CGContextAddLineToPoint(ctx, im + x, y);
41 CGContextStrokePath(ctx);
43 CGContextBeginPath(ctx);
44 CGContextMoveToPoint(ctx, x, -im + y);
45 CGContextAddLineToPoint(ctx, x, im + y);
46 CGContextStrokePath(ctx);
52 void DrawMarkerStar(CGContextRef ctx,
unsigned n,
const TPoint *xy,
55 Double_t im = 4 * markerSize + 0.5;
58 star[0].fX = -im; star[0].fY = 0;
59 star[1].fX = im; star[1].fY = 0;
60 star[2].fX = 0 ; star[2].fY = -im;
61 star[3].fX = 0 ; star[3].fY = im;
63 im = 0.707 * im + 0.5;
64 star[4].fX = -im; star[4].fY = -im;
65 star[5].fX = im; star[5].fY = im;
66 star[6].fX = -im; star[6].fY = im;
67 star[7].fX = im; star[7].fY = -im;
69 for (UInt_t i = 0; i < n; ++i) {
70 const Double_t x = xy[i].fX;
71 const Double_t y = xy[i].fY;
73 CGContextBeginPath(ctx);
74 CGContextMoveToPoint(ctx, star[0].fX + x, star[0].fY + y);
75 CGContextAddLineToPoint(ctx, star[1].fX + x, star[1].fY + y);
76 CGContextStrokePath(ctx);
78 CGContextBeginPath(ctx);
79 CGContextMoveToPoint(ctx, star[2].fX + x, star[2].fY + y);
80 CGContextAddLineToPoint(ctx, star[3].fX + x, star[3].fY + y);
81 CGContextStrokePath(ctx);
83 CGContextBeginPath(ctx);
84 CGContextMoveToPoint(ctx, star[4].fX + x, star[4].fY + y);
85 CGContextAddLineToPoint(ctx, star[5].fX + x, star[5].fY + y);
86 CGContextStrokePath(ctx);
88 CGContextBeginPath(ctx);
89 CGContextMoveToPoint(ctx, star[6].fX + x, star[6].fY + y);
90 CGContextAddLineToPoint(ctx, star[7].fX + x, star[7].fY + y);
91 CGContextStrokePath(ctx);
97 void DrawMarkerOpenCircle(CGContextRef ctx,
unsigned n,
const TPoint *xy,
100 Double_t r = 4 * markerSize + 0.5;
104 const Double_t d = 2 * r;
106 for (
unsigned i = 0; i < n; ++i) {
107 const Double_t x = xy[i].fX;
108 const Double_t y = xy[i].fY;
110 const CGRect rect = CGRectMake(x - r, y - r, d, d);
111 CGContextStrokeEllipseInRect(ctx, rect);
117 void DrawMarkerX(CGContextRef ctx,
unsigned n,
const TPoint *xy,
120 const Double_t im = 0.707 * (4 * markerSize + 0.5) + 0.5;
121 for (
unsigned i = 0; i < n; ++i) {
122 const Double_t x = xy[i].fX;
123 const Double_t y = xy[i].fY;
125 CGContextBeginPath(ctx);
126 CGContextMoveToPoint(ctx, -im + x, -im + y);
127 CGContextAddLineToPoint(ctx, im + x, im + y);
128 CGContextStrokePath(ctx);
130 CGContextBeginPath(ctx);
131 CGContextMoveToPoint(ctx, -im + x, im + y);
132 CGContextAddLineToPoint(ctx, im + x, -im + y);
133 CGContextStrokePath(ctx);
139 void DrawMarkerFullDotSmall(CGContextRef ctx,
unsigned n,
const TPoint *xy)
141 for (
unsigned i = 0; i < n; ++i) {
142 const Double_t x = xy[i].fX;
143 const Double_t y = xy[i].fY;
145 CGContextBeginPath(ctx);
146 CGContextMoveToPoint(ctx, -1. + x, y);
147 CGContextAddLineToPoint(ctx, x + 1., y);
148 CGContextStrokePath(ctx);
150 CGContextBeginPath(ctx);
151 CGContextMoveToPoint(ctx, x, -1. + y);
152 CGContextAddLineToPoint(ctx, x, 1. + y);
153 CGContextStrokePath(ctx);
159 void DrawMarkerFullDotMedium(CGContextRef ctx,
unsigned n,
const TPoint *xy)
161 for (
unsigned i = 0; i < n; ++i)
162 CGContextFillRect(ctx, CGRectMake(xy[i].fX - 1, xy[i].fY - 1, 3.f, 3.f));
167 void DrawMarkerFullDotLarge(CGContextRef ctx,
unsigned n,
const TPoint *xy,
170 Double_t radius = 4 * markerSize + 0.5;
174 const Double_t d = 2 * radius;
176 for (
unsigned i = 0; i < n; ++i) {
177 const Double_t x = xy[i].fX;
178 const Double_t y = xy[i].fY;
180 const CGRect rect = CGRectMake(x - radius, y - radius, d, d);
181 CGContextFillEllipseInRect(ctx, rect);
187 void DrawMarkerFullSquare(CGContextRef ctx,
unsigned n,
const TPoint *xy,
190 const Double_t im = 4 * markerSize + 0.5;
191 for (
unsigned i = 0; i < n; ++i) {
192 const CGRect rect = CGRectMake(xy[i].fX - im, xy[i].fY - im, im * 2, im * 2);
193 CGContextFillRect(ctx, rect);
199 void DrawMarkerOpenSquare(CGContextRef ctx,
unsigned n,
const TPoint *xy,
202 const Double_t im = 4 * markerSize + 0.5;
203 for (
unsigned i = 0; i < n; ++i) {
204 const CGRect rect = CGRectMake(xy[i].fX - im, xy[i].fY - im, im * 2, im * 2);
205 CGContextStrokeRect(ctx, rect);
211 void DrawMarkerFullTriangleUp(CGContextRef ctx,
unsigned n,
const TPoint *xy,
214 const Double_t im = 4 * markerSize + 0.5;
215 for (
unsigned i = 0; i < n; ++i) {
216 const Double_t x = xy[i].fX;
217 const Double_t y = xy[i].fY;
218 CGContextBeginPath(ctx);
219 CGContextMoveToPoint(ctx, x - im, y - im);
220 CGContextAddLineToPoint(ctx, x + im, y - im);
221 CGContextAddLineToPoint(ctx, x, im + y);
222 CGContextFillPath(ctx);
228 void DrawMarkerOpenTriangleUp(CGContextRef ctx,
unsigned n,
const TPoint *xy,
231 const Double_t im = 4 * markerSize + 0.5;
232 for (
unsigned i = 0; i < n; ++i) {
233 const Double_t x = xy[i].fX;
234 const Double_t y = xy[i].fY;
235 CGContextBeginPath(ctx);
236 CGContextMoveToPoint(ctx, x - im, y - im);
237 CGContextAddLineToPoint(ctx, x + im, y - im);
238 CGContextAddLineToPoint(ctx, x, im + y);
239 CGContextAddLineToPoint(ctx, x - im, y - im);
240 CGContextStrokePath(ctx);
246 void DrawMarkerOpenTriangleDown(CGContextRef ctx,
unsigned n,
const TPoint *xy,
249 const Int_t im = Int_t(4 * markerSize + 0.5);
250 for (
unsigned i = 0; i < n; ++i) {
251 const Double_t x = xy[i].fX;
252 const Double_t y = xy[i].fY;
254 CGContextBeginPath(ctx);
255 CGContextMoveToPoint(ctx, x - im, y + im);
256 CGContextAddLineToPoint(ctx, x, y - im);
257 CGContextAddLineToPoint(ctx, im + x, y + im);
258 CGContextAddLineToPoint(ctx, x - im, y + im);
259 CGContextStrokePath(ctx);
265 void DrawMarkerFullTriangleDown(CGContextRef ctx,
unsigned n,
const TPoint *xy,
268 const Int_t im = Int_t(4 * markerSize + 0.5);
269 for (
unsigned i = 0; i < n; ++i) {
270 const Double_t x = xy[i].fX;
271 const Double_t y = xy[i].fY;
273 CGContextBeginPath(ctx);
274 CGContextMoveToPoint(ctx, x - im, y + im);
275 CGContextAddLineToPoint(ctx, x, y - im);
276 CGContextAddLineToPoint(ctx, im + x, y + im);
277 CGContextFillPath(ctx);
283 void DrawMarkerFullDiamond(CGContextRef ctx,
unsigned n,
const TPoint *xy,
286 const Int_t im = Int_t(4 * markerSize + 0.5);
287 const Int_t imx = Int_t(2.66 * markerSize + 0.5);
289 for (
unsigned i = 0; i < n; ++i) {
290 const Double_t x = xy[i].fX;
291 const Double_t y = xy[i].fY;
293 CGContextBeginPath(ctx);
294 CGContextMoveToPoint(ctx, x - imx, y);
295 CGContextAddLineToPoint(ctx, x, y - im);
296 CGContextAddLineToPoint(ctx, x + imx, y);
297 CGContextAddLineToPoint(ctx, x, y + im);
298 CGContextDrawPath(ctx, kCGPathFillStroke);
304 void DrawMarkerOpenDiamond(CGContextRef ctx,
unsigned n,
const TPoint *xy,
307 const Int_t im = Int_t(4 * markerSize + 0.5);
308 const Int_t imx = Int_t(2.66 * markerSize + 0.5);
310 for (
unsigned i = 0; i < n; ++i) {
311 const Double_t x = xy[i].fX;
312 const Double_t y = xy[i].fY;
314 CGContextBeginPath(ctx);
315 CGContextMoveToPoint(ctx, x - imx, y);
316 CGContextAddLineToPoint(ctx, x, y - im);
317 CGContextAddLineToPoint(ctx, x + imx, y);
318 CGContextAddLineToPoint(ctx, x, y + im);
319 CGContextAddLineToPoint(ctx, x - imx, y);
320 CGContextStrokePath(ctx);
326 void DrawMarkerFullCross(CGContextRef ctx,
unsigned n,
const TPoint *xy,
329 const Int_t im = Int_t(4 * markerSize + 0.5);
330 const Int_t imx = Int_t(1.33 * markerSize + 0.5);
332 for (
unsigned i = 0; i < n; ++i) {
333 const Double_t x = xy[i].fX;
334 const Double_t y = xy[i].fY;
336 CGContextBeginPath(ctx);
337 CGContextMoveToPoint(ctx, x - im, y - imx);
338 CGContextAddLineToPoint(ctx, x - imx, y - imx);
339 CGContextAddLineToPoint(ctx, x - imx, y - im);
340 CGContextAddLineToPoint(ctx, x + imx, y - im);
341 CGContextAddLineToPoint(ctx, x + imx, y - imx);
342 CGContextAddLineToPoint(ctx, x + im, y - imx);
343 CGContextAddLineToPoint(ctx, x + im, y + imx);
344 CGContextAddLineToPoint(ctx, x + imx, y + imx);
345 CGContextAddLineToPoint(ctx, x + imx, y + im);
346 CGContextAddLineToPoint(ctx, x - imx, y + im);
347 CGContextAddLineToPoint(ctx, x - imx, y + imx);
348 CGContextAddLineToPoint(ctx, x - im, y + imx);
349 CGContextAddLineToPoint(ctx, x - im, y - imx);
350 CGContextFillPath(ctx);
356 void DrawMarkerOpenCross(CGContextRef ctx,
unsigned n,
const TPoint *xy,
359 const Int_t im = Int_t(4 * markerSize + 0.5);
360 const Int_t imx = Int_t(1.33 * markerSize + 0.5);
362 for (
unsigned i = 0; i < n; ++i) {
363 const Double_t x = xy[i].fX;
364 const Double_t y = xy[i].fY;
366 CGContextBeginPath(ctx);
367 CGContextMoveToPoint(ctx, x - im, y - imx);
368 CGContextAddLineToPoint(ctx, x - imx, y - imx);
369 CGContextAddLineToPoint(ctx, x - imx, y - im);
370 CGContextAddLineToPoint(ctx, x + imx, y - im);
371 CGContextAddLineToPoint(ctx, x + imx, y - imx);
372 CGContextAddLineToPoint(ctx, x + im, y - imx);
373 CGContextAddLineToPoint(ctx, x + im, y + imx);
374 CGContextAddLineToPoint(ctx, x + imx, y + imx);
375 CGContextAddLineToPoint(ctx, x + imx, y + im);
376 CGContextAddLineToPoint(ctx, x - imx, y + im);
377 CGContextAddLineToPoint(ctx, x - imx, y + imx);
378 CGContextAddLineToPoint(ctx, x - im, y + imx);
379 CGContextAddLineToPoint(ctx, x - im, y - imx);
380 CGContextStrokePath(ctx);
386 void DrawMarkerFullStar(CGContextRef ctx,
unsigned n,
const TPoint *xy,
390 const Int_t im = Int_t(4 * markerSize + 0.5);
391 const Int_t im1 = Int_t(0.66 * markerSize + 0.5);
392 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
393 const Int_t im3 = Int_t(2.66 * markerSize + 0.5);
394 const Int_t im4 = Int_t(1.33 * markerSize + 0.5);
396 for (
unsigned i = 0; i < n; ++i) {
397 const Double_t x = xy[i].fX;
398 const Double_t y = xy[i].fY;
400 CGContextBeginPath(ctx);
401 CGContextMoveToPoint(ctx, x - im, y - im4);
402 CGContextAddLineToPoint(ctx, x - im2, y + im1);
403 CGContextAddLineToPoint(ctx, x - im4, y - im4);
404 CGContextFillPath(ctx);
406 CGContextBeginPath(ctx);
407 CGContextMoveToPoint(ctx, x - im2, y + im1);
408 CGContextAddLineToPoint(ctx, x - im3, y + im);
409 CGContextAddLineToPoint(ctx, x, y + im2);
410 CGContextFillPath(ctx);
412 CGContextBeginPath(ctx);
413 CGContextMoveToPoint(ctx, x, y + im2);
414 CGContextAddLineToPoint(ctx, x + im3, y + im);
415 CGContextAddLineToPoint(ctx, x + im2, y + im1);
416 CGContextFillPath(ctx);
418 CGContextBeginPath(ctx);
419 CGContextMoveToPoint(ctx, x + im2, y + im1);
420 CGContextAddLineToPoint(ctx, x + im, y - im4);
421 CGContextAddLineToPoint(ctx,x + im4, y - im4);
422 CGContextFillPath(ctx);
424 CGContextBeginPath(ctx);
425 CGContextMoveToPoint(ctx, x + im4, y - im4);
426 CGContextAddLineToPoint(ctx, x, y - im);
427 CGContextAddLineToPoint(ctx, x - im4, y - im4);
428 CGContextFillPath(ctx);
430 CGContextBeginPath(ctx);
431 CGContextMoveToPoint(ctx, x - im4, y - im4);
432 CGContextAddLineToPoint(ctx, x - im2, y + im1);
433 CGContextAddLineToPoint(ctx, x, y + im2);
434 CGContextFillPath(ctx);
436 CGContextBeginPath(ctx);
437 CGContextMoveToPoint(ctx, x - im4, y - im4);
438 CGContextAddLineToPoint(ctx, x, y + im2);
439 CGContextAddLineToPoint(ctx, x + im2, y + im1);
440 CGContextFillPath(ctx);
442 CGContextBeginPath(ctx);
443 CGContextMoveToPoint(ctx, x - im4, y - im4);
444 CGContextAddLineToPoint(ctx, x + im2, y + im1);
445 CGContextAddLineToPoint(ctx, x + im4, y - im4);
446 CGContextFillPath(ctx);
452 void DrawMarkerOpenStar(CGContextRef ctx,
unsigned n,
const TPoint *xy,
455 const Int_t im = Int_t(4 * markerSize + 0.5);
456 const Int_t im1 = Int_t(0.66 * markerSize + 0.5);
457 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
458 const Int_t im3 = Int_t(2.66 * markerSize + 0.5);
459 const Int_t im4 = Int_t(1.33 * markerSize + 0.5);
461 for (
unsigned i = 0; i < n; ++i) {
462 const Double_t x = xy[i].fX;
463 const Double_t y = xy[i].fY;
465 CGContextBeginPath(ctx);
466 CGContextMoveToPoint(ctx, x - im, y - im4);
467 CGContextAddLineToPoint(ctx, x - im2, y + im1);
468 CGContextAddLineToPoint(ctx, x - im3, y + im);
469 CGContextAddLineToPoint(ctx, x, y + im2);
470 CGContextAddLineToPoint(ctx, x + im3, y + im);
471 CGContextAddLineToPoint(ctx, x + im2, y + im1);
472 CGContextAddLineToPoint(ctx, x + im, y - im4);
473 CGContextAddLineToPoint(ctx, x + im4, y - im4);
474 CGContextAddLineToPoint(ctx, x, y - im);
475 CGContextAddLineToPoint(ctx, x - im4, y - im4);
476 CGContextAddLineToPoint(ctx, x - im, y - im4);
477 CGContextStrokePath(ctx);
482 void DrawMarkerOpenSquareDiagonal(CGContextRef ctx,
unsigned n,
const TPoint *xy,
485 const Int_t im = Int_t(4 * markerSize + 0.5);
487 for (
unsigned i = 0; i < n; ++i) {
488 const Double_t x = xy[i].fX;
489 const Double_t y = xy[i].fY;
491 CGContextBeginPath(ctx);
492 CGContextMoveToPoint(ctx, x - im, y - im);
493 CGContextAddLineToPoint(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 CGContextStrokePath(ctx);
500 CGContextBeginPath(ctx);
501 CGContextMoveToPoint(ctx, x - im, y + im);
502 CGContextAddLineToPoint(ctx, x + im, y - im);
503 CGContextStrokePath(ctx);
508 void DrawMarkerOpenDiamondCross(CGContextRef ctx,
unsigned n,
const TPoint *xy,
511 const Int_t im = Int_t(4 * markerSize + 0.5);
513 for (
unsigned i = 0; i < n; ++i) {
514 const Double_t x = xy[i].fX;
515 const Double_t y = xy[i].fY;
517 CGContextBeginPath(ctx);
518 CGContextMoveToPoint(ctx, x - im, y );
519 CGContextAddLineToPoint(ctx, x , y - im);
520 CGContextAddLineToPoint(ctx, x + im, y );
521 CGContextAddLineToPoint(ctx, x , y + im);
522 CGContextAddLineToPoint(ctx, x - im, y );
523 CGContextAddLineToPoint(ctx, x + im, y );
524 CGContextStrokePath(ctx);
526 CGContextBeginPath(ctx);
527 CGContextMoveToPoint(ctx, x , y + im);
528 CGContextAddLineToPoint(ctx, x , y - im);
529 CGContextStrokePath(ctx);
534 void DrawMarkerOpenThreeTriangles(CGContextRef ctx,
unsigned n,
const TPoint *xy,
537 const Int_t im = Int_t(4 * markerSize + 0.5);
538 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
540 for (
unsigned i = 0; i < n; ++i) {
541 const Double_t x = xy[i].fX;
542 const Double_t y = xy[i].fY;
544 CGContextBeginPath(ctx);
545 CGContextMoveToPoint(ctx, x , y );
546 CGContextAddLineToPoint(ctx, x -im2, y + im);
547 CGContextAddLineToPoint(ctx, x - im, y );
548 CGContextAddLineToPoint(ctx, x , y );
549 CGContextAddLineToPoint(ctx, x -im2, y - im);
550 CGContextAddLineToPoint(ctx, x +im2, y - im);
551 CGContextAddLineToPoint(ctx, x , y );
552 CGContextAddLineToPoint(ctx, x + im, y );
553 CGContextAddLineToPoint(ctx, x +im2, y + im);
554 CGContextAddLineToPoint(ctx, x , y );
555 CGContextStrokePath(ctx);
560 void DrawMarkerOctagonCross(CGContextRef ctx,
unsigned n,
const TPoint *xy,
563 const Int_t im = Int_t(4 * markerSize + 0.5);
564 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
566 for (
unsigned i = 0; i < n; ++i) {
567 const Double_t x = xy[i].fX;
568 const Double_t y = xy[i].fY;
570 CGContextBeginPath(ctx);
571 CGContextMoveToPoint(ctx, x - im, y );
572 CGContextAddLineToPoint(ctx, x - im, y -im2);
573 CGContextAddLineToPoint(ctx, x -im2, y - im);
574 CGContextAddLineToPoint(ctx, x +im2, y - im);
575 CGContextAddLineToPoint(ctx, x + im, y -im2);
576 CGContextAddLineToPoint(ctx, x + im, y +im2);
577 CGContextAddLineToPoint(ctx, x +im2, y + im);
578 CGContextAddLineToPoint(ctx, x -im2, y + im);
579 CGContextAddLineToPoint(ctx, x - im, y +im2);
580 CGContextAddLineToPoint(ctx, x - im, y );
581 CGContextAddLineToPoint(ctx, x + im, y );
582 CGContextStrokePath(ctx);
584 CGContextBeginPath(ctx);
585 CGContextMoveToPoint(ctx, x , y - im);
586 CGContextAddLineToPoint(ctx, x , y + im);
587 CGContextStrokePath(ctx);
592 void DrawMarkerFullThreeTriangles(CGContextRef ctx,
unsigned n,
const TPoint *xy,
595 const Int_t im = Int_t(4 * markerSize + 0.5);
596 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
598 for (
unsigned i = 0; i < n; ++i) {
599 const Double_t x = xy[i].fX;
600 const Double_t y = xy[i].fY;
602 CGContextBeginPath(ctx);
603 CGContextMoveToPoint(ctx, x , y );
604 CGContextAddLineToPoint(ctx, x -im2, y + im);
605 CGContextAddLineToPoint(ctx, x - im, y );
606 CGContextAddLineToPoint(ctx, x , y );
607 CGContextAddLineToPoint(ctx, x -im2, y - im);
608 CGContextAddLineToPoint(ctx, x +im2, y - im);
609 CGContextAddLineToPoint(ctx, x , y );
610 CGContextAddLineToPoint(ctx, x + im, y );
611 CGContextAddLineToPoint(ctx, x +im2, y + im);
612 CGContextAddLineToPoint(ctx, x , y );
613 CGContextFillPath(ctx);
618 void DrawMarkerOpenFourTrianglesX(CGContextRef ctx,
unsigned n,
const TPoint *xy,
621 const Int_t im = Int_t(4 * markerSize + 0.5);
622 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
624 for (
unsigned i = 0; i < n; ++i) {
625 const Double_t x = xy[i].fX;
626 const Double_t y = xy[i].fY;
628 CGContextBeginPath(ctx);
629 CGContextMoveToPoint(ctx, x , y );
630 CGContextAddLineToPoint(ctx, x +im2, y + im);
631 CGContextAddLineToPoint(ctx, x + im, y +im2);
632 CGContextAddLineToPoint(ctx, x , y );
633 CGContextAddLineToPoint(ctx, x + im, y -im2);
634 CGContextAddLineToPoint(ctx, x +im2, y - im);
635 CGContextAddLineToPoint(ctx, x , y );
636 CGContextAddLineToPoint(ctx, x -im2, y - im);
637 CGContextAddLineToPoint(ctx, x - im, y -im2);
638 CGContextAddLineToPoint(ctx, x , y );
639 CGContextAddLineToPoint(ctx, x - im, y +im2);
640 CGContextAddLineToPoint(ctx, x -im2, y + im);
641 CGContextAddLineToPoint(ctx, x , y );
642 CGContextStrokePath(ctx);
647 void DrawMarkerFullFourTrianglesX(CGContextRef ctx,
unsigned n,
const TPoint *xy,
650 const Int_t im = Int_t(4 * markerSize + 0.5);
651 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
653 for (
unsigned i = 0; i < n; ++i) {
654 const Double_t x = xy[i].fX;
655 const Double_t y = xy[i].fY;
657 CGContextBeginPath(ctx);
658 CGContextMoveToPoint(ctx, x , y );
659 CGContextAddLineToPoint(ctx, x +im2, y + im);
660 CGContextAddLineToPoint(ctx, x + im, y +im2);
661 CGContextAddLineToPoint(ctx, x , y );
662 CGContextAddLineToPoint(ctx, x + im, y -im2);
663 CGContextAddLineToPoint(ctx, x +im2, y - im);
664 CGContextAddLineToPoint(ctx, x , y );
665 CGContextAddLineToPoint(ctx, x -im2, y - im);
666 CGContextAddLineToPoint(ctx, x - im, y -im2);
667 CGContextAddLineToPoint(ctx, x , y );
668 CGContextAddLineToPoint(ctx, x - im, y +im2);
669 CGContextAddLineToPoint(ctx, x -im2, y + im);
670 CGContextAddLineToPoint(ctx, x , y );
671 CGContextFillPath(ctx);
676 void DrawMarkerOpenDoubleDiamond(CGContextRef ctx,
unsigned n,
const TPoint *xy,
679 const Int_t im = Int_t(4 * markerSize + 0.5);
680 const Int_t im4 = Int_t(markerSize + 0.5);
682 for (
unsigned i = 0; i < n; ++i) {
683 const Double_t x = xy[i].fX;
684 const Double_t y = xy[i].fY;
686 CGContextBeginPath(ctx);
687 CGContextMoveToPoint(ctx, x , y + im);
688 CGContextAddLineToPoint(ctx, x -im4, y +im4);
689 CGContextAddLineToPoint(ctx, x - im, y );
690 CGContextAddLineToPoint(ctx, x -im4, y -im4);
691 CGContextAddLineToPoint(ctx, x , y - im);
692 CGContextAddLineToPoint(ctx, x +im4, y -im4);
693 CGContextAddLineToPoint(ctx, x + im, y );
694 CGContextAddLineToPoint(ctx, x +im4, y +im4);
695 CGContextAddLineToPoint(ctx, x , y + im);
696 CGContextStrokePath(ctx);
701 void DrawMarkerFullDoubleDiamond(CGContextRef ctx,
unsigned n,
const TPoint *xy,
704 const Int_t im = Int_t(4 * markerSize + 0.5);
705 const Int_t im4 = Int_t( markerSize + 0.5);
707 for (
unsigned i = 0; i < n; ++i) {
708 const Double_t x = xy[i].fX;
709 const Double_t y = xy[i].fY;
711 CGContextBeginPath(ctx);
712 CGContextMoveToPoint(ctx, x , y + im);
713 CGContextAddLineToPoint(ctx, x -im4, y +im4);
714 CGContextAddLineToPoint(ctx, x - im, y );
715 CGContextAddLineToPoint(ctx, x -im4, y -im4);
716 CGContextAddLineToPoint(ctx, x , y - im);
717 CGContextAddLineToPoint(ctx, x +im4, y -im4);
718 CGContextAddLineToPoint(ctx, x + im, y );
719 CGContextAddLineToPoint(ctx, x +im4, y +im4);
720 CGContextAddLineToPoint(ctx, x , y + im);
721 CGContextFillPath(ctx);
726 void DrawMarkerOpenFourTrianglesPlus(CGContextRef ctx,
unsigned n,
const TPoint *xy,
729 const Int_t im = Int_t(4 * markerSize + 0.5);
730 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
732 for (
unsigned i = 0; i < n; ++i) {
733 const Double_t x = xy[i].fX;
734 const Double_t y = xy[i].fY;
736 CGContextBeginPath(ctx);
737 CGContextMoveToPoint(ctx, x , y );
738 CGContextAddLineToPoint(ctx, x +im2, y + im);
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 , y );
743 CGContextAddLineToPoint(ctx, x + im, y +im2);
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 , y );
748 CGContextStrokePath(ctx);
753 void DrawMarkerFullFourTrianglesPlus(CGContextRef ctx,
unsigned n,
const TPoint *xy,
756 const Int_t im = Int_t(4 * markerSize + 0.5);
757 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
758 const Int_t im4 = Int_t(0.2 * markerSize + 0.5);
760 for (
unsigned i = 0; i < n; ++i) {
761 const Double_t x = xy[i].fX;
762 const Double_t y = xy[i].fY;
764 CGContextBeginPath(ctx);
765 CGContextMoveToPoint(ctx, x +im4, y +im4);
766 CGContextAddLineToPoint(ctx, x +im2, y + im);
767 CGContextAddLineToPoint(ctx, x -im2, y + im);
768 CGContextAddLineToPoint(ctx, x -im4, y +im4);
769 CGContextAddLineToPoint(ctx, x - im, y +im2);
770 CGContextAddLineToPoint(ctx, x - im, y -im2);
771 CGContextAddLineToPoint(ctx, x -im4, y -im4);
772 CGContextAddLineToPoint(ctx, x -im2, y - im);
773 CGContextAddLineToPoint(ctx, x +im2, y - im);
774 CGContextAddLineToPoint(ctx, x +im4, y -im4);
775 CGContextAddLineToPoint(ctx, x + im, y -im2);
776 CGContextAddLineToPoint(ctx, x + im, y +im2);
777 CGContextAddLineToPoint(ctx, x +im4, y +im4);
778 CGContextFillPath(ctx);
783 void DrawMarkerOpenCrossX(CGContextRef ctx,
unsigned n,
const TPoint *xy,
786 const Int_t im = Int_t(4 * markerSize + 0.5);
787 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
789 for (
unsigned i = 0; i < n; ++i) {
790 const Double_t x = xy[i].fX;
791 const Double_t y = xy[i].fY;
793 CGContextBeginPath(ctx);
794 CGContextMoveToPoint(ctx, x , y + im2);
795 CGContextAddLineToPoint(ctx, x -im2, y + im);
796 CGContextAddLineToPoint(ctx, x - im, y +im2);
797 CGContextAddLineToPoint(ctx, x -im2, y );
798 CGContextAddLineToPoint(ctx, x - im, y -im2);
799 CGContextAddLineToPoint(ctx, x -im2, y - im);
800 CGContextAddLineToPoint(ctx, x , y -im2);
801 CGContextAddLineToPoint(ctx, x +im2, y - im);
802 CGContextAddLineToPoint(ctx, x + im, y -im2);
803 CGContextAddLineToPoint(ctx, x +im2, y );
804 CGContextAddLineToPoint(ctx, x + im, y +im2);
805 CGContextAddLineToPoint(ctx, x +im2, y + im);
806 CGContextAddLineToPoint(ctx, x , y +im2);
807 CGContextStrokePath(ctx);
812 void DrawMarkerFullCrossX(CGContextRef ctx,
unsigned n,
const TPoint *xy,
815 const Int_t im = Int_t(4 * markerSize + 0.5);
816 const Int_t im2 = Int_t(2.0 * markerSize + 0.5);
818 for (
unsigned i = 0; i < n; ++i) {
819 const Double_t x = xy[i].fX;
820 const Double_t y = xy[i].fY;
822 CGContextBeginPath(ctx);
823 CGContextMoveToPoint(ctx, x , y + im2);
824 CGContextAddLineToPoint(ctx, x -im2, y + im);
825 CGContextAddLineToPoint(ctx, x - im, y +im2);
826 CGContextAddLineToPoint(ctx, x -im2, y );
827 CGContextAddLineToPoint(ctx, x - im, y -im2);
828 CGContextAddLineToPoint(ctx, x -im2, y - im);
829 CGContextAddLineToPoint(ctx, x , y -im2);
830 CGContextAddLineToPoint(ctx, x +im2, y - im);
831 CGContextAddLineToPoint(ctx, x + im, y -im2);
832 CGContextAddLineToPoint(ctx, x +im2, y );
833 CGContextAddLineToPoint(ctx, x + im, y +im2);
834 CGContextAddLineToPoint(ctx, x +im2, y + im);
835 CGContextAddLineToPoint(ctx, x , y +im2);
836 CGContextFillPath(ctx);
841 void DrawMarkerFourSquaresX(CGContextRef ctx,
unsigned n,
const TPoint *xy,
844 const Int_t im = Int_t(4 * markerSize + 0.5);
845 const Int_t im2 = Int_t(2.00 * markerSize + 0.5);
847 for (
unsigned i = 0; i < n; ++i) {
848 const Double_t x = xy[i].fX;
849 const Double_t y = xy[i].fY;
851 CGContextBeginPath(ctx);
852 CGContextMoveToPoint(ctx, x , y + im2*1.01);
853 CGContextAddLineToPoint(ctx, x -im2, y + im);
854 CGContextAddLineToPoint(ctx, x - im, y +im2);
855 CGContextAddLineToPoint(ctx, x -im2, y );
856 CGContextAddLineToPoint(ctx, x - im, y -im2);
857 CGContextAddLineToPoint(ctx, x -im2, y - im);
858 CGContextAddLineToPoint(ctx, x , y -im2);
859 CGContextAddLineToPoint(ctx, x +im2, y - im);
860 CGContextAddLineToPoint(ctx, x + im, y -im2);
861 CGContextAddLineToPoint(ctx, x +im2, y );
862 CGContextAddLineToPoint(ctx, x + im, y +im2);
863 CGContextAddLineToPoint(ctx, x +im2, y + im);
864 CGContextAddLineToPoint(ctx, x , y +im2*0.99);
865 CGContextAddLineToPoint(ctx, x +im2*0.99, y );
866 CGContextAddLineToPoint(ctx, x , y -im2*0.99);
867 CGContextAddLineToPoint(ctx, x -im2*0.99, y );
868 CGContextAddLineToPoint(ctx, x , y +im2*0.99);
869 CGContextFillPath(ctx);
874 void DrawMarkerFourSquaresPlus(CGContextRef ctx,
unsigned n,
const TPoint *xy,
877 const Int_t im = Int_t(4 * markerSize + 0.5);
878 const Int_t im2 = Int_t(1.33 * markerSize + 0.5);
880 for (
unsigned i = 0; i < n; ++i) {
881 const Double_t x = xy[i].fX;
882 const Double_t y = xy[i].fY;
884 CGContextBeginPath(ctx);
885 CGContextMoveToPoint(ctx, x -im2, y - im2*1.005);
886 CGContextAddLineToPoint(ctx, x -im2, y - im);
887 CGContextAddLineToPoint(ctx, x +im2, y - im);
888 CGContextAddLineToPoint(ctx, x +im2, y -im2);
889 CGContextAddLineToPoint(ctx, x + im, y -im2);
890 CGContextAddLineToPoint(ctx, x + im, y +im2);
891 CGContextAddLineToPoint(ctx, x +im2, y +im2);
892 CGContextAddLineToPoint(ctx, x +im2, y + im);
893 CGContextAddLineToPoint(ctx, x -im2, y + im);
894 CGContextAddLineToPoint(ctx, x -im2, y +im2);
895 CGContextAddLineToPoint(ctx, x - im, y +im2);
896 CGContextAddLineToPoint(ctx, x - im, y -im2);
897 CGContextAddLineToPoint(ctx, x -im2, y -im2*0.995);
898 CGContextAddLineToPoint(ctx, x -im2, y +im2);
899 CGContextAddLineToPoint(ctx, x +im2, y +im2);
900 CGContextAddLineToPoint(ctx, x +im2, y -im2);
901 CGContextAddLineToPoint(ctx, x -im2, y -im2*1.005);
902 CGContextFillPath(ctx);
907 void DrawPolyMarker(CGContextRef ctx,
unsigned nPoints,
const TPoint *xy,
908 Size_t markerSize, Style_t markerStyle)
910 switch (markerStyle) {
912 DrawMarkerDot(ctx, nPoints, xy);
915 DrawMarkerPlus(ctx, nPoints, xy, markerSize);
919 DrawMarkerStar(ctx, nPoints, xy, markerSize);
923 DrawMarkerOpenCircle(ctx, nPoints, xy, markerSize);
926 DrawMarkerX(ctx, nPoints, xy, markerSize);
929 DrawMarkerFullDotSmall(ctx, nPoints, xy);
932 DrawMarkerFullDotMedium(ctx, nPoints, xy);
936 DrawMarkerFullDotLarge(ctx, nPoints, xy, markerSize);
939 DrawMarkerFullSquare(ctx, nPoints, xy, markerSize);
941 case kFullTriangleUp:
942 DrawMarkerFullTriangleUp(ctx, nPoints, xy, markerSize);
944 case kFullTriangleDown:
945 DrawMarkerFullTriangleDown(ctx, nPoints, xy, markerSize);
948 DrawMarkerOpenSquare(ctx, nPoints, xy, markerSize);
950 case kOpenTriangleUp:
951 DrawMarkerOpenTriangleUp(ctx, nPoints, xy, markerSize);
953 case kOpenTriangleDown:
954 DrawMarkerOpenTriangleDown(ctx, nPoints, xy, markerSize);
957 DrawMarkerOpenDiamond(ctx, nPoints, xy, markerSize);
960 DrawMarkerFullDiamond(ctx, nPoints, xy, markerSize);
963 DrawMarkerOpenCross(ctx, nPoints, xy, markerSize);
966 DrawMarkerFullCross(ctx, nPoints, xy, markerSize);
969 DrawMarkerFullStar(ctx, nPoints, xy, markerSize);
972 DrawMarkerOpenStar(ctx, nPoints, xy, markerSize);
974 case kOpenDiamondCross:
975 DrawMarkerOpenDiamondCross(ctx, nPoints, xy, markerSize);
977 case kOpenSquareDiagonal:
978 DrawMarkerOpenSquareDiagonal(ctx, nPoints, xy, markerSize);
980 case kOpenThreeTriangles:
981 DrawMarkerOpenThreeTriangles(ctx, nPoints, xy, markerSize);
984 DrawMarkerOctagonCross(ctx, nPoints, xy, markerSize);
986 case kFullThreeTriangles:
987 DrawMarkerFullThreeTriangles(ctx, nPoints, xy, markerSize);
989 case kOpenFourTrianglesX:
990 DrawMarkerOpenFourTrianglesX(ctx, nPoints, xy, markerSize);
992 case kFullFourTrianglesX:
993 DrawMarkerFullFourTrianglesX(ctx, nPoints, xy, markerSize);
995 case kOpenDoubleDiamond:
996 DrawMarkerOpenDoubleDiamond(ctx, nPoints, xy, markerSize);
998 case kFullDoubleDiamond:
999 DrawMarkerFullDoubleDiamond(ctx, nPoints, xy, markerSize);
1001 case kOpenFourTrianglesPlus:
1002 DrawMarkerOpenFourTrianglesPlus(ctx, nPoints, xy, markerSize);
1004 case kFullFourTrianglesPlus:
1005 DrawMarkerFullFourTrianglesPlus(ctx, nPoints, xy, markerSize);
1008 DrawMarkerOpenCrossX(ctx, nPoints, xy, markerSize);
1011 DrawMarkerFullCrossX(ctx, nPoints, xy, markerSize);
1014 DrawMarkerFourSquaresX(ctx, nPoints, xy, markerSize);
1016 case kFourSquaresPlus:
1017 DrawMarkerFourSquaresPlus(ctx, nPoints, xy, markerSize);
1024 void DrawPolyMarker(CGContextRef ctx,
const std::vector<TPoint> &xy,
1025 Size_t markerSize, Style_t markerStyle)
1027 DrawPolyMarker(ctx, xy.size(), &xy[0], markerSize, markerStyle);