ROOT logo
ROOT » GRAF3D » GL » TGLRnrCtx

class TGLRnrCtx


 The TGLRnrCtx class aggregates data for a given redering context as
 needed by various parts of the ROOT's OpenGL infractructure. It
 serves as a connecting point between the steering part of the
 infrastructure (viewer, scene) and concrete rendering classes
 (logical, physical shape). It is just a data-holder, there is no
 functionality in it.

 Development notes:

 One RnrCtx is created by each viewer and it is just an extension of
 the viewer context that changes along the render
 descend. Separating this also has some abstract benefit of hiding
 viewer implementation from those that do not need to know it.

 Current scene / scene-info part is always initialized by viewer,
 scenes can assume they're ok.

Function Members (Methods)

public:
TGLRnrCtx(TGLViewerBase* viewer)
virtual~TGLRnrCtx()
voidBeginSelection(Int_t x, Int_t y, Int_t r = 3)
TGLColorSet*ChangeBaseColorSet(TGLColorSet* set)
static TClass*Class()
TGLClip*Clip() const
voidCloseDLCapture()
voidColorOrForeground(Color_t col)
TGLColorSet&ColorSet()
Short_tCombiLOD() const
Short_tDrawPass() const
voidEndSelection(Int_t glResult)
TGLColorSet*GetBaseColorSet()
TGLCamera*GetCamera()
const TGLCamera*GetCamera() const
UInt_tGetEventKeySym() const
TGLContextIdentity*GetGLCtxIdentity() const
GLUquadric*GetGluQuadric()
UChar_t*GetGrabbedImage() const
Int_tGetGrabBuffer() const
Bool_tGetGrabImage() const
Int_tGetPickRadius()
TGLRect*GetPickRectangle()
Float_tGetRenderScale() const
TGLSceneBase*GetScene()
TGLSceneInfo*GetSceneInfo()
TGLSelectBuffer*GetSelectBuffer() const
TGLViewerBase*GetViewer()
Bool_tHasClip() const
Bool_tHasStopwatchTimedOut()
Bool_tHighlight() const
Bool_tHighlightOutline() const
virtual TClass*IsA() const
Bool_tIsDLCaptureOpen() const
Bool_tIsDrawPassFilled() const
Bool_tIsDrawPassOutlineLine() const
Bool_tIsStopwatchRunning() const
voidOpenDLCapture()
voidPopColorSet()
voidProjectionMatrixPop()
voidProjectionMatrixPushIdentity()
voidPushColorSet()
TGLCamera&RefCamera()
const TGLCamera&RefCamera() const
TGLSceneBase&RefScene()
TGLSceneInfo&RefSceneInfo()
TGLViewerBase&RefViewer()
voidRegisterFont(Int_t size, Int_t file, Int_t mode, TGLFont& out)
voidRegisterFont(Int_t size, const char* name, Int_t mode, TGLFont& out)
voidRegisterFontNoScale(Int_t size, Int_t file, Int_t mode, TGLFont& out)
voidRegisterFontNoScale(Int_t size, const char* name, Int_t mode, TGLFont& out)
voidReleaseFont(TGLFont& font)
Double_tRenderTimeOut() const
TGLClip*SceneClip() const
Short_tSceneLOD() const
Float_tSceneOLLineW() const
Short_tSceneStyle() const
Float_tSceneWFLineW() const
Bool_tSecSelection() const
Bool_tSelection() const
voidSetCamera(TGLCamera* c)
voidSetClip(TGLClip* p)
voidSetCombiLOD(Short_t LOD)
voidSetDrawPass(Short_t dpass)
voidSetEventKeySym(UInt_t k)
voidSetGLCtxIdentity(TGLContextIdentity* cid)
voidSetGrabbedImage(UChar_t* img)
voidSetGrabImage(Bool_t gi, Int_t buf = -1)
voidSetHighlight(Bool_t hil)
voidSetHighlightOutline(Bool_t ho)
voidSetRenderScale(Float_t s)
voidSetRenderTimeOut(Double_t tout)
voidSetSceneClip(TGLClip* p)
voidSetSceneInfo(TGLSceneInfo* si)
voidSetSceneLOD(Short_t LOD)
voidSetSceneOLLineW(Float_t w)
voidSetSceneStyle(Short_t sty)
voidSetSceneWFLineW(Float_t w)
voidSetSecSelection(Bool_t secSel)
voidSetSelection(Bool_t sel)
voidSetShapeLOD(Short_t LOD)
voidSetShapePixSize(Float_t ps)
voidSetViewerClip(TGLClip* p)
voidSetViewerLOD(Short_t LOD)
voidSetViewerOLLineW(Float_t w)
voidSetViewerStyle(Short_t sty)
voidSetViewerWFLineW(Float_t w)
Short_tShapeLOD() const
Float_tShapePixSize() const
virtual voidShowMembers(TMemberInspector& insp)
voidStartStopwatch()
voidStopStopwatch()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
static const char*StyleName(Short_t style)
TGLClip*ViewerClip() const
Short_tViewerLOD() const
Float_tViewerOLLineW() const
Short_tViewerStyle() const
Float_tViewerWFLineW() const
private:
TGLRnrCtx(const TGLRnrCtx&)
TGLRnrCtx&operator=(const TGLRnrCtx&)

Data Members

public:
enum EStyle { kStyleUndef
kFill
kOutline
kWireFrame
};
enum EPass { kPassUndef
kPassFill
kPassOutlineFill
kPassOutlineLine
kPassWireFrame
};
enum ELODPresets { kLODUndef
kLODPixel
kLODLow
kLODMed
kLODHigh
};
enum EShapeSelectionLevel { kSSLNotSelected
kSSLSelected
kSSLImpliedSelected
kSSLHighlighted
kSSLImpliedHighlighted
kSSLEnd
};
protected:
TGLCamera*fCamera
TGLClip*fClip
list<TGLColorSet*,allocator<TGLColorSet*> >*fColorSetStack
Short_tfCombiLODCombined viewer/scene lod.
Bool_tfDLCaptureOpen! DL-capture currently open
Short_tfDrawPass
UInt_tfEventKeySym
TGLContextIdentity*fGLCtxIdentity! Current GL context identity
Int_tfGrabBufferWhich buffer to grab after render.
Bool_tfGrabImageSet to true to store the image.
UChar_t*fGrabbedImageBuffer where image was stored after rendering.
Bool_tfHasTimedOut
Bool_tfHighlightTrue when in highlight.
Bool_tfHighlightOutlineTrue when in highlight-outline.
Bool_tfIsRunning
Int_tfPickRadius
TGLRect*fPickRectangle
GLUquadric*fQuadric
Float_tfRenderScale
Double_tfRenderTimeOut
TGLClip*fSceneClip
TGLSceneInfo*fSceneInfo
Short_tfSceneLOD
Float_tfSceneOLLineW
Short_tfSceneStyle
Float_tfSceneWFLineW
Bool_tfSecSelection
TGLSelectBuffer*fSelectBuffer
Bool_tfSelection
Short_tfShapeLODLOD calculated for current shape.
Float_tfShapePixSizeOnly relevant when not using display lists.
TGLStopwatchfStopwatch
TGLViewerBase*fViewer
TGLClip*fViewerClip
Short_tfViewerLOD
Float_tfViewerOLLineW
Short_tfViewerStyle
Float_tfViewerWFLineW

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TGLRnrCtx(TGLViewerBase* viewer)
 Constructor.
~TGLRnrCtx()
 Destructor.
TGLSceneBase * GetScene()
 Return current scene (based on scene-info data).
TGLSceneBase & RefScene()
 Return current scene (based on scene-info data).
Bool_t IsDrawPassFilled() const
 Returns true if current render-pass uses filled polygon style.
Bool_t HasStopwatchTimedOut()
 Check if the stopwatch went beyond the render time limit.
void BeginSelection(Int_t x, Int_t y, Int_t r = 3)
 Setup context for running selection.
 x and y are in window coordinates.
void EndSelection(Int_t glResult)
 End selection.
TGLRect * GetPickRectangle()
 Return current pick rectangle. This is *zero* when
 selection is not set.
Int_t GetPickRadius()
 Return pick radius. If selection is not active it returns 0.
void PushColorSet()
 Create copy of current color-set on the top of the stack.
TGLColorSet& ColorSet()
 Return reference to current color-set (top of hte stack).
void PopColorSet()
 Pops the top-most color-set.
 If only one entry is available, error is printed and the entry remains.
TGLColorSet* ChangeBaseColorSet(TGLColorSet* set)
 Change the default/bottom color-set.
 Returns the previous color-set.
TGLColorSet* GetBaseColorSet()
 Returns the current base color-set.
void ColorOrForeground(Color_t col)
 Set col if it is different from background, otherwise use
 current foreground color.
void OpenDLCapture()
 Start display-list capture.
void CloseDLCapture()
 End display list capture.
void ReleaseFont(TGLFont& font)
 Release font in the GL rendering context.
void RegisterFontNoScale(Int_t size, Int_t file, Int_t mode, TGLFont& out)
 Get font in the GL rendering context.
void RegisterFontNoScale(Int_t size, const char* name, Int_t mode, TGLFont& out)
 Get font in the GL rendering context.
void RegisterFont(Int_t size, Int_t file, Int_t mode, TGLFont& out)
 Get font in the GL rendering context.
 The font is scaled relative to current render scale.
void RegisterFont(Int_t size, const char* name, Int_t mode, TGLFont& out)
 Get font in the GL rendering context.
 The font is scaled relative to current render scale.
void ProjectionMatrixPushIdentity()
void ProjectionMatrixPop()
const char* StyleName(Short_t style)
 Return string describing the style.
TGLRnrCtx(const TGLRnrCtx& )
TGLRnrCtx& operator=(const TGLRnrCtx& )
TGLViewerBase * GetViewer()
 Central objects
{ return fViewer; }
TGLViewerBase & RefViewer()
{ return *fViewer; }
TGLCamera * GetCamera()
{ return fCamera; }
TGLCamera & RefCamera()
{ return *fCamera; }
TGLSceneInfo * GetSceneInfo()
{ return fSceneInfo; }
TGLSceneInfo & RefSceneInfo()
{ return *fSceneInfo; }
const TGLCamera & RefCamera() const
{ return *fCamera; }
const TGLCamera * GetCamera() const
{ return fCamera; }
void SetCamera(TGLCamera* c)
 void SetViewer   (TGLViewerBase* v) { fViewer = v; }
{ fCamera = c; }
void SetSceneInfo(TGLSceneInfo* si)
{ fSceneInfo = si; }
Short_t ViewerLOD() const
 Draw LOD, style, clip, rnr-pass
{ return fViewerLOD; }
void SetViewerLOD(Short_t LOD)
{ fViewerLOD = LOD; }
Short_t SceneLOD() const
{ return fSceneLOD; }
void SetSceneLOD(Short_t LOD)
{ fSceneLOD = LOD; }
Short_t CombiLOD() const
{ return fCombiLOD; }
void SetCombiLOD(Short_t LOD)
{ fCombiLOD = LOD; }
Short_t ShapeLOD() const
{ return fShapeLOD; }
void SetShapeLOD(Short_t LOD)
{ fShapeLOD = LOD; }
Float_t ShapePixSize() const
{ return fShapePixSize; }
void SetShapePixSize(Float_t ps)
{ fShapePixSize = ps; }
Short_t ViewerStyle() const
{ return fViewerStyle; }
void SetViewerStyle(Short_t sty)
{ fViewerStyle = sty; }
Short_t SceneStyle() const
{ return fSceneStyle; }
void SetSceneStyle(Short_t sty)
{ fSceneStyle = sty; }
Float_t ViewerWFLineW() const
{ return fViewerWFLineW; }
void SetViewerWFLineW(Float_t w)
Float_t SceneWFLineW() const
{ return fSceneWFLineW; }
void SetSceneWFLineW(Float_t w)
{ fSceneWFLineW = w; }
Float_t ViewerOLLineW() const
{ return fViewerOLLineW; }
void SetViewerOLLineW(Float_t w)
Float_t SceneOLLineW() const
{ return fSceneOLLineW; }
void SetSceneOLLineW(Float_t w)
{ fSceneOLLineW = w; }
TGLClip* ViewerClip() const
{ return fViewerClip; }
void SetViewerClip(TGLClip* p)
{ fViewerClip = p; }
TGLClip* SceneClip() const
{ return fSceneClip; }
void SetSceneClip(TGLClip* p)
{ fSceneClip = p; }
void SetClip(TGLClip* p)
{ fClip = p; }
Bool_t HasClip() const
{ return fClip != 0; }
Short_t DrawPass() const
{ return fDrawPass; }
void SetDrawPass(Short_t dpass)
{ fDrawPass = dpass; }
Bool_t IsDrawPassOutlineLine() const
Double_t RenderTimeOut() const
 Render time-out
{ return fRenderTimeOut; }
void SetRenderTimeOut(Double_t tout)
{ fRenderTimeOut = tout; }
void StartStopwatch()
void StopStopwatch()
Bool_t IsStopwatchRunning() const
{ return fIsRunning; }
Bool_t Highlight() const
{ return fHighlight; }
void SetHighlight(Bool_t hil)
{ fHighlight = hil; }
Bool_t HighlightOutline() const
{ return fHighlightOutline; }
void SetHighlightOutline(Bool_t ho)
Bool_t Selection() const
{ return fSelection; }
void SetSelection(Bool_t sel)
{ fSelection = sel; }
Bool_t SecSelection() const
{ return fSecSelection; }
void SetSecSelection(Bool_t secSel)
 Low-level getters
{ fSecSelection = secSel; }
TGLSelectBuffer * GetSelectBuffer() const
 Composed operations
{ return fSelectBuffer; }
Float_t GetRenderScale() const
{ return fRenderScale; }
void SetRenderScale(Float_t s)
{ fRenderScale = s; }
UInt_t GetEventKeySym() const
{ return fEventKeySym; }
void SetEventKeySym(UInt_t k)
{ fEventKeySym = k; }
Bool_t IsDLCaptureOpen() const
{ return fDLCaptureOpen; }
TGLContextIdentity* GetGLCtxIdentity() const
{ return fGLCtxIdentity; }
void SetGLCtxIdentity(TGLContextIdentity* cid)
{ fGLCtxIdentity = cid; }
GLUquadric* GetGluQuadric()
{ return fQuadric; }
void SetGrabImage(Bool_t gi, Int_t buf = -1)
 Picture grabbing
{ fGrabImage = gi; fGrabBuffer = buf; }
Bool_t GetGrabImage() const
{ return fGrabImage; }
Int_t GetGrabBuffer() const
{ return fGrabBuffer; }
UChar_t* GetGrabbedImage() const
{ return fGrabbedImage; }
void SetGrabbedImage(UChar_t* img)
{ fGrabbedImage = img; }