Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLUtil.h File Reference
#include "Rtypes.h"
#include "TError.h"
#include <vector>
#include <cmath>
#include <cassert>
#include <utility>
Include dependency graph for TGLUtil.h:
This graph shows which files directly or indirectly include this file:

Classes

class  TGLUtil::TColorLocker
 
class  TGLUtil::TDrawQualityModifier
 
class  TGLUtil::TDrawQualityScaler
 
class  TGL2DArray< T >
 
class  TGLCapabilityEnabler
 
class  TGLCapabilitySwitch
 
class  TGLColor
 Class encapsulating color information in preferred GL format - an array of four unsigned bytes. More...
 
class  TGLColorSet
 Class encapsulating a set of colors used throughout standard rendering. More...
 
class  TGLDisableGuard
 
class  TGLEnableGuard
 
class  TGLFloatHolder
 
class  TGLLevelPalette
 
class  TGLLine3
 3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'. More...
 
class  TGLMatrix
 16 component (4x4) transform matrix - column MAJOR as per GL. More...
 
class  TGLPlane
 3D plane class - of format Ax + By + Cz + D = 0 More...
 
class  TGLRect
 Viewport (pixel base) 2D rectangle class. More...
 
class  TGLSelectionBuffer
 
class  TGLUtil
 Wrapper class for various misc static functions - error checking, draw helpers etc. More...
 
class  TGLVector3
 3 component (x/y/z) vector class. More...
 
class  TGLVertex3
 3 component (x/y/z) vertex class. More...
 
class  Rgl::TGuardBase
 
class  Rgl::TOneArgGuard< Func, Arg >
 
class  Rgl::TTwoArgsGuard< Func, Arg1, Arg2 >
 

Namespaces

namespace  Rgl
 

Typedefs

typedef std::pair< Int_t, Int_tRgl::BinRange_t
 
typedef std::pair< Double_t, Double_tRgl::Range_t
 
typedef std::vector< TGLPlane >::const_iterator TGLPlaneSet_ci
 
typedef std::vector< TGLPlane >::iterator TGLPlaneSet_i
 
typedef std::vector< TGLPlaneTGLPlaneSet_t
 

Enumerations

enum  EGLCoordType { kGLCartesian , kGLPolar , kGLCylindrical , kGLSpherical }
 
enum  EGLPlotType {
  kGLLegoPlot , kGLSurfacePlot , kGLBoxPlot , kGLTF3Plot ,
  kGLStackPlot , kGLParametricPlot , kGLIsoPlot , kGL5D ,
  kGLTH3Composition , kGLVoxel , kGLDefaultPlot
}
 
enum  Rgl::EOverlap { Rgl::kInside = 0 , Rgl::kPartial , Rgl::kOutside }
 

Functions

Int_t Rgl::ColorToObjectID (const UChar_t *color, Bool_t highColor)
 
TGLVector3 Cross (const TGLVector3 &v1, const TGLVector3 &v2)
 
Double_t Dot (const TGLVector3 &v1, const TGLVector3 &v2)
 
void Rgl::DrawAxes (Int_t fp, const Int_t *vp, const TGLVertex3 *box, const TGLPlotCoordinates *coord, TAxis *xAxis, TAxis *yAxis, TAxis *zAxis)
 Using front point, find, where to draw axes and which labels to use for them gVirtualX->SelectWindow(gGLManager->GetVirtualXInd(fGLDevice)); gVirtualX->SetDrawMode(TVirtualX::kCopy);//TCanvas by default sets in kInverse.
 
void Rgl::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.
 
void Rgl::DrawBoxFrontTextured (Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Double_t texMin, Double_t texMax, Int_t fp)
 Draws lego's bar as a 3d box LULULULU.
 
void Rgl::DrawBoxWithGradientFill (Double_t y1, Double_t y2, Double_t x1, Double_t x2, const Double_t *rgba1, const Double_t *rgba2)
 
void Rgl::DrawCylinder (TGLQuadric *quadric, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
 Cylinder for lego3.
 
void Rgl::DrawError (Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
 
void Rgl::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 Rgl::DrawFaceTextured (const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, Double_t t1, Double_t t2, Double_t t3, Double_t z, const TGLVector3 &normal)
 Draw textured triangle on a plane.
 
void Rgl::DrawQuadFilled (const Double_t *v0, const Double_t *v1, const Double_t *v2, const Double_t *v3, const Double_t *normal)
 Draw quad face.
 
void Rgl::DrawQuadFilled (const TGLVertex3 &v0, const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &normal)
 Draw quad face.
 
void Rgl::DrawQuadOutline (const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVertex3 &v4)
 Draw quad outline.
 
void Rgl::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 same type?
 
void Rgl::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.
 
void Rgl::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 Rgl::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.
 
void Rgl::DrawTrapezoid (const Double_t ver[][2], Double_t zMin, Double_t zMax, Bool_t color=kTRUE)
 
void Rgl::DrawTrapezoid (const Double_t ver[][3])
 
void Rgl::DrawTrapezoidTextured (const Double_t ver[][2], Double_t zMin, Double_t zMax, Double_t texMin, Double_t texMax)
 In polar coordinates, box became trapezoid.
 
void Rgl::DrawTrapezoidTextured (const Double_t ver[][3], Double_t texMin, Double_t texMax)
 
void Rgl::DrawTrapezoidTextured2 (const Double_t ver[][2], Double_t zMin, Double_t zMax, Double_t texMin, Double_t texMax)
 In polar coordinates, box became trapezoid.
 
void Rgl::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.
 
std::pair< Bool_t, TGLLine3Intersection (const TGLPlane &p1, const TGLPlane &p2)
 Find 3D line interestion of this plane with 'other'.
 
std::pair< Bool_t, TGLVertex3Intersection (const TGLPlane &p1, const TGLPlane &p2, const TGLPlane &p3)
 
std::pair< Bool_t, TGLVertex3Intersection (const TGLPlane &plane, const TGLLine3 &line, Bool_t extend)
 Find intersection of 3D space 'line' with this plane.
 
template<class Func , class Arg >
TOneArgGuard< Func, Arg > Rgl::make_guard (Func f, Arg a)
 
template<class Func , class Arg1 , class Arg2 >
TTwoArgsGuard< Func, Arg1, Arg2 > Rgl::make_guard (Func f, Arg1 a1, Arg2 a2)
 
void Rgl::ObjectIDToColor (Int_t objectID, Bool_t highColor)
 Object id encoded as rgb triplet.
 
TGLMatrix operator* (const TGLMatrix &lhs, const TGLMatrix &rhs)
 
Double_t operator* (const TGLVector3 &a, const TGLVector3 &b)
 
const TGLVector3 operator* (const TGLVector3 &vec, Double_t val)
 
TGLVertex3 operator* (Double_t f, const TGLVertex3 &v)
 
TGLVector3 operator+ (const TGLVector3 &vector1, const TGLVector3 &vector2)
 
TGLVertex3 operator+ (const TGLVertex3 &vertex1, const TGLVector3 &vertex2)
 
TGLVector3 operator- (const TGLVector3 &vector1, const TGLVector3 &vector2)
 
TGLVector3 operator- (const TGLVertex3 &vertex1, const TGLVertex3 &vertex2)
 
const TGLVector3 operator/ (const TGLVector3 &vec, Double_t val)
 
void Rgl::SetZLevels (TAxis *zAxis, Double_t zMin, Double_t zMax, Double_t zScale, std::vector< Double_t > &zLevels)
 

Variables

const Float_t Rgl::gBlueEmission [] = {0.f, 0.f, 1.f, 1.f}
 
const Float_t Rgl::gGrayEmission [] = {0.3f,0.3f, 0.3f,1.f}
 
const Float_t Rgl::gGreenEmission [] = {0.f, 1.f, 0.f, 1.f}
 
const Float_t Rgl::gNullEmission [] = {0.f, 0.f, 0.f, 1.f}
 
const Float_t Rgl::gOrangeEmission [] = {1.f, 0.4f, 0.f, 1.f}
 
const Float_t Rgl::gRedEmission [] = {1.f, 0.f, 0.f, 1.f}
 
const Float_t Rgl::gWhiteEmission [] = {1.f, 1.f, 1.f, 1.f}
 

Typedef Documentation

◆ TGLPlaneSet_ci

typedef std::vector<TGLPlane>::const_iterator TGLPlaneSet_ci

Definition at line 573 of file TGLUtil.h.

◆ TGLPlaneSet_i

typedef std::vector<TGLPlane>::iterator TGLPlaneSet_i

Definition at line 572 of file TGLUtil.h.

◆ TGLPlaneSet_t

typedef std::vector<TGLPlane> TGLPlaneSet_t

Definition at line 571 of file TGLUtil.h.

Enumeration Type Documentation

◆ EGLCoordType

Enumerator
kGLCartesian 
kGLPolar 
kGLCylindrical 
kGLSpherical 

Definition at line 42 of file TGLUtil.h.

◆ EGLPlotType

Enumerator
kGLLegoPlot 
kGLSurfacePlot 
kGLBoxPlot 
kGLTF3Plot 
kGLStackPlot 
kGLParametricPlot 
kGLIsoPlot 
kGL5D 
kGLTH3Composition 
kGLVoxel 
kGLDefaultPlot 

Definition at line 50 of file TGLUtil.h.

Function Documentation

◆ Cross()

TGLVector3 Cross ( const TGLVector3 v1,
const TGLVector3 v2 
)
inline

Definition at line 323 of file TGLUtil.h.

◆ Dot()

Double_t Dot ( const TGLVector3 v1,
const TGLVector3 v2 
)
inline

Definition at line 317 of file TGLUtil.h.

◆ Intersection() [1/3]

std::pair< Bool_t, TGLLine3 > Intersection ( const TGLPlane p1,
const TGLPlane p2 
)

Find 3D line interestion of this plane with 'other'.

Returns a std::pair

first (Bool_t) second (TGLLine3) kTRUE - planes intersect intersection line between planes kFALSE - no intersect (parallel) undefined

Definition at line 516 of file TGLUtil.cxx.

◆ Intersection() [2/3]

std::pair< Bool_t, TGLVertex3 > Intersection ( const TGLPlane p1,
const TGLPlane p2,
const TGLPlane p3 
)

Definition at line 531 of file TGLUtil.cxx.

◆ Intersection() [3/3]

std::pair< Bool_t, TGLVertex3 > Intersection ( const TGLPlane plane,
const TGLLine3 line,
Bool_t  extend 
)

Find intersection of 3D space 'line' with this plane.

If 'extend' is kTRUE then line extents can be extended (infinite length) to find intersection. If 'extend' is kFALSE the fixed extents of line is respected.

The return a std::pair

  • first (Bool_t) second (TGLVertex3)
  • kTRUE - line/plane intersect intersection vertex on plane
  • kFALSE - no line/plane intersect undefined

If intersection is not found (first == kFALSE) & 'extend' was kTRUE (infinite line) this implies line and plane are parallel. If 'extend' was kFALSE, then either line parallel or insufficient length.

Definition at line 559 of file TGLUtil.cxx.

◆ operator*() [1/4]

TGLMatrix operator* ( const TGLMatrix lhs,
const TGLMatrix rhs 
)
inline

Definition at line 705 of file TGLUtil.h.

◆ operator*() [2/4]

Double_t operator* ( const TGLVector3 a,
const TGLVector3 b 
)
inline

Definition at line 372 of file TGLUtil.h.

◆ operator*() [3/4]

const TGLVector3 operator* ( const TGLVector3 vec,
Double_t  val 
)
inline

Definition at line 337 of file TGLUtil.h.

◆ operator*() [4/4]

TGLVertex3 operator* ( Double_t  f,
const TGLVertex3 v 
)
inline

Definition at line 135 of file TGLUtil.h.

◆ operator+() [1/2]

TGLVector3 operator+ ( const TGLVector3 vector1,
const TGLVector3 vector2 
)
inline

Definition at line 358 of file TGLUtil.h.

◆ operator+() [2/2]

TGLVertex3 operator+ ( const TGLVertex3 vertex1,
const TGLVector3 vertex2 
)
inline

Definition at line 344 of file TGLUtil.h.

◆ operator-() [1/2]

TGLVector3 operator- ( const TGLVector3 vector1,
const TGLVector3 vector2 
)
inline

Definition at line 365 of file TGLUtil.h.

◆ operator-() [2/2]

TGLVector3 operator- ( const TGLVertex3 vertex1,
const TGLVertex3 vertex2 
)
inline

Definition at line 351 of file TGLUtil.h.

◆ operator/()

const TGLVector3 operator/ ( const TGLVector3 vec,
Double_t  val 
)
inline

Definition at line 331 of file TGLUtil.h.