Import Geant4 9.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:25:56 +02:00
parent 74cad5e589
commit 89a9605df1
4440 changed files with 379508 additions and 189225 deletions
+6 -4
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: FRClient.cc,v 1.7 2006/06/29 21:25:49 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: FRClient.cc,v 1.8 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// FRClient.cc
// FukuiRenderer Client
@@ -55,6 +55,7 @@
#include <string.h>
#include <stdio.h>
#include "G4VisManager.hh"
#include "FRClient.h"
FRClient::FRClient()
@@ -98,8 +99,9 @@ int FRClient::connect(const char *hostname, int port_)
}
hp = gethostbyname(hostname) ;
if ( !hp ) {
G4cerr << "ERROR: gethostbyname() failed" << G4endl;
return -1;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "ERROR: gethostbyname() failed" << G4endl;
return -1;
}
memcpy( (char * )&sa.sin_addr, (char * )hp->h_addr, hp->h_length );
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VRML1FileSceneHandler.cc,v 1.12 2006/06/29 21:25:57 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML1FileSceneHandler.cc,v 1.13 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRML1FileSceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -39,6 +39,7 @@
#include <stdlib.h>
#include "globals.hh"
#include "G4VisManager.hh"
#include "G4Scene.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
@@ -103,7 +104,8 @@ G4VRML1FileSceneHandler::G4VRML1FileSceneHandler(G4VRML1File& system, const G4St
G4VRML1FileSceneHandler::~G4VRML1FileSceneHandler()
{
#if defined DEBUG_FR_SCENE
G4cerr << "***** ~G4VRML1FileSceneHandler" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** ~G4VRML1FileSceneHandler" << G4endl;
#endif
VRMLEndModeling();
}
@@ -133,13 +135,15 @@ void G4VRML1FileSceneHandler::connectPort()
// Message in the final execution
if( i == MAX_FILE_INDEX )
{
G4cerr << "===========================================" << G4endl;
G4cerr << "WARNING MESSAGE from VRML1FILE driver: " << G4endl;
G4cerr << " This file name is the final one in the " << G4endl;
G4cerr << " automatic updation of the output file name." << G4endl;
G4cerr << " You may overwrite existing files, i.e. " << G4endl;
G4cerr << " g4_XX.wrl. " << G4endl;
G4cerr << "===========================================" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "===========================================" << G4endl;
G4cout << "WARNING MESSAGE from VRML1FILE driver: " << G4endl;
G4cout << " This file name is the final one in the " << G4endl;
G4cout << " automatic updation of the output file name." << G4endl;
G4cout << " You may overwrite existing files, i.e. " << G4endl;
G4cout << " g4_XX.wrl. " << G4endl;
G4cout << "===========================================" << G4endl;
}
}
// re-determine file name as G4VRMLFILE_DEST_DIR/g4_XX.wrl
@@ -165,12 +169,13 @@ void G4VRML1FileSceneHandler::connectPort()
} // for
// open a VRML 1.0 file with determined file name
G4cerr << "===========================================" << G4endl;
G4cerr << "Output VRML 1.0 file: " << fVRMLFileName << G4endl;
G4cerr << "Maximum number of files in the destination directory: " << fMaxFileNum << G4endl;
G4cerr << " (Customizable with the environment variable: G4VRMLFILE_MAX_FILE_NUM) " << G4endl;
G4cerr << "===========================================" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "===========================================" << G4endl;
G4cout << "Output VRML 1.0 file: " << fVRMLFileName << G4endl;
G4cout << "Maximum number of files in the destination directory: " << fMaxFileNum << G4endl;
G4cout << " (Customizable with the environment variable: G4VRMLFILE_MAX_FILE_NUM) " << G4endl;
G4cout << "===========================================" << G4endl;
}
fDest.open(fVRMLFileName) ; fFlagDestOpen = true ;
}
@@ -186,18 +191,21 @@ void G4VRML1FileSceneHandler::closePort()
// close VRML file
fDest.close(); fFlagDestOpen = false ;
G4cerr << "*** VRML 1.0 File " << fVRMLFileName << " is generated." << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "*** VRML 1.0 File " << fVRMLFileName << " is generated." << G4endl;
// Invoke viewer
if ( !strcmp(viewer, NO_VRML_VIEWER )) {
G4cerr << "MESSAGE from VRML1FILE driver:" << G4endl;
G4cerr << " Set an environmental variable " ;
G4cerr << ENV_VRML_VIEWER << G4endl;
G4cerr << " if you want to visualize the generated VRML file" << G4endl;
G4cerr << " automatically. For example, " << G4endl;
G4cerr << " setenv " << ENV_VRML_VIEWER << " vrweb " << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "MESSAGE from VRML1FILE driver:" << G4endl;
G4cout << " Set an environmental variable " ;
G4cout << ENV_VRML_VIEWER << G4endl;
G4cout << " if you want to visualize the generated VRML file" << G4endl;
G4cout << " automatically. For example, " << G4endl;
G4cout << " setenv " << ENV_VRML_VIEWER << " vrweb " << G4endl;
}
} else {
sprintf( command, "%s %s", viewer, fVRMLFileName );
system( command );
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VRML1FileViewer.cc,v 1.11 2006/06/29 21:25:59 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML1FileViewer.cc,v 1.12 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRMLView.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -33,6 +33,7 @@
//#define DEBUG_FR_VIEW
#include "G4VisManager.hh"
#include "G4Scene.hh"
#include "G4VRML1FileViewer.hh"
#include "G4VRML1FileSceneHandler.hh"
@@ -53,14 +54,16 @@ G4VRML1FileViewer::~G4VRML1FileViewer()
void G4VRML1FileViewer::SetView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1FileViewer::SetView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1FileViewer::SetView(): No effects" << G4endl;
#endif
}
void G4VRML1FileViewer::DrawView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1FileViewer::DrawView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1FileViewer::DrawView()" << G4endl;
#endif
fSceneHandler.VRMLBeginModeling();
@@ -74,7 +77,8 @@ void G4VRML1FileViewer::DrawView()
void G4VRML1FileViewer::ClearView(void)
{
//#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1File1View::ClearView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1File1View::ClearView()" << G4endl;
//#endif
if(fSceneHandler.fFlagDestOpen) {
fSceneHandler.fDest.close();
@@ -88,7 +92,8 @@ void G4VRML1FileViewer::ClearView(void)
void G4VRML1FileViewer::ShowView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1FileViewer::ShowView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1FileViewer::ShowView()" << G4endl;
#endif
fSceneHandler.VRMLEndModeling();
}
@@ -96,6 +101,7 @@ void G4VRML1FileViewer::ShowView(void)
void G4VRML1FileViewer::FinishView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1FileViewer::FinishView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1FileViewer::FinishView(): No effects" << G4endl;
#endif
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VRML1SceneHandler.cc,v 1.10 2006/06/29 21:26:01 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML1SceneHandler.cc,v 1.11 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRML1SceneHandler.cc
// Yasuhide Sawada and Satoshi Tanaka
@@ -43,6 +43,7 @@
#include <fstream>
#include "globals.hh"
#include "G4VisManager.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Point3D.hh"
@@ -80,7 +81,8 @@ G4VRML1SceneHandler::G4VRML1SceneHandler(G4VRML1& system, const G4String& name)
G4VRML1SceneHandler::~G4VRML1SceneHandler()
{
#if defined DEBUG_FR_SCENE
G4cerr << "***** ~G4VRML1SceneHandler" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** ~G4VRML1SceneHandler" << G4endl;
#endif
}
@@ -100,14 +102,18 @@ void G4VRML1SceneHandler::connectPort(G4int max_trial)
for (trial = 0; !fDest.isConnected()&& trial < max_trial; trial++, port++ ) {
if (fDest.connect( (const char * )fSystem.getHostName(), port)) {
// INET domain connection is established
G4cerr << "*** GEANT4 is connected to port ";
G4cerr << fDest.getPort();
G4cerr << " of server " << fSystem.getHostName() << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "*** GEANT4 is connected to port ";
G4cout << fDest.getPort();
G4cout << " of server " << fSystem.getHostName() << G4endl;
}
break;
} else {
// Connection failed. Try the next port.
G4cerr << "*** GEANT4 incremented targeting port to ";
G4cerr << port << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "*** GEANT4 incremented targeting port to ";
G4cout << port << G4endl;
}
}
sleep (1);
@@ -115,17 +121,20 @@ void G4VRML1SceneHandler::connectPort(G4int max_trial)
} // for
if (!fDest.isConnected()) {
G4cerr << "*** INET Connection failed. " << G4endl;
G4cerr << " Maybe, you have not invoked viewer g4vrmlview yet, " << G4endl;
G4cerr << " or too many viewers are already running in the " << G4endl;
G4cerr << " server host(" << fSystem.getHostName() << "). " << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "*** INET Connection failed. " << G4endl;
G4cout << " Maybe, you have not invoked viewer g4vrmlview yet, " << G4endl;
G4cout << " or too many viewers are already running in the " << G4endl;
G4cout << " server host(" << fSystem.getHostName() << "). " << G4endl;
}
}
}
void G4VRML1SceneHandler::closePort()
{
fDest.close();
G4cerr << "*** INET Connection closed. " << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "*** INET Connection closed. " << G4endl;
}
@@ -24,12 +24,14 @@
// ********************************************************************
//
//
// $Id: G4VRML1SceneHandlerFunc.icc,v 1.16 2006/06/29 21:26:03 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML1SceneHandlerFunc.icc,v 1.17 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRML1SceneHandlerFunc.icc
// Satoshi Tanaka & Yasuhide Sawada
#include "G4VisManager.hh"
//#define DEBUG_SCENE_FUNC
// MACRO
@@ -43,7 +45,8 @@
void G4VRML1SCENEHANDLER::AddSolid(const G4Trd& trd)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid trd" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid trd" << "\n" ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(trd)
@@ -52,7 +55,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4Trd& trd)
void G4VRML1SCENEHANDLER::AddSolid(const G4Trap& trap)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid trap" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid trap" << "\n" ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(trap)
@@ -61,7 +65,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4Trap& trap)
void G4VRML1SCENEHANDLER::AddSolid(const G4Para& para)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid para" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid para" << "\n" ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(para)
@@ -70,7 +75,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4Para& para)
void G4VRML1SCENEHANDLER::AddSolid(const G4Torus& torus )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid torus" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid torus" << "\n" ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(torus)
@@ -80,7 +86,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4Torus& torus )
void G4VRML1SCENEHANDLER::AddSolid(const G4VSolid& vsolid)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid vsolid" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid vsolid" << "\n" ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(vsolid)
@@ -89,7 +96,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4VSolid& vsolid)
void G4VRML1SCENEHANDLER::AddSolid(const G4Tubs& tubs)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid tubs" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid tubs" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -126,7 +134,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4Tubs& tubs)
void G4VRML1SCENEHANDLER::AddSolid(const G4Cons& cons)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid cons" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid cons" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -165,7 +174,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4Cons& cons)
void G4VRML1SCENEHANDLER::AddSolid(const G4Box& box)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid box" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid box" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -193,7 +203,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4Box& box)
void G4VRML1SCENEHANDLER::AddSolid(const G4Sphere& sphere)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid sphere" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid sphere" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -229,7 +240,8 @@ void G4VRML1SCENEHANDLER::AddSolid(const G4Sphere& sphere)
void G4VRML1SCENEHANDLER::AddPrimitive(const G4Polyline& polyline)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive polyline" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive polyline" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -268,7 +280,8 @@ void G4VRML1SCENEHANDLER::AddPrimitive(const G4Polyline& polyline)
void G4VRML1SCENEHANDLER::AddPrimitive(const G4Polyhedron& polyhedron)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive(G4Polyhedron)" << "\n";
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive(G4Polyhedron)" << "\n";
#endif
if (polyhedron.GetNoFacets() == 0) return;
@@ -337,9 +350,11 @@ void G4VRML1SCENEHANDLER::AddPrimitive(const G4Polyhedron& polyhedron)
void G4VRML1SCENEHANDLER::AddPrimitive(const G4NURBS&)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive nurbs" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive nurbs" << "\n" ;
#endif
G4cerr << "G4VRML1File::AddPrimitive(G4NURBS&): not implemented. " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "G4VRML1File::AddPrimitive(G4NURBS&): not implemented. " << "\n" ;
VRMLBeginModeling () ;
}
@@ -347,9 +362,11 @@ void G4VRML1SCENEHANDLER::AddPrimitive(const G4NURBS&)
void G4VRML1SCENEHANDLER::AddPrimitive( const G4Text& )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive text" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive text" << "\n" ;
#endif
G4cerr <<
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout <<
"***** void G4VRML1SCENEHANDLER::AddPrimitive( const G4Text& text )"
" not implemented yet."
<< "\n";
@@ -360,7 +377,8 @@ void G4VRML1SCENEHANDLER::AddPrimitive( const G4Text& )
void G4VRML1SCENEHANDLER::AddPrimitive( const G4Circle& circle )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive circle" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive circle" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -390,7 +408,8 @@ void G4VRML1SCENEHANDLER::AddPrimitive( const G4Circle& circle )
void G4VRML1SCENEHANDLER::AddPrimitive(const G4Square& square)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive square" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive square" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -422,7 +441,8 @@ void G4VRML1SCENEHANDLER::AddPrimitive(const G4Square& square)
void G4VRML1SCENEHANDLER::BeginModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginModeling " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** BeginModeling " << "\n" ;
#endif
G4VSceneHandler::BeginModeling();
}
@@ -430,7 +450,8 @@ void G4VRML1SCENEHANDLER::BeginModeling()
void G4VRML1SCENEHANDLER::EndModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndModeling " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** EndModeling " << "\n" ;
#endif
G4VSceneHandler::EndModeling();
}
@@ -440,7 +461,8 @@ void G4VRML1SCENEHANDLER::BeginPrimitives(const G4Transform3D& objectTransformat
G4VSceneHandler::BeginPrimitives (objectTransformation);
fpObjectTransformation = &objectTransformation;
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginPrimitives " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** BeginPrimitives " << "\n" ;
#endif
VRMLBeginModeling();
}
@@ -448,7 +470,8 @@ void G4VRML1SCENEHANDLER::BeginPrimitives(const G4Transform3D& objectTransformat
void G4VRML1SCENEHANDLER::EndPrimitives()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndPrimitives " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** EndPrimitives " << "\n" ;
#endif
G4VSceneHandler::EndPrimitives();
}
@@ -554,7 +577,8 @@ void G4VRML1SCENEHANDLER::VRMLBeginModeling()
{
if (!IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** VRMLBeginModeling() (started)" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** VRMLBeginModeling() (started)" << "\n" ;
#endif
this->connectPort();
fDest << "#VRML V1.0 ascii" << "\n";
@@ -566,7 +590,8 @@ void G4VRML1SCENEHANDLER::VRMLEndModeling()
{
if ( IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** VRMLEndModeling() (started)" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** VRMLEndModeling() (started)" << "\n" ;
#endif
fDest << "#End of file." << "\n";
+14 -7
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VRML1Viewer.cc,v 1.8 2006/06/29 21:26:05 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML1Viewer.cc,v 1.9 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRMLView.cc
// Yasuhide Sawada & Satoshi Tanaka
@@ -39,6 +39,8 @@
//#define DEBUG_FR_VIEW
#include "G4VisManager.hh"
#include "G4Scene.hh"
#include "G4VRML1Viewer.hh"
#include "G4VRML1SceneHandler.hh"
@@ -55,14 +57,16 @@ G4VRML1Viewer::~G4VRML1Viewer()
void G4VRML1Viewer::SetView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::SetView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1Viewer::SetView(): No effects" << G4endl;
#endif
}
void G4VRML1Viewer::DrawView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::DrawView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1Viewer::DrawView()" << G4endl;
#endif
fSceneHandler.VRMLBeginModeling();
@@ -76,14 +80,16 @@ void G4VRML1Viewer::DrawView()
void G4VRML1Viewer::ClearView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::ClearView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1Viewer::ClearView(): No effects" << G4endl;
#endif
}
void G4VRML1Viewer::ShowView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::ShowView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1Viewer::ShowView()" << G4endl;
#endif
fSceneHandler.VRMLEndModeling();
}
@@ -91,7 +97,8 @@ void G4VRML1Viewer::ShowView(void)
void G4VRML1Viewer::FinishView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::FinishView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML1Viewer::FinishView(): No effects" << G4endl;
#endif
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VRML2FileSceneHandler.cc,v 1.14 2006/06/29 21:26:11 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML2FileSceneHandler.cc,v 1.15 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRML2FileSceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -42,6 +42,7 @@
#include "globals.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4VisManager.hh"
#include "G4Point3D.hh"
#include "G4VisAttributes.hh"
#include "G4VModel.hh"
@@ -118,7 +119,8 @@ G4VRML2FileSceneHandler::G4VRML2FileSceneHandler(G4VRML2File& system, const G4St
G4VRML2FileSceneHandler::~G4VRML2FileSceneHandler()
{
#if defined DEBUG_FR_SCENE
G4cerr << "***** ~G4VRML2FileSceneHandler" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** ~G4VRML2FileSceneHandler" << G4endl;
#endif
VRMLEndModeling();
}
@@ -148,13 +150,15 @@ void G4VRML2FileSceneHandler::connectPort()
// Message in the final execution
if( i == MAX_FILE_INDEX )
{
G4cerr << "===========================================" << G4endl;
G4cerr << "WARNING MESSAGE from VRML2FILE driver: " << G4endl;
G4cerr << " This file name is the final one in the " << G4endl;
G4cerr << " automatic updation of the output file name." << G4endl;
G4cerr << " You may overwrite existing files, i.e. " << G4endl;
G4cerr << " g4_XX.wrl. " << G4endl;
G4cerr << "===========================================" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "===========================================" << G4endl;
G4cout << "WARNING MESSAGE from VRML2FILE driver: " << G4endl;
G4cout << " This file name is the final one in the " << G4endl;
G4cout << " automatic updation of the output file name." << G4endl;
G4cout << " You may overwrite existing files, i.e. " << G4endl;
G4cout << " g4_XX.wrl. " << G4endl;
G4cout << "===========================================" << G4endl;
}
}
// re-determine file name as G4VRMLFILE_DEST_DIR/g4_XX.wrl
@@ -179,12 +183,13 @@ void G4VRML2FileSceneHandler::connectPort()
} // for
// open a VRML 2.0 file with determined file name
G4cerr << "===========================================" << G4endl;
G4cerr << "Output VRML 2.0 file: " << fVRMLFileName << G4endl;
G4cerr << "Maximum number of files in the destination directory: " << fMaxFileNum << G4endl;
G4cerr << " (Customizable with the environment variable: G4VRMLFILE_MAX_FILE_NUM) " << G4endl;
G4cerr << "===========================================" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "===========================================" << G4endl;
G4cout << "Output VRML 2.0 file: " << fVRMLFileName << G4endl;
G4cout << "Maximum number of files in the destination directory: " << fMaxFileNum << G4endl;
G4cout << " (Customizable with the environment variable: G4VRMLFILE_MAX_FILE_NUM) " << G4endl;
G4cout << "===========================================" << G4endl;
}
fDest.open(fVRMLFileName) ; fFlagDestOpen = true ;
}
@@ -200,18 +205,21 @@ void G4VRML2FileSceneHandler::closePort()
// close VRML file
fDest.close(); fFlagDestOpen = false ;
G4cerr << "*** VRML 2.0 File " << fVRMLFileName << " is generated." << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "*** VRML 2.0 File " << fVRMLFileName << " is generated." << G4endl;
// Invoke viewer
if ( !strcmp(viewer, NO_VRML_VIEWER )) {
G4cerr << "MESSAGE from VRML2FILE driver:" << G4endl;
G4cerr << " Set an environmental variable " ;
G4cerr << ENV_VRML_VIEWER << G4endl;
G4cerr << " if you want to visualize the generated VRML file" << G4endl;
G4cerr << " automatically. For example, " << G4endl;
G4cerr << " setenv " << ENV_VRML_VIEWER << " vrwave " << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "MESSAGE from VRML2FILE driver:" << G4endl;
G4cout << " Set an environmental variable " ;
G4cout << ENV_VRML_VIEWER << G4endl;
G4cout << " if you want to visualize the generated VRML file" << G4endl;
G4cout << " automatically. For example, " << G4endl;
G4cout << " setenv " << ENV_VRML_VIEWER << " vrwave " << G4endl;
}
} else {
sprintf( command, "%s %s", viewer, fVRMLFileName );
system( command );
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VRML2FileViewer.cc,v 1.13 2006/06/29 21:26:13 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML2FileViewer.cc,v 1.14 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRML2FileViewer.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -35,6 +35,7 @@
#include <cmath>
#include "G4VisManager.hh"
#include "G4Scene.hh"
#include "G4VRML2FileViewer.hh"
#include "G4VRML2FileSceneHandler.hh"
@@ -59,7 +60,8 @@ G4VRML2FileViewer::~G4VRML2FileViewer()
void G4VRML2FileViewer::SetView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2FileViewer::SetView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2FileViewer::SetView(): No effects" << G4endl;
#endif
// Do nothing, since VRML a browser is running as a different process.
@@ -70,7 +72,8 @@ void G4VRML2FileViewer::SetView()
void G4VRML2FileViewer::DrawView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2FileViewer::DrawView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2FileViewer::DrawView()" << G4endl;
#endif
fSceneHandler.VRMLBeginModeling() ;
@@ -87,7 +90,8 @@ void G4VRML2FileViewer::DrawView()
void G4VRML2FileViewer::ClearView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2File1View::ClearView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2File1View::ClearView()" << G4endl;
#endif
if(fSceneHandler.fFlagDestOpen) {
fSceneHandler.fDest.close();
@@ -101,7 +105,8 @@ void G4VRML2FileViewer::ClearView(void)
void G4VRML2FileViewer::ShowView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2FileViewer::ShowView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2FileViewer::ShowView()" << G4endl;
#endif
fSceneHandler.VRMLEndModeling();
}
@@ -109,7 +114,8 @@ void G4VRML2FileViewer::ShowView(void)
void G4VRML2FileViewer::FinishView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2FileViewer::FinishView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2FileViewer::FinishView(): No effects" << G4endl;
#endif
}
@@ -120,7 +126,8 @@ void G4VRML2FileViewer::SendViewParameters ()
// later due to user interaction via visualization system's GUI.)
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2FileViewer::SendViewParameters()\n";
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2FileViewer::SendViewParameters()\n";
#endif
// error recovery
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VRML2SceneHandler.cc,v 1.12 2006/06/29 21:26:15 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML2SceneHandler.cc,v 1.13 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRML2SceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -45,6 +45,8 @@
#include <cmath>
#include "globals.hh"
#include "G4VisManager.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Point3D.hh"
@@ -92,7 +94,8 @@ G4VRML2SceneHandler::G4VRML2SceneHandler(G4VRML2& system, const G4String& name)
G4VRML2SceneHandler::~G4VRML2SceneHandler()
{
#if defined DEBUG_FR_SCENE
G4cerr << "***** ~G4VRML2SceneHandler" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** ~G4VRML2SceneHandler" << G4endl;
#endif
}
@@ -112,14 +115,18 @@ void G4VRML2SceneHandler::connectPort(G4int max_trial)
for (trial = 0; !fDest.isConnected()&& trial < max_trial; trial++, port++ ) {
if (fDest.connect( (const char * )fSystem.getHostName(), port)) {
// INET domain connection is established
G4cerr << "*** GEANT4 is connected to port ";
G4cerr << fDest.getPort();
G4cerr << " of server " << fSystem.getHostName() << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "*** GEANT4 is connected to port ";
G4cout << fDest.getPort();
G4cout << " of server " << fSystem.getHostName() << G4endl;
}
break;
} else {
// Connection failed. Try the next port.
G4cerr << "*** GEANT4 incremented targeting port to ";
G4cerr << port << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "*** GEANT4 incremented targeting port to ";
G4cout << port << G4endl;
}
}
sleep (1);
@@ -127,17 +134,20 @@ void G4VRML2SceneHandler::connectPort(G4int max_trial)
} // for
if (!fDest.isConnected()) {
G4cerr << "*** INET Connection failed. " << G4endl;
G4cerr << " Maybe, you have not invoked viewer g4vrmlview yet, " << G4endl;
G4cerr << " or too many viewers are already running in the " << G4endl;
G4cerr << " server host(" << fSystem.getHostName() << "). " << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
G4cout << "*** INET Connection failed. " << G4endl;
G4cout << " Maybe, you have not invoked viewer g4vrmlview yet, " << G4endl;
G4cout << " or too many viewers are already running in the " << G4endl;
G4cout << " server host(" << fSystem.getHostName() << "). " << G4endl;
}
}
}
void G4VRML2SceneHandler::closePort()
{
fDest.close();
G4cerr << "*** INET Connection closed. " << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "*** INET Connection closed. " << G4endl;
}
@@ -24,18 +24,21 @@
// ********************************************************************
//
//
// $Id: G4VRML2SceneHandlerFunc.icc,v 1.20 2006/06/29 21:26:17 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML2SceneHandlerFunc.icc,v 1.21 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRML2SceneHandlerFunc.icc
// Satoshi Tanaka & Yasuhide Sawada
//#define DEBUG_SCENE_FUNC
#include "G4VisManager.hh"
void G4VRML2SCENEHANDLER::AddSolid(const G4Trd& trd)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid trd" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid trd" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(trd);
@@ -44,7 +47,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4Trd& trd)
void G4VRML2SCENEHANDLER::AddSolid(const G4Trap& trap)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid trap" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid trap" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(trap);
@@ -53,7 +57,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4Trap& trap)
void G4VRML2SCENEHANDLER::AddSolid(const G4Para& para)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid para" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid para" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(para);
@@ -62,7 +67,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4Para& para)
void G4VRML2SCENEHANDLER::AddSolid(const G4Torus& torus )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid torus" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid torus" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(torus);
@@ -72,7 +78,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4Torus& torus )
void G4VRML2SCENEHANDLER::AddSolid(const G4VSolid& vsolid)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid vsolid" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid vsolid" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(vsolid);
@@ -81,7 +88,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4VSolid& vsolid)
void G4VRML2SCENEHANDLER::AddSolid(const G4Tubs& tubs)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid tubs" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid tubs" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(tubs) ;
@@ -92,7 +100,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4Tubs& tubs)
void G4VRML2SCENEHANDLER::AddSolid(const G4Cons& cons)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid cons" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid cons" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(cons) ;
@@ -101,7 +110,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4Cons& cons)
void G4VRML2SCENEHANDLER::AddSolid(const G4Box& box)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid box" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid box" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(box) ;
@@ -111,7 +121,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4Box& box)
void G4VRML2SCENEHANDLER::AddSolid(const G4Sphere& sphere)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddSolid sphere" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddSolid sphere" << "\n" ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddSolid(sphere) ;
@@ -120,7 +131,8 @@ void G4VRML2SCENEHANDLER::AddSolid(const G4Sphere& sphere)
void G4VRML2SCENEHANDLER::AddPrimitive(const G4Polyline& polyline)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive polyline" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive polyline" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -169,7 +181,8 @@ void G4VRML2SCENEHANDLER::AddPrimitive(const G4Polyline& polyline)
void G4VRML2SCENEHANDLER::AddPrimitive(const G4Polyhedron& polyhedron)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive(G4Polyhedron)" << "\n";
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive(G4Polyhedron)" << "\n";
#endif
if (polyhedron.GetNoFacets() == 0) return;
@@ -252,9 +265,11 @@ void G4VRML2SCENEHANDLER::AddPrimitive(const G4Polyhedron& polyhedron)
void G4VRML2SCENEHANDLER::AddPrimitive(const G4NURBS&)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive nurbs" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive nurbs" << "\n" ;
#endif
G4cerr << "G4VRML2File::AddPrimitive(G4NURBS&): not implemented. " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "G4VRML2File::AddPrimitive(G4NURBS&): not implemented. " << "\n" ;
VRMLBeginModeling () ;
}
@@ -262,9 +277,11 @@ void G4VRML2SCENEHANDLER::AddPrimitive(const G4NURBS&)
void G4VRML2SCENEHANDLER::AddPrimitive( const G4Text& )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive text" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive text" << "\n" ;
#endif
G4cerr <<
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout <<
"***** void G4VRML2SCENEHANDLER::AddPrimitive( const G4Text& text )"
" not implemented yet."
<< "\n";
@@ -276,7 +293,8 @@ void G4VRML2SCENEHANDLER::AddPrimitive( const G4Text& )
void G4VRML2SCENEHANDLER::AddPrimitive( const G4Circle& circle )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive circle" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive circle" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -334,7 +352,8 @@ void G4VRML2SCENEHANDLER::AddPrimitive( const G4Circle& circle )
void G4VRML2SCENEHANDLER::AddPrimitive(const G4Square& square)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive square" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** AddPrimitive square" << "\n" ;
#endif
VRMLBeginModeling () ;
@@ -395,7 +414,8 @@ void G4VRML2SCENEHANDLER::AddPrimitive(const G4Square& square)
void G4VRML2SCENEHANDLER::BeginModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginModeling" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** BeginModeling" << "\n" ;
#endif
G4VSceneHandler::BeginModeling();
@@ -404,7 +424,8 @@ void G4VRML2SCENEHANDLER::BeginModeling()
void G4VRML2SCENEHANDLER::EndModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndModeling " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** EndModeling " << "\n" ;
#endif
G4VSceneHandler::EndModeling();
}
@@ -414,7 +435,8 @@ void G4VRML2SCENEHANDLER::BeginPrimitives(const G4Transform3D& objectTransformat
G4VSceneHandler::BeginPrimitives (objectTransformation);
fpObjectTransformation = &objectTransformation;
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginPrimitives " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** BeginPrimitives " << "\n" ;
#endif
VRMLBeginModeling();
}
@@ -422,7 +444,8 @@ void G4VRML2SCENEHANDLER::BeginPrimitives(const G4Transform3D& objectTransformat
void G4VRML2SCENEHANDLER::EndPrimitives()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndPrimitives " << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** EndPrimitives " << "\n" ;
#endif
G4VSceneHandler::EndPrimitives();
}
@@ -499,7 +522,8 @@ void G4VRML2SCENEHANDLER::VRMLBeginModeling()
{
if (!IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** VRMLBeginModeling (started)" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** VRMLBeginModeling (started)" << "\n" ;
#endif
this->connectPort();
fDest << "#VRML V2.0 utf8" << "\n";
@@ -511,7 +535,8 @@ void G4VRML2SCENEHANDLER::VRMLEndModeling()
{
if ( IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** VRMLEndModeling (started)" << "\n" ;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** VRMLEndModeling (started)" << "\n" ;
#endif
fDest << "#End of file." << "\n";
this->closePort();
+15 -8
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VRML2Viewer.cc,v 1.12 2006/06/29 21:26:35 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VRML2Viewer.cc,v 1.13 2010/11/11 00:14:50 akimura Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// G4VRML2Viewer.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -41,6 +41,7 @@
#include <cmath>
#include "G4VisManager.hh"
#include "G4Scene.hh"
#include "G4VRML2Viewer.hh"
#include "G4VRML2SceneHandler.hh"
@@ -64,7 +65,8 @@ G4VRML2Viewer::~G4VRML2Viewer()
void G4VRML2Viewer::SetView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::SetView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2Viewer::SetView(): No effects" << G4endl;
#endif
// Do nothing, since VRML a browser is running as a different process.
@@ -76,7 +78,8 @@ void G4VRML2Viewer::SetView()
void G4VRML2Viewer::DrawView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::DrawView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2Viewer::DrawView()" << G4endl;
#endif
fSceneHandler.VRMLBeginModeling() ;
@@ -92,14 +95,16 @@ void G4VRML2Viewer::DrawView()
void G4VRML2Viewer::ClearView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::ClearView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2Viewer::ClearView(): No effects" << G4endl;
#endif
}
void G4VRML2Viewer::ShowView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::ShowView()" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2Viewer::ShowView()" << G4endl;
#endif
fSceneHandler.VRMLEndModeling();
}
@@ -107,7 +112,8 @@ void G4VRML2Viewer::ShowView(void)
void G4VRML2Viewer::FinishView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::FinishView(): No effects" << G4endl;
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2Viewer::FinishView(): No effects" << G4endl;
#endif
}
@@ -118,7 +124,8 @@ void G4VRML2Viewer::SendViewParameters ()
// later due to user interaction via visualization system's GUI.)
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::SendViewParameters()\n";
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
G4cout << "***** G4VRML2Viewer::SendViewParameters()\n";
#endif
// error recovery
if ( fsin_VHA < 1.0e-6 ) { return ; }