Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
visualization
management
include
G4VisCommandsListManager.hh
Go to the documentation of this file.
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
// $Id$
27
//
28
// Jane Tinslay, John Allison, Joseph Perl October 2005
29
//
30
// Class Description:
31
// Templated list manager commands which control list manager listing and
32
// selection.
33
// Class Description - End:
34
35
#ifndef G4VISCOMMANDLISTMANAGER_HH
36
#define G4VISCOMMANDLISTMANAGER_HH
37
38
#include "
G4UImessenger.hh
"
39
#include "G4String.hh"
40
#include "
G4UIcmdWithAString.hh
"
41
#include "
G4UIcommand.hh
"
42
43
template
<
typename
Manager>
44
class
G4VisCommandListManagerList
:
public
G4UImessenger
{
45
46
public
:
// With description
47
48
G4VisCommandListManagerList
(Manager*,
const
G4String
& placement);
49
// Input list manager and command placement
50
51
virtual
~G4VisCommandListManagerList
();
52
53
G4String
GetCurrentValue
(
G4UIcommand
*);
54
void
SetNewValue
(
G4UIcommand
* command,
G4String
newValue);
55
56
G4String
Placement
()
const
;
57
58
private
:
59
60
// Data members
61
Manager* fpManager;
62
G4String
fPlacement;
63
64
G4UIcmdWithAString
* fpCommand;
65
66
};
67
68
// List command
69
template
<
typename
Manager>
70
G4VisCommandListManagerList<Manager>::G4VisCommandListManagerList
(Manager* manager,
const
G4String
& placement)
71
:fpManager(manager)
72
,fPlacement(placement)
73
{
74
G4String
command =
Placement
()+
"/list"
;
75
76
fpCommand =
new
G4UIcmdWithAString
(command,
this
);
77
fpCommand->
SetGuidance
(
"List objects registered with list manager"
);
78
fpCommand->
SetParameterName
(
"name"
,
true
);
79
}
80
81
template
<
typename
Manager>
82
G4VisCommandListManagerList<Manager>::~G4VisCommandListManagerList
()
83
{
84
delete
fpCommand;
85
}
86
87
template
<
typename
Manager>
88
G4String
89
G4VisCommandListManagerList<Manager>::Placement
()
const
90
{
91
return
fPlacement;
92
}
93
94
template
<
typename
Manager>
95
G4String
96
G4VisCommandListManagerList<Manager>::GetCurrentValue
(
G4UIcommand
*)
97
{
98
return
""
;
99
}
100
101
template
<
typename
Manager>
102
void
G4VisCommandListManagerList<Manager>::SetNewValue
(
G4UIcommand
*,
G4String
name
)
103
{
104
G4cout
<<
"Listing models available in "
<<Placement()<<
G4endl
;
105
106
assert (0 != fpManager);
107
fpManager->Print(
G4cout
, name);
108
}
109
110
//Select command
111
template
<
typename
Manager>
112
class
G4VisCommandListManagerSelect
:
public
G4UImessenger
{
113
114
public
:
// With description
115
116
G4VisCommandListManagerSelect
(Manager*,
const
G4String
& placement);
117
// Input list manager and command placement
118
119
virtual
~G4VisCommandListManagerSelect
();
120
121
G4String
GetCurrentValue
(
G4UIcommand
*);
122
void
SetNewValue
(
G4UIcommand
* command,
G4String
newValue);
123
124
private
:
125
126
Manager* fpManager;
127
G4String
fPlacement;
128
129
G4UIcmdWithAString
* fpCommand;
130
131
};
132
133
template
<
typename
Manager>
134
G4VisCommandListManagerSelect<Manager>::G4VisCommandListManagerSelect
(Manager* manager,
const
G4String
& placement)
135
:fpManager(manager)
136
,fPlacement(placement)
137
{
138
G4String
command = placement+
"/select"
;
139
G4String
guidance =
"Select created object"
;
140
141
fpCommand =
new
G4UIcmdWithAString
(command,
this
);
142
fpCommand->
SetGuidance
(guidance);
143
fpCommand->
SetParameterName
(
"name"
,
false
);
144
}
145
146
template
<
typename
Manager>
147
G4VisCommandListManagerSelect<Manager>::~G4VisCommandListManagerSelect
()
148
{
149
delete
fpCommand;
150
}
151
152
template
<
typename
Manager>
153
G4String
154
G4VisCommandListManagerSelect<Manager>::GetCurrentValue
(
G4UIcommand
*)
155
{
156
return
""
;
157
}
158
159
template
<
typename
Manager>
160
void
G4VisCommandListManagerSelect<Manager>::SetNewValue
(
G4UIcommand
*,
G4String
name
)
161
{
162
assert (0 != fpManager);
163
fpManager->SetCurrent(name);
164
}
165
166
// Mode command
167
template
<
typename
Manager>
168
class
G4VisCommandManagerMode
:
public
G4UImessenger
{
169
170
public
:
// With description
171
172
G4VisCommandManagerMode
(Manager*,
const
G4String
& placement);
173
174
virtual
~G4VisCommandManagerMode
();
175
176
G4String
GetCurrentValue
(
G4UIcommand
*);
177
void
SetNewValue
(
G4UIcommand
* command,
G4String
newValue);
178
179
private
:
180
181
Manager* fpManager;
182
G4String
fPlacement;
183
184
G4UIcmdWithAString
* fpCommand;
185
186
};
187
template
<
typename
Manager>
188
G4VisCommandManagerMode<Manager>::G4VisCommandManagerMode
(Manager* manager,
const
G4String
& placement)
189
:fpManager(manager)
190
,fPlacement(placement)
191
{
192
G4String
command = fPlacement+
"/mode"
;
193
194
fpCommand =
new
G4UIcmdWithAString
(command,
this
);
195
fpCommand->
SetGuidance
(
"Set mode of operation"
);
196
fpCommand->
SetParameterName
(
"mode"
,
false
);
197
fpCommand->
SetCandidates
(
"soft hard"
);
198
}
199
200
template
<
typename
Manager>
201
G4VisCommandManagerMode<Manager>::~G4VisCommandManagerMode
()
202
{
203
delete
fpCommand;
204
}
205
206
template
<
typename
Manager>
207
G4String
208
G4VisCommandManagerMode<Manager>::GetCurrentValue
(
G4UIcommand
*)
209
{
210
return
""
;
211
}
212
213
template
<
typename
Manager>
214
void
G4VisCommandManagerMode<Manager>::SetNewValue
(
G4UIcommand
*,
G4String
name
)
215
{
216
assert (0 != fpManager);
217
fpManager->SetMode(name);
218
}
219
220
#endif
Generated on Sat May 25 2013 14:34:15 for Geant4 by
1.8.4