90FRflag_in_modeling (false) ,
91flag_saving_g4_prim (false) ,
96 if ( std::getenv(
"G4DAWNFILE_DEST_DIR" ) == NULL ) {
97 strcpy( fG4PrimDestDir ,
"" ) ;
100 strcpy( fG4PrimDestDir , std::getenv(
"G4DAWNFILE_DEST_DIR" ) );
106 if ( std::getenv(
"G4DAWNFILE_MAX_FILE_NUM" ) != NULL ) {
108 sscanf( std::getenv(
"G4DAWNFILE_MAX_FILE_NUM"),
"%d", &fMaxFileNum ) ;
113 if( fMaxFileNum < 1 ) { fMaxFileNum = 1 ; }
117 if( std::getenv(
"G4DAWNFILE_PRECISION" ) != NULL ) {
118 sscanf( std::getenv(
"G4DAWNFILE_PRECISION"),
"%d", &fPrec ) ;
130#if defined DEBUG_FR_SCENE
147 const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
150 strcpy ( fG4PrimFileName, fG4PrimDestDir) ;
156 for(
int i = 0 ; i < fMaxFileNum ; i++) {
159 if( i == MAX_FILE_INDEX )
162 G4cout <<
"===========================================" <<
G4endl;
163 G4cout <<
"WARNING MESSAGE from DAWNFILE driver: " <<
G4endl;
164 G4cout <<
" This file name is the final one in the " <<
G4endl;
165 G4cout <<
" automatic updation of the output file name." <<
G4endl;
166 G4cout <<
" You may overwrite existing files, i.e. " <<
G4endl;
168 G4cout <<
"===========================================" <<
G4endl;
173 std::ostringstream filename; filename
175 << std::setw(4) << std::setfill(
'0') << i <<
".prim";
176 strncpy(fG4PrimFileName,filename.str().c_str(),
sizeof(fG4PrimFileName)-1);
177 fG4PrimFileName[
sizeof(fG4PrimFileName)-1] =
'\0';
181 fin.open(fG4PrimFileName) ;
193 G4cout <<
"=========================================== " <<
G4endl;
195 G4cout <<
"Destination directory (current dir if NULL): " << fG4PrimDestDir <<
G4endl;
196 G4cout <<
"Maximal number of files in the destination directory: " << fMaxFileNum <<
G4endl;
198 G4cout <<
" * The maximal number is customizable as: " <<
G4endl;
199 G4cout <<
" % setenv G4DAWNFILE_MAX_FILE_NUM number " <<
G4endl;
200 G4cout <<
" * The destination directory is customizable as:" <<
G4endl;
201 G4cout <<
" % setenv G4DAWNFILE_DEST_DIR dir_name/ " <<
G4endl;
202 G4cout <<
" ** Do not forget \"/\" at the end of the " <<
G4endl;
204 G4cout <<
"=========================================== " <<
G4endl;
212#if defined DEBUG_FR_SCENE
214 G4cout <<
"***** BeginSavingG4Prim (called)\n";
219#if defined DEBUG_FR_SCENE
221 G4cout <<
"***** (started) " ;
226 fPrimDest.
Open(fG4PrimFileName) ;
229 flag_saving_g4_prim = true ;
235#if defined DEBUG_FR_SCENE
237 G4cout <<
"***** EndSavingG4Prim (called)\n";
242#if defined DEBUG_FR_SCENE
247 flag_saving_g4_prim = false ;
257#if defined DEBUG_FR_SCENE
259 G4cout <<
"***** G4DAWNFILESceneHandler::FRBeginModeling (called & started)" <<
G4endl;
269#if defined DEBUG_FR_SCENE
271 G4cout <<
"***** (!SetCamera in FRBeginModeling())" <<
G4endl;
276#if defined DEBUG_FR_SCENE
278 G4cout <<
"***** (!OpenDevice in FRBeginModeling())" <<
G4endl;
283#if defined DEBUG_FR_SCENE
285 G4cout <<
"***** (!BeginModeling in FRBeginModeling())" <<
G4endl;
298#define G4FRSCENEHANDLER G4DAWNFILESceneHandler
299#include "G4FRSceneFunc.icc"
300#undef G4FRSCENEHANDLER
307G4int G4DAWNFILESceneHandler::fSceneIdCount = 0;
const int FR_MAX_FILE_NUM
const char DEFAULT_G4PRIM_FILE_NAME[]
const char FR_ENV_CULL_INVISIBLE_OBJECTS[]
const char G4PRIM_FILE_HEADER[]
const char FR_G4_PRIM_HEADER[]
const char FR_OPEN_DEVICE[]
const char FR_BEGIN_MODELING[]
const char FR_SET_CAMERA[]
G4GLOB_DLL std::ostream G4cout
void SendBoundingBox(void)
G4bool IsSavingG4Prim(void)
void SendStr(const char *char_string)
G4DAWNFILESceneHandler(G4DAWNFILE &system, const G4String &name="")
void EndSavingG4Prim(void)
virtual ~G4DAWNFILESceneHandler()
void BeginSavingG4Prim(void)
void Open(const char *filename)
static Verbosity GetVerbosity()