Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ClippablePolygon.cc,v 1.2 2000/04/18 19:07:11 davidw Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ClippablePolygon.cc,v 1.4 2000/11/13 08:11:39 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -23,6 +23,20 @@
#include "G4VoxelLimits.hh"
//
// Constructor
//
G4ClippablePolygon::G4ClippablePolygon()
{
}
//
// Destructor
//
G4ClippablePolygon::~G4ClippablePolygon()
{
}
//
// AddVertexInOrder
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EllipticalTube.cc,v 1.7 2000/04/19 19:09:07 davidw Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4EllipticalTube.cc,v 1.9 2000/11/20 18:18:58 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -35,8 +35,8 @@
// Constructor
//
G4EllipticalTube::G4EllipticalTube( const G4String &name,
const G4double theDx, const G4double theDy, const G4double theDz )
: G4VSolid( name )
G4double theDx, G4double theDy, G4double theDz )
: G4VSolid( name )
{
dx = theDx;
dy = theDy;
@@ -182,7 +182,7 @@ EInside G4EllipticalTube::Inside( const G4ThreeVector& p) const
//
// Check x,y: are we outside?
//
G4double x = p.x(), y = p.y();
// G4double x = p.x(), y = p.y();
if (CheckXY(p.x(), p.y(), +halfTol) > 1.0) return kOutside;
@@ -459,7 +459,7 @@ G4double G4EllipticalTube::DistanceToOut( const G4ThreeVector& p,const G4ThreeVe
if (calcNorm) *validNorm = true;
G4double sBest = kInfinity;
const G4ThreeVector *nBest;
const G4ThreeVector *nBest=0;
//
// Might we intersect the -dz surface?
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EnclosingCylinder.cc,v 1.1 2000/04/07 11:00:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4EnclosingCylinder.cc,v 1.2 2000/11/02 16:54:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -26,8 +26,9 @@
// Constructor
//
G4EnclosingCylinder::G4EnclosingCylinder( const G4ReduciblePolygon *rz,
const G4bool thePhiIsOpen,
const G4double theStartPhi, const G4double theTotalPhi )
G4bool thePhiIsOpen,
G4double theStartPhi,
G4double theTotalPhi )
{
//
// Obtain largest r and smallest and largest z
@@ -39,7 +40,9 @@ G4EnclosingCylinder::G4EnclosingCylinder( const G4ReduciblePolygon *rz,
//
// Save phi info
//
if ( phiIsOpen = thePhiIsOpen ) {
phiIsOpen = thePhiIsOpen;
if ( phiIsOpen )
{
startPhi = theStartPhi;
totalPhi = theTotalPhi;
+14 -14
View File
@@ -5,9 +5,9 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Hype.cc,v 1.3 2000/04/19 17:56:44 davidw Exp $
// $Id: G4Hype.cc,v 1.5 2000/11/20 18:18:58 gcosmo Exp $
// $Original: G4Hype.cc,v 1.0 1998/06/09 16:57:50 safai Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -54,11 +54,11 @@
// Constructor - check parameters, and fills protected data members
G4Hype::G4Hype(const G4String& pName,
const G4double newInnerRadius,
const G4double newOuterRadius,
const G4double newInnerStereo,
const G4double newOuterStereo,
const G4double newHalfLenZ) : G4VSolid(pName)
G4double newInnerRadius,
G4double newOuterRadius,
G4double newInnerStereo,
G4double newOuterStereo,
G4double newHalfLenZ) : G4VSolid(pName)
{
// Check z-len
if (newHalfLenZ>0)
@@ -156,7 +156,7 @@ G4bool G4Hype::CalculateExtent( const EAxis axis,
//
G4bool splitOuter = (outerRadius/endOuterRadius < 0.95);
G4bool splitInner;
G4bool splitInner = 0;
if (InnerSurfaceExists()) {
splitInner = (innerRadius/endInnerRadius < 0.95);
}
@@ -186,7 +186,7 @@ G4bool G4Hype::CalculateExtent( const EAxis axis,
transform.ApplyPointTransform( v0 );
transform.ApplyPointTransform( v1 );
G4double zInnerSplit;
G4double zInnerSplit=0.;
if (InnerSurfaceExists()) {
if (splitInner) {
v2 = transform.TransformPoint(
@@ -1046,7 +1046,7 @@ G4NURBS* G4Hype::CreateNURBS () const
//
//
G4int G4Hype::IntersectHype( const G4ThreeVector &p, const G4ThreeVector &v,
const G4double r2, const G4double tan2Phi, G4double s[2] )
G4double r2, G4double tan2Phi, G4double s[2] )
{
G4double x0 = p.x(), y0 = p.y(), z0 = p.z();
G4double tx = v.x(), ty = v.y(), tz = v.z();
@@ -1110,8 +1110,8 @@ G4int G4Hype::IntersectHype( const G4ThreeVector &p, const G4ThreeVector &v,
// the z position on the asymptotic limit line that
// contains the normal on the line through the point p.
//
G4double G4Hype::ApproxDistOutside( const G4double pr, const G4double pz,
const G4double r0, const G4double tanPhi )
G4double G4Hype::ApproxDistOutside( G4double pr, G4double pz,
G4double r0, G4double tanPhi )
{
if (tanPhi < DBL_MIN) return pr-r0;
@@ -1167,8 +1167,8 @@ G4double G4Hype::ApproxDistOutside( const G4double pr, const G4double pz,
//
// Assumes pr and pz are positive
//
G4double G4Hype::ApproxDistInside( const G4double pr, const G4double pz,
const G4double r0, const G4double tan2Phi )
G4double G4Hype::ApproxDistInside( G4double pr, G4double pz,
G4double r0, G4double tan2Phi )
{
if (tan2Phi < DBL_MIN) return r0 - pr;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IntersectingCone.cc,v 1.1 2000/04/07 11:01:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4IntersectingCone.cc,v 1.2 2000/10/20 16:02:30 davidw Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -179,7 +179,7 @@ G4int G4IntersectingCone::LineHitsCone1( const G4ThreeVector &p, const G4ThreeVe
if (radical < -1E-6) return 0; // No solution
if (radical < 1E-6) {
if (radical < 1E-6*fabs(b)) {
//
// The radical is roughly zero: check for special, very rare, cases
//
@@ -271,7 +271,7 @@ G4int G4IntersectingCone::LineHitsCone2( const G4ThreeVector &p, const G4ThreeVe
if (radical < -1E-6) return 0; // No solution
if (radical < 1E-6) {
if (radical < 1E-6*fabs(b)) {
//
// The radical is roughly zero: check for special, very rare, cases
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolyPhiFace.cc,v 1.1 2000/04/07 11:01:31 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PolyPhiFace.cc,v 1.3 2000/11/20 18:18:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -36,8 +36,8 @@
// | | +--> z
// [0]---------[3]
//
G4PolyPhiFace::G4PolyPhiFace( const G4ReduciblePolygon *rz, const G4double phi,
const G4double deltaPhi, const G4double phiOther )
G4PolyPhiFace::G4PolyPhiFace( const G4ReduciblePolygon *rz, G4double phi,
G4double deltaPhi, G4double phiOther )
{
numEdges = rz->NumVertices();
@@ -251,16 +251,16 @@ G4PolyPhiFace::G4PolyPhiFace( const G4PolyPhiFace &source )
//
// Assignment operator
//
G4PolyPhiFace *G4PolyPhiFace::operator=( const G4PolyPhiFace &source )
G4PolyPhiFace& G4PolyPhiFace::operator=( const G4PolyPhiFace &source )
{
if (this == &source) return this;
if (this == &source) return *this;
delete [] edges;
delete [] corners;
CopyStuff( source );
return this;
return *this;
}
@@ -313,7 +313,7 @@ void G4PolyPhiFace::CopyStuff( const G4PolyPhiFace &source )
// Intersect
//
G4bool G4PolyPhiFace::Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
const G4bool outgoing, const G4double surfTolerance,
G4bool outgoing, G4double surfTolerance,
G4double &distance, G4double &distFromSurface,
G4ThreeVector &aNormal, G4bool &isAllBehind )
{
@@ -365,7 +365,7 @@ G4bool G4PolyPhiFace::Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
//
// Distance
//
G4double G4PolyPhiFace::Distance( const G4ThreeVector &p, const G4bool outgoing )
G4double G4PolyPhiFace::Distance( const G4ThreeVector &p, G4bool outgoing )
{
G4double normSign = outgoing ? +1 : -1;
//
@@ -407,7 +407,7 @@ G4double G4PolyPhiFace::Distance( const G4ThreeVector &p, const G4bool outgoing
//
// Inside
//
EInside G4PolyPhiFace::Inside( const G4ThreeVector &p, const G4double tolerance,
EInside G4PolyPhiFace::Inside( const G4ThreeVector &p, G4double tolerance,
G4double *bestDistance )
{
//
@@ -590,8 +590,8 @@ void G4PolyPhiFace::CalculateExtent( const EAxis axis,
// See: "Computational Geometry in C (Second Edition)"
// http://cs.smith.edu/~orourke/
//
G4bool G4PolyPhiFace::InsideEdgesExact( const G4double r, const G4double z,
const G4double normSign, const G4ThreeVector &p, const G4ThreeVector &v )
G4bool G4PolyPhiFace::InsideEdgesExact( G4double r, G4double z, G4double normSign,
const G4ThreeVector &p, const G4ThreeVector &v )
{
//
// Quick check of extent
@@ -720,7 +720,7 @@ G4bool G4PolyPhiFace::InsideEdgesExact( const G4double r, const G4double z,
// calculate the distance to the shape. I left it in here because ...
// well ... to test it better.
//
G4bool G4PolyPhiFace::InsideEdges( const G4double r, const G4double z )
G4bool G4PolyPhiFace::InsideEdges( G4double r, G4double z )
{
//
// Quick check of extent
@@ -742,13 +742,13 @@ G4bool G4PolyPhiFace::InsideEdges( const G4double r, const G4double z )
//
// Decide if the point in r,z is inside the edges of our face
//
G4bool G4PolyPhiFace::InsideEdges( const G4double r, const G4double z,
G4bool G4PolyPhiFace::InsideEdges( G4double r, G4double z,
G4double *bestDist2,
G4PolyPhiFaceVertex **base3Dnorm,
G4ThreeVector **head3Dnorm )
{
G4double bestDistance2 = kInfinity;
G4bool answer;
G4bool answer = 0;
G4PolyPhiFaceEdge *edge = edges;
do {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Polycone.cc,v 1.3 2000/06/27 16:20:11 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4Polycone.cc,v 1.4 2000/11/02 16:54:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -31,10 +31,10 @@
//
// Constructor (GEANT3 style parameters)
//
G4Polycone::G4Polycone( G4String name,
const G4double phiStart,
const G4double phiTotal,
const G4int numZPlanes,
G4Polycone::G4Polycone( const G4String& name,
G4double phiStart,
G4double phiTotal,
G4int numZPlanes,
const G4double zPlane[],
const G4double rInner[],
const G4double rOuter[] ) : G4VCSGfaceted( name )
@@ -74,10 +74,10 @@ G4Polycone::G4Polycone( G4String name,
//
// Constructor (generic parameters)
//
G4Polycone::G4Polycone( G4String name,
const G4double phiStart,
const G4double phiTotal,
const G4int numRZ,
G4Polycone::G4Polycone( const G4String& name,
G4double phiStart,
G4double phiTotal,
G4int numRZ,
const G4double r[],
const G4double z[] ) : G4VCSGfaceted( name )
{
@@ -96,8 +96,8 @@ G4Polycone::G4Polycone( G4String name,
//
// Generic create routine, called by each constructor after conversion of arguments
//
void G4Polycone::Create( const G4double phiStart,
const G4double phiTotal,
void G4Polycone::Create( G4double phiStart,
G4double phiTotal,
G4ReduciblePolygon *rz )
{
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolyconeSide.cc,v 1.1 2000/04/07 11:02:07 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PolyconeSide.cc,v 1.3 2000/11/20 18:18:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -36,10 +36,10 @@ G4PolyconeSide::G4PolyconeSide( const G4PolyconeSideRZ *prevRZ,
const G4PolyconeSideRZ *tail,
const G4PolyconeSideRZ *head,
const G4PolyconeSideRZ *nextRZ,
const G4double thePhiStart,
const G4double theDeltaPhi,
const G4bool thePhiIsOpen,
const G4bool isAllBehind )
G4double thePhiStart,
G4double theDeltaPhi,
G4bool thePhiIsOpen,
G4bool isAllBehind )
{
//
// Record values
@@ -140,16 +140,16 @@ G4PolyconeSide::G4PolyconeSide( const G4PolyconeSide &source )
//
// Assignment operator
//
G4PolyconeSide *G4PolyconeSide::operator=( const G4PolyconeSide &source )
G4PolyconeSide& G4PolyconeSide::operator=( const G4PolyconeSide &source )
{
if (this == &source) return this;
if (this == &source) return *this;
delete cone;
if (phiIsOpen) delete [] corners;
CopyStuff( source );
return this;
return *this;
}
@@ -200,7 +200,7 @@ void G4PolyconeSide::CopyStuff( const G4PolyconeSide &source )
// Intersect
//
G4bool G4PolyconeSide::Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
const G4bool outgoing, const G4double surfTolerance,
G4bool outgoing, G4double surfTolerance,
G4double &distance, G4double &distFromSurface,
G4ThreeVector &normal, G4bool &isAllBehind )
{
@@ -312,7 +312,7 @@ G4bool G4PolyconeSide::Intersect( const G4ThreeVector &p, const G4ThreeVector &v
}
G4double G4PolyconeSide::Distance( const G4ThreeVector &p, const G4bool outgoing )
G4double G4PolyconeSide::Distance( const G4ThreeVector &p, G4bool outgoing )
{
G4double normSign = outgoing ? -1 : +1;
G4double distFrom, distOut2;
@@ -350,7 +350,7 @@ G4double G4PolyconeSide::Distance( const G4ThreeVector &p, const G4bool outgoing
//
// Inside
//
EInside G4PolyconeSide::Inside( const G4ThreeVector &p, const G4double tolerance,
EInside G4PolyconeSide::Inside( const G4ThreeVector &p, G4double tolerance,
G4double *bestDistance )
{
//
@@ -629,7 +629,6 @@ void G4PolyconeSide::CalculateExtent( const EAxis axis,
}
do {
G4double min, max;
phi += sigPhi;
if (numPhi == 1) phi = startPhi+deltaPhi; // Try to avoid roundoff
@@ -703,7 +702,6 @@ void G4PolyconeSide::CalculateExtent( const EAxis axis,
// Add two additional faces if necessary
//
if (phiIsOpen && rNorm > DBL_MIN) {
G4double min, max;
G4double cosPhi = cos(startPhi),
sinPhi = sin(startPhi);
@@ -784,7 +782,7 @@ void G4PolyconeSide::CalculateExtent( const EAxis axis,
// Notes:
// * There are two answers, depending on which hemisphere is considered.
//
G4double G4PolyconeSide::DistanceAway( const G4ThreeVector &p, const G4bool opposite,
G4double G4PolyconeSide::DistanceAway( const G4ThreeVector &p, G4bool opposite,
G4double &distOutside2, G4double *edgeRZnorm )
{
//
@@ -859,7 +857,7 @@ G4double G4PolyconeSide::DistanceAway( const G4ThreeVector &p, const G4bool oppo
//
// Decide if a point is on a cone and return normal if it is
//
G4bool G4PolyconeSide::PointOnCone( const G4ThreeVector &hit, const G4double normSign,
G4bool G4PolyconeSide::PointOnCone( const G4ThreeVector &hit, G4double normSign,
const G4ThreeVector &p, const G4ThreeVector &v,
G4ThreeVector &normal )
{
@@ -923,11 +921,11 @@ G4bool G4PolyconeSide::PointOnCone( const G4ThreeVector &hit, const G4double nor
//
// It is assumed that the lines are *not* parallel
//
void G4PolyconeSide::FindLineIntersect( const G4double x1, const G4double y1,
const G4double tx1, const G4double ty1,
const G4double x2, const G4double y2,
const G4double tx2, const G4double ty2,
G4double &x, G4double &y )
void G4PolyconeSide::FindLineIntersect( G4double x1, G4double y1,
G4double tx1, G4double ty1,
G4double x2, G4double y2,
G4double tx2, G4double ty2,
G4double &x, G4double &y )
{
//
// The solution is a simple linear equation
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Polyhedra.cc,v 1.1 2000/04/07 11:02:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4Polyhedra.cc,v 1.2 2000/11/02 16:54:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -49,11 +49,11 @@
//
// GEANT3 PGON radii are specified in the distance to the norm of each face.
//
G4Polyhedra::G4Polyhedra( G4String name,
const G4double phiStart,
const G4double thePhiTotal,
const G4int theNumSide,
const G4int numZPlanes,
G4Polyhedra::G4Polyhedra( const G4String& name,
G4double phiStart,
G4double thePhiTotal,
G4int theNumSide,
G4int numZPlanes,
const G4double zPlane[],
const G4double rInner[],
const G4double rOuter[] ) : G4VCSGfaceted( name )
@@ -106,11 +106,11 @@ G4Polyhedra::G4Polyhedra( G4String name,
//
// Constructor (generic parameters)
//
G4Polyhedra::G4Polyhedra( G4String name,
const G4double phiStart,
const G4double phiTotal,
const G4int theNumSide,
const G4int numRZ,
G4Polyhedra::G4Polyhedra( const G4String& name,
G4double phiStart,
G4double phiTotal,
G4int theNumSide,
G4int numRZ,
const G4double r[],
const G4double z[] ) : G4VCSGfaceted( name )
{
@@ -129,9 +129,9 @@ G4Polyhedra::G4Polyhedra( G4String name,
//
// Generic create routine, called by each constructor after conversion of arguments
//
void G4Polyhedra::Create( const G4double phiStart,
const G4double phiTotal,
const G4int theNumSide,
void G4Polyhedra::Create( G4double phiStart,
G4double phiTotal,
G4int theNumSide,
G4ReduciblePolygon *rz )
{
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolyhedraSide.cc,v 1.1 2000/04/07 11:02:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PolyhedraSide.cc,v 1.3 2000/11/20 18:19:00 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -35,11 +35,11 @@ G4PolyhedraSide::G4PolyhedraSide( const G4PolyhedraSideRZ *prevRZ,
const G4PolyhedraSideRZ *tail,
const G4PolyhedraSideRZ *head,
const G4PolyhedraSideRZ *nextRZ,
const G4int theNumSide,
const G4double thePhiStart,
const G4double thePhiTotal,
const G4bool thePhiIsOpen,
const G4bool isAllBehind )
G4int theNumSide,
G4double thePhiStart,
G4double thePhiTotal,
G4bool thePhiIsOpen,
G4bool isAllBehind )
{
//
// Record values
@@ -207,7 +207,7 @@ G4PolyhedraSide::G4PolyhedraSide( const G4PolyhedraSideRZ *prevRZ,
} while( prev=vec, ++vec < vecs + numSide );
if (phiIsOpen) {
G4double rFact = cos(0.5*deltaPhi);
// G4double rFact = cos(0.5*deltaPhi);
//
// If phi is open, we need to patch up normals of the
// first and last edges and their corresponding
@@ -274,9 +274,9 @@ G4PolyhedraSide::G4PolyhedraSide( const G4PolyhedraSide &source )
//
// Assignment operator
//
G4PolyhedraSide *G4PolyhedraSide::operator=( const G4PolyhedraSide &source )
G4PolyhedraSide& G4PolyhedraSide::operator=( const G4PolyhedraSide &source )
{
if (this == &source) return this;
if (this == &source) return *this;
delete cone;
delete [] vecs;
@@ -284,7 +284,7 @@ G4PolyhedraSide *G4PolyhedraSide::operator=( const G4PolyhedraSide &source )
CopyStuff( source );
return this;
return *this;
}
@@ -380,7 +380,7 @@ void G4PolyhedraSide::CopyStuff( const G4PolyhedraSide &source )
//
//
G4bool G4PolyhedraSide::Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
const G4bool outgoing, const G4double surfTolerance,
G4bool outgoing, G4double surfTolerance,
G4double &distance, G4double &distFromSurface,
G4ThreeVector &normal, G4bool &isAllBehind )
{
@@ -492,7 +492,7 @@ G4bool G4PolyhedraSide::Intersect( const G4ThreeVector &p, const G4ThreeVector &
}
G4double G4PolyhedraSide::Distance( const G4ThreeVector &p, const G4bool outgoing )
G4double G4PolyhedraSide::Distance( const G4ThreeVector &p, G4bool outgoing )
{
G4double normSign = outgoing ? -1 : +1;
@@ -524,7 +524,7 @@ G4double G4PolyhedraSide::Distance( const G4ThreeVector &p, const G4bool outgoin
//
// Inside
//
EInside G4PolyhedraSide::Inside( const G4ThreeVector &p, const G4double tolerance,
EInside G4PolyhedraSide::Inside( const G4ThreeVector &p, G4double tolerance,
G4double *bestDistance )
{
//
@@ -700,8 +700,8 @@ void G4PolyhedraSide::CalculateExtent( const EAxis axis,
//
G4bool G4PolyhedraSide::IntersectSidePlane( const G4ThreeVector &p, const G4ThreeVector &v,
const G4PolyhedraSideVec vec,
const G4double normSign,
const G4double surfTolerance,
G4double normSign,
G4double surfTolerance,
G4double &distance, G4double &distFromSurface )
{
//
@@ -830,7 +830,7 @@ G4int G4PolyhedraSide::LineHitsSegments( const G4ThreeVector &p, const G4ThreeVe
// Decide which phi segment is closest in phi to the point.
// The result is the same as PhiSegment if there is no phi opening.
//
G4int G4PolyhedraSide::ClosestPhiSegment( const G4double phi0 )
G4int G4PolyhedraSide::ClosestPhiSegment( G4double phi0 )
{
G4int iPhi = PhiSegment( phi0 );
if (iPhi >= 0) return iPhi;
@@ -858,7 +858,7 @@ G4int G4PolyhedraSide::ClosestPhiSegment( const G4double phi0 )
// A value of -1 indicates that the phi value is outside the shape
// (only possible if phiTotal < 360 degrees).
//
G4int G4PolyhedraSide::PhiSegment( const G4double phi0 )
G4int G4PolyhedraSide::PhiSegment( G4double phi0 )
{
//
// How far are we from phiStart? Come up with a positive answer
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReduciblePolygon.cc,v 1.1 2000/04/07 11:03:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ReduciblePolygon.cc,v 1.3 2000/11/20 18:19:00 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -28,7 +28,8 @@
//
// Constructor: with simple arrays
//
G4ReduciblePolygon::G4ReduciblePolygon( const G4double a[], const G4double b[], const G4int n )
G4ReduciblePolygon::G4ReduciblePolygon( const G4double a[], const G4double b[],
G4int n )
{
//
// Do all of the real work in Create
@@ -41,7 +42,7 @@ G4ReduciblePolygon::G4ReduciblePolygon( const G4double a[], const G4double b[],
// Constructor: special PGON/PCON case
//
G4ReduciblePolygon::G4ReduciblePolygon( const G4double rmin[], const G4double rmax[],
const G4double z[], const G4int n )
const G4double z[], G4int n )
{
//
// Translate
@@ -74,7 +75,7 @@ G4ReduciblePolygon::G4ReduciblePolygon( const G4double rmin[], const G4double rm
// To be called by constructors, fill in the list and statistics for a new
// polygon
//
void G4ReduciblePolygon::Create( const G4double a[], const G4double b[], const G4int n )
void G4ReduciblePolygon::Create( const G4double a[], const G4double b[], G4int n )
{
if (n<3) G4Exception( "G4ReduciblePolygon: less than 3 vertices specified" );
@@ -139,7 +140,7 @@ void G4ReduciblePolygon::CopyVertices( G4double a[], G4double b[] ) const
//
// Multiply all a values by a common scale
//
void G4ReduciblePolygon::ScaleA( const G4double scale )
void G4ReduciblePolygon::ScaleA( G4double scale )
{
ABVertex *curr = vertexHead;
while( curr ) {
@@ -154,7 +155,7 @@ void G4ReduciblePolygon::ScaleA( const G4double scale )
//
// Multiply all b values by a common scale
//
void G4ReduciblePolygon::ScaleB( const G4double scale )
void G4ReduciblePolygon::ScaleB( G4double scale )
{
ABVertex *curr = vertexHead;
while( curr ) {
@@ -170,7 +171,7 @@ void G4ReduciblePolygon::ScaleB( const G4double scale )
// Remove adjacent vertices that are equal. Returns "false" if there
// is a problem (too few vertices remaining).
//
G4bool G4ReduciblePolygon::RemoveDuplicateVertices( const G4double tolerance )
G4bool G4ReduciblePolygon::RemoveDuplicateVertices( G4double tolerance )
{
ABVertex *curr = vertexHead,
*prev = 0,
@@ -221,7 +222,7 @@ G4bool G4ReduciblePolygon::RemoveDuplicateVertices( const G4double tolerance )
// Remove any unneeded vertices, i.e. those vertices which
// are on the line connecting the previous and next vertices.
//
G4bool G4ReduciblePolygon::RemoveRedundantVertices( const G4double tolerance )
G4bool G4ReduciblePolygon::RemoveRedundantVertices( G4double tolerance )
{
//
// Under these circumstances, we can quit now!
@@ -234,7 +235,6 @@ G4bool G4ReduciblePolygon::RemoveRedundantVertices( const G4double tolerance )
// Loop over all vertices
//
ABVertex *curr = vertexHead,
*prev = 0,
*next = curr->next; // A little dangerous
while( curr ) {
next = curr->next;
@@ -368,7 +368,7 @@ void G4ReduciblePolygon::ReverseOrder()
//
// Warning: this routine is not very fast (runs as N**2)
//
G4bool G4ReduciblePolygon::CrossesItself( const G4double tolerance )
G4bool G4ReduciblePolygon::CrossesItself( G4double tolerance )
{
G4double tolerance2 = tolerance*tolerance;
G4double one = 1.0-tolerance,
@@ -377,8 +377,9 @@ G4bool G4ReduciblePolygon::CrossesItself( const G4double tolerance )
// Top loop over line segments. By the time we finish
// with the second to last segment, we're done.
//
ABVertex *curr1 = vertexHead, *next1;
while (next1 = curr1->next) {
ABVertex *curr1 = vertexHead, *next1=0;
while (curr1->next) {
next1 = curr1->next;
G4double da1 = next1->a-curr1->a,
db1 = next1->b-curr1->b;
@@ -425,8 +426,8 @@ G4bool G4ReduciblePolygon::CrossesItself( const G4double tolerance )
//
// Decide if a line through two points crosses the polygon, within tolerance
//
G4bool G4ReduciblePolygon::BisectedBy( const G4double a1, const G4double b1,
const G4double a2, const G4double b2, const G4double tolerance )
G4bool G4ReduciblePolygon::BisectedBy( G4double a1, G4double b1,
G4double a2, G4double b2, G4double tolerance )
{
G4int nNeg = 0, nPos = 0;
@@ -449,7 +450,8 @@ G4bool G4ReduciblePolygon::BisectedBy( const G4double a1, const G4double b1,
if (nNeg) return true;
nPos++;
}
} while( curr = curr->next );
curr = curr->next;
} while( curr );
return false;
}
@@ -475,7 +477,8 @@ G4double G4ReduciblePolygon::Area()
if (next==0) next = vertexHead;
answer += curr->a*next->b - curr->b*next->a;
} while( curr = curr->next );
curr = curr->next;
} while( curr );
return 0.5*answer;
}
@@ -489,7 +492,8 @@ void G4ReduciblePolygon::Print()
ABVertex *curr = vertexHead;
do {
G4cerr << curr->a << " " << curr->b << G4endl;
} while( curr = curr->next );
curr = curr->next;
} while( curr );
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4SolidExtentList.cc,v 1.1 2000/04/07 11:03:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -4,8 +4,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VCSGfaceted.cc,v 1.5 2000/06/08 17:54:01 gracia Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VCSGfaceted.cc,v 1.6 2000/11/20 18:19:01 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -137,7 +137,7 @@ G4bool G4VCSGfaceted::CalculateExtent( const EAxis axis,
//
EInside G4VCSGfaceted::Inside( const G4ThreeVector &p ) const
{
EInside answer;
EInside answer=kOutside;
G4VCSGface **face = faces;
G4double best = kInfinity;
do {
@@ -181,8 +181,8 @@ G4ThreeVector G4VCSGfaceted::SurfaceNormal( const G4ThreeVector& p) const
G4double G4VCSGfaceted::DistanceToIn( const G4ThreeVector &p, const G4ThreeVector &v ) const
{
G4double distance = kInfinity;
G4double distFromSurface;
G4VCSGface *bestFace;
G4double distFromSurface = kInfinity;
G4VCSGface *bestFace=0;
G4VCSGface **face = faces;
do {
G4double faceDistance,
@@ -230,9 +230,9 @@ G4double G4VCSGfaceted::DistanceToOut( const G4ThreeVector &p, const G4ThreeVect
{
G4bool allBehind = true;
G4double distance = kInfinity;
G4double distFromSurface;
G4double distFromSurface = kInfinity;
G4ThreeVector normal;
G4VCSGface *bestFace;
G4VCSGface *bestFace=0;
G4VCSGface **face = faces;
do {
@@ -328,9 +328,7 @@ G4VisExtent G4VCSGfaceted::GetExtent() const
G4double answers[6] = {-kInfinity, -kInfinity, -kInfinity, -kInfinity, -kInfinity, -kInfinity};
G4VCSGface **face = faces;
do {
G4double vmax;
do {
const G4ThreeVector **axis = axes+5 ;
G4double *answer = answers+5;
do {