// ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. * // * * // * This code implementation is the intellectual property of the * // * GEANT4 collaboration. * // * By copying, distributing or modifying the Program (or any work * // * based on the Program) you indicate your acceptance of this * // * statement, and all its terms. * // ******************************************************************** // // $Id: G4VisCommandsListManager.hh,v 1.1 2005/11/21 05:45:42 tinslay Exp $ // GEANT4 tag $Name: geant4-08-00 $ // // Jane Tinslay, John Allison, Joseph Perl October 2005 // // Class Description: // Templated list manager commands which control list manager listing and // selection. // Class Description - End: #ifndef G4VISCOMMANDLISTMANAGER_HH #define G4VISCOMMANDLISTMANAGER_HH #include "G4UImessenger.hh" #include "G4String.hh" #include "G4UIcmdWithAString.hh" #include "G4UIcommand.hh" template class G4VisCommandListManagerList : public G4UImessenger { public: // With description G4VisCommandListManagerList(Manager*, const G4String& placement); // Input list manager and command placement virtual ~G4VisCommandListManagerList(); G4String GetCurrentValue(G4UIcommand*); void SetNewValue(G4UIcommand* command, G4String newValue); G4String Placement() const; private: // Data members Manager* fpManager; G4String fPlacement; G4UIcmdWithAString* fpCommand; }; // List command template G4VisCommandListManagerList::G4VisCommandListManagerList(Manager* manager, const G4String& placement) :fpManager(manager) ,fPlacement(placement) { G4String command = Placement()+"/list"; fpCommand = new G4UIcmdWithAString(command, this); fpCommand->SetGuidance("List objects registered with list manager"); fpCommand->SetParameterName("name", true); } template G4VisCommandListManagerList::~G4VisCommandListManagerList() { delete fpCommand; } template G4String G4VisCommandListManagerList::Placement() const { return fPlacement; } template G4String G4VisCommandListManagerList::GetCurrentValue(G4UIcommand*) { return ""; } template void G4VisCommandListManagerList::SetNewValue(G4UIcommand*, G4String name) { G4cout<<"Listing models available in "<Print(G4cout, name); } //Select command template class G4VisCommandListManagerSelect : public G4UImessenger { public: // With description G4VisCommandListManagerSelect(Manager*, const G4String& placement); // Input list manager and command placement virtual ~G4VisCommandListManagerSelect(); G4String GetCurrentValue(G4UIcommand*); void SetNewValue (G4UIcommand* command, G4String newValue); private: Manager* fpManager; G4String fPlacement; G4UIcmdWithAString* fpCommand; }; template G4VisCommandListManagerSelect::G4VisCommandListManagerSelect(Manager* manager, const G4String& placement) :fpManager(manager) ,fPlacement(placement) { G4String command = placement+"/select"; G4String guidance = "Select created object"; fpCommand = new G4UIcmdWithAString(command, this); fpCommand->SetGuidance(guidance); fpCommand->SetParameterName("name", false); } template G4VisCommandListManagerSelect::~G4VisCommandListManagerSelect() { delete fpCommand; } template G4String G4VisCommandListManagerSelect::GetCurrentValue(G4UIcommand*) { return ""; } template void G4VisCommandListManagerSelect::SetNewValue(G4UIcommand*, G4String name) { assert (0 != fpManager); fpManager->SetCurrent(name); } #endif