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
+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
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/