201 fApply->
Connect(
"Clicked()",
"TGeoMaterialEditor",
this,
"DoApply()");
202 fUndo->
Connect(
"Clicked()",
"TGeoMaterialEditor",
this,
"DoUndo()");
204 fMatA->
Connect(
"ValueSet(Long_t)",
"TGeoMaterialEditor",
this,
"DoA()");
205 fMatZ->
Connect(
"ValueSet(Long_t)",
"TGeoMaterialEditor",
this,
"DoZ()");
206 fMatState->
Connect(
"Selected(Int_t)",
"TGeoMaterialEditor",
this,
"DoState(Int_t)");
210 fMatRadLen->
Connect(
"ValueSet(Long_t)",
"TGeoMaterialEditor",
this,
"DoRadAbs()");
211 fMatAbsLen->
Connect(
"ValueSet(Long_t)",
"TGeoMaterialEditor",
this,
"DoRadAbs()");
400 fNelem =
new TGLabel(
this,
"Number of elements: 0");
412 if (element) fMixElem->AddEntry(element->
GetTitle(),i);
419 fAelem =
new TGLabel(comp1,
"A = 0");
421 fZelem =
new TGLabel(comp1,
"Z = 0");
430 fChkFraction->SetDown(
kTRUE);
437 fNEFraction->SetNumber(0.);
438 fNEFraction->Associate(
this);
446 fChkNatoms->SetDown(
kFALSE);
453 fNENatoms->SetNumber(0);
454 fNENatoms->Associate(
this);
460 fBAddElem->Associate(
this);
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()");
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)");
493 fMatRadLen->
Connect(
"ValueSet(Long_t)",
"TGeoMaterialEditor",
this,
"DoRadAbs()");
494 fMatAbsLen->
Connect(
"ValueSet(Long_t)",
"TGeoMaterialEditor",
this,
"DoRadAbs()");
517 if (fMixture->GetNelements() && fMixture->GetNmixt()) {
518 fChkFraction->SetDown(
kFALSE);
519 fChkNatoms->SetDown(
kTRUE);
522 Bool_t isDown = fChkFraction->IsDown();
523 fChkNatoms->SetDown(!isDown);
531 if (fMixture->GetNelements() && !fMixture->GetNmixt()) {
532 fChkFraction->SetDown(
kTRUE);
533 fChkNatoms->SetDown(
kFALSE);
536 Bool_t isDown = fChkNatoms->IsDown();
537 fChkFraction->SetDown(!isDown);
545 if (fMixture->GetNelements() && fMixture->GetNmixt())
return;
546 fChkFraction->SetDown(
kTRUE);
547 fChkNatoms->SetDown(
kFALSE);
555 if (fMixture->GetNelements() && !fMixture->GetNmixt())
return;
556 fChkFraction->SetDown(
kFALSE);
557 fChkNatoms->SetDown(
kTRUE);
567 Error(
"DoSelectElement",
"No element at index %d", ielem);
572 fAelem->SetText(a.Data());
573 fZelem->SetText(z.
Data());
581 Bool_t byfraction = fChkFraction->IsDown();
583 if (!byfraction && natoms<=0)
return;
584 Double_t frac = fNEFraction->GetNumber();
585 if (byfraction && frac<=0)
return;
588 if (byfraction) fMixture->AddElement(el, frac);
589 else fMixture->AddElement(el, natoms);
639 Int_t nelem = fMixture->GetNelements();
640 for (
Int_t i=0; i<nelem; i++) {
644 s.TString::Format(
"%d-%s-%d: Wmass = %g %%", (
Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
645 (
Int_t)fMixture->GetAmixt()[i],fMixture->GetWmixt()[i]);
647 s.TString::Format(
"%d-%s-%d: Natoms = %d", (
Int_t)fMixture->GetZmixt()[i], fMixture->GetElement(i)->GetName(),
648 (
Int_t)fMixture->GetAmixt()[i],fMixture->GetNmixt()[i]);
654 fComps->MapSubwindows();
virtual const char * GetTitle() const
Returns title of object.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
TGNumberEntry * fMatTemperature
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual Bool_t IsComposite() const
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetName(const char *name)
Set the name of the TNamed.
void DoZ()
Slot for charge.
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.
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
void DoState(Int_t state)
Slot for material state.
virtual void SetNumber(Double_t val)
void DoPressure()
Slot for material pressure.
Double_t GetPressure() const
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorption lengths.
void DoModified()
Slot for signaling modifications.
virtual TList * GetList() const
Base class describing materials.
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
virtual void ConnectSignals2Slots()
Connect signals to slots.
void DoFraction()
Fraction changed.
void DoDensity()
Slot for density.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hirarchically all daughters of a composite frame.
const char * Data() const
virtual void SetModel(TObject *obj)
Connect to the selected material.
TGNumberEntry * fMatDensity
TGTextEntry * fMaterialName
TGNumberEntryField * GetNumberEntry() const
void DoName()
Perform name change.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual void SetModel(TObject *obj)
Connect to the selected mixture.
const char * GetText() const
virtual Bool_t IsMixture() const
Base class for chemical elements.
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
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...
TGCompositeFrame(const TGCompositeFrame &)
void DoUndo()
Slot for cancelling current modifications.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual ~TGeoMaterialEditor()
Destructor.
TGNumberEntry * fMatAbsLen
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
virtual Double_t GetA() const
EGeoMaterialState GetState() const
virtual Int_t GetSelected() const
virtual Double_t GetIntLen() const
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...
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
void DoA()
Slot for atomic mass.
virtual void SetSize(const TGDimension &s)
void DoApply1()
Slot for applying modifications.
Double_t GetTemperature() const
void SetDensity(Double_t density)
void DoChkFraction()
Check button state changed for fraction.
virtual const char * GetName() const
Returns name of object.
void SetPressure(Double_t pressure)
static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p)
Move frame fr at the end of the list of parent p.
void DoApply()
Slot for applying modifications.
virtual void ConnectSignals2Slots()
Connect signals to slots.
R__EXTERN TGeoManager * gGeoManager
void SetState(EGeoMaterialState state)
virtual void AddEntry(TGString *s, Int_t id)
TGDimension GetSize() const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
void DoRadAbs()
Slot for radiation/absorbtion length.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual Double_t GetZ() const
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
virtual Double_t GetRadLen() const
void SetTemperature(Double_t temperature)
virtual UInt_t GetDefaultHeight() const
void UpdateElements()
Update the list of elements in the TGCanvas.
void SetTextJustify(Int_t tmode)
Set text justification.
virtual Double_t GetDensity() const
void DoNatoms()
Natoms changed.
Bool_t fIsMaterialEditable
void DoUndo1()
Slot for undoing all changes.
Int_t GetNelements() const
virtual Double_t GetNumber() const
TGeoElement * GetElement(Int_t z)
void DoAddElem()
Slot for adding an element. No undo.
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...
void DoChkNatoms()
Check button state changed for natoms.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
void DoTemperature()
Slot for material temperature.
TGNumberEntry * fMatRadLen
virtual void MakeTitle(const char *title)
Create attribute frame title.
TGNumberEntry * fMatPressure
void DoSelectElement(Int_t iel)
Slot for selecting an element.