Logo ROOT   6.10/09
Reference Guide
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 //////////////////////////////////////////////////////////////////////////
15 // //
16 // TGeoMaterialEditor //
17 // //
18 // Editor for a TGeoMaterial. //
19 // //
20 //////////////////////////////////////////////////////////////////////////
21 
22 #include "TGWidget.h"
23 #include "TGeoGedFrame.h"
24 
25 class TGeoMaterial;
26 class TGeoTabManager;
27 class TGTextEntry;
28 class TGNumberEntry;
29 class TGTab;
30 class TGComboBox;
31 class TGTextButton;
32 class TGCanvas;
33 class TString;
34 
36 
37 protected:
38 
39  Double_t fAi; // Initial atomic mass
40  Int_t fZi; // Initial Z
41  Int_t fStatei; // Initial material state
42  Double_t fDensityi; // Initial density
43  Double_t fTempi; // Initial temperature
44  Double_t fPresi; // Initial pressure
45  TString fNamei; // Initial name
46  TGeoMaterial *fMaterial; // Material object
47  Bool_t fIsModified; // Flag that material was modified
48  Bool_t fIsMaterialEditable; // Flag that the material can be changed
49 
50  TGTextEntry *fMaterialName; // Material name text entry
51  TGNumberEntry *fMatA; // Number entry for A
52  TGNumberEntry *fMatZ; // Number entry for Z
53  TGComboBox *fMatState; // Material state
54  TGNumberEntry *fMatDensity; // Number entry for density
55  TGNumberEntry *fMatTemperature; // Number entry for temperature
56  TGNumberEntry *fMatPressure; // Number entry for pressure
57  TGNumberEntry *fMatRadLen; // Number entry for radiation length
58  TGNumberEntry *fMatAbsLen; // Number entry for absorbtion length
59  TGCompositeFrame *f23; // Frame for buttons
60  TGTextButton *fApply; // Apply-Button to accept changes
61  TGTextButton *fUndo; // Undo-Button
62 
63  virtual void ConnectSignals2Slots(); // Connect the signals to the slots
64 
65 public:
66  TGeoMaterialEditor(const TGWindow *p = 0,
67  Int_t width = 140, Int_t height = 30,
68  UInt_t options = kChildFrame,
70  virtual ~TGeoMaterialEditor();
71  virtual void SetModel(TObject *obj);
72 
73  void DoA();
74  void DoZ();
75  void DoDensity();
76  void DoModified();
77  void DoName();
78  void DoRadAbs();
79  void DoState(Int_t state);
80  void DoTemperature();
81  void DoPressure();
82  void DoApply();
83  void DoUndo();
84 
85  ClassDef(TGeoMaterialEditor,0) // TGeoMaterial editor
86 };
87 
88 //////////////////////////////////////////////////////////////////////////
89 // //
90 // TGeoMixtureEditor //
91 // //
92 // Editor for a TGeoMixture. //
93 // //
94 //////////////////////////////////////////////////////////////////////////
95 
96 class TGCheckButton;
97 class TGeoMixture;
98 
100 
101 protected:
102 
103  TGeoMixture *fMixture; // Mixture object
104 
105  TGComboBox *fMixElem; // Combo box for elements
106  TGLabel *fNelem; // Label for number of elements
107  TGLabel *fAelem; // Label for A
108  TGLabel *fZelem; // Label for Z
109  TGCheckButton *fChkFraction; // Check button for fraction by wght.
110  TGNumberEntry *fNEFraction; // Number entry for fraction value
111  TGCheckButton *fChkNatoms; // Check button for number of atoms
112  TGNumberEntry *fNENatoms; // Number entry for number of atoms
113  TGTextButton *fBAddElem; // Buttom for adding element as component
114  TGCompositeFrame *fComps; // Frame with components
115 
116  virtual void ConnectSignals2Slots(); // Connect the signals to the slots
117 
118 public:
119  TGeoMixtureEditor(const TGWindow *p = 0,
120  Int_t width = 140, Int_t height = 30,
121  UInt_t options = kChildFrame,
123  virtual ~TGeoMixtureEditor() {}
124  virtual void SetModel(TObject *obj);
125  void UpdateElements();
126 
127  void DoApply1();
128  void DoUndo1();
129  void DoChkFraction();
130  void DoChkNatoms();
131  void DoFraction();
132  void DoNatoms();
133  void DoSelectElement(Int_t iel);
134  void DoAddElem();
135 
136  ClassDef(TGeoMixtureEditor,0) // TGeoMixture editor
137 };
138 
139 #endif
TGTextButton * fApply
TGNumberEntry * fMatA
TGNumberEntry * fMatTemperature
Definition: TGTab.h:62
void DoZ()
Slot for charge.
TGeoMaterialEditor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for material editor.
void DoState(Int_t state)
Slot for material state.
void DoPressure()
Slot for material pressure.
TGCompositeFrame * fComps
void DoModified()
Slot for signaling modifications.
Basic string class.
Definition: TString.h:129
Base class describing materials.
Definition: TGeoMaterial.h:29
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void ConnectSignals2Slots()
Connect signals to slots.
void DoDensity()
Slot for density.
TGNumberEntry * fMatZ
virtual void SetModel(TObject *obj)
Connect to the selected material.
TGNumberEntry * fMatDensity
TGTextEntry * fMaterialName
void DoName()
Perform name change.
#define ClassDef(name, id)
Definition: Rtypes.h:297
ULong_t Pixel_t
Definition: GuiTypes.h:39
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
void DoUndo()
Slot for cancelling current modifications.
virtual ~TGeoMaterialEditor()
Destructor.
TGNumberEntry * fMatAbsLen
TGCompositeFrame * f23
TGTextButton * fUndo
TGCheckButton * fChkFraction
void DoA()
Slot for atomic mass.
TGTextButton * fBAddElem
TGeoMixture * fMixture
TGNumberEntry * fNENatoms
unsigned int UInt_t
Definition: RtypesCore.h:42
TGeoMaterial * fMaterial
void DoApply()
Slot for applying modifications.
double Double_t
Definition: RtypesCore.h:55
void DoRadAbs()
Slot for radiation/absorbtion length.
Mother of all ROOT objects.
Definition: TObject.h:37
TGNumberEntry * fNEFraction
TGCheckButton * fChkNatoms
void DoTemperature()
Slot for material temperature.
TGNumberEntry * fMatRadLen
TGNumberEntry * fMatPressure