Logo ROOT   6.12/06
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 /** \class TGeoMaterialEditor
13 \ingroup Geometry_builder
14 
15 Editors for materials.
16 
17 
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 absorption 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("Absorption 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/absorption 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 
387 /** \class TGeoMixtureEditor
388 \ingroup Geometry_builder
389 
390 Editors for mixtures.
391 
392 */
393 
395 
396 ////////////////////////////////////////////////////////////////////////////////
397 /// Constructor for mixture editor.
398 
400  Int_t height, UInt_t options, Pixel_t back)
401  : TGeoMaterialEditor(p, width, height, options | kVerticalFrame, back)
402 {
403  fMixture = 0;
404  TGCompositeFrame *compxyz=0, *f1=0;
405  TGTextEntry *nef;
406  MakeTitle("Mixture settings");
407  fNelem = new TGLabel(this, "Number of elements: 0");
408  AddFrame(fNelem, new TGLayoutHints(kLHintsLeft , 6, 2, 2, 2));
409  compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame | kDoubleBorder);
410  // Combo box for selecting elements
411  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
415  if (table) {
416  TGeoElement *element;
417  for (Int_t i=0; i<table->GetNelements(); i++) {
418  element = table->GetElement(i);
419  if (element) fMixElem->AddEntry(element->GetTitle(),i);
420  }
421  }
422  fMixElem->Select(0);
424  f1->AddFrame(fMixElem, new TGLayoutHints(kLHintsLeft , 2, 2, 1, 1));
425  TGCompositeFrame *comp1 = new TGCompositeFrame(f1, 118, 30, kVerticalFrame);
426  fAelem = new TGLabel(comp1, "A = 0");
427  comp1->AddFrame(fAelem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
428  fZelem = new TGLabel(comp1, "Z = 0");
429  comp1->AddFrame(fZelem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
430  f1->AddFrame(comp1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX| kLHintsExpandY , 2, 2, 0, 0));
431  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 0, 0));
432 
433  // Fraction by weight
434  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
436  fChkFraction = new TGCheckButton(f1, "% weight");
438  f1->AddFrame(fChkFraction, new TGLayoutHints(kLHintsLeft , 2, 2, 6, 1));
443  nef->SetToolTipText("Enter fraction by weight of this element");
444  fNEFraction->SetNumber(0.);
445  fNEFraction->Associate(this);
446  f1->AddFrame(fNEFraction, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
447  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
448 
449  // Fraction by number of atoms
450  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
452  fChkNatoms = new TGCheckButton(f1, "N. atoms");
454  f1->AddFrame(fChkNatoms, new TGLayoutHints(kLHintsLeft, 2, 2, 6, 1));
455  fNENatoms = new TGNumberEntry(f1, 0., 5, kMIX_NATOMS);
459  nef->SetToolTipText("Enter number of atoms for this element");
460  fNENatoms->SetNumber(0);
461  fNENatoms->Associate(this);
462  f1->AddFrame(fNENatoms, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
463  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
464 
465  // Button for adding the element
466  fBAddElem = new TGTextButton(compxyz, "Add component");
467  fBAddElem->Associate(this);
468  compxyz->AddFrame(fBAddElem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
469 
470  compxyz->Resize(150,30);
471  AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 1, 1));
472 
473  // List view with all components
474  fComps = new TGCompositeFrame(this, 150, 100, kVerticalFrame | kSunkenFrame);
476 
478 }
479 
480 ////////////////////////////////////////////////////////////////////////////////
481 /// Connect signals to slots.
482 
484 {
485  fApply->Connect("Clicked()", "TGeoMixtureEditor", this, "DoApply1()");
486  fUndo->Connect("Clicked()", "TGeoMixtureEditor", this, "DoUndo1()");
487  fChkFraction->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkFraction()");
488  fChkNatoms->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkNatoms()");
489  fNEFraction->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoFraction()");
490  fNENatoms->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoNatoms()");
491  fMixElem->Connect("Selected(Int_t)", "TGeoMixtureEditor", this, "DoSelectElement(Int_t)");
492  fBAddElem->Connect("Clicked()", "TGeoMixtureEditor", this, "DoAddElem()");
493  fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
494  fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
495  fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
496  fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
497  fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
498  fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
499  fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
500  fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
501  fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
502  fInit = kFALSE;
503 }
504 
505 ////////////////////////////////////////////////////////////////////////////////
506 /// Connect to the selected mixture.
507 
509 {
510  if (obj == 0 || !(obj->InheritsFrom(TGeoMixture::Class()))) {
511  SetActive(kFALSE);
512  return;
513  }
516  UpdateElements();
517 }
518 
519 ////////////////////////////////////////////////////////////////////////////////
520 /// Check button state changed for fraction.
521 
523 {
524  if (fMixture->GetNelements() && fMixture->GetNmixt()) {
527  return;
528  }
529  Bool_t isDown = fChkFraction->IsDown();
530  fChkNatoms->SetDown(!isDown);
531 }
532 
533 ////////////////////////////////////////////////////////////////////////////////
534 /// Check button state changed for natoms.
535 
537 {
538  if (fMixture->GetNelements() && !fMixture->GetNmixt()) {
541  return;
542  }
543  Bool_t isDown = fChkNatoms->IsDown();
544  fChkFraction->SetDown(!isDown);
545 }
546 
547 ////////////////////////////////////////////////////////////////////////////////
548 /// Fraction changed.
549 
551 {
552  if (fMixture->GetNelements() && fMixture->GetNmixt()) return;
555 }
556 
557 ////////////////////////////////////////////////////////////////////////////////
558 /// Natoms changed.
559 
561 {
562  if (fMixture->GetNelements() && !fMixture->GetNmixt()) return;
565 }
566 
567 ////////////////////////////////////////////////////////////////////////////////
568 /// Slot for selecting an element.
569 
571 {
573  if (!el) {
574  Error("DoSelectElement", "No element at index %d", ielem);
575  return;
576  }
577  TString z = TString::Format("Z=%d",el->Z());
578  TString a = TString::Format("A=%d",(Int_t)el->A());
579  fAelem->SetText(a.Data());
580  fZelem->SetText(z.Data());
581 }
582 
583 ////////////////////////////////////////////////////////////////////////////////
584 /// Slot for adding an element. No undo.
585 
587 {
588  Bool_t byfraction = fChkFraction->IsDown();
589  Int_t natoms = (Int_t)fNENatoms->GetNumber();
590  if (!byfraction && natoms<=0) return;
591  Double_t frac = fNEFraction->GetNumber();
592  if (byfraction && frac<=0) return;
594  if (!el) return;
595  if (byfraction) fMixture->AddElement(el, frac);
596  else fMixture->AddElement(el, natoms);
598 }
599 
600 ////////////////////////////////////////////////////////////////////////////////
601 /// Slot for applying modifications.
602 
604 {
605  const char *name = fMaterialName->GetText();
606  fMaterial->SetName(name);
607 
612 // fMaterial->SetRadLen(fMatRadLen->GetNumber(), fMatAbsLen->GetNumber());
615  fUndo->SetEnabled();
617 }
618 
619 ////////////////////////////////////////////////////////////////////////////////
620 /// Slot for undoing all changes.
621 
623 {
633  fMaterial->SetPressure(fPresi*6.2415e+8);
638 }
639 
640 ////////////////////////////////////////////////////////////////////////////////
641 /// Update the list of elements in the TGCanvas.
642 
644 {
645  fComps->RemoveAll();
646  Int_t nelem = fMixture->GetNelements();
647  for (Int_t i=0; i<nelem; i++) {
648  TString s;
649  Bool_t byfrac = (fMixture->GetNmixt())?kFALSE:kTRUE;
650  if (byfrac)
651  s.TString::Format("%d-%s-%d: Wmass = %g %%", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
652  (Int_t)fMixture->GetAmixt()[i],fMixture->GetWmixt()[i]);
653  else
654  s.TString::Format("%d-%s-%d: Natoms = %d", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
655  (Int_t)fMixture->GetAmixt()[i],fMixture->GetNmixt()[i]);
656 
657  TGLabel *label = new TGLabel(fComps, s);
659  fComps->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 1, 1, 0, 0));
660  }
662 }
TGTextButton * fApply
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
TGNumberEntry * fMatA
Mixtures of elements.
Definition: TGeoMaterial.h:134
TGNumberEntry * fMatTemperature
Table of elements.
Definition: TGeoElement.h:369
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class &quot;classname&quot;.
Definition: TObject.cxx:443
Int_t Z() const
Definition: TGeoElement.h:73
virtual Bool_t IsComposite() const
Definition: TGFrame.h:259
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:173
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
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.
virtual void SetA(Double_t a)
Definition: TGeoMaterial.h:111
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.
virtual Bool_t IsDown() const
Definition: TGButton.h:312
Double_t GetPressure() const
Definition: TGeoMaterial.h:99
TGCompositeFrame * fComps
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:125
virtual TList * GetList() const
Definition: TGFrame.h:369
Base class describing materials.
Definition: TGeoMaterial.h:29
virtual void SetZ(Double_t z)
Definition: TGeoMaterial.h:112
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
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
virtual void ConnectSignals2Slots()
Connect signals to slots.
Editors for materials.
void DoFraction()
Fraction changed.
void DoDensity()
Slot for density.
TGNumberEntry * fMatZ
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
const char * Data() const
Definition: TString.h:345
virtual void SetModel(TObject *obj)
Connect to the selected material.
Double_t A() const
Definition: TGeoElement.h:76
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:2365
ULong_t Pixel_t
Definition: GuiTypes.h:39
virtual void SetModel(TObject *obj)
Connect to the selected mixture.
void Class()
Definition: Class.C:29
Double_t * GetWmixt() const
Definition: TGeoMaterial.h:175
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:177
const char * GetText() const
Definition: TGTextEntry.h:134
virtual Bool_t IsMixture() const
Definition: TGeoMaterial.h:108
Base class for chemical elements.
Definition: TGeoElement.h:36
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
Retrieve 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:880
virtual ~TGeoMaterialEditor()
Destructor.
TGNumberEntry * fMatAbsLen
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
TGCompositeFrame * f23
TGeoMixtureEditor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for mixture editor.
TGTextButton * fUndo
virtual Double_t GetA() const
Definition: TGeoMaterial.h:84
TGCheckButton * fChkFraction
EGeoMaterialState GetState() const
Definition: TGeoMaterial.h:100
virtual Int_t GetSelected() const
Definition: TGComboBox.h:134
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:94
virtual Int_t GetNelements() const
Definition: TGeoMaterial.h:172
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:867
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
Int_t * GetNmixt() const
Definition: TGeoMaterial.h:176
void DoA()
Slot for atomic mass.
virtual void SetSize(const TGDimension &s)
Definition: TGFrame.h:299
void DoApply1()
Slot for applying modifications.
auto * a
Definition: textangle.C:12
TGTextButton * fBAddElem
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
TGeoMixture * fMixture
Double_t GetTemperature() const
Definition: TGeoMaterial.h:98
TGNumberEntry * fNENatoms
unsigned int UInt_t
Definition: RtypesCore.h:42
TGFrame * fFrame
Definition: TGLayout.h:119
TGeoMaterial * fMaterial
void DoChkFraction()
Check button state changed for fraction.
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
void SetPressure(Double_t pressure)
Definition: TGeoMaterial.h:120
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.
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual void SetFormat(EStyle style, EAttribute attr=TGNumberFormat::kNEAAnyNumber)
#define ClassImp(name)
Definition: Rtypes.h:359
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:559
void SetState(EGeoMaterialState state)
Definition: TGeoMaterial.h:121
double Double_t
Definition: RtypesCore.h:55
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:409
TGDimension GetSize() const
Definition: TGFrame.h:277
ETGeoMixtureWid
Editors for mixtures.
static constexpr double s
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/absorption length.
Double_t * GetAmixt() const
Definition: TGeoMaterial.h:174
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
virtual Double_t GetZ() const
Definition: TGeoMaterial.h:85
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
virtual Double_t GetRadLen() const
Definition: TGeoMaterial.h:93
virtual void SetDown(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.cxx:260
void SetTemperature(Double_t temperature)
Definition: TGeoMaterial.h:119
Bool_t fInit
Definition: TGedFrame.h:53
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:238
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:87
void DoNatoms()
Natoms changed.
virtual void SetDensity(Double_t density)
Definition: TGeoMaterial.h:113
TGNumberEntry * fNEFraction
TF1 * f1
Definition: legend1.C:11
void DoUndo1()
Slot for undoing all changes.
Int_t GetNelements() const
Definition: TGeoElement.h:417
virtual Double_t GetNumber() const
TGCheckButton * fChkNatoms
TGeoElement * GetElement(Int_t z)
Definition: TGeoElement.h:410
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
void DoTemperature()
Slot for material temperature.
TGNumberEntry * fMatRadLen
const Bool_t kTRUE
Definition: RtypesCore.h:87
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:17
TGNumberEntry * fMatPressure
Common base class for geombuilder editors.
Definition: TGeoGedFrame.h:13
void DoSelectElement(Int_t iel)
Slot for selecting an element.