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.
38const GLenum pointSizePNAME = GLenum(GL_SMOOTH_POINT_SIZE_RANGE);
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];
82 fStipples.resize(kStippleSize * numOfStipples);
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
94 fStipples[ind] = pixel;
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;
130 glPolygonStipple(&set.fStipples[fStipple * PolygonStippleSet::kStippleSize]);
131 glEnable(GL_POLYGON_STIPPLE);
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.) {
140 glEnable(GL_BLEND);
141 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
142 }
143 glColor4fv(rgba);
144}
145
146////////////////////////////////////////////////////////////////////////////////
147
149{
150 if (fStipple)
151 glDisable(GL_POLYGON_STIPPLE);
152
153 if (fAlpha<1.)
154 glDisable(GL_BLEND);
155}
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
174LineAttribSet::LineAttribSet(Bool_t smooth, UInt_t stipple, Double_t maxWidth, Bool_t setWidth)
175 : fSmooth(smooth), fStipple(stipple), fSetWidth(setWidth), fAlpha(0.8)
176{
177 if (fSmooth) {
178 glEnable(GL_BLEND);
179 glEnable(GL_LINE_SMOOTH);
180 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
181 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
182 }
183
184 //Stipple.
185 if (fStipple > 1) {
186 if (fStipple >= gMaxStipple)
187 fStipple = 1;
188 else {
189 glEnable(GL_LINE_STIPPLE);
190 glLineStipple(fStipple == 10 ? 2 : 1, gLineStipples[fStipple]);
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) {
199 glEnable(GL_BLEND);
200 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
201 }
202 glColor4fv(rgba);
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) {
216 glDisable(GL_LINE_SMOOTH);
217 glDisable(GL_BLEND);
218 }
219
220 if (fStipple > 1)
221 glDisable(GL_LINE_STIPPLE);
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();
361 CalculateCircle(fCircle, r, r < 100. ? kSmallCirclePts : kLargeCirclePts);
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
385 CalculateCircle(fCircle, r, r < 100 ? kSmallCirclePts : kLargeCirclePts);
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
391 glBegin(GL_TRIANGLE_FAN);
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;
415 glBegin(GL_POLYGON);
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;
432 glBegin(GL_POLYGON);
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
472 glBegin(GL_POLYGON);
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
538 glBegin(GL_POLYGON);
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();
544 glBegin(GL_POLYGON);
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();
550 glEnd();
551 glBegin(GL_POLYGON);
552 glVertex2d(x - imx, y - imx);
553 glVertex2d(x - imx, y - im);
554 glVertex2d(x + imx, y - im);
555 glVertex2d(x + imx, y - imx);
556 glEnd();
557 }
558}
559
560////////////////////////////////////////////////////////////////////////////////
561/// Full star pentagone
562
564{
565 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
566 const Int_t im1 = Int_t(0.66 * gVirtualX->GetMarkerSize() + 0.5);
567 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
568 const Int_t im3 = Int_t(2.66 * gVirtualX->GetMarkerSize() + 0.5);
569 const Int_t im4 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
570
571 for (UInt_t i = 0; i < n; ++i) {
572 const Double_t x = xy[i].fX;
573 const Double_t y = xy[i].fY;
574
575 glBegin(GL_TRIANGLES);
576 glVertex2d(x - im, y - im4);//0
577 glVertex2d(x - im2, y + im1);//1
578 glVertex2d(x - im4, y - im4);//9
579
580 glVertex2d(x - im2, y + im1);//1
581 glVertex2d(x - im3, y + im);//2
582 glVertex2d(x, y + im2);//3
583
584 glVertex2d(x, y + im2);//3
585 glVertex2d(x + im3, y + im);//4
586 glVertex2d(x + im2, y + im1);//5
587
588 glVertex2d(x + im2, y + im1);//5
589 glVertex2d(x + im, y - im4);//6
590 glVertex2d(x + im4, y - im4);//7
591
592 glVertex2d(x + im4, y - im4);//7
593 glVertex2d(x, y - im);//8
594 glVertex2d(x - im4, y - im4);//9
595
596 glVertex2d(x - im4, y - im4);//9
597 glVertex2d(x - im2, y + im1);//1
598 glVertex2d(x, y + im2);//3
599
600 glVertex2d(x - im4, y - im4);//9
601 glVertex2d(x, y + im2);//3
602 glVertex2d(x + im2, y + im1);//5
603
604 glVertex2d(x - im4, y - im4);//9
605 glVertex2d(x + im2, y + im1);//5
606 glVertex2d(x + im4, y - im4);//7
607
608 glEnd();
609
610 }
611}
612
613////////////////////////////////////////////////////////////////////////////////
614/// Full star pentagone
615
617{
618 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
619 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
620 const Int_t im1 = Int_t(0.66 * MarkerSizeReduced + 0.5);
621 const Int_t im2 = Int_t(2.00 * MarkerSizeReduced + 0.5);
622 const Int_t im3 = Int_t(2.66 * MarkerSizeReduced + 0.5);
623 const Int_t im4 = Int_t(1.33 * MarkerSizeReduced + 0.5);
624
625 for (UInt_t i = 0; i < n; ++i) {
626 const Double_t x = xy[i].fX;
627 const Double_t y = xy[i].fY;
628
629 glBegin(GL_LINE_LOOP);
630 glVertex2d(x - im, y - im4);
631 glVertex2d(x - im2, y + im1);
632 glVertex2d(x - im3, y + im);
633 glVertex2d(x, y + im2);
634 glVertex2d(x + im3, y + im);
635 glVertex2d(x + im2, y + im1);
636 glVertex2d(x + im, y - im4);
637 glVertex2d(x + im4, y - im4);
638 glVertex2d(x, y - im);
639 glVertex2d(x - im4, y - im4);
640 glEnd();
641 }
642}
643
644////////////////////////////////////////////////////////////////////////////////
645
647{
648 const Int_t im = Int_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
649
650 for (unsigned i = 0; i < n; ++i) {
651 const Double_t x = xy[i].fX;
652 const Double_t y = xy[i].fY;
653
654 glBegin(GL_LINE_LOOP);
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 glVertex2d(x + im, y - im);
663 glEnd();
664 }
665}
666
667////////////////////////////////////////////////////////////////////////////////
668
670{
671 const Int_t im = Int_t(4. * (gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.) + 0.5);
672
673 for (unsigned i = 0; i < n; ++i) {
674 const Double_t x = xy[i].fX;
675 const Double_t y = xy[i].fY;
676
677 glBegin(GL_LINE_LOOP);
678 glVertex2d(x - im, y );
679 glVertex2d(x , y - im);
680 glVertex2d(x + im, y );
681 glVertex2d(x , y + im);
682 glVertex2d(x - im, y );
683 glVertex2d(x + im, y );
684 glVertex2d(x , y + im);
685 glVertex2d(x , y - im);
686 glEnd();
687 }
688}
689
690////////////////////////////////////////////////////////////////////////////////
691
693{
694 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
695 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
696 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
697
698 for (unsigned i = 0; i < n; ++i) {
699 const Double_t x = xy[i].fX;
700 const Double_t y = xy[i].fY;
701
702 glBegin(GL_LINE_LOOP);
703 glVertex2d(x , y );
704 glVertex2d(x -im2, y + im);
705 glVertex2d(x - im, y );
706 glVertex2d(x , y );
707 glVertex2d(x -im2, y - im);
708 glVertex2d(x +im2, y - im);
709 glVertex2d(x , y );
710 glVertex2d(x + im, y );
711 glVertex2d(x +im2, y + im);
712 glVertex2d(x , y );
713 glEnd();
714 }
715}
716
717////////////////////////////////////////////////////////////////////////////////
718
720{
721 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
722 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
723 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
724
725 for (unsigned i = 0; i < n; ++i) {
726 const Double_t x = xy[i].fX;
727 const Double_t y = xy[i].fY;
728
729 glBegin(GL_LINE_LOOP);
730 glVertex2d(x-im, y );
731 glVertex2d(x-im, y-im2);
732 glVertex2d(x-im2, y-im);
733 glVertex2d(x+im2, y-im);
734 glVertex2d(x+im, y-im2);
735 glVertex2d(x+im, y+im2);
736 glVertex2d(x+im2, y+im);
737 glVertex2d(x-im2, y+im);
738 glVertex2d(x-im, y+im2);
739 glVertex2d(x-im, y );
740 glVertex2d(x+im, y );
741 glVertex2d(x , y );
742 glVertex2d(x , y-im);
743 glVertex2d(x , y+im);
744 glVertex2d(x , y);
745 glEnd();
746 }
747}
748
749////////////////////////////////////////////////////////////////////////////////
750
752{
753 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
754 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
755
756 for (unsigned i = 0; i < n; ++i) {
757 const Double_t x = xy[i].fX;
758 const Double_t y = xy[i].fY;
759
760 glBegin(GL_POLYGON);
761 glVertex2d(x , y );
762 glVertex2d(x -im2, y + im);
763 glVertex2d(x - im, y );
764 glVertex2d(x , y );
765 glVertex2d(x -im2, y - im);
766 glVertex2d(x +im2, y - im);
767 glVertex2d(x , y );
768 glVertex2d(x + im, y );
769 glVertex2d(x +im2, y + im);
770 glVertex2d(x , y );
771 glEnd();
772 }
773}
774
775////////////////////////////////////////////////////////////////////////////////
776
778{
779 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
780 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
781 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
782
783 for (unsigned i = 0; i < n; ++i) {
784 const Double_t x = xy[i].fX;
785 const Double_t y = xy[i].fY;
786
787 glBegin(GL_LINE_LOOP);
788 glVertex2d(x , y );
789 glVertex2d(x+im2, y+im);
790 glVertex2d(x+im , y+im2);
791 glVertex2d(x , y );
792 glVertex2d(x+im , y-im2);
793 glVertex2d(x+im2, y-im);
794 glVertex2d(x , y );
795 glVertex2d(x-im2, y-im);
796 glVertex2d(x-im , y-im2);
797 glVertex2d(x , y );
798 glVertex2d(x-im , y+im2);
799 glVertex2d(x-im2, y+im);
800 glVertex2d(x , y );
801 glEnd();
802 }
803}
804
805////////////////////////////////////////////////////////////////////////////////
806
808{
809 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
810 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
811
812 for (unsigned i = 0; i < n; ++i) {
813 const Double_t x = xy[i].fX;
814 const Double_t y = xy[i].fY;
815
816 glBegin(GL_POLYGON);
817 glVertex2d(x , y );
818 glVertex2d(x+im2, y+im);
819 glVertex2d(x+im , y+im2);
820 glVertex2d(x , y );
821 glVertex2d(x+im , y-im2);
822 glVertex2d(x+im2, y-im);
823 glVertex2d(x , y );
824 glVertex2d(x-im2, y-im);
825 glVertex2d(x-im , y-im2);
826 glVertex2d(x , y );
827 glVertex2d(x-im , y+im2);
828 glVertex2d(x-im2, y+im);
829 glVertex2d(x , y );
830 glEnd();
831 }
832}
833
834////////////////////////////////////////////////////////////////////////////////
835
837{
838 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
839 const Int_t im = Int_t(4.00 * MarkerSizeReduced + 0.5);
840 const Int_t im4 = Int_t(1.33 * MarkerSizeReduced + 0.5);
841
842 for (unsigned i = 0; i < n; ++i) {
843 const Double_t x = xy[i].fX;
844 const Double_t y = xy[i].fY;
845
846 glBegin(GL_LINE_LOOP);
847 glVertex2d(x , y+im );
848 glVertex2d(x-im4, y+im4);
849 glVertex2d(x-im , y );
850 glVertex2d(x-im4, y-im4);
851 glVertex2d(x , y-im );
852 glVertex2d(x+im4, y-im4);
853 glVertex2d(x+im , y );
854 glVertex2d(x+im4, y+im4);
855 glVertex2d(x , y+im );
856 glEnd();
857 }
858}
859
860////////////////////////////////////////////////////////////////////////////////
861
863{
864 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
865 const Int_t im4 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
866
867 for (unsigned i = 0; i < n; ++i) {
868 const Double_t x = xy[i].fX;
869 const Double_t y = xy[i].fY;
870
871 glBegin(GL_POLYGON);
872 glVertex2d(x, y+im );
873 glVertex2d(x-im4, y+im4);
874 glVertex2d(x, y);
875 glEnd();
876 glBegin(GL_POLYGON);
877 glVertex2d(x-im4, y+im4);
878 glVertex2d(x-im, y);
879 glVertex2d(x, y );
880 glEnd();
881 glBegin(GL_POLYGON);
882 glVertex2d(x-im, y);
883 glVertex2d(x-im4, y-im4);
884 glVertex2d(x, y );
885 glEnd();
886 glBegin(GL_POLYGON);
887 glVertex2d(x-im4, y-im4);
888 glVertex2d(x, y-im);
889 glVertex2d(x, y );
890 glEnd();
891 glBegin(GL_POLYGON);
892 glVertex2d(x, y-im);
893 glVertex2d(x+im4, y-im4);
894 glVertex2d(x, y );
895 glEnd();
896 glBegin(GL_POLYGON);
897 glVertex2d(x+im4, y-im4);
898 glVertex2d(x+im, y);
899 glVertex2d(x, y );
900 glEnd();
901 glBegin(GL_POLYGON);
902 glVertex2d(x+im, y);
903 glVertex2d(x+im4, y+im4);
904 glVertex2d(x, y );
905 glEnd();
906 glBegin(GL_POLYGON);
907 glVertex2d(x+im4, y+im4);
908 glVertex2d(x, y+im);
909 glVertex2d(x, y );
910 glEnd();
911 }
912}
913
914////////////////////////////////////////////////////////////////////////////////
915
917{
918 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
919 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
920 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
921
922 for (unsigned i = 0; i < n; ++i) {
923 const Double_t x = xy[i].fX;
924 const Double_t y = xy[i].fY;
925
926 glBegin(GL_LINE_LOOP);
927 glVertex2d(x , y );
928 glVertex2d(x+im2, y+im);
929 glVertex2d(x-im2, y+im);
930 glVertex2d(x+im2, y-im);
931 glVertex2d(x-im2, y-im);
932 glVertex2d(x , y );
933 glVertex2d(x+im, y+im2);
934 glVertex2d(x+im, y-im2);
935 glVertex2d(x-im, y+im2);
936 glVertex2d(x-im, y-im2);
937 glVertex2d(x , y );
938 glEnd();
939 }
940}
941
942////////////////////////////////////////////////////////////////////////////////
943
945{
946 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
947 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
948
949 for (unsigned i = 0; i < n; ++i) {
950 const Double_t x = xy[i].fX;
951 const Double_t y = xy[i].fY;
952
953 glBegin(GL_POLYGON);
954 glVertex2d(x , y );
955 glVertex2d(x+im2, y+im);
956 glVertex2d(x-im2, y+im);
957 glVertex2d(x+im2, y-im);
958 glVertex2d(x-im2, y-im);
959 glVertex2d(x , y );
960 glVertex2d(x+im, y+im2);
961 glVertex2d(x+im, y-im2);
962 glVertex2d(x-im, y+im2);
963 glVertex2d(x-im, y-im2);
964 glVertex2d(x , y );
965 glEnd();
966 }
967}
968
969////////////////////////////////////////////////////////////////////////////////
970
972{
973 const Double_t MarkerSizeReduced = gVirtualX->GetMarkerSize() - TMath::Floor(TAttMarker::GetMarkerLineWidth(gVirtualX->GetMarkerStyle())/2.)/4.;
974 const Int_t im = Int_t(4. * MarkerSizeReduced + 0.5);
975 const Int_t im2 = Int_t(2. * MarkerSizeReduced + 0.5);
976
977 for (unsigned i = 0; i < n; ++i) {
978 const Double_t x = xy[i].fX;
979 const Double_t y = xy[i].fY;
980
981 glBegin(GL_LINE_LOOP);
982 glVertex2d(x , y +im2);
983 glVertex2d(x -im2, y + im);
984 glVertex2d(x - im, y +im2);
985 glVertex2d(x -im2, y );
986 glVertex2d(x - im, y -im2);
987 glVertex2d(x -im2, y - im);
988 glVertex2d(x , y -im2);
989 glVertex2d(x +im2, y - im);
990 glVertex2d(x + im, y -im2);
991 glVertex2d(x +im2, y );
992 glVertex2d(x + im, y +im2);
993 glVertex2d(x +im2, y + im);
994 glVertex2d(x , y +im2);
995 glEnd();
996 }
997}
998
999////////////////////////////////////////////////////////////////////////////////
1000
1002{
1003 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1004 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
1005
1006 for (unsigned i = 0; i < n; ++i) {
1007 const Double_t x = xy[i].fX;
1008 const Double_t y = xy[i].fY;
1009
1010 glBegin(GL_POLYGON);
1011 glVertex2d(x , y +im2);
1012 glVertex2d(x -im2, y +im);
1013 glVertex2d(x -im , y +im2);
1014 glVertex2d(x -im2, y );
1015 glVertex2d(x , y );
1016 glEnd();
1017 glBegin(GL_POLYGON);
1018 glVertex2d(x -im2, y);
1019 glVertex2d(x -im, y -im2);
1020 glVertex2d(x -im2, y -im);
1021 glVertex2d(x , y-im2);
1022 glVertex2d(x , y );
1023 glEnd();
1024 glBegin(GL_POLYGON);
1025 glVertex2d(x , y -im2);
1026 glVertex2d(x +im2, y -im);
1027 glVertex2d(x +im , y -im2);
1028 glVertex2d(x +im2, y);
1029 glVertex2d(x , y );
1030 glEnd();
1031 glBegin(GL_POLYGON);
1032 glVertex2d(x +im2, y);
1033 glVertex2d(x +im , y +im2);
1034 glVertex2d(x +im2, y +im);
1035 glVertex2d(x , y +im2);
1036 glVertex2d(x , y );
1037 glEnd(); }
1038}
1039
1040////////////////////////////////////////////////////////////////////////////////
1041
1043{
1044 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1045 const Int_t im2 = Int_t(2.00 * gVirtualX->GetMarkerSize() + 0.5);
1046
1047 for (unsigned i = 0; i < n; ++i) {
1048 const Double_t x = xy[i].fX;
1049 const Double_t y = xy[i].fY;
1050
1051 glBegin(GL_POLYGON);
1052 glVertex2d(x, y+im2);
1053 glVertex2d(x-im2 , y+im);
1054 glVertex2d(x-im, y+im2);
1055 glVertex2d(x-im2 , y);
1056 glEnd();
1057 glBegin(GL_POLYGON);
1058 glVertex2d(x-im2, y);
1059 glVertex2d(x-im , y-im2);
1060 glVertex2d(x-im2, y-im);
1061 glVertex2d(x, y-im2);
1062 glEnd();
1063 glBegin(GL_POLYGON);
1064 glVertex2d(x, y-im2);
1065 glVertex2d(x+im2 , y-im);
1066 glVertex2d(x+im, y-im2);
1067 glVertex2d(x+im2, y);
1068 glEnd();
1069 glBegin(GL_POLYGON);
1070 glVertex2d(x+im2, y);
1071 glVertex2d(x+im , y+im2);
1072 glVertex2d(x+im2, y+im);
1073 glVertex2d(x, y+im2);
1074 glEnd();
1075 }
1076}
1077
1078////////////////////////////////////////////////////////////////////////////////
1079
1081{
1082 const Int_t im = Int_t(4 * gVirtualX->GetMarkerSize() + 0.5);
1083 const Int_t im2 = Int_t(1.33 * gVirtualX->GetMarkerSize() + 0.5);
1084
1085 for (unsigned i = 0; i < n; ++i) {
1086 const Double_t x = xy[i].fX;
1087 const Double_t y = xy[i].fY;
1088
1089 glBegin(GL_POLYGON);
1090 glVertex2d(x+im2, y+im2);
1091 glVertex2d(x+im2, y+im);
1092 glVertex2d(x-im2, y+im);
1093 glVertex2d(x-im2, y+im2);
1094 glEnd();
1095 glBegin(GL_POLYGON);
1096 glVertex2d(x-im2, y+im2);
1097 glVertex2d(x-im, y+im2);
1098 glVertex2d(x-im, y-im2);
1099 glVertex2d(x-im2, y-im2);
1100 glEnd();
1101 glBegin(GL_POLYGON);
1102 glVertex2d(x-im2, y-im2);
1103 glVertex2d(x-im2, y-im);
1104 glVertex2d(x+im2, y-im);
1105 glVertex2d(x+im2, y-im2);
1106 glEnd();
1107 glBegin(GL_POLYGON);
1108 glVertex2d(x+im2, y-im2);
1109 glVertex2d(x+im, y-im2);
1110 glVertex2d(x+im, y+im2);
1111 glVertex2d(x+im2, y+im2);
1112 glEnd();
1113 }
1114}
1115
1116/*
1117Small RAII class for GLU tesselator.
1118*/
1119#ifndef CALLBACK
1120#define CALLBACK
1121#endif
1122
1123extern "C" {
1124#if defined(__APPLE_CC__) && __APPLE_CC__ > 4000 && __APPLE_CC__ < 5450 && !defined(__INTEL_COMPILER)
1125 typedef GLvoid (*tess_t)(...);
1126#elif defined( __mips ) || defined( __linux__ ) || defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __sun ) || defined (__CYGWIN__) || defined (__APPLE__)
1127 typedef GLvoid (*tess_t)();
1128#elif defined ( WIN32)
1129 typedef GLvoid (CALLBACK *tess_t)( );
1130#else
1131 #error "Error - need to define type tess_t for this platform/compiler"
1132#endif
1133}
1134
1135////////////////////////////////////////////////////////////////////////////////
1136
1138{
1140 if (!dump)
1141 return;
1142
1143 dump->push_back(MeshPatch_t(type));
1144}
1145
1146////////////////////////////////////////////////////////////////////////////////
1147
1148void Vertex(const Double_t *v)
1149{
1151 if (!dump)
1152 return;
1153
1154 std::vector<Double_t> & vs = dump->back().fPatch;
1155 vs.push_back(v[0]);
1156 vs.push_back(v[1]);
1157 vs.push_back(v[2]);
1158}
1159
1160////////////////////////////////////////////////////////////////////////////////
1161
1162void End()
1163{
1164}
1165
1167
1168////////////////////////////////////////////////////////////////////////////////
1169
1171 : fTess(nullptr)
1172{
1173 GLUtesselator *tess = gluNewTess();
1174 if (!tess)
1175 throw std::runtime_error("tesselator creation failed");
1176
1177#if defined(__GNUC__) && __GNUC__ >= 8
1178#pragma GCC diagnostic push
1179#pragma GCC diagnostic ignored "-Wcast-function-type"
1180#endif
1181
1182 if (!dump) {
1183 gluTessCallback(tess, (GLenum)GLU_BEGIN, (tess_t) glBegin);
1184 gluTessCallback(tess, (GLenum)GLU_END, (tess_t) glEnd);
1185 gluTessCallback(tess, (GLenum)GLU_VERTEX, (tess_t) glVertex3dv);
1186 } else {
1187 gluTessCallback(tess, (GLenum)GLU_BEGIN, (tess_t) Begin);
1188 gluTessCallback(tess, (GLenum)GLU_END, (tess_t) End);
1189 gluTessCallback(tess, (GLenum)GLU_VERTEX, (tess_t) Vertex);
1190 }
1191
1192#if defined(__GNUC__) && __GNUC__ >= 8
1193#pragma GCC diagnostic pop
1194#endif
1195
1197 fTess = tess;
1198}
1199
1200////////////////////////////////////////////////////////////////////////////////
1201
1203{
1205}
1206
1207/*
1208In future, this should be an interface to per-pad FBO.
1209Currently, in only save sizes and coordinates (?)
1210*/
1211////////////////////////////////////////////////////////////////////////////////
1212
1214 : fW(w), fH(h), fX(x), fY(y), fTop(top)
1215{
1216}
1217
1218////////////////////////////////////////////////////////////////////////////////
1219
1221 : fMaxLineWidth(0.),
1222 fMaxPointSize(0.)
1223{
1224}
1225
1226////////////////////////////////////////////////////////////////////////////////
1227
1229{
1230 if (!fMaxLineWidth) {
1231 Double_t lp[2] = {};
1232 glGetDoublev(lineWidthPNAME, lp);//lineWidthPNAME is defined at the top of this file.
1233 fMaxLineWidth = lp[1];
1234 }
1235
1236 return fMaxLineWidth;
1237}
1238
1239////////////////////////////////////////////////////////////////////////////////
1240
1242{
1243 if (!fMaxPointSize) {
1244 Double_t lp[2] = {};
1245 glGetDoublev(pointSizePNAME, lp);//pointSizePNAME is defined at the top of this file.
1246 fMaxPointSize = lp[1];
1247 }
1248
1249 return fMaxLineWidth;
1250}
1251
1252
1253////////////////////////////////////////////////////////////////////////////////
1254
1255void ExtractRGBA(Color_t colorIndex, Float_t *rgba)
1256{
1257 const TColor *color = gROOT->GetColor(colorIndex);
1258 if (color) {
1259 color->GetRGB(rgba[0], rgba[1], rgba[2]);
1260 rgba[3] = color->GetAlpha();
1261 }
1262}
1263
1264////////////////////////////////////////////////////////////////////////////////
1265
1266template<class ValueType>
1267BoundingRect<ValueType> FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys)
1268{
1269 assert(nPoints > 0 && "FindBoundingRect, invalind number of points");
1270 assert(xs != nullptr && "FindBoundingRect, parameter 'xs' is null");
1271 assert(ys != nullptr && "FindBoundingRect, parameter 'ys' is null");
1272
1273 ValueType xMin = xs[0], xMax = xMin;
1274 ValueType yMin = ys[0], yMax = yMin;
1275
1276 for (Int_t i = 1; i < nPoints; ++i) {
1277 xMin = TMath::Min(xMin, xs[i]);
1278 xMax = TMath::Max(xMax, xs[i]);
1279
1280 yMin = TMath::Min(yMin, ys[i]);
1281 yMax = TMath::Max(yMax, ys[i]);
1282 }
1283
1285 box.fXMin = xMin;
1286 box.fXMax = xMax;
1287 box.fWidth = xMax - xMin;
1288
1289 box.fYMin = yMin;
1290 box.fYMax = yMax;
1291 box.fHeight = yMax - yMin;
1292
1293 return box;
1294}
1295
1296template BoundingRect<Double_t> FindBoundingRect(Int_t nPoints, const Double_t *xs, const Double_t *ys);
1297template BoundingRect<Float_t> FindBoundingRect(Int_t nPoints, const Float_t *xs, const Float_t *ys);
1298template BoundingRect<Long_t> FindBoundingRect(Int_t nPoints, const Long_t *xs, const Long_t *ys);
1299template BoundingRect<Int_t> FindBoundingRect(Int_t nPoints, const Int_t *xs, const Int_t *ys);
1300template BoundingRect<SCoord_t> FindBoundingRect(Int_t nPoints, const SCoord_t *xs, const SCoord_t *ys);
1301
1302
1303
1304namespace {
1305
1306////////////////////////////////////////////////////////////////////////////////
1307
1308void CalculateCircle(std::vector<TPoint> &circle, Double_t r, UInt_t pts)
1309{
1310 const Double_t delta = TMath::TwoPi() / pts;
1311 const UInt_t first = circle.size();
1312 Double_t angle = 0.;
1313 circle.resize(circle.size() + pts + 1);
1314
1315 for (UInt_t i = 0; i < pts; ++i, angle += delta) {
1316 circle[first + i].fX = SCoord_t(r * TMath::Cos(angle));
1317 circle[first + i].fY = SCoord_t(r * TMath::Sin(angle));
1318 }
1319
1320 circle.back().fX = circle[first].fX;
1321 circle.back().fY = circle[first].fY;
1322}
1323
1324}//anonymous namespace
1325
1326}//namespace Pad
1327}//namespace Rgl
void GLvoid
Definition GL_glu.h:269
#define GLU_VERTEX
Definition GL_glu.h:210
void gluTessCallback(GLUtesselator *tess, GLenum which, _GLUfuncptr CallBackFunc)
Definition tess.c:286
#define GL_TRIANGLE_FAN
Definition GL_glu.h:289
#define GL_LINES
Definition GL_glu.h:284
void gluDeleteTess(GLUtesselator *tess)
Definition tess.c:203
GLUtesselator * gluNewTess(void)
Definition tess.c:102
#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
#define GL_POLYGON
Definition GL_glu.h:292
#define GL_LINE_LOOP
Definition GL_glu.h:285
void gluTessProperty(GLUtesselator *tess, GLenum which, GLdouble data)
Definition tess.c:211
#define GLU_END
Definition GL_glu.h:212
#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
unsigned short UShort_t
Definition RtypesCore.h:40
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:92
unsigned char UChar_t
Definition RtypesCore.h:38
long Long_t
Definition RtypesCore.h:54
unsigned int UInt_t
Definition RtypesCore.h:46
short Width_t
Definition RtypesCore.h:91
float Float_t
Definition RtypesCore.h:57
double Double_t
Definition RtypesCore.h:59
short SCoord_t
Definition RtypesCore.h:93
#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:406
#define gVirtualX
Definition TVirtualX.h:337
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:21
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Definition TColor.h:54
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:1839
Float_t GetAlpha() const
Definition TColor.h:66
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:250
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Definition TMath.h:680
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:198
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:594
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:588
constexpr Double_t TwoPi()
Definition TMath.h:44