Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-10 14:46:44 +01:00
committed by Ben Morgan
parent 6399a014b6
commit 80e2389dd8
3932 changed files with 202519 additions and 246221 deletions
@@ -128,6 +128,8 @@ class G4GenericMessenger : public G4UImessenger
return SetUnit(u, UnitDefault);
}
Command& SetParameterName(const G4String&, G4bool, G4bool = false);
Command& SetParameterName(const G4String&, const G4String&, const G4String&,
G4bool, G4bool = false);
Command& SetDefaultValue(const G4String&);
Command& SetCandidates(const G4String&);
Command& SetToBeBroadcasted(G4bool s0)
@@ -189,6 +191,8 @@ class G4GenericMessenger : public G4UImessenger
const G4String& doc = "");
void SetDirectory(const G4String& dir) { directory = dir; }
void SetGuidance(const G4String& s);
void Sort(G4bool val = true)
{ if(dircmd) dircmd->Sort(val); }
private:
+18
View File
@@ -194,6 +194,20 @@ class G4UIcommand
failureDescription = "";
}
public:
enum CommandType
{ BaseClassCmd, WithoutParameterCmd,
WithABoolCmd, WithAnIntegerCmd, WithALongIntCmd,
WithADoubleCmd, WithADoubleAndUnitCmd, With3VectorCmd, With3VectorAndUnitCmd,
WithAStringCmd, CmdDirectory = -1 };
inline CommandType GetCommandType() const
{ return commandType; }
void SetCommandType(CommandType);
inline void SetDefaultSortFlag(G4bool val)
{ ifSort = val; }
protected:
// --- the following is used by CheckNewValue() --------
@@ -209,6 +223,8 @@ class G4UIcommand
G4int commandFailureCode = 0;
G4String failureDescription = "";
G4bool ifSort = false;
private:
void G4UIcommandCommonConstructorCode(const char* theCommandPath);
@@ -246,6 +262,8 @@ class G4UIcommand
// Data -----------------------------------------------------------
private:
CommandType commandType = BaseClassCmd;
G4UImessenger* messenger = nullptr;
G4String commandPath;
G4String commandName;
+3 -1
View File
@@ -66,7 +66,7 @@ class G4UIcommandTree
void List() const;
void ListCurrent() const;
void ListCurrentWithNum() const;
void CreateHTML();
void CreateHTML(G4String = "");
inline const G4UIcommand* GetGuidance() const { return guidance; }
inline const G4String& GetPathName() const { return pathName; }
@@ -91,6 +91,8 @@ class G4UIcommandTree
G4UIcommand* guidance = nullptr;
G4String pathName;
G4bool broadcastCommands = true;
G4bool ifSort = false;
G4int createHTMLTreeLevel = 0;
};
#endif
@@ -47,6 +47,12 @@ class G4UIdirectory : public G4UIcommand
G4bool commandsToBeBroadcasted = true);
// Constructors. The argument is a full path directory which
// starts and ends with "/".
void Sort(G4bool val = true)
{ ifSort = val; }
G4bool IfSort() const
{ return ifSort; }
// N.B. ifSort is defined in the base class G4UIcommand
};
#endif
+7
View File
@@ -107,6 +107,13 @@ class G4UImanager : public G4VStateDependent
// x00 : G4CommandStatus.hh enumeration
// yy : the problematic parameter (first found)
G4UIcommand* FindCommand(const char* aCommand);
G4UIcommand* FindCommand(const G4String& aCommand);
// Find the G4UIcommand object. Null pointer is returned if command
// is not found.
// Please note that each thread returns different objects if this
// method is used in multi-threaded mode.
void StoreHistory(const char* fileName = "G4history.macro");
void StoreHistory(G4bool historySwitch,
const char* fileName = "G4history.macro");
+2 -2
View File
@@ -110,10 +110,10 @@ template <typename T>
T* G4UImessenger::CreateCommand(const G4String& cname, const G4String& dsc)
{
G4String path;
if(cname(0) != '/')
if(cname[0] != '/')
{
path = baseDirName + cname;
if(path(0) != '/')
if(path[0] != '/')
path = "/" + path;
}