Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // G4UIcmdWith3Vector << 27 // 23 // 28 // Author: M.Asai, 1998 << 24 // $Id: G4UIcmdWith3Vector.cc,v 1.6 2004/05/16 18:42:30 asaim Exp $ 29 // ------------------------------------------- << 25 // GEANT4 tag $Name: geant4-06-02 $ >> 26 // >> 27 // 30 28 31 #include "G4UIcmdWith3Vector.hh" 29 #include "G4UIcmdWith3Vector.hh" >> 30 #include <strstream> 32 31 33 // ------------------------------------------- << 32 G4UIcmdWith3Vector::G4UIcmdWith3Vector 34 G4UIcmdWith3Vector::G4UIcmdWith3Vector(const c << 33 (const char * theCommandPath,G4UImessenger * theMessenger) 35 : G4UIcommand(theCommandPath, theMessenger) << 34 :G4UIcommand(theCommandPath,theMessenger) 36 { 35 { 37 auto* dblParamX = new G4UIparameter('d'); << 36 G4UIparameter * dblParamX = new G4UIparameter('d'); 38 SetParameter(dblParamX); 37 SetParameter(dblParamX); 39 auto* dblParamY = new G4UIparameter('d'); << 38 G4UIparameter * dblParamY = new G4UIparameter('d'); 40 SetParameter(dblParamY); 39 SetParameter(dblParamY); 41 auto* dblParamZ = new G4UIparameter('d'); << 40 G4UIparameter * dblParamZ = new G4UIparameter('d'); 42 SetParameter(dblParamZ); 41 SetParameter(dblParamZ); 43 SetCommandType(With3VectorCmd); << 44 } 42 } 45 43 46 // ------------------------------------------- << 47 G4ThreeVector G4UIcmdWith3Vector::GetNew3Vecto 44 G4ThreeVector G4UIcmdWith3Vector::GetNew3VectorValue(const char* paramString) 48 { 45 { 49 return ConvertTo3Vector(paramString); 46 return ConvertTo3Vector(paramString); 50 } 47 } 51 48 52 // ------------------------------------------- << 49 void G4UIcmdWith3Vector::SetParameterName 53 void G4UIcmdWith3Vector::SetParameterName(cons << 50 (const char * theNameX,const char * theNameY,const char * theNameZ, 54 cons << 51 G4bool omittable,G4bool currentAsDefault) 55 G4bo << 56 { 52 { 57 G4UIparameter* theParamX = GetParameter(0); << 53 G4UIparameter * theParamX = GetParameter(0); 58 theParamX->SetParameterName(theNameX); 54 theParamX->SetParameterName(theNameX); 59 theParamX->SetOmittable(omittable); 55 theParamX->SetOmittable(omittable); 60 theParamX->SetCurrentAsDefault(currentAsDefa 56 theParamX->SetCurrentAsDefault(currentAsDefault); 61 G4UIparameter* theParamY = GetParameter(1); << 57 G4UIparameter * theParamY = GetParameter(1); 62 theParamY->SetParameterName(theNameY); 58 theParamY->SetParameterName(theNameY); 63 theParamY->SetOmittable(omittable); 59 theParamY->SetOmittable(omittable); 64 theParamY->SetCurrentAsDefault(currentAsDefa 60 theParamY->SetCurrentAsDefault(currentAsDefault); 65 G4UIparameter* theParamZ = GetParameter(2); << 61 G4UIparameter * theParamZ = GetParameter(2); 66 theParamZ->SetParameterName(theNameZ); 62 theParamZ->SetParameterName(theNameZ); 67 theParamZ->SetOmittable(omittable); 63 theParamZ->SetOmittable(omittable); 68 theParamZ->SetCurrentAsDefault(currentAsDefa 64 theParamZ->SetCurrentAsDefault(currentAsDefault); 69 } 65 } 70 66 71 // ------------------------------------------- << 67 void G4UIcmdWith3Vector::SetDefaultValue(G4ThreeVector vec) 72 void G4UIcmdWith3Vector::SetDefaultValue(const << 73 { 68 { 74 G4UIparameter* theParamX = GetParameter(0); << 69 G4UIparameter * theParamX = GetParameter(0); 75 theParamX->SetDefaultValue(vec.x()); 70 theParamX->SetDefaultValue(vec.x()); 76 G4UIparameter* theParamY = GetParameter(1); << 71 G4UIparameter * theParamY = GetParameter(1); 77 theParamY->SetDefaultValue(vec.y()); 72 theParamY->SetDefaultValue(vec.y()); 78 G4UIparameter* theParamZ = GetParameter(2); << 73 G4UIparameter * theParamZ = GetParameter(2); 79 theParamZ->SetDefaultValue(vec.z()); 74 theParamZ->SetDefaultValue(vec.z()); 80 } 75 } >> 76 81 77