142 fVals[0] = -fVals[0];
143 fVals[1] = -fVals[1];
144 fVals[2] = -fVals[2];
150 return (fVals[0] == rhs.
fVals[0] && fVals[1] == rhs.
fVals[1] && fVals[2] == rhs.
fVals[2]);
168 return TGLVertex3(-fVals[0], -fVals[1], -fVals[2]);
227 fVals[0]=other.
fVals[0];
228 fVals[1]=other.
fVals[1];
229 fVals[2]=other.
fVals[2];
256 { fVals[0] = v[0]; fVals[1] = v[1]; fVals[2] = v[2];
return *
this; }
271 fVals[0] -= vec[0]; fVals[1] -= vec[1]; fVals[2] -= vec[2];
279 fVals[0] += vec[0]; fVals[1] += vec[1]; fVals[2] += vec[2];
295 return TGLVector3(-fVals[0], -fVals[1], -fVals[2]);
301 return std::sqrt(fVals[0]*fVals[0] + fVals[1]*fVals[1] + fVals[2]*fVals[2]);
309 Error(
"TGLVector3::Normalise",
"vector has zero magnitude");
320 return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
327 v1[2]*v2[0] - v2[2]*v1[0],
328 v1[0]*v2[1] - v2[0]*v1[1]);
334 return TGLVector3(vec[0] / val, vec[1] / val, vec[2] / val);
340 return TGLVector3(vec[0] * val, vec[1] * val, vec[2] * val);
347 return TGLVertex3(vertex1[0] + vertex2[0], vertex1[1] + vertex2[1], vertex1[2] + vertex2[2]);
354 return TGLVector3(vertex1[0] - vertex2[0], vertex1[1] - vertex2[1], vertex1[2] - vertex2[2]);
361 return TGLVector3(vector1[0] + vector2[0], vector1[1] + vector2[1], vector1[2] + vector2[2]);
368 return TGLVector3(vector1[0] - vector2[0], vector1[1] - vector2[1], vector1[2] - vector2[2]);
375 return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
462 Int_t Diagonal()
const;
463 Int_t Longest()
const;
497 return fWidth > fHeight ? fWidth : fHeight;
507 return static_cast<Double_t>(fWidth) / static_cast<Double_t>(fHeight);
630 void SetTranslation(
const TGLVertex3 & translation);
647 Bool_t IsScalingForRender()
const;
708 res[ 0] = rhs[ 0] * lhs[ 0] + rhs[ 1] * lhs[ 4] + rhs[ 2] * lhs[ 8] + rhs[ 3] * lhs[12];
709 res[ 1] = rhs[ 0] * lhs[ 1] + rhs[ 1] * lhs[ 5] + rhs[ 2] * lhs[ 9] + rhs[ 3] * lhs[13];
710 res[ 2] = rhs[ 0] * lhs[ 2] + rhs[ 1] * lhs[ 6] + rhs[ 2] * lhs[10] + rhs[ 3] * lhs[14];
711 res[ 3] = rhs[ 0] * lhs[ 3] + rhs[ 1] * lhs[ 7] + rhs[ 2] * lhs[11] + rhs[ 3] * lhs[15];
713 res[ 4] = rhs[ 4] * lhs[ 0] + rhs[ 5] * lhs[ 4] + rhs[ 6] * lhs[ 8] + rhs[ 7] * lhs[12];
714 res[ 5] = rhs[ 4] * lhs[ 1] + rhs[ 5] * lhs[ 5] + rhs[ 6] * lhs[ 9] + rhs[ 7] * lhs[13];
715 res[ 6] = rhs[ 4] * lhs[ 2] + rhs[ 5] * lhs[ 6] + rhs[ 6] * lhs[10] + rhs[ 7] * lhs[14];
716 res[ 7] = rhs[ 4] * lhs[ 3] + rhs[ 5] * lhs[ 7] + rhs[ 6] * lhs[11] + rhs[ 7] * lhs[15];
718 res[ 8] = rhs[ 8] * lhs[ 0] + rhs[ 9] * lhs[ 4] + rhs[10] * lhs[ 8] + rhs[11] * lhs[12];
719 res[ 9] = rhs[ 8] * lhs[ 1] + rhs[ 9] * lhs[ 5] + rhs[10] * lhs[ 9] + rhs[11] * lhs[13];
720 res[10] = rhs[ 8] * lhs[ 2] + rhs[ 9] * lhs[ 6] + rhs[10] * lhs[10] + rhs[11] * lhs[14];
721 res[11] = rhs[ 8] * lhs[ 3] + rhs[ 9] * lhs[ 7] + rhs[10] * lhs[11] + rhs[11] * lhs[15];
723 res[12] = rhs[12] * lhs[ 0] + rhs[13] * lhs[ 4] + rhs[14] * lhs[ 8] + rhs[15] * lhs[12];
724 res[13] = rhs[12] * lhs[ 1] + rhs[13] * lhs[ 5] + rhs[14] * lhs[ 9] + rhs[15] * lhs[13];
725 res[14] = rhs[12] * lhs[ 2] + rhs[13] * lhs[ 6] + rhs[14] * lhs[10] + rhs[15] * lhs[14];
726 res[15] = rhs[12] * lhs[ 3] + rhs[13] * lhs[ 7] + rhs[14] * lhs[11] + rhs[15] * lhs[15];
735 C[0] =
x; C[1] =
y; C[2] =
z;
742 C[0] = v[0]; C[1] = v[1]; C[2] = v[2];
749 C[0] = x[0]; C[1] = x[1]; C[2] = x[2];
762 v[0] = C[0]; v[1] = C[1]; v[2] = C[2];
769 x[0] = C[0], x[1] = C[1], x[2] = C[2];
807 Char_t GetTransparency()
const;
816 void SetColor(
Color_t color_index);
818 void SetTransparency(
Char_t transparency);
861 void StdDarkBackground();
862 void StdLightBackground();
893 fOldQuality(GetDrawQuality()) {SetDrawQuality(dq); }
896 { SetDrawQuality(fOldQuality); }
906 fOldQuality(GetDrawQuality()) {SetDrawQuality((
Int_t)(fac*fOldQuality)); }
909 { SetDrawQuality(fOldQuality); }
934 static void InitializeIfNeeded();
937 static Int_t CheckError(
const char * loc);
940 static GLUtesselator* GetDrawTesselator3fv();
941 static GLUtesselator* GetDrawTesselator4fv();
942 static GLUtesselator* GetDrawTesselator3dv();
943 static GLUtesselator* GetDrawTesselator4dv();
949 static UInt_t GetDrawQuality();
950 static void SetDrawQuality(
UInt_t dq);
951 static void ResetDrawQuality();
952 static UInt_t GetDefaultDrawQuality();
953 static void SetDefaultDrawQuality(
UInt_t dq);
955 static UInt_t LockColor();
956 static UInt_t UnlockColor();
957 static Bool_t IsColorLocked();
963 static void ColorTransparency(
Color_t color_index,
Char_t transparency=0);
966 static void Color3ubv(
const UChar_t* rgb);
967 static void Color4ubv(
const UChar_t* rgba);
970 static void Color3fv(
const Float_t* rgb);
971 static void Color4fv(
const Float_t* rgba);
976 static Float_t GetScreenScalingFactor();
977 static Float_t GetPointLineScalingFactor();
978 static Int_t GetPickingRadius();
980 static Float_t GetPointSizeScale();
981 static void SetPointSizeScale(
Float_t scale);
982 static Float_t GetLineWidthScale();
983 static void SetLineWidthScale(
Float_t scale);
985 static void PointSize(
Float_t point_size);
991 static void BeginExtendPickRegion(
Float_t scale);
992 static void EndExtendPickRegion();
999 static void RenderPolyMarkers(
const TAttMarker &marker,
const std::vector<Double_t> &
points,
1002 static void RenderPoints(
const TAttMarker& marker,
1007 static void RenderPoints(
const TAttMarker& marker,
1008 const std::vector<Double_t> &points);
1010 static void RenderCrosses(
const TAttMarker& marker,
1014 static void RenderCrosses(
const TAttMarker& marker,
1015 const std::vector<Double_t> &points,
1027 static void SetDrawColors(
const UChar_t rgba[4]);
1035 static void DrawReferenceMarker(
const TGLCamera & camera,
1039 static void DrawSimpleAxes(
const TGLCamera & camera,
1042 static void DrawNumber(
const TString & num,
1140 void ReadColorBuffer(
Int_t width,
Int_t height);
1168 const T *operator [] (size_type ind)
const 1170 return &std::vector<T>::operator [](ind * fRowLen);
1172 T *operator [] (size_type ind)
1174 return &std::vector<T>::operator [] (ind * fRowLen);
1250 Double_t zScale, std::vector<Double_t> &zLevels);
1287 template<
class Func,
class Arg>
1304 template<
class Func,
class Arg1,
class Arg2>
1313 : fFunc(f), fArg1(a1), fArg2(a2)
1319 fFunc(fArg1, fArg2);
1323 template<
class Func,
class Arg>
1329 template<
class Func,
class Arg1,
class Arg2>
1354 void SetContours(
const std::vector<Double_t> *contours);
1356 void EnableTexture(
Int_t mode)
const;
1357 void DisableTexture()
const;
1359 Int_t GetPaletteSize()
const;
1367 #endif // ROOT_TGLUtil
static UInt_t fgDefaultDrawQuality
const TGLColor & Outline() const
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
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 Float_t gNullEmission[]
const TGLVertex3 & operator+=(const TGLVector3 &val)
void SetBaseVec(Int_t b, Double_t x, Double_t y, Double_t z)
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...
T Mag(const SVector< T, D > &rhs)
Vector magnitude (Euclidian norm) Compute : .
TGLMatrix & operator*=(const TGLMatrix &rhs)
const TGLColor & Selection(Int_t i) const
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 TGLVertex3 & Start() const
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)
Bool_t ValidIndex(UInt_t index) const
Wrapper class for GLU quadric shape drawing object.
const T Maximum(const T &lhs, const T &rhs)
maximum.
TGLVector3 operator-() const
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.
TGLVertex3 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)
const UChar_t * CArr() const
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.
static double p2(double t, double a, double b, double c)
Bool_t ValidIndex(UInt_t index) const
static Int_t fgPickingRadius
Viewport (pixel base) 2D rectangle class.
std::vector< UChar_t > fBuffer
const TGLVertex3 End() const
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,...)
const Double_t * CArr() const
Int_t ColorToObjectID(const UChar_t *color, Bool_t highColor)
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
const TGLColor & Markup() 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)
Bool_t operator==(const TGLVertex3 &rhs) const
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.
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 Float_t gGrayEmission[]
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
const Double_t * CArr() const
const TGLColor & Background() const
const TGLVector3 & Vector() 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.
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.
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
static Float_t fgPointLineScalingFactor
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)
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)
const TGLColor & Foreground() const
Binding & operator=(OUT(*fun)(void))
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.
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. ...
const Double_t * CArr() const
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
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.
def normal(shape, name=None)
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[]
static void Fill(TTree *tree, int init, int count)
virtual ~TDrawQualityScaler()
TGuardBase(const TGuardBase &rhs)
void Set(Int_t x, Int_t y, Int_t width, Int_t height)
TOneArgGuard(Func f, Arg a)
TGLVector3 GetBaseVec(Int_t b) const
const std::vector< Double_t > * fContours
const Int_t * CArr() const
std::string & operator+=(std::string &left, const TString &right)
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.