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