File indexing completed on 2025-01-18 10:11:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGeoTabManager
0013 #define ROOT_TGeoTabManager
0014
0015 #include "TGFrame.h"
0016
0017 #include "TMap.h"
0018
0019 class TVirtualPad;
0020 class TClass;
0021
0022 class TList;
0023 class TGCompositeFrame;
0024 class TGLabel;
0025 class TGTab;
0026 class TGComboBox;
0027 class TGListTree;
0028 class TGListTreeItem;
0029 class TGCanvas;
0030
0031 class TGedEditor;
0032
0033 class TGeoShape;
0034 class TGeoVolume;
0035 class TGeoMedium;
0036 class TGeoMaterial;
0037 class TGeoMatrix;
0038
0039 class TGeoTreeDialog;
0040 class TGeoTransientPanel;
0041
0042 class TGeoTabManager : public TObject {
0043 friend class TGeoManagerEditor;
0044
0045 private:
0046 TGedEditor *fGedEditor;
0047 TVirtualPad *fPad;
0048 TGTab *fTab;
0049 TGeoVolume *fVolume;
0050 TGeoTransientPanel *fShapePanel;
0051 TGeoTransientPanel *fMediumPanel;
0052 TGeoTransientPanel *fMaterialPanel;
0053 TGeoTransientPanel *fMatrixPanel;
0054 TGCompositeFrame *fVolumeTab;
0055
0056 static TMap fgEditorToMgrMap;
0057
0058 void GetEditors(TClass *cl);
0059
0060 public:
0061 TGeoTabManager(TGedEditor *ged);
0062 ~TGeoTabManager() override;
0063
0064 static TGeoTabManager *GetMakeTabManager(TGedEditor *ged);
0065 static void Cleanup(TGCompositeFrame *frame);
0066 TVirtualPad *GetPad() const { return fPad; }
0067 TGTab *GetTab() const { return fTab; }
0068 Int_t GetTabIndex() const;
0069 static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p);
0070 void SetVolTabEnabled(Bool_t flag = kTRUE);
0071 void SetModel(TObject *model);
0072 void SetTab();
0073
0074 void GetShapeEditor(TGeoShape *shape);
0075 void GetVolumeEditor(TGeoVolume *vol);
0076 void GetMatrixEditor(TGeoMatrix *matrix);
0077 void GetMediumEditor(TGeoMedium *medium);
0078 void GetMaterialEditor(TGeoMaterial *material);
0079
0080 TGCompositeFrame *GetVolumeTab() const { return fVolumeTab; }
0081 TGeoVolume *GetVolume() const { return fVolume; }
0082
0083 ClassDefOverride(TGeoTabManager, 0)
0084 };
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094 class TGeoTreeDialog : public TGTransientFrame {
0095
0096 protected:
0097 static TObject *fgSelectedObj;
0098 TGCanvas *fCanvas;
0099 TGLabel *fObjLabel;
0100 TGListTree *fLT;
0101 TGCompositeFrame *f1;
0102 TGTextButton *fClose;
0103
0104 virtual void BuildListTree() = 0;
0105 virtual void ConnectSignalsToSlots() = 0;
0106
0107 public:
0108 TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
0109 ~TGeoTreeDialog() override;
0110
0111 static TObject *GetSelected();
0112
0113 virtual void DoClose() = 0;
0114 virtual void DoItemClick(TGListTreeItem *item, Int_t btn) = 0;
0115 void DoSelect(TGListTreeItem *item);
0116
0117 ClassDefOverride(TGeoTreeDialog, 0)
0118 };
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128 class TGeoVolumeDialog : public TGeoTreeDialog {
0129
0130 protected:
0131 void BuildListTree() override;
0132 void ConnectSignalsToSlots() override;
0133
0134 public:
0135 TGeoVolumeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
0136 ~TGeoVolumeDialog() override {}
0137
0138
0139 void DoClose() override;
0140 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
0141
0142 ClassDefOverride(TGeoVolumeDialog, 0)
0143 };
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153 class TGeoShapeDialog : public TGeoTreeDialog {
0154
0155 protected:
0156 void BuildListTree() override;
0157 void ConnectSignalsToSlots() override;
0158
0159 public:
0160 TGeoShapeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
0161 ~TGeoShapeDialog() override {}
0162
0163
0164 void DoClose() override;
0165 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
0166
0167 ClassDefOverride(TGeoShapeDialog, 0)
0168 };
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178 class TGeoMediumDialog : public TGeoTreeDialog {
0179
0180 protected:
0181 void BuildListTree() override;
0182 void ConnectSignalsToSlots() override;
0183
0184 public:
0185 TGeoMediumDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
0186 ~TGeoMediumDialog() override {}
0187
0188
0189 void DoClose() override;
0190 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
0191
0192 ClassDefOverride(TGeoMediumDialog, 0)
0193 };
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203 class TGeoMaterialDialog : public TGeoTreeDialog {
0204
0205 protected:
0206 void BuildListTree() override;
0207 void ConnectSignalsToSlots() override;
0208
0209 public:
0210 TGeoMaterialDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
0211 ~TGeoMaterialDialog() override {}
0212
0213
0214 void DoClose() override;
0215 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
0216
0217 ClassDefOverride(TGeoMaterialDialog, 0)
0218 };
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228 class TGeoMatrixDialog : public TGeoTreeDialog {
0229
0230 protected:
0231 void BuildListTree() override;
0232 void ConnectSignalsToSlots() override;
0233
0234 public:
0235 TGeoMatrixDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
0236 ~TGeoMatrixDialog() override {}
0237
0238
0239 void DoClose() override;
0240 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
0241
0242 ClassDefOverride(TGeoMatrixDialog, 0)
0243 };
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253 class TGeoTransientPanel : public TGMainFrame {
0254 TGedEditor *fGedEditor;
0255 TGCanvas *fCan;
0256 TGTab *fTab;
0257 TGCompositeFrame *fTabContainer;
0258 TGCompositeFrame *fStyle;
0259 TObject *fModel;
0260 TGTextButton *fClose;
0261
0262 public:
0263 TGeoTransientPanel(TGedEditor *ged, const char *name, TObject *obj);
0264 ~TGeoTransientPanel() override;
0265
0266 void CloseWindow() override;
0267 virtual void DeleteEditors();
0268
0269 TGTab *GetTab() const { return fTab; }
0270 TGCompositeFrame *GetStyle() const { return fStyle; }
0271 TObject *GetModel() const { return fModel; }
0272
0273 void GetEditors(TClass *cl);
0274 virtual void Hide();
0275 virtual void Show();
0276 void SetModel(TObject *model);
0277
0278 ClassDefOverride(TGeoTransientPanel, 0)
0279 };
0280
0281 #endif