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.hh,v 1.2 2000/04/18 19:06:38 davidw Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ClippablePolygon.hh,v 1.4 2000/11/02 16:54:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -19,6 +19,8 @@
// Declaration of a utility class of a polygon that can be
// clipped by a voxel.
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4ClippablePolygon_hh
@@ -37,45 +39,74 @@ class G4VoxelLimits;
#include "g4rw/tvordvec.h"
typedef G4RWTValOrderedVector<G4ThreeVector> G4ThreeVectorList;
class G4ClippablePolygon {
public:
G4ClippablePolygon() {;}
virtual ~G4ClippablePolygon() {;}
class G4ClippablePolygon
{
public: // with description
G4ClippablePolygon();
virtual ~G4ClippablePolygon();
// Constructor & virtual destructor.
virtual void AddVertexInOrder( const G4ThreeVector vertex );
virtual void ClearAllVertices();
virtual void SetNormal( const G4ThreeVector &newNormal ) { normal = newNormal; }
virtual const G4ThreeVector GetNormal() const { return normal; }
inline void SetNormal( const G4ThreeVector &newNormal );
inline const G4ThreeVector GetNormal() const;
virtual G4bool Clip( const G4VoxelLimits &voxelLimit );
virtual G4bool PartialClip( const G4VoxelLimits &voxelLimit, const EAxis IgnoreMe );
virtual void ClipAlongOneAxis( const G4VoxelLimits &voxelLimit, const EAxis axis );
virtual G4bool PartialClip( const G4VoxelLimits &voxelLimit,
const EAxis IgnoreMe );
// Clip, while ignoring the indicated axis.
virtual void ClipAlongOneAxis( const G4VoxelLimits &voxelLimit,
const EAxis axis );
// Clip along just one axis, as specified in voxelLimit.
virtual G4bool GetExtent( const EAxis axis,
G4double &min, G4double &max ) const;
virtual const G4ThreeVector *GetMinPoint( const EAxis axis ) const;
// Returns pointer to minimum point along the specified axis.
// Take care! Do not use pointer after destroying parent polygon.
virtual const G4ThreeVector *GetMaxPoint( const EAxis axis ) const;
virtual G4int GetNumVertices() const { return vertices.entries(); }
virtual G4bool Empty() const { return vertices.entries()==0; }
// Returns pointer to maximum point along the specified axis.
// Take care! Do not use pointer after destroying parent polygon.
inline G4int GetNumVertices() const;
inline G4bool Empty() const;
virtual G4bool InFrontOf( const G4ClippablePolygon &other, EAxis axis ) const;
// Decide if the polygon is in "front" of another when
// viewed along the specified axis. For our purposes here,
// it is sufficient to use the minimum extent of the
// polygon along the axis to determine this.
virtual G4bool BehindOf( const G4ClippablePolygon &other, EAxis axis ) const;
// Decide if this polygon is behind another.
// Remarks in method "InFrontOf" are valid here too.
virtual G4bool GetPlanerExtent( const G4ThreeVector &pointOnPlane,
const G4ThreeVector &planeNormal,
G4double &min, G4double &max ) const;
protected:
G4ThreeVectorList vertices;
G4ThreeVector normal;
// Get min/max distance in or out of a plane.
protected: // with description
void ClipToSimpleLimits( G4ThreeVectorList& pPolygon,
G4ThreeVectorList& outputPolygon,
const G4VoxelLimits& pVoxelLimit );
// pVoxelLimits must be only limited along one axis, and either
// the maximum along the axis must be +kInfinity, or the minimum
// -kInfinity
protected:
G4ThreeVectorList vertices;
G4ThreeVector normal;
};
#include "G4ClippablePolygon.icc"
#endif
@@ -0,0 +1,41 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ClippablePolygon.icc,v 1.1 2000/11/02 16:54:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
//
// G4ClippablePolygon.icc
//
// Implementation of inline methods of G4ClippablePolygon
// --------------------------------------------------------------------
inline
void G4ClippablePolygon::SetNormal( const G4ThreeVector &newNormal )
{
normal = newNormal;
}
inline
const G4ThreeVector G4ClippablePolygon::GetNormal() const
{
return normal;
}
inline
G4int G4ClippablePolygon::GetNumVertices() const
{
return vertices.entries();
}
inline
G4bool G4ClippablePolygon::Empty() const
{
return vertices.entries()==0;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EllipticalTube.hh,v 1.6 2000/04/19 19:08:58 davidw Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4EllipticalTube.hh,v 1.8 2000/11/02 16:54:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -16,10 +16,17 @@
// Class description:
//
// Declaration of a CSG volume representing a tube with elliptical
// cross section (geant3 solid 'ELTU')
// cross section (geant3 solid 'ELTU'):
//
// G4EllipticalTube( const G4String& name,
// G4double Dx,
// G4double Dy,
// G4double Dz )
//
// The equation of the surface in x/y is 1.0 = (x/dx)**2 + (y/dy)**2
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4EllipticalTube_hh
@@ -27,14 +34,16 @@
#include "G4VSolid.hh"
class G4EllipticalTube : public G4VSolid {
public:
class G4EllipticalTube : public G4VSolid
{
public:
G4EllipticalTube( const G4String &name,
const G4double theDx, const G4double theDy, const G4double theDz );
G4double theDx, G4double theDy, G4double theDz );
virtual ~G4EllipticalTube();
//
// Standard CSG inherited methods
// Standard CSG methods
//
virtual G4bool CalculateExtent( const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -52,12 +61,13 @@ class G4EllipticalTube : public G4VSolid {
G4bool *validNorm=0,G4ThreeVector *n=0 ) const;
virtual G4double DistanceToOut( const G4ThreeVector& p ) const;
virtual G4GeometryType GetEntityType() const { return G4String("G4EllipticalTube"); }
G4GeometryType GetEntityType() const { return G4String("G4EllipticalTube"); }
//
// Visualisation methods
//
virtual G4Polyhedron* CreatePolyhedron() const;
virtual void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
virtual G4VisExtent GetExtent() const;
@@ -72,7 +82,8 @@ class G4EllipticalTube : public G4VSolid {
void SetDy( const G4double newDy ) { dy = newDy; }
void SetDz( const G4double newDz ) { dz = newDz; }
protected:
protected:
G4double dx, dy, dz;
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EnclosingCylinder.hh,v 1.1 2000/04/07 10:55:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4EnclosingCylinder.hh,v 1.3 2000/11/02 16:54:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -20,6 +20,8 @@
// is clearly outside a polyhedra or polycone or deciding if
// a trajectory is clearly going to miss those shapes.
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4EnclosingCylinder_hh
@@ -31,17 +33,25 @@
class G4ReduciblePolygon;
class G4EnclosingCylinder {
public:
class G4EnclosingCylinder
{
public: // with description
G4EnclosingCylinder( const G4ReduciblePolygon *rz,
const G4bool phiIsOpen,
const G4double startPhi, const G4double totalPhi );
G4bool phiIsOpen,
G4double startPhi, G4double totalPhi );
~G4EnclosingCylinder();
G4bool MustBeOutside( const G4ThreeVector &p ) const;
// Decide very rapidly if the point is outside the cylinder.
// If one is not certain, return false.
G4bool ShouldMiss( const G4ThreeVector &p, const G4ThreeVector &v ) const;
protected:
// Decide very rapidly if the trajectory is going to miss the cylinder.
// If one is not sure, return false.
protected:
G4double radius; // radius of our cylinder
G4double zLo, zHi; // z extent
@@ -5,9 +5,9 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Hype.hh,v 1.3 2000/04/19 17:56:27 davidw Exp $
// $Id: G4Hype.hh,v 1.4 2000/11/02 16:54:48 gcosmo Exp $
// $Original: G4Hype.hh,v 1.0 1998/06/09 16:57:50 safai Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -37,7 +37,7 @@
//
// As inherited from G4VSolid,
//
// G4Hype(const G4String &pName
// G4Hype(const G4String& pName
// const G4double innerRadius
// const G4double outerRadius
// const G4double innerStereo
@@ -54,7 +54,7 @@
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
//
// Create the List of transformed vertices in the format required
// for G4VSolid:: ClipCrossSection and ClipBetweenSections.
// for G4VSolid::ClipCrossSection and ClipBetweenSections.
// Authors:
// Ernesto Lamanna (Ernesto.Lamanna@roma1.infn.it) &
@@ -75,15 +75,16 @@
class G4SolidExtentList;
class G4ClippablePolygon;
class G4Hype : public G4VSolid {
public:
class G4Hype : public G4VSolid
{
public:
G4Hype(const G4String &pName,
const G4double newInnerRadius,
const G4double newOuterRadius,
const G4double newInnerStereo,
const G4double newOuterStereo,
const G4double newHalfLenZ);
G4double newInnerRadius,
G4double newOuterRadius,
G4double newInnerStereo,
G4double newOuterStereo,
G4double newHalfLenZ);
virtual ~G4Hype();
@@ -96,47 +97,17 @@ public:
const G4AffineTransform& pTransform,
G4double& pmin, G4double& pmax) const;
G4double GetInnerRadius () const { return innerRadius; }
G4double GetOuterRadius () const { return outerRadius; }
G4double GetZHalfLength () const { return halfLenZ; }
G4double GetInnerStereo () const { return innerStereo; }
G4double GetOuterStereo () const { return outerStereo; }
inline G4double GetInnerRadius () const;
inline G4double GetOuterRadius () const;
inline G4double GetZHalfLength () const;
inline G4double GetInnerStereo () const;
inline G4double GetOuterStereo () const;
void SetInnerRadius (G4double newIRad)
{
innerRadius= newIRad;
innerRadius2= newIRad*newIRad;
endInnerRadius2=HypeInnerRadius2(halfLenZ);
endInnerRadius=sqrt(endInnerRadius2);
}
void SetOuterRadius (G4double newORad)
{
outerRadius= newORad;
outerRadius2=newORad*newORad;
endOuterRadius2=HypeOuterRadius2(halfLenZ);
endOuterRadius=sqrt(endOuterRadius2);
}
void SetZHalfLength (G4double newHLZ) { halfLenZ = newHLZ ; }
void SetInnerStereo (G4double newISte)
{
innerStereo= fabs(newISte);
tanInnerStereo=tan(innerStereo);
tanInnerStereo2=tanInnerStereo*tanInnerStereo;
endInnerRadius2=HypeInnerRadius2(halfLenZ);
endInnerRadius=sqrt(endInnerRadius2);
}
void SetOuterStereo (G4double newOSte)
{
outerStereo= fabs(newOSte);
tanOuterStereo=tan(outerStereo);
tanOuterStereo2=tanOuterStereo*tanOuterStereo;
endOuterRadius2=HypeOuterRadius2(halfLenZ);
endOuterRadius=sqrt(endOuterRadius2);
}
inline void SetInnerRadius (G4double newIRad);
inline void SetOuterRadius (G4double newORad);
inline void SetZHalfLength (G4double newHLZ);
inline void SetInnerStereo (G4double newISte);
inline void SetOuterStereo (G4double newOSte);
EInside Inside(const G4ThreeVector& p) const;
@@ -144,36 +115,36 @@ public:
G4double DistanceToIn(const G4ThreeVector& p,const G4ThreeVector& v) const;
G4double DistanceToIn(const G4ThreeVector& p) const;
G4double DistanceToOut(const G4ThreeVector& p,const G4ThreeVector& v,
G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v,
const G4bool calcNorm=G4bool(false),
G4bool *validNorm=0,G4ThreeVector *n=0) const;
G4bool *validNorm=0, G4ThreeVector *n=0) const;
G4double DistanceToOut(const G4ThreeVector& p) const;
virtual G4GeometryType GetEntityType() const { return G4String("G4Hype"); }
inline G4GeometryType GetEntityType() const;
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
G4VisExtent GetExtent () const;
G4Polyhedron* CreatePolyhedron () const;
G4NURBS* CreateNURBS () const;
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
G4VisExtent GetExtent () const;
G4Polyhedron* CreatePolyhedron () const;
G4NURBS* CreateNURBS () const;
protected:
protected:
// whether we have an inner surface or not
G4bool InnerSurfaceExists() const { return (innerRadius > DBL_MIN) || (innerStereo != 0); }
inline G4bool InnerSurfaceExists() const;
// whether we have an inner surface or not
// approximate isotropic distance to hyperbolic surface
static G4double ApproxDistOutside( const G4double pr, const G4double pz,
const G4double r0, const G4double tanPhi );
static G4double ApproxDistInside( const G4double pr, const G4double pz,
const G4double r0, const G4double tan2Phi );
static G4double ApproxDistOutside( G4double pr, G4double pz,
G4double r0, G4double tanPhi );
static G4double ApproxDistInside( G4double pr, G4double pz,
G4double r0, G4double tan2Phi );
// approximate isotropic distance to hyperbolic surface
// values of hype radius at a given Z
G4double HypeInnerRadius2(const G4double zVal) const { return (tanInnerStereo2*zVal*zVal+innerRadius2); }
G4double HypeOuterRadius2(const G4double zVal) const { return (tanOuterStereo2*zVal*zVal+outerRadius2); }
inline G4double HypeInnerRadius2(G4double zVal) const;
inline G4double HypeOuterRadius2(G4double zVal) const;
// values of hype radius at a given Z
// intersection with hyperbolic surface
static G4int IntersectHype( const G4ThreeVector &p, const G4ThreeVector &v,
const G4double r2, const G4double tan2Phi, G4double s[2] );
G4double r2, G4double tan2Phi, G4double s[2] );
// intersection with hyperbolic surface
static void AddPolyToExtent( const G4ThreeVector &v0,
const G4ThreeVector &v1,
@@ -182,15 +153,17 @@ protected:
const G4VoxelLimits &voxelLimit,
const EAxis axis,
G4SolidExtentList &extentList );
G4double innerRadius; // variable names are quite self explanative
protected:
G4double innerRadius;
G4double outerRadius;
G4double halfLenZ;
G4double innerStereo;
G4double outerStereo;
// precalculated parameters, squared quantities
G4double tanInnerStereo;
G4double tanOuterStereo;
G4double tanInnerStereo2; // squared tan of Inner Stereo angle
@@ -203,7 +176,10 @@ protected:
G4double endOuterRadius; // endcap Outer Radius
// Used by distanceToOut
enum ESide {outerFace,innerFace,leftCap, rightCap};
};
#include "G4Hype.icc"
#endif
@@ -0,0 +1,115 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Hype.icc,v 1.1 2000/11/02 16:54:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
//
// G4Hype.icc
//
// Implementation of inline methods of G4Hype
// --------------------------------------------------------------------
inline
G4double G4Hype::GetInnerRadius () const
{
return innerRadius;
}
inline
G4double G4Hype::GetOuterRadius () const
{
return outerRadius;
}
inline
G4double G4Hype::GetZHalfLength () const
{
return halfLenZ;
}
inline
G4double G4Hype::GetInnerStereo () const
{
return innerStereo;
}
inline
G4double G4Hype::GetOuterStereo () const
{
return outerStereo;
}
inline
void G4Hype::SetInnerRadius (G4double newIRad)
{
innerRadius= newIRad;
innerRadius2= newIRad*newIRad;
endInnerRadius2=HypeInnerRadius2(halfLenZ);
endInnerRadius=sqrt(endInnerRadius2);
}
inline
void G4Hype::SetOuterRadius (G4double newORad)
{
outerRadius= newORad;
outerRadius2=newORad*newORad;
endOuterRadius2=HypeOuterRadius2(halfLenZ);
endOuterRadius=sqrt(endOuterRadius2);
}
inline
void G4Hype::SetZHalfLength (G4double newHLZ)
{
halfLenZ = newHLZ ;
}
inline
void G4Hype::SetInnerStereo (G4double newISte)
{
innerStereo= fabs(newISte);
tanInnerStereo=tan(innerStereo);
tanInnerStereo2=tanInnerStereo*tanInnerStereo;
endInnerRadius2=HypeInnerRadius2(halfLenZ);
endInnerRadius=sqrt(endInnerRadius2);
}
inline
void G4Hype::SetOuterStereo (G4double newOSte)
{
outerStereo= fabs(newOSte);
tanOuterStereo=tan(outerStereo);
tanOuterStereo2=tanOuterStereo*tanOuterStereo;
endOuterRadius2=HypeOuterRadius2(halfLenZ);
endOuterRadius=sqrt(endOuterRadius2);
}
inline
G4GeometryType G4Hype::GetEntityType() const
{
return G4String("G4Hype");
}
inline
G4bool G4Hype::InnerSurfaceExists() const
{
return (innerRadius > DBL_MIN) || (innerStereo != 0);
}
inline
G4double G4Hype::HypeInnerRadius2(G4double zVal) const
{
return (tanInnerStereo2*zVal*zVal+innerRadius2);
}
inline
G4double G4Hype::HypeOuterRadius2(G4double zVal) const
{
return (tanOuterStereo2*zVal*zVal+outerRadius2);
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IntersectingCone.hh,v 1.1 2000/04/07 10:56:27 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4IntersectingCone.hh,v 1.3 2000/11/02 16:54:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -19,7 +19,9 @@
//
// Utility class which calculates the intersection
// of an arbitrary line with a fixed cone
//
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4IntersectingCone_hh
@@ -29,8 +31,10 @@
#include "geomdefs.hh"
#include "G4ThreeVector.hh"
class G4IntersectingCone {
public:
class G4IntersectingCone
{
public:
G4IntersectingCone( const G4double r[2], const G4double z[2] );
virtual ~G4IntersectingCone();
@@ -45,7 +49,8 @@ class G4IntersectingCone {
inline G4double ZHi() const { return zHi; }
protected:
protected:
G4double zLo, zHi, // Z bounds of side
rLo, rHi; // R bounds of side
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolyPhiFace.hh,v 1.1 2000/04/07 10:56:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PolyPhiFace.hh,v 1.3 2000/11/02 16:54:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -18,13 +18,20 @@
// Class description:
//
// Definition of a face that bounds a polycone or polyhedra when
// it has a phi opening.
// it has a phi opening:
//
// G4PolyPhiFace( const G4ReduciblePolygon *rz,
// G4double phi,
// G4double deltaPhi,
// G4double phiOther )
//
// Specifically: a face that lies on a plane that passes through
// the z axis. It has boundaries that are straight lines of arbitrary
// length and direction, but with corners aways on the same side of
// the z axis.
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4PolyPhiFace_hh
@@ -48,24 +55,36 @@ typedef struct {
G4ThreeVector norm3D; // 3D edge normal vector
} G4PolyPhiFaceEdge;
class G4PolyPhiFace : public G4VCSGface {
class G4PolyPhiFace : public G4VCSGface
{
public:
G4PolyPhiFace( const G4ReduciblePolygon *rz,
const G4double phi, const G4double deltaPhi, const G4double phiOther );
virtual ~G4PolyPhiFace();
public: // with description
G4PolyPhiFace( const G4ReduciblePolygon *rz,
G4double phi, G4double deltaPhi, G4double phiOther );
// Constructor.
// Points r,z should be supplied in clockwise order in r,z.
// For example:
// [1]---------[2] ^ R
// | | |
// | | +--> z
// [0]---------[3]
virtual ~G4PolyPhiFace();
// Destructor. Removes edges and corners.
G4PolyPhiFace( const G4PolyPhiFace &source );
G4PolyPhiFace *operator=( const G4PolyPhiFace &source );
G4PolyPhiFace& operator=( const G4PolyPhiFace &source );
// Copy constructor and assgnment operator.
G4bool Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
const G4bool outgoing, const G4double surfTolerance,
G4bool outgoing, G4double surfTolerance,
G4double &distance, G4double &distFromSurface,
G4ThreeVector &normal, G4bool &allBehind );
G4double Distance( const G4ThreeVector &p, const G4bool outgoing );
G4double Distance( const G4ThreeVector &p, G4bool outgoing );
EInside Inside( const G4ThreeVector &p, const G4double tolerance,
EInside Inside( const G4ThreeVector &p, G4double tolerance,
G4double *bestDistance );
G4ThreeVector Normal( const G4ThreeVector &p, G4double *bestDistance );
@@ -77,34 +96,47 @@ class G4PolyPhiFace : public G4VCSGface {
const G4AffineTransform &tranform,
G4SolidExtentList &extentList );
G4VCSGface *Clone() { return new G4PolyPhiFace(*this); }
void Diagnose( G4VSolid *solid );
protected:
G4PolyPhiFaceEdge *edges; // The edges of the face
G4PolyPhiFaceVertex *corners; // And the corners
G4int numEdges; // Number of edges
G4ThreeVector normal; // Normal unit vector
G4ThreeVector radial; // Unit vector along radial direction
G4ThreeVector surface; // Point on surface
G4double rMin, rMax, // Extent in r
zMin, zMax; // Extent in z
G4bool allBehind; // True if the entire polycone/polyhedra is behind the place
// of this face
G4bool InsideEdgesExact( const G4double r, const G4double z,
const G4double normSign, const G4ThreeVector &p, const G4ThreeVector &v );
G4bool InsideEdges( const G4double r, const G4double z );
G4bool InsideEdges( const G4double r, const G4double z,
G4double *distRZ2, G4PolyPhiFaceVertex **base3Dnorm=0,
G4ThreeVector **head3Dnorm=0 );
inline G4VCSGface *Clone();
// Allocates on the heap a clone of this face.
inline G4double ExactZOrder( const G4double z,
const G4double qx, const G4double qy, const G4double qz,
public: // without description
void Diagnose( G4VSolid *solid );
// Throw an exception if something is found inconsistent with
// the solid. For debugging purposes only
protected:
G4PolyPhiFaceEdge *edges; // The edges of the face
G4PolyPhiFaceVertex *corners; // And the corners
G4int numEdges; // Number of edges
G4ThreeVector normal; // Normal unit vector
G4ThreeVector radial; // Unit vector along radial direction
G4ThreeVector surface; // Point on surface
G4double rMin, rMax, // Extent in r
zMin, zMax; // Extent in z
G4bool allBehind; // True if the polycone/polyhedra
// is behind the place of this face
G4bool InsideEdgesExact( G4double r, G4double z, G4double normSign,
const G4ThreeVector &p, const G4ThreeVector &v );
// Decide if the point in r,z is inside the edges of our face,
// **but** do so consistently with other faces.
G4bool InsideEdges( G4double r, G4double z );
G4bool InsideEdges( G4double r, G4double z, G4double *distRZ2,
G4PolyPhiFaceVertex **base3Dnorm=0,
G4ThreeVector **head3Dnorm=0 );
// Decide if the point in r,z is inside the edges of our face.
inline G4double ExactZOrder( G4double z,
G4double qx, G4double qy, G4double qz,
const G4ThreeVector &v,
const G4double normSign,
G4double normSign,
const G4PolyPhiFaceVertex *vert ) const;
// Decide precisely whether a trajectory passes to the left, right,
// or exactly passes through the z position of a vertex point in face.
void CopyStuff( const G4PolyPhiFace &source );
};
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolyPhiFace.icc,v 1.1 2000/04/07 10:57:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PolyPhiFace.icc,v 1.2 2000/11/02 16:54:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -17,6 +17,12 @@
// Implementation of inline methods of G4PolyPhiFace
// --------------------------------------------------------------------
inline
G4VCSGface* G4PolyPhiFace::Clone()
{
return new G4PolyPhiFace(*this);
}
// ExactZOrder
//
// Decide precisely whether a trajectory passes to the left, right, or exactly
@@ -29,11 +35,13 @@
// In 99.9999% of the cases, a trivial calculation is used. In difficult
// cases, a precise, compliant calculation is relied on.
//
inline G4double G4PolyPhiFace::ExactZOrder( const G4double z,
const G4double qx, const G4double qy, const G4double qz,
const G4ThreeVector &v,
const G4double normSign,
const G4PolyPhiFaceVertex *vert ) const {
inline
G4double G4PolyPhiFace::ExactZOrder( G4double z,
G4double qx, G4double qy, G4double qz,
const G4ThreeVector &v,
G4double normSign,
const G4PolyPhiFaceVertex *vert ) const
{
G4double answer = vert->z - z;
if (fabs(answer) < kCarTolerance) {
G4ThreeVector qa( qx - vert->x + radial.x(),
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Polycone.hh,v 1.3 2000/06/27 16:20:11 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4Polycone.hh,v 1.5 2000/11/02 16:54:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -18,8 +18,25 @@
// Class description:
//
// Class implementing a CSG type "PCON" Geant 3.21 volume,
// inherited from class G4VCSGSolid.
// inherited from class G4VCSGSolid:
//
// G4Polycone( const G4String& name,
// G4double phiStart, // initial phi starting angle
// G4double phiTotal, // total phi angle
// G4int numZPlanes, // number of z planes
// const G4double zPlane[], // position of z planes
// const G4double rInner[], // tangent distance to inner surface
// const G4double rOuter[]) // tangent distance to outer surface
//
// G4Polycone( const G4String& name,
// G4double phiStart, // initial phi starting angle
// G4double phiTotal, // total phi angle
// G4int numRZ, // number corners in r,z space
// const G4double r[], // r coordinate of these corners
// const G4double z[]) // z coordinate of these corners
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4Polycone_hh
@@ -35,21 +52,22 @@ class G4VCSGface;
class G4Polycone : public G4VCSGfaceted
{
public:
G4Polycone( G4String name,
const G4double phiStart, // initial phi starting angle
const G4double phiTotal, // total phi angle
const G4int numZPlanes, // number of z planes
const G4double zPlane[], // position of z planes
const G4double rInner[], // tangent distance to inner surface
const G4double rOuter[] ); // tangent distance to outer surface
public:
G4Polycone( G4String name,
const G4double phiStart, // initial phi starting angle
const G4double phiTotal, // total phi angle
const G4int numRZ, // number corners in r,z space
const G4double r[], // r coordinate of these corners
const G4double z[] ); // z coordinate of these corners
G4Polycone( const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numZPlanes, // number of z planes
const G4double zPlane[], // position of z planes
const G4double rInner[], // tangent distance to inner surface
const G4double rOuter[] ); // tangent distance to outer surface
G4Polycone( const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numRZ, // number corners in r,z space
const G4double r[], // r coordinate of these corners
const G4double z[] ); // z coordinate of these corners
virtual ~G4Polycone();
@@ -70,7 +88,7 @@ class G4Polycone : public G4VCSGfaceted
const G4int n,
const G4VPhysicalVolume* pRep);
virtual G4GeometryType GetEntityType() const { return G4String("G4Polycone"); }
G4GeometryType GetEntityType() const { return G4String("G4Polycone"); }
G4Polyhedron* CreatePolyhedron() const;
G4NURBS* CreateNURBS() const;
@@ -82,9 +100,10 @@ class G4Polycone : public G4VCSGfaceted
inline G4double GetEndPhi() const { return endPhi; }
inline G4bool IsOpen() const { return phiIsOpen; }
inline G4int GetNumRZCorner() const { return numCorner;}
inline G4PolyconeSideRZ GetCorner( const G4int index ) const { return corners[index]; }
inline G4PolyconeSideRZ GetCorner(G4int index) const { return corners[index]; }
protected:
protected:
//
// Here are our parameters
//
@@ -121,9 +140,9 @@ class G4Polycone : public G4VCSGfaceted
//
// Generic initializer, called by all constructors
//
void Create( const G4double phiStart, // initial phi starting angle
const G4double phiTotal, // total phi angle
G4ReduciblePolygon *rz ); // r/z coordinate of these corners
void Create( G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4ReduciblePolygon *rz); // r/z coordinate of these corners
void CopyStuff( const G4Polycone &source );
};
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolyconeSide.hh,v 1.1 2000/04/07 10:57:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PolyconeSide.hh,v 1.3 2000/11/02 16:54:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -18,8 +18,20 @@
// Class description:
//
// Class implmenting a face that represents one conical side
// of a polycone.
// of a polycone:
//
// G4PolyconeSide( const G4PolyconeSideRZ *prevRZ,
// const G4PolyconeSideRZ *tail,
// const G4PolyconeSideRZ *head,
// const G4PolyconeSideRZ *nextRZ,
// G4double phiStart, G4double deltaPhi,
// G4bool phiIsOpen, G4bool isAllBehind=false )
//
// Values for r1,z1 and r2,z2 should be specified in clockwise
// order in (r,z).
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4PolyconeSide_hh
@@ -33,27 +45,29 @@ typedef struct {
G4double r, z; // start of vector
} G4PolyconeSideRZ;
class G4PolyconeSide : public G4VCSGface {
public:
class G4PolyconeSide : public G4VCSGface
{
public:
G4PolyconeSide( const G4PolyconeSideRZ *prevRZ,
const G4PolyconeSideRZ *tail,
const G4PolyconeSideRZ *head,
const G4PolyconeSideRZ *nextRZ,
const G4double phiStart, const G4double deltaPhi,
const G4bool phiIsOpen, const G4bool isAllBehind=false );
G4double phiStart, G4double deltaPhi,
G4bool phiIsOpen, G4bool isAllBehind=false );
virtual ~G4PolyconeSide();
G4PolyconeSide( const G4PolyconeSide &source );
G4PolyconeSide *operator=( const G4PolyconeSide &source );
G4PolyconeSide& operator=( const G4PolyconeSide &source );
G4bool 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 );
G4double Distance( const G4ThreeVector &p, const G4bool outgoing );
G4double Distance( const G4ThreeVector &p, G4bool outgoing );
EInside Inside( const G4ThreeVector &p, const G4double tolerance,
EInside Inside( const G4ThreeVector &p, G4double tolerance,
G4double *bestDistance );
G4ThreeVector Normal( const G4ThreeVector &p, G4double *bestDistance );
@@ -67,7 +81,8 @@ class G4PolyconeSide : public G4VCSGface {
G4VCSGface *Clone() { return new G4PolyconeSide( *this ); }
protected:
protected:
G4double r[2], z[2]; // r, z parameters, in specified order
G4double startPhi, // Start phi (0 to 2pi), if phiIsOpen
deltaPhi; // Delta phi (0 to 2pi), if phiIsOpen
@@ -89,18 +104,18 @@ class G4PolyconeSide : public G4VCSGface {
G4ThreeVector *corners; // The coordinates of the corners (if phiIsOpen)
G4double DistanceAway( const G4ThreeVector &p, const G4bool opposite,
G4double DistanceAway( const G4ThreeVector &p, G4bool opposite,
G4double &distOutside2, G4double *rzNorm=0 );
G4bool PointOnCone( const G4ThreeVector &hit, const G4double normSign,
G4bool PointOnCone( const G4ThreeVector &hit, G4double normSign,
const G4ThreeVector &p, const G4ThreeVector &v, G4ThreeVector &normal );
void CopyStuff( const G4PolyconeSide &source );
static void 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,
static void FindLineIntersect( G4double x1, G4double y1,
G4double tx1, G4double ty1,
G4double x2, G4double y2,
G4double tx2, G4double ty2,
G4double &x, G4double &y );
};
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Polyhedra.hh,v 1.2 2000/06/26 09:54:34 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4Polyhedra.hh,v 1.4 2000/11/02 16:54:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -18,8 +18,27 @@
// Class description:
//
// Class implementing a CSG type "PGON" Geant 3.21 volume,
// inherited from class G4CSGSolid.
// inherited from class G4CSGSolid:
//
// G4Polyhedra( const G4String& name,
// G4double phiStart, - initial phi starting angle
// G4double phiTotal, - total phi angle
// G4int numSide, - number sides
// G4int numZPlanes, - number of z planes
// const G4double zPlane[], - position of z planes
// const G4double rInner[], - tangent distance to inner surface
// const G4double rOuter[] ) - tangent distance to outer surface
//
// G4Polyhedra( const G4String& name,
// G4double phiStart, - initial phi starting angle
// G4double phiTotal, - total phi angle
// G4int numSide, - number sides
// G4int numRZ, - number corners in r,z space
// const G4double r[], - r coordinate of these corners
// const G4double z[] ) - z coordinate of these corners
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4Polyhedra_hh
@@ -31,24 +50,26 @@
class G4EnclosingCylinder;
class G4ReduciblePolygon;
class G4Polyhedra : public G4VCSGfaceted {
public:
G4Polyhedra( G4String name,
const G4double phiStart, // initial phi starting angle
const G4double phiTotal, // total phi angle
const G4int numSide, // number sides
const G4int numZPlanes, // number of z planes
const G4double zPlane[], // position of z planes
const G4double rInner[], // tangent distance to inner surface
const G4double rOuter[] ); // tangent distance to outer surface
class G4Polyhedra : public G4VCSGfaceted
{
public:
G4Polyhedra( G4String name,
const G4double phiStart, // initial phi starting angle
const G4double phiTotal, // total phi angle
const G4int numSide, // number sides
const G4int numRZ, // number corners in r,z space
const G4double r[], // r coordinate of these corners
const G4double z[] ); // z coordinate of these corners
G4Polyhedra( const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numSide, // number sides
G4int numZPlanes, // number of z planes
const G4double zPlane[], // position of z planes
const G4double rInner[], // tangent distance to inner surface
const G4double rOuter[] ); // tangent distance to outer surface
G4Polyhedra( const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numSide, // number sides
G4int numRZ, // number corners in r,z space
const G4double r[], // r coordinate of these corners
const G4double z[] ); // z coordinate of these corners
virtual ~G4Polyhedra();
@@ -116,9 +137,9 @@ class G4Polyhedra : public G4VCSGfaceted {
//
// Generic initializer, call by all constructors
//
void Create( const G4double phiStart, // initial phi starting angle
const G4double phiTotal, // total phi angle
const G4int numSide, // number sides
void Create( G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numSide, // number sides
G4ReduciblePolygon *rz ); // rz coordinates
void CopyStuff( const G4Polyhedra &source );
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolyhedraSide.hh,v 1.1 2000/04/07 10:58:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4PolyhedraSide.hh,v 1.3 2000/11/02 16:54:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -18,8 +18,21 @@
// Class description:
//
// Class implementing a face that represents one segmented side
// of a polyhedra.
// of a polyhedra:
//
// G4PolyhedraSide( const G4PolyhedraSideRZ *prevRZ,
// const G4PolyhedraSideRZ *tail,
// const G4PolyhedraSideRZ *head,
// const G4PolyhedraSideRZ *nextRZ,
// G4int numSide,
// G4double phiStart, G4double phiTotal,
// G4bool phiIsOpen, G4bool isAllBehind=false )
//
// Values for r1,z1 and r2,z2 should be specified in clockwise
// order in (r,z).
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4PolyhedraSide_hh
@@ -33,28 +46,31 @@ typedef struct {
G4double r, z; // start of vector
} G4PolyhedraSideRZ;
class G4PolyhedraSide : public G4VCSGface {
public:
class G4PolyhedraSide : public G4VCSGface
{
public:
G4PolyhedraSide( const G4PolyhedraSideRZ *prevRZ,
const G4PolyhedraSideRZ *tail,
const G4PolyhedraSideRZ *head,
const G4PolyhedraSideRZ *nextRZ,
const G4int numSide,
const G4double phiStart, const G4double phiTotal,
const G4bool phiIsOpen, const G4bool isAllBehind=false );
G4int numSide,
G4double phiStart, G4double phiTotal,
G4bool phiIsOpen, G4bool isAllBehind=false );
virtual ~G4PolyhedraSide();
G4PolyhedraSide( const G4PolyhedraSide &source );
G4PolyhedraSide *operator=( const G4PolyhedraSide &source );
G4PolyhedraSide& operator=( const G4PolyhedraSide &source );
G4bool Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
const G4bool outgoing, const G4double surfTolerance,
G4bool outgoing, G4double surfTolerance,
G4double &distance, G4double &distFromSurface,
G4ThreeVector &normal, G4bool &allBehind );
G4double Distance( const G4ThreeVector &p, const G4bool outgoing );
G4double Distance( const G4ThreeVector &p, G4bool outgoing );
EInside Inside( const G4ThreeVector &p, const G4double tolerance,
EInside Inside( const G4ThreeVector &p, G4double tolerance,
G4double *bestDistance );
G4ThreeVector Normal( const G4ThreeVector &p, G4double *bestDistance );
@@ -68,7 +84,8 @@ class G4PolyhedraSide : public G4VCSGface {
G4VCSGface *Clone() { return new G4PolyhedraSide( *this ); }
protected:
protected:
//
// A couple internal data structures
//
@@ -109,16 +126,16 @@ class G4PolyhedraSide : public G4VCSGface {
G4bool IntersectSidePlane( const G4ThreeVector &p, const G4ThreeVector &v,
const G4PolyhedraSideVec vec,
const G4double normSign,
const G4double surfTolerance,
G4double normSign,
G4double surfTolerance,
G4double &distance, G4double &distFromSurface );
G4int LineHitsSegments( const G4ThreeVector &p, const G4ThreeVector &v,
G4int *i1, G4int *i2 );
G4int ClosestPhiSegment( const G4double phi );
G4int ClosestPhiSegment( G4double phi );
G4int PhiSegment( const G4double phi );
G4int PhiSegment( G4double phi );
G4double DistanceToOneSide( const G4ThreeVector &p,
const G4PolyhedraSideVec &vec,
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReduciblePolygon.hh,v 1.1 2000/04/07 10:58:32 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ReduciblePolygon.hh,v 1.3 2000/11/02 16:54:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -32,6 +32,8 @@
// The set of manipulations is limited currently to what
// is needed for G4Polycone and G4Polyhedra.
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4ReduciblePolygon_hh
@@ -39,21 +41,23 @@
#include "globals.hh"
class G4ReduciblePolygon {
friend class G4ReduciblePolygonIterator;
class G4ReduciblePolygon
{
friend class G4ReduciblePolygonIterator;
public:
public:
//
// Creator: via simple a/b arrays
//
G4ReduciblePolygon( const G4double a[], const G4double b[], const G4int n );
G4ReduciblePolygon( const G4double a[], const G4double b[], G4int n );
//
// Creator: a special version for G4Polygon and G4Polycone
// that takes two a points at planes of b
// (where a==r and b==z for the GEANT3 classic PCON and PGON)
//
G4ReduciblePolygon( const G4double rmin[], const G4double rmax[], const G4double z[], const G4int n );
G4ReduciblePolygon( const G4double rmin[], const G4double rmax[],
const G4double z[], G4int n );
virtual ~G4ReduciblePolygon();
@@ -72,11 +76,11 @@ class G4ReduciblePolygon {
//
// Manipulations
//
void ScaleA( const G4double scale );
void ScaleB( const G4double scale );
void ScaleA( G4double scale );
void ScaleB( G4double scale );
G4bool RemoveDuplicateVertices( const G4double tolerance );
G4bool RemoveRedundantVertices( const G4double tolerance );
G4bool RemoveDuplicateVertices( G4double tolerance );
G4bool RemoveRedundantVertices( G4double tolerance );
void ReverseOrder();
@@ -84,15 +88,15 @@ class G4ReduciblePolygon {
// Tests
//
G4double Area();
G4bool CrossesItself( const G4double tolerance );
G4bool BisectedBy( const G4double a1, const G4double b1,
const G4double a2, const G4double b2, const G4double tolerance );
G4bool CrossesItself( G4double tolerance );
G4bool BisectedBy( G4double a1, G4double b1,
G4double a2, G4double b2, G4double tolerance );
void Print(); // Debugging only
protected:
protected:
void Create( const G4double a[], const G4double b[], const G4int n );
void Create( const G4double a[], const G4double b[], G4int n );
void CalculateMaxMin();
@@ -116,6 +120,12 @@ class G4ReduciblePolygon {
};
ABVertex *vertexHead;
private:
G4ReduciblePolygon(const G4ReduciblePolygon&);
G4ReduciblePolygon& operator=(const G4ReduciblePolygon&);
// Private copy constructor and assignment operator.
};
@@ -123,21 +133,25 @@ class G4ReduciblePolygon {
// A companion class for iterating over the vertices of our polygon.
// It is simple enough that all routines are declared inline here.
//
class G4ReduciblePolygonIterator {
public:
G4ReduciblePolygonIterator( const G4ReduciblePolygon *theSubject ) { subject = theSubject; current=0; }
class G4ReduciblePolygonIterator
{
public:
G4ReduciblePolygonIterator( const G4ReduciblePolygon *theSubject )
{ subject = theSubject; current=0; }
inline void Begin() { current = subject->vertexHead; }
inline G4bool Next() { if (current) current = current->next; return Valid(); }
void Begin() { current = subject->vertexHead; }
G4bool Next() { if (current) current=current->next; return Valid(); }
inline G4bool Valid() const { return current!=0; }
G4bool Valid() const { return current!=0; }
inline G4double GetA() const { return current->a; }
inline G4double GetB() const { return current->b; }
G4double GetA() const { return current->a; }
G4double GetB() const { return current->b; }
protected:
const G4ReduciblePolygon *subject; // Who are we iterating over
G4ReduciblePolygon::ABVertex *current; // Current vertex
protected:
const G4ReduciblePolygon *subject; // Who are we iterating over
G4ReduciblePolygon::ABVertex *current; // Current vertex
};
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SolidExtentList.hh,v 1.1 2000/04/07 10:58:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4SolidExtentList.hh,v 1.3 2000/11/02 16:54:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -23,6 +23,8 @@
// to calculate the extent of a CSG solid for a voxel
// (G4VSolid::CalculateExtent).
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4SolidExtentList_hh
@@ -32,8 +34,9 @@
#include "G4ClippablePolygon.hh"
class G4SolidExtentList {
public:
class G4SolidExtentList
{
public:
G4SolidExtentList();
G4SolidExtentList( const EAxis targetAxis, const G4VoxelLimits &voxelLimits );
@@ -51,10 +54,10 @@ class G4SolidExtentList {
G4double minLimit; // ... min limit
G4double maxLimit; // ... max limit
G4ClippablePolygon minSurface, // Minimum surface within limits
maxSurface, // Maximum
minAbove, // Minimum surface totally above max limit
maxBelow; // Maximum surface totally below min limit
G4ClippablePolygon minSurface, // Minimum surface within limits
maxSurface, // Maximum
minAbove, // Minimum surface totally above max limit
maxBelow; // Maximum surface totally below min limit
};
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VCSGface.hh,v 1.1 2000/04/07 10:59:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VCSGface.hh,v 1.3 2000/11/02 16:54:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -27,8 +27,8 @@
// Virtual members:
//
// -------------------------------------------------------------------
// Intersect( const G4ThreeVector &p, const G4ThreeVector &v, const G4bool outGoing, const G4double surfTolerance,
// const G4bool outgoing, const G4double surfTolerance,
// Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
// G4bool outGoing, G4double surfTolerance,
// G4double &distance, G4double &distFromSurface,
// G4ThreeVector &normal, G4bool &allBehind );
//
@@ -237,6 +237,8 @@
// and save the answer that is smallest. If there is more than one answer,
// or if allBehind is false for the one answer, return validNorm as false.
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4VCSGface_hh
@@ -252,19 +254,21 @@ class G4VoxelLimits;
class G4AffineTransform;
class G4SolidExtentList;
class G4VCSGface {
public:
class G4VCSGface
{
public:
G4VCSGface() {;}
virtual ~G4VCSGface() {;}
virtual G4bool Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
const G4bool outgoing, const G4double surfTolerance,
G4bool outgoing, G4double surfTolerance,
G4double &distance, G4double &distFromSurface,
G4ThreeVector &normal, G4bool &allBehind ) = 0;
virtual G4double Distance( const G4ThreeVector &p, const G4bool outgoing ) = 0;
virtual G4double Distance( const G4ThreeVector &p, G4bool outgoing ) = 0;
virtual EInside Inside( const G4ThreeVector &p, const G4double tolerance,
virtual EInside Inside( const G4ThreeVector &p, G4double tolerance,
G4double *bestDistance ) = 0;
virtual G4ThreeVector Normal( const G4ThreeVector &p, G4double *bestDistance ) = 0;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VCSGfaceted.hh,v 1.3 2000/04/19 17:56:29 davidw Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VCSGfaceted.hh,v 1.5 2000/11/02 16:54:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------------
@@ -20,6 +20,8 @@
// Virtual class defining CSG type shape that is built entire
// of G4CSGface faces.
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4VCSGfaceted_hh
@@ -32,7 +34,8 @@ class G4VisExtent;
class G4VCSGfaceted : public G4VSolid
{
public:
public:
G4VCSGfaceted( G4String name) : G4VSolid(name) {;}
virtual ~G4VCSGfaceted();
@@ -55,7 +58,7 @@ class G4VCSGfaceted : public G4VSolid
G4bool *validNorm=0,G4ThreeVector *n=0 ) const;
virtual G4double DistanceToOut( const G4ThreeVector& p ) const;
virtual G4GeometryType GetEntityType() const { return G4String("G4CSGfaceted"); }
G4GeometryType GetEntityType() const { return G4String("G4CSGfaceted"); }
virtual G4Polyhedron* CreatePolyhedron() const = 0;