TGeoTabManager.h

Go to the documentation of this file.
00001 // @(#):$Id: TGeoTabManager.h 21565 2007-12-28 12:28:46Z brun $
00002 // Author: M.Gheata 
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2002, 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_TGeoTabManager
00013 #define ROOT_TGeoTabManager
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 //  TGeoTabManager                                                      //
00018 //                                                                      //
00019 //  Manager for editor tabs                                             //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 #ifndef ROOT_TGFrame
00024 #include "TGFrame.h"
00025 #endif
00026 
00027 #ifndef ROOT_TMap
00028 #include "TMap.h"
00029 #endif
00030 
00031 class TVirtualPad;
00032 class TClass;
00033 
00034 class TList;
00035 class TGCompositeFrame;
00036 class TGLabel;
00037 class TGTab;
00038 class TGComboBox;
00039 class TGListTree;
00040 class TGListTreeItem;
00041 class TGCanvas;
00042 
00043 class TGedEditor;
00044 
00045 class TGeoShape;
00046 class TGeoVolume;
00047 class TGeoMedium;
00048 class TGeoMaterial;
00049 class TGeoMatrix;
00050 
00051 class TGeoTreeDialog;
00052 class TGeoTransientPanel;
00053 
00054 class TGeoTabManager : public TObject {
00055   friend class TGeoManagerEditor;
00056 private:
00057    TGedEditor          *fGedEditor;         // Parent editor
00058    TVirtualPad         *fPad;               // Pad to which this applies
00059    TGTab               *fTab;               // Parent tab
00060    TGeoVolume          *fVolume;            // Edited volume
00061    TGeoTransientPanel  *fShapePanel;        // Panel for editing shapes
00062    TGeoTransientPanel  *fMediumPanel;       // Panel for editing media
00063    TGeoTransientPanel  *fMaterialPanel;     // Panel for editing materials
00064    TGeoTransientPanel  *fMatrixPanel;       // Panel for editing matrices
00065    TGCompositeFrame    *fVolumeTab;         // Volume tab
00066 
00067    static TMap         fgEditorToMgrMap;    // Map from ged-editor to associated tab-manager
00068 
00069    void                GetEditors(TClass *cl);
00070 public:
00071    TGeoTabManager(TGedEditor *ged);
00072    virtual ~TGeoTabManager();
00073 
00074    static TGeoTabManager *GetMakeTabManager(TGedEditor *ged); 
00075    static void         Cleanup(TGCompositeFrame *frame);  
00076    TVirtualPad        *GetPad() const {return fPad;}
00077    TGTab              *GetTab() const {return fTab;}
00078    Int_t               GetTabIndex() const;
00079    static void         MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p);
00080    void                SetVolTabEnabled(Bool_t flag=kTRUE);
00081    void                SetModel(TObject *model);
00082    void                SetTab();
00083    
00084    void                GetShapeEditor(TGeoShape *shape);
00085    void                GetVolumeEditor(TGeoVolume *vol);
00086    void                GetMatrixEditor(TGeoMatrix *matrix);
00087    void                GetMediumEditor(TGeoMedium *medium);
00088    void                GetMaterialEditor(TGeoMaterial *material);
00089 
00090    TGCompositeFrame   *GetVolumeTab() const {return fVolumeTab;}
00091    TGeoVolume         *GetVolume() const {return fVolume;}
00092 
00093    ClassDef(TGeoTabManager, 0)   // Tab manager for geometry editors
00094 };
00095 
00096 //////////////////////////////////////////////////////////////////////////
00097 //                                                                      //
00098 //  TGeoTreeDialog                                                      //
00099 //                                                                      //
00100 //  Dialog frame for selecting objects with a tree hierarchy            //
00101 //                                                                      //
00102 //////////////////////////////////////////////////////////////////////////
00103 
00104 class TGeoTreeDialog : public TGTransientFrame {
00105 
00106 protected:
00107    static TObject     *fgSelectedObj;       // Selected object
00108    TGCanvas           *fCanvas;             // TGCanvas containing the list tree
00109    TGLabel            *fObjLabel;           // Label for selected object
00110    TGListTree         *fLT;                 // List tree for selecting
00111    TGCompositeFrame   *f1;                  // Composite frame containing the selection
00112    TGTextButton       *fClose;              // Close button
00113 
00114    virtual void        BuildListTree() = 0;
00115    virtual void        ConnectSignalsToSlots() = 0;
00116 public:
00117    TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
00118    virtual ~TGeoTreeDialog();
00119    
00120    static TObject     *GetSelected();
00121    // Slots
00122    virtual void        DoClose() = 0;
00123    virtual void        DoItemClick(TGListTreeItem *item, Int_t btn) = 0;
00124    void                DoSelect(TGListTreeItem *item);
00125 
00126    ClassDef(TGeoTreeDialog, 0)   // List-Tree based dialog
00127 };
00128 
00129 //////////////////////////////////////////////////////////////////////////
00130 //                                                                      //
00131 //  TGeoVolumeDialog                                                    //
00132 //                                                                      //
00133 //  Special tree dialog class for selecting volumes.                    //
00134 //                                                                      //
00135 //////////////////////////////////////////////////////////////////////////
00136 
00137 class TGeoVolumeDialog : public TGeoTreeDialog {
00138 
00139 protected:
00140    virtual void        BuildListTree();
00141    virtual void        ConnectSignalsToSlots();
00142 
00143 public:
00144    TGeoVolumeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
00145    virtual ~TGeoVolumeDialog() {;}
00146    
00147    // Slots
00148    virtual void        DoClose();
00149    virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);
00150 
00151    ClassDef(TGeoVolumeDialog, 0)   // List-Tree based volume dialog
00152 };
00153 
00154 //////////////////////////////////////////////////////////////////////////
00155 //                                                                      //
00156 //  TGeoShapeDialog                                                     //
00157 //                                                                      //
00158 //  Special tree dialog class for selecting shapes.                     //
00159 //                                                                      //
00160 //////////////////////////////////////////////////////////////////////////
00161 
00162 class TGeoShapeDialog : public TGeoTreeDialog {
00163 
00164 protected:
00165    virtual void        BuildListTree();
00166    virtual void        ConnectSignalsToSlots();
00167 
00168 public:
00169    TGeoShapeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
00170    virtual ~TGeoShapeDialog() {;}
00171    
00172    // Slots
00173    virtual void        DoClose();
00174    virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);
00175 
00176    ClassDef(TGeoShapeDialog, 0)   // List-Tree based shape dialog
00177 };
00178 
00179 //////////////////////////////////////////////////////////////////////////
00180 //                                                                      //
00181 //  TGeoMediumDialog                                                    //
00182 //                                                                      //
00183 //  Special tree dialog class for selecting media.                      //
00184 //                                                                      //
00185 //////////////////////////////////////////////////////////////////////////
00186 
00187 class TGeoMediumDialog : public TGeoTreeDialog {
00188 
00189 protected:
00190    virtual void        BuildListTree();
00191    virtual void        ConnectSignalsToSlots();
00192 
00193 public:
00194    TGeoMediumDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
00195    virtual ~TGeoMediumDialog() {;}
00196    
00197    // Slots
00198    virtual void        DoClose();
00199    virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);
00200 
00201    ClassDef(TGeoMediumDialog, 0)   // List-Tree based medium dialog
00202 };
00203 
00204 //////////////////////////////////////////////////////////////////////////
00205 //                                                                      //
00206 //  TGeoMaterialDialog                                                  //
00207 //                                                                      //
00208 //  Special tree dialog class for selecting materials.                  //
00209 //                                                                      //
00210 //////////////////////////////////////////////////////////////////////////
00211 
00212 class TGeoMaterialDialog : public TGeoTreeDialog {
00213 
00214 protected:
00215    virtual void        BuildListTree();
00216    virtual void        ConnectSignalsToSlots();
00217 
00218 public:
00219    TGeoMaterialDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
00220    virtual ~TGeoMaterialDialog() {;}
00221    
00222    // Slots
00223    virtual void        DoClose();
00224    virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);
00225 
00226    ClassDef(TGeoMaterialDialog, 0)   // List-Tree based material dialog
00227 };
00228 
00229 //////////////////////////////////////////////////////////////////////////
00230 //                                                                      //
00231 //  TGeoMatrixDialog                                                    //
00232 //                                                                      //
00233 //  Special tree dialog class for selecting matrices.                   //
00234 //                                                                      //
00235 //////////////////////////////////////////////////////////////////////////
00236 
00237 class TGeoMatrixDialog : public TGeoTreeDialog {
00238 
00239 protected:
00240    virtual void        BuildListTree();
00241    virtual void        ConnectSignalsToSlots();
00242 
00243 public:
00244    TGeoMatrixDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
00245    virtual ~TGeoMatrixDialog() {;}
00246    
00247    // Slots
00248    virtual void        DoClose();
00249    virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);
00250 
00251    ClassDef(TGeoMatrixDialog, 0)   // List-Tree based matrix dialog
00252 };
00253 
00254 //////////////////////////////////////////////////////////////////////////
00255 //                                                                      //
00256 //  TGeoTransientPanel                                                  //
00257 //                                                                      //
00258 //  Special transient tab holding TGeo editors.                         //
00259 //                                                                      //
00260 //////////////////////////////////////////////////////////////////////////
00261 
00262 class TGeoTransientPanel : public TGMainFrame {
00263    TGedEditor       *fGedEditor;        // ged-editor steering this panel
00264    TGCanvas         *fCan;              // TGCanvas containing a TGTab
00265    TGTab            *fTab;              //tab widget holding the editor
00266    TGCompositeFrame *fTabContainer;     //main tab container
00267    TGCompositeFrame *fStyle;            //style tab container frame
00268    TObject          *fModel;            //selected object
00269    TGTextButton     *fClose;            //close button
00270    
00271 public:
00272    TGeoTransientPanel(TGedEditor* ged, const char *name, TObject *obj);
00273    virtual ~TGeoTransientPanel();
00274    
00275    virtual void        CloseWindow();
00276    virtual void        DeleteEditors();
00277    
00278    TGTab              *GetTab() const {return fTab;}
00279    TGCompositeFrame   *GetStyle() const {return fStyle;}
00280    TObject            *GetModel() const {return fModel;}
00281 
00282    void                GetEditors(TClass *cl);
00283    virtual void        Hide();
00284    virtual void        Show();
00285    void                SetModel(TObject *model);
00286 
00287    ClassDef(TGeoTransientPanel, 0)   // List-Tree based dialog
00288 };
00289 
00290 #endif

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