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
Bool_tGetGrabImage() const
Int_tGetPickRadius()
TGLRect*GetPickRectangle()
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()
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)
voidReleaseFont(TGLFont& font)
Double_tRenderTimeOut() const
TGLClip*SceneClip() const
Short_tSceneLOD() const
Short_tSceneStyle() 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)
voidSetHighlight(Bool_t hil)
voidSetHighlightOutline(Bool_t ho)
voidSetRenderTimeOut(Double_t tout)
voidSetSceneClip(TGLClip* p)
voidSetSceneInfo(TGLSceneInfo* si)
voidSetSceneLOD(Short_t LOD)
voidSetSceneStyle(Short_t sty)
voidSetSecSelection(Bool_t secSel)
voidSetSelection(Bool_t sel)
voidSetShapeLOD(Short_t LOD)
voidSetViewerClip(TGLClip* p)
voidSetViewerLOD(Short_t LOD)
voidSetViewerStyle(Short_t sty)
Short_tShapeLOD() const
virtual voidShowMembers(TMemberInspector& insp, char* parent)
voidStartStopwatch()
voidStopStopwatch()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
static const char*StyleName(Short_t style)
TGLClip*ViewerClip() const
Short_tViewerLOD() const
Short_tViewerStyle() const
private:
TGLRnrCtx(const TGLRnrCtx&)
TGLRnrCtx&operator=(const TGLRnrCtx&)

Data Members

private:
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
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
Double_tfRenderTimeOut
TGLClip*fSceneClip
TGLSceneInfo*fSceneInfo
Short_tfSceneLOD
Short_tfSceneStyle
Bool_tfSecSelection
TGLSelectBuffer*fSelectBuffer
Bool_tfSelection
Short_tfShapeLOD
TGLStopwatchfStopwatch
TGLViewerBase*fViewer
TGLClip*fViewerClip
Short_tfViewerLOD
Short_tfViewerStyle

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 RegisterFont(Int_t size, Int_t file, Int_t mode, TGLFont& out)
 Get font in the GL rendering context.
void RegisterFont(Int_t size, const char* name, Int_t mode, TGLFont& out)
 Get font in the GL rendering context.
void ReleaseFont(TGLFont& font)
 Release font in the GL rendering context.
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()
{ return *fCamera; }
const TGLCamera * GetCamera()
{ 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; }
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; }
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; }
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)
 Picture grabbing
{ fGrabImage = gi; }
Bool_t GetGrabImage() const
{ return fGrabImage; }
UChar_t* GetGrabbedImage() const
{ return fGrabbedImage; }
void SetGrabbedImage(UChar_t* img)
{ fGrabbedImage = img; }