Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -60,6 +60,8 @@ CexmcCustomFilterEval::CexmcCustomFilterEval( const G4String & sourceFileName,
|
||||
if ( ! sourceFile )
|
||||
throw CexmcException( CexmcCFBadSource );
|
||||
|
||||
bool commandIsPending( false );
|
||||
|
||||
while ( ! sourceFile.eof() )
|
||||
{
|
||||
std::string line;
|
||||
@@ -69,62 +71,75 @@ CexmcCustomFilterEval::CexmcCustomFilterEval( const G4String & sourceFileName,
|
||||
if ( commentStartPos != std::string::npos )
|
||||
line.erase( commentStartPos );
|
||||
|
||||
command += line;
|
||||
|
||||
if ( ! command.empty() )
|
||||
if ( line.empty() ||
|
||||
line.find_first_not_of( " \t" ) == std::string::npos )
|
||||
{
|
||||
size_t length( command.length() );
|
||||
|
||||
if ( command[ length - 1 ] == '\\' )
|
||||
{
|
||||
command.erase( length - 1 );
|
||||
continue;
|
||||
}
|
||||
|
||||
CexmcCustomFilter::ParseResult curParseResult;
|
||||
|
||||
std::string::const_iterator begin( command.begin() );
|
||||
std::string::const_iterator end( command.end() );
|
||||
|
||||
try
|
||||
{
|
||||
if ( ! CexmcCustomFilter::phrase_parse( begin, end, grammar,
|
||||
CexmcCustomFilter::space, curParseResult ) ||
|
||||
begin != end )
|
||||
{
|
||||
throw CexmcException( CexmcCFParseError );
|
||||
}
|
||||
}
|
||||
catch ( ... )
|
||||
if ( commandIsPending )
|
||||
{
|
||||
sourceFile.close();
|
||||
throw;
|
||||
throw CexmcException( CexmcCFParseError );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
command += line;
|
||||
|
||||
size_t length( command.length() );
|
||||
|
||||
if ( command[ length - 1 ] == '\\' )
|
||||
{
|
||||
command.erase( length - 1 );
|
||||
commandIsPending = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
CexmcCustomFilter::ParseResult curParseResult;
|
||||
|
||||
std::string::const_iterator begin( command.begin() );
|
||||
std::string::const_iterator end( command.end() );
|
||||
|
||||
try
|
||||
{
|
||||
if ( ! CexmcCustomFilter::phrase_parse( begin, end, grammar,
|
||||
CexmcCustomFilter::space, curParseResult ) ||
|
||||
begin != end )
|
||||
{
|
||||
throw CexmcException( CexmcCFParseError );
|
||||
}
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
sourceFile.close();
|
||||
throw;
|
||||
}
|
||||
|
||||
#ifdef CEXMC_DEBUG_CF
|
||||
G4cout << "Parsed expression AST:" << G4endl;
|
||||
curParseResult.expression.Print();
|
||||
G4cout << "Parsed expression AST:" << G4endl;
|
||||
curParseResult.expression.Print();
|
||||
#endif
|
||||
|
||||
switch ( curParseResult.action )
|
||||
{
|
||||
case CexmcCustomFilter::KeepTPT :
|
||||
case CexmcCustomFilter::DeleteTPT :
|
||||
parseResultTPT.push_back( curParseResult );
|
||||
break;
|
||||
case CexmcCustomFilter::KeepEDT :
|
||||
case CexmcCustomFilter::DeleteEDT :
|
||||
parseResultEDT.push_back( curParseResult );
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
switch ( curParseResult.action )
|
||||
{
|
||||
case CexmcCustomFilter::KeepTPT :
|
||||
case CexmcCustomFilter::DeleteTPT :
|
||||
parseResultTPT.push_back( curParseResult );
|
||||
break;
|
||||
case CexmcCustomFilter::KeepEDT :
|
||||
case CexmcCustomFilter::DeleteEDT :
|
||||
parseResultEDT.push_back( curParseResult );
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
command = "";
|
||||
commandIsPending = false;
|
||||
}
|
||||
|
||||
sourceFile.close();
|
||||
|
||||
if ( commandIsPending )
|
||||
throw CexmcException( CexmcCFParseError );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -72,8 +72,6 @@
|
||||
#include "CexmcException.hh"
|
||||
#include "CexmcHistoWidget.hh"
|
||||
|
||||
extern TDirectory * gDirectory;
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <cmath>
|
||||
#include <Randomize.hh>
|
||||
#include <G4PhysicalConstants.hh>
|
||||
#include <G4SystemOfUnits.hh>
|
||||
#include "CexmcReimplementedGenbod.hh"
|
||||
#include "CexmcException.hh"
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <G4VisManager.hh>
|
||||
#include <G4Scene.hh>
|
||||
#include <G4VModel.hh>
|
||||
#include <G4Version.hh>
|
||||
#include "CexmcRunManager.hh"
|
||||
#include "CexmcRunManagerMessenger.hh"
|
||||
#include "CexmcRunAction.hh"
|
||||
@@ -857,7 +858,7 @@ void CexmcRunManager::SaveCurrentTPTEvent(
|
||||
const CexmcAngularRangeList & angularRanges,
|
||||
G4bool writeToDatabase )
|
||||
{
|
||||
CexmcRun * run( static_cast< const CexmcRun * >( currentRun ) );
|
||||
CexmcRun * run( static_cast< CexmcRun * >( currentRun ) );
|
||||
|
||||
if ( ! run )
|
||||
return;
|
||||
@@ -1315,12 +1316,21 @@ void CexmcRunManager::RegisterScenePrimitives( void )
|
||||
return;
|
||||
|
||||
/* G4Scene declarations lack this kind of typedef */
|
||||
typedef std::vector< G4VModel * > MList;
|
||||
#if G4VERSION_NUMBER < 960
|
||||
typedef std::vector< G4VModel * > MList;
|
||||
#else
|
||||
typedef std::vector< G4Scene::Model > MList;
|
||||
#endif
|
||||
const MList & mList( curScene->GetRunDurationModelList() );
|
||||
|
||||
for ( MList::const_iterator k( mList.begin() ); k != mList.end(); ++k )
|
||||
{
|
||||
if ( ( *k )->GetGlobalDescription() == CexmcScenePrimitivesDescription )
|
||||
#if G4VERSION_NUMBER < 960
|
||||
const G4String & modelDesc( ( *k )->GetGlobalDescription() );
|
||||
#else
|
||||
const G4String & modelDesc( k->fpModel->GetGlobalDescription() );
|
||||
#endif
|
||||
if ( modelDesc == CexmcScenePrimitivesDescription )
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <G4SystemOfUnits.hh>
|
||||
#include <G4Polyline.hh>
|
||||
#include <G4Circle.hh>
|
||||
#include <G4Polyhedron.hh>
|
||||
|
||||
Reference in New Issue
Block a user