Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4UIcommandTree.cc 77651 2013-11-27 08:47:55Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4UIcommandTree.hh"
|
||||
@@ -33,11 +33,11 @@
|
||||
#include "G4ios.hh"
|
||||
|
||||
G4UIcommandTree::G4UIcommandTree()
|
||||
:guidance(NULL)
|
||||
:guidance(NULL),broadcastCommands(true)
|
||||
{ }
|
||||
|
||||
G4UIcommandTree::G4UIcommandTree(const char * thePathName)
|
||||
:guidance(NULL)
|
||||
:guidance(NULL),broadcastCommands(true)
|
||||
{
|
||||
pathName = thePathName;
|
||||
}
|
||||
@@ -60,14 +60,19 @@ G4int G4UIcommandTree::operator!=(const G4UIcommandTree &right) const
|
||||
return ( pathName != right.GetPathName() );
|
||||
}
|
||||
|
||||
void G4UIcommandTree::AddNewCommand(G4UIcommand *newCommand)
|
||||
void G4UIcommandTree::AddNewCommand(G4UIcommand *newCommand, G4bool workerThreadOnly)
|
||||
{
|
||||
G4String commandPath = newCommand->GetCommandPath();
|
||||
G4String remainingPath = commandPath;
|
||||
remainingPath.remove(0,pathName.length());
|
||||
if( remainingPath.isNull() )
|
||||
{
|
||||
guidance = newCommand;
|
||||
if(!guidance)
|
||||
{
|
||||
guidance = newCommand;
|
||||
if(!(newCommand->ToBeBroadcasted())) broadcastCommands = false;
|
||||
if(workerThreadOnly) newCommand->SetWorkerThreadOnly();
|
||||
}
|
||||
return;
|
||||
}
|
||||
G4int i = remainingPath.first('/');
|
||||
@@ -80,6 +85,8 @@ void G4UIcommandTree::AddNewCommand(G4UIcommand *newCommand)
|
||||
if( remainingPath == command[i_thCommand]->GetCommandName() )
|
||||
{ return; }
|
||||
}
|
||||
if(!broadcastCommands) newCommand->SetToBeBroadcasted(false);
|
||||
if(workerThreadOnly) newCommand->SetWorkerThreadOnly();
|
||||
command.push_back( newCommand );
|
||||
return;
|
||||
}
|
||||
@@ -93,19 +100,22 @@ void G4UIcommandTree::AddNewCommand(G4UIcommand *newCommand)
|
||||
{
|
||||
if( nextPath == tree[i_thTree]->GetPathName() )
|
||||
{
|
||||
tree[i_thTree]->AddNewCommand( newCommand );
|
||||
if(!broadcastCommands) newCommand->SetToBeBroadcasted(false);
|
||||
tree[i_thTree]->AddNewCommand( newCommand, workerThreadOnly );
|
||||
return;
|
||||
}
|
||||
}
|
||||
G4UIcommandTree * newTree = new G4UIcommandTree( nextPath );
|
||||
tree.push_back( newTree );
|
||||
newTree->AddNewCommand( newCommand );
|
||||
if(!broadcastCommands) newCommand->SetToBeBroadcasted(false);
|
||||
newTree->AddNewCommand( newCommand, workerThreadOnly );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void G4UIcommandTree::RemoveCommand(G4UIcommand *aCommand)
|
||||
void G4UIcommandTree::RemoveCommand(G4UIcommand *aCommand, G4bool workerThreadOnly)
|
||||
{
|
||||
if(workerThreadOnly && !(aCommand->IsWorkerThreadOnly())) return;
|
||||
G4String commandPath = aCommand->GetCommandPath();
|
||||
G4String remainingPath = commandPath;
|
||||
remainingPath.remove(0,pathName.length());
|
||||
@@ -332,16 +342,25 @@ void G4UIcommandTree::ListCurrent() const
|
||||
G4cout << " Sub-directories : " << G4endl;
|
||||
G4int n_treeEntry = tree.size();
|
||||
for( G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
|
||||
{
|
||||
G4cout << " " << tree[i_thTree]->GetPathName()
|
||||
<< " " << tree[i_thTree]->GetTitle() << G4endl;
|
||||
{
|
||||
G4cout << " " << tree[i_thTree]->GetPathName();
|
||||
if(tree[i_thTree]->GetGuidance() &&
|
||||
tree[i_thTree]->GetGuidance()->IsWorkerThreadOnly())
|
||||
{ G4cout << " @ "; }
|
||||
else
|
||||
{ G4cout << " "; }
|
||||
G4cout << tree[i_thTree]->GetTitle() << G4endl;
|
||||
}
|
||||
G4cout << " Commands : " << G4endl;
|
||||
G4int n_commandEntry = command.size();
|
||||
for( G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ )
|
||||
{
|
||||
G4cout << " " << command[i_thCommand]->GetCommandName()
|
||||
<< " * " << command[i_thCommand]->GetTitle() << G4endl;
|
||||
G4cout << " " << command[i_thCommand]->GetCommandName();
|
||||
if(command[i_thCommand]->IsWorkerThreadOnly())
|
||||
{ G4cout << " @ "; }
|
||||
else
|
||||
{ G4cout << " * "; }
|
||||
G4cout << command[i_thCommand]->GetTitle() << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user