Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLPadUtils.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov 06/05/2009
3
4/*************************************************************************
5 * Copyright (C) 1995-2009, 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 <stdexcept>
13#include <cassert>
14
15#include "TVirtualX.h"
16#include "RStipples.h"
17#include "TColor.h"
18#include "TROOT.h"
19#include "TMath.h"
20
21#include "TGLPadUtils.h"
22#include "TGLIncludes.h"
23
24namespace Rgl {
25namespace Pad {
26
27const UInt_t PolygonStippleSet::fgBitSwap[] = {0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15};
28
29
30/*
31Temporary fix.
32*/
33#ifndef GL_VERSION_1_2
36#else
37const GLenum lineWidthPNAME = GLenum(GL_SMOOTH_LINE_WIDTH_RANGE);//Cast for real enums and macros.
39#endif
40
41/*
42Auxiliary class to converts ROOT's polygon stipples from
43RStipples.h into GL's stipples and hold them in a fStipples array.
44*/
45
46////////////////////////////////////////////////////////////////////////////////
47
49{
50 /*
51 I have to assume, that gStipple has two chars in a line.
52 There in no way to calculate line length and there are no corresponding constants in RStipple.h.
53 So, these numbers are hardcode here.
54 Ordering in RStipples completely different from OpenGL.
55 In OpenGL, if I have, say, 16x2 pattern, GLbytes will be:
56
57 [3][4]
58 [1][2]
59
60 and bits inside them
61
62 [7 6 5 4 3 2 1 0][7 6 5 4 3 2 1 0]
63 [7 6 5 4 3 2 1 0][7 6 5 4 3 2 1 0].
64
65 But for X11 this will be:
66
67 [2][1]
68 [4][3]
69
70 [0 1 2 3 4 5 6 7][0 1 2 3 4 5 6 7]
71 [0 1 2 3 4 5 6 7][0 1 2 3 4 5 6 7]
72
73 So, line 0x7, 0xE from X11 must be
74 converted into 0x70, 0xE0 for OpenGL.
75
76 As OpenGL expects 32x32 pattern, I have to twice each line.
77 */
78
79 /*If somebody will seriously change gStipples declaration,
80 so, that sizeof gStipples becomes "wrong", change this!*/
81 const UInt_t numOfStipples = sizeof gStipples / sizeof gStipples[0];
83
84 for (UInt_t i = 0; i < numOfStipples; ++i) {
85 const UInt_t baseInd = i * kStippleSize;
86
87 for (Int_t j = 15, j1 = 0; j >= 0; --j, ++j1) {//ROOT uses 16x16 stipples.
88 const UInt_t rowShift = j1 * kRowSize;
89
90 for (Int_t k = 1, k1 = 0; k >= 0; --k, ++k1) {//Two chars form a line.
91 const UChar_t pixel = SwapBits(gStipples[i][j * 2 + k]);
92 const UInt_t ind = baseInd + rowShift + k1;
93
95 fStipples[ind + 2] = pixel;
96 fStipples[ind + 64] = pixel;
97 fStipples[ind + 66] = pixel;
98 }
99 }
100 }
101}
102
103////////////////////////////////////////////////////////////////////////////////
104
106{
107 b &= k16Bits;
108
109 const UInt_t low = fgBitSwap[b & kLow4] << 4;
110 const UInt_t up = fgBitSwap[(b & kUp4) >> 4];
111
112 return low | up;
113}
114
115/*
116Class to manipulate fill parameters.
117*/
118////////////////////////////////////////////////////////////////////////////////
119///Polygon stipple, if required.
120
122 : fStipple(0), fAlpha(1.)
123{
124 const UInt_t style = gVirtualX->GetFillStyle() / 1000;
125
126 if (!ignoreStipple) {
127 if (style == 3) {
128 const UInt_t fasi = gVirtualX->GetFillStyle() % 1000;
129 fStipple = (fasi >= 1 && fasi <=25) ? fasi : 2;
132 }
133 }
134
135 // Color and transparency
136 Float_t rgba[] = {0.f, 0.f, 0.f, 1.f};
137 ExtractRGBA(gVirtualX->GetFillColor(), rgba);
138 fAlpha = rgba[3];
139 if (fAlpha<1.) {
142 }
144}
145
146////////////////////////////////////////////////////////////////////////////////
147
156
157/*
158"ROOT like" line stipples.
159*/
160
161const UShort_t gLineStipples[] = {0xffff, 0xffff, 0x3333, 0x5555,
162 0xf040, 0xf4f4, 0xf111, 0xf0f0,
163 0xff11, 0x3fff, 0x08ff};
164
166
167/*
168Set/unset line attributes.
169*/
170////////////////////////////////////////////////////////////////////////////////
171///Set up line parameters.
172///Smooth.
173
175 : fSmooth(smooth), fStipple(stipple), fSetWidth(setWidth), fAlpha(0.8)
176{
177 if (fSmooth) {
182 }
183
184 //Stipple.
185 if (fStipple > 1) {
186 if (fStipple >= gMaxStipple)
187 fStipple = 1;
188 else {
191 }
192 }
193
194 //Color and transparency
195 Float_t rgba[] = {0.f, 0.f, 0.f, 0.8f};
196 ExtractRGBA(gVirtualX->GetLineColor(), rgba);
197 fAlpha = rgba[3];
198 if (fAlpha<0.8) {
201 }
203
204 //Width.
205 if (fSetWidth) {
206 const Width_t w = gVirtualX->GetLineWidth();
207 glLineWidth(w > maxWidth ? maxWidth : !w ? 1.f : w);
208 }
209}
210
211////////////////////////////////////////////////////////////////////////////////
212
214{
215 if (fSmooth || fAlpha<0.8) {
218 }
219
220 if (fStipple > 1)
222
223 if (fSetWidth)
224 glLineWidth(1.f);
225}
226
227/*
228Auxiliary class to draw markers in a gl-pad.
229*/
230
231////////////////////////////////////////////////////////////////////////////////
232/// Simple 1-pixel dots.
233
235{
236 glBegin(GL_POINTS);
237
238 for (UInt_t i = 0; i < n; ++i)
239 glVertex2d(xy[i].fX, xy[i].fY);
240
241 glEnd();
242}
243
244////////////////////////////////////////////////////////////////////////////////
245/// + sign. 1 pixel width lines.
246
248{
249 const Double_t im = 4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5;
250 glBegin(GL_LINES);
251
252 for (UInt_t i = 0; i < n; ++i) {
253 const Double_t x = xy[i].fX;
254 const Double_t y = xy[i].fY;
255 glVertex2d(-im + x, y);
256 glVertex2d(im + x, y);
257 glVertex2d(x, -im + y);
258 glVertex2d(x, im + y);
259 }
260
261 glEnd();
262}
263
264////////////////////////////////////////////////////////////////////////////////
265/// * marker.
266
268{
269 SCoord_t im = SCoord_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
270 fStar[0].fX = -im; fStar[0].fY = 0;
271 fStar[1].fX = im; fStar[1].fY = 0;
272 fStar[2].fX = 0 ; fStar[2].fY = -im;
273 fStar[3].fX = 0 ; fStar[3].fY = im;
274 im = SCoord_t(0.707*Float_t(im) + 0.5);
275 fStar[4].fX = -im; fStar[4].fY = -im;
276 fStar[5].fX = im; fStar[5].fY = im;
277 fStar[6].fX = -im; fStar[6].fY = im;
278 fStar[7].fX = im; fStar[7].fY = -im;
279
280 glBegin(GL_LINES);
281
282 for (UInt_t i = 0; i < n; ++i) {
283 const Double_t x = xy[i].fX;
284 const Double_t y = xy[i].fY;
285
286 glVertex2d(fStar[0].fX + x, fStar[0].fY + y);
287 glVertex2d(fStar[1].fX + x, fStar[1].fY + y);
288 glVertex2d(fStar[2].fX + x, fStar[2].fY + y);
289 glVertex2d(fStar[3].fX + x, fStar[3].fY + y);
290 glVertex2d(fStar[4].fX + x, fStar[4].fY + y);
291 glVertex2d(fStar[5].fX + x, fStar[5].fY + y);
292 glVertex2d(fStar[6].fX + x, fStar[6].fY + y);
293 glVertex2d(fStar[7].fX + x, fStar[7].fY + y);
294 }
295
296 glEnd();
297}
298
299////////////////////////////////////////////////////////////////////////////////
300
302{
303 const Double_t im = 0.707 * (4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5) + 0.5;
304
305 glBegin(GL_LINES);
306
307 for (UInt_t i = 0; i < n; ++i) {
308 const Double_t x = xy[i].fX;
309 const Double_t y = xy[i].fY;
310
311 glVertex2d(-im + x, -im + y);
312 glVertex2d(im + x, im + y);
313 glVertex2d(-im + x, im + y);
314 glVertex2d(im + x, -im + y);
315 }
316
317 glEnd();
318}
319
320////////////////////////////////////////////////////////////////////////////////
321
323{
324 glBegin(GL_LINES);
325
326 for (UInt_t i = 0; i < n; ++i) {
327 const Double_t x = xy[i].fX;
328 const Double_t y = xy[i].fY;
329
330 glVertex2d(-1. + x, y);
331 glVertex2d(x + 1., y);
332 glVertex2d(x, -1. + y);
333 glVertex2d(x, 1. + y);
334 }
335
336 glEnd();
337}
338
339////////////////////////////////////////////////////////////////////////////////
340
342{
343 for (UInt_t i = 0; i < n; ++i)
344 glRectd(xy[i].fX - 1, xy[i].fY - 1, xy[i].fX + 1, xy[i].fY + 1);
345}
346
347namespace {
348//Auxilary function for MarkerPainter. Define near the end of this source file.
349void CalculateCircle(std::vector<TPoint> &circle, Double_t r, UInt_t pts);
350}
351
352////////////////////////////////////////////////////////////////////////////////
353
355{
356 Double_t r = 4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5;
357 if (r > 100.)
358 r = 100.;//as in TGX11.
359
360 fCircle.clear();
362
363 for (UInt_t i = 0; i < n; ++i) {
364 const Double_t x = xy[i].fX;
365 const Double_t y = xy[i].fY;
366
367 glBegin(GL_LINE_LOOP);
368 for (UInt_t j = 0, e = fCircle.size(); j < e; ++j)
369 glVertex2d(fCircle[j].fX + x, fCircle[j].fY + y);
370 glEnd();
371 }
372}
373
374////////////////////////////////////////////////////////////////////////////////
375
377{
378 fCircle.clear();
379 fCircle.push_back(TPoint(0, 0));
380
381 Double_t r = 4 * gVirtualX->GetMarkerSize() + 0.5;
382 if (r > 100.)
383 r = 100;//as in TGX11.
384
386
387 for (UInt_t i = 0; i < n; ++i) {
388 const Double_t x = xy[i].fX;
389 const Double_t y = xy[i].fY;
390
392 for (UInt_t j = 0, e = fCircle.size(); j < e; ++j)
393 glVertex2d(fCircle[j].fX + x, fCircle[j].fY + y);
394 glEnd();
395 }
396}
397
398////////////////////////////////////////////////////////////////////////////////
399
401{
402 const Double_t im = 4 * gVirtualX->GetMarkerSize() + 0.5;
403 for (UInt_t i = 0; i < n; ++i)
404 glRectd(xy[i].fX - im, xy[i].fY - im, xy[i].fX + im, xy[i].fY + im);
405}
406
407////////////////////////////////////////////////////////////////////////////////
408
410{
411 const Double_t im = 4 * gVirtualX->GetMarkerSize() + 0.5;
412 for (UInt_t i = 0; i < n; ++i) {
413 const Double_t x = xy[i].fX;
414 const Double_t y = xy[i].fY;
416 glVertex2d(x - im, y - im);
417 glVertex2d(x + im, y - im);
418 glVertex2d(x, im + y);
419 glEnd();
420 }
421}
422
423////////////////////////////////////////////////////////////////////////////////
424
426{
427 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
428
429 for (UInt_t i = 0; i < n; ++i) {
430 const Double_t x = xy[i].fX;
431 const Double_t y = xy[i].fY;
433 glVertex2d(x - im, y + im);
434 glVertex2d(x, y - im);
435 glVertex2d(im + x, y + im);
436 glEnd();
437 }
438}
439
440////////////////////////////////////////////////////////////////////////////////
441
443{
444 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
445 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
446 const Int_t imx = Int_t(2.66 * MarkerSizeReduced + 0.5);
447
448 for (UInt_t i = 0; i < n; ++i) {
449 const Double_t x = xy[i].fX;
450 const Double_t y = xy[i].fY;
451
452 glBegin(GL_LINE_LOOP);
453 glVertex2d(x - imx, y);
454 glVertex2d(x, y - im);
455 glVertex2d(x + imx, y);
456 glVertex2d(x, y + im);
457 glEnd();
458 }
459}
460
461////////////////////////////////////////////////////////////////////////////////
462
464{
465 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
466 const Int_t imx = Int_t(2.66 * gVirtualX->GetMarkerSize() + 0.5);
467
468 for (UInt_t i = 0; i < n; ++i) {
469 const Double_t x = xy[i].fX;
470 const Double_t y = xy[i].fY;
471
473 glVertex2d(x - imx, y);
474 glVertex2d(x, y - im);
475 glVertex2d(x + imx, y);
476 glVertex2d(x, y + im);
477 glEnd();
478 }
479}
480
481////////////////////////////////////////////////////////////////////////////////
482
484{
485 const Int_t im = Int_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
486
487 for (UInt_t i = 0; i < n; ++i) {
488 const Double_t x = xy[i].fX;
489 const Double_t y = xy[i].fY;
490 glBegin(GL_LINE_LOOP);
491 glVertex2d(x - im, y + im);
492 glVertex2d(x, y - im);
493 glVertex2d(im + x, y + im);
494 glEnd();
495 }
496}
497
498////////////////////////////////////////////////////////////////////////////////
499
501{
502 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
503 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
504 const Int_t imx = Int_t(1.33 * MarkerSizeReduced + 0.5);
505
506 for (UInt_t i = 0; i < n; ++i) {
507 const Double_t x = xy[i].fX;
508 const Double_t y = xy[i].fY;
509
510 glBegin(GL_LINE_LOOP);
511 glVertex2d(x - im, y - imx);
512 glVertex2d(x - imx, y - imx);
513 glVertex2d(x - imx, y - im);
514 glVertex2d(x + imx, y - im);
515 glVertex2d(x + imx, y - imx);
516 glVertex2d(x + im, y - imx);
517 glVertex2d(x + im, y + imx);
518 glVertex2d(x + imx, y + imx);
519 glVertex2d(x + imx, y + im);
520 glVertex2d(x - imx, y + im);
521 glVertex2d(x - imx, y + imx);
522 glVertex2d(x - im, y + imx);
523 glEnd();
524 }
525}
526
527////////////////////////////////////////////////////////////////////////////////
528
530{
531 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
532 const Int_t imx = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
533
534 for (UInt_t i = 0; i < n; ++i) {
535 const Double_t x = xy[i].fX;
536 const Double_t y = xy[i].fY;
537
539 glVertex2d(x - im, y - imx);
540 glVertex2d(x - im, y + imx);
541 glVertex2d(x + im, y + imx);
542 glVertex2d(x + im, y - imx);
543 glEnd();
545 glVertex2d(x - imx, y + imx);
546 glVertex2d(x - imx, y + im);
547 glVertex2d(x + imx, y + im);
548 glVertex2d(x + imx, y + imx);
549 glEnd();
551 glVertex2d(x - imx, y - imx);
552 glVertex2d(x - imx, y - im);
553 glVertex2d(x + imx, y - im);
554 glVertex2d(x + imx, y - imx);
555 glEnd();
556 }
557}
558
559////////////////////////////////////////////////////////////////////////////////
560/// Full star pentagone
561
563{
564 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
565 const Int_t im1 = Int_t(0.66 * gVirtualX->GetMarkerSize() + 0.5);
566 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
567 const Int_t im3 = Int_t(2.66 * gVirtualX->GetMarkerSize() + 0.5);
568 const Int_t im4 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
569
570 for (UInt_t i = 0; i < n; ++i) {
571 const Double_t x = xy[i].fX;
572 const Double_t y = xy[i].fY;
573
574 glBegin(GL_TRIANGLES);
575 glVertex2d(x - im, y - im4);//0
576 glVertex2d(x - im2, y + im1);//1
577 glVertex2d(x - im4, y - im4);//9
578
579 glVertex2d(x - im2, y + im1);//1
580 glVertex2d(x - im3, y + im);//2
581 glVertex2d(x, y + im2);//3
582
583 glVertex2d(x, y + im2);//3
584 glVertex2d(x + im3, y + im);//4
585 glVertex2d(x + im2, y + im1);//5
586
587 glVertex2d(x + im2, y + im1);//5
588 glVertex2d(x + im, y - im4);//6
589 glVertex2d(x + im4, y - im4);//7
590
591 glVertex2d(x + im4, y - im4);//7
592 glVertex2d(x, y - im);//8
593 glVertex2d(x - im4, y - im4);//9
594
595 glVertex2d(x - im4, y - im4);//9
596 glVertex2d(x - im2, y + im1);//1
597 glVertex2d(x, y + im2);//3
598
599 glVertex2d(x - im4, y - im4);//9
600 glVertex2d(x, y + im2);//3
601 glVertex2d(x + im2, y + im1);//5
602
603 glVertex2d(x - im4, y - im4);//9
604 glVertex2d(x + im2, y + im1);//5
605 glVertex2d(x + im4, y - im4);//7
606
607 glEnd();
608
609 }
610}
611
612////////////////////////////////////////////////////////////////////////////////
613/// Full star pentagone
614
616{
617 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
618 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
619 const Int_t im1 = Int_t(0.66 * MarkerSizeReduced + 0.5);
620 const Int_t im2 = Int_t(2.00 * MarkerSizeReduced + 0.5);
621 const Int_t im3 = Int_t(2.66 * MarkerSizeReduced + 0.5);
622 const Int_t im4 = Int_t(1.33 * MarkerSizeReduced + 0.5);
623
624 for (UInt_t i = 0; i < n; ++i) {
625 const Double_t x = xy[i].fX;
626 const Double_t y = xy[i].fY;
627
628 glBegin(GL_LINE_LOOP);
629 glVertex2d(x - im, y - im4);
630 glVertex2d(x - im2, y + im1);
631 glVertex2d(x - im3, y + im);
632 glVertex2d(x, y + im2);
633 glVertex2d(x + im3, y + im);
634 glVertex2d(x + im2, y + im1);
635 glVertex2d(x + im, y - im4);
636 glVertex2d(x + im4, y - im4);
637 glVertex2d(x, y - im);
638 glVertex2d(x - im4, y - im4);
639 glEnd();
640 }
641}
642
643////////////////////////////////////////////////////////////////////////////////
644
646{
647 const Int_t im = Int_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
648
649 for (unsigned i = 0; i < n; ++i) {
650 const Double_t x = xy[i].fX;
651 const Double_t y = xy[i].fY;
652
653 glBegin(GL_LINE_LOOP);
654 glVertex2d(x - im, y - im);
655 glVertex2d(x + im, y - im);
656 glVertex2d(x + im, y + im);
657 glVertex2d(x - im, y + im);
658 glVertex2d(x - im, y - im);
659 glVertex2d(x + im, y + im);
660 glVertex2d(x - im, y + im);
661 glVertex2d(x + im, y - im);
662 glEnd();
663 }
664}
665
666////////////////////////////////////////////////////////////////////////////////
667
669{
670 const Int_t im = Int_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
671
672 for (unsigned i = 0; i < n; ++i) {
673 const Double_t x = xy[i].fX;
674 const Double_t y = xy[i].fY;
675
676 glBegin(GL_LINE_LOOP);
677 glVertex2d(x - im, y );
678 glVertex2d(x , y - im);
679 glVertex2d(x + im, y );
680 glVertex2d(x , y + im);
681 glVertex2d(x - im, y );
682 glVertex2d(x + im, y );
683 glVertex2d(x , y + im);
684 glVertex2d(x , y - im);
685 glEnd();
686 }
687}
688
689////////////////////////////////////////////////////////////////////////////////
690
692{
693 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
694 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
695 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
696
697 for (unsigned i = 0; i < n; ++i) {
698 const Double_t x = xy[i].fX;
699 const Double_t y = xy[i].fY;
700
701 glBegin(GL_LINE_LOOP);
702 glVertex2d(x , y );
703 glVertex2d(x -im2, y + im);
704 glVertex2d(x - im, y );
705 glVertex2d(x , y );
706 glVertex2d(x -im2, y - im);
707 glVertex2d(x +im2, y - im);
708 glVertex2d(x , y );
709 glVertex2d(x + im, y );
710 glVertex2d(x +im2, y + im);
711 glVertex2d(x , y );
712 glEnd();
713 }
714}
715
716////////////////////////////////////////////////////////////////////////////////
717
719{
720 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
721 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
722 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
723
724 for (unsigned i = 0; i < n; ++i) {
725 const Double_t x = xy[i].fX;
726 const Double_t y = xy[i].fY;
727
728 glBegin(GL_LINE_LOOP);
729 glVertex2d(x-im, y );
730 glVertex2d(x-im, y-im2);
731 glVertex2d(x-im2, y-im);
732 glVertex2d(x+im2, y-im);
733 glVertex2d(x+im, y-im2);
734 glVertex2d(x+im, y+im2);
735 glVertex2d(x+im2, y+im);
736 glVertex2d(x-im2, y+im);
737 glVertex2d(x-im, y+im2);
738 glVertex2d(x-im, y );
739 glVertex2d(x+im, y );
740 glVertex2d(x , y );
741 glVertex2d(x , y-im);
742 glVertex2d(x , y+im);
743 glVertex2d(x , y);
744 glEnd();
745 }
746}
747
748////////////////////////////////////////////////////////////////////////////////
749
751{
752 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
753 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
754
755 for (unsigned i = 0; i < n; ++i) {
756 const Double_t x = xy[i].fX;
757 const Double_t y = xy[i].fY;
758
760 glVertex2d(x , y );
761 glVertex2d(x -im2, y + im);
762 glVertex2d(x - im, y );
763 glVertex2d(x , y );
764 glVertex2d(x -im2, y - im);
765 glVertex2d(x +im2, y - im);
766 glVertex2d(x , y );
767 glVertex2d(x + im, y );
768 glVertex2d(x +im2, y + im);
769 glVertex2d(x , y );
770 glEnd();
771 }
772}
773
774////////////////////////////////////////////////////////////////////////////////
775
777{
778 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
779 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
780 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
781
782 for (unsigned i = 0; i < n; ++i) {
783 const Double_t x = xy[i].fX;
784 const Double_t y = xy[i].fY;
785
786 glBegin(GL_LINE_LOOP);
787 glVertex2d(x , y );
788 glVertex2d(x+im2, y+im);
789 glVertex2d(x+im , y+im2);
790 glVertex2d(x , y );
791 glVertex2d(x+im , y-im2);
792 glVertex2d(x+im2, y-im);
793 glVertex2d(x , y );
794 glVertex2d(x-im2, y-im);
795 glVertex2d(x-im , y-im2);
796 glVertex2d(x , y );
797 glVertex2d(x-im , y+im2);
798 glVertex2d(x-im2, y+im);
799 glVertex2d(x , y );
800 glEnd();
801 }
802}
803
804////////////////////////////////////////////////////////////////////////////////
805
807{
808 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
809 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
810
811 for (unsigned i = 0; i < n; ++i) {
812 const Double_t x = xy[i].fX;
813 const Double_t y = xy[i].fY;
814
816 glVertex2d(x , y );
817 glVertex2d(x+im2, y+im);
818 glVertex2d(x+im , y+im2);
819 glVertex2d(x , y );
820 glVertex2d(x+im , y-im2);
821 glVertex2d(x+im2, y-im);
822 glVertex2d(x , y );
823 glVertex2d(x-im2, y-im);
824 glVertex2d(x-im , y-im2);
825 glVertex2d(x , y );
826 glVertex2d(x-im , y+im2);
827 glVertex2d(x-im2, y+im);
828 glVertex2d(x , y );
829 glEnd();
830 }
831}
832
833////////////////////////////////////////////////////////////////////////////////
834
836{
837 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
838 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
839 const Int_t im4 = Int_t(1.33 * MarkerSizeReduced + 0.5);
840
841 for (unsigned i = 0; i < n; ++i) {
842 const Double_t x = xy[i].fX;
843 const Double_t y = xy[i].fY;
844
845 glBegin(GL_LINE_LOOP);
846 glVertex2d(x , y+im );
847 glVertex2d(x-im4, y+im4);
848 glVertex2d(x-im , y );
849 glVertex2d(x-im4, y-im4);
850 glVertex2d(x , y-im );
851 glVertex2d(x+im4, y-im4);
852 glVertex2d(x+im , y );
853 glVertex2d(x+im4, y+im4);
854 glVertex2d(x , y+im );
855 glEnd();
856 }
857}
858
859////////////////////////////////////////////////////////////////////////////////
860
862{
863 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
864 const Int_t im4 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
865
866 for (unsigned i = 0; i < n; ++i) {
867 const Double_t x = xy[i].fX;
868 const Double_t y = xy[i].fY;
869
871 glVertex2d(x, y+im );
872 glVertex2d(x-im4, y+im4);
873 glVertex2d(x, y);
874 glEnd();
876 glVertex2d(x-im4, y+im4);
877 glVertex2d(x-im, y);
878 glVertex2d(x, y );
879 glEnd();
881 glVertex2d(x-im, y);
882 glVertex2d(x-im4, y-im4);
883 glVertex2d(x, y );
884 glEnd();
886 glVertex2d(x-im4, y-im4);
887 glVertex2d(x, y-im);
888 glVertex2d(x, y );
889 glEnd();
891 glVertex2d(x, y-im);
892 glVertex2d(x+im4, y-im4);
893 glVertex2d(x, y );
894 glEnd();
896 glVertex2d(x+im4, y-im4);
897 glVertex2d(x+im, y);
898 glVertex2d(x, y );
899 glEnd();
901 glVertex2d(x+im, y);
902 glVertex2d(x+im4, y+im4);
903 glVertex2d(x, y );
904 glEnd();
906 glVertex2d(x+im4, y+im4);
907 glVertex2d(x, y+im);
908 glVertex2d(x, y );
909 glEnd();
910 }
911}
912
913////////////////////////////////////////////////////////////////////////////////
914
916{
917 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
918 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
919 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
920
921 for (unsigned i = 0; i < n; ++i) {
922 const Double_t x = xy[i].fX;
923 const Double_t y = xy[i].fY;
924
925 glBegin(GL_LINE_LOOP);
926 glVertex2d(x , y );
927 glVertex2d(x+im2, y+im);
928 glVertex2d(x-im2, y+im);
929 glVertex2d(x+im2, y-im);
930 glVertex2d(x-im2, y-im);
931 glVertex2d(x , y );
932 glVertex2d(x+im, y+im2);
933 glVertex2d(x+im, y-im2);
934 glVertex2d(x-im, y+im2);
935 glVertex2d(x-im, y-im2);
936 glVertex2d(x , y );
937 glEnd();
938 }
939}
940
941////////////////////////////////////////////////////////////////////////////////
942
944{
945 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
946 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
947
948 for (unsigned i = 0; i < n; ++i) {
949 const Double_t x = xy[i].fX;
950 const Double_t y = xy[i].fY;
951
953 glVertex2d(x , y );
954 glVertex2d(x+im2, y+im);
955 glVertex2d(x-im2, y+im);
956 glVertex2d(x+im2, y-im);
957 glVertex2d(x-im2, y-im);
958 glVertex2d(x , y );
959 glVertex2d(x+im, y+im2);
960 glVertex2d(x+im, y-im2);
961 glVertex2d(x-im, y+im2);
962 glVertex2d(x-im, y-im2);
963 glVertex2d(x , y );
964 glEnd();
965 }
966}
967
968////////////////////////////////////////////////////////////////////////////////
969
971{
972 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
973 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
974 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
975
976 for (unsigned i = 0; i < n; ++i) {
977 const Double_t x = xy[i].fX;
978 const Double_t y = xy[i].fY;
979
980 glBegin(GL_LINE_LOOP);
981 glVertex2d(x , y +im2);
982 glVertex2d(x -im2, y + im);
983 glVertex2d(x - im, y +im2);
984 glVertex2d(x -im2, y );
985 glVertex2d(x - im, y -im2);
986 glVertex2d(x -im2, y - im);
987 glVertex2d(x , y -im2);
988 glVertex2d(x +im2, y - im);
989 glVertex2d(x + im, y -im2);
990 glVertex2d(x +im2, y );
991 glVertex2d(x + im, y +im2);
992 glVertex2d(x +im2, y + im);
993 glVertex2d(x , y +im2);
994 glEnd();
995 }
996}
997
998////////////////////////////////////////////////////////////////////////////////
999
1001{
1002 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1003 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
1004
1005 for (unsigned i = 0; i < n; ++i) {
1006 const Double_t x = xy[i].fX;
1007 const Double_t y = xy[i].fY;
1008
1010 glVertex2d(x , y +im2);
1011 glVertex2d(x -im2, y +im);
1012 glVertex2d(x -im , y +im2);
1013 glVertex2d(x -im2, y );
1014 glVertex2d(x , y );
1015 glEnd();
1017 glVertex2d(x -im2, y);
1018 glVertex2d(x -im, y -im2);
1019 glVertex2d(x -im2, y -im);
1020 glVertex2d(x , y-im2);
1021 glVertex2d(x , y );
1022 glEnd();
1024 glVertex2d(x , y -im2);
1025 glVertex2d(x +im2, y -im);
1026 glVertex2d(x +im , y -im2);
1027 glVertex2d(x +im2, y);
1028 glVertex2d(x , y );
1029 glEnd();
1031 glVertex2d(x +im2, y);
1032 glVertex2d(x +im , y +im2);
1033 glVertex2d(x +im2, y +im);
1034 glVertex2d(x , y +im2);
1035 glVertex2d(x , y );
1036 glEnd(); }
1037}
1038
1039////////////////////////////////////////////////////////////////////////////////
1040
1042{
1043 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1044 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
1045
1046 for (unsigned i = 0; i < n; ++i) {
1047 const Double_t x = xy[i].fX;
1048 const Double_t y = xy[i].fY;
1049
1051 glVertex2d(x, y+im2);
1052 glVertex2d(x-im2 , y+im);
1053 glVertex2d(x-im, y+im2);
1054 glVertex2d(x-im2 , y);
1055 glEnd();
1057 glVertex2d(x-im2, y);
1058 glVertex2d(x-im , y-im2);
1059 glVertex2d(x-im2, y-im);
1060 glVertex2d(x, y-im2);
1061 glEnd();
1063 glVertex2d(x, y-im2);
1064 glVertex2d(x+im2 , y-im);
1065 glVertex2d(x+im, y-im2);
1066 glVertex2d(x+im2, y);
1067 glEnd();
1069 glVertex2d(x+im2, y);
1070 glVertex2d(x+im , y+im2);
1071 glVertex2d(x+im2, y+im);
1072 glVertex2d(x, y+im2);
1073 glEnd();
1074 }
1075}
1076
1077////////////////////////////////////////////////////////////////////////////////
1078
1080{
1081 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1082 const Int_t im2 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
1083
1084 for (unsigned i = 0; i < n; ++i) {
1085 const Double_t x = xy[i].fX;
1086 const Double_t y = xy[i].fY;
1087
1089 glVertex2d(x+im2, y+im2);
1090 glVertex2d(x+im2, y+im);
1091 glVertex2d(x-im2, y+im);
1092 glVertex2d(x-im2, y+im2);
1093 glEnd();
1095 glVertex2d(x-im2, y+im2);
1096 glVertex2d(x-im, y+im2);
1097 glVertex2d(x-im, y-im2);
1098 glVertex2d(x-im2, y-im2);
1099 glEnd();
1101 glVertex2d(x-im2, y-im2);
1102 glVertex2d(x-im2, y-im);
1103 glVertex2d(x+im2, y-im);
1104 glVertex2d(x+im2, y-im2);
1105 glEnd();
1107 glVertex2d(x+im2, y-im2);
1108 glVertex2d(x+im, y-im2);
1109 glVertex2d(x+im, y+im2);
1110 glVertex2d(x+im2, y+im2);
1111 glEnd();
1112 }
1113}
1114
1115/*
1116Small RAII class for GLU tesselator.
1117*/
1118#ifndef CALLBACK
1119#define CALLBACK
1120#endif
1121
1122extern "C" {
1123#if defined(__APPLE_CC__) && __APPLE_CC__ > 4000 && __APPLE_CC__ < 5450 && !defined(__INTEL_COMPILER)
1124 typedef GLvoid (*tess_t)(...);
1125#elif defined( __mips ) || defined( __linux__ ) || defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __sun ) || defined (__CYGWIN__) || defined (__APPLE__)
1126 typedef GLvoid (*tess_t)();
1127#elif defined ( WIN32)
1128 typedef GLvoid (CALLBACK *tess_t)( );
1129#else
1130 #error "Error - need to define type tess_t for this platform/compiler"
1131#endif
1132}
1133
1134////////////////////////////////////////////////////////////////////////////////
1135
1137{
1139 if (!dump)
1140 return;
1141
1142 dump->push_back(MeshPatch_t(type));
1143}
1144
1145////////////////////////////////////////////////////////////////////////////////
1146
1147void Vertex(const Double_t *v)
1148{
1150 if (!dump)
1151 return;
1152
1153 std::vector<Double_t> & vs = dump->back().fPatch;
1154 vs.push_back(v[0]);
1155 vs.push_back(v[1]);
1156 vs.push_back(v[2]);
1157}
1158
1159////////////////////////////////////////////////////////////////////////////////
1160
1161void End()
1162{
1163}
1164
1166
1167////////////////////////////////////////////////////////////////////////////////
1168
1170 : fTess(nullptr)
1171{
1173 if (!tess)
1174 throw std::runtime_error("tesselator creation failed");
1175
1176#if defined(__GNUC__) && __GNUC__ >= 8
1177#pragma GCC diagnostic push
1178#pragma GCC diagnostic ignored "-Wcast-function-type"
1179#endif
1180
1181 if (!dump) {
1185 } else {
1189 }
1190
1191#if defined(__GNUC__) && __GNUC__ >= 8
1192#pragma GCC diagnostic pop
1193#endif
1194
1196 fTess = tess;
1197}
1198
1199////////////////////////////////////////////////////////////////////////////////
1200
1205
1206/*
1207In future, this should be an interface to per-pad FBO.
1208Currently, in only save sizes and coordinates (?)
1209*/
1210////////////////////////////////////////////////////////////////////////////////
1211
1213 : fW(w), fH(h), fX(x), fY(y), fTop(top)
1214{
1215}
1216
1217////////////////////////////////////////////////////////////////////////////////
1218
1220 : fMaxLineWidth(0.),
1221 fMaxPointSize(0.)
1222{
1223}
1224
1225////////////////////////////////////////////////////////////////////////////////
1226
1228{
1229 if (!fMaxLineWidth) {
1230 Double_t lp[2] = {};
1231 glGetDoublev(lineWidthPNAME, lp);//lineWidthPNAME is defined at the top of this file.
1232 fMaxLineWidth = lp[1];
1233 }
1234
1235 return fMaxLineWidth;
1236}
1237
1238////////////////////////////////////////////////////////////////////////////////
1239
1241{
1242 if (!fMaxPointSize) {
1243 Double_t lp[2] = {};
1244 glGetDoublev(pointSizePNAME, lp);//pointSizePNAME is defined at the top of this file.
1245 fMaxPointSize = lp[1];
1246 }
1247
1248 return fMaxLineWidth;
1249}
1250
1251
1252////////////////////////////////////////////////////////////////////////////////
1253
1255{
1256 const TColor *color = gROOT->GetColor(colorIndex);
1257 if (color) {
1258 color->GetRGB(rgba[0], rgba[1], rgba[2]);
1259 rgba[3] = color->GetAlpha();
1260 }
1261}
1262
1263////////////////////////////////////////////////////////////////////////////////
1264
1265template<class ValueType>
1266BoundingRect<ValueType> FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys)
1267{
1268 assert(nPoints > 0 && "FindBoundingRect, invalind number of points");
1269 assert(xs != nullptr && "FindBoundingRect, parameter 'xs' is null");
1270 assert(ys != nullptr && "FindBoundingRect, parameter 'ys' is null");
1271
1272 ValueType xMin = xs[0], xMax = xMin;
1273 ValueType yMin = ys[0], yMax = yMin;
1274
1275 for (Int_t i = 1; i < nPoints; ++i) {
1276 xMin = TMath::Min(xMin, xs[i]);
1277 xMax = TMath::Max(xMax, xs[i]);
1278
1279 yMin = TMath::Min(yMin, ys[i]);
1280 yMax = TMath::Max(yMax, ys[i]);
1281 }
1282
1284 box.fXMin = xMin;
1285 box.fXMax = xMax;
1286 box.fWidth = xMax - xMin;
1287
1288 box.fYMin = yMin;
1289 box.fYMax = yMax;
1290 box.fHeight = yMax - yMin;
1291
1292 return box;
1293}
1294
1300
1301
1302
1303namespace {
1304
1305////////////////////////////////////////////////////////////////////////////////
1306
1307void CalculateCircle(std::vector<TPoint> &circle, Double_t r, UInt_t pts)
1308{
1309 const Double_t delta = TMath::TwoPi() / pts;
1310 const UInt_t first = circle.size();
1311 Double_t angle = 0.;
1312 circle.resize(circle.size() + pts + 1);
1313
1314 for (UInt_t i = 0; i < pts; ++i, angle += delta) {
1315 circle[first + i].fX = SCoord_t(r * TMath::Cos(angle));
1316 circle[first + i].fY = SCoord_t(r * TMath::Sin(angle));
1317 }
1318
1319 circle.back().fX = circle[first].fX;
1320 circle.back().fY = circle[first].fY;
1321}
1322
1323}//anonymous namespace
1324
1325}//namespace Pad
1326}//namespace Rgl
#define b(i)
Definition RSha256.hxx:100
#define h(i)
Definition RSha256.hxx:106
#define e(i)
Definition RSha256.hxx:103
const unsigned char gStipples[26][32]
Definition RStipples.h:24
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Color_t
Color number (short)
Definition RtypesCore.h:99
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
short Width_t
Line width (short)
Definition RtypesCore.h:98
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
short SCoord_t
Screen coordinates (short)
Definition RtypesCore.h:100
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define CALLBACK
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
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 angle
Option_t Option_t TPoint xy
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 type
Option_t Option_t style
#define gROOT
Definition TROOT.h:414
#define gVirtualX
Definition TVirtualX.h:338
FillAttribSet(const PolygonStippleSet &set, Bool_t ignoreStipple)
Polygon stipple, if required.
Double_t GetMaxLineWidth() const
Double_t GetMaxPointSize() const
LineAttribSet(Bool_t smooth, UInt_t stipple, Double_t maxWidth, Bool_t setWidth)
Set up line parameters.
void DrawOpenThreeTriangles(UInt_t n, const TPoint *xy) const
void DrawFullCrossX(UInt_t n, const TPoint *xy) const
void DrawFullDotSmall(UInt_t n, const TPoint *xy) const
void DrawOpenSquareDiagonal(UInt_t n, const TPoint *xy) const
void DrawOpenDoubleDiamond(UInt_t n, const TPoint *xy) const
void DrawFullFourTrianglesX(UInt_t n, const TPoint *xy) const
void DrawFullDotLarge(UInt_t n, const TPoint *xy) const
void DrawFullThreeTriangles(UInt_t n, const TPoint *xy) const
void DrawCircle(UInt_t n, const TPoint *xy) const
void DrawFullFourTrianglesPlus(UInt_t n, const TPoint *xy) const
void DrawOpenCross(UInt_t n, const TPoint *xy) const
void DrawFullCross(UInt_t n, const TPoint *xy) const
void DrawFullTrianlgeDown(UInt_t n, const TPoint *xy) const
void DrawOpenStar(UInt_t n, const TPoint *xy) const
Full star pentagone.
void DrawX(UInt_t n, const TPoint *xy) const
void DrawPlus(UInt_t n, const TPoint *xy) const
void DrawFullTrianlgeUp(UInt_t n, const TPoint *xy) const
void DrawFullSquare(UInt_t n, const TPoint *xy) const
std::vector< TPoint > fCircle
void DrawOpenFourTrianglesPlus(UInt_t n, const TPoint *xy) const
void DrawStar(UInt_t n, const TPoint *xy) const
void DrawFullDoubleDiamond(UInt_t n, const TPoint *xy) const
void DrawOpenCrossX(UInt_t n, const TPoint *xy) const
void DrawDot(UInt_t n, const TPoint *xy) const
Simple 1-pixel dots.
void DrawOctagonCross(UInt_t n, const TPoint *xy) const
void DrawFourSquaresX(UInt_t n, const TPoint *xy) const
void DrawFourSquaresPlus(UInt_t n, const TPoint *xy) const
void DrawFullDotMedium(UInt_t n, const TPoint *xy) const
void DrawDiamond(UInt_t n, const TPoint *xy) const
void DrawFullStar(UInt_t n, const TPoint *xy) const
Full star pentagone.
void DrawOpenTrianlgeDown(UInt_t n, const TPoint *xy) const
void DrawFullDiamond(UInt_t n, const TPoint *xy) const
void DrawOpenFourTrianglesX(UInt_t n, const TPoint *xy) const
void DrawOpenDiamondCross(UInt_t n, const TPoint *xy) const
OffScreenDevice(UInt_t w, UInt_t h, UInt_t x, UInt_t y, Bool_t top)
std::vector< unsigned char > fStipples
Definition TGLPadUtils.h:42
static UInt_t SwapBits(UInt_t bits)
static const UInt_t fgBitSwap[]
Definition TGLPadUtils.h:44
Tesselator(Bool_t dump=kFALSE)
static Tesselation_t * GetDump()
static Tesselation_t * fVs
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
The color creation and management class.
Definition TColor.h:22
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Definition TColor.h:55
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1926
Float_t GetAlpha() const
Definition TColor.h:67
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.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
const UShort_t gLineStipples[]
std::list< MeshPatch_t > Tesselation_t
BoundingRect< ValueType > FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys)
void Vertex(const Double_t *v)
const UInt_t gMaxStipple
void ExtractRGBA(Color_t colorIndex, Float_t *rgba)
const GLenum lineWidthPNAME
void Begin(Int_t type)
const GLenum pointSizePNAME
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:249
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Definition TMath.h:691
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:197
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599
constexpr Double_t TwoPi()
Definition TMath.h:47