Logo ROOT   6.18/05
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
15Editors 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");
72
73 TGTextEntry *nef;
74 MakeTitle("Material properties");
77 f1->AddFrame(new TGLabel(f1, "A"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
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));
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]");
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));
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));
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()))) {
222 return;
223 }
224 fMaterial = (TGeoMaterial*)obj;
225 fAi = fMaterial->GetA();
226 fZi = (Int_t)fMaterial->GetZ();
230 fPresi = fMaterial->GetPressure()/6.2415e+8;
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();
340
350 fUndo->SetEnabled();
352}
353
354////////////////////////////////////////////////////////////////////////////////
355/// Slot for cancelling current modifications.
356
358{
372 fMaterial->SetPressure(fPresi*6.2415e+8);
377}
378
379////////////////////////////////////////////////////////////////////////////////
380/// Slot for signaling modifications.
381
383{
385}
386
387/** \class TGeoMixtureEditor
388\ingroup Geometry_builder
389
390Editors 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");
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");
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()))) {
512 return;
513 }
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;
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();
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(),
653 else
654 s.TString::Format("%d-%s-%d: Natoms = %d", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
656
657 TGLabel *label = new TGLabel(fComps, s);
659 fComps->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 1, 1, 0, 0));
660 }
662}
void Class()
Definition: Class.C:29
ULong_t Pixel_t
Definition: GuiTypes.h:39
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:365
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ kRaisedFrame
Definition: TGFrame.h:62
@ kSunkenFrame
Definition: TGFrame.h:61
@ kVerticalFrame
Definition: TGFrame.h:59
@ kDoubleBorder
Definition: TGFrame.h:63
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ kOwnBackground
Definition: TGFrame.h:69
@ kLHintsRight
Definition: TGLayout.h:33
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsExpandX
Definition: TGLayout.h:37
@ kTextLeft
Definition: TGWidget.h:34
@ kTextCenterY
Definition: TGWidget.h:39
char name[80]
Definition: TGX11.cxx:109
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:601
ETGeoMaterialWid
@ kMATERIAL_TEMP
@ kMATERIAL_A
@ kMATERIAL_STATE
@ kMATERIAL_ABS
@ kMATERIAL_APPLY
@ kMATERIAL_RHO
@ kMATERIAL_Z
@ kMATERIAL_PRES
@ kMATERIAL_NAME
@ kMATERIAL_CANCEL
@ kMATERIAL_UNDO
@ kMATERIAL_RAD
ETGeoMaterialStates
@ kMAT_SOLID
@ kMAT_UNDEFINED
@ kMAT_GAS
@ kMAT_LIQUID
ETGeoMixtureWid
@ kMIX_CHK2
@ kMIX_NATOMS
@ kMIX_FRAC
@ kMIX_CHK1
@ kMIX_ELEM
@ kMIX_ADDELEM
virtual void SetDown(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.cxx:260
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:409
virtual Bool_t IsDown() const
Definition: TGButton.h:312
virtual Int_t GetSelected() const
Definition: TGComboBox.h:134
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
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
virtual TList * GetList() const
Definition: TGFrame.h:369
TGCompositeFrame(const TGCompositeFrame &)
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 Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:949
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void RemoveAll()
Remove all frames from composite frame.
Definition: TGFrame.cxx:1113
TGFrame * fFrame
Definition: TGLayout.h:119
virtual void SetSize(const TGDimension &s)
Definition: TGFrame.h:299
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:238
TGDimension GetSize() const
Definition: TGFrame.h:277
virtual Bool_t IsComposite() const
Definition: TGFrame.h:259
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGLabel.cxx:393
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:177
virtual void SetNumber(Double_t val)
TGNumberEntryField * GetNumberEntry() const
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
virtual void SetFormat(EStyle style, EAttribute attr=TGNumberFormat::kNEAAnyNumber)
virtual Double_t GetNumber() const
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
const char * GetText() const
Definition: TGTextEntry.h:134
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
Bool_t fInit
Definition: TGedFrame.h:53
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
Table of elements.
Definition: TGeoElement.h:370
TGeoElement * GetElement(Int_t z)
Definition: TGeoElement.h:410
Int_t GetNelements() const
Definition: TGeoElement.h:417
Base class for chemical elements.
Definition: TGeoElement.h:37
Double_t A() const
Definition: TGeoElement.h:76
Int_t Z() const
Definition: TGeoElement.h:73
Common base class for geombuilder editors.
Definition: TGeoGedFrame.h:13
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
TGeoTabManager * fTabMgr
Definition: TGeoGedFrame.h:17
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
Editors for materials.
void DoState(Int_t state)
Slot for material state.
TGTextEntry * fMaterialName
TGeoMaterialEditor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for material editor.
void DoTemperature()
Slot for material temperature.
void DoRadAbs()
Slot for radiation/absorption length.
void DoPressure()
Slot for material pressure.
virtual ~TGeoMaterialEditor()
Destructor.
TGeoMaterial * fMaterial
void DoZ()
Slot for charge.
TGNumberEntry * fMatDensity
TGNumberEntry * fMatAbsLen
TGNumberEntry * fMatTemperature
TGNumberEntry * fMatZ
virtual void ConnectSignals2Slots()
Connect signals to slots.
void DoModified()
Slot for signaling modifications.
TGCompositeFrame * f23
TGNumberEntry * fMatPressure
TGTextButton * fUndo
void DoA()
Slot for atomic mass.
void DoName()
Perform name change.
TGNumberEntry * fMatA
TGNumberEntry * fMatRadLen
void DoUndo()
Slot for cancelling current modifications.
TGTextButton * fApply
virtual void SetModel(TObject *obj)
Connect to the selected material.
void DoDensity()
Slot for density.
void DoApply()
Slot for applying modifications.
Base class describing materials.
Definition: TGeoMaterial.h:31
virtual Double_t GetIntLen() const
Definition: TGeoMaterial.h:110
virtual void SetDensity(Double_t density)
Definition: TGeoMaterial.h:129
virtual void SetZ(Double_t z)
Definition: TGeoMaterial.h:128
virtual Bool_t IsMixture() const
Definition: TGeoMaterial.h:124
void SetState(EGeoMaterialState state)
Definition: TGeoMaterial.h:137
EGeoMaterialState GetState() const
Definition: TGeoMaterial.h:116
Double_t GetTemperature() const
Definition: TGeoMaterial.h:114
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorption lengths.
Double_t GetPressure() const
Definition: TGeoMaterial.h:115
void SetPressure(Double_t pressure)
Definition: TGeoMaterial.h:136
virtual void SetA(Double_t a)
Definition: TGeoMaterial.h:127
virtual Double_t GetRadLen() const
Definition: TGeoMaterial.h:109
virtual Double_t GetA() const
Definition: TGeoMaterial.h:100
virtual Double_t GetDensity() const
Definition: TGeoMaterial.h:103
virtual Double_t GetZ() const
Definition: TGeoMaterial.h:101
void SetTemperature(Double_t temperature)
Definition: TGeoMaterial.h:135
Editors for mixtures.
void DoAddElem()
Slot for adding an element. No undo.
TGNumberEntry * fNENatoms
void DoNatoms()
Natoms changed.
TGTextButton * fBAddElem
void UpdateElements()
Update the list of elements in the TGCanvas.
TGCheckButton * fChkNatoms
virtual void SetModel(TObject *obj)
Connect to the selected mixture.
void DoUndo1()
Slot for undoing all changes.
void DoChkNatoms()
Check button state changed for natoms.
TGCompositeFrame * fComps
void DoApply1()
Slot for applying modifications.
TGNumberEntry * fNEFraction
TGCheckButton * fChkFraction
void DoChkFraction()
Check button state changed for fraction.
void DoFraction()
Fraction changed.
TGeoMixture * fMixture
virtual void ConnectSignals2Slots()
Connect signals to slots.
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.
void DoSelectElement(Int_t iel)
Slot for selecting an element.
Mixtures of elements.
Definition: TGeoMaterial.h:151
Int_t * GetNmixt() const
Definition: TGeoMaterial.h:192
virtual TGeoElement * GetElement(Int_t i=0) const
Retrieve the pointer to the element corresponding to component I.
Double_t * GetZmixt() const
Definition: TGeoMaterial.h:189
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
Double_t * GetWmixt() const
Definition: TGeoMaterial.h:191
virtual Int_t GetNelements() const
Definition: TGeoMaterial.h:188
Double_t * GetAmixt() const
Definition: TGeoMaterial.h:190
static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p)
Move frame fr at the end of the list of parent p.
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
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
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
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
TF1 * f1
Definition: legend1.C:11
static constexpr double s
auto * a
Definition: textangle.C:12