source: trunk/source/materials/src/G4NistMessenger.cc@ 1199

Last change on this file since 1199 was 1196, checked in by garnier, 16 years ago

update CVS release candidate geant4.9.3.01

File size: 5.9 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id: G4NistMessenger.cc,v 1.8 2009/10/30 19:39:35 bagoulia Exp $
28// GEANT4 tag $Name: materials-V09-02-18 $
29//
30//
31// File name: G4NistMessenger
32//
33// Author: Vladimir Ivanchenko
34//
35// Creation date: 23.12.2004
36//
37// Modifications:
38//
39//
40// -------------------------------------------------------------------
41//
42
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
45
46#include "G4NistMessenger.hh"
47
48#include "G4NistManager.hh"
49
50#include "G4UIdirectory.hh"
51#include "G4UIcmdWithAnInteger.hh"
52#include "G4UIcmdWithAString.hh"
53#include "G4IonisParamMat.hh"
54#include "G4DensityEffectData.hh"
55
56//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
57
58G4NistMessenger::G4NistMessenger(G4NistManager* man)
59:manager(man)
60{
61 matDir = new G4UIdirectory("/material/");
62 matDir->SetGuidance("Commands for materials");
63
64 verCmd = new G4UIcmdWithAnInteger("/material/verbose",this);
65 verCmd->SetGuidance("Set verbose level.");
66
67 nistDir = new G4UIdirectory("/material/nist/");
68 nistDir->SetGuidance("Commands for the nist dataBase");
69
70 prtElmCmd = new G4UIcmdWithAString("/material/nist/printElement",this);
71 prtElmCmd->SetGuidance("print element(s) in dataBase.");
72 prtElmCmd->SetGuidance("symbol = element.");
73 prtElmCmd->SetGuidance("all = all elements.");
74 prtElmCmd->SetParameterName("symbol", true);
75 prtElmCmd->SetDefaultValue("all");
76
77 przElmCmd = new G4UIcmdWithAnInteger("/material/nist/printElementZ",this);
78 przElmCmd->SetGuidance("print element Z in dataBase.");
79 przElmCmd->SetGuidance("0 = all elements.");
80 przElmCmd->SetParameterName("Z", true);
81 przElmCmd->SetDefaultValue(0);
82
83 lisMatCmd = new G4UIcmdWithAString("/material/nist/listMaterials",this);
84 lisMatCmd->SetGuidance("list materials in Geant4 dataBase.");
85 lisMatCmd->SetGuidance("simple - simple NIST materials.");
86 lisMatCmd->SetGuidance("compound - compound NIST materials.");
87 lisMatCmd->SetGuidance("hep - HEP materials.");
88 lisMatCmd->SetGuidance("all - list of all Geant4 materials.");
89 lisMatCmd->SetParameterName("list", true);
90 lisMatCmd->SetCandidates("simple compound hep all");
91 lisMatCmd->SetDefaultValue("all");
92
93 g4Dir = new G4UIdirectory("/material/g4/");
94 g4Dir->SetGuidance("Commands for G4MaterialTable");
95
96 g4ElmCmd = new G4UIcmdWithAString("/material/g4/printElement",this);
97 g4ElmCmd->SetGuidance("print Element from G4ElementTable.");
98 g4ElmCmd->SetGuidance("all - all elements.");
99 g4ElmCmd->SetParameterName("elm", true);
100 g4ElmCmd->SetDefaultValue("all");
101
102 g4MatCmd = new G4UIcmdWithAString("/material/g4/printMaterial",this);
103 g4MatCmd->SetGuidance("print Material from G4MaterialTable.");
104 g4MatCmd->SetGuidance("all - all materials");
105 g4MatCmd->SetParameterName("mat", true);
106 g4MatCmd->SetDefaultValue("all");
107
108 g4DensCmd = new G4UIcmdWithAString("/material/g4/printDensityEffParam",this);
109 g4DensCmd->SetGuidance("print Material from G4DensityEffectData.");
110 g4DensCmd->SetGuidance("all - all materials");
111 g4DensCmd->SetParameterName("mat", true);
112 g4DensCmd->SetDefaultValue("all");
113}
114
115//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
116
117G4NistMessenger::~G4NistMessenger()
118{
119 delete verCmd;
120 delete prtElmCmd;
121 delete przElmCmd;
122 delete lisMatCmd;
123 delete nistDir;
124
125 delete g4ElmCmd;
126 delete g4MatCmd;
127 delete g4Dir;
128 delete matDir;
129}
130
131//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132
133void G4NistMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
134{
135 if (command == verCmd)
136 { manager->SetVerbose(verCmd->GetNewIntValue(newValue));}
137
138 if (command == prtElmCmd)
139 { manager->PrintElement(newValue);}
140
141 if (command == przElmCmd)
142 { manager->PrintElement(przElmCmd->GetNewIntValue(newValue));}
143
144 if (command == lisMatCmd)
145 { manager->ListMaterials(newValue);}
146
147 if (command == g4ElmCmd)
148 { manager->PrintG4Element(newValue);}
149
150 if (command == g4MatCmd)
151 { manager->PrintG4Material(newValue);}
152
153 if (command == g4DensCmd)
154 { if (G4Material::GetNumberOfMaterials > 0) {
155 G4IonisParamMat::GetDensityEffectData()->PrintData(newValue);
156 }
157 }
158}
159//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracBrowser for help on using the repository browser.