TGLSAViewer.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLSAViewer.h 36895 2010-11-24 11:46:09Z matevz $
00002 // Author:  Richard Maunder / Timur Pocheptsov
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGLSAViewer
00013 #define ROOT_TGLSAViewer
00014 
00015 #include "TGLViewer.h"
00016 #include "TString.h"
00017 
00018 class TGLSAFrame;
00019 class TGLFormat;
00020 class TGWindow;
00021 class TGFrame;
00022 class TGCompositeFrame;
00023 class TGPopupMenu;
00024 class TGButton;
00025 
00026 class TGedEditor;
00027 class TGLEventHandler;
00028 class TGMenuBar;
00029 
00030 //______________________________________________________________________________
00031 //
00032 // TGLSAViewer
00033 //
00034 // The top-level standalone GL viewer.
00035 
00036 
00037 class TGLSAViewer : public TGLViewer
00038 {
00039 public:
00040    enum EGLSACommands {
00041       kGLHelpAbout, kGLHelpViewer,
00042       kGLPerspYOZ, kGLPerspXOZ, kGLPerspXOY,
00043       kGLXOY,  kGLXOZ,  kGLZOY,
00044       kGLXnOY, kGLXnOZ, kGLZnOY,
00045       kGLOrthoRotate, kGLOrthoDolly,
00046       kGLSaveEPS, kGLSavePDF, kGLSavePNG, kGLSaveGIF, kGLSaveAnimGIF,
00047       kGLSaveJPG, kGLSaveAS, kGLCloseViewer, kGLQuitROOT,
00048       kGLEditObject, kGLHideMenus };
00049 
00050 private:
00051    // GUI components
00052    TGLSAFrame        *fFrame;
00053    TGLFormat         *fFormat;
00054    TGPopupMenu       *fFileMenu;
00055    TGPopupMenu       *fFileSaveMenu;
00056    TGPopupMenu       *fCameraMenu;
00057    TGPopupMenu       *fHelpMenu;
00058 
00059    // Ged
00060    TGCompositeFrame  *fLeftVerticalFrame;
00061 
00062    TGCompositeFrame  *fRightVerticalFrame;
00063 
00064    TString            fDirName;
00065    Int_t              fTypeIdx;
00066    Bool_t             fOverwrite;
00067    TGMenuBar         *fMenuBar;
00068    TGButton          *fMenuBut;
00069    Bool_t             fHideMenuBar;
00070    TTimer            *fMenuHidingTimer;
00071    Bool_t             fMenuHidingShowMenu;
00072 
00073    Bool_t             fDeleteMenuBar;
00074 
00075    static Long_t      fgMenuHidingTimeout;
00076 
00077    void ResetMenuHidingTimer(Bool_t show_menu);
00078 
00079    // Initial window positioning
00080    static const Int_t fgInitX;
00081    static const Int_t fgInitY;
00082    static const Int_t fgInitW;
00083    static const Int_t fgInitH;
00084 
00085    static const char *fgHelpText1;
00086    static const char *fgHelpText2;
00087 
00088    void CreateMenus();
00089    void CreateFrames();
00090 
00091    // non-copyable class
00092    TGLSAViewer(const TGLSAViewer &);
00093    TGLSAViewer & operator = (const TGLSAViewer &);
00094 
00095 public:
00096    TGLSAViewer(TVirtualPad* pad, TGLFormat* format=0);
00097    TGLSAViewer(const TGWindow* parent, TVirtualPad *pad, TGedEditor *ged=0,
00098                TGLFormat* format=0);
00099    ~TGLSAViewer();
00100 
00101    virtual void CreateGLWidget();
00102    virtual void DestroyGLWidget();
00103 
00104    virtual const char* GetName() const { return "GLViewer"; }
00105 
00106    virtual void SelectionChanged();
00107 
00108    void   Show();
00109    void   Close();
00110    void   DeleteMenuBar();
00111    void   DisableCloseMenuEntries();
00112    void   EnableMenuBarHiding();
00113    void   DisableMenuBarHiding();
00114    void   MenuHidingTimeout();
00115 
00116    void   HandleMenuBarHiding(Event_t* ev);
00117 
00118    // GUI events - editors, frame etc
00119    Bool_t ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t);
00120 
00121    TGCompositeFrame* GetFrame() const;
00122    TGCompositeFrame* GetLeftVerticalFrame() const { return fLeftVerticalFrame; }
00123 
00124    TGLFormat*        GetFormat() const { return fFormat; }
00125 
00126    void ToggleEditObject();
00127    void ToggleOrthoRotate();
00128    void ToggleOrthoDolly();
00129 
00130    static void SetMenuHidingTimeout(Long_t timeout);
00131 
00132    ClassDef(TGLSAViewer, 0); // Standalone GL viewer.
00133 };
00134 
00135 #endif
00136 

Generated on Tue Jul 5 14:16:54 2011 for ROOT_528-00b_version by  doxygen 1.5.1