91 FRflag_in_modeling (false) ,
92 flag_saving_g4_prim (false) ,
94 fPrec (9), fPrec2 (16)
97 if ( getenv(
"G4DAWNFILE_DEST_DIR" ) == NULL ) {
98 strcpy( fG4PrimDestDir ,
"" ) ;
101 strcpy( fG4PrimDestDir , getenv(
"G4DAWNFILE_DEST_DIR" ) );
107 if ( getenv(
"G4DAWNFILE_MAX_FILE_NUM" ) != NULL ) {
109 sscanf( getenv(
"G4DAWNFILE_MAX_FILE_NUM"),
"%d", &fMaxFileNum ) ;
114 if( fMaxFileNum < 1 ) { fMaxFileNum = 1 ; }
118 if( getenv(
"G4DAWNFILE_PRECISION" ) != NULL ) {
119 sscanf( getenv(
"G4DAWNFILE_PRECISION"),
"%d", &fPrec ) ;
131 #if defined DEBUG_FR_SCENE
148 const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
151 strcpy ( fG4PrimFileName, fG4PrimDestDir) ;
157 for(
int i = 0 ; i < fMaxFileNum ; i++) {
160 if( i == MAX_FILE_INDEX )
163 G4cout <<
"===========================================" <<
G4endl;
164 G4cout <<
"WARNING MESSAGE from DAWNFILE driver: " <<
G4endl;
165 G4cout <<
" This file name is the final one in the " <<
G4endl;
166 G4cout <<
" automatic updation of the output file name." <<
G4endl;
167 G4cout <<
" You may overwrite existing files, i.e. " <<
G4endl;
169 G4cout <<
"===========================================" <<
G4endl;
174 std::ostringstream filename; filename
176 << std::setw(4) << std::setfill(
'0') << i <<
".prim";
177 strncpy(fG4PrimFileName,filename.str().c_str(),
sizeof(fG4PrimFileName));
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
307 G4int G4DAWNFILESceneHandler::fSceneIdCount = 0;
void SendStr(const char *char_string)
virtual ~G4DAWNFILESceneHandler()
G4DAWNFILESceneHandler(G4DAWNFILE &system, const G4String &name="")
G4bool IsSavingG4Prim(void)
const char FR_BEGIN_MODELING[]
const char G4PRIM_FILE_HEADER[]
void Open(const char *filename)
const char FR_G4_PRIM_HEADER[]
void EndSavingG4Prim(void)
G4GLOB_DLL std::ostream G4cout
void BeginSavingG4Prim(void)
const int FR_MAX_FILE_NUM
const char FR_OPEN_DEVICE[]
const char DEFAULT_G4PRIM_FILE_NAME[]
const char FR_SET_CAMERA[]
static Verbosity GetVerbosity()
const char FR_ENV_CULL_INVISIBLE_OBJECTS[]
void SendBoundingBox(void)