Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 1999/04/15 15:27:55 johna Exp $
# $Id: GNUmakefile,v 1.3 2000/04/07 13:32:40 gcosmo Exp $
name := G4FR
@@ -17,6 +17,7 @@ CPPFLAGS += -I$(G4BASE)/graphics_reps/include
CPPFLAGS += -I$(G4BASE)/intercoms/include
CPPFLAGS += -I$(G4BASE)/global/HEPGeometry/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/CSG/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/specific/include
CPPFLAGS += -I$(G4BASE)/geometry/management/include
CPPFLAGS += -I$(G4BASE)/geometry/volumes/include
@@ -1,3 +1,18 @@
DAWN-V01-01-04
- Target = standard target in scene
+ relative target in view
(G4DAWNFILEView.cc, G4FukuiRendererView.cc)
- Automatic filename incrementation is made default.
g4_00.prim, g4_01.prim, ... , g4_99.prim
g4_00.eps , g4_01.eps , ... , g4_99.eps
DAWN-V01-01-03 Satoshi TANAKA May 11, 2000
- In G4DAWNFILEViewer.cc,
< strcpy( fPSViewer, "ghostview" );
---
> // strcpy( fPSViewer, "ghostview" );
> strcpy( fPSViewer, "gv" );
DAWN-V00-01-08
- Removed implicit casting from the previous updation
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DAWNFILE.hh,v 1.5 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE driver factory.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DAWNFILESceneHandler.hh,v 1.5 1999/12/16 17:24:48 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DAWNFILEViewer.hh,v 1.5 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE viewer - opens window, hard copy, etc.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FRClientServer.hh,v 1.3 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4FRClientServer.hh,v 1.4 2000/02/29 09:54:38 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA, Wed Jul 3 14:13:52 JST 1996
////////////////////////////////
@@ -59,7 +59,7 @@ class G4FRClientServer {
protected:
void Err( char* message ) { perror(message) ;}
void Err( const char* message ) { perror(message) ;}
void SetSendingMessage( const char* message )
{ strcpy( fSendingMessage, message );}
void Send() ; // send command in fSendingMessage
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRConst.hh,v 1.4 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA, Tue Jul 2 15:30:49 JST 1996
///////////////////////////////////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRFeatures.hh,v 1.3 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
#if !defined G4_FR_FEATURES_HH
#define G4_FR_FEATURES_HH
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRSocketConfig.hh,v 1.3 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
////////////////////////////////
///// G4FRSocketConfig.h /////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRSocketMacro.hh,v 1.3 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
///////////////////////////////
///// G4FRSocketMacro.hh /////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRofstream.hh,v 1.3 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
#include"g4std/fstream"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FukuiRenderer.hh,v 1.5 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FukuiRendererSceneHandler.hh,v 1.5 1999/12/16 17:24:49 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 11:19:19 JST 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FukuiRendererViewer.hh,v 1.5 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 12:10:14 JST 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DAWNFILE.cc,v 1.5 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE factory.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DAWNFILESceneHandler.cc,v 1.3 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DAWNFILESceneHandler.cc,v 1.5 2000/05/16 15:56:43 stanaka Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE scene.
@@ -32,6 +32,7 @@
#include "G4DAWNFILEViewer.hh"
#include "G4Point3D.hh"
#include "G4VisAttributes.hh"
#include "G4Scene.hh"
#include "G4Transform3D.hh"
#include "G4Polyhedron.hh"
#include "G4Box.hh"
@@ -39,6 +40,10 @@
#include "G4Polyline.hh"
#include "G4Trd.hh"
#include "G4Tubs.hh"
#include "G4Trap.hh"
#include "G4Torus.hh"
#include "G4Sphere.hh"
#include "G4Para.hh"
#include "G4Text.hh"
#include "G4Circle.hh"
#include "G4Square.hh"
@@ -48,7 +53,14 @@
//----- constants
const char FR_ENV_CULL_INVISIBLE_OBJECTS [] = "G4DAWN_CULL_INVISIBLE_OBJECTS";
const char G4PRIM_FILE_HEADER [] = "g4_";
const char DEFAULT_G4PRIM_FILE_NAME[] = "g4.prim";
const char DEFAULT_G4PRIM_FILE_NAME[] = "g4_00.prim";
// const int FR_MAX_FILE_NUM = 1 ;
// const int FR_MAX_FILE_NUM = 5 ;
// const int FR_MAX_FILE_NUM = 10 ;
// const int FR_MAX_FILE_NUM = 15 ;
// const int FR_MAX_FILE_NUM = 20 ;
const int FR_MAX_FILE_NUM = 99 ;
///////////////////////////
@@ -70,21 +82,21 @@ COMMAND_BUF_SIZE (G4FRofstream::SEND_BUFMAX)
// g4.prim filename and its directory
if ( getenv( "G4DAWNFILE_DEST_DIR" ) == NULL ) {
strcpy( fG4PrimDestDir , "" );
strcpy( fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME );
strcpy( fG4PrimDestDir , "" ) ; // output dir
strcpy( fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME ); // filename
} else {
strcpy( fG4PrimDestDir , getenv( "G4DAWNFILE_DEST_DIR" ) );
strcpy( fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME );
strcpy( fG4PrimDestDir , getenv( "G4DAWNFILE_DEST_DIR" ) ); // output dir
strcpy( fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME ); // filename
}
// maximum number of g4.prim files in the dest directory
fMaxFileNum = 1 ; // initialization
fMaxFileNum = FR_MAX_FILE_NUM ; // initialization
if ( getenv( "G4DAWNFILE_MAX_FILE_NUM" ) != NULL ) {
sscanf( getenv("G4DAWNFILE_MAX_FILE_NUM"), "%d", &fMaxFileNum ) ;
} else {
fMaxFileNum = 1 ;
fMaxFileNum = FR_MAX_FILE_NUM ;
}
if( fMaxFileNum < 1 ) { fMaxFileNum = 1 ; }
@@ -105,7 +117,7 @@ G4DAWNFILESceneHandler::~G4DAWNFILESceneHandler ()
//-----
void G4DAWNFILESceneHandler::SetG4PrimFileName()
{
// g4.prim, g4_1.prim, ..., g4_MAX_FILE_INDEX.prim
// g4_00.prim, g4_01.prim, ..., g4_MAX_FILE_INDEX.prim
const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
// dest directory (null if no environmental variables is set)
@@ -117,19 +129,22 @@ void G4DAWNFILESceneHandler::SetG4PrimFileName()
// Automatic updation of file names
for( int i = 0 ; i < fMaxFileNum ; i++) {
// Message
if( fMaxFileNum > 1 && i == MAX_FILE_INDEX ) {
// Message in the final execution
if( i == MAX_FILE_INDEX )
{
G4cerr << "===========================================" << G4endl;
G4cerr << "WARNING MESSAGE from DAWNFILE driver: " << G4endl;
G4cerr << " This file name is the final one in the " << G4endl;
G4cerr << " automatic updation of the output file name." << G4endl;
G4cerr << " You may overwrite an existing file of " << G4endl;
G4cerr << " the same name. " << G4endl;
G4cerr << " You may overwrite existing files, i.e. " << G4endl;
G4cerr << " g4_XX.prim and g4_XX.eps " << G4endl;
G4cerr << "===========================================" << G4endl;
}
// re-determine file to G4DAWNFILE_DEST_DIR/g4_i.prim for i>0
if( i > 0 ) {
// re-determine file name as G4DAWNFILE_DEST_DIR/g4_XX.prim
if( i >= 0 && i <= 9 ) {
sprintf( fG4PrimFileName, "%s%s%s%d.prim" , fG4PrimDestDir, G4PRIM_FILE_HEADER, "0", i );
} else {
sprintf( fG4PrimFileName, "%s%s%d.prim" , fG4PrimDestDir, G4PRIM_FILE_HEADER, i );
}
@@ -138,7 +153,7 @@ void G4DAWNFILESceneHandler::SetG4PrimFileName()
fin.open(fG4PrimFileName) ;
if(!fin) {
// new file
fin.close(); // error recovery
fin.close();
break;
} else {
// already exists (try next)
@@ -147,11 +162,18 @@ void G4DAWNFILESceneHandler::SetG4PrimFileName()
} // for
G4cerr << "===========================================" << G4endl;
G4cerr << "Output file: " << fG4PrimFileName << G4endl;
G4cerr << "Muximal number of file in the destination directory: " << fMaxFileNum << G4endl;
G4cerr << " (Customizable as: setenv G4DAWNFILE_MAX_FILE_NUM number) " << G4endl;
G4cerr << "===========================================" << G4endl;
G4cerr << "=========================================== " << G4endl;
G4cerr << "Output file: " << fG4PrimFileName << G4endl;
G4cerr << "Destination directory (current dir if NULL): " << fG4PrimDestDir << G4endl;
G4cerr << "Maximal number of files in the destination directory: " << fMaxFileNum << G4endl;
G4cerr << "Note: " << G4endl;
G4cerr << " * The maximal number is customizable as: " << G4endl;
G4cerr << " % setenv G4DAWNFILE_MAX_FILE_NUM number " << G4endl;
G4cerr << " * The destination directory is customizable as:" << G4endl;
G4cerr << " % setenv G4DAWNFILE_DEST_DIR dir_name/ " << G4endl;
G4cerr << " ** Do not forget \"/\" at the end of the " << G4endl;
G4cerr << " dir_name, e.g. \"./tmp/\". " << G4endl;
G4cerr << "=========================================== " << G4endl;
} // G4DAWNFILESceneHandler::SetG4PrimFileName()
@@ -169,7 +191,7 @@ void G4DAWNFILESceneHandler::BeginSavingG4Prim( void )
G4cerr << "***** (started) " ;
G4cerr << "(open g4.prim, ##)" << G4endl;
#endif
SetG4PrimFileName() ; // returned to fG4PrimFileName
SetG4PrimFileName() ; // result set to fG4PrimFileName
fPrimDest.Open(fG4PrimFileName) ;
SendStr( FR_G4_PRIM_HEADER ) ;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DAWNFILEViewer.cc,v 1.6 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DAWNFILEViewer.cc,v 1.9 2000/05/15 07:48:27 stanaka Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE view - opens window, hard copy, etc.
@@ -66,7 +66,8 @@ G4DAWNFILEViewer::G4DAWNFILEViewer (G4DAWNFILESceneHandler& scene,
}
// Set a PostScript Viewer
strcpy( fPSViewer, "ghostview" );
// strcpy( fPSViewer, "ghostview" );
strcpy( fPSViewer, "gv" );
if( getenv( "G4DAWNFILE_PS_VIEWER" ) != NULL ) {
strcpy( fPSViewer, getenv( "G4DAWNFILE_PS_VIEWER" ) ) ;
}
@@ -148,6 +149,7 @@ void G4DAWNFILEViewer::ShowView( void )
//----- Invoke DAWN
G4cout << G4endl ;
if( false == G4FRofstream::DoesFileExist( fSceneHandler.GetG4PrimFileName() ) )
{
G4cout << "ERROR: Failed to generate file ";
@@ -268,7 +270,9 @@ void G4DAWNFILEViewer::SendViewParameters ()
gui_out << "0" << G4endl ; // auto target
//----- target point
const G4Point3D& target_point = fVP.GetCurrentTargetPoint();
const G4Point3D& target_point
= fSceneHandler.GetScene()->GetStandardTargetPoint()
+ fVP.GetCurrentTargetPoint();
gui_out << target_point.x() << G4endl ;
gui_out << target_point.y() << G4endl ;
gui_out << target_point.z() << G4endl ;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRClientServer.cc,v 1.3 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA, Wed Jul 3 14:14:29 JST 1996
////////////////////////////////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRSceneFunc.icc,v 1.10 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FukuiRenderer.cc,v 1.4 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FukuiRendererSceneHandler.cc,v 1.3 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4FukuiRendererSceneHandler.cc,v 1.4 2000/04/12 13:08:22 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 11:34:24 JST 1996
@@ -33,6 +33,7 @@
#include "G4FukuiRendererViewer.hh"
#include "G4Point3D.hh"
#include "G4VisAttributes.hh"
#include "G4Scene.hh"
#include "G4Transform3D.hh"
#include "G4Polyhedron.hh"
#include "G4Box.hh"
@@ -40,6 +41,10 @@
#include "G4Polyline.hh"
#include "G4Trd.hh"
#include "G4Tubs.hh"
#include "G4Trap.hh"
#include "G4Torus.hh"
#include "G4Sphere.hh"
#include "G4Para.hh"
#include "G4Text.hh"
#include "G4Circle.hh"
#include "G4Square.hh"
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FukuiRendererViewer.cc,v 1.4 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4FukuiRendererViewer.cc,v 1.5 2000/05/13 10:57:51 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 12:09:11 JST 1996
@@ -224,7 +224,9 @@ void G4FukuiRendererViewer::SendViewParameters ()
h_angle );
//----- (4A) CALC target point
const G4Point3D& target_point = fVP.GetCurrentTargetPoint();
const G4Point3D& target_point
= fSceneHandler.GetScene()->GetStandardTargetPoint()
+ fVP.GetCurrentTargetPoint();
//----- (4B) SEND target point
fSceneHandler.SendStrDouble3( FR_TARGET_POINT,