Logo ROOT   6.08/07
Reference Guide
TGeoMaterialEditor.cxx
Go to the documentation of this file.
1 // @(#):$Id$
2 // Author: M.Gheata
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 //______________________________________________________________________________
13 //
14 // TGeoMaterialEditor, TGeoMixtureEditor
15 // =======================================
16 //
17 // Editors for materials and mixtures.
18 //______________________________________________________________________________
19 
20 #include "TGeoMaterialEditor.h"
21 #include "TGeoTabManager.h"
22 #include "TGeoMaterial.h"
23 #include "TGeoManager.h"
24 #include "TVirtualGeoPainter.h"
25 #include "TPad.h"
26 #include "TView.h"
27 #include "TGTab.h"
28 #include "TGComboBox.h"
29 #include "TGButton.h"
30 #include "TGTextEntry.h"
31 #include "TGNumberEntry.h"
32 #include "TGLabel.h"
33 #include "TGListView.h"
34 
36 
41 };
42 
45 };
46 
49 };
50 
51 ////////////////////////////////////////////////////////////////////////////////
52 /// Constructor for material editor.
53 
55  Int_t height, UInt_t options, Pixel_t back)
56  : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
57 {
58  fMaterial = 0;
59  fAi = fZi = 0;
60  fDensityi = 0.0;
61  fNamei = "";
64 
65  // TextEntry for material name
66  MakeTitle("Name");
69  fMaterialName->SetToolTipText("Enter the material name");
70  fMaterialName->Associate(this);
72 
73  TGTextEntry *nef;
74  MakeTitle("Material properties");
77  f1->AddFrame(new TGLabel(f1, "A"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
79  nef = (TGTextEntry*)fMatA->GetNumberEntry();
80  nef->SetToolTipText("Enter the atomic mass");
81  fMatA->Associate(this);
82  f1->AddFrame(fMatA, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
83  f1->AddFrame(new TGLabel(f1, "Z"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
85  nef = (TGTextEntry*)fMatZ->GetNumberEntry();
86  nef->SetToolTipText("Enter the atomic charge");
87  fMatZ->Associate(this);
88  f1->AddFrame(fMatZ, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
89  f1->Resize(150,30);
90  AddFrame(f1, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
91 
92 
94  // Combo box for material state
95  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
97  f1->AddFrame(new TGLabel(f1, "State"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
104  f1->AddFrame(fMatState, new TGLayoutHints(kLHintsRight , 2, 2, 1, 1));
105  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
106 
107  // Number entry for density
108  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
110  f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
114  nef->SetToolTipText("Enter material density in [g/cm3]");
115  fMatDensity->Associate(this);
116  f1->AddFrame(fMatDensity, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
117  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
118 
119  // Number entry for temperature
120  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
122  f1->AddFrame(new TGLabel(f1, "Temperature"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
126  nef->SetToolTipText("Enter material temperature in [Kelvin]");
127  fMatTemperature->Associate(this);
128  f1->AddFrame(fMatTemperature, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
129  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
130 
131  // Number entry for pressure
132  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
134  f1->AddFrame(new TGLabel(f1, "Pressure"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
138  nef->SetToolTipText("Enter material pressure in [bar]");
139  fMatPressure->Associate(this);
140  f1->AddFrame(fMatPressure, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
141  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
142 
143  // Number entry for radiation length
144  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
146  f1->AddFrame(new TGLabel(f1, "RadLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
147  fMatRadLen = new TGNumberEntry(f1, 0., 5, kMATERIAL_RAD);
150  nef->SetToolTipText("Computed radiation length");
151  fMatRadLen->Associate(this);
152  f1->AddFrame(fMatRadLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
153  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
154 
155  // Number entry for absorbtion length
156  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
158  f1->AddFrame(new TGLabel(f1, "AbsLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
159  fMatAbsLen = new TGNumberEntry(f1, 0., 5, kMATERIAL_ABS);
162  nef->SetToolTipText("Absorbtion length");
163  fMatAbsLen->Associate(this);
164  f1->AddFrame(fMatAbsLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
165  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
166 
167  compxyz->Resize(150,30);
168  AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 2, 2));
169 
170  // Buttons
172  fApply = new TGTextButton(f23, "Apply");
173  f23->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 1, 1));
174  fApply->Associate(this);
175  fUndo = new TGTextButton(f23, " Undo ");
176  f23->AddFrame(fUndo, new TGLayoutHints(kLHintsRight , 2, 2, 1, 1));
177  fUndo->Associate(this);
178  AddFrame(f23, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
180 }
181 
182 ////////////////////////////////////////////////////////////////////////////////
183 /// Destructor
184 
186 {
187  TGFrameElement *el;
188  TIter next(GetList());
189  while ((el = (TGFrameElement *)next())) {
190  if (el->fFrame->IsComposite())
192  }
193  Cleanup();
194 }
195 
196 ////////////////////////////////////////////////////////////////////////////////
197 /// Connect signals to slots.
198 
200 {
201  fApply->Connect("Clicked()", "TGeoMaterialEditor", this, "DoApply()");
202  fUndo->Connect("Clicked()", "TGeoMaterialEditor", this, "DoUndo()");
203  fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
204  fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
205  fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
206  fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
207  fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
208  fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
209  fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
210  fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
211  fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
212  fInit = kFALSE;
213 }
214 
215 ////////////////////////////////////////////////////////////////////////////////
216 /// Connect to the selected material.
217 
219 {
220  if (obj == 0 || !(obj->InheritsFrom(TGeoMaterial::Class()))) {
221  SetActive(kFALSE);
222  return;
223  }
224  fMaterial = (TGeoMaterial*)obj;
225  fAi = fMaterial->GetA();
226  fZi = (Int_t)fMaterial->GetZ();
230  fPresi = fMaterial->GetPressure()/6.2415e+8;
231  fNamei = fMaterial->GetName();
233  fMatA->SetNumber(fAi);
234  fMatZ->SetNumber(fZi);
243 
245  SetActive();
246 }
247 
248 ////////////////////////////////////////////////////////////////////////////////
249 /// Perform name change.
250 
252 {
253  DoModified();
254 }
255 
256 ////////////////////////////////////////////////////////////////////////////////
257 /// Slot for atomic mass.
258 
260 {
261  if (fMaterial->IsMixture()) {
263  return;
264  }
265  DoModified();
266 }
267 
268 ////////////////////////////////////////////////////////////////////////////////
269 /// Slot for charge.
270 
272 {
273  if (fMaterial->IsMixture()) {
275  return;
276  }
277  Int_t z = (Int_t)fMatZ->GetNumber();
279  if (z >= table->GetNelements()) {
280  z = table->GetNelements()-1;
281  fMatZ->SetNumber(z);
282  }
283  TGeoElement *elem = table->GetElement(z);
284  if (!elem) return;
285  Double_t a = elem->A();
286  fMatA->SetNumber(a);
287  DoModified();
288 }
289 
290 ////////////////////////////////////////////////////////////////////////////////
291 /// Slot for material state.
292 
294 {
295  DoModified();
296 }
297 
298 ////////////////////////////////////////////////////////////////////////////////
299 /// Slot for material temperature.
300 
302 {
303  DoModified();
304 }
305 
306 ////////////////////////////////////////////////////////////////////////////////
307 /// Slot for material pressure.
308 
310 {
311  DoModified();
312 }
313 
314 ////////////////////////////////////////////////////////////////////////////////
315 /// Slot for density.
316 /// fMatDensity->SetNumber(fDensityi);
317 
319 {
320  DoModified();
321 }
322 
323 ////////////////////////////////////////////////////////////////////////////////
324 /// Slot for radiation/absorbtion length.
325 
327 {
330  DoModified();
331 }
332 
333 ////////////////////////////////////////////////////////////////////////////////
334 /// Slot for applying modifications.
335 
337 {
338  const char *name = fMaterialName->GetText();
339  fMaterial->SetName(name);
340 
350  fUndo->SetEnabled();
352 }
353 
354 ////////////////////////////////////////////////////////////////////////////////
355 /// Slot for cancelling current modifications.
356 
358 {
361  fMatA->SetNumber(fAi);
362  fMaterial->SetA(fAi);
363  fMatZ->SetNumber(fZi);
364  fMaterial->SetZ(fZi);
372  fMaterial->SetPressure(fPresi*6.2415e+8);
377 }
378 
379 ////////////////////////////////////////////////////////////////////////////////
380 /// Slot for signaling modifications.
381 
383 {
384  fApply->SetEnabled();
385 }
386 
388 
389 ////////////////////////////////////////////////////////////////////////////////
390 /// Constructor for mixture editor.
391 
393  Int_t height, UInt_t options, Pixel_t back)
394  : TGeoMaterialEditor(p, width, height, options | kVerticalFrame, back)
395 {
396  fMixture = 0;
397  TGCompositeFrame *compxyz=0, *f1=0;
398  TGTextEntry *nef;
399  MakeTitle("Mixture settings");
400  fNelem = new TGLabel(this, "Number of elements: 0");
401  AddFrame(fNelem, new TGLayoutHints(kLHintsLeft , 6, 2, 2, 2));
402  compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame | kDoubleBorder);
403  // Combo box for selecting elements
404  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
406  fMixElem = new TGComboBox(f1, kMIX_ELEM);
408  if (table) {
409  TGeoElement *element;
410  for (Int_t i=0; i<table->GetNelements(); i++) {
411  element = table->GetElement(i);
412  if (element) fMixElem->AddEntry(element->GetTitle(),i);
413  }
414  }
415  fMixElem->Select(0);
416  fMixElem->Resize(90, fMaterialName->GetDefaultHeight());
417  f1->AddFrame(fMixElem, new TGLayoutHints(kLHintsLeft , 2, 2, 1, 1));
418  TGCompositeFrame *comp1 = new TGCompositeFrame(f1, 118, 30, kVerticalFrame);
419  fAelem = new TGLabel(comp1, "A = 0");
420  comp1->AddFrame(fAelem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
421  fZelem = new TGLabel(comp1, "Z = 0");
422  comp1->AddFrame(fZelem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
423  f1->AddFrame(comp1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX| kLHintsExpandY , 2, 2, 0, 0));
424  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 0, 0));
425 
426  // Fraction by weight
427  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
429  fChkFraction = new TGCheckButton(f1, "% weight");
430  fChkFraction->SetDown(kTRUE);
431  f1->AddFrame(fChkFraction, new TGLayoutHints(kLHintsLeft , 2, 2, 6, 1));
432  fNEFraction = new TGNumberEntry(f1, 0., 5, kMIX_FRAC, TGNumberFormat::kNESRealThree);
434  fNEFraction->Resize(65, fMaterialName->GetDefaultHeight());
435  nef = (TGTextEntry*)fNEFraction->GetNumberEntry();
436  nef->SetToolTipText("Enter fraction by weight of this element");
437  fNEFraction->SetNumber(0.);
438  fNEFraction->Associate(this);
439  f1->AddFrame(fNEFraction, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
440  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
441 
442  // Fraction by number of atoms
443  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
445  fChkNatoms = new TGCheckButton(f1, "N. atoms");
446  fChkNatoms->SetDown(kFALSE);
447  f1->AddFrame(fChkNatoms, new TGLayoutHints(kLHintsLeft, 2, 2, 6, 1));
448  fNENatoms = new TGNumberEntry(f1, 0., 5, kMIX_NATOMS);
450  fNENatoms->Resize(65, fMaterialName->GetDefaultHeight());
451  nef = (TGTextEntry*)fNENatoms->GetNumberEntry();
452  nef->SetToolTipText("Enter number of atoms for this element");
453  fNENatoms->SetNumber(0);
454  fNENatoms->Associate(this);
455  f1->AddFrame(fNENatoms, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
456  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
457 
458  // Button for adding the element
459  fBAddElem = new TGTextButton(compxyz, "Add component");
460  fBAddElem->Associate(this);
461  compxyz->AddFrame(fBAddElem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
462 
463  compxyz->Resize(150,30);
464  AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 1, 1));
465 
466  // List view with all components
467  fComps = new TGCompositeFrame(this, 150, 100, kVerticalFrame | kSunkenFrame);
468  AddFrame(fComps, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 0, 2, 1, 2));
469 
471 }
472 
473 ////////////////////////////////////////////////////////////////////////////////
474 /// Connect signals to slots.
475 
477 {
478  fApply->Connect("Clicked()", "TGeoMixtureEditor", this, "DoApply1()");
479  fUndo->Connect("Clicked()", "TGeoMixtureEditor", this, "DoUndo1()");
480  fChkFraction->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkFraction()");
481  fChkNatoms->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkNatoms()");
482  fNEFraction->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoFraction()");
483  fNENatoms->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoNatoms()");
484  fMixElem->Connect("Selected(Int_t)", "TGeoMixtureEditor", this, "DoSelectElement(Int_t)");
485  fBAddElem->Connect("Clicked()", "TGeoMixtureEditor", this, "DoAddElem()");
486  fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
487  fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
488  fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
489  fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
490  fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
491  fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
492  fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
493  fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
494  fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
495  fInit = kFALSE;
496 }
497 
498 ////////////////////////////////////////////////////////////////////////////////
499 /// Connect to the selected mixture.
500 
502 {
503  if (obj == 0 || !(obj->InheritsFrom(TGeoMixture::Class()))) {
504  SetActive(kFALSE);
505  return;
506  }
508  fMixture = (TGeoMixture*)fMaterial;
509  UpdateElements();
510 }
511 
512 ////////////////////////////////////////////////////////////////////////////////
513 /// Check button state changed for fraction.
514 
516 {
517  if (fMixture->GetNelements() && fMixture->GetNmixt()) {
518  fChkFraction->SetDown(kFALSE);
519  fChkNatoms->SetDown(kTRUE);
520  return;
521  }
522  Bool_t isDown = fChkFraction->IsDown();
523  fChkNatoms->SetDown(!isDown);
524 }
525 
526 ////////////////////////////////////////////////////////////////////////////////
527 /// Check button state changed for natoms.
528 
530 {
531  if (fMixture->GetNelements() && !fMixture->GetNmixt()) {
532  fChkFraction->SetDown(kTRUE);
533  fChkNatoms->SetDown(kFALSE);
534  return;
535  }
536  Bool_t isDown = fChkNatoms->IsDown();
537  fChkFraction->SetDown(!isDown);
538 }
539 
540 ////////////////////////////////////////////////////////////////////////////////
541 /// Fraction changed.
542 
544 {
545  if (fMixture->GetNelements() && fMixture->GetNmixt()) return;
546  fChkFraction->SetDown(kTRUE);
547  fChkNatoms->SetDown(kFALSE);
548 }
549 
550 ////////////////////////////////////////////////////////////////////////////////
551 /// Natoms changed.
552 
554 {
555  if (fMixture->GetNelements() && !fMixture->GetNmixt()) return;
556  fChkFraction->SetDown(kFALSE);
557  fChkNatoms->SetDown(kTRUE);
558 }
559 
560 ////////////////////////////////////////////////////////////////////////////////
561 /// Slot for selecting an element.
562 
564 {
566  if (!el) {
567  Error("DoSelectElement", "No element at index %d", ielem);
568  return;
569  }
570  TString z = TString::Format("Z=%d",el->Z());
571  TString a = TString::Format("A=%d",(Int_t)el->A());
572  fAelem->SetText(a.Data());
573  fZelem->SetText(z.Data());
574 }
575 
576 ////////////////////////////////////////////////////////////////////////////////
577 /// Slot for adding an element. No undo.
578 
580 {
581  Bool_t byfraction = fChkFraction->IsDown();
582  Int_t natoms = (Int_t)fNENatoms->GetNumber();
583  if (!byfraction && natoms<=0) return;
584  Double_t frac = fNEFraction->GetNumber();
585  if (byfraction && frac<=0) return;
586  TGeoElement *el = gGeoManager->GetElementTable()->GetElement(fMixElem->GetSelected());
587  if (!el) return;
588  if (byfraction) fMixture->AddElement(el, frac);
589  else fMixture->AddElement(el, natoms);
590  fTabMgr->GetMaterialEditor(fMixture);
591 }
592 
593 ////////////////////////////////////////////////////////////////////////////////
594 /// Slot for applying modifications.
595 
597 {
598  const char *name = fMaterialName->GetText();
599  fMaterial->SetName(name);
600 
605 // fMaterial->SetRadLen(fMatRadLen->GetNumber(), fMatAbsLen->GetNumber());
608  fUndo->SetEnabled();
610 }
611 
612 ////////////////////////////////////////////////////////////////////////////////
613 /// Slot for undoing all changes.
614 
616 {
626  fMaterial->SetPressure(fPresi*6.2415e+8);
631 }
632 
633 ////////////////////////////////////////////////////////////////////////////////
634 /// Update the list of elements in the TGCanvas.
635 
637 {
638  fComps->RemoveAll();
639  Int_t nelem = fMixture->GetNelements();
640  for (Int_t i=0; i<nelem; i++) {
641  TString s;
642  Bool_t byfrac = (fMixture->GetNmixt())?kFALSE:kTRUE;
643  if (byfrac)
644  s.TString::Format("%d-%s-%d: Wmass = %g %%", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
645  (Int_t)fMixture->GetAmixt()[i],fMixture->GetWmixt()[i]);
646  else
647  s.TString::Format("%d-%s-%d: Natoms = %d", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
648  (Int_t)fMixture->GetAmixt()[i],fMixture->GetNmixt()[i]);
649 
650  TGLabel *label = new TGLabel(fComps, s);
652  fComps->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 1, 1, 0, 0));
653  }
654  fComps->MapSubwindows();
655 }
TGTextButton * fApply
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
TGNumberEntry * fMatA
TGNumberEntry * fMatTemperature
EGeoMaterialState GetState() const
Definition: TGeoMaterial.h:106
Table of elements.
Definition: TGeoElement.h:367
virtual Double_t GetDensity() const
Definition: TGeoMaterial.h:93
Int_t Z() const
Definition: TGeoElement.h:76
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:131
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.
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
void DoState(Int_t state)
Slot for material state.
ETGeoMaterialWid
virtual void SetNumber(Double_t val)
void DoPressure()
Slot for material pressure.
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorption lengths.
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
TArc * a
Definition: textangle.C:12
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Bool_t IsComposite() const
Definition: TGFrame.h:275
virtual void ConnectSignals2Slots()
Connect signals to slots.
const char * Class
Definition: TXMLSetup.cxx:64
void DoFraction()
Fraction changed.
void DoDensity()
Slot for density.
TGNumberEntry * fMatZ
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hirarchically all daughters of a composite frame.
virtual void SetModel(TObject *obj)
Connect to the selected material.
TGNumberEntry * fMatDensity
TGTextEntry * fMaterialName
void DoName()
Perform name change.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2335
ULong_t Pixel_t
Definition: GuiTypes.h:41
virtual void SetModel(TObject *obj)
Connect to the selected mixture.
Base class for chemical elements.
Definition: TGeoElement.h:46
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
Definition: TGComboBox.cxx:443
TGCompositeFrame(const TGCompositeFrame &)
void DoUndo()
Slot for cancelling current modifications.
virtual Double_t GetA() const
Definition: TGeoMaterial.h:90
virtual Double_t GetIntLen() const
Definition: TGeoMaterial.h:100
virtual TList * GetList() const
Definition: TGFrame.h:385
virtual ~TGeoMaterialEditor()
Destructor.
TGNumberEntry * fMatAbsLen
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
TGCompositeFrame * f23
TGTextButton * fUndo
virtual Double_t GetZ() const
Definition: TGeoMaterial.h:91
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Definition: TQObject.cxx:1137
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
Double_t GetPressure() const
Definition: TGeoMaterial.h:105
void DoA()
Slot for atomic mass.
virtual void SetSize(const TGDimension &s)
Definition: TGFrame.h:315
void DoApply1()
Slot for applying modifications.
Double_t GetTemperature() const
Definition: TGeoMaterial.h:104
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:90
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:488
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:925
void SetDensity(Double_t density)
Definition: TGeoMaterial.h:119
TGFrame * fFrame
Definition: TGLayout.h:125
Int_t GetNelements() const
Definition: TGeoElement.h:415
TGeoMaterial * fMaterial
void DoChkFraction()
Check button state changed for fraction.
void SetPressure(Double_t pressure)
Definition: TGeoMaterial.h:126
static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p)
Move frame fr at the end of the list of parent p.
void DoApply()
Slot for applying modifications.
virtual void ConnectSignals2Slots()
Connect signals to slots.
TGDimension GetSize() const
Definition: TGFrame.h:293
const char * GetText() const
Definition: TGTextEntry.h:140
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:254
#define ClassImp(name)
Definition: Rtypes.h:279
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:554
virtual Bool_t IsMixture() const
Definition: TGeoMaterial.h:114
void SetState(EGeoMaterialState state)
Definition: TGeoMaterial.h:127
double Double_t
Definition: RtypesCore.h:55
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:108
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:409
virtual Double_t GetNumber() const
ETGeoMixtureWid
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
void DoRadAbs()
Slot for radiation/absorbtion length.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
ETGeoMaterialStates
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
void SetZ(Double_t z)
Definition: TGeoMaterial.h:118
void SetTemperature(Double_t temperature)
Definition: TGeoMaterial.h:125
Bool_t fInit
Definition: TGedFrame.h:55
void UpdateElements()
Update the list of elements in the TGCanvas.
virtual Int_t GetSelected() const
Definition: TGComboBox.h:136
TGNumberEntryField * GetNumberEntry() const
void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGLabel.cxx:393
void DoNatoms()
Natoms changed.
void SetA(Double_t a)
Definition: TGeoMaterial.h:117
TF1 * f1
Definition: legend1.C:11
void DoUndo1()
Slot for undoing all changes.
Double_t A() const
Definition: TGeoElement.h:79
TGeoElement * GetElement(Int_t z)
Definition: TGeoElement.h:408
void DoAddElem()
Slot for adding an element. No undo.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line...
virtual Double_t GetRadLen() const
Definition: TGeoMaterial.h:99
void DoChkNatoms()
Check button state changed for natoms.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:949
const Bool_t kTRUE
Definition: Rtypes.h:91
void DoTemperature()
Slot for material temperature.
TGNumberEntry * fMatRadLen
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
char name[80]
Definition: TGX11.cxx:109
TGeoTabManager * fTabMgr
Definition: TGeoGedFrame.h:27
TGNumberEntry * fMatPressure
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
const char * Data() const
Definition: TString.h:349
void DoSelectElement(Int_t iel)
Slot for selecting an element.