// // ******************************************************************** // * 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: G4VisCommandTemplates.icc,v 1.3.4.1 2001/06/28 19:16:08 gunter Exp $ // GEANT4 tag $Name: $ // // // Command Messenger Templates. // John Allison 7th September 1997 #include "G4UIcommand.hh" #include "G4UIdirectory.hh" #include "G4UIcmdWithoutParameter.hh" #include "G4ios.hh" /************************************** // What follows is just a try at a general template. But I think I'll abandon templates for this job - JA. template G4VisCommandMessenger ::G4VisCommandMessenger () { fpCommand = G4VisCommandMessengerRegister (fCommand.GetCommandName (), fCommand.GetGuidance (), this); } template G4VisCommandMessenger ::~G4VisCommandMessenger () { delete fpCommand; } template void G4VisCommandMessenger ::SetNewValue (G4UIcommand*, G4String newValues) { switch (G4VisCommandMessengerInterpret (newValues)) { case 0: fCommand.SetValue (false); break; case 1: fCommand.SetValue (true); break; default: break; } G4cout << "Current value of " << fCommand.GetValueName () << " is " << fCommand.GetValue () << G4endl; } ************************************/ // OLD STYLE!! template G4VisCommandDirectoryMessenger ::G4VisCommandDirectoryMessenger () { fpCommand = new G4UIdirectory (fCommandDirectory.GetCommandName ()); fpCommand -> SetGuidance (fCommandDirectory.GetGuidance ()); } // OLD STYLE!! template G4VisCommandDirectoryMessenger ::~G4VisCommandDirectoryMessenger () { delete fpCommand; } // OLD STYLE!! template G4VisSimpleCommandMessenger ::G4VisSimpleCommandMessenger () { fpCommand = new G4UIcmdWithoutParameter (fSimpleCommand.GetCommandName (), this); fpCommand -> SetGuidance (fSimpleCommand.GetGuidance ()); } // OLD STYLE!! template G4VisSimpleCommandMessenger ::~G4VisSimpleCommandMessenger () { delete fpCommand; } // OLD STYLE!! template void G4VisSimpleCommandMessenger ::SetNewValue (G4UIcommand*, G4String) { fSimpleCommand.SetValue (); } // OLD STYLE!! template G4VisButtonCommandMessenger ::G4VisButtonCommandMessenger () { fpCommand = G4VisButtonCommandMessengerRegister (fButtonCommand.GetCommandName (), fButtonCommand.GetGuidance (), this); } // OLD STYLE!! template G4VisButtonCommandMessenger ::~G4VisButtonCommandMessenger () { delete fpCommand; } // OLD STYLE!! template void G4VisButtonCommandMessenger ::SetNewValue (G4UIcommand*, G4String newValues) { switch (G4VisButtonCommandMessengerInterpret (newValues)) { case 0: fButtonCommand.SetValue (false); break; case 1: fButtonCommand.SetValue (true); break; default: break; } G4cout << "Current value of " << fButtonCommand.GetValueName () << " is " << fButtonCommand.GetValue () << G4endl; }