33#include "TGLIncludes.h"
131 std::cout <<
"(" <<
fVals[0] <<
"," <<
fVals[1] <<
"," <<
fVals[2] <<
")" << std::endl;
174 fVertex(start), fVector(end - start)
182 fVertex(start), fVector(
vect)
226 fX(0), fY(0), fWidth(0), fHeight(0)
333 Set(1.0, 1.0, 1.0, 0.0);
398 Error(
"TGLPlane::Normalise",
"trying to normalise plane with zero magnitude normal");
413 std::cout.precision(6);
414 std::cout <<
"Plane : " <<
fVals[0] <<
"x + " <<
fVals[1] <<
"y + " <<
fVals[2] <<
"z + " <<
fVals[3] << std::endl;
700 for(
int r=0;
r<4; ++
r, ++C)
703 for(
int c=0;
c<4; ++
c, T+=4)
704 B[
c] = C[0]*T[0] + C[4]*T[1] + C[8]*T[2] + C[12]*T[3];
705 C[0] = B[0]; C[4] = B[1]; C[8] = B[2]; C[12] = B[3];
716 for (
int c=0;
c<4; ++
c, C+=4)
719 for(
int r=0;
r<4; ++
r, ++T)
720 B[
r] = T[0]*C[0] + T[4]*C[1] + T[8]*C[2] + T[12]*C[3];
721 C[0] = B[0]; C[1] = B[1]; C[2] = B[2]; C[3] = B[3];
751 for (
UInt_t i=0; i < 16; i++) {
838 Error(
"TGLMatrix::Scale()",
"zero scale div by zero");
846 Error(
"TGLMatrix::Scale()",
"zero scale div by zero");
854 Error(
"TGLMatrix::Scale()",
"zero scale div by zero");
897 --
i1 <<= 2; --
i2 <<= 2;
898 for(
int r=0;
r<4; ++
r, ++
c) {
899 b1 = cos*
c[
i1] + sin*
c[
i2];
900 b2 = cos*
c[
i2] - sin*
c[
i1];
917 for(
int c=0;
c<4; ++
c, C+=4) {
918 b1 = cos*C[
i1] - sin*C[
i2];
919 b2 = cos*C[
i2] + sin*C[
i1];
920 C[
i1] = b1; C[
i2] = b2;
930 for (
UInt_t i = 0; i < 3; i++) {
1010 Warning(
"TGLMatrix::Invert",
"matrix is singular.");
1047 r.X() = M[0]*
v[0] + M[4]*
v[1] + M[8]*
v[2] + M[12]*
w;
1048 r.Y() = M[1]*
v[0] + M[5]*
v[1] + M[9]*
v[2] + M[13]*
w;
1049 r.Z() = M[2]*
v[0] + M[6]*
v[1] + M[10]*
v[2] + M[14]*
w;
1060 r.X() = M[0]*
v[0] + M[4]*
v[1] + M[8]*
v[2];
1061 r.Y() = M[1]*
v[0] + M[5]*
v[1] + M[9]*
v[2];
1062 r.Z() = M[2]*
v[0] + M[6]*
v[1] + M[10]*
v[2];
1073 v.X() = M[0]*
r[0] + M[4]*
r[1] + M[8]*
r[2] + M[12]*
w;
1074 v.Y() = M[1]*
r[0] + M[5]*
r[1] + M[9]*
r[2] + M[13]*
w;
1075 v.Z() = M[2]*
r[0] + M[6]*
r[1] + M[10]*
r[2] + M[14]*
w;
1085 v.X() = M[0]*
r[0] + M[4]*
r[1] + M[8]*
r[2];
1086 v.Y() = M[1]*
r[0] + M[5]*
r[1] + M[9]*
r[2];
1087 v.Z() = M[2]*
r[0] + M[6]*
r[1] + M[10]*
r[2];
1128 std::cout.precision(6);
1132 std::cout <<
fVals[
y*4 +
x] <<
" ";
1134 std::cout <<
"]" << std::endl;
1343 for (
Int_t i = 0; i < 5; ++i)
1356 for (
Int_t i = 0; i < 5; ++i)
1434#if defined(__APPLE_CC__) && __APPLE_CC__ > 4000 && __APPLE_CC__ < 5450 && !defined(__INTEL_COMPILER)
1436#elif defined(__linux__) || defined(__FreeBSD__) || defined( __OpenBSD__ ) || defined(__sun) || defined (__CYGWIN__) || defined (__APPLE__)
1438#elif defined (WIN32)
1441 #error "Error - need to define type tessfuncptr_t for this platform/compiler"
1448class TGLTesselatorWrap
1459 throw std::bad_alloc();
1461#if defined(__GNUC__) && __GNUC__ >= 8
1462#pragma GCC diagnostic push
1463#pragma GCC diagnostic ignored "-Wcast-function-type"
1470#if defined(__GNUC__) && __GNUC__ >= 8
1471#pragma GCC diagnostic pop
1492#if defined(__GNUC__) && __GNUC__ >= 8
1493#pragma GCC diagnostic push
1494#pragma GCC diagnostic ignored "-Wcast-function-type"
1499#if defined(__GNUC__) && __GNUC__ >= 8
1500#pragma GCC diagnostic pop
1513#if defined(__GNUC__) && __GNUC__ >= 8
1514#pragma GCC diagnostic push
1515#pragma GCC diagnostic ignored "-Wcast-function-type"
1520#if defined(__GNUC__) && __GNUC__ >= 8
1521#pragma GCC diagnostic pop
1534#if defined(__GNUC__) && __GNUC__ >= 8
1535#pragma GCC diagnostic push
1536#pragma GCC diagnostic ignored "-Wcast-function-type"
1541#if defined(__GNUC__) && __GNUC__ >= 8
1542#pragma GCC diagnostic pop
1555#if defined(__GNUC__) && __GNUC__ >= 8
1556#pragma GCC diagnostic push
1557#pragma GCC diagnostic ignored "-Wcast-function-type"
1562#if defined(__GNUC__) && __GNUC__ >= 8
1563#pragma GCC diagnostic pop
1581 if (
strcmp(
gEnv->
GetValue(
"OpenGL.PointLineScalingFactor",
"native"),
"native") == 0)
1647 Error(
"TGLUtil::CheckError",
"GL Error %s", (
const char *)
errString);
1673 Error(
"TGLUtil::UnlockColor",
"fgColorLockCount already 0.");
1725 glColor4f(
c->GetRed(),
c->GetGreen(),
c->GetBlue(), alpha);
1951 for (
Int_t i=0; i<=12; i+=4) {
1984 if (s == 2 || s == 3 || s == 5 || s == 28)
2001 if (s == 2 || s == 3 || s == 5 || s == 28)
2045 for (
Int_t i=0; i<
n; ++i,
p+=3)
2153 for (
Int_t i=0; i<
n; ++i,
p+=3)
2167 for (
Int_t i=0; i<
n; ++i,
p+=3)
2220 typedef std::vector<Double_t>::size_type size_type;
2224 for (size_type i = 0; i <
points.size(); i += 3) {
2271 if (
aline.GetLineStyle() > 1)
2275 switch (
aline.GetLineStyle()) {
2276 case 2:
pat = 0x3333;
break;
2277 case 3:
pat = 0x5555;
break;
2278 case 4:
pat = 0xf040;
break;
2279 case 5:
pat = 0xf4f4;
break;
2280 case 6:
pat = 0xf111;
break;
2281 case 7:
pat = 0xf0f0;
break;
2282 case 8:
pat = 0xff11;
break;
2283 case 9:
pat = 0x3fff;
break;
2284 case 10:
pat = 0x08ff;
break;
2502 static const UChar_t xyz[][8] = {
2503 {0x44, 0x44, 0x28, 0x10, 0x10, 0x28, 0x44, 0x44},
2504 {0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x44, 0x44},
2505 {0x7c, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x7c}
2518 for (
UInt_t i = 0; i < 3; i++) {
2524 start[(i+1)%3] = 0.0;
2525 start[(i+2)%3] = 0.0;
2528 start[(i+1)%3] = min[(i+1)%3];
2529 start[(i+2)%3] = min[(i+2)%3];
2531 vector[(i+1)%3] = 0.0;
2532 vector[(i+2)%3] = 0.0;
2542 vector[i] = min[i] - max[i];
2554 vector[i] = max[i] - min[i];
2566 if (min[
j] <= 0.0 && max[
j] >= 0.0) {
2569 zero[(
j+1)%3] = min[(
j+1)%3];
2570 zero[(
j+2)%3] = min[(
j+2)%3];
2582 for (
UInt_t k = 0; k < 3; k++) {
2589 minPos[(k+1)%3] = min[(k+1)%3];
2590 minPos[(k+2)%3] = min[(k+2)%3];
2619 glBitmap(8, 8, 0.0, 4.0, 0.0, 0.0, xyz[k]);
2633 {0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38},
2634 {0x10, 0x10, 0x10, 0x10, 0x10, 0x70, 0x10, 0x10},
2635 {0x7c, 0x44, 0x20, 0x18, 0x04, 0x04, 0x44, 0x38},
2636 {0x38, 0x44, 0x04, 0x04, 0x18, 0x04, 0x44, 0x38},
2637 {0x04, 0x04, 0x04, 0x04, 0x7c, 0x44, 0x44, 0x44},
2638 {0x7c, 0x44, 0x04, 0x04, 0x7c, 0x40, 0x40, 0x7c},
2639 {0x7c, 0x44, 0x44, 0x44, 0x7c, 0x40, 0x40, 0x7c},
2640 {0x20, 0x20, 0x20, 0x10, 0x08, 0x04, 0x44, 0x7c},
2641 {0x38, 0x44, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38},
2642 {0x7c, 0x44, 0x04, 0x04, 0x7c, 0x44, 0x44, 0x7c},
2643 {0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
2644 {0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00},
2645 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
2657 if (num[i] ==
'.') {
2659 }
else if (num[i] ==
'-') {
2661 }
else if (num[i] ==
' ') {
2663 }
else if (num[i] >=
'0' && num[i] <=
'9') {
2787 : fWidth(0), fHeight(0)
2863 if (
lhs.fRGB[0] <
rhs.fRGB[0])
2865 else if (
lhs.fRGB[0] >
rhs.fRGB[0])
2867 else if (
lhs.fRGB[1] <
rhs.fRGB[1])
2869 else if (
lhs.fRGB[1] >
rhs.fRGB[1])
2871 else if (
lhs.fRGB[2] <
rhs.fRGB[2])
2906 glColor3ub(it->second.fRGB[0], it->second.fRGB[1], it->second.fRGB[2]);
2908 Error(
"ObjectIDToColor",
"No color for such object ID: %d",
objectID);
2995const Int_t gBoxFrontQuads[][4] = {{0, 1, 2, 3}, {4, 0, 3, 5}, {4, 5, 6, 7}, {7, 6, 2, 1}};
2996const Double_t gBoxFrontNormals[][3] = {{-1., 0., 0.}, {0., -1., 0.}, {1., 0., 0.}, {0., 1., 0.}};
2999const Int_t gBoxBackQuads[][4] = {{7, 1, 2, 6}, {4, 7, 6, 5}, {0, 4, 5, 3}, {0, 3, 2, 1}};
3000const Double_t gBoxBackNormals[][3] = {{0., -1., 0.}, {-1., 0., 0.}, {0., 1., 0.}, {1., 0., 0.}};
3021 const Double_t box[][3] = {{
xMin,
yMin,
zMax}, {
xMin,
yMax,
zMax}, {
xMin,
yMax,
zMin}, {
xMin,
yMin,
zMin},
3022 {
xMax,
yMin,
zMax}, {
xMax,
yMin,
zMin}, {
xMax,
yMax,
zMin}, {
xMax,
yMax,
zMax}};
3074 const Double_t box[][3] = {{
xMin,
yMin,
zMax}, {
xMin,
yMax,
zMax}, {
xMin,
yMax,
zMin}, {
xMin,
yMin,
zMin},
3075 {
xMax,
yMin,
zMax}, {
xMax,
yMin,
zMin}, {
xMax,
yMax,
zMin}, {
xMax,
yMax,
zMax}};
3161 const Double_t box[][3] = {{
xMin,
yMin,
zMax}, {
xMin,
yMax,
zMax}, {
xMin,
yMax,
zMin}, {
xMin,
yMin,
zMin},
3162 {
xMax,
yMin,
zMax}, {
xMax,
yMin,
zMin}, {
xMax,
yMax,
zMin}, {
xMax,
yMax,
zMax}};
3199 assert(
rgba1 !=
nullptr &&
"DrawBoxWithGradientFill, parameter 'rgba1' is null");
3200 assert(
rgba2 !=
nullptr &&
"DrawBoxWithGradientFill, parameter 'rgba2' is null");
3220 "DrawQuadStripWithRadialGradientFill, invalid number of points");
3222 "DrawQuadStripWithRadialGradientFill, parameter 'inner' is null");
3224 "DrawQuadStripWithRadialGradientFill, parameter 'innerRGBA' is null");
3226 "DrawQuadStripWithRadialGradientFill, parameter 'outer' is null");
3228 "DrawQuadStripWithRadialGradientFill, parameter 'outerRGBA' is null");
3764 +
box[left].X() -
vp[0]));
3766 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3767 *
gPad->GetWh() +
vp[1]));
3769 +
box[fp].X() -
vp[0]));
3771 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3772 *
gPad->GetWh() +
vp[1]));
3774 *
gPad->GetWw() +
box[right].X() -
vp[0]));
3776 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3777 *
gPad->GetWh() +
vp[1]));
3779 {
coord->GetXRange().second,
coord->GetYRange().first },
3780 {
coord->GetXRange().second,
coord->GetYRange().second},
3781 {
coord->GetXRange().first,
coord->GetYRange().second}};
3811 +
box[left + 4].X() -
vp[0]));
3813 + (1 -
gPad->GetHNDC() -
gPad->GetYlowNDC())
3814 *
gPad->GetWh() +
vp[1]));
3824 Double_t binLow = 0., binHigh = 0., binWidth = 0.;
3828 for (
Int_t i = 0; i < nBins + 1; ++i)
3901 }
else if (
v < (
vmin + 0.5 *
dv)) {
3905 }
else if (
v < (
vmin + 0.75 *
dv)) {
3930 }
else if (
v < (
vmin + 2.0 *
dv / 6.0)) {
3934 }
else if (
v < (
vmin + 3.0 *
dv / 6.0)) {
3938 }
else if (
v < (
vmin + 4.0 *
dv / 6.0)) {
3942 }
else if (
v < (
vmin + 5.0 *
dv / 6.0)) {
3967 }
else if (
v < (
vmin + 0.5 *
dv)) {
3971 }
else if (
v < (
vmin + 0.75 *
dv)) {
3997 }
else if (
v < (
vmin + 2 *
dv / 3)) {
4012 }
else if (
v < (
vmin + 0.4 *
dv)) {
4016 }
else if (
v < (
vmin + 0.6 *
dv)) {
4020 }
else if (
v < (
vmin + 0.8 *
dv)) {
4031 c1[0] = 200 / 255.0;
c1[1] = 60 / 255.0;
c1[2] = 0 / 255.0;
4032 c2[0] = 250 / 255.0;
c2[1] = 160 / 255.0;
c2[2] = 110 / 255.0;
4038 c1[0] = 55 / 255.0;
c1[1] = 55 / 255.0;
c1[2] = 45 / 255.0;
4039 c2[0] = 200 / 255.0;
c2[1] = 60 / 255.0;
c2[2] = 0 / 255.0;
4040 c3[0] = 250 / 255.0;
c3[1] = 160 / 255.0;
c3[2] = 110 / 255.0;
4054 c1[0] = 0 / 255.0;
c1[1] = 255 / 255.0;
c1[2] = 0 / 255.0;
4055 c2[0] = 255 / 255.0;
c2[1] = 150 / 255.0;
c2[2] = 0 / 255.0;
4056 c3[0] = 255 / 255.0;
c3[1] = 250 / 255.0;
c3[2] = 240 / 255.0;
4079 }
else if (
v < (
vmin + 0.5 *
dv)) {
4083 }
else if (
v < (
vmin + 0.75 *
dv)) {
4126 c1[0] = 0 / 255.0;
c1[1] = 160 / 255.0;
c1[2] = 0 / 255.0;
4127 c2[0] = 180 / 255.0;
c2[1] = 220 / 255.0;
c2[2] = 0 / 255.0;
4128 c3[0] = 250 / 255.0;
c3[1] = 220 / 255.0;
c3[2] = 170 / 255.0;
4150 : fContours(nullptr),
4169 Error(
"TGLLevelPaletter::GeneratePalette",
4170 "Invalid palette size, must be a positive number");
4175 Error(
"TGLLevelPalette::GeneratePalette",
4176 "Number of contours %d is too big for GL 1D texture, try to reduce it to %d",
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char)
char Char_t
Character 1 byte (char)
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Bool_t operator<(const TDatime &d1, const TDatime &d2)
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
winID h TVirtualViewer3D TVirtualGLPainter p
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 const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char DrawLine
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
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 TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char y1
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TStyle * gStyle
const_iterator end() const
virtual Int_t GetNdivisions() const
virtual Float_t GetLabelOffset() const
virtual Float_t GetTickLength() const
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
Class to manage histogram axis.
virtual Bool_t GetTimeDisplay() const
const char * ChooseTimeFormat(Double_t axislength=0)
Choose a reasonable time format from the coordinates in the active pad and the number of divisions in...
virtual const char * GetTimeFormatOnly() const
Return only the time format from the string fTimeFormat.
virtual const char * GetTimeFormat() const
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
TGLVertex3 Center() const
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
~TGLCapabilityEnabler()
Destructor - reset state if changed.
TGLCapabilityEnabler(const TGLCapabilityEnabler &)
TGLCapabilitySwitch(const TGLCapabilitySwitch &)
~TGLCapabilitySwitch()
Destructor - reset state if changed.
Class encapsulating a set of colors used throughout standard rendering.
void StdLightBackground()
Set defaults for light (white) background.
TGLColorSet & operator=(const TGLColorSet &s)
Assignment operator.
void StdDarkBackground()
Set defaults for dark (black) background.
TGLColorSet()
Constructor. Sets default for dark background.
Class encapsulating color information in preferred GL format - an array of four unsigned bytes.
void SetTransparency(Char_t transparency)
Set alpha from the transparency.
const UChar_t * CArr() const
Char_t GetTransparency() const
Returns transparency value.
void SetColor(Int_t r, Int_t g, Int_t b, Int_t a=255)
Set color with Int_t values.
TGLColor()
Default constructor. Color is initialized to black.
TString AsString() const
Return string describing the color.
TGLColor & operator=(const TGLColor &c)
Assignment operator.
Color_t GetColorIndex() const
Returns color-index representing the color.
~TGLDisableGuard()
TGLDisableGuard destructor.
TGLDisableGuard(Int_t cap)
TGLDisableGuard constructor.
~TGLEnableGuard()
TGLEnableGuard destructor.
TGLEnableGuard(Int_t cap)
TGLEnableGuard constructor.
TGLFloatHolder(const TGLFloatHolder &)=delete
const UChar_t * GetColour(Double_t z) const
Get color.
const std::vector< Double_t > * fContours
Int_t GetPaletteSize() const
Get. Palette. Size.
void SetContours(const std::vector< Double_t > *contours)
Clear :)
std::vector< UChar_t > fTexels
void DisableTexture() const
Disable 1D texture.
Double_t GetTexCoord(Double_t z) const
Get tex coordinate.
Bool_t GeneratePalette(UInt_t paletteSize, const Rgl::Range_t &zRange, Bool_t checkSize=kTRUE)
Try to find colors for palette.
void EnableTexture(Int_t mode) const
Enable 1D texture.
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'.
TGLLine3(const TGLVertex3 &start, const TGLVertex3 &end)
Vector of line from fVertex.
const TGLVertex3 End() const
void Draw() const
Draw line in current basic GL color.
TGLVector3 fVector
Start vertex of line.
void Set(const TGLVertex3 &start, const TGLVertex3 &end)
Set 3D line running from 'start' to 'end'.
16 component (4x4) transform matrix - column MAJOR as per GL.
void MultLeft(const TGLMatrix &lhs)
Multiply with matrix lhs on left.
TGLVector3 Multiply(const TGLVector3 &v, Double_t w=1) const
Multiply vector.
void Scale(const TGLVector3 &scale)
Set matrix axis scales to 'scale'.
void RotateLF(Int_t i1, Int_t i2, Double_t amount)
Rotate in local frame.
Double_t Invert()
Invert the matrix, returns determinant.
void MoveLF(Int_t ai, Double_t amount)
Translate in local frame.
void SetIdentity()
Set matrix to identity.
void Transpose3x3()
Transpose the top left 3x3 matrix component along major diagonal Supported as currently incompatibili...
void RotatePF(Int_t i1, Int_t i2, Double_t amount)
Rotate in parent frame. Does optimised version of MultLeft.
void Move3LF(Double_t x, Double_t y, Double_t z)
Translate in local frame along all base vectors simultaneously.
void Rotate(const TGLVertex3 &pivot, const TGLVector3 &axis, Double_t angle)
Update matrix so resulting transform has been rotated about 'pivot' (in parent frame),...
virtual ~TGLMatrix()
Destroy matrix object.
TGLVector3 GetTranslation() const
Return the translation component of matrix.
void RotateIP(TGLVector3 &v) const
Rotate vector in-place. Translation is not applied.
Bool_t IsScalingForRender() const
Return true if matrix is to be considered a scaling matrix for rendering.
void TransformVertex(TGLVertex3 &vertex) const
Transform passed 'vertex' by this matrix - converts local frame to parent.
TGLVector3 GetScale() const
Get local axis scaling factors.
void MultRight(const TGLMatrix &rhs)
Multiply with matrix rhs on right.
void SetTranslation(Double_t x, Double_t y, Double_t z)
Set matrix translation components x,y,z.
void Set(const TGLVertex3 &origin, const TGLVector3 &zAxis, const TGLVector3 &xAxis=nullptr)
Set matrix which when applied puts local origin at 'origin' and the local Z axis in direction 'z'.
void MultiplyIP(TGLVector3 &v, Double_t w=1) const
Multiply vector in-place.
void Translate(const TGLVector3 &vect)
Shift matrix translation components by 'vect' in parent frame.
void Dump() const
Output 16 matrix components to std::cout.
TGLMatrix()
Construct default identity matrix:
3D plane class - of format Ax + By + Cz + D = 0
void Set(const TGLPlane &other)
Assign from other.
void Negate()
Negate the plane.
TGLVertex3 NearestOn(const TGLVertex3 &point) const
Return nearest point on plane.
TGLPlane & operator=(const TGLPlane &src)
Assignment operator.
void Normalise()
Normalise the plane.
TGLPlane()
Construct a default plane of x + y + z = 0.
Double_t DistanceTo(const TGLVertex3 &vertex) const
Distance from plane to vertex.
void Dump() const
Output plane equation to std::out.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
Wrapper class for GLU quadric shape drawing object.
Viewport (pixel base) 2D rectangle class.
TGLRect()
Positive width/height.
Int_t Diagonal() const
Return the diagonal of the rectangle.
Rgl::EOverlap Overlap(const TGLRect &other) const
Return overlap result (kInside, kOutside, kPartial) of this rect with 'other'.
virtual ~TGLRect()
Destroy rect object.
void Expand(Int_t x, Int_t y)
Expand the rect to encompass point (x,y)
const UChar_t * GetPixelColor(Int_t px, Int_t py) const
Get pixel color.
void ReadColorBuffer(Int_t width, Int_t height)
Read color buffer.
virtual ~TGLSelectionBuffer()
TGLSelectionBuffer destructor.
TGLSelectionBuffer()
TGLSelectionBuffer constructor.
std::vector< UChar_t > fBuffer
static void DrawSphere(const TGLVertex3 &position, Double_t radius, const UChar_t rgba[4])
Draw sphere, centered on vertex 'position', with radius 'radius', color 'rgba'.
static void Color4ubv(const UChar_t *rgba)
Wrapper for glColor4ubv.
static UInt_t GetDrawQuality()
static: get draw quality
static Int_t fgPickingRadius
static const UChar_t fgWhite[4]
static UInt_t fgDefaultDrawQuality
static void SetDrawQuality(UInt_t dq)
static: set draw quality
static Float_t GetPointSizeScale()
Get global point-size scale.
static void Color3f(Float_t r, Float_t g, Float_t b)
Wrapper for glColor3f.
static Float_t fgPointSize
static Float_t fgLineWidth
static Float_t fgScreenScalingFactor
static void ResetDrawQuality()
static: reset draw quality
static Float_t fgSimpleAxisWidthScale
static Float_t fgPointSizeScale
static Bool_t IsColorLocked()
Returns true if color lock-count is greater than 0.
static void Color3fv(const Float_t *rgb)
Wrapper for glColor3fv.
static void SetLineWidthScale(Float_t scale)
Set global line-width scale.
static void SetSimpleAxisWidthScale(Float_t s)
static UInt_t LockColor()
Prevent further color changes.
static void Color4f(Float_t r, Float_t g, Float_t b, Float_t a)
Wrapper for glColor4f.
static void SetDrawColors(const UChar_t rgba[4])
Set basic draw colors from 4 component 'rgba' Used by other TGLUtil drawing routines.
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
static void BeginAttLine(const TAttLine &aline, Char_t transp, Int_t pick_radius=0, Bool_t selection=kFALSE)
Setup drawing parameters according to passed TAttLine.
static const UChar_t fgRed[4]
static void RenderPolyLine(const TAttLine &aline, Char_t transp, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE)
Render poly-line as specified by the p-array.
static UInt_t GetDefaultDrawQuality()
static: get default draw quality
static void BeginExtendPickRegion(Float_t scale)
static void InitializeIfNeeded()
Initialize globals that require other libraries to be initialized.
static Float_t GetLineWidthScale()
Returns global line-width scale.
static Float_t fgPointLineScalingFactor
static UInt_t UnlockColor()
Allow color changes.
static void EndAttLine(Int_t pick_radius=0, Bool_t selection=kFALSE)
Restore previous line drawing state.
static void DrawLine(const TGLLine3 &line, ELineHeadShape head, Double_t size, const UChar_t rgba[4])
Draw thick line (tube) defined by 'line', with head at end shape 'head' - box/arrow/none,...
static void Color(const TGLColor &color)
Set color from TGLColor.
static void DrawReferenceMarker(const TGLCamera &camera, const TGLVertex3 &pos, Float_t radius=3, const UChar_t *rgba=nullptr)
Draw a sphere- marker on world-coordinate 'pos' with pixel radius 'radius'.
static void DrawRing(const TGLVertex3 ¢er, const TGLVector3 &normal, Double_t radius, const UChar_t *rgba)
Draw ring, centered on 'center', lying on plane defined by 'center' & 'normal' of outer radius 'radiu...
static void Color3ubv(const UChar_t *rgb)
Wrapper for glColor3ubv.
static Int_t CheckError(const char *loc)
Check current GL error state, outputting details via ROOT Error method if one.
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
static void ColorAlpha(const TGLColor &color, UChar_t alpha)
Set color from TGLColor and alpha value.
static Int_t GetPickingRadius()
Returns picking radius.
static void SetPointSizeScale(Float_t scale)
Set global point-size scale.
static void Color4fv(const Float_t *rgba)
Wrapper for glColor4fv.
static void Color3ub(UChar_t r, UChar_t g, UChar_t b)
Wrapper for glColor3ub.
static UInt_t fgDrawQuality
static GLUtesselator * GetDrawTesselator4dv()
Returns a tesselator for direct drawing when using 4-vertices with double precision.
static const UChar_t fgBlue[4]
static const UChar_t fgGrey[4]
static Float_t PointSize()
Get the point-size, taking the global scaling into account.
static void EndExtendPickRegion()
static GLUtesselator * GetDrawTesselator3dv()
Returns a tesselator for direct drawing when using 3-vertices with double precision.
static GLUtesselator * GetDrawTesselator4fv()
Returns a tesselator for direct drawing when using 4-vertices with single precision.
static Float_t fgSimpleAxisBBoxScale
static const UChar_t fgGreen[4]
static UInt_t fgColorLockCount
static GLUtesselator * GetDrawTesselator3fv()
Returns a tesselator for direct drawing when using 3-vertices with single precision.
static void DrawSimpleAxes(const TGLCamera &camera, const TGLBoundingBox &bbox, Int_t axesType, Float_t labelScale=1)
Draw simple xyz-axes for given bounding-box.
static void SetSimpleAxisBBoxScale(Float_t s)
static void SetDefaultDrawQuality(UInt_t dq)
static: set default draw quality
static void PointToViewport(Int_t &x, Int_t &y)
Convert from point/screen coordinates to GL viewport coordinates.
static void DrawNumber(const TString &num, const TGLVertex3 &pos, Bool_t center=kFALSE)
Draw number in string 'num' via internal 8x8-pixel bitmap on vertex 'pos'.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
static Float_t fgLineWidthScale
static void RenderPolyMarkers(const TAttMarker &marker, Char_t transp, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE)
Render polymarkers at points specified by p-array.
static const UChar_t fgYellow[4]
static void RenderPoints(const TAttMarker &marker, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE)
Render markers as circular or square points.
static Float_t GetPointLineScalingFactor()
Return extra scaling factor for points and lines.
static void Color4ub(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
Wrapper for glColor4ub.
static void RenderCrosses(const TAttMarker &marker, Float_t *p, Int_t n, Bool_t sec_selection=kFALSE)
Render markers as crosses.
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
void Dump() const
Output vertex component values to std::cout.
void Minimum(const TGLVertex3 &other)
void Maximum(const TGLVertex3 &other)
void Set(Double_t x, Double_t y, Double_t z)
TGLVertex3()
Construct a default (0.0, 0.0, 0.0) vertex.
void Shift(TGLVector3 &shift)
Offset a vertex by vector 'shift'.
const Double_t * CArr() const
~TGLVertex3()
Destroy vertex object.
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void DrawTrapezoid(const Double_t ver[][2], Double_t zMin, Double_t zMax, Bool_t color=kTRUE)
void DrawFaceTextured(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, Double_t t1, Double_t t2, Double_t t3, const TGLVector3 &norm1, const TGLVector3 &norm2, const TGLVector3 &norm3)
Draw textured triangle.
void DrawQuadStripWithRadialGradientFill(unsigned nPoints, const Double_t *inner, const Double_t *innerRGBA, const Double_t *outer, const Double_t *outerRGBA)
TODO: is it possible to use GLdouble to avoid problems with Double_t/GLdouble if they are not the sam...
void DrawQuadFilled(const TGLVertex3 &v0, const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &normal)
Draw quad face.
void DrawTrapezoidTextured(const Double_t ver[][2], Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax)
In polar coordinates, box became trapezoid.
const Float_t gNullEmission[]
const Int_t gFramePoints[][2]
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
const Float_t gBlueEmission[]
const Float_t gWhiteEmission[]
void SetZLevels(TAxis *zAxis, Double_t zMin, Double_t zMax, Double_t zScale, std::vector< Double_t > &zLevels)
void CylindricalNormalInv(const Double_t *v, Double_t *normal)
void DrawTrapezoidTextured2(const Double_t ver[][2], Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax)
In polar coordinates, box became trapezoid.
const Int_t gBoxFrontQuads[][4]
const Float_t gGrayEmission[]
void GetColor(Float_t v, Float_t vmin, Float_t vmax, Int_t type, Float_t *rgba)
This function creates color for parametric surface's vertex, using its 'u' value.
const Int_t gBoxBackQuads[][4]
void SphericalNormal(const Double_t *v, Double_t *normal)
void DrawCylinder(TGLQuadric *quadric, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Cylinder for lego3.
const Int_t gAxisType[][2]
void DrawError(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
void SphericalNormalInv(const Double_t *v, Double_t *normal)
const Float_t gRedEmission[]
const Int_t gBoxBackPlanes[][2]
void DrawTransparentBox(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Int_t fp)
Draws lego's bar as a 3d box.
std::pair< Double_t, Double_t > Range_t
void DrawBoxFront(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Int_t fp)
Draws lego's bar as a 3d box.
const Double_t gBoxFrontNormals[][3]
const Float_t gGreenEmission[]
void CylindricalNormal(const Double_t *v, Double_t *normal)
void DrawQuadOutline(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVertex3 &v4)
Draw quad outline.
void DrawBoxWithGradientFill(Double_t y1, Double_t y2, Double_t x1, Double_t x2, const Double_t *rgba1, const Double_t *rgba2)
void DrawSphere(TGLQuadric *quadric, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Cylinder for lego3.
void DrawBoxFrontTextured(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax, Int_t front)
Draws lego's bar as a 3d box LULULULU.
void DrawSmoothFace(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &norm1, const TGLVector3 &norm2, const TGLVector3 &norm3)
Draws triangle face, each vertex has its own averaged normal.
const Double_t gBoxBackNormals[][3]
const Float_t gOrangeEmission[]
void Draw2DAxis(TAxis *axis, Double_t xMin, Double_t yMin, Double_t xMax, Double_t yMax, Double_t min, Double_t max, Bool_t log, Bool_t z=kFALSE)
Int_t ColorToObjectID(const UChar_t *color, Bool_t highColor)
const Int_t gBoxFrontPlanes[][2]
void DrawAxes(Int_t frontPoint, const Int_t *viewport, const TGLVertex3 *box2D, const TGLPlotCoordinates *plotCoord, TAxis *xAxis, TAxis *yAxis, TAxis *zAxis)
Using front point, find, where to draw axes and which labels to use for them gVirtualX->SelectWindow(...
T * Normal2Plane(const T v1[3], const T v2[3], const T v3[3], T normal[3])
Calculates a normal vector of a plane.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.