Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RTJpegCoder.cc,v 1.6 2006-06-29 21:23:55 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -51,8 +50,8 @@ G4JpegCoder::G4JpegCoder(u_char* colorR,u_char* colorG,u_char* colorB)
mOBSP = 0;
for(int n=0; n<8; n++)
for(int m=0; m<8; m++)
mCosT[n][m] = std::cos((2 * m + 1) * n * PaiDiv16);
for(int im=0; im<8; im++)
mCosT[n][im] = std::cos((2 * im + 1) * n * PaiDiv16);
}
G4JpegCoder::~G4JpegCoder(void)
@@ -219,12 +218,12 @@ G4JpegCoder::CodeHuffman(int cs)
mOBSP->SetBits((acT.CodeT)[zrlIdx], (acT.SizeT)[zrlIdx]);
run -= 16;
}
int s = 0;
int is = 0;
while( absCoefficient > 0 ){
absCoefficient >>= 1;
s++;
is++;
}
int aIdx = run * 10 + s + (run == 15);
int aIdx = run * 10 + is + (run == 15);
if( aIdx >= acT.numOfElement )
throw( G4IndexError( acT.numOfElement, aIdx, "CodeHuffman:AC" )
);
@@ -232,7 +231,7 @@ G4JpegCoder::CodeHuffman(int cs)
int v = mDCTData[ Zigzag[n] ];
if( v < 0 )
v--;
mOBSP->SetBits( v, s );
mOBSP->SetBits( v, is );
run = 0;
}
else{
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RTJpegMaker.cc,v 1.10 2006-06-29 21:23:57 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RTMessenger.cc,v 1.10 2006-11-17 21:34:12 perl Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RTOutBitStream.cc,v 1.6 2008-04-04 13:52:48 allison Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RTSimpleScanner.cc,v 1.5 2010-06-14 14:33:34 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RTSteppingAction.cc,v 1.7 2006-06-29 21:24:05 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RTTrackingAction.cc,v 1.5 2006-06-29 21:24:07 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RTXScanner.cc,v 1.8 2010-06-14 14:33:34 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
@@ -181,7 +180,7 @@ G4bool G4RTXScanner::GetXWindow(const G4String& name, G4ViewParameters& vp)
&scmap, &nMaps, XA_RGB_BEST_MAP);
if (!status) {
system("xstdcmap -best"); // ...and try again...
Status status = XGetRGBColormaps
status = XGetRGBColormaps
(display, RootWindow(display, screen_num),
&scmap, &nMaps, XA_RGB_BEST_MAP);
if (!status) {
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RayTracer.cc,v 1.22 2007-06-14 15:25:20 allison Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
#include "G4RayTracer.hh"
#include "G4RayTracerFeatures.hh"
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RayTracerSceneHandler.cc,v 1.10 2006-11-14 14:46:37 allison Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
#include "G4RayTracerSceneHandler.hh"
#include "G4VisManager.hh"
@@ -24,13 +24,13 @@
// ********************************************************************
//
//
// $Id: G4RayTracerViewer.cc,v 1.18 2009-08-19 08:39:19 lgarnier Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
#include "G4RayTracerViewer.hh"
#include "G4ios.hh"
#include <sstream>
#include "G4SystemOfUnits.hh"
#include "G4VSceneHandler.hh"
#include "G4Scene.hh"
@@ -46,6 +46,8 @@ G4RayTracerViewer::G4RayTracerViewer
{
theTracer = aTracer;
if (!aTracer) theTracer = new G4TheRayTracer;
theTracer->SetNColumn(fVP.GetWindowSizeHintX());
theTracer->SetNRow(fVP.GetWindowSizeHintY());
}
G4RayTracerViewer::~G4RayTracerViewer() {}
@@ -72,13 +74,11 @@ void G4RayTracerViewer::SetView()
SetViewSpan(200. * frontHalfAngle / theTracer->GetNColumn());
theTracer->SetTargetPosition(targetPoint);
theTracer->SetEyePosition(cameraPosition);
theTracer->SetHeadAngle(fVP.GetViewpointDirection().phi());
theTracer->SetUpVector(fVP.GetUpVector());
const G4Vector3D
actualLightpointDirection(-fVP.GetActualLightpointDirection());
theTracer->SetLightDirection(actualLightpointDirection);
theTracer->SetBackgroundColour(fVP.GetBackgroundColour());
theTracer->SetNColumn(fVP.GetWindowSizeHintX());
theTracer->SetNRow(fVP.GetWindowSizeHintY());
}
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RayTracerX.cc,v 1.5 2006-06-29 21:24:17 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RayTracerXViewer.cc,v 1.8 2009-09-16 16:56:52 allison Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
#ifdef G4VIS_BUILD_RAYTRACERX_DRIVER
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RayTrajectory.cc,v 1.15 2006-06-29 21:24:21 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RayTrajectoryPoint.cc,v 1.6 2006-06-29 21:24:23 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
@@ -24,14 +24,14 @@
// ********************************************************************
//
//
// $Id: G4TheRayTracer.cc,v 1.3 2006-06-29 21:24:25 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
//
#include "G4TheRayTracer.hh"
#include "G4SystemOfUnits.hh"
#include "G4EventManager.hh"
#include "G4RTMessenger.hh"
#include "G4RayShooter.hh"
@@ -75,8 +75,9 @@ G4TheRayTracer::G4TheRayTracer(G4VFigureFileMaker* figMaker,
eyePosition = G4ThreeVector(1.*m,1.*m,1.*m);
targetPosition = G4ThreeVector(0.,0.,0.);
lightDirection = G4ThreeVector(-0.1,-0.2,-0.3).unit();
up = G4ThreeVector(0,1,0);
viewSpan = 5.0*deg;
headAngle = 270.*deg;
headAngle = 0.;
attenuationLength = 1.0*m;
distortionOn = false;
@@ -223,12 +224,18 @@ G4bool G4TheRayTracer::CreateBitMap()
G4ThreeVector rayDirection;
if(distortionOn)
{
rayDirection = G4ThreeVector(std::tan(angleX)/std::cos(angleY),-std::tan(angleY)/std::cos(angleX),1.0);
rayDirection = G4ThreeVector(-std::tan(angleX)/std::cos(angleY),std::tan(angleY)/std::cos(angleX),1.0);
}
else
{
rayDirection = G4ThreeVector(std::tan(angleX),-std::tan(angleY),1.0);
rayDirection = G4ThreeVector(-std::tan(angleX),std::tan(angleY),1.0);
}
G4double cp = std::cos(eyeDirection.phi());
G4double sp = std::sqrt(1.-cp*cp);
G4double ct = std::cos(eyeDirection.theta());
G4double st = std::sqrt(1.-ct*ct);
G4double gamma = std::atan2(ct*cp*up.x()+ct*sp*up.y()-st*up.z(), -sp*up.x()+cp*up.y());
rayDirection.rotateZ(-gamma);
rayDirection.rotateZ(headAngle);
rayDirection.rotateUz(eyeDirection);
G4ThreeVector rayPosition(eyePosition);
@@ -253,7 +260,7 @@ G4bool G4TheRayTracer::CreateBitMap()
}
}
if (interceptable) {
theRayShooter->Shoot(anEvent,rayPosition,rayDirection);
theRayShooter->Shoot(anEvent,rayPosition,rayDirection.unit());
theEventManager->ProcessOneEvent(anEvent);
succeeded = GenerateColour(anEvent);
colorR[iCoord] = (unsigned char)(int(255*rayColour.GetRed()));
@@ -311,11 +318,11 @@ G4bool G4TheRayTracer::GenerateColour(G4Event* anEvent)
G4Colour G4TheRayTracer::GetMixedColour(G4Colour surfCol,G4Colour transCol,G4double weight)
{
G4double r = weight*surfCol.GetRed() + (1.-weight)*transCol.GetRed();
G4double g = weight*surfCol.GetGreen() + (1.-weight)*transCol.GetGreen();
G4double b = weight*surfCol.GetBlue() + (1.-weight)*transCol.GetBlue();
G4double a = weight*surfCol.GetAlpha() + (1.-weight)*transCol.GetAlpha();
return G4Colour(r,g,b,a);
G4double red = weight*surfCol.GetRed() + (1.-weight)*transCol.GetRed();
G4double green = weight*surfCol.GetGreen() + (1.-weight)*transCol.GetGreen();
G4double blue = weight*surfCol.GetBlue() + (1.-weight)*transCol.GetBlue();
G4double alpha = weight*surfCol.GetAlpha() + (1.-weight)*transCol.GetAlpha();
return G4Colour(red,green,blue,alpha);
}
G4Colour G4TheRayTracer::GetSurfaceColour(G4RayTrajectoryPoint* point)
@@ -338,10 +345,11 @@ G4Colour G4TheRayTracer::GetSurfaceColour(G4RayTrajectoryPoint* point)
if(preVis)
{
G4double brill = (1.0-(-lightDirection).dot(normal))/2.0;
G4double r = preAtt->GetColour().GetRed();
G4double g = preAtt->GetColour().GetGreen();
G4double b = preAtt->GetColour().GetBlue();
preCol = G4Colour(r*brill,g*brill,b*brill,preAtt->GetColour().GetAlpha());
G4double red = preAtt->GetColour().GetRed();
G4double green = preAtt->GetColour().GetGreen();
G4double blue = preAtt->GetColour().GetBlue();
preCol = G4Colour
(red*brill,green*brill,blue*brill,preAtt->GetColour().GetAlpha());
}
else
{ preCol = transparent; }
@@ -349,10 +357,11 @@ G4Colour G4TheRayTracer::GetSurfaceColour(G4RayTrajectoryPoint* point)
if(postVis)
{
G4double brill = (1.0-(-lightDirection).dot(-normal))/2.0;
G4double r = postAtt->GetColour().GetRed();
G4double g = postAtt->GetColour().GetGreen();
G4double b = postAtt->GetColour().GetBlue();
postCol = G4Colour(r*brill,g*brill,b*brill,postAtt->GetColour().GetAlpha());
G4double red = postAtt->GetColour().GetRed();
G4double green = postAtt->GetColour().GetGreen();
G4double blue = postAtt->GetColour().GetBlue();
postCol = G4Colour
(red*brill,green*brill,blue*brill,postAtt->GetColour().GetAlpha());
}
else
{ postCol = transparent; }
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VRTScanner.cc,v 1.1 2010-06-14 14:33:34 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//