Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 1999/04/15 15:27:55 johna Exp $
# $Id: GNUmakefile,v 1.3 2000/04/07 13:32:40 gcosmo Exp $
name := G4FR
@@ -17,6 +17,7 @@ CPPFLAGS += -I$(G4BASE)/graphics_reps/include
CPPFLAGS += -I$(G4BASE)/intercoms/include
CPPFLAGS += -I$(G4BASE)/global/HEPGeometry/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/CSG/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/specific/include
CPPFLAGS += -I$(G4BASE)/geometry/management/include
CPPFLAGS += -I$(G4BASE)/geometry/volumes/include
@@ -1,3 +1,18 @@
DAWN-V01-01-04
- Target = standard target in scene
+ relative target in view
(G4DAWNFILEView.cc, G4FukuiRendererView.cc)
- Automatic filename incrementation is made default.
g4_00.prim, g4_01.prim, ... , g4_99.prim
g4_00.eps , g4_01.eps , ... , g4_99.eps
DAWN-V01-01-03 Satoshi TANAKA May 11, 2000
- In G4DAWNFILEViewer.cc,
< strcpy( fPSViewer, "ghostview" );
---
> // strcpy( fPSViewer, "ghostview" );
> strcpy( fPSViewer, "gv" );
DAWN-V00-01-08
- Removed implicit casting from the previous updation
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DAWNFILE.hh,v 1.5 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE driver factory.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DAWNFILESceneHandler.hh,v 1.5 1999/12/16 17:24:48 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DAWNFILEViewer.hh,v 1.5 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE viewer - opens window, hard copy, etc.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FRClientServer.hh,v 1.3 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4FRClientServer.hh,v 1.4 2000/02/29 09:54:38 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA, Wed Jul 3 14:13:52 JST 1996
////////////////////////////////
@@ -59,7 +59,7 @@ class G4FRClientServer {
protected:
void Err( char* message ) { perror(message) ;}
void Err( const char* message ) { perror(message) ;}
void SetSendingMessage( const char* message )
{ strcpy( fSendingMessage, message );}
void Send() ; // send command in fSendingMessage
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRConst.hh,v 1.4 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA, Tue Jul 2 15:30:49 JST 1996
///////////////////////////////////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRFeatures.hh,v 1.3 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
#if !defined G4_FR_FEATURES_HH
#define G4_FR_FEATURES_HH
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRSocketConfig.hh,v 1.3 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
////////////////////////////////
///// G4FRSocketConfig.h /////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRSocketMacro.hh,v 1.3 1999/12/15 14:54:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
///////////////////////////////
///// G4FRSocketMacro.hh /////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRofstream.hh,v 1.3 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
#include"g4std/fstream"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FukuiRenderer.hh,v 1.5 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FukuiRendererSceneHandler.hh,v 1.5 1999/12/16 17:24:49 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 11:19:19 JST 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FukuiRendererViewer.hh,v 1.5 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 12:10:14 JST 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DAWNFILE.cc,v 1.5 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE factory.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DAWNFILESceneHandler.cc,v 1.3 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DAWNFILESceneHandler.cc,v 1.5 2000/05/16 15:56:43 stanaka Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE scene.
@@ -32,6 +32,7 @@
#include "G4DAWNFILEViewer.hh"
#include "G4Point3D.hh"
#include "G4VisAttributes.hh"
#include "G4Scene.hh"
#include "G4Transform3D.hh"
#include "G4Polyhedron.hh"
#include "G4Box.hh"
@@ -39,6 +40,10 @@
#include "G4Polyline.hh"
#include "G4Trd.hh"
#include "G4Tubs.hh"
#include "G4Trap.hh"
#include "G4Torus.hh"
#include "G4Sphere.hh"
#include "G4Para.hh"
#include "G4Text.hh"
#include "G4Circle.hh"
#include "G4Square.hh"
@@ -48,7 +53,14 @@
//----- constants
const char FR_ENV_CULL_INVISIBLE_OBJECTS [] = "G4DAWN_CULL_INVISIBLE_OBJECTS";
const char G4PRIM_FILE_HEADER [] = "g4_";
const char DEFAULT_G4PRIM_FILE_NAME[] = "g4.prim";
const char DEFAULT_G4PRIM_FILE_NAME[] = "g4_00.prim";
// const int FR_MAX_FILE_NUM = 1 ;
// const int FR_MAX_FILE_NUM = 5 ;
// const int FR_MAX_FILE_NUM = 10 ;
// const int FR_MAX_FILE_NUM = 15 ;
// const int FR_MAX_FILE_NUM = 20 ;
const int FR_MAX_FILE_NUM = 99 ;
///////////////////////////
@@ -70,21 +82,21 @@ COMMAND_BUF_SIZE (G4FRofstream::SEND_BUFMAX)
// g4.prim filename and its directory
if ( getenv( "G4DAWNFILE_DEST_DIR" ) == NULL ) {
strcpy( fG4PrimDestDir , "" );
strcpy( fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME );
strcpy( fG4PrimDestDir , "" ) ; // output dir
strcpy( fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME ); // filename
} else {
strcpy( fG4PrimDestDir , getenv( "G4DAWNFILE_DEST_DIR" ) );
strcpy( fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME );
strcpy( fG4PrimDestDir , getenv( "G4DAWNFILE_DEST_DIR" ) ); // output dir
strcpy( fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME ); // filename
}
// maximum number of g4.prim files in the dest directory
fMaxFileNum = 1 ; // initialization
fMaxFileNum = FR_MAX_FILE_NUM ; // initialization
if ( getenv( "G4DAWNFILE_MAX_FILE_NUM" ) != NULL ) {
sscanf( getenv("G4DAWNFILE_MAX_FILE_NUM"), "%d", &fMaxFileNum ) ;
} else {
fMaxFileNum = 1 ;
fMaxFileNum = FR_MAX_FILE_NUM ;
}
if( fMaxFileNum < 1 ) { fMaxFileNum = 1 ; }
@@ -105,7 +117,7 @@ G4DAWNFILESceneHandler::~G4DAWNFILESceneHandler ()
//-----
void G4DAWNFILESceneHandler::SetG4PrimFileName()
{
// g4.prim, g4_1.prim, ..., g4_MAX_FILE_INDEX.prim
// g4_00.prim, g4_01.prim, ..., g4_MAX_FILE_INDEX.prim
const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
// dest directory (null if no environmental variables is set)
@@ -117,19 +129,22 @@ void G4DAWNFILESceneHandler::SetG4PrimFileName()
// Automatic updation of file names
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 DAWNFILE 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.prim and g4_XX.eps " << G4endl;
G4cerr << "===========================================" << G4endl;
}
// re-determine file to G4DAWNFILE_DEST_DIR/g4_i.prim for i>0
if( i > 0 ) {
// re-determine file name as G4DAWNFILE_DEST_DIR/g4_XX.prim
if( i >= 0 && i <= 9 ) {
sprintf( fG4PrimFileName, "%s%s%s%d.prim" , fG4PrimDestDir, G4PRIM_FILE_HEADER, "0", i );
} else {
sprintf( fG4PrimFileName, "%s%s%d.prim" , fG4PrimDestDir, G4PRIM_FILE_HEADER, i );
}
@@ -138,7 +153,7 @@ void G4DAWNFILESceneHandler::SetG4PrimFileName()
fin.open(fG4PrimFileName) ;
if(!fin) {
// new file
fin.close(); // error recovery
fin.close();
break;
} else {
// already exists (try next)
@@ -147,11 +162,18 @@ void G4DAWNFILESceneHandler::SetG4PrimFileName()
} // for
G4cerr << "===========================================" << G4endl;
G4cerr << "Output file: " << fG4PrimFileName << G4endl;
G4cerr << "Muximal number of file in the destination directory: " << fMaxFileNum << G4endl;
G4cerr << " (Customizable as: setenv G4DAWNFILE_MAX_FILE_NUM number) " << G4endl;
G4cerr << "===========================================" << G4endl;
G4cerr << "=========================================== " << G4endl;
G4cerr << "Output file: " << fG4PrimFileName << G4endl;
G4cerr << "Destination directory (current dir if NULL): " << fG4PrimDestDir << G4endl;
G4cerr << "Maximal number of files in the destination directory: " << fMaxFileNum << G4endl;
G4cerr << "Note: " << G4endl;
G4cerr << " * The maximal number is customizable as: " << G4endl;
G4cerr << " % setenv G4DAWNFILE_MAX_FILE_NUM number " << G4endl;
G4cerr << " * The destination directory is customizable as:" << G4endl;
G4cerr << " % setenv G4DAWNFILE_DEST_DIR dir_name/ " << G4endl;
G4cerr << " ** Do not forget \"/\" at the end of the " << G4endl;
G4cerr << " dir_name, e.g. \"./tmp/\". " << G4endl;
G4cerr << "=========================================== " << G4endl;
} // G4DAWNFILESceneHandler::SetG4PrimFileName()
@@ -169,7 +191,7 @@ void G4DAWNFILESceneHandler::BeginSavingG4Prim( void )
G4cerr << "***** (started) " ;
G4cerr << "(open g4.prim, ##)" << G4endl;
#endif
SetG4PrimFileName() ; // returned to fG4PrimFileName
SetG4PrimFileName() ; // result set to fG4PrimFileName
fPrimDest.Open(fG4PrimFileName) ;
SendStr( FR_G4_PRIM_HEADER ) ;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DAWNFILEViewer.cc,v 1.6 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DAWNFILEViewer.cc,v 1.9 2000/05/15 07:48:27 stanaka Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA
// DAWNFILE view - opens window, hard copy, etc.
@@ -66,7 +66,8 @@ G4DAWNFILEViewer::G4DAWNFILEViewer (G4DAWNFILESceneHandler& scene,
}
// Set a PostScript Viewer
strcpy( fPSViewer, "ghostview" );
// strcpy( fPSViewer, "ghostview" );
strcpy( fPSViewer, "gv" );
if( getenv( "G4DAWNFILE_PS_VIEWER" ) != NULL ) {
strcpy( fPSViewer, getenv( "G4DAWNFILE_PS_VIEWER" ) ) ;
}
@@ -148,6 +149,7 @@ void G4DAWNFILEViewer::ShowView( void )
//----- Invoke DAWN
G4cout << G4endl ;
if( false == G4FRofstream::DoesFileExist( fSceneHandler.GetG4PrimFileName() ) )
{
G4cout << "ERROR: Failed to generate file ";
@@ -268,7 +270,9 @@ void G4DAWNFILEViewer::SendViewParameters ()
gui_out << "0" << G4endl ; // auto target
//----- target point
const G4Point3D& target_point = fVP.GetCurrentTargetPoint();
const G4Point3D& target_point
= fSceneHandler.GetScene()->GetStandardTargetPoint()
+ fVP.GetCurrentTargetPoint();
gui_out << target_point.x() << G4endl ;
gui_out << target_point.y() << G4endl ;
gui_out << target_point.z() << G4endl ;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRClientServer.cc,v 1.3 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// Satoshi TANAKA, Wed Jul 3 14:14:29 JST 1996
////////////////////////////////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FRSceneFunc.icc,v 1.10 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FukuiRenderer.cc,v 1.4 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FukuiRendererSceneHandler.cc,v 1.3 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4FukuiRendererSceneHandler.cc,v 1.4 2000/04/12 13:08:22 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 11:34:24 JST 1996
@@ -33,6 +33,7 @@
#include "G4FukuiRendererViewer.hh"
#include "G4Point3D.hh"
#include "G4VisAttributes.hh"
#include "G4Scene.hh"
#include "G4Transform3D.hh"
#include "G4Polyhedron.hh"
#include "G4Box.hh"
@@ -40,6 +41,10 @@
#include "G4Polyline.hh"
#include "G4Trd.hh"
#include "G4Tubs.hh"
#include "G4Trap.hh"
#include "G4Torus.hh"
#include "G4Sphere.hh"
#include "G4Para.hh"
#include "G4Text.hh"
#include "G4Circle.hh"
#include "G4Square.hh"
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FukuiRendererViewer.cc,v 1.4 1999/12/15 14:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4FukuiRendererViewer.cc,v 1.5 2000/05/13 10:57:51 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 12:09:11 JST 1996
@@ -224,7 +224,9 @@ void G4FukuiRendererViewer::SendViewParameters ()
h_angle );
//----- (4A) CALC target point
const G4Point3D& target_point = fVP.GetCurrentTargetPoint();
const G4Point3D& target_point
= fSceneHandler.GetScene()->GetStandardTargetPoint()
+ fVP.GetCurrentTargetPoint();
//----- (4B) SEND target point
fSceneHandler.SendStrDouble3( FR_TARGET_POINT,
+6 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.4 1999/09/15 16:49:59 johna Exp $
# $Id: GNUmakefile,v 1.5 2000/01/29 00:42:44 asaim Exp $
# -----------------------------------------------------------------------
# GNUmakefile for visualization and modeling. John Allison, 5/7/95.
# Modeling is always made. Others by environment. John Allison 4/7/98.
@@ -40,6 +40,11 @@ ifdef G4VIS_BUILD_DAWNFILE_DRIVER
endif
# End of DAWN and DAWNFILE drivers
ifdef G4VIS_BUILD_RAYTRACER_DRIVER
SUBDIRS += RayTracer
SUBLIBS += G4RayTracer
endif
ifdef G4VIS_BUILD_OPACS_DRIVER
SUBDIRS += OPACS
SUBLIBS += G4OPACS
+165 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.59 2000/01/17 10:36:40 johna Exp $
$Id: History,v 1.88 2000/06/09 08:42:46 johna Exp $
-------------------------------------------------------------------
=========================================================
@@ -24,6 +24,170 @@ committal in the CVS repository !
History file for visualization category
---------------------------------------
9th June 2000 John Allison (vis-V01-01-06)
- Tagged for system testing.
8th June 2000 Guy Barrand
- OPACS/src/G4GoSceneHandler.cc : correct polyhedron
wire-frame in order to remove some edges. Now the
rendering is the same than for OpenGL driver.
This was requested for long by ALICE, and had been
requested for ATLAS by Gaston Parrour recently.
7th June 2000 John Allison
- /vis/viewer/update preferred, synonym /vis/viewer/show deprecated.
7th June 2000 Makoto Asai
- Fix the flip view of RayTracer.
2nd June May 2000 John Allison
- Forced /control/verbose 2 for compound commands.
20th May 2000 John Allison
- Bug fix in G4PhysicalVolumeModel for replicas (Guy Barrand).
26 May 2000 Guy Barrand
- management/src/G4VisCommandsScene.
Protect against a null pointer for aScene in NotifyHandlers::SetNewValue.
- OPACS/src/G4WoViewer.cc :
Change camera name checking so that a viewer created
by the GUI (Wo) could be hooked.
- OPACS/src/G4GoSceneHandler.cc :
Change circle rendering.
- OpenInventor/G4OpenInventorSceneHandler : protect against null pointers.
22nd May 2000 John Allison (vis-V01-01-05)
- Many bug fixes from in OpenGL (opengl-V01-01-00) - see OpenGL/History. Main
features:
o workaround for bug in Mesa which slowed OpenGLXm (Guy Barrand).
o multiple OpenGLXm windows no longer cause crash on exit (Guy).
- modeling-V01-01-00: Added G4VTreeGraphicsScene (DTREE).
- G4Scene::IsEmpty if empty of RunDurationModels - VisManager adds world in
this case.
18th/19th May 2000 John Allison
- Introduced some /vis/viewer/set commands.
- /vis/scene/include/trajectories changed to /vis/scene/add/trajectories.
Similarly hits. (Old commands kept but deprecated.)
- G4ViewParameters.cc: bug fix in density culling printing.
- G4VisCommandsSceneHandler.cc: bug fix in /vis/sceneHandler/create.
- G4VisManagerRegisterMessengers.cc: improved comments.
18th May 2000 John Allison vis-V01-01-04
- Included DAWN-V01-01-04: Automatic filename incrementation is made default.
15th May 2000 John Allison
- Added compound commands /vis/open, /vis/drawVolume and /vis/specify.
- /vis/viewer/reset now resets *all* view parameters.
- Fixed double application of transformation in /vis/scene/add/volume.
- Fixed verbosity parameter in /vis/scene/list.
- Made G4BoundingSphereScene::PreAddThis non-inline.
13th May 2000 John Allison
- Redefined current target point to be *relative* to standard target point.
(No longer necessary to initialize current target point in G4VViewer
constructor. The fix of 4th May is reversed.)
11th May 2000 Satoshi Tanaka vis-V01-01-03
- In G4DAWNFILEViewer.cc,
< strcpy( fPSViewer, "ghostview" );
---
> // strcpy( fPSViewer, "ghostview" );
> strcpy( fPSViewer, "gv" );
4th May 2000 John Allison
- Tidied comments in G4VisManagerRegisterMessengers.cc.
- Initialize current target point in G4VViewer constructor.
- Re-implemented /vis/viewer/reset to change view parameters of
viewer directly.
2nd May 2000 John Allison vis-V01-01-02
- Added /vis/viewer/reset.
- G4VSceneHandler, G4VViewer, G4OpenGLXmMainMenubarCallbacks: corrected
some name anomolies - "scene" was still being used in places where it
meant "scene handler".
- G4VViewer: added GetShortName(), corrected SetName(...).
- G4ViewParameters.hh: improved class description.
- G4VisManager: added ViewerShortName(...) and GetViewer(...) utilities.
- G4RayTracer: set out-of-world ray to black.
- G4RayTracerViewer: corrected trapping of orthogonal projection.
- Some minor enhancements to tests.
27th April 2000 Gabriele Cosmo
- Removed unnecessary #include "G4Transform.hh" from VRML. (Since
geometry-V01-01-02 G4Transform.hh no longer exists.)
27th April 2000 John Allison
- Updated README file.
12th April 2000 John Allison vis-V01-01-01
- Made G4PhysicalVolumeModel::DescribeSolid virtual.
- G4PhysicalVolumeModel::DescribeSolid no longer deals with composite
solids - now programmed into CompositeSolid::CreatePolyhedron, where
CompositeSolid means G4IntersectionSolid, G4SubtractionSolid and
G4UnionSolid.
- G4PhysicalVolumeModel::DescribeSolid no longer deals with displaced
solids - now programmed into G4DisplacedSolid::CreatePolyhedron.
- Added G4LogicalVolumeModel::DescribeSolid, which explicitly adds
components of composite solids as white forced-wireframe objects.
- Removed unnecessary #includes from G4VSceneHandler.hh which required
consequent inclusion in many other scene handlers and viewers.
7th April 2000 John Allison vis-V01-01-00
- Modified GNUmakefiles for restructured geometry.
29th February 2000 John Allison vis-V01-00-06
- Changed `char*' to `const char*' in G4FRClientServer::Err(...).
28th February 2000 John Allison
- Cosmetic improvements to G4RayTracerSceneHandler.hh and G4RayTracerViewer.hh.
24th February 2000 John Allison
- Minor inmprovement of messages from /vis/viewer/refresh.
- Cosmetic tidying in G4OpenGLViewer.cc.
- Added protection for null viewer in G4RTSteppingAction.cc and
G4RayTrajectory.cc.
- Corrected for zoom, etc., in G4RayTracerViewer.cc.
23rd February 2000 John Allison
- Added G4RayTracerSceneHandler and Viewer.
- Some modifications to other RayTracer routines for vis compliance.
- (Note: headAngle still not right - ray traced views are sometimes tipped.)
23rd February 2000 John Allison vis-V01-00-05
- Includes raytracer-V01-00-01a which is original version plus fixes for
ISO compliance.
21st February 2000 John Allison
- /vis/viewer/refresh no longer invokes ShowView().
- G4VViewer: introduced data member fShortName.
- Added G4RTSteppingAction and G4RayTrajectory to list of G4VisManager's
friends.
- Improved G4VisManager::CreateSceneHandler() and CreateViewer() and
handling of error in G4VisCommandSceneHandler::Create() and
G4VisCommandViewer::Create().
- OpenGL: char* becomes const char*. Small output text improvement.
- test: some changes for Ray Tracer. Boolean intersection instead of union.
02 February 2000 Guy Barrand
- OPACS/src/G4XoViewer.cc : change WaitForNotify signature to
be able to compile with DEC-cxx 6.1.
vis-V01-00-04 29th January 2000 Satoshi Tanaka
- CVS tag is assigned to the Makoto's committing below.
29th January 2000 Makoto Asai
- Introduction of G4RayTracer (visualization/RayTracer/...)
- Migration of G4RayTracer
affected files :
visualization/GNUmakefile
visualization/management/include/MyVisManager.cc
visualization/management/src/G4VisManager.cc
affected files in other directory :
config/G4VIS_BUILD.gmk
config/G4VIS_USE.gmk
vis-V01-00-03 17th January 2000 John Allison
- Added protection for no voxelisation in G4LogicalVolumeModel.cc.
- Changed endl to G4endl in G4VisCommandsViewer.cc and G4GoSceneHandler.cc.
+2 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 1999/04/15 15:27:56 johna Exp $
# $Id: GNUmakefile,v 1.3 2000/04/07 14:52:49 johna Exp $
name := G4OPACS
@@ -15,6 +15,7 @@ CPPFLAGS += -I$(G4BASE)/visualization/modeling/include
CPPFLAGS += -I$(G4BASE)/global/management/include
CPPFLAGS += -I$(G4BASE)/global/HEPGeometry/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/CSG/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/specific/include
CPPFLAGS += -I$(G4BASE)/graphics_reps/include
CPPFLAGS += -I$(G4BASE)/geometry/management/include
CPPFLAGS += -I$(G4BASE)/geometry/volumes/include
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GoSceneHandler.hh,v 1.5 1999/12/16 17:25:02 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Wo.hh,v 1.5 1999/12/15 14:54:02 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4WoViewer.hh,v 1.4 1999/12/15 14:54:02 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Xo.hh,v 1.5 1999/12/15 14:54:02 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4XoViewer.hh,v 1.4 1999/12/15 14:54:02 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GoSceneHandler.cc,v 1.7 2000/01/17 10:28:50 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4GoSceneHandler.cc,v 1.9 2000/06/07 22:36:02 barrand Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
@@ -146,6 +146,8 @@ void G4GoSceneHandler::AddPrimitive (
#endif
// Direction of circle ?
//GoAddCircleToNode (fGoNode,radius,center.x(),center.y(),center.z(),0.,0.,1.);
OContextSetMarkerStyle (OContextGetStaticInstance(),OMarkerStyleCircle);
OContextSetMarkerSize (OContextGetStaticInstance(),5);
GoAddMarkerToNode (fGoNode,center.x(),center.y(),center.z());
}
/***************************************************************************/
@@ -174,48 +176,78 @@ void G4GoSceneHandler::AddPrimitive (
break;
}
G4bool notLastFace;
G4Normal3D SurfaceNormal;
double xs[5];
double ys[5];
double zs[5];
double xs[5];
double ys[5];
double zs[5];
G4Normal3D SurfaceNormal;
G4Point3D vertex;
do
{
G4bool notLastEdge;
G4Point3D vertex;
G4int edgeFlag = 1;
int iPoint;
iPoint = 0;
notLastFace = polyhedron.GetNextNormal (SurfaceNormal);
do
{
notLastEdge = polyhedron.GetNextVertex (vertex, edgeFlag);
xs[iPoint] = vertex.x();
ys[iPoint] = vertex.y();
zs[iPoint] = vertex.z();
iPoint++;
} while (notLastEdge);
if( (iPoint!=3) && (iPoint!=4) )
{
CWarnF ("G4GoSceneHandler::AddPrimitive G4Polyhedron : not a quad or a triangle : %d\n",iPoint);
}
else
{
if (modeling==OModelingWireFrame)
{
xs[iPoint] = xs[0];
ys[iPoint] = ys[0];
zs[iPoint] = zs[0];
iPoint++;
ONodeAddLines (fGoNode,OContextGetStaticInstance(),iPoint,xs,ys,zs);
}
else if (modeling==OModelingSolid)
{
ONodeAddPolygon (fGoNode,OContextGetStaticInstance(),iPoint,xs,ys,zs);
G4bool notLastFace;
do {
G4int edgeFlag = 1;
G4int lastEdgeFlag = edgeFlag;
int iPoint = 0;
notLastFace = polyhedron.GetNextNormal (SurfaceNormal);
G4bool notLastEdge;
do {
notLastEdge = polyhedron.GetNextVertex (vertex, edgeFlag);
if (modeling==OModelingWireFrame) {
if (edgeFlag != lastEdgeFlag) {
if (edgeFlag) {
// Pass to visible edges, restart to accumulate :
iPoint = 0;
xs[iPoint] = vertex.x();
ys[iPoint] = vertex.y();
zs[iPoint] = vertex.z();
iPoint++;
} else {
// Pass to invisible edges, flush the visible ones :
xs[iPoint] = vertex.x();
ys[iPoint] = vertex.y();
zs[iPoint] = vertex.z();
iPoint++;
if(iPoint>=2) {
ONodeAddLines(fGoNode,OContextGetStaticInstance(),
iPoint,xs,ys,zs);
}
}
lastEdgeFlag = edgeFlag;
} else {
if (edgeFlag) {
xs[iPoint] = vertex.x();
ys[iPoint] = vertex.y();
zs[iPoint] = vertex.z();
iPoint++;
} else {
}
}
} while (notLastFace);
} else {
xs[iPoint] = vertex.x();
ys[iPoint] = vertex.y();
zs[iPoint] = vertex.z();
iPoint++;
}
} while (notLastEdge);
if (modeling==OModelingWireFrame) {
if(iPoint!=0) { // Some line started, flush it :
/*
xs[iPoint] = xs[0];
ys[iPoint] = ys[0];
zs[iPoint] = zs[0];
iPoint++;
*/
if(iPoint>=2) {
ONodeAddLines(fGoNode,OContextGetStaticInstance(),iPoint,xs,ys,zs);
}
}
} else if (modeling==OModelingSolid) {
if( (iPoint!=3) && (iPoint!=4) ) {
CWarnF ("G4GoSceneHandler::AddPrimitive G4Polyhedron : not a quad or a triangle : %d\n",iPoint);
} else {
ONodeAddPolygon (fGoNode,OContextGetStaticInstance(),iPoint,xs,ys,zs);
}
}
} while (notLastFace);
}
/***************************************************************************/
void G4GoSceneHandler::AddPrimitive (
@@ -444,15 +476,24 @@ void G4GoSceneHandler::BeginPrimitives (
fGoNode = nodeName!=NULL ? ONodeCreate (nodeName) : ONodeMake ();
if(ONodeIsValid(fRootGoNode)==0) {
#ifdef DEBUG
G4cout << " build Root, Static, Transient nodes" << G4endl;
#endif
fRootGoNode = ONodeMake ();
fStaticRootGoNode = ONodeMake ();
fTransientRootGoNode = ONodeMake ();
ONodeAddChild (fRootGoNode,fStaticRootGoNode);
ONodeAddChild (fRootGoNode,fTransientRootGoNode);
}
}
if (fReadyForTransients) {
#ifdef DEBUG
G4cout << " add node to transient scene graph" << G4endl;
#endif
ONodeAddChild (fTransientRootGoNode,fGoNode);
} else {
#ifdef DEBUG
G4cout << " add node to static scene graph" << G4endl;
#endif
ONodeAddChild (fStaticRootGoNode,fGoNode);
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Wo.cc,v 1.4 1999/12/15 14:54:02 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
+10 -5
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4WoViewer.cc,v 1.3 1999/12/15 14:54:02 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4WoViewer.cc,v 1.6 2000/05/28 13:35:14 barrand Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
@@ -27,6 +27,7 @@
#include <Wo.h>
//G4
#include "G4VInteractorManager.hh"
#include "G4Scene.hh"
#include "G4Wo.hh"
#include "G4GoSceneHandler.hh"
//This
@@ -54,8 +55,10 @@ G4WoViewer::G4WoViewer (
CWarn ("G4WoViewer : Wo is not initialized !\n");
return;
}
char* defName = CStringDuplicate((char*)fName.data());
char* defNameGS = CStringDuplicate((char*)fName.data());
char* defName = CStringGetFirstWord(defNameGS);
CStringDelete(defNameGS);
CStringReplacePart (&defName,"-","_");
fGoCamera = OCameraGetIdentifier (defName);
@@ -141,7 +144,9 @@ void G4WoViewer::SetView (
// later due to user interaction via visualization system's GUI.)
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
const G4Point3D target = fVP.GetCurrentTargetPoint ();
const G4Point3D target
= fSceneHandler.GetScene()->GetStandardTargetPoint()
+ fVP.GetCurrentTargetPoint ();
G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
if(radius<=0.) radius = 1. * m;
const G4double cameraDistance = fVP.GetCameraDistance (radius);
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Xo.cc,v 1.5 1999/12/15 14:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
+11 -5
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4XoViewer.cc,v 1.4 1999/12/15 14:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4XoViewer.cc,v 1.7 2000/05/13 10:57:31 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Guy Barrand 04 November 1996
@@ -29,13 +29,17 @@
/*Xo*/
#include <XoCamera.h>
//G4
#include "G4Scene.hh"
#include "G4GoSceneHandler.hh"
#include "G4Xo.hh"
#include "G4VInteractorManager.hh"
//This
#include "G4XoViewer.hh"
static Bool WaitForNotify (Display*,XEvent*,char*);
extern "C" {
Bool WaitForNotify (Display*,XEvent*,XPointer);
}
static void ActivateCallback (Widget,XtPointer,XtPointer);
static void CollectCallback (Widget,XtPointer,XtPointer);
/***************************************************************************/
@@ -145,7 +149,9 @@ void G4XoViewer::SetView (
// later due to user interaction via visualization system's GUI.)
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
const G4Point3D target = fVP.GetCurrentTargetPoint ();
const G4Point3D target
= fSceneHandler.GetScene()->GetStandardTargetPoint()
+ fVP.GetCurrentTargetPoint ();
G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
if(radius<=0.) radius = 1. * m;
const G4double cameraDistance = fVP.GetCameraDistance (radius);
@@ -206,7 +212,7 @@ void G4XoViewer::ShowView (
Bool WaitForNotify (
Display* d
,XEvent* e
,char* arg
,XPointer arg
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
+2 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.1 1999/01/07 16:14:47 gunter Exp $
# $Id: GNUmakefile,v 1.2 2000/04/07 13:32:41 gcosmo Exp $
name := G4OpenGL
@@ -15,6 +15,7 @@ CPPFLAGS += -I$(G4BASE)/visualization/modeling/include
CPPFLAGS += -I$(G4BASE)/global/management/include
CPPFLAGS += -I$(G4BASE)/global/HEPGeometry/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/CSG/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/specific/include
CPPFLAGS += -I$(G4BASE)/graphics_reps/include
CPPFLAGS += -I$(G4BASE)/geometry/management/include
CPPFLAGS += -I$(G4BASE)/geometry/volumes/include
+34
View File
@@ -0,0 +1,34 @@
$Id: History,v 1.2 2000/05/22 08:34:58 johna Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
History file for visualization/OpenGL
-------------------------------------
22nd May 2000 John Allison (opengl-V01-01-00)
- Fixed slow response of 2nd window of OpenGLXm. Worked around Mesa bug
by sharing static visuals in G4OpenGLXViewer (Guy Barrand):
static XVisualInfo* vi_single_buffer;
static XVisualInfo* vi_double_buffer;
- Removed ChooseVisual from G4OpenGLXmViewer.cc - done in base class
G4OpenGLXViewer.
- Protected double deletion of window in destructors of G4OpenGLXmViewer
and G4OpenGLXViewer (Guy Barrand).
- Changed requested bits per colour to r,g,b = 1,1,1 in G4OpenGLViewer.cc.
- Corrected order of CreateMainWindow() and InitializeGLView() in X*Viewer
constructors.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateSceneHandler.hh,v 1.3 1999/12/15 14:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateViewer.hh,v 1.4 1999/12/15 14:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateWin32.hh,v 1.4 1999/12/15 14:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// OpenGLImmediateWin32 graphics system factory.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateWin32Viewer.hh,v 1.3 1999/12/15 14:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Class G4OpenGLImmediateWin32Viewer : a class derived from
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateX.hh,v 1.5 1999/12/15 14:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateXViewer.hh,v 1.4 1999/12/15 14:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateXm.hh,v 1.4 1999/12/15 14:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateXmViewer.hh,v 1.3 1999/12/15 14:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLSceneHandler.hh,v 1.5 1999/12/16 17:25:05 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 27th March 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLSceneHandler.icc,v 1.3 1999/12/16 17:25:06 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 20th January 1998
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredSceneHandler.hh,v 1.7 1999/12/15 14:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredViewer.hh,v 1.5 1999/12/15 14:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredWin32.hh,v 1.4 1999/12/15 14:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// OpenGLStoredWin32 graphics system factory.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredWin32Viewer.hh,v 1.2 1999/12/15 14:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Class G4OpenGLStoredWin32Viewer : a class derived from
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredX.hh,v 1.5 1999/12/15 14:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredXViewer.hh,v 1.3 1999/12/15 14:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredXm.hh,v 1.4 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredXmViewer.hh,v 1.2 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLTransform3D.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 24th October 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLViewer.hh,v 1.5 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 27th March 1996
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLWin32Viewer.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// G4OpenGLWin32Viewer : Class to provide WindowsNT specific
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLXViewer.hh,v 1.6 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLXViewer.hh,v 1.8 2000/05/22 08:06:50 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -56,7 +56,7 @@ protected:
void printBuffer(GLint, GLfloat*);
GLfloat* spewPrimitiveEPS (FILE*, GLfloat*);
void spewSortedFeedback (FILE*, GLint, GLfloat*);
void spewWireframeEPS (FILE*, GLint, GLfloat*, char*);
void spewWireframeEPS (FILE*, GLint, GLfloat*, const char*);
void print3DcolorVertex(GLint, GLint*, GLfloat*);
G4float pointSize;
@@ -73,6 +73,8 @@ protected:
XWindowAttributes xwa;
Display *dpy;
static XVisualInfo *vi_single_buffer;
static XVisualInfo *vi_double_buffer;
XVisualInfo *vi_immediate,
*vi_stored,
*vi;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmBox.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Box container class
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmConvenienceRoutines.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmFourArrowButtons.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Four arrow buttons class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmFramedBox.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Framed box container class
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmMainMenubarCallbacks.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmPanningCallbacks.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmPushButton.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Push button class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmRadioButton.hh,v 1.3 1999/12/15 14:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Radio button class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmResources.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Default resources file for GEANT4 OpenGL Motif windows.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmRotationCallbacks.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmSeparator.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Separator class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmSliderBar.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Slider bar class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmStyleCallbacks.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmTextField.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Text field class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmTopLevelShell.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Top level shell class
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmVWidgetComponent.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Base class for all Motif component widgets
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmVWidgetContainer.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Base class for all Motif container widgets
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmVWidgetObject.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Virtual base class for all Motif widgets.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmVWidgetShell.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//Base class for all Motif window widgets (shells)
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmViewer.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmWindowHandlingCallbacks.hh,v 1.3 1999/12/15 14:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.3 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateViewer.cc,v 1.3 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateWin32.cc,v 1.4 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// OpenGLImmediateWin32 graphics system factory.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateWin32Viewer.cc,v 1.2 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Class G4OpenGLImmediateWin32Viewer : a class derived from G4OpenGLWin32Viewer and
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateX.cc,v 1.5 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 27th March 1996
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLImmediateXViewer.cc,v 1.3 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLImmediateXViewer.cc,v 1.4 2000/05/22 08:16:25 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -47,10 +47,10 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
CreateGLXContext (vi_immediate);
InitializeGLView ();
CreateMainWindow ();
InitializeGLView ();
// clear the buffers and window.
ClearView ();
FinishView ();
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateXm.cc,v 1.4 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLImmediateXmViewer.cc,v 1.2 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLImmediateXmViewer.cc,v 1.3 2000/05/22 08:16:29 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -45,10 +45,10 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
CreateGLXContext (vi_immediate);
InitializeGLView ();
CreateMainWindow ();
InitializeGLView ();
// clear the buffers and window.
ClearView ();
FinishView ();
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLSceneHandler.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLSceneHandler.cc,v 1.5 2000/02/21 16:03:18 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 27th March 1996
@@ -85,8 +85,8 @@ void G4OpenGLSceneHandler::AddPrimitive (const G4Text& text) {
G4double size = GetMarkerSize (text, sizeType);
G4cerr
<< "G4OpenGLSceneHandler::AddPrimitive (const G4Text& text) not implemented yet."
<< "\n Called with text " << text.GetText ()
<< " at " << text.GetPosition ()
<< "\n Called with text \"" << text.GetText ()
<< "\" at " << text.GetPosition ()
<< ", size " << size
<< ", offsets " << text.GetXOffset () << ", " << text.GetYOffset ()
<< ", type " << sizeType
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLStoredSceneHandler.cc,v 1.6 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLStoredSceneHandler.cc,v 1.7 2000/04/12 13:09:07 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -40,7 +40,7 @@
#include "G4VisAttributes.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ModelingParameters.hh"
#include "G4VModel.hh"
#include "G4OpenGLStoredSceneHandler.hh"
G4OpenGLStoredSceneHandler::G4OpenGLStoredSceneHandler (G4VGraphicsSystem& system,
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredViewer.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredWin32.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// OpenGLStoredWin32 graphics system factory.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredWin32Viewer.cc,v 1.2 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Class G4OpenGLStoredWin32Viewer : a class derived from G4OpenGLWin32Viewer and
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredX.cc,v 1.5 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLStoredXViewer.cc,v 1.3 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLStoredXViewer.cc,v 1.4 2000/05/22 08:16:36 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -46,10 +46,10 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
CreateGLXContext (vi_stored);
InitializeGLView ();
CreateMainWindow ();
InitializeGLView ();
// clear the buffers and window.
ClearView ();
FinishView ();
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredXm.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLStoredXmViewer.cc,v 1.2 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLStoredXmViewer.cc,v 1.3 2000/05/22 08:16:42 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -43,10 +43,10 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
CreateGLXContext (vi_stored);
InitializeGLView ();
CreateMainWindow ();
InitializeGLView ();
// clear the buffers and window.
ClearView ();
FinishView ();
@@ -57,7 +57,6 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel (GL_FLAT);
}
void G4OpenGLStoredXmViewer::DrawView () {
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLTransform3D.cc,v 1.3 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 24th October 1996
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLViewer.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLViewer.cc,v 1.8 2000/05/22 08:09:15 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 27th March 1996
@@ -25,6 +25,7 @@
#include <assert.h>
#include <unistd.h>
#include "G4Scene.hh"
#include "G4VisExtent.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
@@ -33,12 +34,12 @@
#include "G4Plane3D.hh"
int G4OpenGLViewer::snglBuf_RGBA[10] =
{ GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3,
GLX_BLUE_SIZE, 2, GLX_DEPTH_SIZE, 1, None };
{ GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 1, None };
int G4OpenGLViewer::dblBuf_RGBA[11] =
{ GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3,
GLX_BLUE_SIZE, 2, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 1, None };
{ GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 1, None };
G4OpenGLViewer::G4OpenGLViewer (G4OpenGLSceneHandler& scene):
G4VViewer (scene, -1),
@@ -95,16 +96,16 @@ void G4OpenGLViewer::SetView () {
glLightfv (GL_LIGHT0, GL_AMBIENT, ambient);
glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuse);
const G4Point3D& target = fVP.GetCurrentTargetPoint ();
// Get radius of scene.
// Get radius of scene, etc.
// Note that this procedure properly takes into account zoom, dolly and pan.
const G4Point3D& targetPoint
= fSceneHandler.GetScene()->GetStandardTargetPoint()
+ fVP.GetCurrentTargetPoint ();
G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
if(radius<=0.) radius = 1.;
const G4double cameraDistance = fVP.GetCameraDistance (radius);
const G4Point3D& pCamera =
target + cameraDistance * fVP.GetViewpointDirection().unit();
const G4Point3D cameraPosition =
targetPoint + cameraDistance * fVP.GetViewpointDirection().unit();
const GLdouble near = fVP.GetNearDistance (cameraDistance, radius);
const GLdouble far = fVP.GetFarDistance (cameraDistance, near, radius);
const GLdouble right = fVP.GetFrontHalfHeight (near, radius);
@@ -128,12 +129,13 @@ void G4OpenGLViewer::SetView () {
const G4Normal3D& upVector = fVP.GetUpVector ();
G4Point3D gltarget;
if (cameraDistance > 1.e-6 * radius) {
gltarget = target;
gltarget = targetPoint;
}
else {
gltarget = target - radius * fVP.GetViewpointDirection().unit();
gltarget = targetPoint - radius * fVP.GetViewpointDirection().unit();
}
const G4Point3D& pCamera = cameraPosition; // An alias for brevity.
gluLookAt (pCamera.x(), pCamera.y(), pCamera.z(), // Viewpoint.
gltarget.x(), gltarget.y(), gltarget.z(), // Target point.
upVector.x(), upVector.y(), upVector.z()); // Up vector.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLWin32Viewer.cc,v 1.2 1999/12/15 14:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// G4OpenGLWin32Viewer : Class to provide WindowsNT specific

Some files were not shown because too many files have changed in this diff Show More