78 fFlagDestOpen( false )
81 strcpy(fVRMLFileName,
"");
84 strcpy( fVRMLFileDestDir,
"" );
91 if ( getenv(
"G4VRMLFILE_MAX_FILE_NUM" ) != NULL ) {
93 sscanf( getenv(
"G4VRMLFILE_MAX_FILE_NUM"),
"%d", &fMaxFileNum ) ;
98 if( fMaxFileNum < 1 ) { fMaxFileNum = 1; }
105#if defined DEBUG_FR_SCENE
113#define G4VRML1SCENEHANDLER G4VRML1FileSceneHandler
114#define IS_CONNECTED this->isConnected()
115#include "G4VRML1SceneHandlerFunc.icc"
117#undef G4VRML1SCENEHANDLER
123 const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
126 strcpy ( fVRMLFileName, fVRMLFileDestDir) ;
132 for(
int i = 0 ; i < fMaxFileNum ; i++) {
135 if( i == MAX_FILE_INDEX )
138 G4cout <<
"===========================================" <<
G4endl;
139 G4cout <<
"WARNING MESSAGE from VRML1FILE driver: " <<
G4endl;
140 G4cout <<
" This file name is the final one in the " <<
G4endl;
141 G4cout <<
" automatic updation of the output file name." <<
G4endl;
142 G4cout <<
" You may overwrite existing files, i.e. " <<
G4endl;
144 G4cout <<
"===========================================" <<
G4endl;
149 if( i >= 0 && i <= 9 ) {
150 sprintf( fVRMLFileName,
"%s%s%s%d.wrl" , fVRMLFileDestDir,
WRL_FILE_HEADER,
"0", i );
152 sprintf( fVRMLFileName,
"%s%s%d.wrl" , fVRMLFileDestDir,
WRL_FILE_HEADER, i );
157 fin.open(fVRMLFileName) ;
172 G4cout <<
"===========================================" <<
G4endl;
173 G4cout <<
"Output VRML 1.0 file: " << fVRMLFileName <<
G4endl;
174 G4cout <<
"Maximum number of files in the destination directory: " << fMaxFileNum <<
G4endl;
175 G4cout <<
" (Customizable with the environment variable: G4VRMLFILE_MAX_FILE_NUM) " <<
G4endl;
176 G4cout <<
"===========================================" <<
G4endl;
178 fDest.open(fVRMLFileName) ; fFlagDestOpen = true ;
192 fDest.close(); fFlagDestOpen = false ;
194 G4cout <<
"*** VRML 1.0 File " << fVRMLFileName <<
" is generated." <<
G4endl;
202 G4cout <<
" Set an environmental variable " ;
204 G4cout <<
" if you want to visualize the generated VRML file" <<
G4endl;
209 sprintf( command,
"%s %s", viewer, fVRMLFileName );
210 (void) system( command );
214G4int G4VRML1FileSceneHandler::fSceneIdCount = 0;
const int DEFAULT_MAX_WRL_FILE_NUM
const char DEFAULT_WRL_FILE_NAME[]
const char WRL_FILE_HEADER[]
const char VRMLFILE_DEST_DIR[]
const char NO_VRML_VIEWER[]
const char ENV_VRML_VIEWER[]
G4DLLIMPORT std::ostream G4cout
virtual ~G4VRML1FileSceneHandler()
G4VRML1FileSceneHandler(G4VRML1File &system, const G4String &name="")
static Verbosity GetVerbosity()