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
34
48};
49
51
53
54////////////////////////////////////////////////////////////////////////////////
55/// Constructor for material editor.
56
58 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
59{
60 fMaterial = 0;
61 fAi = fZi = 0;
62 fDensityi = 0.0;
63 fNamei = "";
66
67 // TextEntry for material name
68 MakeTitle("Name");
71 fMaterialName->SetToolTipText("Enter the material name");
74
75 TGTextEntry *nef;
76 MakeTitle("Material properties");
78 f1->AddFrame(new TGLabel(f1, "A"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
81 nef->SetToolTipText("Enter the atomic mass");
82 fMatA->Associate(this);
83 f1->AddFrame(fMatA, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
84 f1->AddFrame(new TGLabel(f1, "Z"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
87 nef->SetToolTipText("Enter the atomic charge");
88 fMatZ->Associate(this);
89 f1->AddFrame(fMatZ, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
90 f1->Resize(150, 30);
91 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
92
94 // Combo box for material state
96 f1->AddFrame(new TGLabel(f1, "State"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
103 f1->AddFrame(fMatState, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
104 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
105
106 // Number entry for density
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
119 f1->AddFrame(new TGLabel(f1, "Temperature"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
123 nef->SetToolTipText("Enter material temperature in [Kelvin]");
125 f1->AddFrame(fMatTemperature, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
126 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
127
128 // Number entry for pressure
130 f1->AddFrame(new TGLabel(f1, "Pressure"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
134 nef->SetToolTipText("Enter material pressure in [bar]");
135 fMatPressure->Associate(this);
136 f1->AddFrame(fMatPressure, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
137 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
138
139 // Number entry for radiation length
141 f1->AddFrame(new TGLabel(f1, "RadLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
145 nef->SetToolTipText("Computed radiation length");
146 fMatRadLen->Associate(this);
147 f1->AddFrame(fMatRadLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
148 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
149
150 // Number entry for absorption length
152 f1->AddFrame(new TGLabel(f1, "AbsLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
156 nef->SetToolTipText("Absorption length");
157 fMatAbsLen->Associate(this);
158 f1->AddFrame(fMatAbsLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
159 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
160
161 compxyz->Resize(150, 30);
162 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 2, 2));
163
164 // Buttons
166 fApply = new TGTextButton(f23, "Apply");
167 f23->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 1, 1));
168 fApply->Associate(this);
169 fUndo = new TGTextButton(f23, " Undo ");
170 f23->AddFrame(fUndo, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
171 fUndo->Associate(this);
172 AddFrame(f23, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
174}
175
176////////////////////////////////////////////////////////////////////////////////
177/// Destructor
178
180{
181 TGFrameElement *el;
182 TIter next(GetList());
183 while ((el = (TGFrameElement *)next())) {
184 if (el->fFrame->IsComposite())
186 }
187 Cleanup();
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Connect signals to slots.
192
194{
195 fApply->Connect("Clicked()", "TGeoMaterialEditor", this, "DoApply()");
196 fUndo->Connect("Clicked()", "TGeoMaterialEditor", this, "DoUndo()");
197 fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
198 fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
199 fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
200 fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
201 fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
202 fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
203 fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
204 fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
205 fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
206 fInit = kFALSE;
207}
208
209////////////////////////////////////////////////////////////////////////////////
210/// Connect to the selected material.
211
213{
214 if (obj == 0 || !(obj->InheritsFrom(TGeoMaterial::Class()))) {
216 return;
217 }
218 fMaterial = (TGeoMaterial *)obj;
219 fAi = fMaterial->GetA();
220 fZi = (Int_t)fMaterial->GetZ();
224 fPresi = fMaterial->GetPressure() / 6.2415e+8;
237
238 if (fInit)
240 SetActive();
241}
242
243////////////////////////////////////////////////////////////////////////////////
244/// Perform name change.
245
247{
248 DoModified();
249}
250
251////////////////////////////////////////////////////////////////////////////////
252/// Slot for atomic mass.
253
255{
256 if (fMaterial->IsMixture()) {
258 return;
259 }
260 DoModified();
261}
262
263////////////////////////////////////////////////////////////////////////////////
264/// Slot for charge.
265
267{
268 if (fMaterial->IsMixture()) {
270 return;
271 }
272 Int_t z = (Int_t)fMatZ->GetNumber();
274 if (z >= table->GetNelements()) {
275 z = table->GetNelements() - 1;
276 fMatZ->SetNumber(z);
277 }
278 TGeoElement *elem = table->GetElement(z);
279 if (!elem)
280 return;
281 Double_t a = elem->A();
282 fMatA->SetNumber(a);
283 DoModified();
284}
285
286////////////////////////////////////////////////////////////////////////////////
287/// Slot for material state.
288
290{
291 DoModified();
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// Slot for material temperature.
296
298{
299 DoModified();
300}
301
302////////////////////////////////////////////////////////////////////////////////
303/// Slot for material pressure.
304
306{
307 DoModified();
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Slot for density.
312/// fMatDensity->SetNumber(fDensityi);
313
315{
316 DoModified();
317}
318
319////////////////////////////////////////////////////////////////////////////////
320/// Slot for radiation/absorption length.
321
323{
326 DoModified();
327}
328
329////////////////////////////////////////////////////////////////////////////////
330/// Slot for applying modifications.
331
333{
334 const char *name = fMaterialName->GetText();
336
346 fUndo->SetEnabled();
348}
349
350////////////////////////////////////////////////////////////////////////////////
351/// Slot for cancelling current modifications.
352
354{
368 fMaterial->SetPressure(fPresi * 6.2415e+8);
373}
374
375////////////////////////////////////////////////////////////////////////////////
376/// Slot for signaling modifications.
377
379{
381}
382
383/** \class TGeoMixtureEditor
384\ingroup Geometry_builder
385
386Editors for mixtures.
387
388*/
389
391
392////////////////////////////////////////////////////////////////////////////////
393/// Constructor for mixture editor.
394
396 : TGeoMaterialEditor(p, width, height, options | kVerticalFrame, back)
397{
398 fMixture = 0;
399 TGCompositeFrame *compxyz = 0, *f1 = 0;
400 TGTextEntry *nef;
401 MakeTitle("Mixture settings");
402 fNelem = new TGLabel(this, "Number of elements: 0");
403 AddFrame(fNelem, new TGLayoutHints(kLHintsLeft, 6, 2, 2, 2));
404 compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame | kDoubleBorder);
405 // Combo box for selecting elements
409 if (table) {
410 TGeoElement *element;
411 for (Int_t i = 0; i < table->GetNelements(); i++) {
412 element = table->GetElement(i);
413 if (element)
414 fMixElem->AddEntry(element->GetTitle(), i);
415 }
416 }
417 fMixElem->Select(0);
419 f1->AddFrame(fMixElem, new TGLayoutHints(kLHintsLeft, 2, 2, 1, 1));
420 TGCompositeFrame *comp1 = new TGCompositeFrame(f1, 118, 30, kVerticalFrame);
421 fAelem = new TGLabel(comp1, "A = 0");
422 comp1->AddFrame(fAelem, new TGLayoutHints(kLHintsRight, 2, 2, 2, 0));
423 fZelem = new TGLabel(comp1, "Z = 0");
424 comp1->AddFrame(fZelem, new TGLayoutHints(kLHintsRight, 2, 2, 2, 0));
425 f1->AddFrame(comp1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 2, 2, 0, 0));
426 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 0, 0));
427
428 // Fraction by weight
430 fChkFraction = new TGCheckButton(f1, "% weight");
432 f1->AddFrame(fChkFraction, new TGLayoutHints(kLHintsLeft, 2, 2, 6, 1));
437 nef->SetToolTipText("Enter fraction by weight of this element");
439 fNEFraction->Associate(this);
440 f1->AddFrame(fNEFraction, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
441 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
442
443 // Fraction by number of atoms
445 fChkNatoms = new TGCheckButton(f1, "N. atoms");
447 f1->AddFrame(fChkNatoms, new TGLayoutHints(kLHintsLeft, 2, 2, 6, 1));
448 fNENatoms = new TGNumberEntry(f1, 0., 5, kMIX_NATOMS);
452 nef->SetToolTipText("Enter number of atoms for this element");
454 fNENatoms->Associate(this);
455 f1->AddFrame(fNENatoms, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
456 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 1, 1));
457
458 // Button for adding the element
459 fBAddElem = new TGTextButton(compxyz, "Add component");
460 fBAddElem->Associate(this);
461 compxyz->AddFrame(fBAddElem, new TGLayoutHints(kLHintsRight, 2, 2, 2, 0));
462
463 compxyz->Resize(150, 30);
464 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 1, 1));
465
466 // List view with all components
467 fComps = new TGCompositeFrame(this, 150, 100, kVerticalFrame | kSunkenFrame);
469
471}
472
473////////////////////////////////////////////////////////////////////////////////
474/// Connect signals to slots.
475
477{
478 fApply->Connect("Clicked()", "TGeoMixtureEditor", this, "DoApply1()");
479 fUndo->Connect("Clicked()", "TGeoMixtureEditor", this, "DoUndo1()");
480 fChkFraction->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkFraction()");
481 fChkNatoms->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkNatoms()");
482 fNEFraction->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoFraction()");
483 fNENatoms->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoNatoms()");
484 fMixElem->Connect("Selected(Int_t)", "TGeoMixtureEditor", this, "DoSelectElement(Int_t)");
485 fBAddElem->Connect("Clicked()", "TGeoMixtureEditor", this, "DoAddElem()");
486 fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
487 fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
488 fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
489 fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
490 fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
491 fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
492 fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
493 fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
494 fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
495 fInit = kFALSE;
496}
497
498////////////////////////////////////////////////////////////////////////////////
499/// Connect to the selected mixture.
500
502{
503 if (obj == 0 || !(obj->InheritsFrom(TGeoMixture::Class()))) {
505 return;
506 }
510}
511
512////////////////////////////////////////////////////////////////////////////////
513/// Check button state changed for fraction.
514
516{
517 if (fMixture->GetNelements() && fMixture->GetNmixt()) {
520 return;
521 }
522 Bool_t isDown = fChkFraction->IsDown();
523 fChkNatoms->SetDown(!isDown);
524}
525
526////////////////////////////////////////////////////////////////////////////////
527/// Check button state changed for natoms.
528
530{
531 if (fMixture->GetNelements() && !fMixture->GetNmixt()) {
534 return;
535 }
536 Bool_t isDown = fChkNatoms->IsDown();
537 fChkFraction->SetDown(!isDown);
538}
539
540////////////////////////////////////////////////////////////////////////////////
541/// Fraction changed.
542
544{
546 return;
549}
550
551////////////////////////////////////////////////////////////////////////////////
552/// Natoms changed.
553
555{
557 return;
560}
561
562////////////////////////////////////////////////////////////////////////////////
563/// Slot for selecting an element.
564
566{
568 if (!el) {
569 Error("DoSelectElement", "No element at index %d", ielem);
570 return;
571 }
572 TString z = TString::Format("Z=%d", el->Z());
573 TString a = TString::Format("A=%d", (Int_t)el->A());
574 fAelem->SetText(a.Data());
575 fZelem->SetText(z.Data());
576}
577
578////////////////////////////////////////////////////////////////////////////////
579/// Slot for adding an element. No undo.
580
582{
583 Bool_t byfraction = fChkFraction->IsDown();
584 Int_t natoms = (Int_t)fNENatoms->GetNumber();
585 if (!byfraction && natoms <= 0)
586 return;
588 if (byfraction && frac <= 0)
589 return;
591 if (!el)
592 return;
593 if (byfraction)
594 fMixture->AddElement(el, frac);
595 else
596 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],
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}
@ 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
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
@ 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:310
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition TGButton.cxx:459
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:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual TList * GetList() const
Definition TGFrame.h:310
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
virtual void RemoveAll()
Remove all frames from composite frame.
Definition TGFrame.cxx:1131
TGFrame * fFrame
Definition TGLayout.h:112
virtual void SetSize(const TGDimension &s)
Definition TGFrame.h:252
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:191
TGDimension GetSize() const
Definition TGFrame.h:230
virtual Bool_t IsComposite() const
Definition TGFrame.h:212
This class handles GUI labels.
Definition TGLabel.h:24
void SetTextJustify(Int_t tmode)
Set text justification.
Definition TGLabel.cxx:396
virtual void SetText(TGString *newText)
Set new text in label.
Definition TGLabel.cxx:180
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:95
Table of elements.
TGeoElement * GetElement(Int_t z)
Int_t GetNelements() const
Base class for chemical elements.
Definition TGeoElement.h:36
Double_t A() const
Definition TGeoElement.h:71
Int_t Z() const
Definition TGeoElement.h:68
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)
Editors for mixtures.
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:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
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:525
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:869
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:380
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:2356
TF1 * f1
Definition legend1.C:11