63 :
G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
64 kSceneHandler (sceneHandler)
65{
66
67 std::strncpy( kG4GddViewer, "gMocren", 8);
68 if( std::getenv( "G4GMocrenFile_VIEWER" ) != NULL ) {
69 char * env = std::getenv( "G4GMocrenFile_VIEWER" );
71 if(len >= 32) {
72 G4Exception(
"G4GMocrenFileViewer::G4GMocrenFileViewer(*)",
74 "Invalid length of string set in G4GMocrenFile_VIEWER");
75 }
76 std::strncpy( kG4GddViewer, env, sizeof(kG4GddViewer) - 1);
77 kG4GddViewer[sizeof(kG4GddViewer) - 1] = '\0';
78
79 }
80
81
82 if ( !std::strcmp( kG4GddViewer, "NONE" ) ) {
83
84
85 kG4GddViewerInvocation[0] = '\0';
86 } else {
87
88 std::strncpy( kG4GddViewerInvocation, kG4GddViewer,
89 sizeof(kG4GddViewerInvocation) - 1);
90 kG4GddViewerInvocation[sizeof(kG4GddViewerInvocation) - 1] = '\0';
91 G4int n =
sizeof(kG4GddViewerInvocation)
92 - (
G4int)std::strlen(kG4GddViewerInvocation) - 1;
93 std::strncat( kG4GddViewerInvocation, " ", n);
96 if(len >= 64) {
97 G4Exception(
"G4GMocrenFileViewer::G4GMocrenFileViewer(*)",
99 "Invalid length of the GDD file name");
100 }
101 n =
sizeof(kG4GddViewerInvocation)
102 - (
G4int)std::strlen(kG4GddViewerInvocation) - 1;
103 std::strncat( kG4GddViewerInvocation, gddfname, n);
104 }
105
106}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
const char * GetGddFileName()
G4VViewer(G4VSceneHandler &, G4int id, const G4String &name="")