76 fFlagDestOpen( false ),
77 fPVPickable ( false ),
81 strcpy(fVRMLFileName,
"");
85 strcpy( fVRMLFileDestDir,
"" );
93 if ( getenv(
"G4VRMLFILE_MAX_FILE_NUM" ) != NULL ) {
95 sscanf( getenv(
"G4VRMLFILE_MAX_FILE_NUM"),
"%d", &fMaxFileNum ) ;
100 if( fMaxFileNum < 1 ) { fMaxFileNum = 1; }
104 if( getenv(
"G4VRML_PV_PICKABLE" ) != NULL ) {
107 sscanf( getenv(
"G4VRML_PV_PICKABLE"),
"%d", &is_pickable ) ;
109 if ( is_pickable ) { SetPVPickability (
true ) ; }
113 SetPVTransparency ();
120#if defined DEBUG_FR_SCENE
128#define G4VRML2SCENEHANDLER G4VRML2FileSceneHandler
129#define IS_CONNECTED this->isConnected()
130#include "G4VRML2SceneHandlerFunc.icc"
132#undef G4VRML2SCENEHANDLER
138 const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
141 strcpy ( fVRMLFileName, fVRMLFileDestDir) ;
147 for(
int i = 0 ; i < fMaxFileNum ; i++) {
150 if( i == MAX_FILE_INDEX )
153 G4cout <<
"===========================================" <<
G4endl;
154 G4cout <<
"WARNING MESSAGE from VRML2FILE driver: " <<
G4endl;
155 G4cout <<
" This file name is the final one in the " <<
G4endl;
156 G4cout <<
" automatic updation of the output file name." <<
G4endl;
157 G4cout <<
" You may overwrite existing files, i.e. " <<
G4endl;
159 G4cout <<
"===========================================" <<
G4endl;
164 if( i >= 0 && i <= 9 ) {
165 sprintf( fVRMLFileName,
"%s%s%s%d.wrl" , fVRMLFileDestDir,
WRL_FILE_HEADER,
"0", i );
167 sprintf( fVRMLFileName,
"%s%s%d.wrl" , fVRMLFileDestDir,
WRL_FILE_HEADER, i );
172 fin.open(fVRMLFileName) ;
186 G4cout <<
"===========================================" <<
G4endl;
187 G4cout <<
"Output VRML 2.0 file: " << fVRMLFileName <<
G4endl;
188 G4cout <<
"Maximum number of files in the destination directory: " << fMaxFileNum <<
G4endl;
189 G4cout <<
" (Customizable with the environment variable: G4VRMLFILE_MAX_FILE_NUM) " <<
G4endl;
190 G4cout <<
"===========================================" <<
G4endl;
192 fDest.open(fVRMLFileName) ; fFlagDestOpen = true ;
206 fDest.close(); fFlagDestOpen = false ;
208 G4cout <<
"*** VRML 2.0 File " << fVRMLFileName <<
" is generated." <<
G4endl;
216 G4cout <<
" Set an environmental variable " ;
218 G4cout <<
" if you want to visualize the generated VRML file" <<
G4endl;
223 sprintf( command,
"%s %s", viewer, fVRMLFileName );
224 (void) system( command );
228G4int G4VRML2FileSceneHandler::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[]
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
G4VRML2FileSceneHandler(G4VRML2File &system, const G4String &name="")
virtual ~G4VRML2FileSceneHandler()
static Verbosity GetVerbosity()