ROOT logo
ROOT » GRAF3D » GL » TGLUtil

class TGLUtil


 Wrapper class for various misc static functions - error checking,
 draw helpers etc.

Function Members (Methods)

public:
virtual~TGLUtil()
static voidBeginAttLine(const TAttLine& aline, Int_t pick_radius = 0, Bool_t selection = kFALSE)
static voidBeginExtendPickRegion(Float_t scale)
static voidCheckError(const char* loc)
static TClass*Class()
static voidColor(const TGLColor& color)
static voidColor(const TGLColor& color, UChar_t alpha)
static voidColor(const TGLColor& color, Float_t alpha)
static voidColor(Color_t color_index, Float_t alpha = 1)
static voidColor3f(Float_t r, Float_t g, Float_t b)
static voidColor3fv(const Float_t* rgb)
static voidColor3ub(UChar_t r, UChar_t g, UChar_t b)
static voidColor3ubv(const UChar_t* rgb)
static voidColor4f(Float_t r, Float_t g, Float_t b, Float_t a)
static voidColor4fv(const Float_t* rgba)
static voidColor4ub(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
static voidColor4ubv(const UChar_t* rgba)
static voidColorTransparency(Color_t color_index, Char_t transparency = 0)
static voidDrawLine(const TGLLine3& line, TGLUtil::ELineHeadShape head, Double_t size, const Float_t* rgba)
static voidDrawLine(const TGLVertex3& start, const TGLVector3& vector, TGLUtil::ELineHeadShape head, Double_t size, const Float_t* rgba)
static voidDrawNumber(const TString& num, const TGLVertex3& pos, Bool_t center = kFALSE)
static voidDrawReferenceMarker(const TGLCamera& camera, const TGLVertex3& pos, Float_t radius = 3, const Float_t* rgba = 0)
static voidDrawRing(const TGLVertex3& center, const TGLVector3& normal, Double_t radius, const Float_t* rgba)
static voidDrawSimpleAxes(const TGLCamera& camera, const TGLBoundingBox& bbox, Int_t axesType)
static voidDrawSphere(const TGLVertex3& position, Double_t radius, const Float_t* rgba)
static voidEndAttLine(Int_t pick_radius = 0, Bool_t selection = kFALSE)
static voidEndExtendPickRegion()
static UInt_tGetDefaultDrawQuality()
static UInt_tGetDrawQuality()
static GLUtesselator*GetDrawTesselator3dv()
static GLUtesselator*GetDrawTesselator3fv()
static GLUtesselator*GetDrawTesselator4dv()
static GLUtesselator*GetDrawTesselator4fv()
static Float_tGetLineWidthScale()
static Float_tGetPointSizeScale()
virtual TClass*IsA() const
static Bool_tIsColorLocked()
static Float_tLineWidth()
static voidLineWidth(Float_t line_width)
static UInt_tLockColor()
static Float_tPointSize()
static voidPointSize(Float_t point_size)
static voidRenderCrosses(const TAttMarker& marker, Float_t* p, Int_t n, Bool_t sec_selection = kFALSE)
static voidRenderPoints(const TAttMarker& marker, Float_t* p, Int_t n, Int_t pick_radius = 0, Bool_t selection = kFALSE, Bool_t sec_selection = kFALSE)
static voidRenderPolyLine(const TAttLine& aline, Float_t* p, Int_t n, Int_t pick_radius = 0, Bool_t selection = kFALSE)
static voidRenderPolyMarkers(const TAttMarker& marker, Float_t* p, Int_t n, Int_t pick_radius = 0, Bool_t selection = kFALSE, Bool_t sec_selection = kFALSE)
static voidResetDrawQuality()
static voidSetDefaultDrawQuality(UInt_t dq)
static voidSetDrawColors(const Float_t* rgba)
static voidSetDrawQuality(UInt_t dq)
static voidSetLineWidthScale(Float_t scale)
static voidSetPointSizeScale(Float_t scale)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
static UInt_tUnlockColor()
private:
TGLUtil(const TGLUtil&)
TGLUtil&operator=(const TGLUtil&)

Data Members

public:
enum ELineHeadShape { kLineHeadNone
kLineHeadArrow
kLineHeadBox
};
enum EAxesType { kAxesNone
kAxesEdge
kAxesOrigin
};
private:
static UInt_tfgColorLockCount
static UInt_tfgDefaultDrawQuality
static UInt_tfgDrawQuality
static Float_tfgLineWidth
static Float_tfgLineWidthScale
static Float_tfgPointSize
static Float_tfgPointSizeScale

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

GLUtesselator* GetDrawTesselator3fv()
 Returns a tesselator for direct drawing when using 3-vertices with
 single precision.
GLUtesselator* GetDrawTesselator4fv()
 Returns a tesselator for direct drawing when using 4-vertices with
 single precision.
GLUtesselator* GetDrawTesselator3dv()
 Returns a tesselator for direct drawing when using 3-vertices with
 double precision.
GLUtesselator* GetDrawTesselator4dv()
 Returns a tesselator for direct drawing when using 4-vertices with
 double precision.
UInt_t GetDrawQuality()
static: get draw quality
void SetDrawQuality(UInt_t dq)
static: set draw quality
void ResetDrawQuality()
static: reset draw quality
UInt_t GetDefaultDrawQuality()
static: get default draw quality
void SetDefaultDrawQuality(UInt_t dq)
static: set default draw quality
void CheckError(const char* loc)
 Check current GL error state, outputing details via ROOT
 Error method if one
UInt_t LockColor()
 Prevent further color changes.
UInt_t UnlockColor()
 Allow color changes.
Bool_t IsColorLocked()
 Returns true if color lockcount is greater than 0.
void Color(const TGLColor& color)
 Set color from TGLColor.
void Color(const TGLColor& color, UChar_t alpha)
 Set color from TGLColor and alpha value.
void Color(const TGLColor& color, Float_t alpha)
 Set color from TGLColor and alpha value.
void Color(Color_t color_index, Float_t alpha)
 Set color from color_index and GL-style alpha (default 1).
void ColorTransparency(Color_t color_index, Char_t transparency = 0)
 Set color from color_index and ROOT-style transparency (default 0).
void Color3ub(UChar_t r, UChar_t g, UChar_t b)
 Wrapper for glColor3ub.
void Color4ub(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
 Wrapper for glColor4ub.
void Color3ubv(const UChar_t* rgb)
 Wrapper for glColor3ubv.
void Color4ubv(const UChar_t* rgba)
 Wrapper for glColor4ubv.
void Color3f(Float_t r, Float_t g, Float_t b)
 Wrapper for glColor3f.
void Color4f(Float_t r, Float_t g, Float_t b, Float_t a)
 Wrapper for glColor4f.
void Color3fv(const Float_t* rgb)
 Wrapper for glColor3fv.
void Color4fv(const Float_t* rgba)
 Wrapper for glColor4fv.
Float_t GetPointSizeScale()
 Get global point-size scale.
void SetPointSizeScale(Float_t scale)
 Set global point-size scale.
Float_t GetLineWidthScale()
 Returns global line-width scale.
void SetLineWidthScale(Float_t scale)
 Set global line-width scale.
void PointSize(Float_t point_size)
 Set the point-size, taking the global scaling into account.
 Wrapper for glPointSize.
void LineWidth(Float_t line_width)
 Set the line-width, taking the global scaling into account.
 Wrapper for glLineWidth.
Float_t PointSize()
 Get the point-size, taking the global scaling into account.
Float_t LineWidth()
 Get the line-width, taking the global scaling into account.
void BeginExtendPickRegion(Float_t scale)
 Extend pick region for large point-sizes or line-widths.
void EndExtendPickRegion()
 End extension of the pick region.
void RenderPolyMarkers(const TAttMarker& marker, 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.
 Supports point and cross-like styles.
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.
 Color is never changed.
void RenderCrosses(const TAttMarker& marker, Float_t* p, Int_t n, Bool_t sec_selection = kFALSE)
 Render markers as crosses.
 Color is never changed.
void RenderPolyLine(const TAttLine& aline, Float_t* p, Int_t n, Int_t pick_radius = 0, Bool_t selection = kFALSE)
 Render poly-line as specified by the p-array.
void BeginAttLine(const TAttLine& aline, Int_t pick_radius = 0, Bool_t selection = kFALSE)
 Setup drawing parrameters according to passed TAttLine.
void EndAttLine(Int_t pick_radius = 0, Bool_t selection = kFALSE)
 Restore previous line drawing state.
void SetDrawColors(const Float_t* rgba)
 Set basic draw colors from 4 component 'rgba'
 Used by other TGLUtil drawing routines

 Sets basic (unlit) color - glColor
 and also GL materials (see OpenGL docs) thus:

 diffuse  : rgba
 ambient  : 0.0 0.0 0.0 1.0
 specular : 0.6 0.6 0.6 1.0
 emission : rgba/4.0
 shininess: 60.0

 emission is set so objects with no lights (but lighting still enabled)
 are partially visible
void DrawSphere(const TGLVertex3& position, Double_t radius, const Float_t* rgba)
 Draw sphere, centered on vertex 'position', with radius 'radius',
 color 'rgba'
void DrawLine(const TGLLine3& line, TGLUtil::ELineHeadShape head, Double_t size, const Float_t* rgba)
 Draw thick line (tube) defined by 'line', with head at end shape
 'head' - box/arrow/none, (head) size 'size', color 'rgba'
void DrawLine(const TGLVertex3& start, const TGLVector3& vector, TGLUtil::ELineHeadShape head, Double_t size, const Float_t* rgba)
 Draw thick line (tube) running from 'start', length 'vector',
 with head at end of shape 'head' - box/arrow/none,
 (head) size 'size', color 'rgba'
void DrawRing(const TGLVertex3& center, const TGLVector3& normal, Double_t radius, const Float_t* rgba)
 Draw ring, centered on 'center', lying on plane defined by 'center' & 'normal'
 of outer radius 'radius', color 'rgba'
void DrawReferenceMarker(const TGLCamera& camera, const TGLVertex3& pos, Float_t radius = 3, const Float_t* rgba = 0)
 Draw a sphere- marker on world-coordinate 'pos' with pixel
 radius 'radius'. Color argument is optional.
void DrawSimpleAxes(const TGLCamera& camera, const TGLBoundingBox& bbox, Int_t axesType)
 Draw simple xyz-axes for given bounding-box.
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'. If 'center' is true, the number is centered on 'pos'.
 Only numbers, '.', '-' and ' ' are supported.
TGLColor& operator=(const TGLUtil& )
TGLUtil(const TGLUtil& )
virtual ~TGLUtil()
{}