Import Geant4 10.4.0.beta source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VRML1FileSceneHandler.cc 66870 2013-01-14 23:38:59Z adotti $
|
||||
// $Id: G4VRML1FileSceneHandler.cc 104289 2017-05-23 13:24:09Z gcosmo $
|
||||
//
|
||||
// G4VRML1FileSceneHandler.cc
|
||||
// Satoshi Tanaka & Yasuhide Sawada
|
||||
@@ -36,6 +36,8 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VisManager.hh"
|
||||
@@ -146,14 +148,14 @@ void G4VRML1FileSceneHandler::connectPort()
|
||||
}
|
||||
|
||||
// re-determine file name as G4VRMLFILE_DEST_DIR/g4_XX.wrl
|
||||
if( i >= 0 && i <= 9 ) {
|
||||
sprintf( fVRMLFileName, "%s%s%s%d.wrl" , fVRMLFileDestDir, WRL_FILE_HEADER, "0", i );
|
||||
} else {
|
||||
sprintf( fVRMLFileName, "%s%s%d.wrl" , fVRMLFileDestDir, WRL_FILE_HEADER, i );
|
||||
}
|
||||
std::ostringstream filename;
|
||||
filename
|
||||
<< fVRMLFileDestDir << WRL_FILE_HEADER
|
||||
<< std::setw(2) << std::setfill('0') << i << ".wrl";
|
||||
strncpy(fVRMLFileName,filename.str().c_str(),sizeof(fVRMLFileName));
|
||||
|
||||
// check validity of the file name
|
||||
std::ifstream fin ;
|
||||
std::ifstream fin ;
|
||||
fin.open(fVRMLFileName) ;
|
||||
if(!fin) {
|
||||
// new file
|
||||
@@ -206,7 +208,9 @@ void G4VRML1FileSceneHandler::closePort()
|
||||
G4cout << " setenv " << ENV_VRML_VIEWER << " vrweb " << G4endl;
|
||||
}
|
||||
} else {
|
||||
sprintf( command, "%s %s", viewer, fVRMLFileName );
|
||||
std::ostringstream ossCommand;
|
||||
ossCommand << viewer << ' ' << fVRMLFileName;
|
||||
strncpy(command,ossCommand.str().c_str(),sizeof(command));
|
||||
(void) system( command );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user