ROOT logo
// @(#):$Id$
// Author: M.Gheata 
/*************************************************************************
 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGeoMaterialEditor
#define ROOT_TGeoMaterialEditor

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoMaterialEditor                                                  //
//                                                                      //
//  Editor for a TGeoMaterial.                                          //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGButton
#include "TGWidget.h"
#endif
#ifndef ROOT_TGeoGedFrame
#include "TGeoGedFrame.h"
#endif

class TGeoMaterial;
class TGeoTabManager;
class TGTextEntry;
class TGNumberEntry;
class TGTab;
class TGComboBox;
class TGTextButton;
class TGCanvas;
class TString;

class TGeoMaterialEditor : public TGeoGedFrame {

protected:

   Double_t             fAi;                // Initial atomic mass
   Int_t                fZi;                // Initial Z
   Int_t                fStatei;            // Initial material state
   Double_t             fDensityi;          // Initial density
   Double_t             fTempi;             // Initial temperature
   Double_t             fPresi;             // Initial pressure
   TString              fNamei;             // Initial name
   TGeoMaterial        *fMaterial;          // Material object
   Bool_t               fIsModified;        // Flag that material was modified
   Bool_t               fIsMaterialEditable;  // Flag that the material can be changed

   TGTextEntry         *fMaterialName;      // Material name text entry
   TGNumberEntry       *fMatA;              // Number entry for A
   TGNumberEntry       *fMatZ;              // Number entry for Z
   TGComboBox          *fMatState;          // Material state
   TGNumberEntry       *fMatDensity;        // Number entry for density
   TGNumberEntry       *fMatTemperature;    // Number entry for temperature
   TGNumberEntry       *fMatPressure;       // Number entry for pressure
   TGNumberEntry       *fMatRadLen;         // Number entry for radiation length
   TGNumberEntry       *fMatAbsLen;         // Number entry for absorbtion length
   TGCompositeFrame    *f23;                // Frame for buttons
   TGTextButton        *fApply;             // Apply-Button to accept changes
   TGTextButton        *fUndo;              // Undo-Button

   virtual void ConnectSignals2Slots();   // Connect the signals to the slots

public:
   TGeoMaterialEditor(const TGWindow *p = 0,
                   Int_t width = 140, Int_t height = 30,
                   UInt_t options = kChildFrame,
                   Pixel_t back = GetDefaultFrameBackground());
   virtual ~TGeoMaterialEditor();
   virtual void   SetModel(TObject *obj);

   void           DoA();
   void           DoZ();
   void           DoDensity();
   void           DoModified();
   void           DoName();
   void           DoRadAbs();
   void           DoState(Int_t state);
   void           DoTemperature();
   void           DoPressure();
   void           DoApply();
   void           DoUndo();
   
   ClassDef(TGeoMaterialEditor,0)   // TGeoMaterial editor
};   

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoMixtureEditor                                                   //
//                                                                      //
//  Editor for a TGeoMixture.                                           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGCheckButton;
class TGeoMixture;

class TGeoMixtureEditor : public TGeoMaterialEditor {  

protected:

   TGeoMixture         *fMixture;           // Mixture object 

   TGComboBox          *fMixElem;           // Combo box for elements
   TGLabel             *fNelem;             // Label for number of elements
   TGLabel             *fAelem;             // Label for A
   TGLabel             *fZelem;             // Label for Z
   TGCheckButton       *fChkFraction;       // Check button for fraction by wght.
   TGNumberEntry       *fNEFraction;        // Number entry for fraction value
   TGCheckButton       *fChkNatoms;         // Check button for number of atoms
   TGNumberEntry       *fNENatoms;          // Number entry for number of atoms
   TGTextButton        *fBAddElem;          // Buttom for adding element as component
   TGCompositeFrame    *fComps;             // Frame with components

   virtual void ConnectSignals2Slots();     // Connect the signals to the slots

public:
   TGeoMixtureEditor(const TGWindow *p = 0,
                   Int_t width = 140, Int_t height = 30,
                   UInt_t options = kChildFrame,
                   Pixel_t back = GetDefaultFrameBackground());
   virtual ~TGeoMixtureEditor() {}
   virtual void   SetModel(TObject *obj);
   void           UpdateElements();
  
   void           DoApply1();
   void           DoUndo1();
   void           DoChkFraction();
   void           DoChkNatoms();
   void           DoFraction();
   void           DoNatoms();
   void           DoSelectElement(Int_t iel);
   void           DoAddElem();

   ClassDef(TGeoMixtureEditor,0)   // TGeoMixture editor
};   

#endif                    
 TGeoMaterialEditor.h:1
 TGeoMaterialEditor.h:2
 TGeoMaterialEditor.h:3
 TGeoMaterialEditor.h:4
 TGeoMaterialEditor.h:5
 TGeoMaterialEditor.h:6
 TGeoMaterialEditor.h:7
 TGeoMaterialEditor.h:8
 TGeoMaterialEditor.h:9
 TGeoMaterialEditor.h:10
 TGeoMaterialEditor.h:11
 TGeoMaterialEditor.h:12
 TGeoMaterialEditor.h:13
 TGeoMaterialEditor.h:14
 TGeoMaterialEditor.h:15
 TGeoMaterialEditor.h:16
 TGeoMaterialEditor.h:17
 TGeoMaterialEditor.h:18
 TGeoMaterialEditor.h:19
 TGeoMaterialEditor.h:20
 TGeoMaterialEditor.h:21
 TGeoMaterialEditor.h:22
 TGeoMaterialEditor.h:23
 TGeoMaterialEditor.h:24
 TGeoMaterialEditor.h:25
 TGeoMaterialEditor.h:26
 TGeoMaterialEditor.h:27
 TGeoMaterialEditor.h:28
 TGeoMaterialEditor.h:29
 TGeoMaterialEditor.h:30
 TGeoMaterialEditor.h:31
 TGeoMaterialEditor.h:32
 TGeoMaterialEditor.h:33
 TGeoMaterialEditor.h:34
 TGeoMaterialEditor.h:35
 TGeoMaterialEditor.h:36
 TGeoMaterialEditor.h:37
 TGeoMaterialEditor.h:38
 TGeoMaterialEditor.h:39
 TGeoMaterialEditor.h:40
 TGeoMaterialEditor.h:41
 TGeoMaterialEditor.h:42
 TGeoMaterialEditor.h:43
 TGeoMaterialEditor.h:44
 TGeoMaterialEditor.h:45
 TGeoMaterialEditor.h:46
 TGeoMaterialEditor.h:47
 TGeoMaterialEditor.h:48
 TGeoMaterialEditor.h:49
 TGeoMaterialEditor.h:50
 TGeoMaterialEditor.h:51
 TGeoMaterialEditor.h:52
 TGeoMaterialEditor.h:53
 TGeoMaterialEditor.h:54
 TGeoMaterialEditor.h:55
 TGeoMaterialEditor.h:56
 TGeoMaterialEditor.h:57
 TGeoMaterialEditor.h:58
 TGeoMaterialEditor.h:59
 TGeoMaterialEditor.h:60
 TGeoMaterialEditor.h:61
 TGeoMaterialEditor.h:62
 TGeoMaterialEditor.h:63
 TGeoMaterialEditor.h:64
 TGeoMaterialEditor.h:65
 TGeoMaterialEditor.h:66
 TGeoMaterialEditor.h:67
 TGeoMaterialEditor.h:68
 TGeoMaterialEditor.h:69
 TGeoMaterialEditor.h:70
 TGeoMaterialEditor.h:71
 TGeoMaterialEditor.h:72
 TGeoMaterialEditor.h:73
 TGeoMaterialEditor.h:74
 TGeoMaterialEditor.h:75
 TGeoMaterialEditor.h:76
 TGeoMaterialEditor.h:77
 TGeoMaterialEditor.h:78
 TGeoMaterialEditor.h:79
 TGeoMaterialEditor.h:80
 TGeoMaterialEditor.h:81
 TGeoMaterialEditor.h:82
 TGeoMaterialEditor.h:83
 TGeoMaterialEditor.h:84
 TGeoMaterialEditor.h:85
 TGeoMaterialEditor.h:86
 TGeoMaterialEditor.h:87
 TGeoMaterialEditor.h:88
 TGeoMaterialEditor.h:89
 TGeoMaterialEditor.h:90
 TGeoMaterialEditor.h:91
 TGeoMaterialEditor.h:92
 TGeoMaterialEditor.h:93
 TGeoMaterialEditor.h:94
 TGeoMaterialEditor.h:95
 TGeoMaterialEditor.h:96
 TGeoMaterialEditor.h:97
 TGeoMaterialEditor.h:98
 TGeoMaterialEditor.h:99
 TGeoMaterialEditor.h:100
 TGeoMaterialEditor.h:101
 TGeoMaterialEditor.h:102
 TGeoMaterialEditor.h:103
 TGeoMaterialEditor.h:104
 TGeoMaterialEditor.h:105
 TGeoMaterialEditor.h:106
 TGeoMaterialEditor.h:107
 TGeoMaterialEditor.h:108
 TGeoMaterialEditor.h:109
 TGeoMaterialEditor.h:110
 TGeoMaterialEditor.h:111
 TGeoMaterialEditor.h:112
 TGeoMaterialEditor.h:113
 TGeoMaterialEditor.h:114
 TGeoMaterialEditor.h:115
 TGeoMaterialEditor.h:116
 TGeoMaterialEditor.h:117
 TGeoMaterialEditor.h:118
 TGeoMaterialEditor.h:119
 TGeoMaterialEditor.h:120
 TGeoMaterialEditor.h:121
 TGeoMaterialEditor.h:122
 TGeoMaterialEditor.h:123
 TGeoMaterialEditor.h:124
 TGeoMaterialEditor.h:125
 TGeoMaterialEditor.h:126
 TGeoMaterialEditor.h:127
 TGeoMaterialEditor.h:128
 TGeoMaterialEditor.h:129
 TGeoMaterialEditor.h:130
 TGeoMaterialEditor.h:131
 TGeoMaterialEditor.h:132
 TGeoMaterialEditor.h:133
 TGeoMaterialEditor.h:134
 TGeoMaterialEditor.h:135
 TGeoMaterialEditor.h:136
 TGeoMaterialEditor.h:137
 TGeoMaterialEditor.h:138
 TGeoMaterialEditor.h:139
 TGeoMaterialEditor.h:140
 TGeoMaterialEditor.h:141
 TGeoMaterialEditor.h:142
 TGeoMaterialEditor.h:143