ROOT logo
// @(#):$Id$
// Author: M.Gheata 

/*************************************************************************
 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGeoTabManager
#define ROOT_TGeoTabManager

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoTabManager                                                      //
//                                                                      //
//  Manager for editor tabs                                             //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif

#ifndef ROOT_TMap
#include "TMap.h"
#endif

class TVirtualPad;
class TClass;

class TList;
class TGCompositeFrame;
class TGLabel;
class TGTab;
class TGComboBox;
class TGListTree;
class TGListTreeItem;
class TGCanvas;

class TGedEditor;

class TGeoShape;
class TGeoVolume;
class TGeoMedium;
class TGeoMaterial;
class TGeoMatrix;

class TGeoTreeDialog;
class TGeoTransientPanel;

class TGeoTabManager : public TObject {
  friend class TGeoManagerEditor;
private:
   TGedEditor          *fGedEditor;         // Parent editor
   TVirtualPad         *fPad;               // Pad to which this applies
   TGTab               *fTab;               // Parent tab
   TGeoVolume          *fVolume;            // Edited volume
   TGeoTransientPanel  *fShapePanel;        // Panel for editing shapes
   TGeoTransientPanel  *fMediumPanel;       // Panel for editing media
   TGeoTransientPanel  *fMaterialPanel;     // Panel for editing materials
   TGeoTransientPanel  *fMatrixPanel;       // Panel for editing matrices
   TGCompositeFrame    *fVolumeTab;         // Volume tab

   static TMap         fgEditorToMgrMap;    // Map from ged-editor to associated tab-manager

   void                GetEditors(TClass *cl);
public:
   TGeoTabManager(TGedEditor *ged);
   virtual ~TGeoTabManager();

   static TGeoTabManager *GetMakeTabManager(TGedEditor *ged); 
   static void         Cleanup(TGCompositeFrame *frame);  
   TVirtualPad        *GetPad() const {return fPad;}
   TGTab              *GetTab() const {return fTab;}
   Int_t               GetTabIndex() const;
   static void         MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p);
   void                SetVolTabEnabled(Bool_t flag=kTRUE);
   void                SetModel(TObject *model);
   void                SetTab();
   
   void                GetShapeEditor(TGeoShape *shape);
   void                GetVolumeEditor(TGeoVolume *vol);
   void                GetMatrixEditor(TGeoMatrix *matrix);
   void                GetMediumEditor(TGeoMedium *medium);
   void                GetMaterialEditor(TGeoMaterial *material);

   TGCompositeFrame   *GetVolumeTab() const {return fVolumeTab;}
   TGeoVolume         *GetVolume() const {return fVolume;}

   ClassDef(TGeoTabManager, 0)   // Tab manager for geometry editors
};

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoTreeDialog                                                      //
//                                                                      //
//  Dialog frame for selecting objects with a tree hierarchy            //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGeoTreeDialog : public TGTransientFrame {

protected:
   static TObject     *fgSelectedObj;       // Selected object
   TGCanvas           *fCanvas;             // TGCanvas containing the list tree
   TGLabel            *fObjLabel;           // Label for selected object
   TGListTree         *fLT;                 // List tree for selecting
   TGCompositeFrame   *f1;                  // Composite frame containing the selection
   TGTextButton       *fClose;              // Close button

   virtual void        BuildListTree() = 0;
   virtual void        ConnectSignalsToSlots() = 0;
public:
   TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
   virtual ~TGeoTreeDialog();
   
   static TObject     *GetSelected();
   // Slots
   virtual void        DoClose() = 0;
   virtual void        DoItemClick(TGListTreeItem *item, Int_t btn) = 0;
   void                DoSelect(TGListTreeItem *item);

   ClassDef(TGeoTreeDialog, 0)   // List-Tree based dialog
};

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoVolumeDialog                                                    //
//                                                                      //
//  Special tree dialog class for selecting volumes.                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGeoVolumeDialog : public TGeoTreeDialog {

protected:
   virtual void        BuildListTree();
   virtual void        ConnectSignalsToSlots();

public:
   TGeoVolumeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
   virtual ~TGeoVolumeDialog() {;}
   
   // Slots
   virtual void        DoClose();
   virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);

   ClassDef(TGeoVolumeDialog, 0)   // List-Tree based volume dialog
};

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoShapeDialog                                                     //
//                                                                      //
//  Special tree dialog class for selecting shapes.                     //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGeoShapeDialog : public TGeoTreeDialog {

protected:
   virtual void        BuildListTree();
   virtual void        ConnectSignalsToSlots();

public:
   TGeoShapeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
   virtual ~TGeoShapeDialog() {;}
   
   // Slots
   virtual void        DoClose();
   virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);

   ClassDef(TGeoShapeDialog, 0)   // List-Tree based shape dialog
};

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoMediumDialog                                                    //
//                                                                      //
//  Special tree dialog class for selecting media.                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGeoMediumDialog : public TGeoTreeDialog {

protected:
   virtual void        BuildListTree();
   virtual void        ConnectSignalsToSlots();

public:
   TGeoMediumDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
   virtual ~TGeoMediumDialog() {;}
   
   // Slots
   virtual void        DoClose();
   virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);

   ClassDef(TGeoMediumDialog, 0)   // List-Tree based medium dialog
};

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoMaterialDialog                                                  //
//                                                                      //
//  Special tree dialog class for selecting materials.                  //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGeoMaterialDialog : public TGeoTreeDialog {

protected:
   virtual void        BuildListTree();
   virtual void        ConnectSignalsToSlots();

public:
   TGeoMaterialDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
   virtual ~TGeoMaterialDialog() {;}
   
   // Slots
   virtual void        DoClose();
   virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);

   ClassDef(TGeoMaterialDialog, 0)   // List-Tree based material dialog
};

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoMatrixDialog                                                    //
//                                                                      //
//  Special tree dialog class for selecting matrices.                   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGeoMatrixDialog : public TGeoTreeDialog {

protected:
   virtual void        BuildListTree();
   virtual void        ConnectSignalsToSlots();

public:
   TGeoMatrixDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
   virtual ~TGeoMatrixDialog() {;}
   
   // Slots
   virtual void        DoClose();
   virtual void        DoItemClick(TGListTreeItem *item, Int_t btn);

   ClassDef(TGeoMatrixDialog, 0)   // List-Tree based matrix dialog
};

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoTransientPanel                                                  //
//                                                                      //
//  Special transient tab holding TGeo editors.                         //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGeoTransientPanel : public TGMainFrame {
   TGedEditor       *fGedEditor;        // ged-editor steering this panel
   TGCanvas         *fCan;              // TGCanvas containing a TGTab
   TGTab            *fTab;              //tab widget holding the editor
   TGCompositeFrame *fTabContainer;     //main tab container
   TGCompositeFrame *fStyle;            //style tab container frame
   TObject          *fModel;            //selected object
   TGTextButton     *fClose;            //close button
   
public:
   TGeoTransientPanel(TGedEditor* ged, const char *name, TObject *obj);
   virtual ~TGeoTransientPanel();
   
   virtual void        CloseWindow();
   virtual void        DeleteEditors();
   
   TGTab              *GetTab() const {return fTab;}
   TGCompositeFrame   *GetStyle() const {return fStyle;}
   TObject            *GetModel() const {return fModel;}

   void                GetEditors(TClass *cl);
   virtual void        Hide();
   virtual void        Show();
   void                SetModel(TObject *model);

   ClassDef(TGeoTransientPanel, 0)   // List-Tree based dialog
};

#endif
 TGeoTabManager.h:1
 TGeoTabManager.h:2
 TGeoTabManager.h:3
 TGeoTabManager.h:4
 TGeoTabManager.h:5
 TGeoTabManager.h:6
 TGeoTabManager.h:7
 TGeoTabManager.h:8
 TGeoTabManager.h:9
 TGeoTabManager.h:10
 TGeoTabManager.h:11
 TGeoTabManager.h:12
 TGeoTabManager.h:13
 TGeoTabManager.h:14
 TGeoTabManager.h:15
 TGeoTabManager.h:16
 TGeoTabManager.h:17
 TGeoTabManager.h:18
 TGeoTabManager.h:19
 TGeoTabManager.h:20
 TGeoTabManager.h:21
 TGeoTabManager.h:22
 TGeoTabManager.h:23
 TGeoTabManager.h:24
 TGeoTabManager.h:25
 TGeoTabManager.h:26
 TGeoTabManager.h:27
 TGeoTabManager.h:28
 TGeoTabManager.h:29
 TGeoTabManager.h:30
 TGeoTabManager.h:31
 TGeoTabManager.h:32
 TGeoTabManager.h:33
 TGeoTabManager.h:34
 TGeoTabManager.h:35
 TGeoTabManager.h:36
 TGeoTabManager.h:37
 TGeoTabManager.h:38
 TGeoTabManager.h:39
 TGeoTabManager.h:40
 TGeoTabManager.h:41
 TGeoTabManager.h:42
 TGeoTabManager.h:43
 TGeoTabManager.h:44
 TGeoTabManager.h:45
 TGeoTabManager.h:46
 TGeoTabManager.h:47
 TGeoTabManager.h:48
 TGeoTabManager.h:49
 TGeoTabManager.h:50
 TGeoTabManager.h:51
 TGeoTabManager.h:52
 TGeoTabManager.h:53
 TGeoTabManager.h:54
 TGeoTabManager.h:55
 TGeoTabManager.h:56
 TGeoTabManager.h:57
 TGeoTabManager.h:58
 TGeoTabManager.h:59
 TGeoTabManager.h:60
 TGeoTabManager.h:61
 TGeoTabManager.h:62
 TGeoTabManager.h:63
 TGeoTabManager.h:64
 TGeoTabManager.h:65
 TGeoTabManager.h:66
 TGeoTabManager.h:67
 TGeoTabManager.h:68
 TGeoTabManager.h:69
 TGeoTabManager.h:70
 TGeoTabManager.h:71
 TGeoTabManager.h:72
 TGeoTabManager.h:73
 TGeoTabManager.h:74
 TGeoTabManager.h:75
 TGeoTabManager.h:76
 TGeoTabManager.h:77
 TGeoTabManager.h:78
 TGeoTabManager.h:79
 TGeoTabManager.h:80
 TGeoTabManager.h:81
 TGeoTabManager.h:82
 TGeoTabManager.h:83
 TGeoTabManager.h:84
 TGeoTabManager.h:85
 TGeoTabManager.h:86
 TGeoTabManager.h:87
 TGeoTabManager.h:88
 TGeoTabManager.h:89
 TGeoTabManager.h:90
 TGeoTabManager.h:91
 TGeoTabManager.h:92
 TGeoTabManager.h:93
 TGeoTabManager.h:94
 TGeoTabManager.h:95
 TGeoTabManager.h:96
 TGeoTabManager.h:97
 TGeoTabManager.h:98
 TGeoTabManager.h:99
 TGeoTabManager.h:100
 TGeoTabManager.h:101
 TGeoTabManager.h:102
 TGeoTabManager.h:103
 TGeoTabManager.h:104
 TGeoTabManager.h:105
 TGeoTabManager.h:106
 TGeoTabManager.h:107
 TGeoTabManager.h:108
 TGeoTabManager.h:109
 TGeoTabManager.h:110
 TGeoTabManager.h:111
 TGeoTabManager.h:112
 TGeoTabManager.h:113
 TGeoTabManager.h:114
 TGeoTabManager.h:115
 TGeoTabManager.h:116
 TGeoTabManager.h:117
 TGeoTabManager.h:118
 TGeoTabManager.h:119
 TGeoTabManager.h:120
 TGeoTabManager.h:121
 TGeoTabManager.h:122
 TGeoTabManager.h:123
 TGeoTabManager.h:124
 TGeoTabManager.h:125
 TGeoTabManager.h:126
 TGeoTabManager.h:127
 TGeoTabManager.h:128
 TGeoTabManager.h:129
 TGeoTabManager.h:130
 TGeoTabManager.h:131
 TGeoTabManager.h:132
 TGeoTabManager.h:133
 TGeoTabManager.h:134
 TGeoTabManager.h:135
 TGeoTabManager.h:136
 TGeoTabManager.h:137
 TGeoTabManager.h:138
 TGeoTabManager.h:139
 TGeoTabManager.h:140
 TGeoTabManager.h:141
 TGeoTabManager.h:142
 TGeoTabManager.h:143
 TGeoTabManager.h:144
 TGeoTabManager.h:145
 TGeoTabManager.h:146
 TGeoTabManager.h:147
 TGeoTabManager.h:148
 TGeoTabManager.h:149
 TGeoTabManager.h:150
 TGeoTabManager.h:151
 TGeoTabManager.h:152
 TGeoTabManager.h:153
 TGeoTabManager.h:154
 TGeoTabManager.h:155
 TGeoTabManager.h:156
 TGeoTabManager.h:157
 TGeoTabManager.h:158
 TGeoTabManager.h:159
 TGeoTabManager.h:160
 TGeoTabManager.h:161
 TGeoTabManager.h:162
 TGeoTabManager.h:163
 TGeoTabManager.h:164
 TGeoTabManager.h:165
 TGeoTabManager.h:166
 TGeoTabManager.h:167
 TGeoTabManager.h:168
 TGeoTabManager.h:169
 TGeoTabManager.h:170
 TGeoTabManager.h:171
 TGeoTabManager.h:172
 TGeoTabManager.h:173
 TGeoTabManager.h:174
 TGeoTabManager.h:175
 TGeoTabManager.h:176
 TGeoTabManager.h:177
 TGeoTabManager.h:178
 TGeoTabManager.h:179
 TGeoTabManager.h:180
 TGeoTabManager.h:181
 TGeoTabManager.h:182
 TGeoTabManager.h:183
 TGeoTabManager.h:184
 TGeoTabManager.h:185
 TGeoTabManager.h:186
 TGeoTabManager.h:187
 TGeoTabManager.h:188
 TGeoTabManager.h:189
 TGeoTabManager.h:190
 TGeoTabManager.h:191
 TGeoTabManager.h:192
 TGeoTabManager.h:193
 TGeoTabManager.h:194
 TGeoTabManager.h:195
 TGeoTabManager.h:196
 TGeoTabManager.h:197
 TGeoTabManager.h:198
 TGeoTabManager.h:199
 TGeoTabManager.h:200
 TGeoTabManager.h:201
 TGeoTabManager.h:202
 TGeoTabManager.h:203
 TGeoTabManager.h:204
 TGeoTabManager.h:205
 TGeoTabManager.h:206
 TGeoTabManager.h:207
 TGeoTabManager.h:208
 TGeoTabManager.h:209
 TGeoTabManager.h:210
 TGeoTabManager.h:211
 TGeoTabManager.h:212
 TGeoTabManager.h:213
 TGeoTabManager.h:214
 TGeoTabManager.h:215
 TGeoTabManager.h:216
 TGeoTabManager.h:217
 TGeoTabManager.h:218
 TGeoTabManager.h:219
 TGeoTabManager.h:220
 TGeoTabManager.h:221
 TGeoTabManager.h:222
 TGeoTabManager.h:223
 TGeoTabManager.h:224
 TGeoTabManager.h:225
 TGeoTabManager.h:226
 TGeoTabManager.h:227
 TGeoTabManager.h:228
 TGeoTabManager.h:229
 TGeoTabManager.h:230
 TGeoTabManager.h:231
 TGeoTabManager.h:232
 TGeoTabManager.h:233
 TGeoTabManager.h:234
 TGeoTabManager.h:235
 TGeoTabManager.h:236
 TGeoTabManager.h:237
 TGeoTabManager.h:238
 TGeoTabManager.h:239
 TGeoTabManager.h:240
 TGeoTabManager.h:241
 TGeoTabManager.h:242
 TGeoTabManager.h:243
 TGeoTabManager.h:244
 TGeoTabManager.h:245
 TGeoTabManager.h:246
 TGeoTabManager.h:247
 TGeoTabManager.h:248
 TGeoTabManager.h:249
 TGeoTabManager.h:250
 TGeoTabManager.h:251
 TGeoTabManager.h:252
 TGeoTabManager.h:253
 TGeoTabManager.h:254
 TGeoTabManager.h:255
 TGeoTabManager.h:256
 TGeoTabManager.h:257
 TGeoTabManager.h:258
 TGeoTabManager.h:259
 TGeoTabManager.h:260
 TGeoTabManager.h:261
 TGeoTabManager.h:262
 TGeoTabManager.h:263
 TGeoTabManager.h:264
 TGeoTabManager.h:265
 TGeoTabManager.h:266
 TGeoTabManager.h:267
 TGeoTabManager.h:268
 TGeoTabManager.h:269
 TGeoTabManager.h:270
 TGeoTabManager.h:271
 TGeoTabManager.h:272
 TGeoTabManager.h:273
 TGeoTabManager.h:274
 TGeoTabManager.h:275
 TGeoTabManager.h:276
 TGeoTabManager.h:277
 TGeoTabManager.h:278
 TGeoTabManager.h:279
 TGeoTabManager.h:280
 TGeoTabManager.h:281
 TGeoTabManager.h:282
 TGeoTabManager.h:283
 TGeoTabManager.h:284
 TGeoTabManager.h:285
 TGeoTabManager.h:286
 TGeoTabManager.h:287
 TGeoTabManager.h:288
 TGeoTabManager.h:289
 TGeoTabManager.h:290