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