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  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_TGeoMaterialEditor
0012 #define ROOT_TGeoMaterialEditor
0013 
0014 #include "TGWidget.h"
0015 #include "TGeoGedFrame.h"
0016 
0017 class TGeoMaterial;
0018 class TGeoTabManager;
0019 class TGTextEntry;
0020 class TGNumberEntry;
0021 class TGTab;
0022 class TGComboBox;
0023 class TGTextButton;
0024 class TGCanvas;
0025 class TString;
0026 
0027 class TGeoMaterialEditor : public TGeoGedFrame {
0028 
0029 protected:
0030    Double_t fAi;               // Initial atomic mass
0031    Int_t fZi;                  // Initial Z
0032    Int_t fStatei;              // Initial material state
0033    Double_t fDensityi;         // Initial density
0034    Double_t fTempi;            // Initial temperature
0035    Double_t fPresi;            // Initial pressure
0036    TString fNamei;             // Initial name
0037    TGeoMaterial *fMaterial;    // Material object
0038    Bool_t fIsModified;         // Flag that material was modified
0039    Bool_t fIsMaterialEditable; // Flag that the material can be changed
0040 
0041    TGTextEntry *fMaterialName;     // Material name text entry
0042    TGNumberEntry *fMatA;           // Number entry for A
0043    TGNumberEntry *fMatZ;           // Number entry for Z
0044    TGComboBox *fMatState;          // Material state
0045    TGNumberEntry *fMatDensity;     // Number entry for density
0046    TGNumberEntry *fMatTemperature; // Number entry for temperature
0047    TGNumberEntry *fMatPressure;    // Number entry for pressure
0048    TGNumberEntry *fMatRadLen;      // Number entry for radiation length
0049    TGNumberEntry *fMatAbsLen;      // Number entry for absorption length
0050    TGCompositeFrame *f23;          // Frame for buttons
0051    TGTextButton *fApply;           // Apply-Button to accept changes
0052    TGTextButton *fUndo;            // Undo-Button
0053 
0054    virtual void ConnectSignals2Slots(); // Connect the signals to the slots
0055 
0056 public:
0057    TGeoMaterialEditor(const TGWindow *p = nullptr, Int_t width = 140, Int_t height = 30, UInt_t options = kChildFrame,
0058                       Pixel_t back = GetDefaultFrameBackground());
0059    ~TGeoMaterialEditor() override;
0060    void SetModel(TObject *obj) override;
0061 
0062    void DoA();
0063    void DoZ();
0064    void DoDensity();
0065    void DoModified();
0066    void DoName();
0067    void DoRadAbs();
0068    void DoState(Int_t state);
0069    void DoTemperature();
0070    void DoPressure();
0071    void DoApply();
0072    void DoUndo();
0073 
0074    ClassDefOverride(TGeoMaterialEditor, 0) // TGeoMaterial editor
0075 };
0076 
0077 class TGCheckButton;
0078 class TGeoMixture;
0079 
0080 class TGeoMixtureEditor : public TGeoMaterialEditor {
0081 
0082 protected:
0083    TGeoMixture *fMixture; // Mixture object
0084 
0085    TGComboBox *fMixElem;        // Combo box for elements
0086    TGLabel *fNelem;             // Label for number of elements
0087    TGLabel *fAelem;             // Label for A
0088    TGLabel *fZelem;             // Label for Z
0089    TGCheckButton *fChkFraction; // Check button for fraction by weight.
0090    TGNumberEntry *fNEFraction;  // Number entry for fraction value
0091    TGCheckButton *fChkNatoms;   // Check button for number of atoms
0092    TGNumberEntry *fNENatoms;    // Number entry for number of atoms
0093    TGTextButton *fBAddElem;     // Button for adding element as component
0094    TGCompositeFrame *fComps;    // Frame with components
0095 
0096    void ConnectSignals2Slots() override; // Connect the signals to the slots
0097 
0098 public:
0099    TGeoMixtureEditor(const TGWindow *p = nullptr, Int_t width = 140, Int_t height = 30, UInt_t options = kChildFrame,
0100                      Pixel_t back = GetDefaultFrameBackground());
0101    ~TGeoMixtureEditor() override {}
0102    void SetModel(TObject *obj) override;
0103    void UpdateElements();
0104 
0105    void DoApply1();
0106    void DoUndo1();
0107    void DoChkFraction();
0108    void DoChkNatoms();
0109    void DoFraction();
0110    void DoNatoms();
0111    void DoSelectElement(Int_t iel);
0112    void DoAddElem();
0113 
0114    ClassDefOverride(TGeoMixtureEditor, 0) // TGeoMixture editor
0115 };
0116 
0117 #endif