12 #ifndef ROOT_TGLViewer 13 #define ROOT_TGLViewer 412 if (fPending) TurnOff();
else fPending =
kTRUE;
413 if (redrawLOD < fRedrawLOD) fRedrawLOD = redrawLOD;
419 if (fPending) { TurnOff(); fPending =
kFALSE; }
443 fViewer(0), fFadeTarget(0), fTime(0), fNSteps(0) {}
445 fViewer(v),fFadeTarget(fade), fTime(time), fNSteps(steps) {}
453 #endif // ROOT_TGLViewer TGEventHandler * fEventHandler
select record from last overlay select
void FadeView(Float_t alpha)
Draw a rectangle (background color and given alpha) across the whole viewport.
Int_t fAxesType
smooth line edge rendering
TGLCamera * fCurrentCamera
A GL overlay element which displays camera furstum.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
TGLVertex3 fReferencePos
reference marker on?
virtual void ReMouseOver(TObject *obj, UInt_t state)
Emit MouseOver signal.
Class encapsulating a set of colors used throughout standard rendering.
TGLSelectRecord fSelRec
select record in use as selected
Bool_t fStereoQuadBuf
use stereo rendering
TGLClipSet * GetClipSet() const
const TGLRect & RefViewport() const
TGLColorSet fLightColorSet
color-set with dark background
void MakeCurrent() const
Make GL context current.
virtual void PadPaint(TVirtualPad *pad)
Entry point for updating viewer contents via VirtualViewer3D interface.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
TGLPerspectiveCamera fPerspectiveCameraXOZ
virtual void PreRender()
Initialize objects that influence rendering.
void ReinitializeCurrentCamera(const TGLVector3 &hAxis, const TGLVector3 &vAxis, Bool_t redraw=kTRUE)
Change base-vectors defining the camera-base transformation of current camera.
Float_t fLineScale
size scale for points
Wrap TGLPysicalShape into TObject so that it can be edited using GED.
TGEventHandler * GetEventHandler() const
virtual void MouseOver(TGLPhysicalShape *)
Emit MouseOver signal.
void SwitchColorSet()
Switch between dark and light colorsets.
TGLAutoRotator * fAutoRotator
virtual Bool_t OpenComposite(const TBuffer3D &, Bool_t *=0)
virtual void ResetCamerasAfterNextUpdate()
TGLOverlayElement * GetCurrentOvlElm() const
TGLOrthoCamera fOrthoXnOZCamera
Identifier of a shared GL-context.
void ResetCurrentCamera()
Resets position/rotation of current camera to default values.
void SetupCameras(Bool_t reset)
Setup cameras for current bounding box.
TGLOrthoCamera fOrthoXOZCamera
static TGLColorSet & GetDefaultColorSet()
Returns reference to the default color-set.
TGLOrthoCamera fOrthoXOYCamera
TGLCamera & RefCamera(ECameraType camera)
Return camera reference by type.
Bool_t RequestOverlaySelect(Int_t x, Int_t y)
Post request for secondary selection rendering of selected object around the window point (x...
virtual void SetEventHandler(TGEventHandler *handler)
Set the event-handler.
This is the ROOT implementation of the Qt object communication mechanism (see also http://www...
Scene base-class – provides basic interface expected by the TGLViewer or its sub-classes: ...
Float_t fStereoEyeOffsetFac
position of zero-parallax plane: 0 - near clipping plane, 1 - far clipping plane
TGLViewer & operator=(const TGLViewer &)
void DoDraw(Bool_t swap_buffers=kTRUE)
Draw out the viewer.
Bool_t IsColorSetDark() const
Returns true if current color set is dark.
void SetCameraOverlay(TGLCameraOverlay *m)
void SetSmoothPoints(Bool_t s)
Bool_t SavePictureScale(const TString &fileName, Float_t scale, Bool_t pixel_object_scale=kTRUE)
Save picture with given scale to current window size.
TGLColorSet & RefLightColorSet()
const TGLPhysicalShape * GetSelected() const
Return selected physical shape.
void SetMaxSceneDrawTimeLQ(Float_t t)
void SetDrawCameraCenter(Bool_t x)
Draw camera look at and rotation point.
GUI editor for TGLViewer.
An abstract interface to image processing library.
Bool_t SavePictureHeight(const TString &fileName, Int_t height, Bool_t pixel_object_scale=kTRUE)
Save picture with given height (width scaled proportionally).
Bool_t RequestSecondarySelect(Int_t x, Int_t y)
Request secondary select.
virtual void UnMouseOver(TObject *obj, UInt_t state)
Emit UnMouseOver signal.
virtual void SetGedEditor(TGedEditor *ed)
Perspective projection camera - with characteristic foreshortening.
virtual void PostRender()
Restore state set in PreRender().
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Process event of type 'event' - one of EEventType types, occurring at window location px...
Encapsulates a set of lights for OpenGL.
void UseLightColorSet()
Use the light color-set.
Combine all available manipulators in a collection.
static void UseDefaultColorSetForNewViewers(Bool_t x)
Sets static flag that determines if new viewers should use the default color-set. ...
void SetOrthoCamera(ECameraType camera, Double_t zoom, Double_t dolly, Double_t center[3], Double_t hRotate, Double_t vRotate)
Set an orthographic camera to supplied configuration - note this does not need to be the current came...
Wrapper class for GL capture & output routines.
Bool_t GetResetCamerasOnUpdate() const
void SetClearColor(Color_t col)
Set background method.
Base class for GL viewers.
Concrete physical shape - a GL drawable.
TGLCamera & CurrentCamera() const
virtual Bool_t CanLoopOnPrimitives() const
Float_t GetStereoFrustumAsymFac() const
virtual void Render()
Normal rendering, used by mono and stereo rendering.
void AutoFade(Float_t fade, Float_t time=1, Int_t steps=10)
Animate fading from current value to fade over given time (sec) and number of steps.
static TGLColorSet fgDefaultColorSet
fade the view (0 - no fade/default, 1 - full fade/no rendering done)
void SetPointScale(Float_t s)
EDragAction GetDragAction() const
TGLSelectRecord fCurrentSelRec
void SetLineScale(Float_t s)
#define ClassDef(name, id)
virtual void OverlayDragFinished()
An overlay operation can result in change to an object.
Bool_t fDebugMode
cache logicals during scene rebuilds
TGLRedrawTimer * fRedrawTimer
3 component (x/y/z) vertex class.
TGLContextIdentity * fGLCtxId
for embedded gl viewer
virtual void PostSceneBuildSetup(Bool_t resetCameras)
Perform post scene-build setup.
virtual void Start(Long_t milliSec=-1, Bool_t singleShot=kFALSE)
Starts the timer with a milliSec timeout.
void PostDraw()
Perform GL work which must be done after each draw.
Bool_t GetIgnoreSizesOnUpdate() const
Bool_t GetSmoothLines() const
const char * GetPictureFileName() const
Viewport (pixel base) 2D rectangle class.
Bool_t fResetCamerasOnUpdate
void SwapBuffers() const
Swap GL buffers.
Bool_t DoSecondarySelect(Int_t x, Int_t y)
Secondary selection.
Abstract 3D shapes viewer.
3 component (x/y/z) vector class.
virtual void RemoveOverlayElement(TGLOverlayElement *el)
Remove overlay element.
Int_t ViewportDiagonal() const
TGedEditor * GetGedEditor() const
void DrawGuides()
Draw reference marker and coordinate axes.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
void ApplySelection()
Process result from last selection (in fSelRec) and extract a new current selection from it...
Bool_t fAxesDepthTest
axes type
virtual ~TGLFaderHelper()
void SetSmartRefresh(Bool_t smart_ref)
void Emit(const char *signal)
Acitvate signal without args.
Float_t GetStereoEyeOffsetFac() const
Bool_t GetSmartRefresh() const
TGLManipSet * fSelectedPShapeRef
select record from last secondary select (should go to context)
Bool_t GetClipAutoUpdate() const
Float_t fMaxSceneDrawTimeLQ
max time for scene rendering at high LOD (in ms)
void UpdateScene(Bool_t redraw=kTRUE)
Force update of pad-scenes.
TGLSelectRecord & GetSelRec()
void InitGL()
Initialise GL state.
virtual Int_t AddObject(UInt_t, const TBuffer3D &, Bool_t *=0)
void SetPerspectiveCamera(ECameraType camera, Double_t fov, Double_t dolly, Double_t center[3], Double_t hRotate, Double_t vRotate)
Set a perspective camera to supplied configuration - note this does not need to be the current camera...
Float_t fFader
default file-name for SavePicture()
Bool_t IsUsingDefaultColorSet() const
Check if the viewer is using the default color set.
Automatically rotates GL camera.
TGLAutoRotator * GetAutoRotator()
Get the auto-rotator for this viewer.
void RequestDraw(Short_t LOD=TGLRnrCtx::kLODMed)
Post request for redraw of viewer at level of detail 'LOD' Request is directed via cross thread gVirt...
virtual void PrintObjects()
Pass viewer for print capture by TGLOutput.
Bool_t RequestSelect(Int_t x, Int_t y)
Post request for selection render pass viewer, picking objects around the window point (x...
static Bool_t IsUsingDefaultColorSetForNewViewers()
Returns the value of the static flag that determines if new viewers should use the default color-set...
virtual void AddCompositeOp(UInt_t)
void RequestDraw(Int_t milliSec, Short_t redrawLOD)
Bool_t fIsPrinting
debug mode (forced rebuild + draw scene/frustum/interest boxes)
Standard selection record including information about containing scene and details ob out selected ob...
Bool_t GetAutoUpdate() const
TGLCameraOverlay * GetCameraOverlay() const
Bool_t SavePictureUsingFBO(const TString &fileName, Int_t w, Int_t h, Float_t pixel_object_scale=0)
Save current image in various formats (gif, gif+, jpg, png).
void GetGuideState(Int_t &axesType, Bool_t &axesDepthTest, Bool_t &referenceOn, Double_t *referencePos) const
Fetch the state of guides (axes & reference markers) into arguments.
virtual Int_t AddObject(const TBuffer3D &, Bool_t *=0)
virtual void CreateGLWidget()
virtual void Clicked(TObject *obj)
Emit Clicked signal.
TGLRect fViewport
max time for scene rendering at high LOD (in ms)
Bool_t DoOverlaySelect(Int_t x, Int_t y)
Perform GL selection, picking overlay objects only.
void DoDrawStereo(Bool_t swap_buffers)
Draw out in stereoscopic mode.
void SetStereoZeroParallax(Float_t f)
A collection of concrete TGLClip objects to be selected from.
void SetStereoFrustumAsymFac(Float_t f)
virtual void DoubleClicked()
Generic 3D primitive description class.
TGLOvlSelectRecord fOvlSelRec
current overlay element
Handles synchronous and a-synchronous timer events.
TGLOvlSelectRecord & GetOvlSelRec()
void UseDarkColorSet()
Use the dark color-set.
Float_t GetMaxSceneDrawTimeLQ() const
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Bool_t fSmoothPoints
width scale for lines
void SetStereo(Bool_t stereo, Bool_t quad_buf=kTRUE)
Enable stereo rendering.
Int_t Diagonal() const
Return the diagonal of the rectangle.
virtual Bool_t PreferLocalFrame() const
Bool_t DoSelect(Int_t x, Int_t y)
Perform GL selection, picking objects overlapping WINDOW area described by 'rect'.
Float_t GetPointScale() const
void SetStereoEyeOffsetFac(Float_t f)
Float_t GetStereoZeroParallax() const
void SetSmoothLines(Bool_t s)
Float_t GetLineScale() const
void SetPictureFileName(const TString &f)
TImage * GetPictureUsingBB()
Returns current image.
void SetAutoUpdate(Bool_t aup)
Bool_t fSmoothLines
smooth point edge rendering
Bool_t SavePictureWidth(const TString &fileName, Int_t width, Bool_t pixel_object_scale=kTRUE)
Save picture with given width (height scaled proportionally).
void SetViewport(Int_t x, Int_t y, Int_t width, Int_t height)
Set viewer viewport (window area) with bottom/left at (x,y), with dimensions 'width'/'height'.
void SetResetCamerasOnUpdate(Bool_t v)
TGLOrthoCamera fOrthoXnOYCamera
virtual Bool_t BuildingScene() const
TGLOrthoCamera fOrthoZOYCamera
static Bool_t fgUseDefaultColorSetForNewViewers
a shared, default color-set
Float_t fMaxSceneDrawTimeHQ
timer for triggering redraws
TGLOrthoCamera fOrthoZnOYCamera
virtual void BeginScene()
Base-class and default implementation of event-handler for TGLViewer.
Float_t fStereoZeroParallax
draw quad buffer or left/right stereo in left/right half of window
virtual void SelectionChanged()
Update GUI components for embedded viewer selection change.
virtual void ReClicked(TObject *obj, UInt_t button, UInt_t state)
Emit ReClicked signal with button id and modifier state.
Bool_t fReferenceOn
remove guides hidden-lines
virtual void CloseComposite()
void SetCurrentCamera(ECameraType camera)
Set current active camera - 'cameraType' one of: kCameraPerspX, kCameraPerspY, kCameraPerspZ, kCameraOrthoXOY, kCameraOrthoXOZ, kCameraOrthoZOY, kCameraOrthoXnOY, kCameraOrthoXnOZ, kCameraOrthoZnOY.
TGLCameraOverlay * fCameraOverlay
reference marker on?
Bool_t fIgnoreSizesOnUpdate
for embedded gl viewer
TContextMenu * fContextMenu
external pad - remove replace with signal
TImage * GetPictureUsingFBO(Int_t w, Int_t h, Float_t pixel_object_scale=0)
Returns current image.
TGLColorSet & RefDarkColorSet()
TGLOverlayElement * fCurrentOvlElm
void DoDrawMono(Bool_t swap_buffers)
Draw out in monoscopic mode.
TGLLightSet * GetLightSet() const
Orthographic projection camera.
Mother of all ROOT objects.
TGLViewer(const TGLViewer &)
Float_t fStereoFrustumAsymFac
virtual void RefreshPadEditor(TObject *obj=0)
Update GED editor if it is set.
void ClearCurrentOvlElm()
Reset current overlay-element to zero, eventually notifying the old one that the mouse has left...
Bool_t Notify()
Notify when timer times out.
Bool_t SavePictureUsingBB(const TString &fileName)
Save current image in various formats (gif, gif+, jpg, png).
void SetGuideState(Int_t axesType, Bool_t axesDepthTest, Bool_t referenceOn, const Double_t *referencePos)
Set the state of guides (axes & reference markers) from arguments.
virtual void DestroyGLWidget()
void InitSecondaryObjects()
Common initialization.
virtual void MouseIdle(TGLPhysicalShape *, UInt_t, UInt_t)
Emit MouseIdle signal.
EPushAction GetPushAction() const
virtual ~TGLViewer()
Destroy viewer object.
void SetClipAutoUpdate(Bool_t x)
virtual void SetupClipObject()
name says it all
TGLPerspectiveCamera fPerspectiveCameraXOY
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Calculate and return pixel distance to nearest viewer object from window location px...
Float_t GetMaxSceneDrawTimeHQ() const
TGLColorSet * GetBaseColorSet()
Returns the current base color-set.
virtual void ResetCameras()
void SetMaxSceneDrawTimeHQ(Float_t t)
virtual void UnClicked(TObject *obj, UInt_t button, UInt_t state)
Emit UnClicked signal with button id and modifier state.
Bool_t GetDrawCameraCenter()
void PreDraw()
Perform GL work which must be done before each draw.
Selection record for overlay objects.
void UseDefaultColorSet(Bool_t x)
Set usage of the default color set.
void SetAutoRotator(TGLAutoRotator *ar)
Set the auto-rotator for this viewer. The old rotator is deleted.
TGLColorSet fDarkColorSet
viewport - drawn area
TGLRedrawTimer(TGLViewer &viewer)
Bool_t GetSmoothPoints() const
TGedEditor * fGedEditor
event handler
Bool_t fSmartRefresh
markup size of viewport in scene units
Float_t fPointScale
color-set with light background
TGLPerspectiveCamera fPerspectiveCameraYOZ
Bool_t fDrawCameraCenter
reference position
Bool_t SavePicture()
Save current image using the default file name which can be set via SetPictureFileName() and defaults...
void SetIgnoreSizesOnUpdate(Bool_t v)
TGLFaderHelper(TGLViewer *v, Float_t fade, Float_t time, Int_t steps)
TGLPShapeObj * fPShapeWrap
GED editor.
TGLSelectRecord fSecSelRec
select record from last select (should go to context)
void DrawDebugInfo()
If in debug mode draw camera aids and overall bounding box.
const char * Data() const
Bool_t fResetCamerasOnNextUpdate
TGLWidget * GetGLWidget()