TGLViewerBase Base class for GL viewers. Provides a basic scene management and a small set of control variables (camera, LOD, style, clip) that are used by the scene classes. Renering wrappers are available but minimal. There is no concept of GL-context here ... we just draw into whatever is set from outside. Development notes: Each viewer automatically creates a TGLRnrCtx and passes it down all render functions.
TGLViewerBase::SceneInfoList_i | FindScene(TGLSceneBase* scene) |
void | SubRenderScenes(TGLViewerBase::SubRender_foo render_foo) |
TGLViewerBase(const TGLViewerBase&) | |
TGLViewerBase& | operator=(const TGLViewerBase&) |
enum TGLLockable::ELock { | kUnlocked | |
kDrawLock | ||
kSelectLock | ||
kModifyLock | ||
}; |
TGLCamera* | fCamera | Camera for rendering. |
Bool_t | fChanged | Change requiring redraw is pending. |
TGLClip* | fClip | Viewer clipping-plane. |
Short_t | fLOD | Viewer-lod for rendering. |
TGLLockable::ELock | TGLLockable::fLock | Lock state. |
TGLBoundingBox | fOverallBoundingBox | Axis-aligned union of scene bboxes. |
vector<TGLOverlayElement*,allocator<TGLOverlayElement*> > | fOverlay | |
Bool_t | fResetSceneInfosOnRender | Request rebuild of view-specific scene data. |
TGLRnrCtx* | fRnrCtx | |
list<TGLSceneInfo*,allocator<TGLSceneInfo*> > | fScenes | Registered scenes. |
Short_t | fStyle | Viewer-style for rendering. |
vector<TGLSceneInfo*,allocator<TGLSceneInfo*> > | fVisScenes | Visible scenes. |
Remove scene, its scene-info is deleted. Called from scene that is being destroyed while still holding viewer references.
Force rebuild of view-dependent scene-info structures. This should be called before calling render (draw/select) if something that affects camera interest has been changed.
Initialize render-context, setup camera, GL, render-area. Check and lock scenes, determine their visibility.
Call sub-rendering function render_foo on all currently visible scenes.
Render all scenes. This is done in four passes: - render opaque objects from all scenes - render transparent objects from all scenes - clear depth buffer - render opaque selected objects from all scenes (with highlight) - render transparent selected objects from all scenes (with highlight)
Perform minimal initialization for overlay selection. Here we assume that scene has already been drawn and that camera and overall bounding box are ok. Scenes are not locked.
Process selection record on buffer-position 'recIdx' and fill the data into 'rec'. Returns TRUE if scene was demangled and an object identified. When FALSE is returned it is still possible that scene has been identified. Check for this if interested in scene-selection. The select-buffer is taken form fRnrCtx.
Find next select record that can be resolved, starting from position 'recIdx'. 'recIdx' is passed as reference and points to found record in the buffer.
Find next select record that can be resolved and whose result is not transparent, starting from position 'recIdx'. 'recIdx' is passed as reference and points to found record in the buffer.
Find next overlay-select record that can be resolved, starting from position 'recIdx'. 'recIdx' is passed as reference and points to found record in the buffer.