Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt,v 1.1 2010-09-29 19:14:32 bmorgan Exp $
|
||||
# $Id: CMakeLists.txt 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.3 2011-01-03 14:34:46 lgarnier Exp $
|
||||
# $Id: GNUmakefile 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
|
||||
name := G4GMocren
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.17 2011-01-03 14:34:46 lgarnier Exp $
|
||||
$Id: History 75179 2013-10-29 10:09:31Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,38 @@ committal in the CVS repository !
|
||||
History file for visualization/gMocren sub-category
|
||||
---------------------------------------------------
|
||||
|
||||
29th June 2013 Gabriele Cosmo (gMocren-V09-06-07)
|
||||
- Commmented out private declaration of G4GMocrenFileSceneHandler::operator=()
|
||||
to overcome compilation error on MacOSX 10.9 Mavericks.
|
||||
- Fixed streaming on cout of ofstream content in G4GMocrenIO::storeData4().
|
||||
Clears a compilation error detected on Windows/VC++12.
|
||||
|
||||
17th June 2013 John Allison (gMocren-V09-06-06)
|
||||
- G4GMocrenFileSceneHandler.cc: Reverted snprintf to sprintf.
|
||||
o snprintf not in cstdlib on Windows.
|
||||
o Mark as "intentional" on next Coverity analysis.
|
||||
|
||||
15th June 2013 Akinori Kimura (gMocren-V09-06-05)
|
||||
- G4GMocrenIO.cc and G4GMocrenFileSceneHandler.{cc,hh}: Fixed warnings of
|
||||
Coverity.
|
||||
|
||||
4th June 2013 Akinori Kimura (gMocren-V09-06-04)
|
||||
- G4GMocrenIO: Fixed an inconsistency of the length check of the unit string.
|
||||
|
||||
24th February 2013 John Allison (gMocren-V09-06-03)
|
||||
- G4GMocrenFileViewer, G4GMocrenMessenger:
|
||||
o Removed unused fields as warned by new clang compiler.
|
||||
|
||||
22nd January 2013 Akinori Kimura (gMocren-V09-06-02)
|
||||
- Fixed wrong parameters of G4Exception() in G4GMocrenIO.cc.
|
||||
|
||||
22nd January 2013 Akinori Kimura (gMocren-V09-06-01)
|
||||
- Replaced exit() with G4Exception() in G4GMocrenIO.cc.
|
||||
|
||||
2nd December 2012 John Allison (gMocren-V09-06-00)
|
||||
- Remove NURBS.
|
||||
- Remove references to i_mode.
|
||||
|
||||
8th August 2012 John Allison (gMocren-V09-05-05)
|
||||
- G4GMocrenFileSceneHandler.cc:
|
||||
o Intercepted 2D primitives - JustWarning printed.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenFile.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Mar. 31, 2009 Akinori Kimura
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenFileCTtoDensityMap.hh 70733 2013-06-05 10:05:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Oct. 12, 2009 Akinori Kimura
|
||||
@@ -52,5 +52,11 @@ protected:
|
||||
G4int kCTMinMax[2];
|
||||
G4double * kDensity;
|
||||
G4int kSize;
|
||||
|
||||
private:
|
||||
// Private copy constructor and assigment operator - copying and
|
||||
// assignment not allowed. Keeps Coverity happy.
|
||||
G4GMocrenFileCTtoDensityMap (const G4GMocrenFileCTtoDensityMap&);
|
||||
G4GMocrenFileCTtoDensityMap& operator = (const G4GMocrenFileCTtoDensityMap&);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenFileSceneHandler.hh 75179 2013-10-29 10:09:31Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Mar. 31, 2009 Akinori Kimura
|
||||
@@ -66,7 +66,6 @@ public:
|
||||
//----- overriding base class methods
|
||||
void AddPrimitive (const G4Polyline& line);
|
||||
void AddPrimitive (const G4Polyhedron& p);
|
||||
void AddPrimitive (const G4NURBS& nurb);
|
||||
void AddPrimitive (const G4Text&);
|
||||
void AddPrimitive (const G4Circle&);
|
||||
void AddPrimitive (const G4Square&);
|
||||
@@ -178,10 +177,14 @@ private:
|
||||
~Index3D(){;}
|
||||
G4bool operator < (const Index3D & _right) const;
|
||||
G4bool operator == (const Index3D & _right) const;
|
||||
private:
|
||||
// Private assigment operator -
|
||||
// assignment not allowed. Keeps Coverity happy.
|
||||
// Index3D& operator = (const Index3D&);
|
||||
};
|
||||
|
||||
std::map<Index3D, float> kNestedModality;
|
||||
std::map<Index3D, G4double> * fTempNestedHits;
|
||||
//std::map<Index3D, G4double> * fTempNestedHits;
|
||||
std::map<G4String, std::map<Index3D, G4double> > kNestedHitsList;
|
||||
//std::map<G4String, G4String> kNestedHitsUnit;
|
||||
|
||||
@@ -200,7 +203,7 @@ private:
|
||||
G4int kFlagParameterization; // 0: G4VNestedParameterisation based geometry
|
||||
// 1: G4PhantomParameterisation
|
||||
// 2: interactive scorer
|
||||
G4bool kFLagProcessedInteractiveScorer;
|
||||
G4bool kFlagProcessedInteractiveScorer;
|
||||
|
||||
char kGddDestDir[256];
|
||||
char kGddFileName[256];
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenFileViewer.hh 68043 2013-03-13 14:27:49Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Mar. 31, 2009 Akinori Kimura : release for the gMocrenFile driver
|
||||
@@ -60,7 +60,6 @@ public:
|
||||
|
||||
private:
|
||||
G4GMocrenFileSceneHandler& kSceneHandler; // Reference to Graphics Scene for this view.
|
||||
G4GMocrenMessenger & kMessenger;
|
||||
|
||||
char kG4GddViewer[32] ;
|
||||
char kG4GddViewerInvocation[64] ;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenMessenger.hh 68043 2013-03-13 14:27:49Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Mar. 31, 2009 Akinori Kimura
|
||||
@@ -81,7 +81,6 @@ private:
|
||||
G4UIcmdWithABool* useSolidsCommand;
|
||||
|
||||
G4bool invisibles;
|
||||
G4UIcmdWithABool* writeInvisiblesCommand;
|
||||
|
||||
G4String kgMocrenVolumeName;
|
||||
G4UIcmdWithAString* kSetgMocrenVolumeNameCommand;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenTouchable.hh 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Mar. 31, 2009 Akinori Kimura
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake,v 1.1 2010-09-29 19:14:41 bmorgan Exp $
|
||||
# $Id: sources.cmake 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenFile.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// GMocrenFile factory.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenFileSceneHandler.cc 71551 2013-06-18 07:27:24Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Mar. 31, 2009 Akinori Kimura
|
||||
@@ -128,25 +128,29 @@ G4GMocrenFileSceneHandler::G4GMocrenFileSceneHandler(G4GMocrenFile& system,
|
||||
kFlagInModeling(false),
|
||||
kFlagSaving_g4_gdd(false),
|
||||
kFlagParameterization(0),
|
||||
kFLagProcessedInteractiveScorer(false) {
|
||||
kFlagProcessedInteractiveScorer(false) {
|
||||
|
||||
// g4.gdd filename and its directory
|
||||
if(getenv("G4GMocrenFile_DEST_DIR") == NULL) {
|
||||
if(std::getenv("G4GMocrenFile_DEST_DIR") == NULL) {
|
||||
kGddDestDir[0] = '\0';
|
||||
//std::strcpy(kGddDestDir , ""); // output dir
|
||||
//std::strcpy(kGddFileName, DEFAULT_GDD_FILE_NAME); // filename
|
||||
std::strncpy(kGddFileName, DEFAULT_GDD_FILE_NAME, std::strlen(DEFAULT_GDD_FILE_NAME)); // filename
|
||||
std::strncpy(kGddFileName, DEFAULT_GDD_FILE_NAME,
|
||||
std::strlen(DEFAULT_GDD_FILE_NAME)); // filename
|
||||
} else {
|
||||
const char * env = getenv("G4GMocrenFile_DEST_DIR");
|
||||
std::strncpy(kGddDestDir, env, std::strlen(env)); // output dir
|
||||
std::strncpy(kGddFileName, DEFAULT_GDD_FILE_NAME, std::strlen(DEFAULT_GDD_FILE_NAME)); // filename
|
||||
const char * env = std::getenv("G4GMocrenFile_DEST_DIR");
|
||||
std::strncpy(kGddDestDir, env, std::strlen(env)); // output dir
|
||||
std::strncpy(kGddFileName, DEFAULT_GDD_FILE_NAME,
|
||||
std::strlen(DEFAULT_GDD_FILE_NAME)); // filename
|
||||
}
|
||||
|
||||
// maximum number of g4.gdd files in the dest directory
|
||||
kMaxFileNum = FR_MAX_FILE_NUM ; // initialization
|
||||
if ( std::getenv( "G4GMocrenFile_MAX_FILE_NUM" ) != NULL ) {
|
||||
|
||||
std::sscanf( getenv("G4GMocrenFile_MAX_FILE_NUM"), "%d", &kMaxFileNum ) ;
|
||||
char * pcFileNum = getenv("G4GMocrenFile_MAX_FILE_NUM");
|
||||
char c10FileNum[10];
|
||||
std::strncpy(c10FileNum, pcFileNum, 10);
|
||||
kMaxFileNum = std::atoi(c10FileNum);
|
||||
|
||||
} else {
|
||||
kMaxFileNum = FR_MAX_FILE_NUM ;
|
||||
@@ -169,6 +173,8 @@ G4GMocrenFileSceneHandler::~G4GMocrenFileSceneHandler ()
|
||||
// close g4.gdd
|
||||
GFEndModeling();
|
||||
}
|
||||
if(kgMocrenIO != NULL) delete kgMocrenIO;
|
||||
|
||||
}
|
||||
|
||||
//----- initialize all parameters
|
||||
@@ -226,7 +232,8 @@ void G4GMocrenFileSceneHandler::SetGddFileName()
|
||||
// check validity of the file name
|
||||
std::ifstream fin(kGddFileName);
|
||||
if(GFDEBUG)
|
||||
G4cout << "FILEOPEN: " << i << " : " << kGddFileName << fin.fail() << G4endl;
|
||||
G4cout << "FILEOPEN: " << i << " : " << kGddFileName << fin.fail()
|
||||
<< G4endl;
|
||||
if(!fin) {
|
||||
// new file
|
||||
fin.close();
|
||||
@@ -613,20 +620,6 @@ void G4GMocrenFileSceneHandler::AddPrimitive (const G4Polyline& polyline)
|
||||
} // G4GMocrenFileSceneHandler::AddPrimitive (polyline)
|
||||
|
||||
|
||||
//----- Add nurbes
|
||||
void G4GMocrenFileSceneHandler::AddPrimitive (const G4NURBS&)
|
||||
{
|
||||
//-----
|
||||
if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "***** AddPrimitive( G4NURBS )" << G4endl;
|
||||
|
||||
//----- Initialize if necessary
|
||||
GFBeginModeling();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----- Add text
|
||||
void G4GMocrenFileSceneHandler::AddPrimitive ( const G4Text& text )
|
||||
{
|
||||
@@ -1243,7 +1236,7 @@ void G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )
|
||||
|
||||
|
||||
// processing geometry construction based on the interactive PS
|
||||
if(!kFLagProcessedInteractiveScorer) {
|
||||
if(!kFlagProcessedInteractiveScorer) {
|
||||
|
||||
|
||||
// get the dimension of the geometry defined in G4VScoringMesh
|
||||
@@ -1339,7 +1332,7 @@ void G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )
|
||||
|
||||
|
||||
//
|
||||
kFLagProcessedInteractiveScorer = true;
|
||||
kFlagProcessedInteractiveScorer = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1569,7 +1562,7 @@ void G4GMocrenFileSceneHandler::AddCompound(const G4VTrajectory & traj) {
|
||||
("G4VSceneHandler::AddCompound(const G4VTrajectory&)",
|
||||
"gMocren0013", FatalException, "Not a G4TrajectoriesModel.");
|
||||
} else {
|
||||
traj.DrawTrajectory(pTrModel->GetDrawingMode());
|
||||
traj.DrawTrajectory();
|
||||
|
||||
const G4VTrajectory * trj = pTrModel->GetCurrentTrajectory();
|
||||
G4cout << "------ track" << G4endl;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenFileViewer.cc 70733 2013-06-05 10:05:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Mar. 31, 2009 Akinori Kimura
|
||||
@@ -59,14 +59,13 @@ const bool GFDEBUG = false;
|
||||
|
||||
//----- G4GMocrenFileViewer, constructor
|
||||
G4GMocrenFileViewer::G4GMocrenFileViewer (G4GMocrenFileSceneHandler& sceneHandler,
|
||||
G4GMocrenMessenger & messenger,
|
||||
G4GMocrenMessenger &,
|
||||
const G4String& name)
|
||||
: G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
|
||||
kSceneHandler (sceneHandler),
|
||||
kMessenger(messenger)
|
||||
kSceneHandler (sceneHandler)
|
||||
{
|
||||
// Set a g4.gdd-file viewer
|
||||
std::strncpy( kG4GddViewer, "gMocren", 7);
|
||||
std::strncpy( kG4GddViewer, "gMocren", 8);
|
||||
if( getenv( "G4GMocrenFile_VIEWER" ) != NULL ) {
|
||||
char * env = getenv( "G4GMocrenFile_VIEWER" );
|
||||
std::strncpy( kG4GddViewer, env, std::strlen(env));
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenIO.cc 75179 2013-10-29 10:09:31Z gcosmo $
|
||||
//
|
||||
//
|
||||
// File I/O manager class for writing or reading calcuated dose
|
||||
@@ -72,6 +72,7 @@ GMocrenDataPrimitive<T>::~GMocrenDataPrimitive () {
|
||||
|
||||
template <typename T> GMocrenDataPrimitive<T> &
|
||||
GMocrenDataPrimitive<T>::operator = (const GMocrenDataPrimitive<T> & _right) {
|
||||
if (this == &_right) return *this;
|
||||
for(int i = 0; i < 3; i++) {
|
||||
kSize[i] = _right.kSize[i];
|
||||
kCenter[i] = _right.kCenter[i];
|
||||
@@ -471,7 +472,7 @@ bool G4GMocrenIO::storeData4() {
|
||||
std::ofstream ofile(kFileName.c_str(),
|
||||
std::ios_base::out|std::ios_base::binary);
|
||||
if(DEBUG || kVerbose > 0)
|
||||
G4cout << " file open status: " << ofile << G4endl;
|
||||
G4cout << " file open status: " << ofile.rdbuf() << G4endl;
|
||||
|
||||
// file identifier
|
||||
ofile.write("gMocren ", 8);
|
||||
@@ -739,7 +740,7 @@ bool G4GMocrenIO::storeData4() {
|
||||
for(int i = 0; i < 13; i++) cdunit[i] = '\0';
|
||||
const char * cu = kDoseUnit.c_str();
|
||||
size_t lcu = std::strlen(cu);
|
||||
if(lcu > 1024) lcu = 1024;
|
||||
if(lcu > 12) lcu = 12;
|
||||
std::strncpy(cdunit, cu, lcu);
|
||||
ofile.write((char *)cdunit, 12);
|
||||
if(DEBUG || kVerbose > 0) {
|
||||
@@ -1632,7 +1633,10 @@ bool G4GMocrenIO::retrieveData() {
|
||||
<< G4endl;
|
||||
G4cout << " " << kFileName << G4endl;
|
||||
}
|
||||
std::exit(-1);
|
||||
G4Exception("G4GMocrenIO::retrieveDadta()",
|
||||
"gMocren2001", FatalException,
|
||||
"Error.");
|
||||
|
||||
}
|
||||
} else if(std::strncmp(verid, "GRAPE", 5) == 0) {
|
||||
G4cout << ">>>>>>> retrieve data (ver.2) <<<<<<<" << G4endl;
|
||||
@@ -3584,7 +3588,10 @@ void G4GMocrenIO::getShortDoseDist(short * _data, int _z, int _num) {
|
||||
<< "first argument is NULL pointer. "
|
||||
<< "The argument must be allocated array."
|
||||
<< G4endl;
|
||||
std::exit(-1);
|
||||
G4Exception("G4GMocrenIO::getShortDoseDist()",
|
||||
"gMocren2002", FatalException,
|
||||
"Error.");
|
||||
return;
|
||||
}
|
||||
|
||||
int size[3];
|
||||
@@ -3913,7 +3920,9 @@ void G4GMocrenIO::getTrack(int _num, std::vector<float *> & _steps,
|
||||
if(_num > (int)kTracks.size()) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cout << "ERROR in getTrack() : " << G4endl;
|
||||
std::exit(-1);
|
||||
G4Exception("G4GMocrenIO::getTrack()",
|
||||
"gMocren2003", FatalException,
|
||||
"Error.");
|
||||
}
|
||||
unsigned char * color = new unsigned char[3];
|
||||
kTracks[_num].getColor(color);
|
||||
@@ -3973,7 +3982,10 @@ void G4GMocrenIO::getDetector(int _num, std::vector<float *> & _edges,
|
||||
if(_num > (int)kDetectors.size()) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cout << "ERROR in getDetector() : " << G4endl;
|
||||
std::exit(-1);
|
||||
|
||||
G4Exception("G4GMocrenIO::getDetector()",
|
||||
"gMocren2004", FatalException,
|
||||
"Error.");
|
||||
}
|
||||
|
||||
_detName = kDetectors[_num].getName();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GMocrenMessenger.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Created: Mar. 31, 2009 Akinori Kimura
|
||||
|
||||
Reference in New Issue
Block a user