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
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");
70
71 TGTextEntry *nef;
72 MakeTitle("Material properties");
75 f1->AddFrame(new TGLabel(f1, "A"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
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));
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]");
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));
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));
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()))) {
220 return;
221 }
222 fMaterial = (TGeoMaterial*)obj;
223 fAi = fMaterial->GetA();
224 fZi = (Int_t)fMaterial->GetZ();
228 fPresi = fMaterial->GetPressure()/6.2415e+8;
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{
370 fMaterial->SetPressure(fPresi*6.2415e+8);
375}
376
377////////////////////////////////////////////////////////////////////////////////
378/// Slot for signaling modifications.
379
381{
383}
384
385/** \class TGeoMixtureEditor
386\ingroup Geometry_builder
387
388Editors 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");
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");
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()))) {
510 return;
511 }
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;
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(),
651 else
652 s.TString::Format("%d-%s-%d: Natoms = %d", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
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
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:197
@ 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:37
Double_t A() const
Definition TGeoElement.h:76
Int_t Z() const
Definition TGeoElement.h:73
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.
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
void DoA()
Slot for atomic mass.
void DoName()
Perform name change.
TGNumberEntry * fMatA
TGNumberEntry * fMatRadLen
void DoUndo()
Slot for cancelling current modifications.
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.
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 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.
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.
virtual void ConnectSignals2Slots()
Connect signals to slots.
void DoSelectElement(Int_t iel)
Slot for selecting an element.
Mixtures of elements.
Int_t * GetNmixt() const
virtual TGeoElement * GetElement(Int_t i=0) const
Retrieve the pointer to the element corresponding to component I.
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
Double_t * GetWmixt() const
virtual Int_t GetNelements() const
static TClass * Class()
Double_t * GetAmixt() const
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