Logo ROOT  
Reference Guide
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 "Riostream.h"
13#include <stdexcept>
14#include <cassert>
15
16#include "TVirtualPad.h"
17#include "TVirtualX.h"
18#include "RStipples.h"
19#include "TColor.h"
20#include "TROOT.h"
21#include "TMath.h"
22
23#include "TGLPadUtils.h"
24#include "TGLIncludes.h"
25
26namespace Rgl {
27namespace Pad {
28
29const UInt_t PolygonStippleSet::fgBitSwap[] = {0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15};
30
31
32/*
33Temporary fix.
34*/
35#ifndef GL_VERSION_1_2
38#else
39const GLenum lineWidthPNAME = GLenum(GL_SMOOTH_LINE_WIDTH_RANGE);//Cast for real enums and macros.
40const GLenum pointSizePNAME = GLenum(GL_SMOOTH_POINT_SIZE_RANGE);
41#endif
42
43/*
44Auxiliary class to converts ROOT's polygon stipples from
45RStipples.h into GL's stipples and hold them in a fStipples array.
46*/
47
48////////////////////////////////////////////////////////////////////////////////
49
51{
52 /*
53 I have to assume, that gStipple has two chars in a line.
54 There in no way to calculate line length and there are no corresponding constants in RStipple.h.
55 So, these numbers are hardcode here.
56 Ordering in RStipples completely different from OpenGL.
57 In OpenGL, if I have, say, 16x2 pattern, GLbytes will be:
58
59 [3][4]
60 [1][2]
61
62 and bits inside them
63
64 [7 6 5 4 3 2 1 0][7 6 5 4 3 2 1 0]
65 [7 6 5 4 3 2 1 0][7 6 5 4 3 2 1 0].
66
67 But for X11 this will be:
68
69 [2][1]
70 [4][3]
71
72 [0 1 2 3 4 5 6 7][0 1 2 3 4 5 6 7]
73 [0 1 2 3 4 5 6 7][0 1 2 3 4 5 6 7]
74
75 So, line 0x7, 0xE from X11 must be
76 converted into 0x70, 0xE0 for OpenGL.
77
78 As OpenGL expects 32x32 pattern, I have to twice each line.
79 */
80
81 /*If somebody will seriously change gStipples declaration,
82 so, that sizeof gStipples becomes "wrong", change this!*/
83 const UInt_t numOfStipples = sizeof gStipples / sizeof gStipples[0];
84 fStipples.resize(kStippleSize * numOfStipples);
85
86 for (UInt_t i = 0; i < numOfStipples; ++i) {
87 const UInt_t baseInd = i * kStippleSize;
88
89 for (Int_t j = 15, j1 = 0; j >= 0; --j, ++j1) {//ROOT uses 16x16 stipples.
90 const UInt_t rowShift = j1 * kRowSize;
91
92 for (Int_t k = 1, k1 = 0; k >= 0; --k, ++k1) {//Two chars form a line.
93 const UChar_t pixel = SwapBits(gStipples[i][j * 2 + k]);
94 const UInt_t ind = baseInd + rowShift + k1;
95
96 fStipples[ind] = pixel;
97 fStipples[ind + 2] = pixel;
98 fStipples[ind + 64] = pixel;
99 fStipples[ind + 66] = pixel;
100 }
101 }
102 }
103}
104
105////////////////////////////////////////////////////////////////////////////////
106
108{
109#ifdef WIN32
110 b = ~b & 0xff;
111#endif
112 b &= k16Bits;
113
114 const UInt_t low = fgBitSwap[b & kLow4] << 4;
115 const UInt_t up = fgBitSwap[(b & kUp4) >> 4];
116
117 return low | up;
118}
119
120/*
121Class to manipulate fill parameters.
122*/
123////////////////////////////////////////////////////////////////////////////////
124///Polygon stipple, if required.
125
127 : fStipple(0), fAlpha(1.)
128{
129 const UInt_t style = gVirtualX->GetFillStyle() / 1000;
130
131 if (!ignoreStipple) {
132 if (style == 3) {
133 const UInt_t fasi = gVirtualX->GetFillStyle() % 1000;
134 fStipple = (fasi >= 1 && fasi <=25) ? fasi : 2;
135 glPolygonStipple(&set.fStipples[fStipple * PolygonStippleSet::kStippleSize]);
136 glEnable(GL_POLYGON_STIPPLE);
137 }
138 }
139
140 // Color and transparency
141 Float_t rgba[] = {0.f, 0.f, 0.f, 1.f};
142 ExtractRGBA(gVirtualX->GetFillColor(), rgba);
143 fAlpha = rgba[3];
144 if (fAlpha<1.) {
145 glEnable(GL_BLEND);
146 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
147 }
148 glColor4fv(rgba);
149}
150
151////////////////////////////////////////////////////////////////////////////////
152
154{
155 if (fStipple)
156 glDisable(GL_POLYGON_STIPPLE);
157
158 if (fAlpha<1.)
159 glDisable(GL_BLEND);
160}
161
162/*
163"ROOT like" line stipples.
164*/
165
166const UShort_t gLineStipples[] = {0xffff, 0xffff, 0x3333, 0x5555,
167 0xf040, 0xf4f4, 0xf111, 0xf0f0,
168 0xff11, 0x3fff, 0x08ff};
169
171
172/*
173Set/unset line attributes.
174*/
175////////////////////////////////////////////////////////////////////////////////
176///Set up line parameters.
177///Smooth.
178
179LineAttribSet::LineAttribSet(Bool_t smooth, UInt_t stipple, Double_t maxWidth, Bool_t setWidth)
180 : fSmooth(smooth), fStipple(stipple), fSetWidth(setWidth), fAlpha(0.8)
181{
182 if (fSmooth) {
183 glEnable(GL_BLEND);
184 glEnable(GL_LINE_SMOOTH);
185 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
186 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
187 }
188
189 //Stipple.
190 if (fStipple > 1) {
191 if (fStipple >= gMaxStipple)
192 fStipple = 1;
193 else {
194 glEnable(GL_LINE_STIPPLE);
195 glLineStipple(fStipple == 10 ? 2 : 1, gLineStipples[fStipple]);
196 }
197 }
198
199 //Color and transparency
200 Float_t rgba[] = {0.f, 0.f, 0.f, 0.8f};
201 ExtractRGBA(gVirtualX->GetLineColor(), rgba);
202 fAlpha = rgba[3];
203 if (fAlpha<0.8) {
204 glEnable(GL_BLEND);
205 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
206 }
207 glColor4fv(rgba);
208
209 //Width.
210 if (fSetWidth) {
211 const Width_t w = gVirtualX->GetLineWidth();
212 glLineWidth(w > maxWidth ? maxWidth : !w ? 1.f : w);
213 }
214}
215
216////////////////////////////////////////////////////////////////////////////////
217
219{
220 if (fSmooth || fAlpha<0.8) {
221 glDisable(GL_LINE_SMOOTH);
222 glDisable(GL_BLEND);
223 }
224
225 if (fStipple > 1)
226 glDisable(GL_LINE_STIPPLE);
227
228 if (fSetWidth)
229 glLineWidth(1.f);
230}
231
232/*
233Auxiliary class to draw markers in a gl-pad.
234*/
235
236////////////////////////////////////////////////////////////////////////////////
237/// Simple 1-pixel dots.
238
240{
241 glBegin(GL_POINTS);
242
243 for (UInt_t i = 0; i < n; ++i)
244 glVertex2d(xy[i].fX, xy[i].fY);
245
246 glEnd();
247}
248
249////////////////////////////////////////////////////////////////////////////////
250/// + sign. 1 pixel width lines.
251
253{
254 const Double_t im = 4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5;
255 glBegin(GL_LINES);
256
257 for (UInt_t i = 0; i < n; ++i) {
258 const Double_t x = xy[i].fX;
259 const Double_t y = xy[i].fY;
260 glVertex2d(-im + x, y);
261 glVertex2d(im + x, y);
262 glVertex2d(x, -im + y);
263 glVertex2d(x, im + y);
264 }
265
266 glEnd();
267}
268
269////////////////////////////////////////////////////////////////////////////////
270/// * marker.
271
273{
274 SCoord_t im = SCoord_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
275 fStar[0].fX = -im; fStar[0].fY = 0;
276 fStar[1].fX = im; fStar[1].fY = 0;
277 fStar[2].fX = 0 ; fStar[2].fY = -im;
278 fStar[3].fX = 0 ; fStar[3].fY = im;
279 im = SCoord_t(0.707*Float_t(im) + 0.5);
280 fStar[4].fX = -im; fStar[4].fY = -im;
281 fStar[5].fX = im; fStar[5].fY = im;
282 fStar[6].fX = -im; fStar[6].fY = im;
283 fStar[7].fX = im; fStar[7].fY = -im;
284
285 glBegin(GL_LINES);
286
287 for (UInt_t i = 0; i < n; ++i) {
288 const Double_t x = xy[i].fX;
289 const Double_t y = xy[i].fY;
290
291 glVertex2d(fStar[0].fX + x, fStar[0].fY + y);
292 glVertex2d(fStar[1].fX + x, fStar[1].fY + y);
293 glVertex2d(fStar[2].fX + x, fStar[2].fY + y);
294 glVertex2d(fStar[3].fX + x, fStar[3].fY + y);
295 glVertex2d(fStar[4].fX + x, fStar[4].fY + y);
296 glVertex2d(fStar[5].fX + x, fStar[5].fY + y);
297 glVertex2d(fStar[6].fX + x, fStar[6].fY + y);
298 glVertex2d(fStar[7].fX + x, fStar[7].fY + y);
299 }
300
301 glEnd();
302}
303
304////////////////////////////////////////////////////////////////////////////////
305
307{
308 const Double_t im = 0.707 * (4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5) + 0.5;
309
310 glBegin(GL_LINES);
311
312 for (UInt_t i = 0; i < n; ++i) {
313 const Double_t x = xy[i].fX;
314 const Double_t y = xy[i].fY;
315
316 glVertex2d(-im + x, -im + y);
317 glVertex2d(im + x, im + y);
318 glVertex2d(-im + x, im + y);
319 glVertex2d(im + x, -im + y);
320 }
321
322 glEnd();
323}
324
325////////////////////////////////////////////////////////////////////////////////
326
328{
329 glBegin(GL_LINES);
330
331 for (UInt_t i = 0; i < n; ++i) {
332 const Double_t x = xy[i].fX;
333 const Double_t y = xy[i].fY;
334
335 glVertex2d(-1. + x, y);
336 glVertex2d(x + 1., y);
337 glVertex2d(x, -1. + y);
338 glVertex2d(x, 1. + y);
339 }
340
341 glEnd();
342}
343
344////////////////////////////////////////////////////////////////////////////////
345
347{
348 for (UInt_t i = 0; i < n; ++i)
349 glRectd(xy[i].fX - 1, xy[i].fY - 1, xy[i].fX + 1, xy[i].fY + 1);
350}
351
352namespace {
353//Auxilary function for MarkerPainter. Define near the end of this source file.
354void CalculateCircle(std::vector<TPoint> &circle, Double_t r, UInt_t pts);
355}
356
357////////////////////////////////////////////////////////////////////////////////
358
360{
361 Double_t r = 4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5;
362 if (r > 100.)
363 r = 100.;//as in TGX11.
364
365 fCircle.clear();
366 CalculateCircle(fCircle, r, r < 100. ? kSmallCirclePts : kLargeCirclePts);
367
368 for (UInt_t i = 0; i < n; ++i) {
369 const Double_t x = xy[i].fX;
370 const Double_t y = xy[i].fY;
371
372 glBegin(GL_LINE_LOOP);
373 for (UInt_t j = 0, e = fCircle.size(); j < e; ++j)
374 glVertex2d(fCircle[j].fX + x, fCircle[j].fY + y);
375 glEnd();
376 }
377}
378
379////////////////////////////////////////////////////////////////////////////////
380
382{
383 fCircle.clear();
384 fCircle.push_back(TPoint(0, 0));
385
386 Double_t r = 4 * gVirtualX->GetMarkerSize() + 0.5;
387 if (r > 100.)
388 r = 100;//as in TGX11.
389
390 CalculateCircle(fCircle, r, r < 100 ? kSmallCirclePts : kLargeCirclePts);
391
392 for (UInt_t i = 0; i < n; ++i) {
393 const Double_t x = xy[i].fX;
394 const Double_t y = xy[i].fY;
395
396 glBegin(GL_TRIANGLE_FAN);
397 for (UInt_t j = 0, e = fCircle.size(); j < e; ++j)
398 glVertex2d(fCircle[j].fX + x, fCircle[j].fY + y);
399 glEnd();
400 }
401}
402
403////////////////////////////////////////////////////////////////////////////////
404
406{
407 const Double_t im = 4 * gVirtualX->GetMarkerSize() + 0.5;
408 for (UInt_t i = 0; i < n; ++i)
409 glRectd(xy[i].fX - im, xy[i].fY - im, xy[i].fX + im, xy[i].fY + im);
410}
411
412////////////////////////////////////////////////////////////////////////////////
413
415{
416 const Double_t im = 4 * gVirtualX->GetMarkerSize() + 0.5;
417 for (UInt_t i = 0; i < n; ++i) {
418 const Double_t x = xy[i].fX;
419 const Double_t y = xy[i].fY;
420 glBegin(GL_POLYGON);
421 glVertex2d(x - im, y - im);
422 glVertex2d(x + im, y - im);
423 glVertex2d(x, im + y);
424 glEnd();
425 }
426}
427
428////////////////////////////////////////////////////////////////////////////////
429
431{
432 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
433
434 for (UInt_t i = 0; i < n; ++i) {
435 const Double_t x = xy[i].fX;
436 const Double_t y = xy[i].fY;
437 glBegin(GL_POLYGON);
438 glVertex2d(x - im, y + im);
439 glVertex2d(x, y - im);
440 glVertex2d(im + x, y + im);
441 glEnd();
442 }
443}
444
445////////////////////////////////////////////////////////////////////////////////
446
448{
449 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
450 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
451 const Int_t imx = Int_t(2.66 * MarkerSizeReduced + 0.5);
452
453 for (UInt_t i = 0; i < n; ++i) {
454 const Double_t x = xy[i].fX;
455 const Double_t y = xy[i].fY;
456
457 glBegin(GL_LINE_LOOP);
458 glVertex2d(x - imx, y);
459 glVertex2d(x, y - im);
460 glVertex2d(x + imx, y);
461 glVertex2d(x, y + im);
462 glEnd();
463 }
464}
465
466////////////////////////////////////////////////////////////////////////////////
467
469{
470 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
471 const Int_t imx = Int_t(2.66 * gVirtualX->GetMarkerSize() + 0.5);
472
473 for (UInt_t i = 0; i < n; ++i) {
474 const Double_t x = xy[i].fX;
475 const Double_t y = xy[i].fY;
476
477 glBegin(GL_POLYGON);
478 glVertex2d(x - imx, y);
479 glVertex2d(x, y - im);
480 glVertex2d(x + imx, y);
481 glVertex2d(x, y + im);
482 glEnd();
483 }
484}
485
486////////////////////////////////////////////////////////////////////////////////
487
489{
490 const Int_t im = Int_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
491
492 for (UInt_t i = 0; i < n; ++i) {
493 const Double_t x = xy[i].fX;
494 const Double_t y = xy[i].fY;
495 glBegin(GL_LINE_LOOP);
496 glVertex2d(x - im, y + im);
497 glVertex2d(x, y - im);
498 glVertex2d(im + x, y + im);
499 glEnd();
500 }
501}
502
503////////////////////////////////////////////////////////////////////////////////
504
506{
507 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
508 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
509 const Int_t imx = Int_t(1.33 * MarkerSizeReduced + 0.5);
510
511 for (UInt_t i = 0; i < n; ++i) {
512 const Double_t x = xy[i].fX;
513 const Double_t y = xy[i].fY;
514
515 glBegin(GL_LINE_LOOP);
516 glVertex2d(x - im, y - imx);
517 glVertex2d(x - imx, y - imx);
518 glVertex2d(x - imx, y - im);
519 glVertex2d(x + imx, y - im);
520 glVertex2d(x + imx, y - imx);
521 glVertex2d(x + im, y - imx);
522 glVertex2d(x + im, y + imx);
523 glVertex2d(x + imx, y + imx);
524 glVertex2d(x + imx, y + im);
525 glVertex2d(x - imx, y + im);
526 glVertex2d(x - imx, y + imx);
527 glVertex2d(x - im, y + imx);
528 glEnd();
529 }
530}
531
532////////////////////////////////////////////////////////////////////////////////
533
535{
536 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
537 const Int_t imx = Int_t(1.33 * gVirtualX->GetMarkerSize() + 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_POLYGON);
544 glVertex2d(x - im, y - imx);
545 glVertex2d(x - im, y + imx);
546 glVertex2d(x + im, y + imx);
547 glVertex2d(x + im, y - imx);
548 glEnd();
549 glBegin(GL_POLYGON);
550 glVertex2d(x - imx, y + imx);
551 glVertex2d(x - imx, y + im);
552 glVertex2d(x + imx, y + im);
553 glVertex2d(x + imx, y + imx);
554 glEnd();
555 glEnd();
556 glBegin(GL_POLYGON);
557 glVertex2d(x - imx, y - imx);
558 glVertex2d(x - imx, y - im);
559 glVertex2d(x + imx, y - im);
560 glVertex2d(x + imx, y - imx);
561 glEnd();
562 }
563}
564
565////////////////////////////////////////////////////////////////////////////////
566/// Full star pentagone
567
569{
570 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
571 const Int_t im1 = Int_t(0.66 * gVirtualX->GetMarkerSize() + 0.5);
572 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
573 const Int_t im3 = Int_t(2.66 * gVirtualX->GetMarkerSize() + 0.5);
574 const Int_t im4 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
575
576 for (UInt_t i = 0; i < n; ++i) {
577 const Double_t x = xy[i].fX;
578 const Double_t y = xy[i].fY;
579
580 glBegin(GL_TRIANGLES);
581 glVertex2d(x - im, y - im4);//0
582 glVertex2d(x - im2, y + im1);//1
583 glVertex2d(x - im4, y - im4);//9
584
585 glVertex2d(x - im2, y + im1);//1
586 glVertex2d(x - im3, y + im);//2
587 glVertex2d(x, y + im2);//3
588
589 glVertex2d(x, y + im2);//3
590 glVertex2d(x + im3, y + im);//4
591 glVertex2d(x + im2, y + im1);//5
592
593 glVertex2d(x + im2, y + im1);//5
594 glVertex2d(x + im, y - im4);//6
595 glVertex2d(x + im4, y - im4);//7
596
597 glVertex2d(x + im4, y - im4);//7
598 glVertex2d(x, y - im);//8
599 glVertex2d(x - im4, y - im4);//9
600
601 glVertex2d(x - im4, y - im4);//9
602 glVertex2d(x - im2, y + im1);//1
603 glVertex2d(x, y + im2);//3
604
605 glVertex2d(x - im4, y - im4);//9
606 glVertex2d(x, y + im2);//3
607 glVertex2d(x + im2, y + im1);//5
608
609 glVertex2d(x - im4, y - im4);//9
610 glVertex2d(x + im2, y + im1);//5
611 glVertex2d(x + im4, y - im4);//7
612
613 glEnd();
614
615 }
616}
617
618////////////////////////////////////////////////////////////////////////////////
619/// Full star pentagone
620
622{
623 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
624 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
625 const Int_t im1 = Int_t(0.66 * MarkerSizeReduced + 0.5);
626 const Int_t im2 = Int_t(2.00 * MarkerSizeReduced + 0.5);
627 const Int_t im3 = Int_t(2.66 * MarkerSizeReduced + 0.5);
628 const Int_t im4 = Int_t(1.33 * MarkerSizeReduced + 0.5);
629
630 for (UInt_t i = 0; i < n; ++i) {
631 const Double_t x = xy[i].fX;
632 const Double_t y = xy[i].fY;
633
634 glBegin(GL_LINE_LOOP);
635 glVertex2d(x - im, y - im4);
636 glVertex2d(x - im2, y + im1);
637 glVertex2d(x - im3, y + im);
638 glVertex2d(x, y + im2);
639 glVertex2d(x + im3, y + im);
640 glVertex2d(x + im2, y + im1);
641 glVertex2d(x + im, y - im4);
642 glVertex2d(x + im4, y - im4);
643 glVertex2d(x, y - im);
644 glVertex2d(x - im4, y - im4);
645 glEnd();
646 }
647}
648
649////////////////////////////////////////////////////////////////////////////////
650
652{
653 const Int_t im = Int_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
654
655 for (unsigned i = 0; i < n; ++i) {
656 const Double_t x = xy[i].fX;
657 const Double_t y = xy[i].fY;
658
659 glBegin(GL_LINE_LOOP);
660 glVertex2d(x - im, y - im);
661 glVertex2d(x + im, y - im);
662 glVertex2d(x + im, y + im);
663 glVertex2d(x - im, y + im);
664 glVertex2d(x - im, y - im);
665 glVertex2d(x + im, y + im);
666 glVertex2d(x - im, y + im);
667 glVertex2d(x + im, y - im);
668 glEnd();
669 }
670}
671
672////////////////////////////////////////////////////////////////////////////////
673
675{
676 const Int_t im = Int_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
677
678 for (unsigned i = 0; i < n; ++i) {
679 const Double_t x = xy[i].fX;
680 const Double_t y = xy[i].fY;
681
682 glBegin(GL_LINE_LOOP);
683 glVertex2d(x - im, y );
684 glVertex2d(x , y - im);
685 glVertex2d(x + im, y );
686 glVertex2d(x , y + im);
687 glVertex2d(x - im, y );
688 glVertex2d(x + im, y );
689 glVertex2d(x , y + im);
690 glVertex2d(x , y - im);
691 glEnd();
692 }
693}
694
695////////////////////////////////////////////////////////////////////////////////
696
698{
699 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
700 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
701 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
702
703 for (unsigned i = 0; i < n; ++i) {
704 const Double_t x = xy[i].fX;
705 const Double_t y = xy[i].fY;
706
707 glBegin(GL_LINE_LOOP);
708 glVertex2d(x , y );
709 glVertex2d(x -im2, y + im);
710 glVertex2d(x - im, y );
711 glVertex2d(x , y );
712 glVertex2d(x -im2, y - im);
713 glVertex2d(x +im2, y - im);
714 glVertex2d(x , y );
715 glVertex2d(x + im, y );
716 glVertex2d(x +im2, y + im);
717 glVertex2d(x , y );
718 glEnd();
719 }
720}
721
722////////////////////////////////////////////////////////////////////////////////
723
725{
726 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
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-im, y );
736 glVertex2d(x-im, y-im2);
737 glVertex2d(x-im2, y-im);
738 glVertex2d(x+im2, y-im);
739 glVertex2d(x+im, y-im2);
740 glVertex2d(x+im, y+im2);
741 glVertex2d(x+im2, y+im);
742 glVertex2d(x-im2, y+im);
743 glVertex2d(x-im, y+im2);
744 glVertex2d(x-im, y );
745 glVertex2d(x+im, y );
746 glVertex2d(x , y );
747 glVertex2d(x , y-im);
748 glVertex2d(x , y+im);
749 glVertex2d(x , y);
750 glEnd();
751 }
752}
753
754////////////////////////////////////////////////////////////////////////////////
755
757{
758 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
759 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
760
761 for (unsigned i = 0; i < n; ++i) {
762 const Double_t x = xy[i].fX;
763 const Double_t y = xy[i].fY;
764
765 glBegin(GL_POLYGON);
766 glVertex2d(x , y );
767 glVertex2d(x -im2, y + im);
768 glVertex2d(x - im, y );
769 glVertex2d(x , y );
770 glVertex2d(x -im2, y - im);
771 glVertex2d(x +im2, y - im);
772 glVertex2d(x , y );
773 glVertex2d(x + im, y );
774 glVertex2d(x +im2, y + im);
775 glVertex2d(x , y );
776 glEnd();
777 }
778}
779
780////////////////////////////////////////////////////////////////////////////////
781
783{
784 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
785 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
786 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 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
792 glBegin(GL_LINE_LOOP);
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 glVertex2d(x-im2, y-im);
801 glVertex2d(x-im , y-im2);
802 glVertex2d(x , y );
803 glVertex2d(x-im , y+im2);
804 glVertex2d(x-im2, y+im);
805 glVertex2d(x , y );
806 glEnd();
807 }
808}
809
810////////////////////////////////////////////////////////////////////////////////
811
813{
814 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
815 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
816
817 for (unsigned i = 0; i < n; ++i) {
818 const Double_t x = xy[i].fX;
819 const Double_t y = xy[i].fY;
820
821 glBegin(GL_POLYGON);
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 glVertex2d(x-im2, y-im);
830 glVertex2d(x-im , y-im2);
831 glVertex2d(x , y );
832 glVertex2d(x-im , y+im2);
833 glVertex2d(x-im2, y+im);
834 glVertex2d(x , y );
835 glEnd();
836 }
837}
838
839////////////////////////////////////////////////////////////////////////////////
840
842{
843 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
844 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
845 const Int_t im4 = Int_t(1.33 * MarkerSizeReduced + 0.5);
846
847 for (unsigned i = 0; i < n; ++i) {
848 const Double_t x = xy[i].fX;
849 const Double_t y = xy[i].fY;
850
851 glBegin(GL_LINE_LOOP);
852 glVertex2d(x , y+im );
853 glVertex2d(x-im4, y+im4);
854 glVertex2d(x-im , y );
855 glVertex2d(x-im4, y-im4);
856 glVertex2d(x , y-im );
857 glVertex2d(x+im4, y-im4);
858 glVertex2d(x+im , y );
859 glVertex2d(x+im4, y+im4);
860 glVertex2d(x , y+im );
861 glEnd();
862 }
863}
864
865////////////////////////////////////////////////////////////////////////////////
866
868{
869 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
870 const Int_t im4 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
871
872 for (unsigned i = 0; i < n; ++i) {
873 const Double_t x = xy[i].fX;
874 const Double_t y = xy[i].fY;
875
876 glBegin(GL_POLYGON);
877 glVertex2d(x, y+im );
878 glVertex2d(x-im4, y+im4);
879 glVertex2d(x, y);
880 glEnd();
881 glBegin(GL_POLYGON);
882 glVertex2d(x-im4, y+im4);
883 glVertex2d(x-im, y);
884 glVertex2d(x, y );
885 glEnd();
886 glBegin(GL_POLYGON);
887 glVertex2d(x-im, y);
888 glVertex2d(x-im4, y-im4);
889 glVertex2d(x, y );
890 glEnd();
891 glBegin(GL_POLYGON);
892 glVertex2d(x-im4, y-im4);
893 glVertex2d(x, y-im);
894 glVertex2d(x, y );
895 glEnd();
896 glBegin(GL_POLYGON);
897 glVertex2d(x, y-im);
898 glVertex2d(x+im4, y-im4);
899 glVertex2d(x, y );
900 glEnd();
901 glBegin(GL_POLYGON);
902 glVertex2d(x+im4, y-im4);
903 glVertex2d(x+im, y);
904 glVertex2d(x, y );
905 glEnd();
906 glBegin(GL_POLYGON);
907 glVertex2d(x+im, y);
908 glVertex2d(x+im4, y+im4);
909 glVertex2d(x, y );
910 glEnd();
911 glBegin(GL_POLYGON);
912 glVertex2d(x+im4, y+im4);
913 glVertex2d(x, y+im);
914 glVertex2d(x, y );
915 glEnd();
916 }
917}
918
919////////////////////////////////////////////////////////////////////////////////
920
922{
923 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
924 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
925 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
926
927 for (unsigned i = 0; i < n; ++i) {
928 const Double_t x = xy[i].fX;
929 const Double_t y = xy[i].fY;
930
931 glBegin(GL_LINE_LOOP);
932 glVertex2d(x , y );
933 glVertex2d(x+im2, y+im);
934 glVertex2d(x-im2, y+im);
935 glVertex2d(x+im2, y-im);
936 glVertex2d(x-im2, y-im);
937 glVertex2d(x , y );
938 glVertex2d(x+im, y+im2);
939 glVertex2d(x+im, y-im2);
940 glVertex2d(x-im, y+im2);
941 glVertex2d(x-im, y-im2);
942 glVertex2d(x , y );
943 glEnd();
944 }
945}
946
947////////////////////////////////////////////////////////////////////////////////
948
950{
951 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
952 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 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_POLYGON);
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 Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
979 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
980 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
981
982 for (unsigned i = 0; i < n; ++i) {
983 const Double_t x = xy[i].fX;
984 const Double_t y = xy[i].fY;
985
986 glBegin(GL_LINE_LOOP);
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 glVertex2d(x +im2, y - im);
995 glVertex2d(x + im, y -im2);
996 glVertex2d(x +im2, y );
997 glVertex2d(x + im, y +im2);
998 glVertex2d(x +im2, y + im);
999 glVertex2d(x , y +im2);
1000 glEnd();
1001 }
1002}
1003
1004////////////////////////////////////////////////////////////////////////////////
1005
1007{
1008 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1009 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
1010
1011 for (unsigned i = 0; i < n; ++i) {
1012 const Double_t x = xy[i].fX;
1013 const Double_t y = xy[i].fY;
1014
1015 glBegin(GL_POLYGON);
1016 glVertex2d(x , y +im2);
1017 glVertex2d(x -im2, y +im);
1018 glVertex2d(x -im , y +im2);
1019 glVertex2d(x -im2, y );
1020 glVertex2d(x , y );
1021 glEnd();
1022 glBegin(GL_POLYGON);
1023 glVertex2d(x -im2, y);
1024 glVertex2d(x -im, y -im2);
1025 glVertex2d(x -im2, y -im);
1026 glVertex2d(x , y-im2);
1027 glVertex2d(x , y );
1028 glEnd();
1029 glBegin(GL_POLYGON);
1030 glVertex2d(x , y -im2);
1031 glVertex2d(x +im2, y -im);
1032 glVertex2d(x +im , y -im2);
1033 glVertex2d(x +im2, y);
1034 glVertex2d(x , y );
1035 glEnd();
1036 glBegin(GL_POLYGON);
1037 glVertex2d(x +im2, y);
1038 glVertex2d(x +im , y +im2);
1039 glVertex2d(x +im2, y +im);
1040 glVertex2d(x , y +im2);
1041 glVertex2d(x , y );
1042 glEnd(); }
1043}
1044
1045////////////////////////////////////////////////////////////////////////////////
1046
1048{
1049 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1050 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
1051
1052 for (unsigned i = 0; i < n; ++i) {
1053 const Double_t x = xy[i].fX;
1054 const Double_t y = xy[i].fY;
1055
1056 glBegin(GL_POLYGON);
1057 glVertex2d(x, y+im2);
1058 glVertex2d(x-im2 , y+im);
1059 glVertex2d(x-im, y+im2);
1060 glVertex2d(x-im2 , y);
1061 glEnd();
1062 glBegin(GL_POLYGON);
1063 glVertex2d(x-im2, y);
1064 glVertex2d(x-im , y-im2);
1065 glVertex2d(x-im2, y-im);
1066 glVertex2d(x, y-im2);
1067 glEnd();
1068 glBegin(GL_POLYGON);
1069 glVertex2d(x, y-im2);
1070 glVertex2d(x+im2 , y-im);
1071 glVertex2d(x+im, y-im2);
1072 glVertex2d(x+im2, y);
1073 glEnd();
1074 glBegin(GL_POLYGON);
1075 glVertex2d(x+im2, y);
1076 glVertex2d(x+im , y+im2);
1077 glVertex2d(x+im2, y+im);
1078 glVertex2d(x, y+im2);
1079 glEnd();
1080 }
1081}
1082
1083////////////////////////////////////////////////////////////////////////////////
1084
1086{
1087 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1088 const Int_t im2 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
1089
1090 for (unsigned i = 0; i < n; ++i) {
1091 const Double_t x = xy[i].fX;
1092 const Double_t y = xy[i].fY;
1093
1094 glBegin(GL_POLYGON);
1095 glVertex2d(x+im2, y+im2);
1096 glVertex2d(x+im2, y+im);
1097 glVertex2d(x-im2, y+im);
1098 glVertex2d(x-im2, y+im2);
1099 glEnd();
1100 glBegin(GL_POLYGON);
1101 glVertex2d(x-im2, y+im2);
1102 glVertex2d(x-im, y+im2);
1103 glVertex2d(x-im, y-im2);
1104 glVertex2d(x-im2, y-im2);
1105 glEnd();
1106 glBegin(GL_POLYGON);
1107 glVertex2d(x-im2, y-im2);
1108 glVertex2d(x-im2, y-im);
1109 glVertex2d(x+im2, y-im);
1110 glVertex2d(x+im2, y-im2);
1111 glEnd();
1112 glBegin(GL_POLYGON);
1113 glVertex2d(x+im2, y-im2);
1114 glVertex2d(x+im, y-im2);
1115 glVertex2d(x+im, y+im2);
1116 glVertex2d(x+im2, y+im2);
1117 glEnd();
1118 }
1119}
1120
1121/*
1122Small RAII class for GLU tesselator.
1123*/
1124#ifndef CALLBACK
1125#define CALLBACK
1126#endif
1127
1128extern "C" {
1129#if defined(__APPLE_CC__) && __APPLE_CC__ > 4000 && __APPLE_CC__ < 5450 && !defined(__INTEL_COMPILER)
1130 typedef GLvoid (*tess_t)(...);
1131#elif defined( __mips ) || defined( __linux__ ) || defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __sun ) || defined (__CYGWIN__) || defined (__APPLE__)
1132 typedef GLvoid (*tess_t)();
1133#elif defined ( WIN32)
1134 typedef GLvoid (CALLBACK *tess_t)( );
1135#else
1136 #error "Error - need to define type tess_t for this platform/compiler"
1137#endif
1138}
1139
1140////////////////////////////////////////////////////////////////////////////////
1141
1143{
1145 if (!dump)
1146 return;
1147
1148 dump->push_back(MeshPatch_t(type));
1149}
1150
1151////////////////////////////////////////////////////////////////////////////////
1152
1153void Vertex(const Double_t *v)
1154{
1156 if (!dump)
1157 return;
1158
1159 std::vector<Double_t> & vs = dump->back().fPatch;
1160 vs.push_back(v[0]);
1161 vs.push_back(v[1]);
1162 vs.push_back(v[2]);
1163}
1164
1165////////////////////////////////////////////////////////////////////////////////
1166
1167void End()
1168{
1169}
1170
1172
1173////////////////////////////////////////////////////////////////////////////////
1174
1176 : fTess(0)
1177{
1178 GLUtesselator *tess = gluNewTess();
1179 if (!tess)
1180 throw std::runtime_error("tesselator creation failed");
1181
1182#if defined(__GNUC__) && __GNUC__ >= 8
1183#pragma GCC diagnostic push
1184#pragma GCC diagnostic ignored "-Wcast-function-type"
1185#endif
1186
1187 if (!dump) {
1188 gluTessCallback(tess, (GLenum)GLU_BEGIN, (tess_t) glBegin);
1189 gluTessCallback(tess, (GLenum)GLU_END, (tess_t) glEnd);
1190 gluTessCallback(tess, (GLenum)GLU_VERTEX, (tess_t) glVertex3dv);
1191 } else {
1192 gluTessCallback(tess, (GLenum)GLU_BEGIN, (tess_t) Begin);
1193 gluTessCallback(tess, (GLenum)GLU_END, (tess_t) End);
1194 gluTessCallback(tess, (GLenum)GLU_VERTEX, (tess_t) Vertex);
1195 }
1196
1197#if defined(__GNUC__) && __GNUC__ >= 8
1198#pragma GCC diagnostic pop
1199#endif
1200
1202 fTess = tess;
1203}
1204
1205////////////////////////////////////////////////////////////////////////////////
1206
1208{
1210}
1211
1212/*
1213In future, this should be an interface to per-pad FBO.
1214Currently, in only save sizes and coordinates (?)
1215*/
1216////////////////////////////////////////////////////////////////////////////////
1217
1219 : fW(w), fH(h), fX(x), fY(y), fTop(top)
1220{
1221}
1222
1223////////////////////////////////////////////////////////////////////////////////
1224
1226 : fMaxLineWidth(0.),
1227 fMaxPointSize(0.)
1228{
1229}
1230
1231////////////////////////////////////////////////////////////////////////////////
1232
1234{
1235 if (!fMaxLineWidth) {
1236 Double_t lp[2] = {};
1237 glGetDoublev(lineWidthPNAME, lp);//lineWidthPNAME is defined at the top of this file.
1238 fMaxLineWidth = lp[1];
1239 }
1240
1241 return fMaxLineWidth;
1242}
1243
1244////////////////////////////////////////////////////////////////////////////////
1245
1247{
1248 if (!fMaxPointSize) {
1249 Double_t lp[2] = {};
1250 glGetDoublev(pointSizePNAME, lp);//pointSizePNAME is defined at the top of this file.
1251 fMaxPointSize = lp[1];
1252 }
1253
1254 return fMaxLineWidth;
1255}
1256
1257
1258////////////////////////////////////////////////////////////////////////////////
1259
1260void ExtractRGBA(Color_t colorIndex, Float_t *rgba)
1261{
1262 const TColor *color = gROOT->GetColor(colorIndex);
1263 if (color) {
1264 color->GetRGB(rgba[0], rgba[1], rgba[2]);
1265 rgba[3] = color->GetAlpha();
1266 }
1267}
1268
1269////////////////////////////////////////////////////////////////////////////////
1270
1271template<class ValueType>
1272BoundingRect<ValueType> FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys)
1273{
1274 assert(nPoints > 0 && "FindBoundingRect, invalind number of points");
1275 assert(xs != nullptr && "FindBoundingRect, parameter 'xs' is null");
1276 assert(ys != nullptr && "FindBoundingRect, parameter 'ys' is null");
1277
1278 ValueType xMin = xs[0], xMax = xMin;
1279 ValueType yMin = ys[0], yMax = yMin;
1280
1281 for (Int_t i = 1; i < nPoints; ++i) {
1282 xMin = TMath::Min(xMin, xs[i]);
1283 xMax = TMath::Max(xMax, xs[i]);
1284
1285 yMin = TMath::Min(yMin, ys[i]);
1286 yMax = TMath::Max(yMax, ys[i]);
1287 }
1288
1290 box.fXMin = xMin;
1291 box.fXMax = xMax;
1292 box.fWidth = xMax - xMin;
1293
1294 box.fYMin = yMin;
1295 box.fYMax = yMax;
1296 box.fHeight = yMax - yMin;
1297
1298 return box;
1299}
1300
1301template BoundingRect<Double_t> FindBoundingRect(Int_t nPoints, const Double_t *xs, const Double_t *ys);
1302template BoundingRect<Float_t> FindBoundingRect(Int_t nPoints, const Float_t *xs, const Float_t *ys);
1303template BoundingRect<Long_t> FindBoundingRect(Int_t nPoints, const Long_t *xs, const Long_t *ys);
1304template BoundingRect<Int_t> FindBoundingRect(Int_t nPoints, const Int_t *xs, const Int_t *ys);
1305template BoundingRect<SCoord_t> FindBoundingRect(Int_t nPoints, const SCoord_t *xs, const SCoord_t *ys);
1306
1307
1308
1309namespace {
1310
1311////////////////////////////////////////////////////////////////////////////////
1312
1313void CalculateCircle(std::vector<TPoint> &circle, Double_t r, UInt_t pts)
1314{
1315 const Double_t delta = TMath::TwoPi() / pts;
1316 const UInt_t first = circle.size();
1317 Double_t angle = 0.;
1318 circle.resize(circle.size() + pts + 1);
1319
1320 for (UInt_t i = 0; i < pts; ++i, angle += delta) {
1321 circle[first + i].fX = SCoord_t(r * TMath::Cos(angle));
1322 circle[first + i].fY = SCoord_t(r * TMath::Sin(angle));
1323 }
1324
1325 circle.back().fX = circle[first].fX;
1326 circle.back().fY = circle[first].fY;
1327}
1328
1329}//anonymous namespace
1330
1331}//namespace Pad
1332}//namespace Rgl
void GLvoid
Definition: GL_glu.h:269
GLAPI GLUtesselator *GLAPIENTRY gluNewTess(void)
Definition: tess.c:102
#define GLU_VERTEX
Definition: GL_glu.h:210
#define GL_TRIANGLE_FAN
Definition: GL_glu.h:289
#define GL_LINES
Definition: GL_glu.h:284
#define GL_TRIANGLES
Definition: GL_glu.h:287
unsigned int GLenum
Definition: GL_glu.h:266
#define GL_POINTS
Definition: GL_glu.h:283
#define GLU_BEGIN
Definition: GL_glu.h:208
#define GLU_TESS_TOLERANCE
Definition: GL_glu.h:234
GLAPI void GLAPIENTRY gluTessProperty(GLUtesselator *tess, GLenum which, GLdouble data)
Definition: tess.c:211
GLAPI void GLAPIENTRY gluTessCallback(GLUtesselator *tess, GLenum which, _GLUfuncptr CallBackFunc)
Definition: tess.c:286
#define GL_POLYGON
Definition: GL_glu.h:292
#define GL_LINE_LOOP
Definition: GL_glu.h:285
#define GLU_END
Definition: GL_glu.h:212
GLAPI void GLAPIENTRY gluDeleteTess(GLUtesselator *tess)
Definition: tess.c:203
ROOT::R::TRInterface & r
Definition: Object.C:4
#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:26
unsigned short UShort_t
Definition: RtypesCore.h:38
int Int_t
Definition: RtypesCore.h:43
unsigned char UChar_t
Definition: RtypesCore.h:36
unsigned int UInt_t
Definition: RtypesCore.h:44
long Long_t
Definition: RtypesCore.h:52
short Width_t
Definition: RtypesCore.h:80
double Double_t
Definition: RtypesCore.h:57
short SCoord_t
Definition: RtypesCore.h:82
short Color_t
Definition: RtypesCore.h:81
float Float_t
Definition: RtypesCore.h:55
#define CALLBACK
int type
Definition: TGX11.cxx:120
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
#define gROOT
Definition: TROOT.h:406
#define gVirtualX
Definition: TVirtualX.h:338
FillAttribSet(const PolygonStippleSet &set, Bool_t ignoreStipple)
Polygon stipple, if required.
Double_t fMaxLineWidth
Definition: TGLPadUtils.h:228
Double_t GetMaxLineWidth() const
Double_t fMaxPointSize
Definition: TGLPadUtils.h:229
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
Definition: TGLPadUtils.h:110
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()
Definition: TGLPadUtils.h:190
static Tesselation_t * fVs
Definition: TGLPadUtils.h:199
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
Definition: TAttMarker.cxx:297
The color creation and management class.
Definition: TColor.h:19
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Definition: TColor.h:51
Float_t GetAlpha() const
Definition: TColor.h:63
Definition: TPoint.h:31
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
Definition: TGLPadUtils.h:170
BoundingRect< ValueType > FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys)
void End()
void Vertex(const Double_t *v)
const UInt_t gMaxStipple
void ExtractRGBA(Color_t colorIndex, Float_t *rgba)
const GLenum lineWidthPNAME
Definition: TGLPadUtils.cxx:36
void Begin(Int_t type)
const GLenum pointSizePNAME
Definition: TGLPadUtils.cxx:37
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
Double_t Floor(Double_t x)
Definition: TMath.h:693
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
Double_t Cos(Double_t)
Definition: TMath.h:631
Double_t Sin(Double_t)
Definition: TMath.h:627
constexpr Double_t TwoPi()
Definition: TMath.h:45
Definition: first.py:1
TCanvas * style()
Definition: style.C:1