// @(#):$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_TGeoManagerEditor
#define ROOT_TGeoManagerEditor

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoManagerEditor                                                   //
//                                                                      //
//  Editor for a TGeoManager.                                           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGButton
#include "TGWidget.h"
#endif
#ifndef ROOT_TGeoGedFrame
#include "TGeoGedFrame.h"
#endif

class TGeoManager;
class TGeoVolume;
class TGeoShape;
class TGeoMedium;
class TGeoMaterial;
class TGeoMatrix;
class TGShutter;
class TGShutterItem;
class TGTextEntry;
class TGTab;
class TGComboBox;
class TGNumberEntry;
class TGTextButton;
class TGPictureButton;
class TGCheckButton;
class TGRadioButton;
class TGeoTabManager;

class TGeoManagerEditor : public TGedFrame {

protected:

   TGeoManager         *fGeometry;          // Selected geometry manager
   TGeoTabManager      *fTabMgr;            // Tab manager
   TGTab               *fTab;               // TGTab of GedEditor
   TGCompositeFrame    *fVolumeTab;         // Tab of Volume tab
   Bool_t               fIsModified;        // Flag that manager was modified
   TGShutter           *fCategories;        // Categories shutter
   TGTextEntry         *fManagerName;       // Name text entry
   TGTextEntry         *fManagerTitle;      // Title text entry
   TGTextEntry         *fMediumName;        // Medium name text entry
   TGTextEntry         *fMatrixName;        // Matrix name text entry
   TGTextEntry         *fMaterialName;      // Material name text entry
   TGTextEntry         *fVolumeName;        // Volume name text entry
   TGeoMaterial        *fSelectedMaterial;   // Selected material
   TGeoMaterial        *fSelectedMaterial2;  // Selected material for medium creation
   TGLabel             *fLSelMaterial;      // Selected material label
   TGLabel             *fLSelMaterial2;      // Selected material label
   TGPictureButton     *fBSelMaterial;      // Button for selecting a material
   TGPictureButton     *fBSelMaterial2;      // Button for selecting a material
   TGeoVolume          *fSelectedVolume;    // Selected volume
   TGLabel             *fLSelVolume;        // Selected volume label
   TGPictureButton     *fBSelVolume;        // Button for selecting a volume
   TGeoShape           *fSelectedShape;     // Selected shape
   TGeoShape           *fSelectedShape2;    // Selected shape for volume creation
   TGLabel             *fLSelShape;         // Selected shape label
   TGLabel             *fLSelShape2;         // Selected shape label
   TGPictureButton     *fBSelShape;         // Button for selecting a shape
   TGPictureButton     *fBSelShape2;         // Button for selecting a shape
   TGeoMatrix          *fSelectedMatrix;    // Selected matrix
   TGLabel             *fLSelMatrix;        // Selected matrix label
   TGPictureButton     *fBSelMatrix;        // Button for selecting a matrix
   TGeoMedium          *fSelectedMedium;    // Selected medium
   TGeoMedium          *fSelectedMedium2;    // Selected medium for volume creation
   TGLabel             *fLSelMedium;        // Selected medium label
   TGLabel             *fLSelMedium2;        // Selected medium label
   TGPictureButton     *fBSelMedium;        // Button for selecting a medium
   TGPictureButton     *fBSelMedium2;       // Button for selecting a medium
   TGPictureButton     *fShapeButton[21];   // List of shape buttons
   TGPictureButton     *fMatrixButton[3];   // List of matrix buttons
   TGPictureButton     *fVolumeButton[2];   // List of volume buttons
   TGPictureButton     *fMaterialButton[2]; // List of material buttons
   TGRadioButton       *fExportOption[2];   // Export option buttons
   TGTextButton        *fExportButton;      // Button to export geometry
   TGComboBox          *fElementList;       // Combo box for elements
   TGNumberEntry       *fEntryDensity;      // Number entry for material density
   TGPictureButton     *fMediumButton;      // Button to create a medium
   TGNumberEntry       *fMediumId;          // Medium ID number entry
   TGTextButton        *fEditShape;         // Button for editing selected shape
   TGTextButton        *fEditMedium;        // Button for editing a medium
   TGTextButton        *fEditMaterial;      // Button for editing a material
   TGTextButton        *fEditMatrix;        // Button for editing a matrix
   TGTextButton        *fEditVolume;        // Button for editing a volume
   TGTextButton        *fSetTopVolume;      // Button for setting top volume
   TGLabel             *fLSelTop;           // Selected top volume
   TGPictureButton     *fBSelTop;           // Button for selecting top volume
   TGTextButton        *fCloseGeometry;     // Button for closing the geometry
   TGCompositeFrame    *f2;                 // Parent frame for shape editing
   TGCompositeFrame    *f3;                 // Parent frame for volume editing
   TGCompositeFrame    *f4;                 // Parent frame for materials editing
   TGCompositeFrame    *f5;                 // Parent frame for media editing
   TGCompositeFrame    *f6;                 // Parent frame for matrices editing
   TGCompositeFrame    *f7;                 // Parent frame for closing geometry
   TCanvas             *fConnectedCanvas;   // Canvas connected to SelectedSlot()

   virtual void ConnectSignals2Slots();     // Connect the signals to the slots
   void           ShowSelectShape(Bool_t show=kTRUE);
   void           ShowSelectVolume(Bool_t show=kTRUE);
   void           ShowSelectMaterial(Bool_t show=kTRUE);
   void           ShowSelectMedium(Bool_t show=kTRUE);
   void           ShowSelectMatrix(Bool_t show=kTRUE);

public:
   TGeoManagerEditor(const TGWindow *p = 0,
                    Int_t width = 140, Int_t height = 30,
                    UInt_t options = kChildFrame,
                    Pixel_t back = GetDefaultFrameBackground());
   virtual ~TGeoManagerEditor();
   static void    LoadLib() {;}
   virtual void   SetModel(TObject *obj);

   virtual void   SelectedSlot(TVirtualPad* pad, TObject* obj, Int_t event);
   void           ConnectSelected(TCanvas *c);
   void           DisconnectSelected();

   void           DoName();
   void           DoCreateBox();
   void           DoCreatePara();
   void           DoCreateTrd1();
   void           DoCreateTrd2();
   void           DoCreateTrap();
   void           DoCreateGtra();
   void           DoCreateXtru();
   void           DoCreateArb8();
   void           DoCreateTube();
   void           DoCreateTubs();
   void           DoCreateCone();
   void           DoCreateCons();
   void           DoCreateSphe();
   void           DoCreateCtub();
   void           DoCreateEltu();
   void           DoCreateTorus();
   void           DoCreatePcon();
   void           DoCreatePgon();
   void           DoCreateHype();
   void           DoCreateParab();
   void           DoCreateComposite();
   void           DoCreateMaterial();
   void           DoCreateMixture();
   void           DoCreateMedium();
   void           DoCreateTranslation();
   void           DoCreateRotation();
   void           DoCreateCombi();
   void           DoCreateVolume();
   void           DoCreateAssembly();
   void           DoEditShape();
   void           DoEditVolume();
   void           DoEditMedium();
   void           DoEditMaterial();
   void           DoEditMatrix();
   void           DoSelectShape();
   void           DoSelectShape2();
   void           DoSelectVolume();
   void           DoSelectMatrix();
   void           DoSelectMaterial();
   void           DoSelectMaterial2();
   void           DoSelectMedium();
   void           DoSelectMedium2();
   void           DoSetTopVolume();
   void           DoSelectTopVolume();
   void           DoExportGeometry();
   void           DoCloseGeometry();
   
   ClassDef(TGeoManagerEditor,0)   // TGeoManager editor
};   
  
#endif                    
 TGeoManagerEditor.h:1
 TGeoManagerEditor.h:2
 TGeoManagerEditor.h:3
 TGeoManagerEditor.h:4
 TGeoManagerEditor.h:5
 TGeoManagerEditor.h:6
 TGeoManagerEditor.h:7
 TGeoManagerEditor.h:8
 TGeoManagerEditor.h:9
 TGeoManagerEditor.h:10
 TGeoManagerEditor.h:11
 TGeoManagerEditor.h:12
 TGeoManagerEditor.h:13
 TGeoManagerEditor.h:14
 TGeoManagerEditor.h:15
 TGeoManagerEditor.h:16
 TGeoManagerEditor.h:17
 TGeoManagerEditor.h:18
 TGeoManagerEditor.h:19
 TGeoManagerEditor.h:20
 TGeoManagerEditor.h:21
 TGeoManagerEditor.h:22
 TGeoManagerEditor.h:23
 TGeoManagerEditor.h:24
 TGeoManagerEditor.h:25
 TGeoManagerEditor.h:26
 TGeoManagerEditor.h:27
 TGeoManagerEditor.h:28
 TGeoManagerEditor.h:29
 TGeoManagerEditor.h:30
 TGeoManagerEditor.h:31
 TGeoManagerEditor.h:32
 TGeoManagerEditor.h:33
 TGeoManagerEditor.h:34
 TGeoManagerEditor.h:35
 TGeoManagerEditor.h:36
 TGeoManagerEditor.h:37
 TGeoManagerEditor.h:38
 TGeoManagerEditor.h:39
 TGeoManagerEditor.h:40
 TGeoManagerEditor.h:41
 TGeoManagerEditor.h:42
 TGeoManagerEditor.h:43
 TGeoManagerEditor.h:44
 TGeoManagerEditor.h:45
 TGeoManagerEditor.h:46
 TGeoManagerEditor.h:47
 TGeoManagerEditor.h:48
 TGeoManagerEditor.h:49
 TGeoManagerEditor.h:50
 TGeoManagerEditor.h:51
 TGeoManagerEditor.h:52
 TGeoManagerEditor.h:53
 TGeoManagerEditor.h:54
 TGeoManagerEditor.h:55
 TGeoManagerEditor.h:56
 TGeoManagerEditor.h:57
 TGeoManagerEditor.h:58
 TGeoManagerEditor.h:59
 TGeoManagerEditor.h:60
 TGeoManagerEditor.h:61
 TGeoManagerEditor.h:62
 TGeoManagerEditor.h:63
 TGeoManagerEditor.h:64
 TGeoManagerEditor.h:65
 TGeoManagerEditor.h:66
 TGeoManagerEditor.h:67
 TGeoManagerEditor.h:68
 TGeoManagerEditor.h:69
 TGeoManagerEditor.h:70
 TGeoManagerEditor.h:71
 TGeoManagerEditor.h:72
 TGeoManagerEditor.h:73
 TGeoManagerEditor.h:74
 TGeoManagerEditor.h:75
 TGeoManagerEditor.h:76
 TGeoManagerEditor.h:77
 TGeoManagerEditor.h:78
 TGeoManagerEditor.h:79
 TGeoManagerEditor.h:80
 TGeoManagerEditor.h:81
 TGeoManagerEditor.h:82
 TGeoManagerEditor.h:83
 TGeoManagerEditor.h:84
 TGeoManagerEditor.h:85
 TGeoManagerEditor.h:86
 TGeoManagerEditor.h:87
 TGeoManagerEditor.h:88
 TGeoManagerEditor.h:89
 TGeoManagerEditor.h:90
 TGeoManagerEditor.h:91
 TGeoManagerEditor.h:92
 TGeoManagerEditor.h:93
 TGeoManagerEditor.h:94
 TGeoManagerEditor.h:95
 TGeoManagerEditor.h:96
 TGeoManagerEditor.h:97
 TGeoManagerEditor.h:98
 TGeoManagerEditor.h:99
 TGeoManagerEditor.h:100
 TGeoManagerEditor.h:101
 TGeoManagerEditor.h:102
 TGeoManagerEditor.h:103
 TGeoManagerEditor.h:104
 TGeoManagerEditor.h:105
 TGeoManagerEditor.h:106
 TGeoManagerEditor.h:107
 TGeoManagerEditor.h:108
 TGeoManagerEditor.h:109
 TGeoManagerEditor.h:110
 TGeoManagerEditor.h:111
 TGeoManagerEditor.h:112
 TGeoManagerEditor.h:113
 TGeoManagerEditor.h:114
 TGeoManagerEditor.h:115
 TGeoManagerEditor.h:116
 TGeoManagerEditor.h:117
 TGeoManagerEditor.h:118
 TGeoManagerEditor.h:119
 TGeoManagerEditor.h:120
 TGeoManagerEditor.h:121
 TGeoManagerEditor.h:122
 TGeoManagerEditor.h:123
 TGeoManagerEditor.h:124
 TGeoManagerEditor.h:125
 TGeoManagerEditor.h:126
 TGeoManagerEditor.h:127
 TGeoManagerEditor.h:128
 TGeoManagerEditor.h:129
 TGeoManagerEditor.h:130
 TGeoManagerEditor.h:131
 TGeoManagerEditor.h:132
 TGeoManagerEditor.h:133
 TGeoManagerEditor.h:134
 TGeoManagerEditor.h:135
 TGeoManagerEditor.h:136
 TGeoManagerEditor.h:137
 TGeoManagerEditor.h:138
 TGeoManagerEditor.h:139
 TGeoManagerEditor.h:140
 TGeoManagerEditor.h:141
 TGeoManagerEditor.h:142
 TGeoManagerEditor.h:143
 TGeoManagerEditor.h:144
 TGeoManagerEditor.h:145
 TGeoManagerEditor.h:146
 TGeoManagerEditor.h:147
 TGeoManagerEditor.h:148
 TGeoManagerEditor.h:149
 TGeoManagerEditor.h:150
 TGeoManagerEditor.h:151
 TGeoManagerEditor.h:152
 TGeoManagerEditor.h:153
 TGeoManagerEditor.h:154
 TGeoManagerEditor.h:155
 TGeoManagerEditor.h:156
 TGeoManagerEditor.h:157
 TGeoManagerEditor.h:158
 TGeoManagerEditor.h:159
 TGeoManagerEditor.h:160
 TGeoManagerEditor.h:161
 TGeoManagerEditor.h:162
 TGeoManagerEditor.h:163
 TGeoManagerEditor.h:164
 TGeoManagerEditor.h:165
 TGeoManagerEditor.h:166
 TGeoManagerEditor.h:167
 TGeoManagerEditor.h:168
 TGeoManagerEditor.h:169
 TGeoManagerEditor.h:170
 TGeoManagerEditor.h:171
 TGeoManagerEditor.h:172
 TGeoManagerEditor.h:173
 TGeoManagerEditor.h:174
 TGeoManagerEditor.h:175
 TGeoManagerEditor.h:176
 TGeoManagerEditor.h:177
 TGeoManagerEditor.h:178
 TGeoManagerEditor.h:179
 TGeoManagerEditor.h:180
 TGeoManagerEditor.h:181
 TGeoManagerEditor.h:182
 TGeoManagerEditor.h:183
 TGeoManagerEditor.h:184
 TGeoManagerEditor.h:185
 TGeoManagerEditor.h:186