Import Geant4 8.1.0 source tree
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# $Id: GNUmakefile,v 1.2 2006/04/25 08:09:45 kmura Exp $
|
||||
# $Name: geant4-08-01 $
|
||||
# ===========================================================
|
||||
# Makefile for building Geant4Py modules
|
||||
# ===========================================================
|
||||
include ../../config/config.gmk
|
||||
|
||||
# python module name
|
||||
MODULE := G4interface#
|
||||
|
||||
include $(G4PY_INSTALL)/config/g4py.gmk
|
||||
include $(G4PY_INSTALL)/config/module.gmk
|
||||
include $(G4PY_INSTALL)/config/install.gmk
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4UImanager.cc,v 1.4 2006/06/29 15:34:01 gunter Exp $
|
||||
// $Name: geant4-08-01 $
|
||||
// ====================================================================
|
||||
// pyG4UImanager.cc
|
||||
//
|
||||
// G4UImanager class is pure singleton, so it cannnot be exposed
|
||||
// from BPL. Functionality of G4UImanager is exposed in global
|
||||
// name space via wrappers.
|
||||
// 2005 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
|
||||
// ====================================================================
|
||||
// wrappers
|
||||
// ====================================================================
|
||||
namespace pyG4UImanager {
|
||||
|
||||
//////////////////////////////////////////////
|
||||
G4int ApplyUICommand_1(const G4String& cmdstr)
|
||||
//////////////////////////////////////////////
|
||||
{
|
||||
G4UImanager* UImgr= G4UImanager::GetUIpointer();
|
||||
G4int returnVal= UImgr-> ApplyCommand(cmdstr);
|
||||
if( returnVal == fCommandSucceeded ) return returnVal;
|
||||
|
||||
G4int paramIndex= returnVal % 100;
|
||||
G4int commandStatus= returnVal - paramIndex;
|
||||
|
||||
switch(commandStatus) {
|
||||
case fCommandSucceeded:
|
||||
break;
|
||||
|
||||
case fCommandNotFound:
|
||||
G4cout << "command <" << UImgr-> SolveAlias(cmdstr)
|
||||
<< "> not found" << G4endl;
|
||||
break;
|
||||
|
||||
case fIllegalApplicationState:
|
||||
G4cout << "illegal application state -- command refused"
|
||||
<< G4endl;
|
||||
break;
|
||||
|
||||
case fParameterOutOfRange:
|
||||
break;
|
||||
|
||||
case fParameterOutOfCandidates:
|
||||
G4cout << "Parameter is out of candidate list (index "
|
||||
<< paramIndex << ")"
|
||||
<< G4endl;
|
||||
break;
|
||||
|
||||
case fParameterUnreadable:
|
||||
G4cout << "Parameter is wrong type and/or is not omittable (index "
|
||||
<< paramIndex << ")" << G4endl;
|
||||
break;
|
||||
|
||||
case fAliasNotFound:
|
||||
break;
|
||||
|
||||
default:
|
||||
G4cout << "command refused (" << commandStatus << ")" << G4endl;
|
||||
break;
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
G4int ApplyUICommand_2(const std::string& cmdstr)
|
||||
/////////////////////////////////////////////////
|
||||
{
|
||||
return ApplyUICommand_1(cmdstr);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////
|
||||
std::string GetCurrentValues(const char* cmdstr)
|
||||
////////////////////////////////////////////////
|
||||
{
|
||||
G4UImanager* UImgr= G4UImanager::GetUIpointer();
|
||||
return UImgr-> GetCurrentValues(cmdstr);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
using namespace pyG4UImanager;
|
||||
|
||||
// ====================================================================
|
||||
// module definition
|
||||
// ====================================================================
|
||||
void export_G4UImanager()
|
||||
{
|
||||
def("ApplyUICommand", ApplyUICommand_1);
|
||||
def("ApplyUICommand", ApplyUICommand_2);
|
||||
def("GetCurrentValues", GetCurrentValues);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4UIterminal.cc,v 1.4 2006/06/29 15:34:04 gunter Exp $
|
||||
// $Name: geant4-08-01 $
|
||||
// ====================================================================
|
||||
// pyG4UIterminal.cc
|
||||
//
|
||||
// 2005 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
|
||||
static G4UIterminal* session= 0;
|
||||
|
||||
// ====================================================================
|
||||
// wrappers
|
||||
// ====================================================================
|
||||
namespace pyG4UIterminal {
|
||||
|
||||
/////////////////////
|
||||
void StartUISession()
|
||||
/////////////////////
|
||||
{
|
||||
if (session == 0 ) {
|
||||
G4UItcsh* tcsh= new
|
||||
G4UItcsh("[40;01;33meccsim[40;31m(%s)[40;36m[%/][00;01;30m:");
|
||||
|
||||
session= new G4UIterminal(tcsh);
|
||||
tcsh-> SetLsColor(BLUE,RED);
|
||||
}
|
||||
|
||||
session-> SessionStart();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
using namespace pyG4UIterminal;
|
||||
|
||||
// ====================================================================
|
||||
// module definition
|
||||
// ====================================================================
|
||||
void export_G4UIterminal()
|
||||
{
|
||||
def("StartUISession", StartUISession);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pymodG4interface.cc,v 1.4 2006/06/29 15:34:07 gunter Exp $
|
||||
// $Name: geant4-08-01 $
|
||||
// ====================================================================
|
||||
// pymodG4pyInterface.cc [Geant4Py module]
|
||||
//
|
||||
// 2005 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
|
||||
using namespace boost::python;
|
||||
|
||||
// ====================================================================
|
||||
// module definition
|
||||
// ====================================================================
|
||||
|
||||
void export_G4UImanager();
|
||||
void export_G4UIterminal();
|
||||
|
||||
BOOST_PYTHON_MODULE(G4interface)
|
||||
{
|
||||
export_G4UImanager();
|
||||
export_G4UIterminal();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user