Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+3
View File
@@ -1,3 +1,6 @@
VRML-V00-01-01 4th November 1999 Satoshi Tanaka
- Introduction of VRMLBeginModeling() for new vis commands
VRML-00-03-07 Satoshi TANAKA Dec 07, 1998
- An environmental variable "G4VRML_VIEWER" is renames to
"G4VRMLFILE_VIEWER" for consistency.
+222
View File
@@ -0,0 +1,222 @@
----- How to visualize Geant4 simulation -----
----- with VRML-network drivers and g4vrmlview -----
November 04, 1999
Satoshi Tanaka and Yasuhide Sawada
Fukui University, Japan
tanaka@i1nws1.fuis.fukui-u.ac.jp
------------------------
Section 1: Introduction
------------------------
This is a document to explain how to perform Geant4
"remote" visualization with VRML. You can visualize Geant4
simulation on your WWW browser.
You have to prepare the following softwares beforehand:
(1) Geant4
(2) g4vrmlview, a small java software included in the Geant4 package
geant4/source/visualization/VRML/g4vrmlview/
Or you can also obtain it from our ftp site:
ftp://i1nws2.fuis.fukui-u.ac.jp/pub/graphics
/fukui_graphics_system/g4vrmlview_VERSION.tar.gz
(3) VRML browser, e.g., vrweb, VRMLview, etc
-----------------------------------------------
Section 2: What is the Geant4 VRML-network drivers?
-----------------------------------------------
Geant4 VRML-network drivers are included in visualization category of
the Geant4 package:
geant4/source/visualization/VRML/
The VRML-network drivers work as follows:
(1) Convert 3D data of Geant4 simulation into VRML 1.0/2.0 codes.
(2) Send the generated VRML codes to another process of "g4vrmlview",
running at either local or remote host.
(Note: For local visualization, use the VRML-file drivers,
which can be invoked with the following commands:
.....
Idle> /vis/sceneHandler/create VRML1FILE
for VRML 1.0 and
Idle> /vis/sceneHandler/create VRML2FILE
for VRML 2.0.
------------------------------------------------------------------------
Section 3: Environmental variables to customize the VRML-network drivers
------------------------------------------------------------------------
You can customize the VRML-network drivers by setting environmental
variables at Geant4 host, i.e., the host where Geant4 runs:
Geant4_host % setenv G4VRML_PORT port_number
Geant4_host % setenv G4VRML_HOST_NAME host_name
The default port number is 40801, and the default host name
is "localhost". You need not define the environmental
variables if you use the default values.
---------------------------------
Section 4: What is g4vrmlview?
---------------------------------
g4vrmlview is a software written in java.
It works as follows:
(1) Receive VRML codes from a VRML-network driver of Geant4
via local or wide-area network.
(2) Save the received VRML codes to a local file named "g4.wrl" etc.
(3) Invoke a VRML viewer, which is specified at the command line,
automatically.
--------------------------------------
Section 5: How to install g4vrmlview
--------------------------------------
You need JDK1.1 to install g4vrmlview.
The installation can be done by doing the following steps:
(1) % cd g4vrmlview
(2) Edit Makefile and set a proper directory name to variable
"INSTALL_DIR". The default setting is:
INSTALL_DIR = "/usr/local/javaclass"
Later, java classes (g4vrmlview.class etc) are installed
to the directory specified by the variable INSTALL_DIR.
(3) Set the environmental variable "CLASSPATH" in .cshrc etc.
(This step can be skipped in some platforms.)
For example, if JDK1.1.1 is installed in the directory
"/usr/local/dev/jdk1.1.1" and you want to install g4vrmlview
into "/usr/local/javaclass", then the variable CLASSPATH
should be defined as:
# java in Unix (.cshrc)
setenv CLASSPATH .:/usr/local/dev/jdk1.1.1/lib/classes.zip:\
/usr/local/javaclass
Similarly, in Windows NT/95, if JDK.1.1 is installed in
the directory "C:\jdk1.1.1" and you want to install g4vrmlview
into C:\dev\javaclass, you should add the following lines to
AUTOEXEC.BAT:
# java in Windows NT/95 (autoexec.bat)
SET CLASSPATH = .;C:\jdk1.1.1\lib\classes.zip;C:\dev\javaclass
(4) % make clean
(5) % make
(6) Test created java classes using g4mini.
You can do it using two separate windows,
instead of using two separate hosts.
Here we assume that we use windows named "window_1"
and "window_2", and use the VRML browser "vrweb".
window_1 % java g4vrmlview vrweb
Waiting for requests at port 40801 ...
window_2 % java g4vrmlview vrweb
% java g4mini
Usage: java g4mini src_file server_hostname
window_2 % java g4mini sample.wrl localhost
The test is successful if you see pictures on the VRML browser.
Now you can use g4vrmlview if the class path of java is,
explicitly or implicitly set to the current directory.
Go on to the next step if you want to install g4vrmlview into
a public place.
Here you have to become root if you do not have permission
to INSTALL_DIR. If the directory INSTALL_DIR does not exist,
it will be created automatically.
(5) % make install
--------------------------------------
Section 6: How to use g4vrmlview
--------------------------------------
(1) Invoke g4vrmlview at the host where g4vrmlview runs,
say, "VRML_host". For example,
VRML_host% java g4vrmlview VRML_browser_name
where the last argument is a name of your favorite VRML browser.
(2) Invoke Geant4 at the host, where Geant4 runs, say, Geant4_host.
For example,
Geant4_host% exampleN03
.....
Idel> /vis/sceneHandler/create VRML1
for VRML 1.0 and
Idel> /vis/sceneHandler/create VRML2
for VRML 2.0.
---------------------------------------
Section 7: More notes on g4vrmlview
---------------------------------------
(1) Format of invoking g4vrmlview:
% java g4vrmlview VRML_browser_name [port_number]
VRML_browser_name:
"netscape", "vrweb", etc,
or "NONE" to suppress invoking VRML browser
port_number:
The default port number is 40801.
If you have set the environmental variable
"G4VRML_PORT" at Geant4 host,
you have to give the same port number.
For example,
Geant4_host % setenv G4VRML_PORT 40802
VRML_host % java g4vrmlview netscape 40802
(2) Auto increment of port number:
If the port number 40801 is already in use, it is
automatically incremented one by one up to 40810.
(3) Multiple thread:
g4vrmlview is a multi-thread software.
It can accept data from plural Geant4 at the same time.
(4) Saving VRML codes to files:
VRML codes sent from Geant4 is saved to a file named
"g4.wrl". If g4.wrl already exists, the file name is
incremented to g4_2.wrl. Similarly the file name is
incremented to g4_3.wrl, g4_4.wrl, etc.
The files are created in the directory where you invoked g4vrmlview.
===== End of document =====
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: g4mini.java,v 1.1 1999/01/07 16:15:09 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: g4mini.java,v 1.1.10.1 1999/12/07 20:53:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
import java.io.*;
import java.net.*;
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: g4vrmlview.java,v 1.1 1999/01/07 16:15:09 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: g4vrmlview.java,v 1.1.10.1 1999/12/07 20:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
import java.io.*;
import java.net.*;
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: FRClient.h,v 1.1 1999/01/07 16:15:09 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: FRClient.h,v 1.1.10.1 1999/12/07 20:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// FRClient.h
// FukuiRenderer Client
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FRClient.hh,v 1.2 1999/01/09 16:27:29 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4FRClient.hh,v 1.2.8.1 1999/12/07 20:53:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4FRClient.hh
// Yasuhide Sawada and Satoshi Tanaka
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1.hh,v 1.5 1999/05/10 15:39:03 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1.hh,v 1.5.8.1 1999/12/07 20:53:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1.hh
// Yasuhide Sawada and Satoshi Tanaka
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1File.hh,v 1.5 1999/05/10 15:39:05 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1File.hh,v 1.5.8.1 1999/12/07 20:53:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1File.hh
// Satoshi Tanaka & Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1FileSceneHandler.hh,v 1.2 1999/05/10 15:39:06 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1FileSceneHandler.hh,v 1.4.4.1 1999/12/07 20:53:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1FileSceneHandler.hh
// Satoshi Tanaka & Yasuhide Sawada
@@ -16,7 +16,6 @@
#ifndef G4VRML1FILE_SCENE_HANDLER_HH
#define G4VRML1FILE_SCENE_HANDLER_HH
#include <rw/tvhdict.h>
#include <fstream.h>
#include "globals.hh"
@@ -61,8 +60,8 @@ public:
void BeginModeling();
void EndModeling();
void beginSending();
void endSending();
void VRMLBeginModeling();
void VRMLEndModeling();
static G4int GetSceneCount() { return fSceneCount; }
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1FileViewer.hh,v 1.3 1999/05/10 15:39:07 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1FileViewer.hh,v 1.3.8.1 1999/12/07 20:53:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1FileViewer.hh
// Satoshi Tanaka and Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1SceneHandler.hh,v 1.2 1999/05/10 15:39:08 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1SceneHandler.hh,v 1.4.4.1 1999/12/07 20:53:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1SceneHandler.hh
// Yasuhide Sawada & Satoshi Tanaka
@@ -16,7 +16,6 @@
#ifndef G4VRML1_SCENE_HANDLER_HH
#define G4VRML1_SCENE_HANDLER_HH
#include <rw/tvhdict.h>
#include "globals.hh"
#include "G4LogicalVolume.hh"
@@ -62,8 +61,8 @@ public:
void BeginModeling();
void EndModeling();
void beginSending();
void endSending();
void VRMLBeginModeling();
void VRMLEndModeling();
static G4int GetSceneCount() { return fSceneCount; }
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1Viewer.hh,v 1.3 1999/05/10 15:39:09 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1Viewer.hh,v 1.3.8.1 1999/12/07 20:53:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1Viewer.hh
// Satoshi Tanaka & Yasuhide Sawada
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2.hh,v 1.5 1999/05/10 15:39:10 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2.hh,v 1.5.8.1 1999/12/07 20:53:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2.hh
// Satoshi Tanaka and Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2File.hh,v 1.5 1999/05/10 15:39:11 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2File.hh,v 1.5.8.1 1999/12/07 20:53:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2File.hh
// Satoshi Tanaka & Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2FileSceneHandler.hh,v 1.2 1999/05/10 15:39:13 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2FileSceneHandler.hh,v 1.3.4.1 1999/12/07 20:53:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2FileSceneHandler.hh
// Satoshi Tanaka & Yasuhide Sawada
@@ -62,9 +62,8 @@ public:
static G4int GetSceneCount() { return fSceneCount; }
// IO
void beginSending();
void endSending();
void VRMLBeginModeling();
void VRMLEndModeling();
void connectPort();
void closePort();
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2FileViewer.hh,v 1.3 1999/05/10 15:39:14 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2FileViewer.hh,v 1.3.8.1 1999/12/07 20:53:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2FileViewer.hh
// Satoshi Tanaka and Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2SceneHandler.hh,v 1.2 1999/05/10 15:39:15 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2SceneHandler.hh,v 1.3.4.1 1999/12/07 20:53:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2SceneHandler.hh
// Satoshi Tanaka & Yasuhide Sawada
@@ -62,9 +62,8 @@ public:
static G4int GetSceneCount() { return fSceneCount; }
// IO
void beginSending();
void endSending();
void VRMLBeginModeling();
void VRMLEndModeling();
void connectPort(int max_trial = MAX_CONNECTION_TRIAL );
void closePort();
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2Viewer.hh,v 1.3 1999/05/10 15:39:16 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2Viewer.hh,v 1.3.8.1 1999/12/07 20:53:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2Viewer.hh
// Satoshi Tanaka & Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRMLNetConfig.hh,v 1.2 1999/01/09 16:27:41 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRMLNetConfig.hh,v 1.2.8.1 1999/12/07 20:53:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRMLNetConfig.hh
// Satoshi Tanaka
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: FRClient.cc,v 1.2 1999/01/09 16:27:41 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: FRClient.cc,v 1.2.8.1 1999/12/07 20:53:44 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// FRClient.cc
// FukuiRenderer Client
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FRClient.cc,v 1.2 1999/01/09 16:27:42 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4FRClient.cc,v 1.2.8.1 1999/12/07 20:53:44 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4FRClient.cc
// Yasuhide Sawada & Satoshi Tanaka
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1.cc,v 1.3 1999/01/11 00:48:04 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1.cc,v 1.3.8.1 1999/12/07 20:53:44 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1.cc
// Yasuhide Sawada & Satoshi Tanaka
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1File.cc,v 1.3 1999/01/11 00:48:05 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1File.cc,v 1.3.8.1 1999/12/07 20:53:45 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1File.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1FileSceneHandler.cc,v 1.1 1999/01/09 16:27:44 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1FileSceneHandler.cc,v 1.1.8.1 1999/12/07 20:53:45 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1FileSceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1FileViewer.cc,v 1.2 1999/01/11 00:48:07 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1FileViewer.cc,v 1.3.4.1 1999/12/07 20:53:45 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRMLView.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -35,8 +35,7 @@ G4VRML1FileViewer::~G4VRML1FileViewer()
void G4VRML1FileViewer::SetView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1FileViewer::SetView()" << endl;
G4cerr << "G4VRML1FileViewer::SetView(); not imlemented. " << endl;
G4cerr << "***** G4VRML1FileViewer::SetView(): No effects" << endl;
#endif
}
@@ -45,6 +44,9 @@ void G4VRML1FileViewer::DrawView()
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1FileViewer::DrawView()" << endl;
#endif
fSceneHandler.VRMLBeginModeling();
// Here is a minimal DrawView() function.
NeedKernelVisit();
ProcessView();
@@ -54,23 +56,22 @@ void G4VRML1FileViewer::DrawView()
void G4VRML1FileViewer::ClearView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1File1View::ClearView()" << endl;
G4cerr << "G4VRML1FileViewer::ClearView(); not implemented. " << endl;
G4cerr << "***** G4VRML1File1View::ClearView(): No effects" << endl;
#endif
}
void G4VRML1FileViewer::ShowView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1FileViewer::ShowView()" << endl;
G4cerr << "***** G4VRML1FileViewer::ShowView()" << endl;
#endif
fSceneHandler.endSending();
fSceneHandler.VRMLEndModeling();
}
void G4VRML1FileViewer::FinishView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1FileViewer::FinishView()" << endl;
G4cerr << "***** G4VRML1FileViewer::FinishView(): No effects" << endl;
#endif
}
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1SceneHandler.cc,v 1.1 1999/01/09 16:27:46 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1SceneHandler.cc,v 1.1.8.1 1999/12/07 20:53:46 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1SceneHandler.cc
// Yasuhide Sawada and Satoshi Tanaka
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1SceneHandlerFunc.icc,v 1.2 1999/01/11 00:48:08 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1SceneHandlerFunc.icc,v 1.3.4.1 1999/12/07 20:53:46 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML1SceneHandlerFunc.icc
// Satoshi Tanaka & Yasuhide Sawada
@@ -24,32 +24,36 @@
void G4VRML1SCENE::AddThis(const G4Trd& trd)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis trd\n";
G4cerr << "***** AddThis trd" << endl ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(trd)
}
void G4VRML1SCENE::AddThis(const G4Trap& trap)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis trap\n";
G4cerr << "***** AddThis trap" << endl ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(trap)
}
void G4VRML1SCENE::AddThis(const G4Para& para)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis para\n";
G4cerr << "***** AddThis para" << endl ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(para)
}
void G4VRML1SCENE::AddThis(const G4Torus& torus )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis torus\n";
G4cerr << "***** AddThis torus" << endl ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(torus)
}
@@ -57,16 +61,19 @@ void G4VRML1SCENE::AddThis(const G4Torus& torus )
void G4VRML1SCENE::AddThis(const G4VSolid& vsolid)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis vsolid\n";
G4cerr << "***** AddThis vsolid" << endl ;
#endif
VRMLBeginModeling () ;
ADDTHIS_WITH_NAME(vsolid)
}
void G4VRML1SCENE::AddThis(const G4Tubs& tubs)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis tubs\n";
G4cerr << "***** AddThis tubs" << endl ;
#endif
VRMLBeginModeling () ;
// set current name
fCurrentDEF = "tubs_" + tubs.GetName();
@@ -88,7 +95,7 @@ void G4VRML1SCENE::AddThis(const G4Tubs& tubs)
fDest << "\t" << "}" << endl; // DEF Separator
fDest << "}" << endl; // Separator
} else {
// call AddPrimitives(Polyhedron)
// call AddPrimitive(Polyhedron)
RequestPrimitives(tubs);
}
@@ -100,8 +107,10 @@ void G4VRML1SCENE::AddThis(const G4Tubs& tubs)
void G4VRML1SCENE::AddThis(const G4Cons& cons)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis cons\n";
G4cerr << "***** AddThis cons" << endl ;
#endif
VRMLBeginModeling () ;
// set current name
fCurrentDEF = "cons_" + cons.GetName();
@@ -126,7 +135,7 @@ void G4VRML1SCENE::AddThis(const G4Cons& cons)
fDest << "\t" << "}" << endl; // DEF Separator
fDest << "}" << endl; // Separator
} else {
// call AddPrimitives(Polyhedron)
// call AddPrimitive(Polyhedron)
RequestPrimitives(cons);
}
@@ -137,8 +146,10 @@ void G4VRML1SCENE::AddThis(const G4Cons& cons)
void G4VRML1SCENE::AddThis(const G4Box& box)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis box\n";
G4cerr << "***** AddThis box" << endl ;
#endif
VRMLBeginModeling () ;
// set current name
fCurrentDEF = "box_" + box.GetName();
@@ -163,8 +174,10 @@ void G4VRML1SCENE::AddThis(const G4Box& box)
void G4VRML1SCENE::AddThis(const G4Sphere& sphere)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis sphere\n";
G4cerr << "***** AddThis sphere" << endl ;
#endif
VRMLBeginModeling () ;
// set current name
fCurrentDEF = "sphere_" + sphere.GetName();
@@ -186,7 +199,7 @@ void G4VRML1SCENE::AddThis(const G4Sphere& sphere)
fDest << "\t" << "}" << endl; // DEF Separator
fDest << "}" << endl; // Separator
} else {
// call AddPrimitives(Polyhedron)
// call AddPrimitive(Polyhedron)
RequestPrimitives( sphere );
}
@@ -197,8 +210,9 @@ void G4VRML1SCENE::AddThis(const G4Sphere& sphere)
void G4VRML1SCENE::AddPrimitive(const G4Polyline& polyline)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive polyline\n";
G4cerr << "***** AddPrimitive polyline" << endl ;
#endif
VRMLBeginModeling () ;
fDest << "Separator {" << endl;
@@ -237,6 +251,7 @@ void G4VRML1SCENE::AddPrimitive(const G4Polyhedron& polyhedron)
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive(G4Polyhedron)" << endl;
#endif
VRMLBeginModeling () ;
fDest << "Separator {" << endl;
@@ -294,36 +309,40 @@ void G4VRML1SCENE::AddPrimitive(const G4Polyhedron& polyhedron)
fDest << "\t" << "}" << endl; // (DEF) Separator
fDest << "}" << endl; // Separator
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** end of AddPrimitive(G4Polyhedron)\n";
#endif
}
void G4VRML1SCENE::AddPrimitive(const G4NURBS& nurb)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive nurbs\n";
G4cerr << "***** AddPrimitive nurbs" << endl ;
#endif
G4cerr << "G4VRML1File::AddPrimitive(G4NURBS&): not implemented. \n";
G4cerr << "G4VRML1File::AddPrimitive(G4NURBS&): not implemented. " << endl ;
VRMLBeginModeling () ;
}
void G4VRML1SCENE::AddPrimitive( const G4Text& text )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrim mark text\n";
G4cerr << "***** AddPrimitive text" << endl ;
#endif
G4cerr <<
"***** void G4VRML1SCENE::AddPrimitive( const G4Text& text )"
" not implemented yet."
<< endl;
VRMLBeginModeling () ;
}
void G4VRML1SCENE::AddPrimitive( const G4Circle& circle )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrim mark circle\n";
G4cerr << "***** AddPrimitive circle" << endl ;
#endif
VRMLBeginModeling () ;
// begin sending a mark
fDest << "Separator {" << endl;
@@ -345,23 +364,26 @@ void G4VRML1SCENE::AddPrimitive( const G4Circle& circle )
fDest << "}" << endl; // Separator
}
void G4VRML1SCENE::AddPrimitive(const G4Square& Square) // mark Square
void G4VRML1SCENE::AddPrimitive(const G4Square& square)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrim mark Square\n";
G4cerr << "***** AddPrimitive square" << endl ;
#endif
VRMLBeginModeling () ;
// begin sending a mark
fDest << "Separator {" << endl;
// send color
SendMarkerColor ( Square );
SendMarkerColor ( square );
// position
SendMarkerWorldPosition ( Square );
SendMarkerWorldPosition ( square );
// Calc size
G4double size = GetMarkerHalfSize ( Square );
G4double size = GetMarkerHalfSize ( square );
size *= 2.;
// send shape with size
@@ -378,23 +400,22 @@ void G4VRML1SCENE::AddPrimitive(const G4Square& Square) // mark Square
void G4VRML1SCENE::ClearStore()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** ClearStore()\n";
G4cerr << "***** ClearStore(): No effects" << endl ;
#endif
}
void G4VRML1SCENE::BeginModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginModeling\n";
G4cerr << "***** BeginModeling " << endl ;
#endif
G4VSceneHandler::BeginModeling();
beginSending();
}
void G4VRML1SCENE::EndModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndModeling \n";
G4cerr << "***** EndModeling " << endl ;
#endif
G4VSceneHandler::EndModeling();
}
@@ -404,15 +425,15 @@ void G4VRML1SCENE::BeginPrimitives(const G4Transform3D& objectTransformation)
G4VSceneHandler::BeginPrimitives (objectTransformation);
fpObjectTransformation = &objectTransformation;
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginPrimitives \n";
G4cerr << "***** BeginPrimitives " << endl ;
#endif
beginSending();
VRMLBeginModeling();
}
void G4VRML1SCENE::EndPrimitives()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndPrimitives \n";
G4cerr << "***** EndPrimitives " << endl ;
#endif
G4VSceneHandler::EndPrimitives();
}
@@ -514,18 +535,25 @@ void G4VRML1SCENE::SendSphereNode(G4double R)
fDest << "\t\t" << "}" << endl;
}
void G4VRML1SCENE::beginSending()
void G4VRML1SCENE::VRMLBeginModeling()
{
if (!IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** VRMLBeginModeling() (started)" << endl ;
#endif
this->connectPort();
fDest << "#VRML V1.0 ascii" << endl;
fDest << "# Generated by VRML driver of GEANT4\n" << endl;
fDest << "# Generated by VRML 1.0 driver of GEANT4\n" << endl;
}
}
void G4VRML1SCENE::endSending()
void G4VRML1SCENE::VRMLEndModeling()
{
if ( IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** VRMLEndModeling() (started)" << endl ;
#endif
fDest << "#End of file." << endl;
this->closePort();
}
+11 -12
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML1Viewer.cc,v 1.2 1999/01/11 00:48:09 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML1Viewer.cc,v 1.3.4.1 1999/12/07 20:53:46 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRMLView.cc
// Yasuhide Sawada & Satoshi Tanaka
@@ -34,8 +34,7 @@ G4VRML1Viewer::~G4VRML1Viewer()
void G4VRML1Viewer::SetView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::SetView()" << endl;
G4cerr << "G4VRML1Viewer::SetView(); not imlemented. " << endl;
G4cerr << "***** G4VRML1Viewer::SetView(): No effects" << endl;
#endif
}
@@ -44,6 +43,9 @@ void G4VRML1Viewer::DrawView()
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::DrawView()" << endl;
#endif
fSceneHandler.VRMLBeginModeling();
// Here is a minimal DrawView() function.
NeedKernelVisit();
ProcessView();
@@ -53,26 +55,23 @@ void G4VRML1Viewer::DrawView()
void G4VRML1Viewer::ClearView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::ClearView()" << endl;
G4cerr << "G4VRML1Viewer::ClearView(); not implemented. " << endl;
G4cerr << "***** G4VRML1Viewer::ClearView(): No effects" << endl;
#endif
}
void G4VRML1Viewer::ShowView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::ShowView()" << endl;
G4cerr << "***** G4VRML1Viewer::ShowView()" << endl;
#endif
fSceneHandler.endSending();
fSceneHandler.VRMLEndModeling();
}
void G4VRML1Viewer::FinishView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML1Viewer::FinishView()" << endl;
//G4cerr << "G4VRML1Viewer::FinishView(); not implemented. " << endl;
G4cerr << "***** G4VRML1Viewer::FinishView(): No effects" << endl;
#endif
//fSceneHandler.endSending();
}
#endif
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2.cc,v 1.3 1999/01/11 00:48:09 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2.cc,v 1.3.8.1 1999/12/07 20:53:46 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2.cc
// Satoshi Tanaka & Yasuhide Sawada
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2File.cc,v 1.3 1999/01/11 00:48:10 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2File.cc,v 1.3.8.1 1999/12/07 20:53:47 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2File.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2FileSceneHandler.cc,v 1.1 1999/01/09 16:27:50 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2FileSceneHandler.cc,v 1.1.8.1 1999/12/07 20:53:47 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2FileSceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2FileViewer.cc,v 1.2 1999/01/11 00:48:11 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2FileViewer.cc,v 1.3.4.1 1999/12/07 20:53:47 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2FileViewer.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -42,8 +42,7 @@ G4VRML2FileViewer::~G4VRML2FileViewer()
void G4VRML2FileViewer::SetView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2FileViewer::SetView()" << endl;
G4cerr << "G4VRML2FileViewer::SetView(); not imlemented. " << endl;
G4cerr << "***** G4VRML2FileViewer::SetView(): No effects" << endl;
#endif
// Do nothing, since VRML a browser is running as a different process.
@@ -57,8 +56,7 @@ void G4VRML2FileViewer::DrawView()
G4cerr << "***** G4VRML2FileViewer::DrawView()" << endl;
#endif
// Open VRML2 file and output header comments
fSceneHandler.beginSending() ;
fSceneHandler.VRMLBeginModeling() ;
// Viewpoint node
SendViewParameters();
@@ -72,23 +70,22 @@ void G4VRML2FileViewer::DrawView()
void G4VRML2FileViewer::ClearView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2File1View::ClearView()" << endl;
G4cerr << "G4VRML2FileViewer::ClearView(); not implemented. " << endl;
G4cerr << "***** G4VRML2File1View::ClearView(): No effects" << endl;
#endif
}
void G4VRML2FileViewer::ShowView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2FileViewer::ShowView()" << endl;
G4cerr << "***** G4VRML2FileViewer::ShowView()" << endl;
#endif
fSceneHandler.endSending();
fSceneHandler.VRMLEndModeling();
}
void G4VRML2FileViewer::FinishView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2FileViewer::FinishView()" << endl;
G4cerr << "***** G4VRML2FileViewer::FinishView(): No effects" << endl;
#endif
}
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2SceneHandler.cc,v 1.1 1999/01/09 16:27:53 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2SceneHandler.cc,v 1.1.8.1 1999/12/07 20:53:47 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2SceneHandler.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2SceneHandlerFunc.icc,v 1.2 1999/01/11 00:48:11 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2SceneHandlerFunc.icc,v 1.3.4.1 1999/12/07 20:53:47 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2SceneHandlerFunc.icc
// Satoshi Tanaka & Yasuhide Sawada
@@ -16,32 +16,36 @@
void G4VRML2SCENE::AddThis(const G4Trd& trd)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis trd\n";
G4cerr << "***** AddThis trd" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(trd);
}
void G4VRML2SCENE::AddThis(const G4Trap& trap)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis trap\n";
G4cerr << "***** AddThis trap" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(trap);
}
void G4VRML2SCENE::AddThis(const G4Para& para)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis para\n";
G4cerr << "***** AddThis para" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(para);
}
void G4VRML2SCENE::AddThis(const G4Torus& torus )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis torus\n";
G4cerr << "***** AddThis torus" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(torus);
}
@@ -49,16 +53,18 @@ void G4VRML2SCENE::AddThis(const G4Torus& torus )
void G4VRML2SCENE::AddThis(const G4VSolid& vsolid)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis vsolid\n";
G4cerr << "***** AddThis vsolid" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(vsolid);
}
void G4VRML2SCENE::AddThis(const G4Tubs& tubs)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis tubs\n";
G4cerr << "***** AddThis tubs" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(tubs) ;
}
@@ -67,16 +73,18 @@ void G4VRML2SCENE::AddThis(const G4Tubs& tubs)
void G4VRML2SCENE::AddThis(const G4Cons& cons)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis cons\n";
G4cerr << "***** AddThis cons" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(cons) ;
}
void G4VRML2SCENE::AddThis(const G4Box& box)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis box\n";
G4cerr << "***** AddThis box" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(box) ;
}
@@ -84,17 +92,20 @@ void G4VRML2SCENE::AddThis(const G4Box& box)
void G4VRML2SCENE::AddThis(const G4Sphere& sphere)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddThis sphere\n";
G4cerr << "***** AddThis sphere" << endl ;
#endif
VRMLBeginModeling () ;
G4VSceneHandler::AddThis(sphere) ;
}
void G4VRML2SCENE::AddPrimitive(const G4Polyline& polyline)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive polyline\n";
G4cerr << "***** AddPrimitive polyline" << endl ;
#endif
VRMLBeginModeling () ;
// VRML codes are generated below
fDest << "#---------- POLYLINE" << endl;
@@ -142,6 +153,8 @@ void G4VRML2SCENE::AddPrimitive(const G4Polyhedron& polyhedron)
cerr << "***** AddPrimitive(G4Polyhedron)" << endl;
#endif
VRMLBeginModeling () ;
// Transparency checking: If completely transparent, skip drawing
if ( GetPVTransparency() > 0.99 ) { return ; }
@@ -211,36 +224,40 @@ void G4VRML2SCENE::AddPrimitive(const G4Polyhedron& polyhedron)
fDest << "}" << endl; // Anchor
}
#if defined DEBUG_SCENE_FUNC
cerr << "***** end of AddPrimitive(G4Polyhedron)\n";
#endif
}
void G4VRML2SCENE::AddPrimitive(const G4NURBS& nurb)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrimitive nurbs\n";
G4cerr << "***** AddPrimitive nurbs" << endl ;
#endif
G4cerr << "G4VRML2File::AddPrimitive(G4NURBS&): not implemented. \n";
G4cerr << "G4VRML2File::AddPrimitive(G4NURBS&): not implemented. " << endl ;
VRMLBeginModeling () ;
}
void G4VRML2SCENE::AddPrimitive( const G4Text& text )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrim mark text\n";
G4cerr << "***** AddPrimitive text" << endl ;
#endif
G4cerr <<
"***** void G4VRML2SCENE::AddPrimitive( const G4Text& text )"
" not implemented yet."
<< endl;
VRMLBeginModeling () ;
}
void G4VRML2SCENE::AddPrimitive( const G4Circle& circle )
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrim mark circle\n";
G4cerr << "***** AddPrimitive circle" << endl ;
#endif
VRMLBeginModeling () ;
// Information
// const char* info = NULL ;
const char* info = circle.GetInfo() ;
@@ -292,12 +309,14 @@ void G4VRML2SCENE::AddPrimitive( const G4Circle& circle )
}
void G4VRML2SCENE::AddPrimitive(const G4Square& square) // mark Square
void G4VRML2SCENE::AddPrimitive(const G4Square& square)
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** AddPrim mark Square\n";
G4cerr << "***** AddPrimitive square" << endl ;
#endif
VRMLBeginModeling () ;
// Information
// const char* info = NULL ;
const char* info = square.GetInfo() ;
@@ -354,26 +373,23 @@ void G4VRML2SCENE::AddPrimitive(const G4Square& square) // mark Square
void G4VRML2SCENE::ClearStore()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** ClearStore()\n";
G4cerr << "***** ClearStore(): No effetcs" << endl ;
#endif
}
void G4VRML2SCENE::BeginModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginModeling\n";
G4cerr << "***** BeginModeling" << endl ;
#endif
G4VSceneHandler::BeginModeling();
beginSending(); // error recovery:
// This function should be already called in
// DrawView() of the View class
// before camera setting
}
void G4VRML2SCENE::EndModeling()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndModeling \n";
G4cerr << "***** EndModeling " << endl ;
#endif
G4VSceneHandler::EndModeling();
}
@@ -383,18 +399,15 @@ void G4VRML2SCENE::BeginPrimitives(const G4Transform3D& objectTransformation)
G4VSceneHandler::BeginPrimitives (objectTransformation);
fpObjectTransformation = &objectTransformation;
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** BeginPrimitives \n";
G4cerr << "***** BeginPrimitives " << endl ;
#endif
beginSending(); // error recovery:
// This function should be already called in
// DrawView() of the View class
// before camera setting
VRMLBeginModeling();
}
void G4VRML2SCENE::EndPrimitives()
{
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** EndPrimitives \n";
G4cerr << "***** EndPrimitives " << endl ;
#endif
G4VSceneHandler::EndPrimitives();
}
@@ -467,18 +480,24 @@ void G4VRML2SCENE::SendMaterialNode()
}
void G4VRML2SCENE::beginSending()
void G4VRML2SCENE::VRMLBeginModeling()
{
if (!IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** VRMLBeginModeling (started)" << endl ;
#endif
this->connectPort();
fDest << "#VRML V2.0 utf8" << endl;
fDest << "# Generated by VRML 2.0 driver of GEANT4\n" << endl;
}
}
void G4VRML2SCENE::endSending()
void G4VRML2SCENE::VRMLEndModeling()
{
if ( IS_CONNECTED ) {
#if defined DEBUG_SCENE_FUNC
G4cerr << "***** VRMLEndModeling (started)" << endl ;
#endif
fDest << "#End of file." << endl;
this->closePort();
}
+9 -14
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VRML2Viewer.cc,v 1.2 1999/01/11 00:48:12 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VRML2Viewer.cc,v 1.3.4.1 1999/12/07 20:53:47 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// G4VRML2Viewer.cc
// Satoshi Tanaka & Yasuhide Sawada
@@ -41,8 +41,7 @@ G4VRML2Viewer::~G4VRML2Viewer()
void G4VRML2Viewer::SetView()
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::SetView()" << endl;
G4cerr << "G4VRML2Viewer::SetView(); not imlemented. " << endl;
G4cerr << "***** G4VRML2Viewer::SetView(): No effects" << endl;
#endif
// Do nothing, since VRML a browser is running as a different process.
@@ -56,8 +55,7 @@ void G4VRML2Viewer::DrawView()
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::DrawView()" << endl;
#endif
// Open VRML2 file and output header comments
fSceneHandler.beginSending() ;
fSceneHandler.VRMLBeginModeling() ;
// Viewpoint node
SendViewParameters();
@@ -71,26 +69,23 @@ void G4VRML2Viewer::DrawView()
void G4VRML2Viewer::ClearView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::ClearView()" << endl;
G4cerr << "G4VRML2Viewer::ClearView(); not implemented. " << endl;
G4cerr << "***** G4VRML2Viewer::ClearView(): No effects" << endl;
#endif
}
void G4VRML2Viewer::ShowView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::ShowView()" << endl;
G4cerr << "***** G4VRML2Viewer::ShowView()" << endl;
#endif
fSceneHandler.endSending();
fSceneHandler.VRMLEndModeling();
}
void G4VRML2Viewer::FinishView(void)
{
#if defined DEBUG_FR_VIEW
G4cerr << "***** G4VRML2Viewer::FinishView()" << endl;
//G4cerr << "G4VRML2Viewer::FinishView(); not implemented. " << endl;
G4cerr << "***** G4VRML2Viewer::FinishView(): No effects" << endl;
#endif
//fSceneHandler.endSending();
}
void G4VRML2Viewer::SendViewParameters ()