Logo ROOT   6.12/07
Reference Guide
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 
18 class TGLSAFrame;
19 class TGLFormat;
20 class TGWindow;
21 class TGFrame;
22 class TGCompositeFrame;
23 class TGPopupMenu;
24 class TGButton;
25 
26 class TGedEditor;
27 class TGLEventHandler;
28 class TGMenuBar;
29 
30 //______________________________________________________________________________
31 //
32 // TGLSAViewer
33 //
34 // The top-level standalone GL viewer.
35 
36 
37 class TGLSAViewer : public TGLViewer
38 {
39 public:
49 
50 private:
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
92  TGLSAViewer(const TGLSAViewer &);
94 
95 public:
96  TGLSAViewer(TVirtualPad* pad, TGLFormat* format=0);
97  TGLSAViewer(const TGWindow* parent, TVirtualPad *pad, TGedEditor *ged=0,
98  TGLFormat* format=0);
99  ~TGLSAViewer();
100 
101  virtual void CreateGLWidget();
102  virtual void DestroyGLWidget();
103 
104  virtual const char* GetName() const { return "GLViewer"; }
105 
106  virtual void SelectionChanged();
107 
108  void Show();
109  void Close();
110  void DeleteMenuBar();
112  void EnableMenuBarHiding();
113  void DisableMenuBarHiding();
114  void MenuHidingTimeout();
115 
116  void HandleMenuBarHiding(Event_t* ev);
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  ClassDef(TGLSAViewer, 0); // Standalone GL viewer.
133 };
134 
135 #endif
136 
void ToggleEditObject()
Toggle state of the 'Edit Object' menu entry.
TGMenuBar * fMenuBar
Definition: TGLSAViewer.h:67
TGLFormat * fFormat
Definition: TGLSAViewer.h:53
TGPopupMenu * fHelpMenu
Definition: TGLSAViewer.h:57
static const Int_t fgInitX
Definition: TGLSAViewer.h:80
static const Int_t fgInitW
Definition: TGLSAViewer.h:82
static const Int_t fgInitH
Definition: TGLSAViewer.h:83
void MenuHidingTimeout()
Action for menu-hiding timeout.
TGLSAFrame * fFrame
Definition: TGLSAViewer.h:52
void ResetMenuHidingTimer(Bool_t show_menu)
Reset the timer for menu-bar hiding.
Basic string class.
Definition: TString.h:125
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGLFormat * GetFormat() const
Definition: TGLSAViewer.h:124
TGButton * fMenuBut
Definition: TGLSAViewer.h:68
Bool_t fDeleteMenuBar
Definition: TGLSAViewer.h:73
Bool_t fHideMenuBar
Definition: TGLSAViewer.h:69
#define ClassDef(name, id)
Definition: Rtypes.h:320
void HandleMenuBarHiding(Event_t *ev)
Maybe switch menu-bar / menu-button.
TGPopupMenu * fFileMenu
Definition: TGLSAViewer.h:54
TGLSAViewer(const TGLSAViewer &)
TString fDirName
Definition: TGLSAViewer.h:64
void DeleteMenuBar()
Delete the menu bar.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:49
void ToggleOrthoDolly()
Toggle state of the 'Ortho allow dolly' menu entry.
Encapsulation of format / contents of an OpenGL buffer.
Definition: TGLFormat.h:35
static void SetMenuHidingTimeout(Long_t timeout)
Set global timeout for menu-hiding in mili-seconds.
The top level standalone GL-viewer - created via plugin manager.
Definition: TGLSAViewer.h:37
TGPopupMenu * fCameraMenu
Definition: TGLSAViewer.h:56
TGCompositeFrame * GetLeftVerticalFrame() const
Definition: TGLSAViewer.h:122
void Close()
Close the viewer - destructed.
void DisableCloseMenuEntries()
Deactivate menu entries for closing the GL window and exiting ROOT.
Bool_t fOverwrite
Definition: TGLSAViewer.h:66
virtual void CreateGLWidget()
Create a GLwidget, it is an error if it is already created.
TGCompositeFrame * fLeftVerticalFrame
Definition: TGLSAViewer.h:60
void EnableMenuBarHiding()
Enable hiding of menu bar.
Bool_t ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t)
Process GUI message capture by the main GUI frame (TGLSAFrame).
TGPopupMenu * fFileSaveMenu
Definition: TGLSAViewer.h:55
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TTimer * fMenuHidingTimer
Definition: TGLSAViewer.h:70
virtual void SelectionChanged()
Update GUI components for embedded viewer selection change.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:53
Standalone GL Viewer GUI main frame.
Definition: TGLSAFrame.h:28
~TGLSAViewer()
Destroy standalone viewer object.
long Long_t
Definition: RtypesCore.h:50
TGCompositeFrame * fRightVerticalFrame
Definition: TGLSAViewer.h:62
void CreateFrames()
Internal frames creation.
Base-class and default implementation of event-handler for TGLViewer.
static const Int_t fgInitY
Definition: TGLSAViewer.h:81
void ToggleOrthoRotate()
Toggle state of the 'Ortho allow rotate' menu entry.
TGCompositeFrame * GetFrame() const
Return the main-frame.
Int_t fTypeIdx
Definition: TGLSAViewer.h:65
virtual const char * GetName() const
Returns name of object.
Definition: TGLSAViewer.h:104
static Long_t fgMenuHidingTimeout
Definition: TGLSAViewer.h:75
static const char * fgHelpText1
Definition: TGLSAViewer.h:85
Bool_t fMenuHidingShowMenu
Definition: TGLSAViewer.h:71
void Show()
Show the viewer.
void CreateMenus()
File/Camera/Help menus.
virtual void DestroyGLWidget()
Destroy the GLwidget, it is an error if it does not exist.
void DisableMenuBarHiding()
Disable hiding of menu bar.
static const char * fgHelpText2
Definition: TGLSAViewer.h:86
TGLSAViewer & operator=(const TGLSAViewer &)