Logo ROOT  
Reference Guide
TGeoMaterialEditor.cxx
Go to the documentation of this file.
1// @(#):$Id$
2// Author: M.Gheata
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class TGeoMaterialEditor
13\ingroup Geometry_builder
14
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 "TView.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#include "TGListView.h"
33
35
40};
41
44};
45
48};
49
50////////////////////////////////////////////////////////////////////////////////
51/// Constructor for material editor.
52
54 Int_t height, UInt_t options, Pixel_t back)
55 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
56{
57 fMaterial = 0;
58 fAi = fZi = 0;
59 fDensityi = 0.0;
60 fNamei = "";
63
64 // TextEntry for material name
65 MakeTitle("Name");
68 fMaterialName->SetToolTipText("Enter the material name");
71
72 TGTextEntry *nef;
73 MakeTitle("Material properties");
76 f1->AddFrame(new TGLabel(f1, "A"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
79 nef->SetToolTipText("Enter the atomic mass");
80 fMatA->Associate(this);
81 f1->AddFrame(fMatA, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
82 f1->AddFrame(new TGLabel(f1, "Z"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
85 nef->SetToolTipText("Enter the atomic charge");
86 fMatZ->Associate(this);
87 f1->AddFrame(fMatZ, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
88 f1->Resize(150,30);
89 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
90
91
93 // Combo box for material state
94 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
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
107 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
109 f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
113 nef->SetToolTipText("Enter material density in [g/cm3]");
114 fMatDensity->Associate(this);
115 f1->AddFrame(fMatDensity, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
116 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
117
118 // Number entry for temperature
119 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
121 f1->AddFrame(new TGLabel(f1, "Temperature"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
125 nef->SetToolTipText("Enter material temperature in [Kelvin]");
127 f1->AddFrame(fMatTemperature, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
128 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
129
130 // Number entry for pressure
131 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
133 f1->AddFrame(new TGLabel(f1, "Pressure"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
137 nef->SetToolTipText("Enter material pressure in [bar]");
138 fMatPressure->Associate(this);
139 f1->AddFrame(fMatPressure, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
140 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
141
142 // Number entry for radiation length
143 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
145 f1->AddFrame(new TGLabel(f1, "RadLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
149 nef->SetToolTipText("Computed radiation length");
150 fMatRadLen->Associate(this);
151 f1->AddFrame(fMatRadLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
152 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
153
154 // Number entry for absorption length
155 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
157 f1->AddFrame(new TGLabel(f1, "AbsLen"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
161 nef->SetToolTipText("Absorption length");
162 fMatAbsLen->Associate(this);
163 f1->AddFrame(fMatAbsLen, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
164 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
165
166 compxyz->Resize(150,30);
167 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 2, 2));
168
169 // Buttons
171 fApply = new TGTextButton(f23, "Apply");
172 f23->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 1, 1));
173 fApply->Associate(this);
174 fUndo = new TGTextButton(f23, " Undo ");
175 f23->AddFrame(fUndo, new TGLayoutHints(kLHintsRight , 2, 2, 1, 1));
176 fUndo->Associate(this);
177 AddFrame(f23, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
179}
180
181////////////////////////////////////////////////////////////////////////////////
182/// Destructor
183
185{
186 TGFrameElement *el;
187 TIter next(GetList());
188 while ((el = (TGFrameElement *)next())) {
189 if (el->fFrame->IsComposite())
191 }
192 Cleanup();
193}
194
195////////////////////////////////////////////////////////////////////////////////
196/// Connect signals to slots.
197
199{
200 fApply->Connect("Clicked()", "TGeoMaterialEditor", this, "DoApply()");
201 fUndo->Connect("Clicked()", "TGeoMaterialEditor", this, "DoUndo()");
202 fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
203 fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
204 fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
205 fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
206 fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
207 fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
208 fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
209 fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
210 fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
211 fInit = kFALSE;
212}
213
214////////////////////////////////////////////////////////////////////////////////
215/// Connect to the selected material.
216
218{
219 if (obj == 0 || !(obj->InheritsFrom(TGeoMaterial::Class()))) {
221 return;
222 }
223 fMaterial = (TGeoMaterial*)obj;
224 fAi = fMaterial->GetA();
225 fZi = (Int_t)fMaterial->GetZ();
229 fPresi = fMaterial->GetPressure()/6.2415e+8;
242
244 SetActive();
245}
246
247////////////////////////////////////////////////////////////////////////////////
248/// Perform name change.
249
251{
252 DoModified();
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Slot for atomic mass.
257
259{
260 if (fMaterial->IsMixture()) {
262 return;
263 }
264 DoModified();
265}
266
267////////////////////////////////////////////////////////////////////////////////
268/// Slot for charge.
269
271{
272 if (fMaterial->IsMixture()) {
274 return;
275 }
276 Int_t z = (Int_t)fMatZ->GetNumber();
278 if (z >= table->GetNelements()) {
279 z = table->GetNelements()-1;
280 fMatZ->SetNumber(z);
281 }
282 TGeoElement *elem = table->GetElement(z);
283 if (!elem) return;
284 Double_t a = elem->A();
285 fMatA->SetNumber(a);
286 DoModified();
287}
288
289////////////////////////////////////////////////////////////////////////////////
290/// Slot for material state.
291
293{
294 DoModified();
295}
296
297////////////////////////////////////////////////////////////////////////////////
298/// Slot for material temperature.
299
301{
302 DoModified();
303}
304
305////////////////////////////////////////////////////////////////////////////////
306/// Slot for material pressure.
307
309{
310 DoModified();
311}
312
313////////////////////////////////////////////////////////////////////////////////
314/// Slot for density.
315/// fMatDensity->SetNumber(fDensityi);
316
318{
319 DoModified();
320}
321
322////////////////////////////////////////////////////////////////////////////////
323/// Slot for radiation/absorption length.
324
326{
329 DoModified();
330}
331
332////////////////////////////////////////////////////////////////////////////////
333/// Slot for applying modifications.
334
336{
337 const char *name = fMaterialName->GetText();
339
349 fUndo->SetEnabled();
351}
352
353////////////////////////////////////////////////////////////////////////////////
354/// Slot for cancelling current modifications.
355
357{
371 fMaterial->SetPressure(fPresi*6.2415e+8);
376}
377
378////////////////////////////////////////////////////////////////////////////////
379/// Slot for signaling modifications.
380
382{
384}
385
386/** \class TGeoMixtureEditor
387\ingroup Geometry_builder
388
389Editors for mixtures.
390
391*/
392
394
395////////////////////////////////////////////////////////////////////////////////
396/// Constructor for mixture editor.
397
399 Int_t height, UInt_t options, Pixel_t back)
400 : TGeoMaterialEditor(p, width, height, options | kVerticalFrame, back)
401{
402 fMixture = 0;
403 TGCompositeFrame *compxyz=0, *f1=0;
404 TGTextEntry *nef;
405 MakeTitle("Mixture settings");
406 fNelem = new TGLabel(this, "Number of elements: 0");
407 AddFrame(fNelem, new TGLayoutHints(kLHintsLeft , 6, 2, 2, 2));
408 compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame | kDoubleBorder);
409 // Combo box for selecting elements
410 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
414 if (table) {
415 TGeoElement *element;
416 for (Int_t i=0; i<table->GetNelements(); i++) {
417 element = table->GetElement(i);
418 if (element) fMixElem->AddEntry(element->GetTitle(),i);
419 }
420 }
421 fMixElem->Select(0);
423 f1->AddFrame(fMixElem, new TGLayoutHints(kLHintsLeft , 2, 2, 1, 1));
424 TGCompositeFrame *comp1 = new TGCompositeFrame(f1, 118, 30, kVerticalFrame);
425 fAelem = new TGLabel(comp1, "A = 0");
426 comp1->AddFrame(fAelem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
427 fZelem = new TGLabel(comp1, "Z = 0");
428 comp1->AddFrame(fZelem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
429 f1->AddFrame(comp1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX| kLHintsExpandY , 2, 2, 0, 0));
430 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 0, 0));
431
432 // Fraction by weight
433 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
435 fChkFraction = new TGCheckButton(f1, "% weight");
437 f1->AddFrame(fChkFraction, new TGLayoutHints(kLHintsLeft , 2, 2, 6, 1));
442 nef->SetToolTipText("Enter fraction by weight of this element");
444 fNEFraction->Associate(this);
445 f1->AddFrame(fNEFraction, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
446 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
447
448 // Fraction by number of atoms
449 f1 = new TGCompositeFrame(compxyz, 118, 10, kHorizontalFrame |
451 fChkNatoms = new TGCheckButton(f1, "N. atoms");
453 f1->AddFrame(fChkNatoms, new TGLayoutHints(kLHintsLeft, 2, 2, 6, 1));
454 fNENatoms = new TGNumberEntry(f1, 0., 5, kMIX_NATOMS);
458 nef->SetToolTipText("Enter number of atoms for this element");
460 fNENatoms->Associate(this);
461 f1->AddFrame(fNENatoms, new TGLayoutHints(kLHintsRight, 2, 2, 1, 1));
462 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 1, 1));
463
464 // Button for adding the element
465 fBAddElem = new TGTextButton(compxyz, "Add component");
466 fBAddElem->Associate(this);
467 compxyz->AddFrame(fBAddElem, new TGLayoutHints(kLHintsRight , 2, 2, 2, 0));
468
469 compxyz->Resize(150,30);
470 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 0, 0, 1, 1));
471
472 // List view with all components
473 fComps = new TGCompositeFrame(this, 150, 100, kVerticalFrame | kSunkenFrame);
475
477}
478
479////////////////////////////////////////////////////////////////////////////////
480/// Connect signals to slots.
481
483{
484 fApply->Connect("Clicked()", "TGeoMixtureEditor", this, "DoApply1()");
485 fUndo->Connect("Clicked()", "TGeoMixtureEditor", this, "DoUndo1()");
486 fChkFraction->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkFraction()");
487 fChkNatoms->Connect("Clicked()", "TGeoMixtureEditor", this, "DoChkNatoms()");
488 fNEFraction->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoFraction()");
489 fNENatoms->Connect("ValueSet(Long_t)", "TGeoMixtureEditor", this, "DoNatoms()");
490 fMixElem->Connect("Selected(Int_t)", "TGeoMixtureEditor", this, "DoSelectElement(Int_t)");
491 fBAddElem->Connect("Clicked()", "TGeoMixtureEditor", this, "DoAddElem()");
492 fMaterialName->Connect("TextChanged(const char *)", "TGeoMaterialEditor", this, "DoName()");
493 fMatA->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoA()");
494 fMatZ->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoZ()");
495 fMatState->Connect("Selected(Int_t)", "TGeoMaterialEditor", this, "DoState(Int_t)");
496 fMatDensity->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoDensity()");
497 fMatTemperature->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoTemperature()");
498 fMatPressure->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoPressure()");
499 fMatRadLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
500 fMatAbsLen->Connect("ValueSet(Long_t)", "TGeoMaterialEditor", this, "DoRadAbs()");
501 fInit = kFALSE;
502}
503
504////////////////////////////////////////////////////////////////////////////////
505/// Connect to the selected mixture.
506
508{
509 if (obj == 0 || !(obj->InheritsFrom(TGeoMixture::Class()))) {
511 return;
512 }
516}
517
518////////////////////////////////////////////////////////////////////////////////
519/// Check button state changed for fraction.
520
522{
523 if (fMixture->GetNelements() && fMixture->GetNmixt()) {
526 return;
527 }
528 Bool_t isDown = fChkFraction->IsDown();
529 fChkNatoms->SetDown(!isDown);
530}
531
532////////////////////////////////////////////////////////////////////////////////
533/// Check button state changed for natoms.
534
536{
537 if (fMixture->GetNelements() && !fMixture->GetNmixt()) {
540 return;
541 }
542 Bool_t isDown = fChkNatoms->IsDown();
543 fChkFraction->SetDown(!isDown);
544}
545
546////////////////////////////////////////////////////////////////////////////////
547/// Fraction changed.
548
550{
551 if (fMixture->GetNelements() && fMixture->GetNmixt()) return;
554}
555
556////////////////////////////////////////////////////////////////////////////////
557/// Natoms changed.
558
560{
561 if (fMixture->GetNelements() && !fMixture->GetNmixt()) return;
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Slot for selecting an element.
568
570{
572 if (!el) {
573 Error("DoSelectElement", "No element at index %d", ielem);
574 return;
575 }
576 TString z = TString::Format("Z=%d",el->Z());
577 TString a = TString::Format("A=%d",(Int_t)el->A());
578 fAelem->SetText(a.Data());
579 fZelem->SetText(z.Data());
580}
581
582////////////////////////////////////////////////////////////////////////////////
583/// Slot for adding an element. No undo.
584
586{
587 Bool_t byfraction = fChkFraction->IsDown();
588 Int_t natoms = (Int_t)fNENatoms->GetNumber();
589 if (!byfraction && natoms<=0) return;
591 if (byfraction && frac<=0) return;
593 if (!el) return;
594 if (byfraction) fMixture->AddElement(el, frac);
595 else fMixture->AddElement(el, natoms);
597}
598
599////////////////////////////////////////////////////////////////////////////////
600/// Slot for applying modifications.
601
603{
604 const char *name = fMaterialName->GetText();
606
611// fMaterial->SetRadLen(fMatRadLen->GetNumber(), fMatAbsLen->GetNumber());
614 fUndo->SetEnabled();
616}
617
618////////////////////////////////////////////////////////////////////////////////
619/// Slot for undoing all changes.
620
622{
632 fMaterial->SetPressure(fPresi*6.2415e+8);
637}
638
639////////////////////////////////////////////////////////////////////////////////
640/// Update the list of elements in the TGCanvas.
641
643{
644 fComps->RemoveAll();
645 Int_t nelem = fMixture->GetNelements();
646 for (Int_t i=0; i<nelem; i++) {
647 TString s;
648 Bool_t byfrac = (fMixture->GetNmixt())?kFALSE:kTRUE;
649 if (byfrac)
650 s.TString::Format("%d-%s-%d: Wmass = %g %%", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
652 else
653 s.TString::Format("%d-%s-%d: Natoms = %d", (Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
655
656 TGLabel *label = new TGLabel(fComps, s);
658 fComps->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 1, 1, 0, 0));
659 }
661}
void Class()
Definition: Class.C:29
@ 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
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kOwnBackground
Definition: GuiTypes.h:391
ULong_t Pixel_t
Definition: GuiTypes.h:39
int Int_t
Definition: RtypesCore.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:90
double Double_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ 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:600
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:262
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:411
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:451
virtual TList * GetList() const
Definition: TGFrame.h:347
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:1101
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void RemoveAll()
Remove all frames from composite frame.
Definition: TGFrame.cxx:1115
TGFrame * fFrame
Definition: TGLayout.h:119
virtual void SetSize(const TGDimension &s)
Definition: TGFrame.h:277
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
TGDimension GetSize() const
Definition: TGFrame.h:255
virtual Bool_t IsComposite() const
Definition: TGFrame.h:237
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGLabel.cxx:394
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:178
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:111
virtual void SetDensity(Double_t density)
Definition: TGeoMaterial.h:130
virtual void SetZ(Double_t z)
Definition: TGeoMaterial.h:129
virtual Bool_t IsMixture() const
Definition: TGeoMaterial.h:125
void SetState(EGeoMaterialState state)
Definition: TGeoMaterial.h:138
EGeoMaterialState GetState() const
Definition: TGeoMaterial.h:117
Double_t GetTemperature() const
Definition: TGeoMaterial.h:115
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorption lengths.
Double_t GetPressure() const
Definition: TGeoMaterial.h:116
void SetPressure(Double_t pressure)
Definition: TGeoMaterial.h:137
virtual void SetA(Double_t a)
Definition: TGeoMaterial.h:128
virtual Double_t GetRadLen() const
Definition: TGeoMaterial.h:110
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:136
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:152
Int_t * GetNmixt() const
Definition: TGeoMaterial.h:193
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:190
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:192
virtual Int_t GetNelements() const
Definition: TGeoMaterial.h:189
Double_t * GetAmixt() const
Definition: TGeoMaterial.h:191
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:891
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:866
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