Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "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
33
48
50
52
53////////////////////////////////////////////////////////////////////////////////
54/// Constructor for material editor.
55
57 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
58{
59 fMaterial = nullptr;
60 fAi = fZi = 0;
61 fDensityi = 0.0;
62 fNamei = "";
65
66 // TextEntry for material name
67 MakeTitle("Name");
70 fMaterialName->SetToolTipText("Enter the material name");
73
75 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
93 // Combo box for material state
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
107 f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
111 nef->SetToolTipText("Enter material density in [g/cm3]");
112 fMatDensity->Associate(this);
113 f1->AddFrame(fMatDensity, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
114 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
115
116 // Number entry for temperature
118 f1->AddFrame(new TGLabel(f1, "Temperature"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
122 nef->SetToolTipText("Enter material temperature in [Kelvin]");
124 f1->AddFrame(fMatTemperature, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
125 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
126
127 // Number entry for pressure
129 f1->AddFrame(new TGLabel(f1, "Pressure"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
133 nef->SetToolTipText("Enter material pressure in [bar]");
134 fMatPressure->Associate(this);
135 f1->AddFrame(fMatPressure, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
136 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
137
138 // Number entry for radiation length
140 f1->AddFrame(new TGLabel(f1, "RadLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
144 nef->SetToolTipText("Computed radiation length");
145 fMatRadLen->Associate(this);
146 f1->AddFrame(fMatRadLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
147 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
148
149 // Number entry for absorption length
151 f1->AddFrame(new TGLabel(f1, "AbsLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
155 nef->SetToolTipText("Absorption length");
156 fMatAbsLen->Associate(this);
157 f1->AddFrame(fMatAbsLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
158 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
159
160 compxyz->Resize(150, 30);
161 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 2, 2));
162
163 // Buttons
165 fApply = new TGTextButton(f23, "Apply");
166 f23->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 1, 1));
167 fApply->Associate(this);
168 fUndo = new TGTextButton(f23, " Undo ");
169 f23->AddFrame(fUndo, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
170 fUndo->Associate(this);
171 AddFrame(f23, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
173}
174
175////////////////////////////////////////////////////////////////////////////////
176/// Destructor
177
179{
181 TIter next(GetList());
182 while ((el = (TGFrameElement *)next())) {
183 if (el->fFrame->IsComposite())
185 }
186 Cleanup();
187}
188
189////////////////////////////////////////////////////////////////////////////////
190/// Connect signals to slots.
191
193{
194 fApply->Connect("Clicked()", "TGeoMaterialEditor", this, "DoApply()");
195 fUndo->Connect("Clicked()", "TGeoMaterialEditor", this, "DoUndo()");
196 fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
197 fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
198 fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
199 fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
200 fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
201 fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
202 fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
203 fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
204 fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
205 fInit = kFALSE;
206}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Connect to the selected material.
210
241
242////////////////////////////////////////////////////////////////////////////////
243/// Perform name change.
244
249
250////////////////////////////////////////////////////////////////////////////////
251/// Slot for atomic mass.
252
254{
255 if (fMaterial->IsMixture()) {
257 return;
258 }
259 DoModified();
260}
261
262////////////////////////////////////////////////////////////////////////////////
263/// Slot for charge.
264
266{
267 if (fMaterial->IsMixture()) {
269 return;
270 }
271 Int_t z = (Int_t)fMatZ->GetNumber();
273 if (z >= table->GetNelements()) {
274 z = table->GetNelements() - 1;
275 fMatZ->SetNumber(z);
276 }
277 TGeoElement *elem = table->GetElement(z);
278 if (!elem)
279 return;
280 Double_t a = elem->A();
281 fMatA->SetNumber(a);
282 DoModified();
283}
284
285////////////////////////////////////////////////////////////////////////////////
286/// Slot for material state.
287
289{
290 DoModified();
291}
292
293////////////////////////////////////////////////////////////////////////////////
294/// Slot for material temperature.
295
300
301////////////////////////////////////////////////////////////////////////////////
302/// Slot for material pressure.
303
308
309////////////////////////////////////////////////////////////////////////////////
310/// Slot for density.
311/// fMatDensity->SetNumber(fDensityi);
312
317
318////////////////////////////////////////////////////////////////////////////////
319/// Slot for radiation/absorption length.
320
327
328////////////////////////////////////////////////////////////////////////////////
329/// Slot for applying modifications.
330
348
349////////////////////////////////////////////////////////////////////////////////
350/// Slot for cancelling current modifications.
351
373
374////////////////////////////////////////////////////////////////////////////////
375/// Slot for signaling modifications.
376
381
382/** \class TGeoMixtureEditor
383\ingroup Geometry_builder
384
385Editors for mixtures.
386
387*/
388
389
390////////////////////////////////////////////////////////////////////////////////
391/// Constructor for mixture editor.
392
394 : TGeoMaterialEditor(p, width, height, options | kVerticalFrame, back)
395{
396 fMixture = nullptr;
397 TGCompositeFrame *compxyz = nullptr, *f1 = nullptr;
399 MakeTitle("Mixture settings");
400 fNelem = new TGLabel(this, "Number of elements: 0");
401 AddFrame(fNelem, new TGLayoutHints(kLHintsLeft, 6, 2, 2, 2));
403 // Combo box for selecting elements
407 if (table) {
409 for (Int_t i = 0; i < table->GetNelements(); i++) {
410 element = table->GetElement(i);
411 if (element)
412 fMixElem->AddEntry(element->GetTitle(), i);
413 }
414 }
415 fMixElem->Select(0);
417 f1->AddFrame(fMixElem, new TGLayoutHints(kLHintsLeft, 2, 2, 1, 1));
419 fAelem = new TGLabel(comp1, "A = 0");
420 comp1->AddFrame(fAelem, new TGLayoutHints(kLHintsRight, 2, 2, 2, 0));
421 fZelem = new TGLabel(comp1, "Z = 0");
422 comp1->AddFrame(fZelem, new TGLayoutHints(kLHintsRight, 2, 2, 2, 0));
423 f1->AddFrame(comp1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 2, 2, 0, 0));
424 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 0, 0));
425
426 // Fraction by weight
428 fChkFraction = new TGCheckButton(f1, "% weight");
430 f1->AddFrame(fChkFraction, new TGLayoutHints(kLHintsLeft, 2, 2, 6, 1));
435 nef->SetToolTipText("Enter fraction by weight of this element");
437 fNEFraction->Associate(this);
438 f1->AddFrame(fNEFraction, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
439 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
440
441 // Fraction by number of atoms
443 fChkNatoms = new TGCheckButton(f1, "N. atoms");
445 f1->AddFrame(fChkNatoms, new TGLayoutHints(kLHintsLeft, 2, 2, 6, 1));
446 fNENatoms = new TGNumberEntry(f1, 0., 5, kMIX_NATOMS);
450 nef->SetToolTipText("Enter number of atoms for this element");
452 fNENatoms->Associate(this);
453 f1->AddFrame(fNENatoms, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
454 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
455
456 // Button for adding the element
457 fBAddElem = new TGTextButton(compxyz, "Add component");
458 fBAddElem->Associate(this);
459 compxyz->AddFrame(fBAddElem, new TGLayoutHints(kLHintsRight, 2, 2, 2, 0));
460
461 compxyz->Resize(150, 30);
462 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 1, 1));
463
464 // List view with all components
465 fComps = new TGCompositeFrame(this, 150, 100, kVerticalFrame | kSunkenFrame);
467
469}
470
471////////////////////////////////////////////////////////////////////////////////
472/// Connect signals to slots.
473
475{
476 fApply->Connect("Clicked()", "TGeoMixtureEditor", this, "DoApply1()");
477 fUndo->Connect("Clicked()", "TGeoMixtureEditor", this, "DoUndo1()");
478 fChkFraction->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkFraction()");
479 fChkNatoms->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkNatoms()");
480 fNEFraction->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoFraction()");
481 fNENatoms->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoNatoms()");
482 fMixElem->Connect("Selected(Int_t)", "TGeoMixtureEditor", this, "DoSelectElement(Int_t)");
483 fBAddElem->Connect("Clicked()", "TGeoMixtureEditor", this, "DoAddElem()");
484 fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
485 fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
486 fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
487 fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
488 fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
489 fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
490 fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
491 fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
492 fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
493 fInit = kFALSE;
494}
495
496////////////////////////////////////////////////////////////////////////////////
497/// Connect to the selected mixture.
498
500{
501 if (obj == nullptr || !(obj->InheritsFrom(TGeoMixture::Class()))) {
503 return;
504 }
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Check button state changed for fraction.
512
523
524////////////////////////////////////////////////////////////////////////////////
525/// Check button state changed for natoms.
526
537
538////////////////////////////////////////////////////////////////////////////////
539/// Fraction changed.
540
548
549////////////////////////////////////////////////////////////////////////////////
550/// Natoms changed.
551
559
560////////////////////////////////////////////////////////////////////////////////
561/// Slot for selecting an element.
562
564{
566 if (!el) {
567 Error("DoSelectElement", "No element at index %d", ielem);
568 return;
569 }
570 TString z = TString::Format("Z=%d", el->Z());
571 TString a = TString::Format("A=%d", (Int_t)el->A());
572 fAelem->SetText(a.Data());
573 fZelem->SetText(z.Data());
574}
575
576////////////////////////////////////////////////////////////////////////////////
577/// Slot for adding an element. No undo.
578
580{
583 if (!byfraction && natoms <= 0)
584 return;
586 if (byfraction && frac <= 0)
587 return;
589 if (!el)
590 return;
591 if (byfraction)
592 fMixture->AddElement(el, frac);
593 else
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
637
638////////////////////////////////////////////////////////////////////////////////
639/// Update the list of elements in the TGCanvas.
640
642{
643 fComps->RemoveAll();
645 for (Int_t i = 0; i < nelem; i++) {
646 TString s;
648 if (byfrac)
649 s.TString::Format("%d-%s-%d: Wmass = %g %%", (Int_t)fMixture->GetZmixt()[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}
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
@ kFitWidth
Definition GuiTypes.h:386
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kOwnBackground
Definition GuiTypes.h:391
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define a(i)
Definition RSha256.hxx:99
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsExpandX
Definition TGLayout.h:30
@ kTextLeft
Definition TGWidget.h:23
@ kTextCenterY
Definition TGWidget.h:28
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char name[80]
Definition TGX11.cxx:110
@ kMATERIAL_NAME
R__EXTERN TGeoManager * gGeoManager
@ 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_UNDEFINED
@ kMAT_LIQUID
@ kMIX_NATOMS
@ kMIX_ADDELEM
virtual void SetDown(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition TGButton.cxx:304
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition TGButton.cxx:453
Selects different options.
Definition TGButton.h:264
Bool_t IsDown() const override
Definition TGButton.h:311
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual Int_t GetSelected() const
Definition TGComboBox.h:114
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
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...
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual TList * GetList() const
Definition TGFrame.h:312
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:959
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual void RemoveAll()
Remove all frames from composite frame.
Definition TGFrame.cxx:1123
virtual void SetSize(const TGDimension &s)
Definition TGFrame.h:254
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:193
TGDimension GetSize() const
Definition TGFrame.h:232
This class handles GUI labels.
Definition TGLabel.h:24
void SetTextJustify(Int_t tmode)
Set text justification.
Definition TGLabel.cxx:395
virtual void SetText(TGString *newText)
Set new text in label.
Definition TGLabel.cxx:179
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
void Associate(const TGWindow *w) override
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 SetNumber(Double_t val, Bool_t emit=kTRUE)
@ kNEANonNegative
Non-negative number.
@ kNESRealThree
Fixed fraction real, three digit.
@ kNESInteger
Style of number entry field.
@ kNESRealTwo
Fixed fraction real, two digit.
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
const char * GetText() const
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:72
ROOT GUI Window base class.
Definition TGWindow.h:23
Bool_t fInit
init flag for setting signals/slots
Definition TGedFrame.h:47
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition TGedFrame.cxx:94
table of elements
TGeoElement * GetElement(Int_t z)
Int_t GetNelements() const
Base class for chemical elements.
Definition TGeoElement.h:31
Common base class for geombuilder editors.
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
TGeoTabManager * fTabMgr
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
Editors for materials.
void DoState(Int_t state)
Slot for material state.
TGTextEntry * fMaterialName
void DoTemperature()
Slot for material temperature.
TGeoMaterialEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for material editor.
void DoRadAbs()
Slot for radiation/absorption length.
void DoPressure()
Slot for material pressure.
TGeoMaterial * fMaterial
void DoZ()
Slot for charge.
TGNumberEntry * fMatDensity
~TGeoMaterialEditor() override
Destructor.
TGNumberEntry * fMatAbsLen
TGNumberEntry * fMatTemperature
TGNumberEntry * fMatZ
virtual void ConnectSignals2Slots()
Connect signals to slots.
void DoModified()
Slot for signaling modifications.
TGCompositeFrame * f23
TGNumberEntry * fMatPressure
void DoA()
Slot for atomic mass.
void DoName()
Perform name change.
TGNumberEntry * fMatA
TGNumberEntry * fMatRadLen
void DoUndo()
Slot for cancelling current modifications.
void SetModel(TObject *obj) override
Connect to the selected material.
void DoDensity()
Slot for density.
void DoApply()
Slot for applying modifications.
Base class describing materials.
virtual Double_t GetIntLen() const
virtual void SetDensity(Double_t density)
virtual void SetZ(Double_t z)
virtual Bool_t IsMixture() const
void SetState(EGeoMaterialState state)
EGeoMaterialState GetState() const
Double_t GetTemperature() const
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorption lengths.
Double_t GetPressure() const
void SetPressure(Double_t pressure)
static TClass * Class()
virtual void SetA(Double_t a)
virtual Double_t GetRadLen() const
virtual Double_t GetA() const
virtual Double_t GetDensity() const
virtual Double_t GetZ() const
void SetTemperature(Double_t temperature)
void DoAddElem()
Slot for adding an element. No undo.
TGNumberEntry * fNENatoms
void DoNatoms()
Natoms changed.
TGTextButton * fBAddElem
void ConnectSignals2Slots() override
Connect signals to slots.
void UpdateElements()
Update the list of elements in the TGCanvas.
TGCheckButton * fChkNatoms
void DoUndo1()
Slot for undoing all changes.
TGeoMixtureEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for mixture editor.
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.
void DoSelectElement(Int_t iel)
Slot for selecting an element.
void SetModel(TObject *obj) override
Connect to the selected mixture.
Mixtures of elements.
Int_t * GetNmixt() const
Double_t * GetZmixt() const
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
Int_t GetNelements() const override
Double_t * GetWmixt() const
static TClass * Class()
Double_t * GetAmixt() const
TGeoElement * GetElement(Int_t i=0) const override
Retrieve the pointer to the element corresponding to component I.
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.
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
Mother of all ROOT objects.
Definition TObject.h:41
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:543
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:865
Basic string class.
Definition TString.h:138
const char * Data() const
Definition TString.h:384
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:2384
TF1 * f1
Definition legend1.C:11