Logo ROOT  
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 /** \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 "TGeoElement.h"
24 #include "TGeoManager.h"
25 #include "TVirtualGeoPainter.h"
26 #include "TGTab.h"
27 #include "TGComboBox.h"
28 #include "TGButton.h"
29 #include "TGTextEntry.h"
30 #include "TGNumberEntry.h"
31 #include "TGLabel.h"
32 
34 
39 };
40 
43 };
44 
47 };
48 
49 ////////////////////////////////////////////////////////////////////////////////
50 /// Constructor for material editor.
51 
53  Int_t height, UInt_t options, Pixel_t back)
54  : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
55 {
56  fMaterial = 0;
57  fAi = fZi = 0;
58  fDensityi = 0.0;
59  fNamei = "";
62 
63  // TextEntry for material name
64  MakeTitle("Name");
67  fMaterialName->SetToolTipText("Enter the material name");
68  fMaterialName->Associate(this);
70 
71  TGTextEntry *nef;
72  MakeTitle("Material properties");
75  f1->AddFrame(new TGLabel(f1, "A"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
77  nef = (TGTextEntry*)fMatA->GetNumberEntry();
78  nef->SetToolTipText("Enter the atomic mass");
79  fMatA->Associate(this);
80  f1->AddFrame(fMatA, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
81  f1->AddFrame(new TGLabel(f1, "Z"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
83  nef = (TGTextEntry*)fMatZ->GetNumberEntry();
84  nef->SetToolTipText("Enter the atomic charge");
85  fMatZ->Associate(this);
86  f1->AddFrame(fMatZ, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
87  f1->Resize(150,30);
88  AddFrame(f1, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
89 
90 
92  // Combo box for material state
93  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
95  f1->AddFrame(new TGLabel(f1, "State"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
102  f1->AddFrame(fMatState, new TGLayoutHints(kLHintsRight , 2, 2, 1, 1));
103  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
104 
105  // Number entry for density
106  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
108  f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
112  nef->SetToolTipText("Enter material density in [g/cm3]");
113  fMatDensity->Associate(this);
114  f1->AddFrame(fMatDensity, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
115  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
116 
117  // Number entry for temperature
118  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
120  f1->AddFrame(new TGLabel(f1, "Temperature"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
124  nef->SetToolTipText("Enter material temperature in [Kelvin]");
125  fMatTemperature->Associate(this);
126  f1->AddFrame(fMatTemperature, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
127  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
128 
129  // Number entry for pressure
130  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
132  f1->AddFrame(new TGLabel(f1, "Pressure"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
136  nef->SetToolTipText("Enter material pressure in [bar]");
137  fMatPressure->Associate(this);
138  f1->AddFrame(fMatPressure, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
139  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
140 
141  // Number entry for radiation length
142  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
144  f1->AddFrame(new TGLabel(f1, "RadLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
145  fMatRadLen = new TGNumberEntry(f1, 0., 5, kMATERIAL_RAD);
148  nef->SetToolTipText("Computed radiation length");
149  fMatRadLen->Associate(this);
150  f1->AddFrame(fMatRadLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
151  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
152 
153  // Number entry for absorption length
154  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
156  f1->AddFrame(new TGLabel(f1, "AbsLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
157  fMatAbsLen = new TGNumberEntry(f1, 0., 5, kMATERIAL_ABS);
160  nef->SetToolTipText("Absorption length");
161  fMatAbsLen->Associate(this);
162  f1->AddFrame(fMatAbsLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
163  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
164 
165  compxyz->Resize(150,30);
166  AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 2, 2));
167 
168  // Buttons
170  fApply = new TGTextButton(f23, "Apply");
171  f23->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 1, 1));
172  fApply->Associate(this);
173  fUndo = new TGTextButton(f23, " Undo ");
174  f23->AddFrame(fUndo, new TGLayoutHints(kLHintsRight , 2, 2, 1, 1));
175  fUndo->Associate(this);
176  AddFrame(f23, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
178 }
179 
180 ////////////////////////////////////////////////////////////////////////////////
181 /// Destructor
182 
184 {
185  TGFrameElement *el;
186  TIter next(GetList());
187  while ((el = (TGFrameElement *)next())) {
188  if (el->fFrame->IsComposite())
190  }
191  Cleanup();
192 }
193 
194 ////////////////////////////////////////////////////////////////////////////////
195 /// Connect signals to slots.
196 
198 {
199  fApply->Connect("Clicked()", "TGeoMaterialEditor", this, "DoApply()");
200  fUndo->Connect("Clicked()", "TGeoMaterialEditor", this, "DoUndo()");
201  fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
202  fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
203  fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
204  fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
205  fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
206  fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
207  fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
208  fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
209  fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
210  fInit = kFALSE;
211 }
212 
213 ////////////////////////////////////////////////////////////////////////////////
214 /// Connect to the selected material.
215 
217 {
218  if (obj == 0 || !(obj->InheritsFrom(TGeoMaterial::Class()))) {
219  SetActive(kFALSE);
220  return;
221  }
222  fMaterial = (TGeoMaterial*)obj;
223  fAi = fMaterial->GetA();
224  fZi = (Int_t)fMaterial->GetZ();
228  fPresi = fMaterial->GetPressure()/6.2415e+8;
229  fNamei = fMaterial->GetName();
231  fMatA->SetNumber(fAi);
232  fMatZ->SetNumber(fZi);
241 
243  SetActive();
244 }
245 
246 ////////////////////////////////////////////////////////////////////////////////
247 /// Perform name change.
248 
250 {
251  DoModified();
252 }
253 
254 ////////////////////////////////////////////////////////////////////////////////
255 /// Slot for atomic mass.
256 
258 {
259  if (fMaterial->IsMixture()) {
261  return;
262  }
263  DoModified();
264 }
265 
266 ////////////////////////////////////////////////////////////////////////////////
267 /// Slot for charge.
268 
270 {
271  if (fMaterial->IsMixture()) {
273  return;
274  }
275  Int_t z = (Int_t)fMatZ->GetNumber();
277  if (z >= table->GetNelements()) {
278  z = table->GetNelements()-1;
279  fMatZ->SetNumber(z);
280  }
281  TGeoElement *elem = table->GetElement(z);
282  if (!elem) return;
283  Double_t a = elem->A();
284  fMatA->SetNumber(a);
285  DoModified();
286 }
287 
288 ////////////////////////////////////////////////////////////////////////////////
289 /// Slot for material state.
290 
292 {
293  DoModified();
294 }
295 
296 ////////////////////////////////////////////////////////////////////////////////
297 /// Slot for material temperature.
298 
300 {
301  DoModified();
302 }
303 
304 ////////////////////////////////////////////////////////////////////////////////
305 /// Slot for material pressure.
306 
308 {
309  DoModified();
310 }
311 
312 ////////////////////////////////////////////////////////////////////////////////
313 /// Slot for density.
314 /// fMatDensity->SetNumber(fDensityi);
315 
317 {
318  DoModified();
319 }
320 
321 ////////////////////////////////////////////////////////////////////////////////
322 /// Slot for radiation/absorption length.
323 
325 {
328  DoModified();
329 }
330 
331 ////////////////////////////////////////////////////////////////////////////////
332 /// Slot for applying modifications.
333 
335 {
336  const char *name = fMaterialName->GetText();
338 
348  fUndo->SetEnabled();
350 }
351 
352 ////////////////////////////////////////////////////////////////////////////////
353 /// Slot for cancelling current modifications.
354 
356 {
359  fMatA->SetNumber(fAi);
360  fMaterial->SetA(fAi);
361  fMatZ->SetNumber(fZi);
362  fMaterial->SetZ(fZi);
370  fMaterial->SetPressure(fPresi*6.2415e+8);
375 }
376 
377 ////////////////////////////////////////////////////////////////////////////////
378 /// Slot for signaling modifications.
379 
381 {
382  fApply->SetEnabled();
383 }
384 
385 /** \class TGeoMixtureEditor
386 \ingroup Geometry_builder
387 
388 Editors for mixtures.
389 
390 */
391 
393 
394 ////////////////////////////////////////////////////////////////////////////////
395 /// Constructor for mixture editor.
396 
398  Int_t height, UInt_t options, Pixel_t back)
399  : TGeoMaterialEditor(p, width, height, options | kVerticalFrame, back)
400 {
401  fMixture = 0;
402  TGCompositeFrame *compxyz=0, *f1=0;
403  TGTextEntry *nef;
404  MakeTitle("Mixture settings");
405  fNelem = new TGLabel(this, "Number of elements: 0");
406  AddFrame(fNelem, new TGLayoutHints(kLHintsLeft , 6, 2, 2, 2));
407  compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame | kDoubleBorder);
408  // Combo box for selecting elements
409  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
413  if (table) {
414  TGeoElement *element;
415  for (Int_t i=0; i<table->GetNelements(); i++) {
416  element = table->GetElement(i);
417  if (element) fMixElem->AddEntry(element->GetTitle(),i);
418  }
419  }
420  fMixElem->Select(0);
422  f1->AddFrame(fMixElem, new TGLayoutHints(kLHintsLeft , 2, 2, 1, 1));
423  TGCompositeFrame *comp1 = new TGCompositeFrame(f1, 118, 30, kVerticalFrame);
424  fAelem = new TGLabel(comp1, "A = 0");
425  comp1->AddFrame(fAelem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
426  fZelem = new TGLabel(comp1, "Z = 0");
427  comp1->AddFrame(fZelem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
428  f1->AddFrame(comp1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX| kLHintsExpandY , 2, 2, 0, 0));
429  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 0, 0));
430 
431  // Fraction by weight
432  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
434  fChkFraction = new TGCheckButton(f1, "% weight");
436  f1->AddFrame(fChkFraction, new TGLayoutHints(kLHintsLeft , 2, 2, 6, 1));
441  nef->SetToolTipText("Enter fraction by weight of this element");
442  fNEFraction->SetNumber(0.);
443  fNEFraction->Associate(this);
444  f1->AddFrame(fNEFraction, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
445  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
446 
447  // Fraction by number of atoms
448  f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
450  fChkNatoms = new TGCheckButton(f1, "N. atoms");
452  f1->AddFrame(fChkNatoms, new TGLayoutHints(kLHintsLeft, 2, 2, 6, 1));
453  fNENatoms = new TGNumberEntry(f1, 0., 5, kMIX_NATOMS);
457  nef->SetToolTipText("Enter number of atoms for this element");
458  fNENatoms->SetNumber(0);
459  fNENatoms->Associate(this);
460  f1->AddFrame(fNENatoms, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
461  compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
462 
463  // Button for adding the element
464  fBAddElem = new TGTextButton(compxyz, "Add component");
465  fBAddElem->Associate(this);
466  compxyz->AddFrame(fBAddElem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
467 
468  compxyz->Resize(150,30);
469  AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 1, 1));
470 
471  // List view with all components
472  fComps = new TGCompositeFrame(this, 150, 100, kVerticalFrame | kSunkenFrame);
474 
476 }
477 
478 ////////////////////////////////////////////////////////////////////////////////
479 /// Connect signals to slots.
480 
482 {
483  fApply->Connect("Clicked()", "TGeoMixtureEditor", this, "DoApply1()");
484  fUndo->Connect("Clicked()", "TGeoMixtureEditor", this, "DoUndo1()");
485  fChkFraction->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkFraction()");
486  fChkNatoms->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkNatoms()");
487  fNEFraction->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoFraction()");
488  fNENatoms->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoNatoms()");
489  fMixElem->Connect("Selected(Int_t)", "TGeoMixtureEditor", this, "DoSelectElement(Int_t)");
490  fBAddElem->Connect("Clicked()", "TGeoMixtureEditor", this, "DoAddElem()");
491  fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
492  fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
493  fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
494  fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
495  fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
496  fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
497  fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
498  fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
499  fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
500  fInit = kFALSE;
501 }
502 
503 ////////////////////////////////////////////////////////////////////////////////
504 /// Connect to the selected mixture.
505 
507 {
508  if (obj == 0 || !(obj->InheritsFrom(TGeoMixture::Class()))) {
509  SetActive(kFALSE);
510  return;
511  }
514  UpdateElements();
515 }
516 
517 ////////////////////////////////////////////////////////////////////////////////
518 /// Check button state changed for fraction.
519 
521 {
522  if (fMixture->GetNelements() && fMixture->GetNmixt()) {
525  return;
526  }
527  Bool_t isDown = fChkFraction->IsDown();
528  fChkNatoms->SetDown(!isDown);
529 }
530 
531 ////////////////////////////////////////////////////////////////////////////////
532 /// Check button state changed for natoms.
533 
535 {
536  if (fMixture->GetNelements() && !fMixture->GetNmixt()) {
539  return;
540  }
541  Bool_t isDown = fChkNatoms->IsDown();
542  fChkFraction->SetDown(!isDown);
543 }
544 
545 ////////////////////////////////////////////////////////////////////////////////
546 /// Fraction changed.
547 
549 {
550  if (fMixture->GetNelements() && fMixture->GetNmixt()) return;
553 }
554 
555 ////////////////////////////////////////////////////////////////////////////////
556 /// Natoms changed.
557 
559 {
560  if (fMixture->GetNelements() && !fMixture->GetNmixt()) return;
563 }
564 
565 ////////////////////////////////////////////////////////////////////////////////
566 /// Slot for selecting an element.
567 
569 {
571  if (!el) {
572  Error("DoSelectElement", "No element at index %d", ielem);
573  return;
574  }
575  TString z = TString::Format("Z=%d",el->Z());
576  TString a = TString::Format("A=%d",(Int_t)el->A());
577  fAelem->SetText(a.Data());
578  fZelem->SetText(z.Data());
579 }
580 
581 ////////////////////////////////////////////////////////////////////////////////
582 /// Slot for adding an element. No undo.
583 
585 {
586  Bool_t byfraction = fChkFraction->IsDown();
587  Int_t natoms = (Int_t)fNENatoms->GetNumber();
588  if (!byfraction && natoms<=0) return;
589  Double_t frac = fNEFraction->GetNumber();
590  if (byfraction && frac<=0) return;
592  if (!el) return;
593  if (byfraction) fMixture->AddElement(el, frac);
594  else fMixture->AddElement(el, natoms);
596 }
597 
598 ////////////////////////////////////////////////////////////////////////////////
599 /// Slot for applying modifications.
600 
602 {
603  const char *name = fMaterialName->GetText();
605 
610 // fMaterial->SetRadLen(fMatRadLen->GetNumber(), fMatAbsLen->GetNumber());
613  fUndo->SetEnabled();
615 }
616 
617 ////////////////////////////////////////////////////////////////////////////////
618 /// Slot for undoing all changes.
619 
621 {
631  fMaterial->SetPressure(fPresi*6.2415e+8);
636 }
637 
638 ////////////////////////////////////////////////////////////////////////////////
639 /// Update the list of elements in the TGCanvas.
640 
642 {
643  fComps->RemoveAll();
644  Int_t nelem = fMixture->GetNelements();
645  for (Int_t i=0; i<nelem; i++) {
646  TString s;
647  Bool_t byfrac = (fMixture->GetNmixt())?kFALSE:kTRUE;
648  if (byfrac)
649  s.TString::Format("%d-%s-%d: Wmass = %g %%", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
650  (Int_t)fMixture->GetAmixt()[i],fMixture->GetWmixt()[i]);
651  else
652  s.TString::Format("%d-%s-%d: Natoms = %d", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
653  (Int_t)fMixture->GetAmixt()[i],fMixture->GetNmixt()[i]);
654 
655  TGLabel *label = new TGLabel(fComps, s);
657  fComps->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 1, 1, 0, 0));
658  }
660 }
TGComboBox.h
TGeoMixtureEditor::fNEFraction
TGNumberEntry * fNEFraction
Definition: TGeoMaterialEditor.h:94
TGButton::SetEnabled
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:412
TGeoMixtureEditor::DoUndo1
void DoUndo1()
Slot for undoing all changes.
Definition: TGeoMaterialEditor.cxx:620
TGeoMaterial::GetDensity
virtual Double_t GetDensity() const
Definition: TGeoMaterial.h:108
TGeoElement::A
Double_t A() const
Definition: TGeoElement.h:76
TGeoMixtureEditor::DoAddElem
void DoAddElem()
Slot for adding an element. No undo.
Definition: TGeoMaterialEditor.cxx:584
TGWindow
Definition: TGWindow.h:31
TGeoMaterial::EGeoMaterialState
EGeoMaterialState
Definition: TGeoMaterial.h:42
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGTextEntry::SetText
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.
Definition: TGTextEntry.cxx:623
kMATERIAL_RHO
@ kMATERIAL_RHO
Definition: TGeoMaterialEditor.cxx:36
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
TGeoTabManager.h
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:347
TGeoElement::Z
Int_t Z() const
Definition: TGeoElement.h:73
TGeoMaterial::GetPressure
Double_t GetPressure() const
Definition: TGeoMaterial.h:120
TGeoMaterial::SetPressure
void SetPressure(Double_t pressure)
Definition: TGeoMaterial.h:141
TNamed::SetName
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
TGeoMaterialEditor
Editors for materials.
Definition: TGeoMaterialEditor.h:27
TGeoMaterial::kMatStateGas
@ kMatStateGas
Definition: TGeoMaterial.h:46
TGButton::SetDown
virtual void SetDown(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.cxx:263
TGeoMaterialEditor::fMatState
TGComboBox * fMatState
Definition: TGeoMaterialEditor.h:45
gGeoManager
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:602
TGCompositeFrame::TGCompositeFrame
TGCompositeFrame(const TGCompositeFrame &)
TGeoGedFrame
Common base class for geombuilder editors.
Definition: TGeoGedFrame.h:13
TString::Data
const char * Data() const
Definition: TString.h:369
TGeoMaterialEditor::fMatA
TGNumberEntry * fMatA
Definition: TGeoMaterialEditor.h:43
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGeoMixtureEditor::DoSelectElement
void DoSelectElement(Int_t iel)
Slot for selecting an element.
Definition: TGeoMaterialEditor.cxx:568
TGFrame::GetSize
TGDimension GetSize() const
Definition: TGFrame.h:255
TGeoMaterialEditor::fMatZ
TGNumberEntry * fMatZ
Definition: TGeoMaterialEditor.h:44
TGeoElementTable::GetElement
TGeoElement * GetElement(Int_t z)
Definition: TGeoElement.h:410
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
TGComboBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
kMATERIAL_STATE
@ kMATERIAL_STATE
Definition: TGeoMaterialEditor.cxx:37
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
kMATERIAL_RAD
@ kMATERIAL_RAD
Definition: TGeoMaterialEditor.cxx:37
TGNumberFormat::kNESRealThree
@ kNESRealThree
Definition: TGNumberEntry.h:37
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:31
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TGTextEntry::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
Definition: TGTextEntry.cxx:1663
TGeoMaterial::IsMixture
virtual Bool_t IsMixture() const
Definition: TGeoMaterial.h:129
TGLabel
Definition: TGLabel.h:32
TGCompositeFrame::Cleanup
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:952
TGeoMaterial::kMatStateSolid
@ kMatStateSolid
Definition: TGeoMaterial.h:44
TGeoMixtureEditor::SetModel
virtual void SetModel(TObject *obj)
Connect to the selected mixture.
Definition: TGeoMaterialEditor.cxx:506
TGeoMaterialEditor::DoDensity
void DoDensity()
Slot for density.
Definition: TGeoMaterialEditor.cxx:316
TGFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
TGeoMaterialEditor::fMatDensity
TGNumberEntry * fMatDensity
Definition: TGeoMaterialEditor.h:46
TGeoMixtureEditor::fComps
TGCompositeFrame * fComps
Definition: TGeoMaterialEditor.h:98
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGTextButton
Definition: TGButton.h:142
TGNumberFormat::kNEANonNegative
@ kNEANonNegative
Definition: TGNumberEntry.h:51
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TGeoMaterial::kMatStateLiquid
@ kMatStateLiquid
Definition: TGeoMaterial.h:45
TGeoMaterial::SetState
void SetState(EGeoMaterialState state)
Definition: TGeoMaterial.h:142
Int_t
int Int_t
Definition: RtypesCore.h:45
kMIX_FRAC
@ kMIX_FRAC
Definition: TGeoMaterialEditor.cxx:46
TGeoElementTable::GetNelements
Int_t GetNelements() const
Definition: TGeoElement.h:417
TGeoMaterialEditor::DoRadAbs
void DoRadAbs()
Slot for radiation/absorption length.
Definition: TGeoMaterialEditor.cxx:324
kMAT_SOLID
@ kMAT_SOLID
Definition: TGeoMaterialEditor.cxx:42
TGeoTabManager::GetMaterialEditor
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
Definition: TGeoTabManager.cxx:159
TGComboBox::Select
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:451
TGeoMaterial::SetRadLen
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorption lengths.
Definition: TGeoMaterial.cxx:430
TGeoTabManager::MoveFrame
static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p)
Move frame fr at the end of the list of parent p.
Definition: TGeoTabManager.cxx:231
TGeoMaterial::SetA
virtual void SetA(Double_t a)
Definition: TGeoMaterial.h:132
kMIX_ADDELEM
@ kMIX_ADDELEM
Definition: TGeoMaterialEditor.cxx:46
TGeoMaterialEditor::DoState
void DoState(Int_t state)
Slot for material state.
Definition: TGeoMaterialEditor.cxx:291
TGNumberFormat::kNESRealTwo
@ kNESRealTwo
Definition: TGNumberEntry.h:36
TGeoMixture::GetNmixt
Int_t * GetNmixt() const
Definition: TGeoMaterial.h:197
kMIX_CHK1
@ kMIX_CHK1
Definition: TGeoMaterialEditor.cxx:46
kTextCenterY
@ kTextCenterY
Definition: TGWidget.h:39
TGNumberEntry::GetNumberEntry
TGNumberEntryField * GetNumberEntry() const
Definition: TGNumberEntry.h:268
TGeoMaterialEditor::ConnectSignals2Slots
virtual void ConnectSignals2Slots()
Connect signals to slots.
Definition: TGeoMaterialEditor.cxx:197
TString::Format
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:2311
kMATERIAL_NAME
@ kMATERIAL_NAME
Definition: TGeoMaterialEditor.cxx:36
TGeoMaterialEditor::DoModified
void DoModified()
Slot for signaling modifications.
Definition: TGeoMaterialEditor.cxx:380
TString
Basic string class.
Definition: TString.h:136
TGeoMaterialEditor::f23
TGCompositeFrame * f23
Definition: TGeoMaterialEditor.h:51
kMATERIAL_PRES
@ kMATERIAL_PRES
Definition: TGeoMaterialEditor.cxx:37
TGeoMixture::AddElement
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
Definition: TGeoMaterial.cxx:783
TGeoMixture::GetElement
virtual TGeoElement * GetElement(Int_t i=0) const
Retrieve the pointer to the element corresponding to component I.
Definition: TGeoMaterial.cxx:988
TGeoMixture::GetWmixt
Double_t * GetWmixt() const
Definition: TGeoMaterial.h:196
TGeoTabManager::Cleanup
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
Definition: TGeoTabManager.cxx:88
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
TGeoMixture
Mixtures of elements.
Definition: TGeoMaterial.h:156
TGeoMaterial::GetIntLen
virtual Double_t GetIntLen() const
Definition: TGeoMaterial.h:115
TGeoMixtureEditor::fZelem
TGLabel * fZelem
Definition: TGeoMaterialEditor.h:92
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
TGeoMaterialEditor::fIsMaterialEditable
Bool_t fIsMaterialEditable
Definition: TGeoMaterialEditor.h:40
TGLabel::SetText
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:179
TGeoMaterial
Base class describing materials.
Definition: TGeoMaterial.h:36
bool
TGTextBuffer
Definition: TGTextBuffer.h:30
TGeoMaterialEditor::~TGeoMaterialEditor
virtual ~TGeoMaterialEditor()
Destructor.
Definition: TGeoMaterialEditor.cxx:183
TGeoMixtureEditor::fMixElem
TGComboBox * fMixElem
Definition: TGeoMaterialEditor.h:89
TGeoMaterialEditor::fUndo
TGTextButton * fUndo
Definition: TGeoMaterialEditor.h:53
TGFrameElement::fFrame
TGFrame * fFrame
Definition: TGLayout.h:119
TGTextEntry::SetDefaultSize
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
Definition: TGTextEntry.cxx:396
TGeoMaterial::GetRadLen
virtual Double_t GetRadLen() const
Definition: TGeoMaterial.h:114
TGeoMixtureEditor::fMixture
TGeoMixture * fMixture
Definition: TGeoMaterialEditor.h:87
TGeoMaterialEditor::DoName
void DoName()
Perform name change.
Definition: TGeoMaterialEditor.cxx:249
kTextLeft
@ kTextLeft
Definition: TGWidget.h:34
TGeoMaterial::SetDensity
virtual void SetDensity(Double_t density)
Definition: TGeoMaterial.h:134
kMIX_CHK2
@ kMIX_CHK2
Definition: TGeoMaterialEditor.cxx:46
TGCheckButton
Definition: TGButton.h:264
TGeoMixtureEditor::DoFraction
void DoFraction()
Fraction changed.
Definition: TGeoMaterialEditor.cxx:548
kMIX_ELEM
@ kMIX_ELEM
Definition: TGeoMaterialEditor.cxx:46
TGeoMaterialEditor::DoA
void DoA()
Slot for atomic mass.
Definition: TGeoMaterialEditor.cxx:257
kMATERIAL_Z
@ kMATERIAL_Z
Definition: TGeoMaterialEditor.cxx:36
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGeoMaterial::GetTemperature
Double_t GetTemperature() const
Definition: TGeoMaterial.h:119
TGeoMaterialEditor::fZi
Int_t fZi
Definition: TGeoMaterialEditor.h:32
TGeoMaterialEditor::fMaterial
TGeoMaterial * fMaterial
Definition: TGeoMaterialEditor.h:38
TGNumberEntry::SetNumber
virtual void SetNumber(Double_t val)
Definition: TGNumberEntry.h:186
TGeoMixtureEditor::TGeoMixtureEditor
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.
Definition: TGeoMaterialEditor.cxx:397
TGeoMaterialEditor::DoTemperature
void DoTemperature()
Slot for material temperature.
Definition: TGeoMaterialEditor.cxx:299
TGeoElement
Base class for chemical elements.
Definition: TGeoElement.h:37
TGeoMaterialEditor::fMatAbsLen
TGNumberEntry * fMatAbsLen
Definition: TGeoMaterialEditor.h:50
TGeoMaterialEditor::fNamei
TString fNamei
Definition: TGeoMaterialEditor.h:37
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
TGeoMixtureEditor::fNENatoms
TGNumberEntry * fNENatoms
Definition: TGeoMaterialEditor.h:96
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
TGeoElement.h
TGeoMixtureEditor::fChkFraction
TGCheckButton * fChkFraction
Definition: TGeoMaterialEditor.h:93
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
kMAT_GAS
@ kMAT_GAS
Definition: TGeoMaterialEditor.cxx:42
TGTextEntry
Definition: TGTextEntry.h:39
TGeoMaterial::GetZ
virtual Double_t GetZ() const
Definition: TGeoMaterial.h:106
a
auto * a
Definition: textangle.C:12
TGeoMaterial.h
TGeoMaterialEditor::fMatTemperature
TGNumberEntry * fMatTemperature
Definition: TGeoMaterialEditor.h:47
TGeoElementTable
Table of elements.
Definition: TGeoElement.h:370
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGeoMaterialEditor::fMatPressure
TGNumberEntry * fMatPressure
Definition: TGeoMaterialEditor.h:48
TGNumberEntry::SetFormat
virtual void SetFormat(EStyle style, EAttribute attr=TGNumberFormat::kNEAAnyNumber)
Definition: TGNumberEntry.h:225
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:33
TGCompositeFrame::RemoveAll
virtual void RemoveAll()
Remove all frames from composite frame.
Definition: TGFrame.cxx:1116
TGLayoutHints
Definition: TGLayout.h:57
ETGeoMaterialStates
ETGeoMaterialStates
Definition: TGeoMaterialEditor.cxx:41
TGeoMixtureEditor::DoApply1
void DoApply1()
Slot for applying modifications.
Definition: TGeoMaterialEditor.cxx:601
TGeoMixtureEditor::ConnectSignals2Slots
virtual void ConnectSignals2Slots()
Connect signals to slots.
Definition: TGeoMaterialEditor.cxx:481
ETGeoMaterialWid
ETGeoMaterialWid
Definition: TGeoMaterialEditor.cxx:35
kMATERIAL_CANCEL
@ kMATERIAL_CANCEL
Definition: TGeoMaterialEditor.cxx:38
TGTab.h
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:38
TGedFrame::MakeTitle
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
TGeoMaterialEditor::DoZ
void DoZ()
Slot for charge.
Definition: TGeoMaterialEditor.cxx:269
TGeoMaterialEditor::TGeoMaterialEditor
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.
Definition: TGeoMaterialEditor.cxx:52
TGeoMaterial::SetZ
virtual void SetZ(Double_t z)
Definition: TGeoMaterial.h:133
TGeoMaterial::GetState
EGeoMaterialState GetState() const
Definition: TGeoMaterial.h:121
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
unsigned int
TGeoMaterialEditor::fTempi
Double_t fTempi
Definition: TGeoMaterialEditor.h:35
TGeoGedFrame::SetActive
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
Definition: TGeoGedFrame.cxx:35
TGComboBox
Definition: TGComboBox.h:67
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TGCheckButton::IsDown
virtual Bool_t IsDown() const
Definition: TGButton.h:312
TGComboBox::GetSelected
virtual Int_t GetSelected() const
Definition: TGComboBox.h:134
TGeoManager.h
TGeoMaterial::SetTemperature
void SetTemperature(Double_t temperature)
Definition: TGeoMaterial.h:140
TGLabel.h
TGeoMixture::GetZmixt
Double_t * GetZmixt() const
Definition: TGeoMaterial.h:194
TGeoMixtureEditor::fBAddElem
TGTextButton * fBAddElem
Definition: TGeoMaterialEditor.h:97
TGeoMixture::GetNelements
virtual Int_t GetNelements() const
Definition: TGeoMaterial.h:193
f1
TF1 * f1
Definition: legend1.C:11
TVirtualGeoPainter.h
Double_t
double Double_t
Definition: RtypesCore.h:59
TGeoMixtureEditor::fChkNatoms
TGCheckButton * fChkNatoms
Definition: TGeoMaterialEditor.h:95
TQObject::Connect
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:866
TGeoMaterialEditor::DoPressure
void DoPressure()
Slot for material pressure.
Definition: TGeoMaterialEditor.cxx:307
TGeoMaterialEditor::fAi
Double_t fAi
Definition: TGeoMaterialEditor.h:31
TGeoMaterialEditor::DoApply
void DoApply()
Slot for applying modifications.
Definition: TGeoMaterialEditor.cxx:334
TGFrame::IsComposite
virtual Bool_t IsComposite() const
Definition: TGFrame.h:237
TGeoMaterialEditor::fMaterialName
TGTextEntry * fMaterialName
Definition: TGeoMaterialEditor.h:42
TGeoMixtureEditor::DoChkFraction
void DoChkFraction()
Check button state changed for fraction.
Definition: TGeoMaterialEditor.cxx:520
kMAT_UNDEFINED
@ kMAT_UNDEFINED
Definition: TGeoMaterialEditor.cxx:42
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TGTextEntry.h
TGButton.h
TGeoMaterial::kMatStateUndefined
@ kMatStateUndefined
Definition: TGeoMaterial.h:43
TGeoMixtureEditor::fAelem
TGLabel * fAelem
Definition: TGeoMaterialEditor.h:91
name
char name[80]
Definition: TGX11.cxx:110
TGNumberEntry::Associate
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
Definition: TGNumberEntry.cxx:2009
TGeoManager::GetElementTable
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
Definition: TGeoManager.cxx:3366
TGFrameElement
Definition: TGLayout.h:112
TGTextEntry::GetText
const char * GetText() const
Definition: TGTextEntry.h:134
TGFrame::SetSize
virtual void SetSize(const TGDimension &s)
Definition: TGFrame.h:277
TGeoMaterialEditor::SetModel
virtual void SetModel(TObject *obj)
Connect to the selected material.
Definition: TGeoMaterialEditor.cxx:216
TIter
Definition: TCollection.h:233
TGNumberEntry.h
TGNumberEntry::GetNumber
virtual Double_t GetNumber() const
Definition: TGNumberEntry.h:206
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:37
TGeoGedFrame::fTabMgr
TGeoTabManager * fTabMgr
Definition: TGeoGedFrame.h:17
TGeoMixtureEditor
Editors for mixtures.
Definition: TGeoMaterialEditor.h:83
TGeoMixture::GetAmixt
Double_t * GetAmixt() const
Definition: TGeoMaterial.h:195
TGeoMaterialEditor::fIsModified
Bool_t fIsModified
Definition: TGeoMaterialEditor.h:39
TGeoMaterialEditor::fMatRadLen
TGNumberEntry * fMatRadLen
Definition: TGeoMaterialEditor.h:49
TGeoMixtureEditor::DoChkNatoms
void DoChkNatoms()
Check button state changed for natoms.
Definition: TGeoMaterialEditor.cxx:534
TGNumberEntry
Definition: TGNumberEntry.h:157
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
kMATERIAL_UNDO
@ kMATERIAL_UNDO
Definition: TGeoMaterialEditor.cxx:38
ETGeoMixtureWid
ETGeoMixtureWid
Definition: TGeoMaterialEditor.cxx:45
TGeoMaterialEditor::fApply
TGTextButton * fApply
Definition: TGeoMaterialEditor.h:52
TGedFrame::fInit
Bool_t fInit
Definition: TGedFrame.h:53
TGeoMaterialEditor::fPresi
Double_t fPresi
Definition: TGeoMaterialEditor.h:36
kMATERIAL_APPLY
@ kMATERIAL_APPLY
Definition: TGeoMaterialEditor.cxx:38
kMAT_LIQUID
@ kMAT_LIQUID
Definition: TGeoMaterialEditor.cxx:42
TGeoMixtureEditor::fNelem
TGLabel * fNelem
Definition: TGeoMaterialEditor.h:90
kMATERIAL_A
@ kMATERIAL_A
Definition: TGeoMaterialEditor.cxx:36
Class
void Class()
Definition: Class.C:29
TGCompositeFrame
Definition: TGFrame.h:324
TGeoMaterialEditor::fDensityi
Double_t fDensityi
Definition: TGeoMaterialEditor.h:34
TGeoMaterialEditor.h
TGeoMaterial::GetA
virtual Double_t GetA() const
Definition: TGeoMaterial.h:105
kMIX_NATOMS
@ kMIX_NATOMS
Definition: TGeoMaterialEditor.cxx:46
kMATERIAL_ABS
@ kMATERIAL_ABS
Definition: TGeoMaterialEditor.cxx:37
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
TGLabel::SetTextJustify
void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGLabel.cxx:395
kMATERIAL_TEMP
@ kMATERIAL_TEMP
Definition: TGeoMaterialEditor.cxx:37
TGeoMaterialEditor::fStatei
Int_t fStatei
Definition: TGeoMaterialEditor.h:33
TGNumberFormat::kNESInteger
@ kNESInteger
Definition: TGNumberEntry.h:34
TGeoMaterialEditor::DoUndo
void DoUndo()
Slot for cancelling current modifications.
Definition: TGeoMaterialEditor.cxx:355
TGeoMixtureEditor::UpdateElements
void UpdateElements()
Update the list of elements in the TGCanvas.
Definition: TGeoMaterialEditor.cxx:641
int
TGeoMixtureEditor::DoNatoms
void DoNatoms()
Natoms changed.
Definition: TGeoMaterialEditor.cxx:558