<< FAQ for Geant4 visualization >>
            September 12, 1999 (First version)
            September 13, 1999 (Revised 1)

###################
##### General #####
###################
----------------------------------------------------------------------
Q: Where can I get information of Geant4 visualization?

A: See the file "geant4/source/visualization/README" first.
   You can also find detailed information in Geant4 User's Guide.
   The sample program "genat4/examples/novice/N03/examplesN03.cc" etc 
   also demonstrate Geant4 visualization.  

----------------------------------------------------------------------
Q: Why does no visualization window appear on my display?

A: Check if "xhost" has been executed in your login host, and 
   also check if the environmental variable "DISPLAY" is properly set.
   See documents of UNIX (X-Window) for details.

----------------------------------------------------------------------
Q: How can I add/remove visualization driver(s) to/from my Geant4?

A: For example, in case of examples/novice/N03, 
   the simplest way is as follows (XXX is a driver name):

     % setenv G4VIS_BUILD_XXX            1
     ..... 
     % setenv G4VIS_USE_XXX              1
     .....
     % cd geant4/source/visualization    
     % gmake clean
     % gmake global
     % cd ../source
     % gmake global
     % cd ../examples/novice/N03
     % gmake clean
     % gmake 

   More elegant way is described in geant4/source/visualization/README.

----------------------------------------------------------------------
Q: What is the difference between commands under /vis~/ and /vis/?

A: The visualization commands are under reconstruction.
   The commands under /vis~/ are old ones, and they will be 
   replaced with new commands in future.
   The new commands, which are still under development, are placed 
   under /vis/.  At present, most of the old commands are tentatively 
   placed under /vis/, too.  For details of the current status of the 
   visualization commands, see User's Guide.
----------------------------------------------------------------------


###########################
##### DAWNFILE driver #####
###########################
----------------------------------------------------------------------
Q: Where can I obtain Fukui Renderer DAWN?

A: You need Fukui Renderer DAWN for Geant4 visualization with the 
   DAWNFILE driver.  You can obtain the source codes and detailed 
   information of DAWN from the following site:

     http://geant4.kek.jp/~tanaka 

   Use DAWN version 3.80a for the visualization category 
   of the CVS tag vis-V00-01-01 or of the latter tags.
   For the older tags, use DAWN version 3.70a.

   For the Geant4.0.0, use DAWN version 3.70a.
   For the un-patched Geant4.0.1, use DAWN version 3.70a.

----------------------------------------------------------------------
Q: How can I incorporate the DAWNFILE driver into my Geant4?

A: Set the following environmental variables (or C-macros in a 
   proper GNUmakefile) before installation and compilation, 
   respectively.

   ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION:               

     % setenv G4VIS_BUILD_DAWNFILE_DRIVER  1                          

   ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION:               
                                                                     
     % setenv G4VIS_USE_DAWNFILE           1                         

----------------------------------------------------------------------
Q: Why isn't the DAWN GUI panel invoked on my display?

A: The are two possibilities:
   (1) You have not executed "xhost" in your login host, and/or 
       you have not set the environmental variable "DISPLAY".
   (2) The parameter file of DAWN is broken for some reason.
       Do the followings to clean up the parameter file in the 
       current directory:

       % dawn -c

----------------------------------------------------------------------
Q: How can I skip to invoke the DAWN GUI panel?

A: Set an environmental variable as follows before executing your 
   Geant4:

     % setenv G4DAWNFILE_VIEWER "dawn -d"

   The option "-d" makes DAWN skip invoke the GUI panel.

----------------------------------------------------------------------
Q: How can I use DAVID for geometry-overlapping tests?

A: Set an environmental variable as follows before executing your 
   Geant4:

     % setenv G4DAWNFILE_VIEWER "david"

   and perform Geant4 visualization with the DAWNFILE driver.

   In order to control tolerance of the geometry-overlapping tests,
   set an environmental variable as follows:

     % setenv DAVID_EPSILON_3D  tolerance

   where the argument is a proper value of tolerance.
   The default value of tolerance is 1.0e-3.

   If you have a "g4.prim" file, which is a DAWN-format file 
   generated by Geant4, you can also invoke DAVID by hand to check 
   its geometry overlapping:

     % david g4.prim

   You can obtain source codes and detailed information of DAVID 
   from the following site:

     http://geant4.kek.jp/~tanaka 

----------------------------------------------------------------------
Q: How can I use the batch mode of Fukui Renderer DAWN

A: In the batch mode, the DAWN GUI panel is not invoked, and no 
   PostScript viewer is invoked, either.  All that DAWN does is to 
   generate a PostScript file "g4.eps" in the current directory.  
   Such a batch mode is quite useful, for example, in the following 
   cases:

     (1) Geant4 is running in a remote host and the network 
         connection to your local host is quite slow.
     (2) You are using a character terminal, such as the "telnet" 
         terminal of Windows 98/NT/2000.

   In such cases, you can perform only PostScript-file generation, 
   and you can visualize and/or print out them later.

   DAWN runs in the batch mode if you set an environmental variable 
   as follows: 

     % setenv DAWN_BATCH  1

   In this case, Geant4 visualization is saved to a PostScript file
   "g4.eps", and the file is overwritten at every visualization. 

   Or if you want to save all visualization in a multi-page "g4.eps" 
   file, set as follows:

     % setenv DAWN_BATCH  a

   where "a" means the append mode of DAWN.
----------------------------------------------------------------------


#########################
##### OpenGL driver #####
#########################
----------------------------------------------------------------------
Q: How can I incorporate the OpenGL-Xlib driver into my Geant4?

A: Set the following environmental variables (or C-macros in a 
   proper GNUmakefile) before installation and compilation,
   respectively.

     ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION:               

       % setenv OGLHOME     ... (e.g. /usr/local)                       
       % setenv G4VIS_BUILD_OPENGLX_DRIVER   1                          

     ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION:               
                                                                     
       % setenv OGLHOME     ... (e.g. /usr/local)                       
       % setenv G4VIS_USE_OPENGLX            1                         

   The variable OGLHOME tells your C++ compiler the place where
   libraries and header files of OpenGL are installed.

----------------------------------------------------------------------
Q: Can I use "Mesa" instead of the native OpenGL?

A: Of course, you can use Mesa.  But you need to "rename" libraries.
   Ask your system manager to make the following symbolic links
   in the directory where the Mesa libraries are installed:

   % ln -s libMesaGL.a libGL.a
   % ln -s libMesaGLU.a libGLU.a

----------------------------------------------------------------------
Q: I cannot compile the OpenGL driver with STL + egcs (g++).

A: You have to edit a file for the STL library. 
   The file is "/usr/include/g++-2/stl-hash-fun.h", 
   for example, in case of the Red Hat Linux 6.0. 
   Comment out the following lines:

     /***** 
     __STL_TEMPLATE_NULL struct hash {
     size_t operator()(unsigned char x) const { return x; }
     };
     *****/

   It is necessary because "struct hash" is regarded 
   as the duplicated definition of "struct hash" by the egcs 
   (g++) compiler.  In the current version of Geant4, 
   such editing is necessary if you want to use the OpenGL driver, 
   which is using the hash algorithm for high-speed visualization.

----------------------------------------------------------------------


#########################
##### OPACS  driver #####
#########################

----------------------------------------------------------------------

###############################
##### OpenInventor driver #####
###############################

----------------------------------------------------------------------

###########################
##### VRMLFILE driver #####
###########################

----------------------------------------------------------------------