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 Style_t fillStyle = att ? att->GetFillStyle() : gVirtualX->GetFillStyle();
125 Color_t fillColor = att ? att->GetFillColor() : gVirtualX->GetFillColor();
126
127 const UInt_t style = fillStyle / 1000;
128
129 if (!ignoreStipple) {
130 if (style == 3) {
131 const UInt_t fasi = fillStyle % 1000;
132 fStipple = (fasi >= 1 && fasi <=25) ? fasi : 2;
135 }
136 }
137
138 // Color and transparency
139 Float_t rgba[] = {0.f, 0.f, 0.f, 1.f};
141 fAlpha = rgba[3];
142 if (fAlpha<1.) {
145 }
147}
148
149////////////////////////////////////////////////////////////////////////////////
150
159
160/*
161"ROOT like" line stipples.
162*/
163
164const UShort_t gLineStipples[] = {0xffff, 0xffff, 0x3333, 0x5555,
165 0xf040, 0xf4f4, 0xf111, 0xf0f0,
166 0xff11, 0x3fff, 0x08ff};
167
169
170/*
171Set/unset line attributes.
172*/
173////////////////////////////////////////////////////////////////////////////////
174///Set up line parameters.
175///Smooth.
176
178 : fSmooth(smooth), fStipple(stipple), fSetWidth(setWidth), fAlpha(0.8)
179{
180 if (fSmooth) {
185 }
186
187 Color_t lineColor = att ? att->GetLineColor() : gVirtualX->GetLineColor();
188 Width_t lineWidth = att ? att->GetLineWidth() : gVirtualX->GetLineWidth();
189
190 //Stipple.
191 if (fStipple > 1) {
192 if (fStipple >= gMaxStipple)
193 fStipple = 1;
194 else {
197 }
198 }
199
200 //Color and transparency
201 Float_t rgba[] = {0.f, 0.f, 0.f, 0.8f};
203 fAlpha = rgba[3];
204 if (fAlpha<0.8) {
207 }
209
210 //Width.
211 if (fSetWidth) {
212 glLineWidth(lineWidth > maxWidth ? maxWidth : !lineWidth ? 1.f : lineWidth);
213 }
214}
215
216////////////////////////////////////////////////////////////////////////////////
217
219{
220 if (fSmooth || fAlpha<0.8) {
223 }
224
225 if (fStipple > 1)
227
228 if (fSetWidth)
229 glLineWidth(1.f);
230}
231
232/*
233Auxiliary class to draw markers in a gl-pad.
234*/
235
236////////////////////////////////////////////////////////////////////////////////
237/// Set marker size and line width
238
245
246////////////////////////////////////////////////////////////////////////////////
247/// Get marker size
248/// If not set before - use gVirtualX value
249
251{
252 return fSetMarker ? fMarkerSize : gVirtualX->GetMarkerSize();
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Get marker width
257/// If not set before - use gVirtualX value
258
263
264////////////////////////////////////////////////////////////////////////////////
265/// Simple 1-pixel dots.
266
268{
269 glBegin(GL_POINTS);
270
271 for (UInt_t i = 0; i < n; ++i)
272 glVertex2d(xy[i].fX, xy[i].fY);
273
274 glEnd();
275}
276
277////////////////////////////////////////////////////////////////////////////////
278/// + sign. 1 pixel width lines.
279
281{
282 const Double_t im = 4. * (GetMarkerSize() - TMath::Floor(GetMarkerWidth()/2.)/4.) + 0.5;
283 glBegin(GL_LINES);
284
285 for (UInt_t i = 0; i < n; ++i) {
286 const Double_t x = xy[i].fX;
287 const Double_t y = xy[i].fY;
288 glVertex2d(-im + x, y);
289 glVertex2d(im + x, y);
290 glVertex2d(x, -im + y);
291 glVertex2d(x, im + y);
292 }
293
294 glEnd();
295}
296
297////////////////////////////////////////////////////////////////////////////////
298/// * marker.
299
301{
302 SCoord_t im = SCoord_t(4. * (GetMarkerSize() - TMath::Floor(GetMarkerWidth()/2.)/4.) + 0.5);
303 fStar[0].fX = -im; fStar[0].fY = 0;
304 fStar[1].fX = im; fStar[1].fY = 0;
305 fStar[2].fX = 0 ; fStar[2].fY = -im;
306 fStar[3].fX = 0 ; fStar[3].fY = im;
307 im = SCoord_t(0.707*Float_t(im) + 0.5);
308 fStar[4].fX = -im; fStar[4].fY = -im;
309 fStar[5].fX = im; fStar[5].fY = im;
310 fStar[6].fX = -im; fStar[6].fY = im;
311 fStar[7].fX = im; fStar[7].fY = -im;
312
313 glBegin(GL_LINES);
314
315 for (UInt_t i = 0; i < n; ++i) {
316 const Double_t x = xy[i].fX;
317 const Double_t y = xy[i].fY;
318
319 glVertex2d(fStar[0].fX + x, fStar[0].fY + y);
320 glVertex2d(fStar[1].fX + x, fStar[1].fY + y);
321 glVertex2d(fStar[2].fX + x, fStar[2].fY + y);
322 glVertex2d(fStar[3].fX + x, fStar[3].fY + y);
323 glVertex2d(fStar[4].fX + x, fStar[4].fY + y);
324 glVertex2d(fStar[5].fX + x, fStar[5].fY + y);
325 glVertex2d(fStar[6].fX + x, fStar[6].fY + y);
326 glVertex2d(fStar[7].fX + x, fStar[7].fY + y);
327 }
328
329 glEnd();
330}
331
332////////////////////////////////////////////////////////////////////////////////
333
335{
336 const Double_t im = 0.707 * (4. * (GetMarkerSize() - TMath::Floor(GetMarkerWidth()/2.)/4.) + 0.5) + 0.5;
337
338 glBegin(GL_LINES);
339
340 for (UInt_t i = 0; i < n; ++i) {
341 const Double_t x = xy[i].fX;
342 const Double_t y = xy[i].fY;
343
344 glVertex2d(-im + x, -im + y);
345 glVertex2d(im + x, im + y);
346 glVertex2d(-im + x, im + y);
347 glVertex2d(im + x, -im + y);
348 }
349
350 glEnd();
351}
352
353////////////////////////////////////////////////////////////////////////////////
354
356{
357 glBegin(GL_LINES);
358
359 for (UInt_t i = 0; i < n; ++i) {
360 const Double_t x = xy[i].fX;
361 const Double_t y = xy[i].fY;
362
363 glVertex2d(-1. + x, y);
364 glVertex2d(x + 1., y);
365 glVertex2d(x, -1. + y);
366 glVertex2d(x, 1. + y);
367 }
368
369 glEnd();
370}
371
372////////////////////////////////////////////////////////////////////////////////
373
375{
376 for (UInt_t i = 0; i < n; ++i)
377 glRectd(xy[i].fX - 1, xy[i].fY - 1, xy[i].fX + 1, xy[i].fY + 1);
378}
379
380namespace {
381//Auxilary function for MarkerPainter. Define near the end of this source file.
382void CalculateCircle(std::vector<TPoint> &circle, Double_t r, UInt_t pts);
383}
384
385////////////////////////////////////////////////////////////////////////////////
386
388{
389 Double_t r = 4. * (GetMarkerSize() - TMath::Floor(GetMarkerWidth()/2.)/4.) + 0.5;
390 if (r > 100.)
391 r = 100.;//as in TGX11.
392
393 fCircle.clear();
395
396 for (UInt_t i = 0; i < n; ++i) {
397 const Double_t x = xy[i].fX;
398 const Double_t y = xy[i].fY;
399
400 glBegin(GL_LINE_LOOP);
401 for (UInt_t j = 0, e = fCircle.size(); j < e; ++j)
402 glVertex2d(fCircle[j].fX + x, fCircle[j].fY + y);
403 glEnd();
404 }
405}
406
407////////////////////////////////////////////////////////////////////////////////
408
410{
411 fCircle.clear();
412 fCircle.push_back(TPoint(0, 0));
413
414 Double_t r = 4 * GetMarkerSize() + 0.5;
415 if (r > 100.)
416 r = 100;//as in TGX11.
417
419
420 for (UInt_t i = 0; i < n; ++i) {
421 const Double_t x = xy[i].fX;
422 const Double_t y = xy[i].fY;
423
425 for (UInt_t j = 0, e = fCircle.size(); j < e; ++j)
426 glVertex2d(fCircle[j].fX + x, fCircle[j].fY + y);
427 glEnd();
428 }
429}
430
431////////////////////////////////////////////////////////////////////////////////
432
434{
435 const Double_t im = 4 * GetMarkerSize() + 0.5;
436 for (UInt_t i = 0; i < n; ++i)
437 glRectd(xy[i].fX - im, xy[i].fY - im, xy[i].fX + im, xy[i].fY + im);
438}
439
440////////////////////////////////////////////////////////////////////////////////
441
443{
444 const Double_t im = 4 * GetMarkerSize() + 0.5;
445 for (UInt_t i = 0; i < n; ++i) {
446 const Double_t x = xy[i].fX;
447 const Double_t y = xy[i].fY;
449 glVertex2d(x - im, y - im);
450 glVertex2d(x + im, y - im);
451 glVertex2d(x, im + y);
452 glEnd();
453 }
454}
455
456////////////////////////////////////////////////////////////////////////////////
457
459{
460 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
461
462 for (UInt_t i = 0; i < n; ++i) {
463 const Double_t x = xy[i].fX;
464 const Double_t y = xy[i].fY;
466 glVertex2d(x - im, y + im);
467 glVertex2d(x, y - im);
468 glVertex2d(im + x, y + im);
469 glEnd();
470 }
471}
472
473////////////////////////////////////////////////////////////////////////////////
474
476{
478 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
479 const Int_t imx = Int_t(2.66 * MarkerSizeReduced + 0.5);
480
481 for (UInt_t i = 0; i < n; ++i) {
482 const Double_t x = xy[i].fX;
483 const Double_t y = xy[i].fY;
484
485 glBegin(GL_LINE_LOOP);
486 glVertex2d(x - imx, y);
487 glVertex2d(x, y - im);
488 glVertex2d(x + imx, y);
489 glVertex2d(x, y + im);
490 glEnd();
491 }
492}
493
494////////////////////////////////////////////////////////////////////////////////
495
497{
498 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
499 const Int_t imx = Int_t(2.66 * GetMarkerSize() + 0.5);
500
501 for (UInt_t i = 0; i < n; ++i) {
502 const Double_t x = xy[i].fX;
503 const Double_t y = xy[i].fY;
504
506 glVertex2d(x - imx, y);
507 glVertex2d(x, y - im);
508 glVertex2d(x + imx, y);
509 glVertex2d(x, y + im);
510 glEnd();
511 }
512}
513
514////////////////////////////////////////////////////////////////////////////////
515
517{
518 const Int_t im = Int_t(4. * (GetMarkerSize() - TMath::Floor(GetMarkerWidth()/2.)/4.) + 0.5);
519
520 for (UInt_t i = 0; i < n; ++i) {
521 const Double_t x = xy[i].fX;
522 const Double_t y = xy[i].fY;
523 glBegin(GL_LINE_LOOP);
524 glVertex2d(x - im, y + im);
525 glVertex2d(x, y - im);
526 glVertex2d(im + x, y + im);
527 glEnd();
528 }
529}
530
531////////////////////////////////////////////////////////////////////////////////
532
534{
536 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
537 const Int_t imx = Int_t(1.33 * MarkerSizeReduced + 0.5);
538
539 for (UInt_t i = 0; i < n; ++i) {
540 const Double_t x = xy[i].fX;
541 const Double_t y = xy[i].fY;
542
543 glBegin(GL_LINE_LOOP);
544 glVertex2d(x - im, y - imx);
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 glVertex2d(x + im, y - imx);
550 glVertex2d(x + im, y + imx);
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 glVertex2d(x - im, y + imx);
556 glEnd();
557 }
558}
559
560////////////////////////////////////////////////////////////////////////////////
561
563{
564 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
565 const Int_t imx = Int_t(1.33 * GetMarkerSize() + 0.5);
566
567 for (UInt_t i = 0; i < n; ++i) {
568 const Double_t x = xy[i].fX;
569 const Double_t y = xy[i].fY;
570
572 glVertex2d(x - im, y - imx);
573 glVertex2d(x - im, y + imx);
574 glVertex2d(x + im, y + imx);
575 glVertex2d(x + im, y - imx);
576 glEnd();
578 glVertex2d(x - imx, y + imx);
579 glVertex2d(x - imx, y + im);
580 glVertex2d(x + imx, y + im);
581 glVertex2d(x + imx, y + imx);
582 glEnd();
584 glVertex2d(x - imx, y - imx);
585 glVertex2d(x - imx, y - im);
586 glVertex2d(x + imx, y - im);
587 glVertex2d(x + imx, y - imx);
588 glEnd();
589 }
590}
591
592////////////////////////////////////////////////////////////////////////////////
593/// Full star pentagone
594
596{
597 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
598 const Int_t im1 = Int_t(0.66 * GetMarkerSize() + 0.5);
599 const Int_t im2 = Int_t(2.00 * GetMarkerSize() + 0.5);
600 const Int_t im3 = Int_t(2.66 * GetMarkerSize() + 0.5);
601 const Int_t im4 = Int_t(1.33 * GetMarkerSize() + 0.5);
602
603 for (UInt_t i = 0; i < n; ++i) {
604 const Double_t x = xy[i].fX;
605 const Double_t y = xy[i].fY;
606
607 glBegin(GL_TRIANGLES);
608 glVertex2d(x - im, y - im4);//0
609 glVertex2d(x - im2, y + im1);//1
610 glVertex2d(x - im4, y - im4);//9
611
612 glVertex2d(x - im2, y + im1);//1
613 glVertex2d(x - im3, y + im);//2
614 glVertex2d(x, y + im2);//3
615
616 glVertex2d(x, y + im2);//3
617 glVertex2d(x + im3, y + im);//4
618 glVertex2d(x + im2, y + im1);//5
619
620 glVertex2d(x + im2, y + im1);//5
621 glVertex2d(x + im, y - im4);//6
622 glVertex2d(x + im4, y - im4);//7
623
624 glVertex2d(x + im4, y - im4);//7
625 glVertex2d(x, y - im);//8
626 glVertex2d(x - im4, y - im4);//9
627
628 glVertex2d(x - im4, y - im4);//9
629 glVertex2d(x - im2, y + im1);//1
630 glVertex2d(x, y + im2);//3
631
632 glVertex2d(x - im4, y - im4);//9
633 glVertex2d(x, y + im2);//3
634 glVertex2d(x + im2, y + im1);//5
635
636 glVertex2d(x - im4, y - im4);//9
637 glVertex2d(x + im2, y + im1);//5
638 glVertex2d(x + im4, y - im4);//7
639
640 glEnd();
641
642 }
643}
644
645////////////////////////////////////////////////////////////////////////////////
646/// Full star pentagone
647
649{
651 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
652 const Int_t im1 = Int_t(0.66 * MarkerSizeReduced + 0.5);
653 const Int_t im2 = Int_t(2.00 * MarkerSizeReduced + 0.5);
654 const Int_t im3 = Int_t(2.66 * MarkerSizeReduced + 0.5);
655 const Int_t im4 = Int_t(1.33 * MarkerSizeReduced + 0.5);
656
657 for (UInt_t i = 0; i < n; ++i) {
658 const Double_t x = xy[i].fX;
659 const Double_t y = xy[i].fY;
660
661 glBegin(GL_LINE_LOOP);
662 glVertex2d(x - im, y - im4);
663 glVertex2d(x - im2, y + im1);
664 glVertex2d(x - im3, y + im);
665 glVertex2d(x, y + im2);
666 glVertex2d(x + im3, y + im);
667 glVertex2d(x + im2, y + im1);
668 glVertex2d(x + im, y - im4);
669 glVertex2d(x + im4, y - im4);
670 glVertex2d(x, y - im);
671 glVertex2d(x - im4, y - im4);
672 glEnd();
673 }
674}
675
676////////////////////////////////////////////////////////////////////////////////
677
679{
680 const Int_t im = Int_t(4. * (GetMarkerSize() - TMath::Floor(GetMarkerWidth()/2.)/4.) + 0.5);
681
682 for (unsigned i = 0; i < n; ++i) {
683 const Double_t x = xy[i].fX;
684 const Double_t y = xy[i].fY;
685
686 glBegin(GL_LINE_LOOP);
687 glVertex2d(x - im, y - im);
688 glVertex2d(x + im, y - im);
689 glVertex2d(x + im, y + im);
690 glVertex2d(x - im, y + im);
691 glVertex2d(x - im, y - im);
692 glVertex2d(x + im, y + im);
693 glVertex2d(x - im, y + im);
694 glVertex2d(x + im, y - im);
695 glEnd();
696 }
697}
698
699////////////////////////////////////////////////////////////////////////////////
700
702{
703 const Int_t im = Int_t(4. * (GetMarkerSize() - TMath::Floor(GetMarkerWidth()/2.)/4.) + 0.5);
704
705 for (unsigned i = 0; i < n; ++i) {
706 const Double_t x = xy[i].fX;
707 const Double_t y = xy[i].fY;
708
709 glBegin(GL_LINE_LOOP);
710 glVertex2d(x - im, y );
711 glVertex2d(x , y - im);
712 glVertex2d(x + im, y );
713 glVertex2d(x , y + im);
714 glVertex2d(x - im, y );
715 glVertex2d(x + im, y );
716 glVertex2d(x , y + im);
717 glVertex2d(x , y - im);
718 glEnd();
719 }
720}
721
722////////////////////////////////////////////////////////////////////////////////
723
725{
727 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
728 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
729
730 for (unsigned i = 0; i < n; ++i) {
731 const Double_t x = xy[i].fX;
732 const Double_t y = xy[i].fY;
733
734 glBegin(GL_LINE_LOOP);
735 glVertex2d(x , y );
736 glVertex2d(x -im2, y + im);
737 glVertex2d(x - im, y );
738 glVertex2d(x , y );
739 glVertex2d(x -im2, y - im);
740 glVertex2d(x +im2, y - im);
741 glVertex2d(x , y );
742 glVertex2d(x + im, y );
743 glVertex2d(x +im2, y + im);
744 glVertex2d(x , y );
745 glEnd();
746 }
747}
748
749////////////////////////////////////////////////////////////////////////////////
750
752{
754 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
755 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
756
757 for (unsigned i = 0; i < n; ++i) {
758 const Double_t x = xy[i].fX;
759 const Double_t y = xy[i].fY;
760
761 glBegin(GL_LINE_LOOP);
762 glVertex2d(x-im, y );
763 glVertex2d(x-im, y-im2);
764 glVertex2d(x-im2, y-im);
765 glVertex2d(x+im2, y-im);
766 glVertex2d(x+im, y-im2);
767 glVertex2d(x+im, y+im2);
768 glVertex2d(x+im2, y+im);
769 glVertex2d(x-im2, y+im);
770 glVertex2d(x-im, y+im2);
771 glVertex2d(x-im, y );
772 glVertex2d(x+im, y );
773 glVertex2d(x , y );
774 glVertex2d(x , y-im);
775 glVertex2d(x , y+im);
776 glVertex2d(x , y);
777 glEnd();
778 }
779}
780
781////////////////////////////////////////////////////////////////////////////////
782
784{
785 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
786 const Int_t im2 = Int_t(2.00 * GetMarkerSize() + 0.5);
787
788 for (unsigned i = 0; i < n; ++i) {
789 const Double_t x = xy[i].fX;
790 const Double_t y = xy[i].fY;
791
793 glVertex2d(x , y );
794 glVertex2d(x -im2, y + im);
795 glVertex2d(x - im, y );
796 glVertex2d(x , y );
797 glVertex2d(x -im2, y - im);
798 glVertex2d(x +im2, y - im);
799 glVertex2d(x , y );
800 glVertex2d(x + im, y );
801 glVertex2d(x +im2, y + im);
802 glVertex2d(x , y );
803 glEnd();
804 }
805}
806
807////////////////////////////////////////////////////////////////////////////////
808
810{
812 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
813 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
814
815 for (unsigned i = 0; i < n; ++i) {
816 const Double_t x = xy[i].fX;
817 const Double_t y = xy[i].fY;
818
819 glBegin(GL_LINE_LOOP);
820 glVertex2d(x , y );
821 glVertex2d(x+im2, y+im);
822 glVertex2d(x+im , y+im2);
823 glVertex2d(x , y );
824 glVertex2d(x+im , y-im2);
825 glVertex2d(x+im2, y-im);
826 glVertex2d(x , y );
827 glVertex2d(x-im2, y-im);
828 glVertex2d(x-im , y-im2);
829 glVertex2d(x , y );
830 glVertex2d(x-im , y+im2);
831 glVertex2d(x-im2, y+im);
832 glVertex2d(x , y );
833 glEnd();
834 }
835}
836
837////////////////////////////////////////////////////////////////////////////////
838
840{
841 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
842 const Int_t im2 = Int_t(2.00 * GetMarkerSize() + 0.5);
843
844 for (unsigned i = 0; i < n; ++i) {
845 const Double_t x = xy[i].fX;
846 const Double_t y = xy[i].fY;
847
849 glVertex2d(x , y );
850 glVertex2d(x+im2, y+im);
851 glVertex2d(x+im , y+im2);
852 glVertex2d(x , y );
853 glVertex2d(x+im , y-im2);
854 glVertex2d(x+im2, y-im);
855 glVertex2d(x , y );
856 glVertex2d(x-im2, y-im);
857 glVertex2d(x-im , y-im2);
858 glVertex2d(x , y );
859 glVertex2d(x-im , y+im2);
860 glVertex2d(x-im2, y+im);
861 glVertex2d(x , y );
862 glEnd();
863 }
864}
865
866////////////////////////////////////////////////////////////////////////////////
867
869{
871 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
872 const Int_t im4 = Int_t(1.33 * MarkerSizeReduced + 0.5);
873
874 for (unsigned i = 0; i < n; ++i) {
875 const Double_t x = xy[i].fX;
876 const Double_t y = xy[i].fY;
877
878 glBegin(GL_LINE_LOOP);
879 glVertex2d(x , y+im );
880 glVertex2d(x-im4, y+im4);
881 glVertex2d(x-im , y );
882 glVertex2d(x-im4, y-im4);
883 glVertex2d(x , y-im );
884 glVertex2d(x+im4, y-im4);
885 glVertex2d(x+im , y );
886 glVertex2d(x+im4, y+im4);
887 glVertex2d(x , y+im );
888 glEnd();
889 }
890}
891
892////////////////////////////////////////////////////////////////////////////////
893
895{
896 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
897 const Int_t im4 = Int_t(1.33 * GetMarkerSize() + 0.5);
898
899 for (unsigned i = 0; i < n; ++i) {
900 const Double_t x = xy[i].fX;
901 const Double_t y = xy[i].fY;
902
904 glVertex2d(x, y+im );
905 glVertex2d(x-im4, y+im4);
906 glVertex2d(x, y);
907 glEnd();
909 glVertex2d(x-im4, y+im4);
910 glVertex2d(x-im, y);
911 glVertex2d(x, y );
912 glEnd();
914 glVertex2d(x-im, y);
915 glVertex2d(x-im4, y-im4);
916 glVertex2d(x, y );
917 glEnd();
919 glVertex2d(x-im4, y-im4);
920 glVertex2d(x, y-im);
921 glVertex2d(x, y );
922 glEnd();
924 glVertex2d(x, y-im);
925 glVertex2d(x+im4, y-im4);
926 glVertex2d(x, y );
927 glEnd();
929 glVertex2d(x+im4, y-im4);
930 glVertex2d(x+im, y);
931 glVertex2d(x, y );
932 glEnd();
934 glVertex2d(x+im, y);
935 glVertex2d(x+im4, y+im4);
936 glVertex2d(x, y );
937 glEnd();
939 glVertex2d(x+im4, y+im4);
940 glVertex2d(x, y+im);
941 glVertex2d(x, y );
942 glEnd();
943 }
944}
945
946////////////////////////////////////////////////////////////////////////////////
947
949{
951 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
952 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
953
954 for (unsigned i = 0; i < n; ++i) {
955 const Double_t x = xy[i].fX;
956 const Double_t y = xy[i].fY;
957
958 glBegin(GL_LINE_LOOP);
959 glVertex2d(x , y );
960 glVertex2d(x+im2, y+im);
961 glVertex2d(x-im2, y+im);
962 glVertex2d(x+im2, y-im);
963 glVertex2d(x-im2, y-im);
964 glVertex2d(x , y );
965 glVertex2d(x+im, y+im2);
966 glVertex2d(x+im, y-im2);
967 glVertex2d(x-im, y+im2);
968 glVertex2d(x-im, y-im2);
969 glVertex2d(x , y );
970 glEnd();
971 }
972}
973
974////////////////////////////////////////////////////////////////////////////////
975
977{
978 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
979 const Int_t im2 = Int_t(2.00 * GetMarkerSize() + 0.5);
980
981 for (unsigned i = 0; i < n; ++i) {
982 const Double_t x = xy[i].fX;
983 const Double_t y = xy[i].fY;
984
986 glVertex2d(x , y );
987 glVertex2d(x+im2, y+im);
988 glVertex2d(x-im2, y+im);
989 glVertex2d(x+im2, y-im);
990 glVertex2d(x-im2, y-im);
991 glVertex2d(x , y );
992 glVertex2d(x+im, y+im2);
993 glVertex2d(x+im, y-im2);
994 glVertex2d(x-im, y+im2);
995 glVertex2d(x-im, y-im2);
996 glVertex2d(x , y );
997 glEnd();
998 }
999}
1000
1001////////////////////////////////////////////////////////////////////////////////
1002
1004{
1006 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
1007 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
1008
1009 for (unsigned i = 0; i < n; ++i) {
1010 const Double_t x = xy[i].fX;
1011 const Double_t y = xy[i].fY;
1012
1013 glBegin(GL_LINE_LOOP);
1014 glVertex2d(x , y +im2);
1015 glVertex2d(x -im2, y + im);
1016 glVertex2d(x - im, y +im2);
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 +im2, y - im);
1022 glVertex2d(x + im, y -im2);
1023 glVertex2d(x +im2, y );
1024 glVertex2d(x + im, y +im2);
1025 glVertex2d(x +im2, y + im);
1026 glVertex2d(x , y +im2);
1027 glEnd();
1028 }
1029}
1030
1031////////////////////////////////////////////////////////////////////////////////
1032
1034{
1035 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
1036 const Int_t im2 = Int_t(2.00 * GetMarkerSize() + 0.5);
1037
1038 for (unsigned i = 0; i < n; ++i) {
1039 const Double_t x = xy[i].fX;
1040 const Double_t y = xy[i].fY;
1041
1043 glVertex2d(x , y +im2);
1044 glVertex2d(x -im2, y +im);
1045 glVertex2d(x -im , y +im2);
1046 glVertex2d(x -im2, y );
1047 glVertex2d(x , y );
1048 glEnd();
1050 glVertex2d(x -im2, y);
1051 glVertex2d(x -im, y -im2);
1052 glVertex2d(x -im2, y -im);
1053 glVertex2d(x , y-im2);
1054 glVertex2d(x , y );
1055 glEnd();
1057 glVertex2d(x , y -im2);
1058 glVertex2d(x +im2, y -im);
1059 glVertex2d(x +im , y -im2);
1060 glVertex2d(x +im2, y);
1061 glVertex2d(x , y );
1062 glEnd();
1064 glVertex2d(x +im2, y);
1065 glVertex2d(x +im , y +im2);
1066 glVertex2d(x +im2, y +im);
1067 glVertex2d(x , y +im2);
1068 glVertex2d(x , y );
1069 glEnd(); }
1070}
1071
1072////////////////////////////////////////////////////////////////////////////////
1073
1075{
1076 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
1077 const Int_t im2 = Int_t(2.00 * GetMarkerSize() + 0.5);
1078
1079 for (unsigned i = 0; i < n; ++i) {
1080 const Double_t x = xy[i].fX;
1081 const Double_t y = xy[i].fY;
1082
1084 glVertex2d(x, y+im2);
1085 glVertex2d(x-im2 , y+im);
1086 glVertex2d(x-im, y+im2);
1087 glVertex2d(x-im2 , y);
1088 glEnd();
1090 glVertex2d(x-im2, y);
1091 glVertex2d(x-im , y-im2);
1092 glVertex2d(x-im2, y-im);
1093 glVertex2d(x, y-im2);
1094 glEnd();
1096 glVertex2d(x, y-im2);
1097 glVertex2d(x+im2 , y-im);
1098 glVertex2d(x+im, y-im2);
1099 glVertex2d(x+im2, y);
1100 glEnd();
1102 glVertex2d(x+im2, y);
1103 glVertex2d(x+im , y+im2);
1104 glVertex2d(x+im2, y+im);
1105 glVertex2d(x, y+im2);
1106 glEnd();
1107 }
1108}
1109
1110////////////////////////////////////////////////////////////////////////////////
1111
1113{
1114 const Int_t im = Int_t(4 * GetMarkerSize() + 0.5);
1115 const Int_t im2 = Int_t(1.33 * GetMarkerSize() + 0.5);
1116
1117 for (unsigned i = 0; i < n; ++i) {
1118 const Double_t x = xy[i].fX;
1119 const Double_t y = xy[i].fY;
1120
1122 glVertex2d(x+im2, y+im2);
1123 glVertex2d(x+im2, y+im);
1124 glVertex2d(x-im2, y+im);
1125 glVertex2d(x-im2, y+im2);
1126 glEnd();
1128 glVertex2d(x-im2, y+im2);
1129 glVertex2d(x-im, y+im2);
1130 glVertex2d(x-im, y-im2);
1131 glVertex2d(x-im2, y-im2);
1132 glEnd();
1134 glVertex2d(x-im2, y-im2);
1135 glVertex2d(x-im2, y-im);
1136 glVertex2d(x+im2, y-im);
1137 glVertex2d(x+im2, y-im2);
1138 glEnd();
1140 glVertex2d(x+im2, y-im2);
1141 glVertex2d(x+im, y-im2);
1142 glVertex2d(x+im, y+im2);
1143 glVertex2d(x+im2, y+im2);
1144 glEnd();
1145 }
1146}
1147
1148/*
1149Small RAII class for GLU tesselator.
1150*/
1151#ifndef CALLBACK
1152#define CALLBACK
1153#endif
1154
1155extern "C" {
1156#if defined(__APPLE_CC__) && __APPLE_CC__ > 4000 && __APPLE_CC__ < 5450 && !defined(__INTEL_COMPILER)
1157 typedef GLvoid (*tess_t)(...);
1158#elif defined( __mips ) || defined( __linux__ ) || defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __sun ) || defined (__CYGWIN__) || defined (__APPLE__)
1159 typedef GLvoid (*tess_t)();
1160#elif defined ( WIN32)
1161 typedef GLvoid (CALLBACK *tess_t)( );
1162#else
1163 #error "Error - need to define type tess_t for this platform/compiler"
1164#endif
1165}
1166
1167////////////////////////////////////////////////////////////////////////////////
1168
1170{
1172 if (!dump)
1173 return;
1174
1175 dump->push_back(MeshPatch_t(type));
1176}
1177
1178////////////////////////////////////////////////////////////////////////////////
1179
1180void Vertex(const Double_t *v)
1181{
1183 if (!dump)
1184 return;
1185
1186 std::vector<Double_t> & vs = dump->back().fPatch;
1187 vs.push_back(v[0]);
1188 vs.push_back(v[1]);
1189 vs.push_back(v[2]);
1190}
1191
1192////////////////////////////////////////////////////////////////////////////////
1193
1194void End()
1195{
1196}
1197
1199
1200////////////////////////////////////////////////////////////////////////////////
1201
1203 : fTess(nullptr)
1204{
1206 if (!tess)
1207 throw std::runtime_error("tesselator creation failed");
1208
1209#if defined(__GNUC__) && __GNUC__ >= 8
1210#pragma GCC diagnostic push
1211#pragma GCC diagnostic ignored "-Wcast-function-type"
1212#endif
1213
1214 if (!dump) {
1218 } else {
1222 }
1223
1224#if defined(__GNUC__) && __GNUC__ >= 8
1225#pragma GCC diagnostic pop
1226#endif
1227
1229 fTess = tess;
1230}
1231
1232////////////////////////////////////////////////////////////////////////////////
1233
1238
1239/*
1240In future, this should be an interface to per-pad FBO.
1241Currently, in only save sizes and coordinates (?)
1242*/
1243////////////////////////////////////////////////////////////////////////////////
1244
1246 : fW(w), fH(h), fX(x), fY(y), fTop(top)
1247{
1248}
1249
1250////////////////////////////////////////////////////////////////////////////////
1251
1253 : fMaxLineWidth(0.),
1254 fMaxPointSize(0.)
1255{
1256}
1257
1258////////////////////////////////////////////////////////////////////////////////
1259
1261{
1262 if (!fMaxLineWidth) {
1263 Double_t lp[2] = {};
1264 glGetDoublev(lineWidthPNAME, lp);//lineWidthPNAME is defined at the top of this file.
1265 fMaxLineWidth = lp[1];
1266 }
1267
1268 return fMaxLineWidth;
1269}
1270
1271////////////////////////////////////////////////////////////////////////////////
1272
1274{
1275 if (!fMaxPointSize) {
1276 Double_t lp[2] = {};
1277 glGetDoublev(pointSizePNAME, lp);//pointSizePNAME is defined at the top of this file.
1278 fMaxPointSize = lp[1];
1279 }
1280
1281 return fMaxLineWidth;
1282}
1283
1284
1285////////////////////////////////////////////////////////////////////////////////
1286
1288{
1289 const TColor *color = gROOT->GetColor(colorIndex);
1290 if (color) {
1291 color->GetRGB(rgba[0], rgba[1], rgba[2]);
1292 rgba[3] = color->GetAlpha();
1293 }
1294}
1295
1296////////////////////////////////////////////////////////////////////////////////
1297
1298template<class ValueType>
1299BoundingRect<ValueType> FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys)
1300{
1301 assert(nPoints > 0 && "FindBoundingRect, invalind number of points");
1302 assert(xs != nullptr && "FindBoundingRect, parameter 'xs' is null");
1303 assert(ys != nullptr && "FindBoundingRect, parameter 'ys' is null");
1304
1305 ValueType xMin = xs[0], xMax = xMin;
1306 ValueType yMin = ys[0], yMax = yMin;
1307
1308 for (Int_t i = 1; i < nPoints; ++i) {
1309 xMin = TMath::Min(xMin, xs[i]);
1310 xMax = TMath::Max(xMax, xs[i]);
1311
1312 yMin = TMath::Min(yMin, ys[i]);
1313 yMax = TMath::Max(yMax, ys[i]);
1314 }
1315
1317 box.fXMin = xMin;
1318 box.fXMax = xMax;
1319 box.fWidth = xMax - xMin;
1320
1321 box.fYMin = yMin;
1322 box.fYMax = yMax;
1323 box.fHeight = yMax - yMin;
1324
1325 return box;
1326}
1327
1333
1334
1335
1336namespace {
1337
1338////////////////////////////////////////////////////////////////////////////////
1339
1340void CalculateCircle(std::vector<TPoint> &circle, Double_t r, UInt_t pts)
1341{
1342 const Double_t delta = TMath::TwoPi() / pts;
1343 const UInt_t first = circle.size();
1344 Double_t angle = 0.;
1345 circle.resize(circle.size() + pts + 1);
1346
1347 for (UInt_t i = 0; i < pts; ++i, angle += delta) {
1348 circle[first + i].fX = SCoord_t(r * TMath::Cos(angle));
1349 circle[first + i].fY = SCoord_t(r * TMath::Sin(angle));
1350 }
1351
1352 circle.back().fX = circle[first].fX;
1353 circle.back().fY = circle[first].fY;
1354}
1355
1356}//anonymous namespace
1357
1358}//namespace Pad
1359}//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
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
short Style_t
Style number (short)
Definition RtypesCore.h:96
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Color_t
Color number (short)
Definition RtypesCore.h:99
float Size_t
Attribute size (float)
Definition RtypesCore.h:103
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
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
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 width
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:426
#define gVirtualX
Definition TVirtualX.h:368
FillAttribSet(const PolygonStippleSet &set, Bool_t ignoreStipple, const TAttFill *att=nullptr)
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, const TAttLine *att=nullptr)
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
Width_t GetMarkerWidth() const
Get marker width If not set before - use gVirtualX value.
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 SetMarkerSizeWidth(Size_t size, Width_t width)
Set marker size and line width.
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
Size_t GetMarkerSize() const
Get marker size If not set before - use gVirtualX value.
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:43
static UInt_t SwapBits(UInt_t bits)
static const UInt_t fgBitSwap[]
Definition TGLPadUtils.h:45
Tesselator(Bool_t dump=kFALSE)
static Tesselation_t * GetDump()
static Tesselation_t * fVs
Fill Area Attributes class.
Definition TAttFill.h:21
Line Attributes class.
Definition TAttLine.h:21
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