82 , FRflag_in_modeling(false)
83 , flag_saving_g4_prim(false)
89 if(std::getenv(
"G4DAWNFILE_DEST_DIR") == NULL)
91 strcpy(fG4PrimDestDir,
"");
96 strcpy(fG4PrimDestDir, std::getenv(
"G4DAWNFILE_DEST_DIR"));
102 if(std::getenv(
"G4DAWNFILE_MAX_FILE_NUM") != NULL)
104 sscanf(std::getenv(
"G4DAWNFILE_MAX_FILE_NUM"),
"%d", &fMaxFileNum);
116 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)
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;
176 << std::setfill(
'0') << i <<
".prim";
177 strncpy(fG4PrimFileName, filename.str().c_str(),
178 sizeof(fG4PrimFileName) - 1);
179 fG4PrimFileName[
sizeof(fG4PrimFileName) - 1] =
'\0';
183 fin.open(fG4PrimFileName);
198 G4cout <<
"=========================================== " <<
G4endl;
200 G4cout <<
"Destination directory (current dir if NULL): " << fG4PrimDestDir
202 G4cout <<
"Maximal number of files in the destination directory: "
205 G4cout <<
" * The maximal number is customizable as: " <<
G4endl;
206 G4cout <<
" % setenv G4DAWNFILE_MAX_FILE_NUM number " <<
G4endl;
207 G4cout <<
" * The destination directory is customizable as:" <<
G4endl;
208 G4cout <<
" % setenv G4DAWNFILE_DEST_DIR dir_name/ " <<
G4endl;
209 G4cout <<
" ** Do not forget \"/\" at the end of the " <<
G4endl;
211 G4cout <<
"=========================================== " <<
G4endl;
218#if defined DEBUG_FR_SCENE
220 G4cout <<
"***** BeginSavingG4Prim (called)\n";
225#if defined DEBUG_FR_SCENE
228 G4cout <<
"***** (started) ";
233 fPrimDest.
Open(fG4PrimFileName);
236 flag_saving_g4_prim =
true;
242#if defined DEBUG_FR_SCENE
244 G4cout <<
"***** EndSavingG4Prim (called)\n";
249#if defined DEBUG_FR_SCENE
254 flag_saving_g4_prim =
false;
263#if defined DEBUG_FR_SCENE
266 <<
"***** G4DAWNFILESceneHandler::FRBeginModeling (called & started)"
277#if defined DEBUG_FR_SCENE
279 G4cout <<
"***** (!SetCamera in FRBeginModeling())" <<
G4endl;
284#if defined DEBUG_FR_SCENE
286 G4cout <<
"***** (!OpenDevice in FRBeginModeling())" <<
G4endl;
291#if defined DEBUG_FR_SCENE
293 G4cout <<
"***** (!BeginModeling in FRBeginModeling())" <<
G4endl;
296 FRflag_in_modeling =
true;
305#define G4FRSCENEHANDLER G4DAWNFILESceneHandler
306#include "G4FRSceneFunc.icc"
307#undef G4FRSCENEHANDLER
314G4int 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()