Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGeoMaterialEditor.h
Go to the documentation of this file.
1 // @(#):$Id$
2 // Author: M.Gheata
3 /*************************************************************************
4  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TGeoMaterialEditor
12 #define ROOT_TGeoMaterialEditor
13 
14 #include "TGWidget.h"
15 #include "TGeoGedFrame.h"
16 
17 class TGeoMaterial;
18 class TGeoTabManager;
19 class TGTextEntry;
20 class TGNumberEntry;
21 class TGTab;
22 class TGComboBox;
23 class TGTextButton;
24 class TGCanvas;
25 class TString;
26 
27 class TGeoMaterialEditor : public TGeoGedFrame {
28 
29 protected:
30 
31  Double_t fAi; // Initial atomic mass
32  Int_t fZi; // Initial Z
33  Int_t fStatei; // Initial material state
34  Double_t fDensityi; // Initial density
35  Double_t fTempi; // Initial temperature
36  Double_t fPresi; // Initial pressure
37  TString fNamei; // Initial name
38  TGeoMaterial *fMaterial; // Material object
39  Bool_t fIsModified; // Flag that material was modified
40  Bool_t fIsMaterialEditable; // Flag that the material can be changed
41 
42  TGTextEntry *fMaterialName; // Material name text entry
43  TGNumberEntry *fMatA; // Number entry for A
44  TGNumberEntry *fMatZ; // Number entry for Z
45  TGComboBox *fMatState; // Material state
46  TGNumberEntry *fMatDensity; // Number entry for density
47  TGNumberEntry *fMatTemperature; // Number entry for temperature
48  TGNumberEntry *fMatPressure; // Number entry for pressure
49  TGNumberEntry *fMatRadLen; // Number entry for radiation length
50  TGNumberEntry *fMatAbsLen; // Number entry for absorption length
51  TGCompositeFrame *f23; // Frame for buttons
52  TGTextButton *fApply; // Apply-Button to accept changes
53  TGTextButton *fUndo; // Undo-Button
54 
55  virtual void ConnectSignals2Slots(); // Connect the signals to the slots
56 
57 public:
58  TGeoMaterialEditor(const TGWindow *p = 0,
59  Int_t width = 140, Int_t height = 30,
60  UInt_t options = kChildFrame,
61  Pixel_t back = GetDefaultFrameBackground());
62  virtual ~TGeoMaterialEditor();
63  virtual void SetModel(TObject *obj);
64 
65  void DoA();
66  void DoZ();
67  void DoDensity();
68  void DoModified();
69  void DoName();
70  void DoRadAbs();
71  void DoState(Int_t state);
72  void DoTemperature();
73  void DoPressure();
74  void DoApply();
75  void DoUndo();
76 
77  ClassDef(TGeoMaterialEditor,0) // TGeoMaterial editor
78 };
79 
80 class TGCheckButton;
81 class TGeoMixture;
82 
83 class TGeoMixtureEditor : public TGeoMaterialEditor {
84 
85 protected:
86 
87  TGeoMixture *fMixture; // Mixture object
88 
89  TGComboBox *fMixElem; // Combo box for elements
90  TGLabel *fNelem; // Label for number of elements
91  TGLabel *fAelem; // Label for A
92  TGLabel *fZelem; // Label for Z
93  TGCheckButton *fChkFraction; // Check button for fraction by weight.
94  TGNumberEntry *fNEFraction; // Number entry for fraction value
95  TGCheckButton *fChkNatoms; // Check button for number of atoms
96  TGNumberEntry *fNENatoms; // Number entry for number of atoms
97  TGTextButton *fBAddElem; // Button for adding element as component
98  TGCompositeFrame *fComps; // Frame with components
99 
100  virtual void ConnectSignals2Slots(); // Connect the signals to the slots
101 
102 public:
103  TGeoMixtureEditor(const TGWindow *p = 0,
104  Int_t width = 140, Int_t height = 30,
105  UInt_t options = kChildFrame,
106  Pixel_t back = GetDefaultFrameBackground());
107  virtual ~TGeoMixtureEditor() {}
108  virtual void SetModel(TObject *obj);
109  void UpdateElements();
110 
111  void DoApply1();
112  void DoUndo1();
113  void DoChkFraction();
114  void DoChkNatoms();
115  void DoFraction();
116  void DoNatoms();
117  void DoSelectElement(Int_t iel);
118  void DoAddElem();
119 
120  ClassDef(TGeoMixtureEditor,0) // TGeoMixture editor
121 };
122 
123 #endif