146 fVals[0] = -fVals[0];
147 fVals[1] = -fVals[1];
148 fVals[2] = -fVals[2];
154 return (fVals[0] == rhs.
fVals[0] && fVals[1] == rhs.
fVals[1] && fVals[2] == rhs.
fVals[2]);
172 return TGLVertex3(-fVals[0], -fVals[1], -fVals[2]);
231 fVals[0]=other.
fVals[0];
232 fVals[1]=other.
fVals[1];
233 fVals[2]=other.
fVals[2];
260 { fVals[0] = v[0]; fVals[1] = v[1]; fVals[2] = v[2];
return *
this; }
275 fVals[0] -= vec[0]; fVals[1] -= vec[1]; fVals[2] -= vec[2];
283 fVals[0] += vec[0]; fVals[1] += vec[1]; fVals[2] += vec[2];
299 return TGLVector3(-fVals[0], -fVals[1], -fVals[2]);
305 return std::sqrt(fVals[0]*fVals[0] + fVals[1]*fVals[1] + fVals[2]*fVals[2]);
313 Error(
"TGLVector3::Normalise",
"vector has zero magnitude");
324 return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
331 v1[2]*v2[0] - v2[2]*v1[0],
332 v1[0]*v2[1] - v2[0]*v1[1]);
338 return TGLVector3(vec[0] / val, vec[1] / val, vec[2] / val);
344 return TGLVector3(vec[0] * val, vec[1] * val, vec[2] * val);
351 return TGLVertex3(vertex1[0] + vertex2[0], vertex1[1] + vertex2[1], vertex1[2] + vertex2[2]);
358 return TGLVector3(vertex1[0] - vertex2[0], vertex1[1] - vertex2[1], vertex1[2] - vertex2[2]);
365 return TGLVector3(vector1[0] + vector2[0], vector1[1] + vector2[1], vector1[2] + vector2[2]);
372 return TGLVector3(vector1[0] - vector2[0], vector1[1] - vector2[1], vector1[2] - vector2[2]);
379 return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
466 Int_t Diagonal()
const;
467 Int_t Longest()
const;
501 return fWidth > fHeight ? fWidth : fHeight;
511 return static_cast<Double_t>(fWidth) / static_cast<Double_t>(fHeight);
634 void SetTranslation(
const TGLVertex3 & translation);
651 Bool_t IsScalingForRender()
const;
712 res[ 0] = rhs[ 0] * lhs[ 0] + rhs[ 1] * lhs[ 4] + rhs[ 2] * lhs[ 8] + rhs[ 3] * lhs[12];
713 res[ 1] = rhs[ 0] * lhs[ 1] + rhs[ 1] * lhs[ 5] + rhs[ 2] * lhs[ 9] + rhs[ 3] * lhs[13];
714 res[ 2] = rhs[ 0] * lhs[ 2] + rhs[ 1] * lhs[ 6] + rhs[ 2] * lhs[10] + rhs[ 3] * lhs[14];
715 res[ 3] = rhs[ 0] * lhs[ 3] + rhs[ 1] * lhs[ 7] + rhs[ 2] * lhs[11] + rhs[ 3] * lhs[15];
717 res[ 4] = rhs[ 4] * lhs[ 0] + rhs[ 5] * lhs[ 4] + rhs[ 6] * lhs[ 8] + rhs[ 7] * lhs[12];
718 res[ 5] = rhs[ 4] * lhs[ 1] + rhs[ 5] * lhs[ 5] + rhs[ 6] * lhs[ 9] + rhs[ 7] * lhs[13];
719 res[ 6] = rhs[ 4] * lhs[ 2] + rhs[ 5] * lhs[ 6] + rhs[ 6] * lhs[10] + rhs[ 7] * lhs[14];
720 res[ 7] = rhs[ 4] * lhs[ 3] + rhs[ 5] * lhs[ 7] + rhs[ 6] * lhs[11] + rhs[ 7] * lhs[15];
722 res[ 8] = rhs[ 8] * lhs[ 0] + rhs[ 9] * lhs[ 4] + rhs[10] * lhs[ 8] + rhs[11] * lhs[12];
723 res[ 9] = rhs[ 8] * lhs[ 1] + rhs[ 9] * lhs[ 5] + rhs[10] * lhs[ 9] + rhs[11] * lhs[13];
724 res[10] = rhs[ 8] * lhs[ 2] + rhs[ 9] * lhs[ 6] + rhs[10] * lhs[10] + rhs[11] * lhs[14];
725 res[11] = rhs[ 8] * lhs[ 3] + rhs[ 9] * lhs[ 7] + rhs[10] * lhs[11] + rhs[11] * lhs[15];
727 res[12] = rhs[12] * lhs[ 0] + rhs[13] * lhs[ 4] + rhs[14] * lhs[ 8] + rhs[15] * lhs[12];
728 res[13] = rhs[12] * lhs[ 1] + rhs[13] * lhs[ 5] + rhs[14] * lhs[ 9] + rhs[15] * lhs[13];
729 res[14] = rhs[12] * lhs[ 2] + rhs[13] * lhs[ 6] + rhs[14] * lhs[10] + rhs[15] * lhs[14];
730 res[15] = rhs[12] * lhs[ 3] + rhs[13] * lhs[ 7] + rhs[14] * lhs[11] + rhs[15] * lhs[15];
739 C[0] =
x; C[1] =
y; C[2] =
z;
746 C[0] = v[0]; C[1] = v[1]; C[2] = v[2];
753 C[0] = x[0]; C[1] = x[1]; C[2] = x[2];
766 v[0] = C[0]; v[1] = C[1]; v[2] = C[2];
773 x[0] = C[0], x[1] = C[1], x[2] = C[2];
811 Char_t GetTransparency()
const;
820 void SetColor(
Color_t color_index);
822 void SetTransparency(
Char_t transparency);
865 void StdDarkBackground();
866 void StdLightBackground();
897 fOldQuality(GetDrawQuality()) {SetDrawQuality(dq); }
900 { SetDrawQuality(fOldQuality); }
910 fOldQuality(GetDrawQuality()) {SetDrawQuality((
Int_t)(fac*fOldQuality)); }
913 { SetDrawQuality(fOldQuality); }
938 static void InitializeIfNeeded();
941 static Int_t CheckError(
const char * loc);
944 static GLUtesselator* GetDrawTesselator3fv();
945 static GLUtesselator* GetDrawTesselator4fv();
946 static GLUtesselator* GetDrawTesselator3dv();
947 static GLUtesselator* GetDrawTesselator4dv();
953 static UInt_t GetDrawQuality();
954 static void SetDrawQuality(
UInt_t dq);
955 static void ResetDrawQuality();
956 static UInt_t GetDefaultDrawQuality();
957 static void SetDefaultDrawQuality(
UInt_t dq);
959 static UInt_t LockColor();
960 static UInt_t UnlockColor();
961 static Bool_t IsColorLocked();
967 static void ColorTransparency(
Color_t color_index,
Char_t transparency=0);
970 static void Color3ubv(
const UChar_t* rgb);
971 static void Color4ubv(
const UChar_t* rgba);
974 static void Color3fv(
const Float_t* rgb);
975 static void Color4fv(
const Float_t* rgba);
980 static Float_t GetScreenScalingFactor();
981 static Float_t GetPointLineScalingFactor();
982 static Int_t GetPickingRadius();
984 static Float_t GetPointSizeScale();
985 static void SetPointSizeScale(
Float_t scale);
986 static Float_t GetLineWidthScale();
987 static void SetLineWidthScale(
Float_t scale);
989 static void PointSize(
Float_t point_size);
995 static void BeginExtendPickRegion(
Float_t scale);
996 static void EndExtendPickRegion();
1003 static void RenderPolyMarkers(
const TAttMarker &marker,
const std::vector<Double_t> &
points,
1006 static void RenderPoints(
const TAttMarker& marker,
1011 static void RenderPoints(
const TAttMarker& marker,
1012 const std::vector<Double_t> &points);
1014 static void RenderCrosses(
const TAttMarker& marker,
1018 static void RenderCrosses(
const TAttMarker& marker,
1019 const std::vector<Double_t> &points,
1031 static void SetDrawColors(
const UChar_t rgba[4]);
1039 static void DrawReferenceMarker(
const TGLCamera & camera,
1043 static void DrawSimpleAxes(
const TGLCamera & camera,
1046 static void DrawNumber(
const TString & num,
1144 void ReadColorBuffer(
Int_t width,
Int_t height);
1172 const T *operator [] (size_type ind)
const 1174 return &std::vector<T>::operator [](ind * fRowLen);
1176 T *operator [] (size_type ind)
1178 return &std::vector<T>::operator [] (ind * fRowLen);
1254 Double_t zScale, std::vector<Double_t> &zLevels);
1291 template<
class Func,
class Arg>
1308 template<
class Func,
class Arg1,
class Arg2>
1317 : fFunc(f), fArg1(a1), fArg2(a2)
1323 fFunc(fArg1, fArg2);
1327 template<
class Func,
class Arg>
1333 template<
class Func,
class Arg1,
class Arg2>
1358 void SetContours(
const std::vector<Double_t> *contours);
1360 void EnableTexture(
Int_t mode)
const;
1361 void DisableTexture()
const;
1363 Int_t GetPaletteSize()
const;
1371 #endif // ROOT_TGLUtil
static UInt_t fgDefaultDrawQuality
std::vector< T >::size_type size_type
void SetZLevels(TAxis *zAxis, Double_t zMin, Double_t zMax, Double_t zScale, std::vector< Double_t > &zLevels)
RooCmdArg Offset(Bool_t flag=kTRUE)
void SetRowLen(Int_t len)
std::vector< UChar_t > fTexels
const UChar_t * CArr() const
TDrawQualityModifier(Int_t dq)
Class encapsulating a set of colors used throughout standard rendering.
int Invert(LASymMatrix &)
static UInt_t fgColorLockCount
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 DrawQuadFilled(const TGLVertex3 &v0, const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &normal)
Draw quad face.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
TGLVertex3 operator*(Double_t f, const TGLVertex3 &v)
static double p3(double t, double a, double b, double c, double d)
Wrapper class for various misc static functions - error checking, draw helpers etc.
const Double_t * CArr() const
const Float_t gNullEmission[]
const TGLColor & Selection(Int_t i) const
const TGLVertex3 & operator+=(const TGLVector3 &val)
void SetBaseVec(Int_t b, Double_t x, Double_t y, Double_t z)
TGLVertex3 operator-() const
std::pair< Double_t, Double_t > Range_t
const TGLVector3 operator/(const TGLVector3 &vec, Double_t val)
16 component (4x4) transform matrix - column MAJOR as per GL.
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...
Class encapsulating color information in preferred GL format - an array of four unsigned bytes...
const Double_t * CArr() const
T Mag(const SVector< T, D > &rhs)
Vector magnitude (Euclidian norm) Compute : .
TGLMatrix & operator*=(const TGLMatrix &rhs)
std::vector< TGLPlane >::const_iterator TGLPlaneSet_ci
TGLVector3 operator-(const TGLVertex3 &vertex1, const TGLVertex3 &vertex2)
const Float_t gBlueEmission[]
Double_t & operator[](Int_t index)
const T Minimum(const T &lhs, const T &rhs)
minimum.
void DrawBoxWithGradientFill(Double_t y1, Double_t y2, Double_t x1, Double_t x2, const Double_t *rgba1, const Double_t *rgba2)
Wrapper class for GLU quadric shape drawing object.
const T Maximum(const T &lhs, const T &rhs)
maximum.
void Offset(Int_t dX, Int_t dY)
void Set(Double_t x, Double_t y, Double_t z)
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(...
void DrawQuadOutline(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVertex3 &v4)
Draw quad outline.
TGLVector3 operator-() const
static const double x2[5]
const Float_t gWhiteEmission[]
#define ClassDef(name, id)
const TGLVertex3 & operator-=(const TGLVector3 &val)
RooCmdArg Color(Color_t color)
TGLVector3 fVector
Start vertex of line.
3 component (x/y/z) vertex class.
TGLVertex3 & operator=(const TGLVertex3 &rhs)
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 TGLColor & Markup() const
static double p2(double t, double a, double b, double c)
static Int_t fgPickingRadius
Viewport (pixel base) 2D rectangle class.
std::vector< UChar_t > fBuffer
3 component (x/y/z) vector class.
std::vector< TGLPlane >::iterator TGLPlaneSet_i
static UInt_t fgDrawQuality
void Error(const char *location, const char *msgfmt,...)
Int_t ColorToObjectID(const UChar_t *color, Bool_t highColor)
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
TGLVector3 GetBaseVec(Int_t b) const
static Float_t fgLineWidth
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.
static Float_t fgPointSizeScale
void DrawError(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
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.
Class to manage histogram axis.
IParamFunction interface (abstract class) describing multi-dimensional parameteric functions It is a ...
const Float_t gGreenEmission[]
const Float_t gRedEmission[]
TOneArgGuard< Func, Arg > make_guard(Func f, Arg a)
std::pair< Int_t, Int_t > BinRange_t
TDrawQualityScaler(Float_t fac)
const TGLVertex3 & Start() const
const Float_t gGrayEmission[]
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
const TGLColor & Background() const
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'...
static double p1(double t, double a, double b)
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.
Bool_t operator==(const TGLVertex3 &rhs) const
lv DrawLine(0.33, 0.0, 0.33, 1.0)
Vector Rotate(const Vector &v, const RotationMatrix &rot)
rotation on a generic vector using a generic rotation class.
const Int_t * CArr() const
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
static Float_t fgPointLineScalingFactor
const TGLVertex3 End() const
static const double x1[5]
std::vector< TGLPlane > TGLPlaneSet_t
Double_t & operator[](Int_t index)
static Float_t fgScreenScalingFactor
void SetCorner(Int_t x, Int_t y)
Bool_t ValidIndex(UInt_t index) const
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.
TGLVertex3 operator+(const TGLVertex3 &vertex1, const TGLVector3 &vertex2)
RooCmdArg LineWidth(Width_t width)
void DrawTrapezoid(const Double_t ver[][2], Double_t zMin, Double_t zMax, Bool_t color=kTRUE)
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.
const TGLVector3 & Vector() const
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
you should not use this method at all Int_t Int_t z
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. ...
TTwoArgsGuard(Func f, Arg1 a1, Arg2 a2)
typedef void((*Func_t)())
TGLColor & Selection(Int_t i)
Bool_t operator==(const TDatime &d1, const TDatime &d2)
virtual ~TDrawQualityModifier()
TGLVector3 & operator/=(Double_t val)
TGLVertex3 & operator*=(Double_t f)
TGLMatrix & operator=(const TGLMatrix &rhs)
static Float_t fgLineWidthScale
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
const TGLColor & Foreground() const
void SetMaxRow(Int_t max)
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
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.
static Float_t fgPointSize
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.
double norm(double *x, double *p)
3D plane class - of format Ax + By + Cz + D = 0
const Float_t gOrangeEmission[]
virtual ~TDrawQualityScaler()
const Double_t * CArr() const
Bool_t ValidIndex(UInt_t index) const
TGuardBase(const TGuardBase &rhs)
void Set(Int_t x, Int_t y, Int_t width, Int_t height)
TOneArgGuard(Func f, Arg a)
const std::vector< Double_t > * fContours
const TGLColor & Outline() const
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.