ROOT  6.06/09
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 
37 enum ETGeoMaterialWid {
38  kMATERIAL_NAME, kMATERIAL_A, kMATERIAL_Z, kMATERIAL_RHO,
39  kMATERIAL_RAD, kMATERIAL_ABS, kMATERIAL_STATE, kMATERIAL_TEMP, kMATERIAL_PRES,
40  kMATERIAL_APPLY, kMATERIAL_CANCEL, kMATERIAL_UNDO
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");
67  fMaterialName = new TGTextEntry(this, new TGTextBuffer(50), kMATERIAL_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));
78  fMatA = new TGNumberEntry(f1, 0., 6, kMATERIAL_A, TGNumberFormat::kNESRealThree);
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));
84  fMatZ = new TGNumberEntry(f1, 0., 4, kMATERIAL_Z, TGNumberFormat::kNESInteger);
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));
98  fMatState = new TGComboBox(f1, kMATERIAL_STATE);
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));
111  fMatDensity = new TGNumberEntry(f1, 0., 5, kMATERIAL_RHO, TGNumberFormat::kNESRealThree);
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));
123  fMatTemperature = new TGNumberEntry(f1, 0., 5, kMATERIAL_TEMP, TGNumberFormat::kNESRealTwo);
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));
135  fMatPressure = new TGNumberEntry(f1, 0., 5, kMATERIAL_PRES, TGNumberFormat::kNESRealThree);
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 
470  TGeoTabManager::MoveFrame(f23, this);
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  }
509  UpdateElements();
510 }
511 
512 ////////////////////////////////////////////////////////////////////////////////
513 /// Check button state changed for fraction.
514 
516 {
517  if (fMixture->GetNelements() && fMixture->GetNmixt()) {
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()) {
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;
548 }
549 
550 ////////////////////////////////////////////////////////////////////////////////
551 /// Natoms changed.
552 
554 {
555  if (fMixture->GetNelements() && !fMixture->GetNmixt()) return;
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;
587  if (!el) return;
588  if (byfraction) fMixture->AddElement(el, frac);
589  else fMixture->AddElement(el, natoms);
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  }
655 }
TGTextButton * fApply
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
TGNumberEntry * fMatA
TGNumberEntry * fMatTemperature
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:487
ClassImp(TGeoMaterialEditor) enum ETGeoMaterialWid
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
Int_t Z() const
Definition: TGeoElement.h:76
virtual Bool_t IsComposite() const
Definition: TGFrame.h:275
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
Double_t * GetZmixt() const
Definition: TGeoMaterial.h:196
virtual void SetName(const char *name)
Change (i.e.
Definition: TNamed.cxx:128
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.
virtual void SetNumber(Double_t val)
void DoPressure()
Slot for material pressure.
virtual Bool_t IsDown() const
Definition: TGButton.h:316
Double_t GetPressure() const
Definition: TGeoMaterial.h:118
TGCompositeFrame * fComps
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorbtion lengths.
void DoModified()
Slot for signaling modifications.
Basic string class.
Definition: TString.h:137
virtual TList * GetList() const
Definition: TGFrame.h:385
virtual void RemoveAll()
Remove all frames from composite frame.
Definition: TGFrame.cxx:1113
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 void ConnectSignals2Slots()
Connect signals to slots.
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.
const char * Data() const
Definition: TString.h:349
virtual void SetModel(TObject *obj)
Connect to the selected material.
Double_t A() const
Definition: TGeoElement.h:79
TGNumberEntry * fMatDensity
TGTextEntry * fMaterialName
TGNumberEntryField * GetNumberEntry() const
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:2334
ULong_t Pixel_t
Definition: GuiTypes.h:41
virtual void SetModel(TObject *obj)
Connect to the selected mixture.
void Class()
Definition: Class.C:29
Double_t * GetWmixt() const
Definition: TGeoMaterial.h:198
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:177
const char * GetText() const
Definition: TGTextEntry.h:140
virtual Bool_t IsMixture() const
Definition: TGeoMaterial.h:127
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 TGeoElement * GetElement(Int_t i=0) const
Retreive the pointer to the element corresponding to component I.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
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 GetA() const
Definition: TGeoMaterial.h:103
TGCheckButton * fChkFraction
EGeoMaterialState GetState() const
Definition: TGeoMaterial.h:119
virtual Int_t GetSelected() const
Definition: TGComboBox.h:136
void AddElement(Double_t a, Double_t z, Double_t weight)
add an element to the mixture using fraction by weight Check if the element is already defined ...
virtual Double_t GetIntLen() const
Definition: TGeoMaterial.h:113
virtual Int_t GetNelements() const
Definition: TGeoMaterial.h:195
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:1135
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
Int_t * GetNmixt() const
Definition: TGeoMaterial.h:199
void DoA()
Slot for atomic mass.
virtual void SetSize(const TGDimension &s)
Definition: TGFrame.h:315
void DoApply1()
Slot for applying modifications.
TGTextButton * fBAddElem
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:90
TGeoMixture * fMixture
Double_t GetTemperature() const
Definition: TGeoMaterial.h:117
TGNumberEntry * fNENatoms
unsigned int UInt_t
Definition: RtypesCore.h:42
void SetDensity(Double_t density)
Definition: TGeoMaterial.h:132
TGFrame * fFrame
Definition: TGLayout.h:125
TGeoMaterial * fMaterial
void DoChkFraction()
Check button state changed for fraction.
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
void SetPressure(Double_t pressure)
Definition: TGeoMaterial.h:139
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.
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:556
void SetState(EGeoMaterialState state)
Definition: TGeoMaterial.h:140
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
TGDimension GetSize() const
Definition: TGFrame.h:293
ETGeoMixtureWid
void DoRadAbs()
Slot for radiation/absorbtion length.
Double_t * GetAmixt() const
Definition: TGeoMaterial.h:197
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual Double_t GetZ() const
Definition: TGeoMaterial.h:104
ETGeoMaterialStates
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Double_t GetRadLen() const
Definition: TGeoMaterial.h:112
virtual void SetDown(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.cxx:260
void SetZ(Double_t z)
Definition: TGeoMaterial.h:131
void SetTemperature(Double_t temperature)
Definition: TGeoMaterial.h:138
Bool_t fInit
Definition: TGedFrame.h:55
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:254
void UpdateElements()
Update the list of elements in the TGCanvas.
void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGLabel.cxx:393
virtual Double_t GetDensity() const
Definition: TGeoMaterial.h:106
void DoNatoms()
Natoms changed.
TGNumberEntry * fNEFraction
void SetA(Double_t a)
Definition: TGeoMaterial.h:130
TF1 * f1
Definition: legend1.C:11
void DoUndo1()
Slot for undoing all changes.
Int_t GetNelements() const
Definition: TGeoElement.h:415
virtual Double_t GetNumber() const
TGCheckButton * fChkNatoms
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...
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
TObject * obj
void DoTemperature()
Slot for material temperature.
TGNumberEntry * fMatRadLen
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
TGeoTabManager * fTabMgr
Definition: TGeoGedFrame.h:27
TGNumberEntry * fMatPressure
void DoSelectElement(Int_t iel)
Slot for selecting an element.