Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLSAViewer.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Richard Maunder / Timur Pocheptsov
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGLSAViewer
13#define ROOT_TGLSAViewer
14
15#include "TGLViewer.h"
16#include "TString.h"
17
18class TGLSAFrame;
19class TGLFormat;
20class TGWindow;
21class TGFrame;
23class TGPopupMenu;
24class TGButton;
25
26class TGedEditor;
27class TGLEventHandler;
28class TGMenuBar;
29
30//______________________________________________________________________________
31//
32// TGLSAViewer
33//
34// The top-level standalone GL viewer.
35
36
37class TGLSAViewer : public TGLViewer
38{
39public:
49
50private:
51 // GUI components
58
59 // Ged
61
63
72
74
76
77 void ResetMenuHidingTimer(Bool_t show_menu);
78
79 // Initial window positioning
80 static const Int_t fgInitX;
81 static const Int_t fgInitY;
82 static const Int_t fgInitW;
83 static const Int_t fgInitH;
84
85 static const char *fgHelpText1;
86 static const char *fgHelpText2;
87
88 void CreateMenus();
89 void CreateFrames();
90
91 // non-copyable class
94
95public:
97 TGLSAViewer(const TGWindow* parent, TVirtualPad *pad, TGedEditor *ged=nullptr,
98 TGLFormat* format=nullptr);
99 ~TGLSAViewer() override;
100
101 void CreateGLWidget() override;
102 void DestroyGLWidget() override;
103
104 const char* GetName() const override { return "GLViewer"; }
105
106 void SelectionChanged() override;
107
108 void Show();
109 void Close();
110 void DeleteMenuBar();
112 void EnableMenuBarHiding();
114 void MenuHidingTimeout();
115
117
118 // GUI events - editors, frame etc
120
121 TGCompositeFrame* GetFrame() const;
123
124 TGLFormat* GetFormat() const { return fFormat; }
125
126 void ToggleEditObject();
127 void ToggleOrthoRotate();
128 void ToggleOrthoDolly();
129
130 static void SetMenuHidingTimeout(Long_t timeout);
131
132 ClassDefOverride(TGLSAViewer, 0); // Standalone GL viewer.
133};
134
135#endif
136
bool Bool_t
Definition RtypesCore.h:63
long Long_t
Definition RtypesCore.h:54
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
A button abstract base class.
Definition TGButton.h:68
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
Base-class and default implementation of event-handler for TGLViewer.
Encapsulation of format / contents of an OpenGL buffer.
Definition TGLFormat.h:36
Standalone GL Viewer GUI main frame.
Definition TGLSAFrame.h:29
The top level standalone GL-viewer - created via plugin manager.
Definition TGLSAViewer.h:38
void Show()
Show the viewer.
Bool_t fDeleteMenuBar
Definition TGLSAViewer.h:73
static void SetMenuHidingTimeout(Long_t timeout)
Set global timeout for menu-hiding in mili-seconds.
void ToggleOrthoDolly()
Toggle state of the 'Ortho allow dolly' menu entry.
TGPopupMenu * fFileMenu
Definition TGLSAViewer.h:54
static const Int_t fgInitH
Definition TGLSAViewer.h:83
Bool_t ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t)
Process GUI message capture by the main GUI frame (TGLSAFrame).
void EnableMenuBarHiding()
Enable hiding of menu bar.
TGLSAViewer(const TGLSAViewer &)
TString fDirName
Definition TGLSAViewer.h:64
TGCompositeFrame * fRightVerticalFrame
Definition TGLSAViewer.h:62
TGMenuBar * fMenuBar
Definition TGLSAViewer.h:67
TGLFormat * GetFormat() const
TGPopupMenu * fHelpMenu
Definition TGLSAViewer.h:57
void ResetMenuHidingTimer(Bool_t show_menu)
Reset the timer for menu-bar hiding.
void CreateMenus()
File/Camera/Help menus.
void ToggleOrthoRotate()
Toggle state of the 'Ortho allow rotate' menu entry.
void CreateFrames()
Internal frames creation.
void SelectionChanged() override
Update GUI components for embedded viewer selection change.
Int_t fTypeIdx
Definition TGLSAViewer.h:65
void CreateGLWidget() override
Create a GLwidget, it is an error if it is already created.
void DeleteMenuBar()
Delete the menu bar.
void HandleMenuBarHiding(Event_t *ev)
Maybe switch menu-bar / menu-button.
static const char * fgHelpText2
Definition TGLSAViewer.h:86
TTimer * fMenuHidingTimer
Definition TGLSAViewer.h:70
void MenuHidingTimeout()
Action for menu-hiding timeout.
static Long_t fgMenuHidingTimeout
Definition TGLSAViewer.h:75
TGLSAViewer & operator=(const TGLSAViewer &)
void DestroyGLWidget() override
Destroy the GLwidget, it is an error if it does not exist.
const char * GetName() const override
Returns name of object.
void Close()
Close the viewer - destructed.
void DisableMenuBarHiding()
Disable hiding of menu bar.
Bool_t fOverwrite
Definition TGLSAViewer.h:66
static const Int_t fgInitX
Definition TGLSAViewer.h:80
Bool_t fHideMenuBar
Definition TGLSAViewer.h:69
static const Int_t fgInitW
Definition TGLSAViewer.h:82
TGLFormat * fFormat
Definition TGLSAViewer.h:53
TGPopupMenu * fFileSaveMenu
Definition TGLSAViewer.h:55
TGCompositeFrame * GetLeftVerticalFrame() const
void ToggleEditObject()
Toggle state of the 'Edit Object' menu entry.
TGCompositeFrame * GetFrame() const
Return the main-frame.
TGButton * fMenuBut
Definition TGLSAViewer.h:68
TGPopupMenu * fCameraMenu
Definition TGLSAViewer.h:56
~TGLSAViewer() override
Destroy standalone viewer object.
TGCompositeFrame * fLeftVerticalFrame
Definition TGLSAViewer.h:60
void DisableCloseMenuEntries()
Deactivate menu entries for closing the GL window and exiting ROOT.
TGLSAFrame * fFrame
Definition TGLSAViewer.h:52
static const char * fgHelpText1
Definition TGLSAViewer.h:85
static const Int_t fgInitY
Definition TGLSAViewer.h:81
Bool_t fMenuHidingShowMenu
Definition TGLSAViewer.h:71
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition TGLViewer.h:55
The TGMenu.h header contains all different menu classes.
Definition TGMenu.h:282
This class creates a popup menu object.
Definition TGMenu.h:110
ROOT GUI Window base class.
Definition TGWindow.h:23
Basic string class.
Definition TString.h:139
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
Event structure.
Definition GuiTypes.h:174