Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:52

0001 // @(#):$Id$
0002 // Author: M.Gheata
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGeoManagerEditor
0013 #define ROOT_TGeoManagerEditor
0014 
0015 #include "TGWidget.h"
0016 #include "TGeoGedFrame.h"
0017 
0018 class TGeoManager;
0019 class TGeoVolume;
0020 class TGeoShape;
0021 class TGeoMedium;
0022 class TGeoMaterial;
0023 class TGeoMatrix;
0024 class TGShutter;
0025 class TGShutterItem;
0026 class TGTextEntry;
0027 class TGTab;
0028 class TGComboBox;
0029 class TGNumberEntry;
0030 class TGTextButton;
0031 class TGPictureButton;
0032 class TGCheckButton;
0033 class TGRadioButton;
0034 class TGeoTabManager;
0035 
0036 class TGeoManagerEditor : public TGedFrame {
0037 
0038 protected:
0039    TGeoManager *fGeometry;              // Selected geometry manager
0040    TGeoTabManager *fTabMgr;             // Tab manager
0041    TGTab *fTab;                         // TGTab of GedEditor
0042    TGCompositeFrame *fVolumeTab;        // Tab of Volume tab
0043    Bool_t fIsModified;                  // Flag that manager was modified
0044    TGShutter *fCategories;              // Categories shutter
0045    TGTextEntry *fManagerName;           // Name text entry
0046    TGTextEntry *fManagerTitle;          // Title text entry
0047    TGTextEntry *fMediumName;            // Medium name text entry
0048    TGTextEntry *fMatrixName;            // Matrix name text entry
0049    TGTextEntry *fMaterialName;          // Material name text entry
0050    TGTextEntry *fVolumeName;            // Volume name text entry
0051    TGeoMaterial *fSelectedMaterial;     // Selected material
0052    TGeoMaterial *fSelectedMaterial2;    // Selected material for medium creation
0053    TGLabel *fLSelMaterial;              // Selected material label
0054    TGLabel *fLSelMaterial2;             // Selected material label
0055    TGPictureButton *fBSelMaterial;      // Button for selecting a material
0056    TGPictureButton *fBSelMaterial2;     // Button for selecting a material
0057    TGeoVolume *fSelectedVolume;         // Selected volume
0058    TGLabel *fLSelVolume;                // Selected volume label
0059    TGPictureButton *fBSelVolume;        // Button for selecting a volume
0060    TGeoShape *fSelectedShape;           // Selected shape
0061    TGeoShape *fSelectedShape2;          // Selected shape for volume creation
0062    TGLabel *fLSelShape;                 // Selected shape label
0063    TGLabel *fLSelShape2;                // Selected shape label
0064    TGPictureButton *fBSelShape;         // Button for selecting a shape
0065    TGPictureButton *fBSelShape2;        // Button for selecting a shape
0066    TGeoMatrix *fSelectedMatrix;         // Selected matrix
0067    TGLabel *fLSelMatrix;                // Selected matrix label
0068    TGPictureButton *fBSelMatrix;        // Button for selecting a matrix
0069    TGeoMedium *fSelectedMedium;         // Selected medium
0070    TGeoMedium *fSelectedMedium2;        // Selected medium for volume creation
0071    TGLabel *fLSelMedium;                // Selected medium label
0072    TGLabel *fLSelMedium2;               // Selected medium label
0073    TGPictureButton *fBSelMedium;        // Button for selecting a medium
0074    TGPictureButton *fBSelMedium2;       // Button for selecting a medium
0075    TGPictureButton *fShapeButton[21];   // List of shape buttons
0076    TGPictureButton *fMatrixButton[3];   // List of matrix buttons
0077    TGPictureButton *fVolumeButton[2];   // List of volume buttons
0078    TGPictureButton *fMaterialButton[2]; // List of material buttons
0079    TGRadioButton *fExportOption[2];     // Export option buttons
0080    TGTextButton *fExportButton;         // Button to export geometry
0081    TGComboBox *fElementList;            // Combo box for elements
0082    TGNumberEntry *fEntryDensity;        // Number entry for material density
0083    TGPictureButton *fMediumButton;      // Button to create a medium
0084    TGNumberEntry *fMediumId;            // Medium ID number entry
0085    TGTextButton *fEditShape;            // Button for editing selected shape
0086    TGTextButton *fEditMedium;           // Button for editing a medium
0087    TGTextButton *fEditMaterial;         // Button for editing a material
0088    TGTextButton *fEditMatrix;           // Button for editing a matrix
0089    TGTextButton *fEditVolume;           // Button for editing a volume
0090    TGTextButton *fSetTopVolume;         // Button for setting top volume
0091    TGLabel *fLSelTop;                   // Selected top volume
0092    TGPictureButton *fBSelTop;           // Button for selecting top volume
0093    TGTextButton *fCloseGeometry;        // Button for closing the geometry
0094    TGCompositeFrame *f2;                // Parent frame for shape editing
0095    TGCompositeFrame *f3;                // Parent frame for volume editing
0096    TGCompositeFrame *f4;                // Parent frame for materials editing
0097    TGCompositeFrame *f5;                // Parent frame for media editing
0098    TGCompositeFrame *f6;                // Parent frame for matrices editing
0099    TGCompositeFrame *f7;                // Parent frame for closing geometry
0100    TCanvas *fConnectedCanvas;           // Canvas connected to SelectedSlot()
0101 
0102    virtual void ConnectSignals2Slots(); // Connect the signals to the slots
0103    void ShowSelectShape(Bool_t show = kTRUE);
0104    void ShowSelectVolume(Bool_t show = kTRUE);
0105    void ShowSelectMaterial(Bool_t show = kTRUE);
0106    void ShowSelectMedium(Bool_t show = kTRUE);
0107    void ShowSelectMatrix(Bool_t show = kTRUE);
0108 
0109 public:
0110    TGeoManagerEditor(const TGWindow *p = nullptr, Int_t width = 140, Int_t height = 30, UInt_t options = kChildFrame,
0111                      Pixel_t back = GetDefaultFrameBackground());
0112    ~TGeoManagerEditor() override;
0113    static void LoadLib();
0114    void SetModel(TObject *obj) override;
0115 
0116    virtual void SelectedSlot(TVirtualPad *pad, TObject *obj, Int_t event);
0117    void ConnectSelected(TCanvas *c);
0118    void DisconnectSelected();
0119 
0120    void DoName();
0121    void DoCreateBox();
0122    void DoCreatePara();
0123    void DoCreateTrd1();
0124    void DoCreateTrd2();
0125    void DoCreateTrap();
0126    void DoCreateGtra();
0127    void DoCreateXtru();
0128    void DoCreateArb8();
0129    void DoCreateTube();
0130    void DoCreateTubs();
0131    void DoCreateCone();
0132    void DoCreateCons();
0133    void DoCreateSphe();
0134    void DoCreateCtub();
0135    void DoCreateEltu();
0136    void DoCreateTorus();
0137    void DoCreatePcon();
0138    void DoCreatePgon();
0139    void DoCreateHype();
0140    void DoCreateParab();
0141    void DoCreateComposite();
0142    void DoCreateMaterial();
0143    void DoCreateMixture();
0144    void DoCreateMedium();
0145    void DoCreateTranslation();
0146    void DoCreateRotation();
0147    void DoCreateCombi();
0148    void DoCreateVolume();
0149    void DoCreateAssembly();
0150    void DoEditShape();
0151    void DoEditVolume();
0152    void DoEditMedium();
0153    void DoEditMaterial();
0154    void DoEditMatrix();
0155    void DoSelectShape();
0156    void DoSelectShape2();
0157    void DoSelectVolume();
0158    void DoSelectMatrix();
0159    void DoSelectMaterial();
0160    void DoSelectMaterial2();
0161    void DoSelectMedium();
0162    void DoSelectMedium2();
0163    void DoSetTopVolume();
0164    void DoSelectTopVolume();
0165    void DoExportGeometry();
0166    void DoCloseGeometry();
0167 
0168    ClassDefOverride(TGeoManagerEditor, 0) // TGeoManager editor
0169 };
0170 
0171 #endif