Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: FRClient.cc,v 1.3.4.1 2001/06/28 19:16:02 gunter Exp $
// GEANT4 tag $Name: $
// $Id: FRClient.cc,v 1.5 2001/09/18 07:53:15 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// FRClient.cc
// FukuiRenderer Client
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4FRClient.cc,v 1.4.4.1 2001/06/28 19:16:03 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4FRClient.cc,v 1.6 2001/09/18 07:53:15 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4FRClient.cc
// Yasuhide Sawada & Satoshi Tanaka
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VRML1.cc,v 1.5.4.1 2001/06/28 19:16:03 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML1.cc,v 1.7 2001/09/18 07:53:15 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML1.cc
// Yasuhide Sawada & Satoshi Tanaka
+2 -9
View File
@@ -21,17 +21,12 @@
// ********************************************************************
//
//
// $Id: G4VRML1File.cc,v 1.5.4.1 2001/06/28 19:16:03 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML1File.cc,v 1.8 2001/09/18 07:53:15 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML1File.cc
// Satoshi Tanaka & Yasuhide Sawada
//=================//
#ifdef G4VIS_BUILD_VRMLFILE_DRIVER
//=================//
#include <stdio.h> // sscanf
#include <stdlib.h> // getenv
@@ -75,5 +70,3 @@ G4VViewer* G4VRML1File::CreateViewer(G4VSceneHandler& scene, const G4String& nam
return pView;
}
#endif
@@ -21,16 +21,12 @@
// ********************************************************************
//
//
// $Id: G4VRML1FileSceneHandler.cc,v 1.4.4.1 2001/06/28 19:16:03 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML1FileSceneHandler.cc,v 1.7 2001/09/18 07:53:15 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML1FileSceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
//=================//
#ifdef G4VIS_BUILD_VRMLFILE_DRIVER
//=================//
//#define DEBUG_FR_SCENE
@@ -70,7 +66,7 @@ const char DEFAULT_WRL_FILE_NAME[] = "g4.wrl";
const char ENV_VRML_VIEWER [] = "G4VRMLFILE_VIEWER";
const char NO_VRML_VIEWER [] = "NONE";
const char VRMLFILE_DEST_DIR [] = "G4VRMLFILE_DEST_DIR";
const int DEFAULT_MAX_WRL_FILE_NUM = 100 ;
G4VRML1FileSceneHandler::G4VRML1FileSceneHandler(G4VRML1File& system, const G4String& name) :
G4VSceneHandler(system, fSceneIdCount++, name),
@@ -88,17 +84,16 @@ G4VRML1FileSceneHandler::G4VRML1FileSceneHandler(G4VRML1File& system, const G4St
strcpy( fVRMLFileDestDir, getenv( VRMLFILE_DEST_DIR ) );
}
// maximum number of g4.prim files in the dest directory
fMaxFileNum = 1 ; // initialization
// maximum number of g4.wrl files in the dest directory
fMaxFileNum = DEFAULT_MAX_WRL_FILE_NUM ; // initialization
if ( getenv( "G4VRMLFILE_MAX_FILE_NUM" ) != NULL ) {
sscanf( getenv("G4VRMLFILE_MAX_FILE_NUM"), "%d", &fMaxFileNum ) ;
} else {
fMaxFileNum = 1 ;
fMaxFileNum = DEFAULT_MAX_WRL_FILE_NUM ;
}
if( fMaxFileNum < 1 ) { fMaxFileNum = 1 ; }
if( fMaxFileNum < 1 ) { fMaxFileNum = 1; }
}
@@ -112,41 +107,44 @@ G4VRML1FileSceneHandler::~G4VRML1FileSceneHandler()
}
#define G4VRML1SCENE G4VRML1FileSceneHandler
#define G4VRML1SCENEHANDLER G4VRML1FileSceneHandler
#define IS_CONNECTED this->isConnected()
#include "G4VRML1SceneHandlerFunc.icc"
#undef IS_CONNECTED
#undef G4VRML1SCENE
#undef G4VRML1SCENEHANDLER
void G4VRML1FileSceneHandler::connectPort()
{
// g4.wrl, g4_1.wrl, ..., g4_MAX_FILE_INDEX.wrl
// g4_00.wrl, g4_01.wrl, ..., g4_MAX_FILE_INDEX.wrl
const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
// dest directory (null if no environmental variables is set)
strcpy ( fVRMLFileName, fVRMLFileDestDir) ;
// create full path name (default)
// create (full) path name (default)
strcat ( fVRMLFileName, DEFAULT_WRL_FILE_NAME );
// Determine VRML file name
for( int i = 0 ; i < fMaxFileNum ; i++) {
// Message
if( fMaxFileNum > 1 && i == MAX_FILE_INDEX ) {
// Message in the final execution
if( i == MAX_FILE_INDEX )
{
G4cerr << "===========================================" << G4endl;
G4cerr << "WARNING MESSAGE from VRML1FILE driver: " << 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 an existing file of " << G4endl;
G4cerr << " the same name. " << G4endl;
G4cerr << " You may overwrite existing files, i.e. " << G4endl;
G4cerr << " g4_XX.wrl. " << G4endl;
G4cerr << "===========================================" << G4endl;
}
// re-determine file to G4VRMLFILE_DEST_DIR/g4_i.wrl for i>0
if( i > 0 ) {
sprintf( fVRMLFileName, "%s%s%d.wrl" , fVRMLFileDestDir, WRL_FILE_HEADER, i );
// 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 );
}
// check validity of the file name
@@ -154,13 +152,14 @@ void G4VRML1FileSceneHandler::connectPort()
fin.open(fVRMLFileName) ;
if(!fin) {
// new file
fin.close(); // error recovery
fin.close();
break;
} else {
// already exists (try next)
fin.close();
}
} // for
// open a VRML 1.0 file with determined file name
@@ -205,5 +204,3 @@ void G4VRML1FileSceneHandler::closePort()
G4int G4VRML1FileSceneHandler::fSceneIdCount = 0;
G4int G4VRML1FileSceneHandler::fSceneCount = 0;
#endif
@@ -21,16 +21,12 @@
// ********************************************************************
//
//
// $Id: G4VRML1FileViewer.cc,v 1.4.4.1 2001/06/28 19:16:03 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML1FileViewer.cc,v 1.7 2001/09/18 07:53:15 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRMLView.cc
// Satoshi Tanaka & Yasuhide Sawada
//=================//
#ifdef G4VIS_BUILD_VRMLFILE_DRIVER
//=================//
//#define DEBUG_FR_VIEW
@@ -90,6 +86,3 @@ void G4VRML1FileViewer::FinishView(void)
G4cerr << "***** G4VRML1FileViewer::FinishView(): No effects" << G4endl;
#endif
}
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VRML1SceneHandler.cc,v 1.4.4.1 2001/06/28 19:16:03 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML1SceneHandler.cc,v 1.6 2001/09/18 07:53:15 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML1SceneHandler.cc
// Yasuhide Sawada and Satoshi Tanaka
@@ -83,11 +83,11 @@ G4VRML1SceneHandler::~G4VRML1SceneHandler()
#define G4VRML1SCENE G4VRML1SceneHandler
#define G4VRML1SCENEHANDLER G4VRML1SceneHandler
#define IS_CONNECTED fDest.isConnected()
#include "G4VRML1SceneHandlerFunc.icc"
#undef IS_CONNECTED
#undef G4VRML1SCENE
#undef G4VRML1SCENEHANDLER
void G4VRML1SceneHandler::connectPort(G4int max_trial)
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VRML1SceneHandlerFunc.icc,v 1.7.2.1 2001/06/28 19:16:03 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML1SceneHandlerFunc.icc,v 1.9 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML1SceneHandlerFunc.icc
// Satoshi Tanaka & Yasuhide Sawada
@@ -37,7 +37,7 @@
// End of MACRO
void G4VRML1SCENE::AddThis(const G4Trd& trd)
void G4VRML1SCENEHANDLER::AddThis(const G4Trd& trd)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis trd" << "\n" ;
@@ -46,7 +46,7 @@ void G4VRML1SCENE::AddThis(const G4Trd& trd)
ADDTHIS_WITH_NAME(trd)
}
void G4VRML1SCENE::AddThis(const G4Trap& trap)
void G4VRML1SCENEHANDLER::AddThis(const G4Trap& trap)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis trap" << "\n" ;
@@ -55,7 +55,7 @@ void G4VRML1SCENE::AddThis(const G4Trap& trap)
ADDTHIS_WITH_NAME(trap)
}
void G4VRML1SCENE::AddThis(const G4Para& para)
void G4VRML1SCENEHANDLER::AddThis(const G4Para& para)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis para" << "\n" ;
@@ -64,7 +64,7 @@ void G4VRML1SCENE::AddThis(const G4Para& para)
ADDTHIS_WITH_NAME(para)
}
void G4VRML1SCENE::AddThis(const G4Torus& torus )
void G4VRML1SCENEHANDLER::AddThis(const G4Torus& torus )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis torus" << "\n" ;
@@ -74,7 +74,7 @@ void G4VRML1SCENE::AddThis(const G4Torus& torus )
}
void G4VRML1SCENE::AddThis(const G4VSolid& vsolid)
void G4VRML1SCENEHANDLER::AddThis(const G4VSolid& vsolid)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis vsolid" << "\n" ;
@@ -83,7 +83,7 @@ void G4VRML1SCENE::AddThis(const G4VSolid& vsolid)
ADDTHIS_WITH_NAME(vsolid)
}
void G4VRML1SCENE::AddThis(const G4Tubs& tubs)
void G4VRML1SCENEHANDLER::AddThis(const G4Tubs& tubs)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis tubs" << "\n" ;
@@ -120,7 +120,7 @@ void G4VRML1SCENE::AddThis(const G4Tubs& tubs)
}
void G4VRML1SCENE::AddThis(const G4Cons& cons)
void G4VRML1SCENEHANDLER::AddThis(const G4Cons& cons)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis cons" << "\n" ;
@@ -159,7 +159,7 @@ void G4VRML1SCENE::AddThis(const G4Cons& cons)
fCurrentDEF = "";
}
void G4VRML1SCENE::AddThis(const G4Box& box)
void G4VRML1SCENEHANDLER::AddThis(const G4Box& box)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis box" << "\n" ;
@@ -187,7 +187,7 @@ void G4VRML1SCENE::AddThis(const G4Box& box)
}
void G4VRML1SCENE::AddThis(const G4Sphere& sphere)
void G4VRML1SCENEHANDLER::AddThis(const G4Sphere& sphere)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis sphere" << "\n" ;
@@ -223,7 +223,7 @@ void G4VRML1SCENE::AddThis(const G4Sphere& sphere)
fCurrentDEF = "";
}
void G4VRML1SCENE::AddPrimitive(const G4Polyline& polyline)
void G4VRML1SCENEHANDLER::AddPrimitive(const G4Polyline& polyline)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive polyline" << "\n" ;
@@ -262,7 +262,7 @@ void G4VRML1SCENE::AddPrimitive(const G4Polyline& polyline)
fDest << "}" << "\n"; // Separator
}
void G4VRML1SCENE::AddPrimitive(const G4Polyhedron& polyhedron)
void G4VRML1SCENEHANDLER::AddPrimitive(const G4Polyhedron& polyhedron)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive(G4Polyhedron)" << "\n";
@@ -331,7 +331,7 @@ void G4VRML1SCENE::AddPrimitive(const G4Polyhedron& polyhedron)
}
void G4VRML1SCENE::AddPrimitive(const G4NURBS& nurb)
void G4VRML1SCENEHANDLER::AddPrimitive(const G4NURBS& nurb)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive nurbs" << "\n" ;
@@ -341,20 +341,20 @@ void G4VRML1SCENE::AddPrimitive(const G4NURBS& nurb)
}
void G4VRML1SCENE::AddPrimitive( const G4Text& text )
void G4VRML1SCENEHANDLER::AddPrimitive( const G4Text& text )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive text" << "\n" ;
#endif
G4cerr <<
"***** void G4VRML1SCENE::AddPrimitive( const G4Text& text )"
"***** void G4VRML1SCENEHANDLER::AddPrimitive( const G4Text& text )"
" not implemented yet."
<< "\n";
VRMLBeginModeling () ;
}
void G4VRML1SCENE::AddPrimitive( const G4Circle& circle )
void G4VRML1SCENEHANDLER::AddPrimitive( const G4Circle& circle )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive circle" << "\n" ;
@@ -384,7 +384,7 @@ void G4VRML1SCENE::AddPrimitive( const G4Circle& circle )
}
void G4VRML1SCENE::AddPrimitive(const G4Square& square)
void G4VRML1SCENEHANDLER::AddPrimitive(const G4Square& square)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive square" << "\n" ;
@@ -416,14 +416,7 @@ void G4VRML1SCENE::AddPrimitive(const G4Square& square)
fDest << "}" << "\n"; // Separator
}
void G4VRML1SCENE::ClearStore()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** ClearStore(): No effects" << "\n" ;
#endif
}
void G4VRML1SCENE::BeginModeling()
void G4VRML1SCENEHANDLER::BeginModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginModeling " << "\n" ;
@@ -431,7 +424,7 @@ void G4VRML1SCENE::BeginModeling()
G4VSceneHandler::BeginModeling();
}
void G4VRML1SCENE::EndModeling()
void G4VRML1SCENEHANDLER::EndModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndModeling " << "\n" ;
@@ -439,7 +432,7 @@ void G4VRML1SCENE::EndModeling()
G4VSceneHandler::EndModeling();
}
void G4VRML1SCENE::BeginPrimitives(const G4Transform3D& objectTransformation)
void G4VRML1SCENEHANDLER::BeginPrimitives(const G4Transform3D& objectTransformation)
{
G4VSceneHandler::BeginPrimitives (objectTransformation);
fpObjectTransformation = &objectTransformation;
@@ -449,7 +442,7 @@ void G4VRML1SCENE::BeginPrimitives(const G4Transform3D& objectTransformation)
VRMLBeginModeling();
}
void G4VRML1SCENE::EndPrimitives()
void G4VRML1SCENEHANDLER::EndPrimitives()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndPrimitives " << "\n" ;
@@ -457,7 +450,7 @@ void G4VRML1SCENE::EndPrimitives()
G4VSceneHandler::EndPrimitives();
}
void G4VRML1SCENE::SendMaterialNode( const G4VisAttributes* pVA )
void G4VRML1SCENEHANDLER::SendMaterialNode( const G4VisAttributes* pVA )
{
// const double TRANSPARENCY = 0.9 ;
const double TRANSPARENCY = 0.5 ;
@@ -483,14 +476,14 @@ void G4VRML1SCENE::SendMaterialNode( const G4VisAttributes* pVA )
}
void G4VRML1SCENE::SendMaterialNode()
void G4VRML1SCENEHANDLER::SendMaterialNode()
{
SendMaterialNode
( fpViewer->GetApplicableVisAttributes (fpVisAttribs) );
}
void G4VRML1SCENE::SendMatrixTransformNode(const G4Transform3D *trans)
void G4VRML1SCENEHANDLER::SendMatrixTransformNode(const G4Transform3D *trans)
{
G4Point3D B (0.0, 0.0, 0.0);
@@ -526,7 +519,7 @@ void G4VRML1SCENE::SendMatrixTransformNode(const G4Transform3D *trans)
fDest << "\t" << "}" << "\n";
}
void G4VRML1SCENE::SendCubeNode(G4double w, G4double h, G4double d)
void G4VRML1SCENEHANDLER::SendCubeNode(G4double w, G4double h, G4double d)
{
fDest << "\t\t" << "Cube {" << "\n";
fDest << "\t\t\t" << "width " << w << "\n";
@@ -535,7 +528,7 @@ void G4VRML1SCENE::SendCubeNode(G4double w, G4double h, G4double d)
fDest << "\t\t" << "}" << "\n";
}
void G4VRML1SCENE::SendCylinderNode(G4double R, G4double h)
void G4VRML1SCENEHANDLER::SendCylinderNode(G4double R, G4double h)
{
fDest << "\t\t" << "Transform {" << "\n";
fDest << "\t\t\t" << "rotation 1 0 0 " << (90. * deg) << "\n";
@@ -547,14 +540,14 @@ void G4VRML1SCENE::SendCylinderNode(G4double R, G4double h)
fDest << "\t\t" << "}" << "\n";
}
void G4VRML1SCENE::SendSphereNode(G4double R)
void G4VRML1SCENEHANDLER::SendSphereNode(G4double R)
{
fDest << "\t\t" << "Sphere {" << "\n";
fDest << "\t\t\t" << "radius " << R << "\n";
fDest << "\t\t" << "}" << "\n";
}
void G4VRML1SCENE::VRMLBeginModeling()
void G4VRML1SCENEHANDLER::VRMLBeginModeling()
{
if (!IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
@@ -566,7 +559,7 @@ void G4VRML1SCENE::VRMLBeginModeling()
}
}
void G4VRML1SCENE::VRMLEndModeling()
void G4VRML1SCENEHANDLER::VRMLEndModeling()
{
if ( IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
@@ -578,7 +571,7 @@ void G4VRML1SCENE::VRMLEndModeling()
}
}
void G4VRML1SCENE::SendMarkerColor ( const G4VMarker& mark )
void G4VRML1SCENEHANDLER::SendMarkerColor ( const G4VMarker& mark )
{
const G4Color& color = GetColor( mark );
@@ -600,7 +593,7 @@ void G4VRML1SCENE::SendMarkerColor ( const G4VMarker& mark )
}
void
G4VRML1SCENE::SendMarkerWorldPosition ( const G4VMarker& mark )
G4VRML1SCENEHANDLER::SendMarkerWorldPosition ( const G4VMarker& mark )
{
G4Point3D point = mark.GetPosition();
@@ -613,7 +606,7 @@ G4VRML1SCENE::SendMarkerWorldPosition ( const G4VMarker& mark )
}
G4double G4VRML1SCENE::GetMarkerHalfSize ( const G4VMarker& mark )
G4double G4VRML1SCENEHANDLER::GetMarkerHalfSize ( const G4VMarker& mark )
{
//----- return value ( marker radius in 3d units)
G4double size = 1.0 ; // initialization
@@ -660,6 +653,19 @@ G4double G4VRML1SCENE::GetMarkerHalfSize ( const G4VMarker& mark )
}
void G4VRML1SCENEHANDLER::ClearTransientStore()
{
G4VSceneHandler::ClearTransientStore ();
// This is typically called after an update and before drawing hits
// of the next event. To simulate the clearing of "transients"
// (hits, etc.) the detector is redrawn...
if (fpViewer) {
fpViewer -> SetView ();
fpViewer -> ClearView ();
fpViewer -> DrawView ();
}
}
// #undef ADDTHIS_WITH_NAME(Solid)
// #undef MAKE_NAME(Solid)
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VRML1Viewer.cc,v 1.4.4.1 2001/06/28 19:16:04 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML1Viewer.cc,v 1.6 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRMLView.cc
// Yasuhide Sawada & Satoshi Tanaka
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VRML2.cc,v 1.5.4.1 2001/06/28 19:16:04 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML2.cc,v 1.7 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML2.cc
// Satoshi Tanaka & Yasuhide Sawada
+2 -9
View File
@@ -21,17 +21,12 @@
// ********************************************************************
//
//
// $Id: G4VRML2File.cc,v 1.5.4.1 2001/06/28 19:16:04 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML2File.cc,v 1.8 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML2File.cc
// Satoshi Tanaka & Yasuhide Sawada
//=================//
#ifdef G4VIS_BUILD_VRMLFILE_DRIVER
//=================//
#include <stdio.h> // sscanf
#include <stdlib.h> // getenv
@@ -75,5 +70,3 @@ G4VViewer* G4VRML2File::CreateViewer(G4VSceneHandler& scene, const G4String& nam
return pView;
}
#endif
@@ -21,16 +21,12 @@
// ********************************************************************
//
//
// $Id: G4VRML2FileSceneHandler.cc,v 1.4.4.1 2001/06/28 19:16:04 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML2FileSceneHandler.cc,v 1.7 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML2FileSceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
//=================//
#ifdef G4VIS_BUILD_VRMLFILE_DRIVER
//=================//
//#define DEBUG_FR_SCENE
@@ -68,6 +64,7 @@ const char DEFAULT_WRL_FILE_NAME[] = "g4.wrl";
const char ENV_VRML_VIEWER [] = "G4VRMLFILE_VIEWER";
const char NO_VRML_VIEWER [] = "NONE";
const char VRMLFILE_DEST_DIR [] = "G4VRMLFILE_DEST_DIR";
const int DEFAULT_MAX_WRL_FILE_NUM = 100 ;
G4VRML2FileSceneHandler::G4VRML2FileSceneHandler(G4VRML2File& system, const G4String& name) :
@@ -91,15 +88,15 @@ G4VRML2FileSceneHandler::G4VRML2FileSceneHandler(G4VRML2File& system, const G4St
// maximum number of g4.prim files in the dest directory
fMaxFileNum = 1 ; // initialization
fMaxFileNum = DEFAULT_MAX_WRL_FILE_NUM ; // initialization
if ( getenv( "G4VRMLFILE_MAX_FILE_NUM" ) != NULL ) {
sscanf( getenv("G4VRMLFILE_MAX_FILE_NUM"), "%d", &fMaxFileNum ) ;
} else {
fMaxFileNum = 1 ;
fMaxFileNum = DEFAULT_MAX_WRL_FILE_NUM ;
}
if( fMaxFileNum < 1 ) { fMaxFileNum = 1 ; }
if( fMaxFileNum < 1 ) { fMaxFileNum = 1; }
// PV name pickability
@@ -126,16 +123,16 @@ G4VRML2FileSceneHandler::~G4VRML2FileSceneHandler()
}
#define G4VRML2SCENE G4VRML2FileSceneHandler
#define G4VRML2SCENEHANDLER G4VRML2FileSceneHandler
#define IS_CONNECTED this->isConnected()
#include "G4VRML2SceneHandlerFunc.icc"
#undef IS_CONNECTED
#undef G4VRML2SCENE
#undef G4VRML2SCENEHANDLER
void G4VRML2FileSceneHandler::connectPort()
{
// g4.wrl, g4_1.wrl, ..., g4_MAX_FILE_INDEX.wrl
// g4_00.wrl, g4_01.wrl, ..., g4_MAX_FILE_INDEX.wrl
const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
// dest directory (null if no environmental variables is set)
@@ -147,20 +144,23 @@ void G4VRML2FileSceneHandler::connectPort()
// Determine VRML file name
for( int i = 0 ; i < fMaxFileNum ; i++) {
// Message
if( fMaxFileNum > 1 && i == MAX_FILE_INDEX ) {
// Message in the final execution
if( i == MAX_FILE_INDEX )
{
G4cerr << "===========================================" << G4endl;
G4cerr << "WARNING MESSAGE from VRML2FILE driver: " << 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 an existing file of " << G4endl;
G4cerr << " the same name. " << G4endl;
G4cerr << " You may overwrite existing files, i.e. " << G4endl;
G4cerr << " g4_XX.wrl. " << G4endl;
G4cerr << "===========================================" << G4endl;
}
// re-determine file to G4VRMLFILE_DEST_DIR/g4_i.wrl for i>0
if( i > 0 ) {
sprintf( fVRMLFileName, "%s%s%d.wrl" , fVRMLFileDestDir, WRL_FILE_HEADER, i );
// 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 );
}
// check validity of the file name
@@ -168,7 +168,7 @@ void G4VRML2FileSceneHandler::connectPort()
fin.open(fVRMLFileName) ;
if(!fin) {
// new file
fin.close(); // error recovery
fin.close();
break;
} else {
// already exists (try next)
@@ -219,5 +219,3 @@ void G4VRML2FileSceneHandler::closePort()
G4int G4VRML2FileSceneHandler::fSceneIdCount = 0;
G4int G4VRML2FileSceneHandler::fSceneCount = 0;
#endif
@@ -21,16 +21,12 @@
// ********************************************************************
//
//
// $Id: G4VRML2FileViewer.cc,v 1.5.4.1 2001/06/28 19:16:04 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML2FileViewer.cc,v 1.8 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML2FileViewer.cc
// Satoshi Tanaka & Yasuhide Sawada
//=================//
#ifdef G4VIS_BUILD_VRMLFILE_DRIVER
//=================//
//#define DEBUG_FR_VIEW
@@ -140,6 +136,4 @@ void G4VRML2FileViewer::SendViewParameters ()
fDest << "}" << G4endl;
fDest << G4endl;
}
#endif
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VRML2SceneHandler.cc,v 1.4.4.1 2001/06/28 19:16:04 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML2SceneHandler.cc,v 1.6 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML2SceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -95,11 +95,11 @@ G4VRML2SceneHandler::~G4VRML2SceneHandler()
#define G4VRML2SCENE G4VRML2SceneHandler
#define G4VRML2SCENEHANDLER G4VRML2SceneHandler
#define IS_CONNECTED fDest.isConnected()
#include "G4VRML2SceneHandlerFunc.icc"
#undef IS_CONNECTED
#undef G4VRML2SCENE
#undef G4VRML2SCENEHANDLER
void G4VRML2SceneHandler::connectPort(G4int max_trial)
@@ -21,15 +21,15 @@
// ********************************************************************
//
//
// $Id: G4VRML2SceneHandlerFunc.icc,v 1.7.2.1 2001/06/28 19:16:04 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML2SceneHandlerFunc.icc,v 1.9 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML2SceneHandlerFunc.icc
// Satoshi Tanaka & Yasuhide Sawada
//#define DEBUG_SCENE_FUNC
void G4VRML2SCENE::AddThis(const G4Trd& trd)
void G4VRML2SCENEHANDLER::AddThis(const G4Trd& trd)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis trd" << "\n" ;
@@ -38,7 +38,7 @@ void G4VRML2SCENE::AddThis(const G4Trd& trd)
G4VSceneHandler::AddThis(trd);
}
void G4VRML2SCENE::AddThis(const G4Trap& trap)
void G4VRML2SCENEHANDLER::AddThis(const G4Trap& trap)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis trap" << "\n" ;
@@ -47,7 +47,7 @@ void G4VRML2SCENE::AddThis(const G4Trap& trap)
G4VSceneHandler::AddThis(trap);
}
void G4VRML2SCENE::AddThis(const G4Para& para)
void G4VRML2SCENEHANDLER::AddThis(const G4Para& para)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis para" << "\n" ;
@@ -56,7 +56,7 @@ void G4VRML2SCENE::AddThis(const G4Para& para)
G4VSceneHandler::AddThis(para);
}
void G4VRML2SCENE::AddThis(const G4Torus& torus )
void G4VRML2SCENEHANDLER::AddThis(const G4Torus& torus )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis torus" << "\n" ;
@@ -66,7 +66,7 @@ void G4VRML2SCENE::AddThis(const G4Torus& torus )
}
void G4VRML2SCENE::AddThis(const G4VSolid& vsolid)
void G4VRML2SCENEHANDLER::AddThis(const G4VSolid& vsolid)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis vsolid" << "\n" ;
@@ -75,7 +75,7 @@ void G4VRML2SCENE::AddThis(const G4VSolid& vsolid)
G4VSceneHandler::AddThis(vsolid);
}
void G4VRML2SCENE::AddThis(const G4Tubs& tubs)
void G4VRML2SCENEHANDLER::AddThis(const G4Tubs& tubs)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis tubs" << "\n" ;
@@ -86,7 +86,7 @@ void G4VRML2SCENE::AddThis(const G4Tubs& tubs)
}
void G4VRML2SCENE::AddThis(const G4Cons& cons)
void G4VRML2SCENEHANDLER::AddThis(const G4Cons& cons)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis cons" << "\n" ;
@@ -95,7 +95,7 @@ void G4VRML2SCENE::AddThis(const G4Cons& cons)
G4VSceneHandler::AddThis(cons) ;
}
void G4VRML2SCENE::AddThis(const G4Box& box)
void G4VRML2SCENEHANDLER::AddThis(const G4Box& box)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis box" << "\n" ;
@@ -105,7 +105,7 @@ void G4VRML2SCENE::AddThis(const G4Box& box)
}
void G4VRML2SCENE::AddThis(const G4Sphere& sphere)
void G4VRML2SCENEHANDLER::AddThis(const G4Sphere& sphere)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis sphere" << "\n" ;
@@ -114,7 +114,7 @@ void G4VRML2SCENE::AddThis(const G4Sphere& sphere)
G4VSceneHandler::AddThis(sphere) ;
}
void G4VRML2SCENE::AddPrimitive(const G4Polyline& polyline)
void G4VRML2SCENEHANDLER::AddPrimitive(const G4Polyline& polyline)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive polyline" << "\n" ;
@@ -163,7 +163,7 @@ void G4VRML2SCENE::AddPrimitive(const G4Polyline& polyline)
}
void G4VRML2SCENE::AddPrimitive(const G4Polyhedron& polyhedron)
void G4VRML2SCENEHANDLER::AddPrimitive(const G4Polyhedron& polyhedron)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive(G4Polyhedron)" << "\n";
@@ -245,7 +245,7 @@ void G4VRML2SCENE::AddPrimitive(const G4Polyhedron& polyhedron)
}
void G4VRML2SCENE::AddPrimitive(const G4NURBS& nurb)
void G4VRML2SCENEHANDLER::AddPrimitive(const G4NURBS& nurb)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive nurbs" << "\n" ;
@@ -255,13 +255,13 @@ void G4VRML2SCENE::AddPrimitive(const G4NURBS& nurb)
VRMLBeginModeling () ;
}
void G4VRML2SCENE::AddPrimitive( const G4Text& text )
void G4VRML2SCENEHANDLER::AddPrimitive( const G4Text& text )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive text" << "\n" ;
#endif
G4cerr <<
"***** void G4VRML2SCENE::AddPrimitive( const G4Text& text )"
"***** void G4VRML2SCENEHANDLER::AddPrimitive( const G4Text& text )"
" not implemented yet."
<< "\n";
@@ -269,7 +269,7 @@ void G4VRML2SCENE::AddPrimitive( const G4Text& text )
}
void G4VRML2SCENE::AddPrimitive( const G4Circle& circle )
void G4VRML2SCENEHANDLER::AddPrimitive( const G4Circle& circle )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive circle" << "\n" ;
@@ -327,7 +327,7 @@ void G4VRML2SCENE::AddPrimitive( const G4Circle& circle )
}
void G4VRML2SCENE::AddPrimitive(const G4Square& square)
void G4VRML2SCENEHANDLER::AddPrimitive(const G4Square& square)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive square" << "\n" ;
@@ -388,14 +388,7 @@ void G4VRML2SCENE::AddPrimitive(const G4Square& square)
}
void G4VRML2SCENE::ClearStore()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** ClearStore(): No effetcs" << "\n" ;
#endif
}
void G4VRML2SCENE::BeginModeling()
void G4VRML2SCENEHANDLER::BeginModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginModeling" << "\n" ;
@@ -404,7 +397,7 @@ void G4VRML2SCENE::BeginModeling()
}
void G4VRML2SCENE::EndModeling()
void G4VRML2SCENEHANDLER::EndModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndModeling " << "\n" ;
@@ -412,7 +405,7 @@ void G4VRML2SCENE::EndModeling()
G4VSceneHandler::EndModeling();
}
void G4VRML2SCENE::BeginPrimitives(const G4Transform3D& objectTransformation)
void G4VRML2SCENEHANDLER::BeginPrimitives(const G4Transform3D& objectTransformation)
{
G4VSceneHandler::BeginPrimitives (objectTransformation);
fpObjectTransformation = &objectTransformation;
@@ -422,7 +415,7 @@ void G4VRML2SCENE::BeginPrimitives(const G4Transform3D& objectTransformation)
VRMLBeginModeling();
}
void G4VRML2SCENE::EndPrimitives()
void G4VRML2SCENEHANDLER::EndPrimitives()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndPrimitives " << "\n" ;
@@ -430,7 +423,7 @@ void G4VRML2SCENE::EndPrimitives()
G4VSceneHandler::EndPrimitives();
}
void G4VRML2SCENE::SendMaterialNode( const G4VisAttributes* pVA )
void G4VRML2SCENEHANDLER::SendMaterialNode( const G4VisAttributes* pVA )
{
// Initialization of drawing parameters
G4bool flagWF = false ;
@@ -491,14 +484,14 @@ void G4VRML2SCENE::SendMaterialNode( const G4VisAttributes* pVA )
}
void G4VRML2SCENE::SendMaterialNode()
void G4VRML2SCENEHANDLER::SendMaterialNode()
{
SendMaterialNode
( fpViewer->GetApplicableVisAttributes (fpVisAttribs) );
}
void G4VRML2SCENE::VRMLBeginModeling()
void G4VRML2SCENEHANDLER::VRMLBeginModeling()
{
if (!IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
@@ -510,7 +503,7 @@ void G4VRML2SCENE::VRMLBeginModeling()
}
}
void G4VRML2SCENE::VRMLEndModeling()
void G4VRML2SCENEHANDLER::VRMLEndModeling()
{
if ( IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
@@ -521,7 +514,7 @@ void G4VRML2SCENE::VRMLEndModeling()
}
}
void G4VRML2SCENE::SendMarkerColor ( const G4VMarker& mark )
void G4VRML2SCENEHANDLER::SendMarkerColor ( const G4VMarker& mark )
{
const G4Color& color = GetColor( mark );
@@ -541,7 +534,7 @@ void G4VRML2SCENE::SendMarkerColor ( const G4VMarker& mark )
}
void
G4VRML2SCENE::SendMarkerWorldPosition ( const G4VMarker& mark )
G4VRML2SCENEHANDLER::SendMarkerWorldPosition ( const G4VMarker& mark )
{
G4Point3D point = mark.GetPosition();
@@ -552,7 +545,7 @@ G4VRML2SCENE::SendMarkerWorldPosition ( const G4VMarker& mark )
}
void G4VRML2SCENE::GetMarkerWorldPosition ( const G4VMarker& mark ,
void G4VRML2SCENEHANDLER::GetMarkerWorldPosition ( const G4VMarker& mark ,
double* pX ,
double* pY ,
double* pZ )
@@ -566,7 +559,7 @@ void G4VRML2SCENE::GetMarkerWorldPosition ( const G4VMarker& mark ,
*pZ = point.z() ;
}
G4double G4VRML2SCENE::GetMarkerHalfSize ( const G4VMarker& mark )
G4double G4VRML2SCENEHANDLER::GetMarkerHalfSize ( const G4VMarker& mark )
{
//----- return value ( marker radius in 3d units)
G4double size = 1.0 ; // initialization
@@ -613,7 +606,7 @@ G4double G4VRML2SCENE::GetMarkerHalfSize ( const G4VMarker& mark )
}
void G4VRML2SCENE::SendLineColor ( const G4VisAttributes* pVA )
void G4VRML2SCENEHANDLER::SendLineColor ( const G4VisAttributes* pVA )
{
const G4Color& color = pVA->GetColor();
@@ -632,7 +625,7 @@ void G4VRML2SCENE::SendLineColor ( const G4VisAttributes* pVA )
fDest << "\t" << "}" << "\n"; // appearance
}
G4double G4VRML2SCENE::SetPVTransparency ()
G4double G4VRML2SCENEHANDLER::SetPVTransparency ()
{
G4double TRANSPARENCY = 0.7 ; // initialization
@@ -652,4 +645,19 @@ G4double G4VRML2SCENE::SetPVTransparency ()
return fPVTransparency ;
}
void G4VRML2SCENEHANDLER::ClearTransientStore()
{
G4VSceneHandler::ClearTransientStore ();
// This is typically called after an update and before drawing hits
// of the next event. To simulate the clearing of "transients"
// (hits, etc.) the detector is redrawn...
if (fpViewer) {
fpViewer -> SetView ();
fpViewer -> ClearView ();
fpViewer -> DrawView ();
}
}
// End of file.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VRML2Viewer.cc,v 1.6.4.1 2001/06/28 19:16:05 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VRML2Viewer.cc,v 1.8 2001/09/18 07:53:16 stanaka Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G4VRML2Viewer.cc
// Satoshi Tanaka & Yasuhide Sawada