Import Geant4 2.0.0 source tree
This commit is contained in:
@@ -5,41 +5,47 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Box.hh,v 1.3 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4Box.hh,v 1.4 2000/04/07 12:55:02 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// class G4Box
|
||||
// G4Box
|
||||
//
|
||||
// A Box is a cuboid of given half lengths dx,dy,dz. The Box is
|
||||
// centred on the origin with sides parallel to the x/y/z axes.
|
||||
// Class description:
|
||||
//
|
||||
// Member functions:
|
||||
// A Box is a cuboid of given half lengths dx,dy,dz. The Box is
|
||||
// centred on the origin with sides parallel to the x/y/z axes.
|
||||
//
|
||||
// As inherited from G4CSGSolid +
|
||||
// Member functions:
|
||||
//
|
||||
// G4Box(const G4String& pName, G4double pX,
|
||||
// G4double pY, G4double pZ)
|
||||
// Construct a box with name, and half lengths pX,pY,pZ
|
||||
// As inherited from G4CSGSolid +
|
||||
//
|
||||
// G4double GetXHalfLength() const
|
||||
// G4double GetYHalfLength() const
|
||||
// G4double GetZHalfLength() const
|
||||
// G4Box(const G4String& pName, G4double pX,
|
||||
// G4double pY, G4double pZ)
|
||||
//
|
||||
// Return the respective parameter
|
||||
// - Construct a box with name, and half lengths pX,pY,pZ
|
||||
//
|
||||
// Protected:
|
||||
// G4double GetXHalfLength() const
|
||||
// G4double GetYHalfLength() const
|
||||
// G4double GetZHalfLength() const
|
||||
//
|
||||
// - Return the respective parameter
|
||||
//
|
||||
// Protected:
|
||||
//
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
//
|
||||
// Create the List of transformed vertices in the format required
|
||||
// for G4VSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
// - Create the List of transformed vertices in the format required
|
||||
// for G4VSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
//
|
||||
// Member Data: (private)
|
||||
//
|
||||
// fDx,fDy,fDz - The box's half-widths
|
||||
// Member Data: (private)
|
||||
//
|
||||
// fDx,fDy,fDz - The box's half-widths
|
||||
|
||||
// History:
|
||||
// 30.06.95 P.Kent Converted from source code developed end 94
|
||||
// 27.03.96 J.Allison Added virtual functions DescribeYourselfTo and
|
||||
@@ -48,7 +54,7 @@
|
||||
// and SendPolyhedronTo to CreatePolyhedron.
|
||||
// 27.03.98 J.Apostolakis Inherit from G4CSGSolid (not G4VSolid).
|
||||
// 18.11.99 J.Apostolakis, V.Grichine: kUndefined was added to ESide
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4BOX_HH
|
||||
#define G4BOX_HH
|
||||
|
||||
@@ -5,28 +5,35 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4CSGSolid.hh,v 1.2 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4CSGSolid.hh,v 1.3 2000/04/07 12:55:02 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// class G4CSGSolid
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// An abstract class for Constructed Solids. Used primarily to
|
||||
// simplify inheritance tree.
|
||||
// G4CSGSolid
|
||||
//
|
||||
// Member functions:
|
||||
// Class description:
|
||||
//
|
||||
// As inherited from G4VSolid
|
||||
// An abstract class for Constructed Solids.
|
||||
// Used primarily to simplify inheritance tree.
|
||||
//
|
||||
// Member functions:
|
||||
//
|
||||
// As inherited from G4VSolid
|
||||
|
||||
// History:
|
||||
// 27.03.98 J.Apostolakis Created first version.
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4CSGSOLID_HH
|
||||
#define G4CSGSOLID_HH
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
|
||||
class G4CSGSolid : public G4VSolid {
|
||||
class G4CSGSolid : public G4VSolid
|
||||
{
|
||||
public:
|
||||
G4CSGSolid(const G4String& pName);
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
//
|
||||
// G4ClippablePolygon.hh
|
||||
//
|
||||
// Declaration of a utility class of a polycon that can be clipped
|
||||
// by a voxel
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
#ifndef G4ClippablePolycon_hh
|
||||
#define G4ClippablePolycon_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "geomdefs.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4VoxelLimits;
|
||||
class G4AffineTransform;
|
||||
|
||||
class G4AffineTransform;
|
||||
class G4VoxelLimits;
|
||||
|
||||
#include "g4rw/tvordvec.h"
|
||||
typedef G4RWTValOrderedVector<G4ThreeVector> G4ThreeVectorList;
|
||||
|
||||
class G4ClippablePolygon {
|
||||
public:
|
||||
G4ClippablePolygon() {;}
|
||||
virtual ~G4ClippablePolygon() {;}
|
||||
|
||||
virtual void AddVertexInOrder( const G4ThreeVector vertex );
|
||||
virtual void ClearAllVertices();
|
||||
|
||||
virtual void SetNormal( const G4ThreeVector &newNormal ) { normal = newNormal; }
|
||||
virtual const G4ThreeVector GetNormal() const { return normal; }
|
||||
|
||||
virtual const G4bool Clip( const G4VoxelLimits &voxelLimit );
|
||||
|
||||
virtual const G4bool PartialClip( const G4VoxelLimits &voxelLimit, const EAxis IgnoreMe );
|
||||
|
||||
virtual void ClipAlongOneAxis( const G4VoxelLimits &voxelLimit, const EAxis axis );
|
||||
|
||||
virtual const G4bool GetExtent( const EAxis axis,
|
||||
G4double &min, G4double &max ) const;
|
||||
virtual const G4ThreeVector *GetMinPoint( const EAxis axis ) const;
|
||||
virtual const G4ThreeVector *GetMaxPoint( const EAxis axis ) const;
|
||||
|
||||
virtual const G4int GetNumVertices() const { return vertices.entries(); }
|
||||
virtual const G4bool Empty() const { return vertices.entries()==0; }
|
||||
|
||||
virtual const G4bool InFrontOf( const G4ClippablePolygon &other, EAxis axis ) const;
|
||||
virtual const G4bool BehindOf( const G4ClippablePolygon &other, EAxis axis ) const;
|
||||
virtual const G4bool GetPlanerExtent( const G4ThreeVector &pointOnPlane,
|
||||
const G4ThreeVector &planeNormal,
|
||||
G4double &min, G4double &max ) const;
|
||||
|
||||
protected:
|
||||
G4ThreeVectorList vertices;
|
||||
G4ThreeVector normal;
|
||||
|
||||
void ClipToSimpleLimits( G4ThreeVectorList& pPolygon,
|
||||
G4ThreeVectorList& outputPolygon,
|
||||
const G4VoxelLimits& pVoxelLimit );
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -5,17 +5,25 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Cons.hh,v 1.2 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4Cons.hh,v 1.4 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// class G4Cons
|
||||
//
|
||||
// A G4Cons is, in the general case, a Phi segment of a cone, with half-length
|
||||
// fDz, inner and outer radii specified at -fDz and +fDz. The Phi segment is
|
||||
// described by a starting fSPhi angle, and the +fDPhi delta angle for the shape.
|
||||
// If the delta angle is >=2*M_PI, the shape is treated as continuous in Phi
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// Member Data:
|
||||
// G4Cons
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A G4Cons is, in the general case, a Phi segment of a cone, with
|
||||
// half-length fDz, inner and outer radii specified at -fDz and +fDz.
|
||||
// The Phi segment is described by a starting fSPhi angle, and the
|
||||
// +fDPhi delta angle for the shape.
|
||||
// If the delta angle is >=2*M_PI, the shape is treated as continuous
|
||||
// in Phi
|
||||
//
|
||||
// Member Data:
|
||||
//
|
||||
// fRmin1 inside radius at -fDz
|
||||
// fRmin2 inside radius at +fDz
|
||||
@@ -26,14 +34,15 @@
|
||||
// fSPhi starting angle of the segment in radians
|
||||
// fDPhi delta angle of the segment in radians
|
||||
//
|
||||
// Note:
|
||||
// Note:
|
||||
// Internally fSPhi & fDPhi are adjusted so that fDPhi<=2PI,
|
||||
// and fDPhi+fSPhi<=2PI. This enables simpler comparisons to be
|
||||
// made with (say) Phi of a point.
|
||||
//
|
||||
|
||||
// History:
|
||||
// 19.3.94 P.Kent Old C++ code converted to tolerant geometry
|
||||
// 13.9.96 V.Grichine Final modifications to commit
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4Cons_HH
|
||||
#define G4Cons_HH
|
||||
@@ -103,8 +112,6 @@ public:
|
||||
|
||||
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
|
||||
|
||||
G4VisExtent GetExtent() const;
|
||||
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
|
||||
G4NURBS* CreateNURBS() const;
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
//
|
||||
// G4EnclosingCylinder.hh
|
||||
//
|
||||
// Definition of a utility class for quickly deciding if a point
|
||||
// is clearly outside a polyhedra or ploycone or deciding if
|
||||
// a trajectory is clearly going to miss said shapes.
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
#ifndef G4EnclosingCylinder_hh
|
||||
#define G4EnclosingCylinder_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "geomdefs.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4ReduciblePolygon;
|
||||
|
||||
class G4EnclosingCylinder {
|
||||
public:
|
||||
G4EnclosingCylinder( const G4ReduciblePolygon *rz,
|
||||
const G4bool phiIsOpen,
|
||||
const G4double startPhi, const G4double totalPhi );
|
||||
~G4EnclosingCylinder();
|
||||
|
||||
G4bool MustBeOutside( const G4ThreeVector &p ) const;
|
||||
G4bool ShouldMiss( const G4ThreeVector &p, const G4ThreeVector &v ) const;
|
||||
|
||||
protected:
|
||||
G4double radius; // radius of our cylinder
|
||||
G4double zLo, zHi; // z extent
|
||||
|
||||
G4bool phiIsOpen; // true if there is a phi segment
|
||||
G4double startPhi, // for isPhiOpen==true, starting of phi segment
|
||||
totalPhi; // for isPhiOpen==true, size of phi segment
|
||||
|
||||
G4double rx1, ry1,
|
||||
dx1, dy1;
|
||||
G4double rx2, ry2,
|
||||
dx2, dy2;
|
||||
|
||||
G4bool concave; // True, if x/y cross section is concave
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,214 +0,0 @@
|
||||
// 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.hh,v 1.3 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4Hype: this class implements in G4 the volume equivalent
|
||||
// to the HYPE volume in Geant 3, i.e. a tube with
|
||||
// hyperbolic profile.
|
||||
//
|
||||
// Authors:
|
||||
// Ernesto Lamanna (Ernesto.Lamanna@roma1.infn.it) &
|
||||
// Francesco Safai Tehrani (Francesco.SafaiTehrani@roma1.infn.it)
|
||||
// Rome, INFN & University of Rome "La Sapienza", 9 June 1998.
|
||||
//
|
||||
// $ Original: G4Hype.hh,v 1.0 1998/06/09 16:57:50 safai Exp $
|
||||
//
|
||||
// For further informations, please read G4Hype.history and G4Hype.doc.
|
||||
//
|
||||
// An hyperbolic volume with curved sides parallel to
|
||||
// the z-axis. The Hype has a specified half-length along
|
||||
// the z axis, about which it is centred, and a given
|
||||
// minimum and maximum radius. A minimum radius of 0
|
||||
// signifies a filled Hype (with hyperbolical inner surface).
|
||||
// To have a filled Hype the user must specify
|
||||
// inner radius = 0 AND inner stereo angle = 0.
|
||||
//
|
||||
// The inner and outer hyperbolical surfaces can have different
|
||||
// stereo angles.
|
||||
// A stereo angle of 0 gives a cylindrical surface.
|
||||
//
|
||||
// Member functions:
|
||||
//
|
||||
// As inherited from G4VSolid,
|
||||
//
|
||||
// G4Hype(const G4String &pName
|
||||
// const G4double innerRadius
|
||||
// const G4double outerRadius
|
||||
// const G4double innerStereo
|
||||
// const G4double outerStereo
|
||||
// const G4double halfLenZ )
|
||||
//
|
||||
// Construct an hype with the given name and dimensions.
|
||||
// The provided angles are in radians.
|
||||
//
|
||||
//
|
||||
// Protected:
|
||||
//
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
//
|
||||
// Create the List of transformed vertices in the format required
|
||||
// for G4VSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
//
|
||||
// History:
|
||||
// 1998/06/09 F.Safai, first version
|
||||
// 18.11.99 , V.Grichine, kUndefined was added in ESide
|
||||
|
||||
#ifndef G4HYPE_HH
|
||||
#define G4HYPE_HH
|
||||
|
||||
#include "G4CSGSolid.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4Hype : public G4CSGSolid {
|
||||
public:
|
||||
|
||||
G4Hype(const G4String &pName,
|
||||
const G4double newInnerRadius,
|
||||
const G4double newOuterRadius,
|
||||
const G4double newInnerStereo,
|
||||
const G4double newOuterStereo,
|
||||
const G4double newHalfLenZ);
|
||||
|
||||
virtual ~G4Hype();
|
||||
|
||||
void ComputeDimensions(G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
const G4VPhysicalVolume* pRep);
|
||||
|
||||
G4bool CalculateExtent(const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
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; }
|
||||
|
||||
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= newISte;
|
||||
tanInnerStereo2=tan(innerStereo)*tan(innerStereo);
|
||||
endInnerRadius2=HypeInnerRadius2(halfLenZ);
|
||||
endInnerRadius=sqrt(endInnerRadius2);
|
||||
}
|
||||
|
||||
void SetOuterStereo (G4double newOSte)
|
||||
{
|
||||
outerStereo= newOSte;
|
||||
tanOuterStereo2=tan(outerStereo)*tan(outerStereo);
|
||||
endOuterRadius2=HypeOuterRadius2(halfLenZ);
|
||||
endOuterRadius=sqrt(endOuterRadius2);
|
||||
}
|
||||
|
||||
EInside Inside(const G4ThreeVector& p) const;
|
||||
|
||||
G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const;
|
||||
|
||||
G4double DistanceToIn(const G4ThreeVector& p,const G4ThreeVector& v) const;
|
||||
G4double DistanceToIn(const G4ThreeVector& p) const;
|
||||
G4double DistanceToOut(const G4ThreeVector& p,const G4ThreeVector& v,
|
||||
const G4bool calcNorm=G4bool(false),
|
||||
G4bool *validNorm=0,G4ThreeVector *n=0) const;
|
||||
G4double DistanceToOut(const G4ThreeVector& p) const;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Hype"); }
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4VisExtent GetExtent () const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
protected:
|
||||
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform) const;
|
||||
|
||||
// values of hype radius at a given Z
|
||||
double HypeInnerRadius2(double zVal) const { return (tanInnerStereo2*zVal*zVal+innerRadius2); }
|
||||
double HypeOuterRadius2(double zVal) const { return (tanOuterStereo2*zVal*zVal+outerRadius2); }
|
||||
|
||||
G4double innerRadius; // variable names are quite self explanative
|
||||
G4double outerRadius;
|
||||
G4double halfLenZ;
|
||||
G4double innerStereo;
|
||||
G4double outerStereo;
|
||||
|
||||
// precalculated parameters, squared quantities
|
||||
double tanInnerStereo2; // squared tan of Inner Stereo angle
|
||||
double tanOuterStereo2; // squared tan of Outer Stereo angle
|
||||
double innerRadius2; // squared Inner Radius
|
||||
double outerRadius2; // squared Outer Radius
|
||||
double endInnerRadius2; // squared endcap Inner Radius
|
||||
double endOuterRadius2; // squared endcap Outer Radius
|
||||
double endInnerRadius; // endcap Inner Radius
|
||||
double endOuterRadius; // endcap Outer Radius
|
||||
|
||||
// Used by distanceToOut
|
||||
enum ESide {kUndefined,outerFace,innerFace,leftCap, rightCap};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
//
|
||||
// G4IntersectingCone.hh
|
||||
//
|
||||
// Declaration of a utility class which calculates the intersection
|
||||
// of an arbitrary line with a fixed cone
|
||||
//
|
||||
#ifndef G4IntersectingCone_hh
|
||||
#define G4IntersectingCone_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "geomdefs.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4IntersectingCone {
|
||||
public:
|
||||
G4IntersectingCone( const G4double r[2], const G4double z[2] );
|
||||
virtual ~G4IntersectingCone();
|
||||
|
||||
G4int LineHitsCone( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
G4double *s1, G4double *s2 );
|
||||
|
||||
G4bool HitOn( const G4double r, const G4double z );
|
||||
|
||||
inline G4double RLo() const { return rLo; }
|
||||
inline G4double RHi() const { return rHi; }
|
||||
inline G4double ZLo() const { return zLo; }
|
||||
inline G4double ZHi() const { return zHi; }
|
||||
|
||||
|
||||
protected:
|
||||
G4double zLo, zHi, // Z bounds of side
|
||||
rLo, rHi; // R bounds of side
|
||||
|
||||
G4bool type1; // True if cone is type 1 (abs(z1-z2)>abs(r1-r2))
|
||||
G4double A, B; // Cone radius parameter:
|
||||
// type 1: r = A + B*z
|
||||
// type 2: z = A + B*r
|
||||
|
||||
G4int LineHitsCone1( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
G4double *s1, G4double *s2 );
|
||||
G4int LineHitsCone2( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
G4double *s1, G4double *s2 );
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -5,17 +5,24 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Para.hh,v 1.3 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4Para.hh,v 1.5 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// class G4Para
|
||||
//
|
||||
// A G4Parallepiped, essentially a box with half lengths dx,dy,dz `skewed'
|
||||
// so that there are angles theta & phi of the polar line joining the faces at
|
||||
// +-dz in z, and alpha formed by the y axis and the plane joinng the
|
||||
// centre of the faces G4Parallel to the z-x plane at -dy and +dy.
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// A G4Para is defined by:
|
||||
// G4Para
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A G4Parallepiped, essentially a box with half lengths dx,dy,dz
|
||||
// `skewed' so that there are angles theta & phi of the polar line
|
||||
// joining the faces at +-dz in z, and alpha formed by the y axis
|
||||
// and the plane joinng the centre of the faces G4Parallel to the
|
||||
// z-x plane at -dy and +dy.
|
||||
//
|
||||
// A G4Para is defined by:
|
||||
// dx,dy,dz Half-length in x,y,z
|
||||
// alpha Angle formed by the y axis and by the plane joining
|
||||
// the centre of the faces G4Parallel to the z-x plane
|
||||
@@ -24,10 +31,10 @@
|
||||
// faces at -dz and +dz in z
|
||||
// phi Azimuthal angle of the line joining the centres of the
|
||||
// faces at -dz and +dz in z
|
||||
// Member data:
|
||||
// Member data:
|
||||
//
|
||||
// Note that the angles parameters are not stored - precomputed trig is
|
||||
// stored instead.
|
||||
// Note that the angles parameters are not stored - precomputed trig is
|
||||
// stored instead.
|
||||
//
|
||||
// fDx Half-length in x
|
||||
// fDy Half-length in y
|
||||
@@ -36,11 +43,12 @@
|
||||
// fTalpha Tan of alpha
|
||||
// fTthetaCphi Tan theta * Cos phi
|
||||
// fTthetaSphi Tan theta * Sin phi
|
||||
//
|
||||
|
||||
// History:
|
||||
// 21.3.94 P.Kent Old C++ code converted to tolerant geometry
|
||||
// 31.10.96 V.Grichine Modifications according G4Box/Tubs before to commit
|
||||
// 18.11.99 V.Grichine , kUndefined was added to ESide
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4Para_HH
|
||||
#define G4Para_HH
|
||||
@@ -151,8 +159,6 @@ public:
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
|
||||
G4VisExtent GetExtent () const;
|
||||
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
//
|
||||
// G4PolyPhiFace.hh
|
||||
//
|
||||
// Definition of a face that bounds a polycone or polyhedra when it has a phi
|
||||
// opening.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
#ifndef G4PolyPhiFace_hh
|
||||
#define G4PolyPhiFace_hh
|
||||
|
||||
#include "G4VCSGface.hh"
|
||||
|
||||
class G4ReduciblePolygon;
|
||||
|
||||
typedef struct {
|
||||
G4double x, y, r, z; // position
|
||||
G4double rNorm,
|
||||
zNorm; // r/z normal
|
||||
G4ThreeVector norm3D; // 3D normal
|
||||
} G4PolyPhiFaceVertex;
|
||||
|
||||
typedef struct {
|
||||
G4PolyPhiFaceVertex *v0, *v1; // Corners
|
||||
G4double tr, tz, // Unit vector along edge
|
||||
length; // Length of edge
|
||||
G4ThreeVector norm3D; // 3D edge normal vector
|
||||
} G4PolyPhiFaceEdge;
|
||||
|
||||
class G4PolyPhiFace : public G4VCSGface {
|
||||
|
||||
public:
|
||||
G4PolyPhiFace( const G4ReduciblePolygon *rz,
|
||||
const G4double phi, const G4double deltaPhi, const G4double phiOther );
|
||||
virtual ~G4PolyPhiFace();
|
||||
|
||||
G4PolyPhiFace( const G4PolyPhiFace &source );
|
||||
G4PolyPhiFace *operator=( const G4PolyPhiFace &source );
|
||||
|
||||
G4bool Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
const G4bool outgoing, const G4double surfTolerance,
|
||||
G4double &distance, G4double &distFromSurface,
|
||||
G4ThreeVector &normal, G4bool &allBehind );
|
||||
|
||||
G4double Distance( const G4ThreeVector &p, const G4bool outgoing );
|
||||
|
||||
EInside Inside( const G4ThreeVector &p, const G4double tolerance,
|
||||
G4double *bestDistance );
|
||||
|
||||
G4ThreeVector Normal( const G4ThreeVector &p, G4double *bestDistance );
|
||||
|
||||
G4double Extent( const G4ThreeVector axis );
|
||||
|
||||
void CalculateExtent( const EAxis axis,
|
||||
const G4VoxelLimits &voxelLimit,
|
||||
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 G4double ExactZOrder( const G4double z,
|
||||
const G4double qx, const G4double qy, const G4double qz,
|
||||
const G4ThreeVector &v,
|
||||
const G4double normSign,
|
||||
const G4PolyPhiFaceVertex *vert ) const;
|
||||
|
||||
void CopyStuff( const G4PolyPhiFace &source );
|
||||
};
|
||||
|
||||
#include "G4PolyPhiFace.icc"
|
||||
|
||||
#endif
|
||||
@@ -1,44 +0,0 @@
|
||||
//
|
||||
// G4PolyPhiFace.icc
|
||||
//
|
||||
// Implementation of inline methods of G4PolyPhiFace
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
|
||||
//
|
||||
// ExactZOrder
|
||||
//
|
||||
// Decide precisely whether a trajectory passes to the left, right, or exactly
|
||||
// passes through the z position of a vertex point in our face.
|
||||
//
|
||||
// Result is only determined within an arbitrary (positive) factor.
|
||||
// > 0 to the right
|
||||
// < 0 to the left
|
||||
// = 0 exactly on top of
|
||||
// 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 {
|
||||
G4double answer = vert->z - z;
|
||||
if (fabs(answer) < kCarTolerance) {
|
||||
G4ThreeVector qa( qx - vert->x + radial.x(),
|
||||
qy - vert->y + radial.y(), qz - vert->z ),
|
||||
qb( qx - vert->x, qy - vert->y, qz - vert->z );
|
||||
G4ThreeVector qacb = qa.cross(qb);
|
||||
|
||||
answer = normSign*qacb.dot(v)*(normal.y()*radial.x()-normal.x()*radial.y());
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
//
|
||||
// G4Polycone.hh
|
||||
//
|
||||
// Declaration of a CSG type "PCON" geant volume, inherited from
|
||||
// class G4VCSGSolid
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
|
||||
#ifndef G4Polycone_hh
|
||||
#define G4Polycone_hh
|
||||
|
||||
#include "G4VCSGfaceted.hh"
|
||||
#include "G4PolyconeSide.hh"
|
||||
|
||||
|
||||
class G4EnclosingCylinder;
|
||||
class G4ReduciblePolygon;
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
virtual ~G4Polycone();
|
||||
|
||||
G4Polycone( const G4Polycone &source );
|
||||
const G4Polycone &operator=( const G4Polycone &source );
|
||||
|
||||
//
|
||||
// A couple overrides to speed things up
|
||||
//
|
||||
EInside Inside( const G4ThreeVector &p ) const;
|
||||
G4double DistanceToIn( const G4ThreeVector &p, const G4ThreeVector &v ) const;
|
||||
G4double DistanceToIn( const G4ThreeVector &p ) const { return G4VCSGfaceted::DistanceToIn(p); }
|
||||
|
||||
//
|
||||
// The usual G4VCSGface stuff
|
||||
//
|
||||
void ComputeDimensions( G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
const G4VPhysicalVolume* pRep);
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Polycone"); }
|
||||
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
G4NURBS* CreateNURBS() const;
|
||||
|
||||
//
|
||||
// Access routines
|
||||
//
|
||||
inline G4double GetStartPhi() const { return startPhi; }
|
||||
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]; }
|
||||
|
||||
protected:
|
||||
//
|
||||
// Here are our parameters
|
||||
//
|
||||
G4double startPhi; // Starting phi value (0 < phiStart < 2pi)
|
||||
G4double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
|
||||
G4bool phiIsOpen; // true if there is a phi segment
|
||||
G4int numCorner; // number RZ points
|
||||
G4PolyconeSideRZ *corners; // corner r,z points
|
||||
|
||||
//
|
||||
// The following is temporary until graphics_reps is brought up to this design
|
||||
//
|
||||
struct G4PolyconeHistorical {
|
||||
G4PolyconeHistorical() {;}
|
||||
~G4PolyconeHistorical();
|
||||
G4PolyconeHistorical( const G4PolyconeHistorical &source );
|
||||
|
||||
G4double Start_angle;
|
||||
G4double Opening_angle;
|
||||
G4int Num_z_planes;
|
||||
G4double *Z_values;
|
||||
G4double *Rmin;
|
||||
G4double *Rmax;
|
||||
};
|
||||
|
||||
G4PolyconeHistorical *original_parameters;
|
||||
|
||||
//
|
||||
// Our quick test
|
||||
//
|
||||
G4EnclosingCylinder *enclosingCylinder;
|
||||
|
||||
//
|
||||
// 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 CopyStuff( const G4Polycone &source );
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,89 +0,0 @@
|
||||
//
|
||||
// G4PolyconeSide
|
||||
//
|
||||
// Declaration of a face that represents one conical side of a polycone
|
||||
//
|
||||
#ifndef G4PolyconeSide_hh
|
||||
#define G4PolyconeSide_hh
|
||||
|
||||
#include "G4VCSGface.hh"
|
||||
|
||||
class G4IntersectingCone;
|
||||
|
||||
typedef struct {
|
||||
G4double r, z; // start of vector
|
||||
} G4PolyconeSideRZ;
|
||||
|
||||
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 );
|
||||
virtual ~G4PolyconeSide();
|
||||
|
||||
G4PolyconeSide( const G4PolyconeSide &source );
|
||||
G4PolyconeSide *operator=( const G4PolyconeSide &source );
|
||||
|
||||
G4bool Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
const G4bool outgoing, const G4double surfTolerance,
|
||||
G4double &distance, G4double &distFromSurface,
|
||||
G4ThreeVector &normal, G4bool &isAllBehind );
|
||||
|
||||
G4double Distance( const G4ThreeVector &p, const G4bool outgoing );
|
||||
|
||||
EInside Inside( const G4ThreeVector &p, const G4double tolerance,
|
||||
G4double *bestDistance );
|
||||
|
||||
G4ThreeVector Normal( const G4ThreeVector &p, G4double *bestDistance );
|
||||
|
||||
G4double Extent( const G4ThreeVector axis );
|
||||
|
||||
void CalculateExtent( const EAxis axis,
|
||||
const G4VoxelLimits &voxelLimit,
|
||||
const G4AffineTransform &tranform,
|
||||
G4SolidExtentList &extentList );
|
||||
|
||||
G4VCSGface *Clone() { return new G4PolyconeSide( *this ); }
|
||||
|
||||
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
|
||||
G4bool phiIsOpen; // True if there is a phi slice
|
||||
G4bool allBehind; // True if the entire solid is "behind" this face
|
||||
|
||||
G4IntersectingCone *cone; // Our intersecting utility class
|
||||
|
||||
G4double rNorm, zNorm; // Normal to surface in r,z space
|
||||
G4double rS, zS; // Unit vector along surface in r,z space
|
||||
G4double length; // Length of face in r,z space
|
||||
G4double prevRS,
|
||||
prevZS; // Unit vector along previous polyconeSide
|
||||
G4double nextRS,
|
||||
nextZS; // Unit vector along next polyconeSide
|
||||
|
||||
G4double rNormEdge[2],
|
||||
zNormEdge[2]; // Normal to edges
|
||||
|
||||
G4ThreeVector *corners; // The coordinates of the corners (if phiIsOpen)
|
||||
|
||||
G4double DistanceAway( const G4ThreeVector &p, const G4bool opposite,
|
||||
G4double &distOutside2, G4double *rzNorm=0 );
|
||||
|
||||
G4bool PointOnCone( const G4ThreeVector &hit, const 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,
|
||||
G4double &x, G4double &y );
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,119 +0,0 @@
|
||||
//
|
||||
// G4Polyhedra.hh
|
||||
//
|
||||
// Declaration of a CSG type "PCON" geant volume, inherited from
|
||||
// class G4CSGSolid
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
|
||||
#ifndef G4Polyhedra_hh
|
||||
#define G4Polyhedra_hh
|
||||
|
||||
#include "G4VCSGfaceted.hh"
|
||||
#include "G4PolyhedraSide.hh"
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
virtual ~G4Polyhedra();
|
||||
|
||||
G4Polyhedra( const G4Polyhedra &source );
|
||||
const G4Polyhedra &operator=( const G4Polyhedra &source );
|
||||
|
||||
//
|
||||
// A couple overrides to speed things up
|
||||
//
|
||||
EInside Inside( const G4ThreeVector &p ) const;
|
||||
G4double DistanceToIn( const G4ThreeVector &p, const G4ThreeVector &v ) const;
|
||||
G4double DistanceToIn( const G4ThreeVector &p ) const { return G4VCSGfaceted::DistanceToIn(p); }
|
||||
|
||||
void ComputeDimensions( G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
const G4VPhysicalVolume* pRep);
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Polyhedra"); }
|
||||
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
G4NURBS* CreateNURBS() const;
|
||||
|
||||
inline G4int GetNumSIde() const { return numSide; }
|
||||
inline G4double GetStartPhi() const { return startPhi; }
|
||||
inline G4double GetEndPhi() const { return endPhi; }
|
||||
inline G4bool IsOpen() const { return phiIsOpen; }
|
||||
inline G4int GetNumRZCorner() const { return numCorner;}
|
||||
inline G4PolyhedraSideRZ GetCorner( const G4int index ) const { return corners[index]; }
|
||||
|
||||
protected:
|
||||
//
|
||||
// Here are our parameters
|
||||
//
|
||||
G4int numSide; // Number of sides
|
||||
G4double startPhi; // Starting phi value (0 < phiStart < 2pi)
|
||||
G4double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
|
||||
G4bool phiIsOpen; // true if there is a phi segment
|
||||
G4int numCorner; // number RZ points
|
||||
G4PolyhedraSideRZ *corners; // our corners
|
||||
|
||||
//
|
||||
// The following is temporary until graphics_reps is brought up to this design
|
||||
//
|
||||
struct G4PolyhedraHistorical {
|
||||
G4PolyhedraHistorical() {;}
|
||||
~G4PolyhedraHistorical();
|
||||
G4PolyhedraHistorical( const G4PolyhedraHistorical &source );
|
||||
|
||||
G4double Start_angle;
|
||||
G4double Opening_angle;
|
||||
G4int numSide;
|
||||
G4int Num_z_planes;
|
||||
G4double *Z_values;
|
||||
G4double *Rmin;
|
||||
G4double *Rmax;
|
||||
};
|
||||
|
||||
G4PolyhedraHistorical *original_parameters;
|
||||
|
||||
//
|
||||
// Our quick test
|
||||
//
|
||||
G4EnclosingCylinder *enclosingCylinder;
|
||||
|
||||
//
|
||||
// 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
|
||||
G4ReduciblePolygon *rz ); // rz coordinates
|
||||
|
||||
void CopyStuff( const G4Polyhedra &source );
|
||||
void DeleteStuff();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,124 +0,0 @@
|
||||
//
|
||||
// G4PolyhedraSide
|
||||
//
|
||||
// Declaration of a face that represents one segmented side of a polyhedra
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
#ifndef G4PolyhedraSide_hh
|
||||
#define G4PolyhedraSide_hh
|
||||
|
||||
#include "G4VCSGface.hh"
|
||||
|
||||
class G4IntersectingCone;
|
||||
|
||||
typedef struct {
|
||||
G4double r, z; // start of vector
|
||||
} G4PolyhedraSideRZ;
|
||||
|
||||
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 );
|
||||
virtual ~G4PolyhedraSide();
|
||||
|
||||
G4PolyhedraSide( const G4PolyhedraSide &source );
|
||||
G4PolyhedraSide *operator=( const G4PolyhedraSide &source );
|
||||
|
||||
G4bool Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
const G4bool outgoing, const G4double surfTolerance,
|
||||
G4double &distance, G4double &distFromSurface,
|
||||
G4ThreeVector &normal, G4bool &allBehind );
|
||||
|
||||
G4double Distance( const G4ThreeVector &p, const G4bool outgoing );
|
||||
|
||||
EInside Inside( const G4ThreeVector &p, const G4double tolerance,
|
||||
G4double *bestDistance );
|
||||
|
||||
G4ThreeVector Normal( const G4ThreeVector &p, G4double *bestDistance );
|
||||
|
||||
G4double Extent( const G4ThreeVector axis );
|
||||
|
||||
void CalculateExtent( const EAxis axis,
|
||||
const G4VoxelLimits &voxelLimit,
|
||||
const G4AffineTransform &tranform,
|
||||
G4SolidExtentList &extentList );
|
||||
|
||||
G4VCSGface *Clone() { return new G4PolyhedraSide( *this ); }
|
||||
|
||||
protected:
|
||||
//
|
||||
// A couple internal data structures
|
||||
//
|
||||
struct sG4PolyhedraSideVec; // Secret recipe for allowing
|
||||
friend struct sG4PolyhedraSideVec; // protected nested structures
|
||||
|
||||
typedef struct sG4PolyhedraSideEdge {
|
||||
G4ThreeVector normal; // Unit normal to this edge
|
||||
G4ThreeVector corner[2]; // The two corners of this phi edge
|
||||
G4ThreeVector cornNorm[2]; // The normals of these corners
|
||||
} G4PolyhedraSideEdge;
|
||||
|
||||
typedef struct sG4PolyhedraSideVec {
|
||||
G4ThreeVector normal, // Normal (point out of the shape)
|
||||
center, // Point in center of side
|
||||
surfPhi, // Unit vector on surface pointing along phi
|
||||
surfRZ; // Unit vector on surface pointing along R/Z
|
||||
G4PolyhedraSideEdge *edges[2]; // The phi boundary edges to this side
|
||||
// [0]=low phi [1]=high phi
|
||||
G4ThreeVector edgeNorm[2]; // RZ edge normals [i] at {r[i],z[i]}
|
||||
} G4PolyhedraSideVec;
|
||||
|
||||
G4int numSide; // Number sides
|
||||
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
|
||||
endPhi; // End phi (>startPhi), if phiIsOpen
|
||||
G4bool phiIsOpen; // True if there is a phi slice
|
||||
G4bool allBehind; // True if the entire solid is "behind" this face
|
||||
|
||||
G4IntersectingCone *cone; // Our intersecting cone
|
||||
|
||||
G4PolyhedraSideVec *vecs; // Vector set for each facet of our face
|
||||
G4PolyhedraSideEdge *edges; // The edges belong to vecs
|
||||
G4double lenRZ, // RZ length of each side
|
||||
lenPhi[2]; // Phi dimensions of each side
|
||||
G4double edgeNorm; // Normal in RZ/Phi space to each side
|
||||
|
||||
G4bool IntersectSidePlane( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
const G4PolyhedraSideVec vec,
|
||||
const G4double normSign,
|
||||
const G4double surfTolerance,
|
||||
G4double &distance, G4double &distFromSurface );
|
||||
|
||||
G4int LineHitsSegments( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
G4int *i1, G4int *i2 );
|
||||
|
||||
G4int ClosestPhiSegment( const G4double phi );
|
||||
|
||||
G4int PhiSegment( const G4double phi );
|
||||
|
||||
G4double DistanceToOneSide( const G4ThreeVector &p,
|
||||
const G4PolyhedraSideVec &vec,
|
||||
G4double *normDist );
|
||||
|
||||
G4double DistanceAway( const G4ThreeVector &p,
|
||||
const G4PolyhedraSideVec &vec,
|
||||
G4double *normDist );
|
||||
|
||||
void CopyStuff( const G4PolyhedraSide &source );
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,134 +0,0 @@
|
||||
//
|
||||
// G4ReduciblePolygon.hh
|
||||
//
|
||||
// Declaration of a utility class used to specify, test, reduce,
|
||||
// and/or otherwise manipulate a 2D polygon.
|
||||
//
|
||||
// For this class, a polygon consists of n > 2 points in 2D
|
||||
// space (a,b). The polygon is always closed by connecting the
|
||||
// last point to the first. A G4ReduciblePolygon is guaranteed
|
||||
// to fulfill this definition in all instances.
|
||||
//
|
||||
// Illegal manipulations (such that a valid polygon would be
|
||||
// produced) result in an error return if possible and
|
||||
// otherwise a G4Exception.
|
||||
//
|
||||
// The set of manipulations is limited currently to what
|
||||
// is needed for G4Polycone and G4Polyhedra.
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
|
||||
#ifndef G4ReduciblePolygon_hh
|
||||
#define G4ReduciblePolygon_hh
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ReduciblePolygon {
|
||||
friend class G4ReduciblePolygonIterator;
|
||||
|
||||
public:
|
||||
//
|
||||
// Creator: via simple a/b arrays
|
||||
//
|
||||
G4ReduciblePolygon( const G4double a[], const G4double b[], const 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 );
|
||||
|
||||
virtual ~G4ReduciblePolygon();
|
||||
|
||||
//
|
||||
// Queries
|
||||
//
|
||||
inline G4int NumVertices() const { return numVertices; }
|
||||
|
||||
inline G4double Amin() const { return aMin; }
|
||||
inline G4double Amax() const { return aMax; }
|
||||
inline G4double Bmin() const { return bMin; }
|
||||
inline G4double Bmax() const { return bMax; }
|
||||
|
||||
void CopyVertices( G4double a[], G4double b[] ) const;
|
||||
|
||||
//
|
||||
// Manipulations
|
||||
//
|
||||
void ScaleA( const G4double scale );
|
||||
void ScaleB( const G4double scale );
|
||||
|
||||
G4bool RemoveDuplicateVertices( const G4double tolerance );
|
||||
G4bool RemoveRedundantVertices( const G4double tolerance );
|
||||
|
||||
void ReverseOrder();
|
||||
|
||||
//
|
||||
// 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 );
|
||||
|
||||
void Print(); // Debugging only
|
||||
|
||||
protected:
|
||||
|
||||
void Create( const G4double a[], const G4double b[], const G4int n );
|
||||
|
||||
void CalculateMaxMin();
|
||||
|
||||
//
|
||||
// Below are member values that are *always* kept up to date (please!)
|
||||
//
|
||||
G4double aMin, aMax, bMin, bMax;
|
||||
G4int numVertices;
|
||||
|
||||
//
|
||||
// A subclass which holds the vertices in a single-linked list
|
||||
//
|
||||
// Yeah, call me an old-fashioned c hacker, but I cannot make
|
||||
// myself use the rogue tools for this trivial list.
|
||||
//
|
||||
struct ABVertex;
|
||||
friend struct ABVertex;
|
||||
struct ABVertex {
|
||||
G4double a, b;
|
||||
ABVertex *next;
|
||||
};
|
||||
|
||||
ABVertex *vertexHead;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// 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; }
|
||||
|
||||
inline void Begin() { current = subject->vertexHead; }
|
||||
inline G4bool Next() { if (current) current = current->next; return Valid(); }
|
||||
|
||||
inline G4bool Valid() const { return current!=0; }
|
||||
|
||||
inline G4double GetA() const { return current->a; }
|
||||
inline G4double GetB() const { return current->b; }
|
||||
|
||||
protected:
|
||||
const G4ReduciblePolygon *subject; // Who are we iterating over
|
||||
G4ReduciblePolygon::ABVertex *current; // Current vertex
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,52 +0,0 @@
|
||||
//
|
||||
// G4SolidExtentList.hh
|
||||
//
|
||||
// Declaration of a list of (voxel) extents along one axis
|
||||
//
|
||||
// This utility class is designed for one specific purpose: to
|
||||
// calculate the extent of a CSG solid for a voxel
|
||||
// (G4VSolid::CalculateExtent).
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
|
||||
#ifndef G4SolidExtentList_hh
|
||||
#define G4SolidExtentList_hh
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
#include "G4ClippablePolygon.hh"
|
||||
|
||||
class G4SolidExtentList {
|
||||
public:
|
||||
|
||||
G4SolidExtentList();
|
||||
G4SolidExtentList( const EAxis targetAxis, const G4VoxelLimits &voxelLimits );
|
||||
~G4SolidExtentList();
|
||||
|
||||
|
||||
void AddSurface( const G4ClippablePolygon &surface );
|
||||
|
||||
G4bool GetExtent( G4double &min, G4double &max ) const;
|
||||
|
||||
protected:
|
||||
|
||||
EAxis axis; // Target axis
|
||||
G4bool limited; // True if limited
|
||||
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
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -5,22 +5,28 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Sphere.hh,v 1.2 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4Sphere.hh,v 1.4 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// class G4Sphere
|
||||
//
|
||||
// A G4Sphere is, in the general case, section of a spherical shell, between
|
||||
// specified phii and theta angles
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// The phi and theta segments are described by a starting angle,
|
||||
// and the +ve delta angle for the shape.
|
||||
// If the delta angle is >=2*M_PI, or >=M_PI the shape is treated as
|
||||
// continuous in phi or theta respectively.
|
||||
// G4Sphere
|
||||
//
|
||||
// Theta must lie between 0-PI (incl).
|
||||
// Class description:
|
||||
//
|
||||
// Member Data:
|
||||
// A G4Sphere is, in the general case, section of a spherical shell,
|
||||
// between specified phii and theta angles
|
||||
//
|
||||
// The phi and theta segments are described by a starting angle,
|
||||
// and the +ve delta angle for the shape.
|
||||
// If the delta angle is >=2*M_PI, or >=M_PI the shape is treated as
|
||||
// continuous in phi or theta respectively.
|
||||
//
|
||||
// Theta must lie between 0-PI (incl).
|
||||
//
|
||||
// Member Data:
|
||||
//
|
||||
// fRmin inner radius
|
||||
// fRmax outer radius
|
||||
@@ -32,17 +38,15 @@
|
||||
// fDTheta delta angle of the segment in radians
|
||||
//
|
||||
//
|
||||
//
|
||||
// Note:
|
||||
// Note:
|
||||
// Internally fSPhi & fDPhi are adjusted so that fDPhi<=2PI,
|
||||
// and fDPhi+fSPhi<=2PI. This enables simpler comparisons to be
|
||||
// made with (say) Phi of a point.
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
// History:
|
||||
// 28.3.94 P.Kent Old C++ code converted to tolerant geometry
|
||||
// 17.9.96 V.Grichine Final modifications to commit
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4Sphere_HH
|
||||
#define G4Sphere_HH
|
||||
@@ -108,8 +112,6 @@ public:
|
||||
|
||||
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
|
||||
|
||||
G4VisExtent GetExtent() const;
|
||||
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
|
||||
G4NURBS* CreateNURBS() const;
|
||||
|
||||
@@ -5,46 +5,49 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Torus.hh,v 1.2 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4Torus.hh,v 1.5 2000/05/26 13:20:40 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// class G4Torus
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// A torus or torus segment with curved sides parallel to
|
||||
// the z-axis. The torus has a specified swept radius
|
||||
// about which it is centred, and a given
|
||||
// minimum and maximum radius. A minimum radius of 0
|
||||
// signifies a filled torus . The torus segment is
|
||||
// specified by starting and delta
|
||||
// angles for phi, with 0 being the +x axis, PI/2
|
||||
// the +y axis. A delta angle of 2PI signifies a
|
||||
// complete, unsegmented torus/cylindr.
|
||||
// G4Torus
|
||||
//
|
||||
// Member functions:
|
||||
// Class description:
|
||||
//
|
||||
// As inherited from G4CSGSolid+
|
||||
// A torus or torus segment with curved sides parallel to the z-axis.
|
||||
// The torus has a specified swept radius about which it is centered,
|
||||
// and a given minimum and maximum radius. A minimum radius of 0
|
||||
// signifies a filled torus.
|
||||
// The torus segment is specified by starting and delta angles for phi,
|
||||
// with 0 being the +x axis, PI/2 the +y axis. A delta angle of 2PI
|
||||
// signifies a complete, unsegmented torus/cylindr.
|
||||
//
|
||||
// G4Torus(const G4String &pName
|
||||
// G4double pRmin
|
||||
// G4double pRmax
|
||||
// G4double pRtor
|
||||
// G4double pSPhi
|
||||
// G4double pDPhi )
|
||||
// Member functions:
|
||||
//
|
||||
// Construct a torus with the given name and dimensions.
|
||||
// The angles are provided is radians. pRtor >= pRmax
|
||||
// As inherited from G4CSGSolid+
|
||||
//
|
||||
// G4Torus(const G4String &pName
|
||||
// G4double pRmin
|
||||
// G4double pRmax
|
||||
// G4double pRtor
|
||||
// G4double pSPhi
|
||||
// G4double pDPhi )
|
||||
//
|
||||
// - Construct a torus with the given name and dimensions.
|
||||
// The angles are provided is radians. pRtor >= pRmax
|
||||
//
|
||||
//
|
||||
// Protected:
|
||||
// Protected:
|
||||
//
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
//
|
||||
// Create the List of transformed vertices in the format required
|
||||
// for G4VSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
// - Create the List of transformed vertices in the format required
|
||||
// for G4VSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
//
|
||||
// Member Data:
|
||||
// Member Data:
|
||||
//
|
||||
// fRmin Inside radius
|
||||
// fRmax Outside radius
|
||||
@@ -56,17 +59,19 @@
|
||||
//
|
||||
// fDPhi Delta angle of the segment in radians
|
||||
//
|
||||
// You could find very often in G4Torus:: functions the values like pt or
|
||||
// it . These are the distances from p or i G4ThreeVector points in the
|
||||
// plane (Z axis points p or i) to fRtor point in XY plane. This value is
|
||||
// similar to rho for G4Tubs and is used for definiton of the point
|
||||
// relative to fRmin and fRmax, i.e. for solution of inside/outside
|
||||
// problems
|
||||
//
|
||||
//
|
||||
// You could find very often in G4Torus:: functions the values like pt or
|
||||
// it . These are the distances from p or i G4ThreeVector points in the
|
||||
// plane (Z axis points p or i) to fRtor point in XY plane. This value is
|
||||
// similar to rho for G4Tubs and is used for definiton of the point
|
||||
// relative to fRmin and fRmax, i.e. for solution of inside/outside
|
||||
// problems
|
||||
|
||||
// History:
|
||||
// 30.10.96 V.Grichine First version of G4Torus
|
||||
// 21.04.98 J.Apostolakis Added SetAllParameters function
|
||||
// 26.05.00 V.Grichine, new SolveBiQuadratic/Cubic developed by O.Cremonesi were
|
||||
// added
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4Torus_HH
|
||||
#define G4Torus_HH
|
||||
@@ -122,14 +127,17 @@ G4Torus(const G4String &pName,
|
||||
|
||||
// Visualisation functions
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4VisExtent GetExtent () const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
protected:
|
||||
|
||||
G4int SolveBiQuadratic(double c[], double s[] ) const ;
|
||||
G4int SolveCubic(double c[], double s[] ) const ;
|
||||
G4int SolveBiQuadratic(G4double c[], G4double s[] ) const ;
|
||||
G4int SolveCubic(G4double c[], G4double s[] ) const ;
|
||||
|
||||
G4int SolveBiQuadraticNew(G4double c[], G4double s[] ) const ;
|
||||
G4int SolveCubicNew(G4double c[], G4double s[], G4double& cd ) const ;
|
||||
|
||||
G4int SolveQuadratic(double c[], double s[] ) const ;
|
||||
|
||||
G4ThreeVectorList*
|
||||
|
||||
@@ -5,19 +5,25 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Trap.hh,v 1.2 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4Trap.hh,v 1.4 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// class G4Trap
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// A G4Trap is a general trapezoid: The faces perpendicular to the z planes
|
||||
// are tapezia, and their centres are not necessarily on a line parallel to
|
||||
// the z axis.
|
||||
// G4Trap
|
||||
//
|
||||
// Note that of the 11 parameters desribed below, only 9 are really
|
||||
// independent - a check for planarity is made in the calculation of the
|
||||
// equation for each plane. If the planes are not parallel, a call to
|
||||
// G4Exception is made.
|
||||
// Class description:
|
||||
//
|
||||
// A G4Trap is a general trapezoid: The faces perpendicular to the
|
||||
// z planes are trapezia, and their centres are not necessarily on
|
||||
// a line parallel to the z axis.
|
||||
//
|
||||
// Note that of the 11 parameters described below, only 9 are really
|
||||
// independent - a check for planarity is made in the calculation of the
|
||||
// equation for each plane. If the planes are not parallel, a call to
|
||||
// G4Exception is made.
|
||||
//
|
||||
// pDz Half-length along the z-axis
|
||||
// pTheta Polar angle of the line joining the centres of the faces
|
||||
@@ -30,110 +36,117 @@
|
||||
// pAlp1 Angle with respect to the y axis from the centre of the side
|
||||
// at y=-pDy1 to the centre at y=+pDy1 of the face at -pDz
|
||||
//
|
||||
// pDy2 Half-length along y of the face at +pDz
|
||||
// pDy2 Half-length along y of the face at +pDz
|
||||
// pDx3 Half-length along x of the side at y=-pDy2 of the face at +pDz
|
||||
// pDx4 Half-length along x of the side at y=+pDy2 of the face at +pDz
|
||||
// pAlp2 Angle with respect to the y axis from the centre of the side
|
||||
// at y=-pDy2 to the centre at y=+pDy2 of the face at +pDz
|
||||
//
|
||||
//
|
||||
// Member Data:
|
||||
// Member Data:
|
||||
//
|
||||
// fDz Half-length along the z axis
|
||||
// fTthetaCphi = tan(pTheta)*cos(pPhi) These combinations are suitable for
|
||||
// fTthetaSphi = tan(pTheta)*sin(pPhi) creation of the trapezoid corners
|
||||
//
|
||||
// fDy1 Half-length along y of the face at -fDz
|
||||
// fDy1 Half-length along y of the face at -fDz
|
||||
// fDx1 Half-length along x of the side at y=-fDy1 of the face at -fDz
|
||||
// fDx2 Half-length along x of the side at y=+fDy1 of the face at -fDz
|
||||
// fTalpha1 Tan of Angle with respect to the y axis from the centre of
|
||||
// the side at y=-fDy1 to the centre at y=+fDy1 of the face at -fDz
|
||||
// the side at y=-fDy1 to the centre at y=+fDy1 of the face
|
||||
// at -fDz
|
||||
//
|
||||
// fDy2 Half-length along y of the face at +fDz
|
||||
// fDy2 Half-length along y of the face at +fDz
|
||||
// fDx3 Half-length along x of the side at y=-fDy2 of the face at +fDz
|
||||
// fDx4 Half-length along x of the side at y=+fDy2 of the face at +fDz
|
||||
// fTalpha2 Tan of Angle with respect to the y axis from the centre of
|
||||
// the side at y=-fDy1 to the centre at y=+fDy1 of the face at -fDz
|
||||
//
|
||||
// TrapSidePlane fPlanes[4] Plane equations of the faces not at +/-fDz
|
||||
// *** order is important !!! :
|
||||
// *** order is important !!!
|
||||
//
|
||||
//
|
||||
// Member functions:
|
||||
// Member functions:
|
||||
//
|
||||
// As inherited from G4CSGSolid + Constructors
|
||||
// As inherited from G4CSGSolid + Constructors
|
||||
//
|
||||
// G4Trap( const G4String& pName,
|
||||
// G4double pDz,
|
||||
// G4double pTheta, G4double pPhi,
|
||||
// G4double pDy1, G4double pDx1, G4double pDx2,
|
||||
// G4double pAlp1,
|
||||
// G4double pDy2, G4double pDx3, G4double pDx4,
|
||||
// G4double pAlp2)
|
||||
// which prepare plane equations and corner coordinates from parameters
|
||||
// &
|
||||
// G4Trap( const G4string& pName,
|
||||
// const G4ThreeVector pt[8])
|
||||
// which prepare plane equations and parameters from corner coordinates
|
||||
// &
|
||||
// G4Trap( const G4String& pName,
|
||||
// G4double pZ,
|
||||
// G4double pY,
|
||||
// G4double pX, G4double pLTX);
|
||||
// for Right Angular Wedge from STEP
|
||||
// G4double pDz,
|
||||
// G4double pTheta, G4double pPhi,
|
||||
// G4double pDy1, G4double pDx1, G4double pDx2,
|
||||
// G4double pAlp1,
|
||||
// G4double pDy2, G4double pDx3, G4double pDx4,
|
||||
// G4double pAlp2)
|
||||
//
|
||||
// & Constructor for G4Trd
|
||||
// - which prepare plane equations and corner coordinates from
|
||||
// parameters
|
||||
//
|
||||
// G4Trap( const G4string& pName,
|
||||
// const G4ThreeVector pt[8])
|
||||
//
|
||||
// - which prepare plane equations and parameters from corner
|
||||
// coordinates
|
||||
//
|
||||
// G4Trap( const G4String& pName,
|
||||
// G4double pZ,
|
||||
// G4double pY,
|
||||
// G4double pX, G4double pLTX);
|
||||
//
|
||||
// - for Right Angular Wedge from STEP
|
||||
//
|
||||
// & Constructor for G4Trd
|
||||
//
|
||||
// G4Trap( const G4String& pName,
|
||||
// G4double pDx1, G4double pDx2,
|
||||
// G4double pDy1, G4double pDy2,
|
||||
// G4double pDz);
|
||||
// G4double pDx1, G4double pDx2,
|
||||
// G4double pDy1, G4double pDy2,
|
||||
// G4double pDz);
|
||||
//
|
||||
// & Constructor for G4Para
|
||||
// & Constructor for G4Para
|
||||
//
|
||||
// G4Trap(const G4String& pName,
|
||||
// G4double pDx, G4double pDy, G4double pDz,
|
||||
// G4double pAlpha, G4double pTheta, G4double pPhi);
|
||||
// G4double pDx, G4double pDy, G4double pDz,
|
||||
// G4double pAlpha, G4double pTheta, G4double pPhi);
|
||||
//
|
||||
// + Access functions that return the respective parameter
|
||||
// + Access functions that return the respective parameter
|
||||
//
|
||||
// G4double GetZHalfLength() const
|
||||
// G4ThreeVector GetSymAxis() const Returns coordinates of unit vector along straight
|
||||
// line joining centers of -/+fDz planes
|
||||
// G4double GetYHalfLength1() const
|
||||
// G4double GetXHalfLength1() const
|
||||
// G4double GetXHalfLength2() const
|
||||
// G4double GetTanAlpha1() const
|
||||
// G4double GetZHalfLength() const
|
||||
// G4ThreeVector GetSymAxis() const
|
||||
// - Returns coordinates of unit vector along straight
|
||||
// line joining centers of -/+fDz planes
|
||||
// G4double GetYHalfLength1() const
|
||||
// G4double GetXHalfLength1() const
|
||||
// G4double GetXHalfLength2() const
|
||||
// G4double GetTanAlpha1() const
|
||||
//
|
||||
// G4double GetYHalfLength2() const
|
||||
// G4double GetXHalfLength3() const
|
||||
// G4double GetXHalfLength4() const
|
||||
// G4double GetTanAlpha2() const
|
||||
// G4double GetYHalfLength2() const
|
||||
// G4double GetXHalfLength3() const
|
||||
// G4double GetXHalfLength4() const
|
||||
// G4double GetTanAlpha2() const
|
||||
//
|
||||
// TrapSidePlane GetSidePlane(G4int n ) const ; n = 0,1,2,3
|
||||
// TrapSidePlane GetSidePlane(G4int n ) const ; n = 0,1,2,3
|
||||
//
|
||||
// Protected:
|
||||
// G4bool MakePlane( G4ThreeVector& p1,
|
||||
// G4ThreeVector& p2,
|
||||
// G4ThreeVector& p3,
|
||||
// G4ThreeVector& p4,
|
||||
// TrapSidePlane& plane )
|
||||
// Protected:
|
||||
//
|
||||
// G4bool MakePlane( G4ThreeVector& p1,
|
||||
// G4ThreeVector& p2,
|
||||
// G4ThreeVector& p3,
|
||||
// G4ThreeVector& p4,
|
||||
// TrapSidePlane& plane )
|
||||
//
|
||||
//
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4Transform& pTransform) const
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4Transform& pTransform) const
|
||||
//
|
||||
// Create the List of transformed vertices in the format required
|
||||
// for G4CSGSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
//
|
||||
//
|
||||
// - Create the List of transformed vertices in the format required
|
||||
// for G4CSGSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
|
||||
// History:
|
||||
//
|
||||
// 23.3.94 P.Kent: Old C++ code converted to tolerant geometry
|
||||
// 9.9.96 V.Grichine: Final modifications before to commit
|
||||
// 1.11.96 V.Grichine Costructors for Right Angular Wedge from STEP & G4Trd/Para
|
||||
// 8.12.97 J.Allison Added "nominal" contructor and method SetAllParameters.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4Trap_HH
|
||||
#define G4Trap_HH
|
||||
@@ -296,8 +309,6 @@ public:
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
|
||||
G4VisExtent GetExtent () const;
|
||||
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
@@ -5,63 +5,71 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Trd.hh,v 1.3 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4Trd.hh,v 1.5 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
|
||||
// class G4Trd
|
||||
//
|
||||
// A Trd is a trapezoid with the x and y dimensions varying along z
|
||||
// functions:
|
||||
//
|
||||
// As inherited from G4CSGSolid +
|
||||
//
|
||||
// G4Trd( const G4String& pName,
|
||||
// G4double pdx1, G4double pdx2,
|
||||
// G4double pdy1, G4double pdy2,
|
||||
// G4double pdz )
|
||||
// Construct a trapezoid with name, and half lengths dpx1,dpx2,dpy1,
|
||||
// dpy2,dpz
|
||||
//
|
||||
// G4double GetXHalfLength1() const
|
||||
// G4double GetXHalfLength2() const
|
||||
// G4double GetYHalfLength1() const
|
||||
// G4double GetYHalfLength2() const
|
||||
// G4double GetZHalfLength() const
|
||||
//
|
||||
// Return the respective parameter
|
||||
//
|
||||
// void SetXHalfLength1(G4double)
|
||||
// void SetXHalfLength2(G4double)
|
||||
// void SetYHalfLength1(G4double)
|
||||
// void SetYHalfLength2(G4double)
|
||||
// void SetZHalfLength(G4double)
|
||||
//
|
||||
// Set the respective parameter
|
||||
//
|
||||
// Protected:
|
||||
//
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
//
|
||||
// Create the List of transformed vertices in the format required
|
||||
// for G4CSGSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// G4Trd
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A Trd is a trapezoid with the x and y dimensions varying along z
|
||||
// functions:
|
||||
//
|
||||
// As inherited from G4CSGSolid +
|
||||
//
|
||||
// G4Trd( const G4String& pName,
|
||||
// G4double pdx1, G4double pdx2,
|
||||
// G4double pdy1, G4double pdy2,
|
||||
// G4double pdz )
|
||||
//
|
||||
// - Construct a trapezoid with name, and half lengths
|
||||
// dpx1,dpx2,dpy1,dpy2,dpz
|
||||
//
|
||||
// G4double GetXHalfLength1() const
|
||||
// G4double GetXHalfLength2() const
|
||||
// G4double GetYHalfLength1() const
|
||||
// G4double GetYHalfLength2() const
|
||||
// G4double GetZHalfLength() const
|
||||
//
|
||||
// - Return the respective parameter
|
||||
//
|
||||
// void SetXHalfLength1(G4double)
|
||||
// void SetXHalfLength2(G4double)
|
||||
// void SetYHalfLength1(G4double)
|
||||
// void SetYHalfLength2(G4double)
|
||||
// void SetZHalfLength(G4double)
|
||||
//
|
||||
// - Set the respective parameter
|
||||
//
|
||||
// Protected:
|
||||
//
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
//
|
||||
// - Create the List of transformed vertices in the format required
|
||||
// for G4CSGSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
//
|
||||
//
|
||||
// Member Data:
|
||||
//
|
||||
|
||||
// Member Data:
|
||||
|
||||
// fDx1 Half-length along x at the surface positioned at -dz
|
||||
// fDx2 Half-length along x at the surface positioned at +dz
|
||||
// fDy1 Half-length along y at the surface positioned at -dz
|
||||
// fDy2 Half-length along y at the surface positioned at +dz
|
||||
// fDz Half-length along z axis
|
||||
//
|
||||
|
||||
// History:
|
||||
// 19.11.99 V.Grichine, kUndefined was added to Eside enum
|
||||
// 21.04.97 J. Apostolakis Added Set Methods.
|
||||
// 19.08.96 P. Kent, V. Grichine ->Fs in accordance with G4Box
|
||||
// 17.02.95 P.Kent Exiting normal return
|
||||
// 12.01.95 P.Kent Old prototype code converted to thick geometry
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4TRD_HH
|
||||
#define G4TRD_HH
|
||||
@@ -160,7 +168,6 @@ class G4Trd : public G4CSGSolid
|
||||
// Visualisation functions
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4VisExtent GetExtent () const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
|
||||
@@ -5,46 +5,52 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Tubs.hh,v 1.2 1999/12/15 14:50:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4Tubs.hh,v 1.4 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// class G4Tubs
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// A tube or tube segment with curved sides parallel to
|
||||
// the z-axis. The tube has a specified half-length along
|
||||
// the z axis, about which it is centred, and a given
|
||||
// minimum and maximum radius. A minimum radius of 0
|
||||
// signifies a filled tube /cylinder. The tube segment is
|
||||
// specified by starting and delta
|
||||
// angles for phi, with 0 being the +x axis, PI/2
|
||||
// the +y axis. A delta angle of 2PI signifies a
|
||||
// complete, unsegmented tube/cylinder.
|
||||
//
|
||||
// G4Tubs
|
||||
//
|
||||
// Member functions:
|
||||
// Class description:
|
||||
//
|
||||
// As inherited from G4VSolid+
|
||||
// A tube or tube segment with curved sides parallel to
|
||||
// the z-axis. The tube has a specified half-length along
|
||||
// the z axis, about which it is centred, and a given
|
||||
// minimum and maximum radius. A minimum radius of 0
|
||||
// signifies a filled tube /cylinder. The tube segment is
|
||||
// specified by starting and delta angles for phi, with 0
|
||||
// being the +x axis, PI/2 the +y axis.
|
||||
// A delta angle of 2PI signifies a complete, unsegmented
|
||||
// tube/cylinder.
|
||||
//
|
||||
// G4Tubs(const G4String &pName
|
||||
// G4double pRMin
|
||||
// G4double pRMax
|
||||
// G4double pDz
|
||||
// G4double pSPhi
|
||||
// G4double pDPhi )
|
||||
// Member functions:
|
||||
//
|
||||
// Construct a tubs with the given name and dimensions.
|
||||
// The angles are provided is radians.
|
||||
// As inherited from G4VSolid+
|
||||
//
|
||||
// G4Tubs(const G4String &pName
|
||||
// G4double pRMin
|
||||
// G4double pRMax
|
||||
// G4double pDz
|
||||
// G4double pSPhi
|
||||
// G4double pDPhi )
|
||||
//
|
||||
// - Construct a tubs with the given name and dimensions.
|
||||
// The angles are provided is radians.
|
||||
//
|
||||
//
|
||||
// Protected:
|
||||
// Protected:
|
||||
//
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
// G4ThreeVectorList*
|
||||
// CreateRotatedVertices(const G4AffineTransform& pTransform) const
|
||||
//
|
||||
// Create the List of transformed vertices in the format required
|
||||
// for G4VSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
// - Create the List of transformed vertices in the format required
|
||||
// for G4VSolid:: ClipCrossSection and ClipBetweenSections.
|
||||
//
|
||||
// Member Data:
|
||||
// Member Data:
|
||||
//
|
||||
// fRMin Inner radius
|
||||
// fRMax Outer radius
|
||||
@@ -55,14 +61,14 @@
|
||||
// fSPhi>-2PI
|
||||
//
|
||||
// fDPhi Delta angle of the segment in radians
|
||||
//
|
||||
//
|
||||
|
||||
// History:
|
||||
// 10.8.95 P.Kent General cleanup, use G4VSolid extent helper functions
|
||||
// to CaluclateExtent
|
||||
// 23.1.94 P.Kent Converted to `tolerant' geometry
|
||||
// 19.07.96 J.Allison G4GraphicsScene - see G4Box.
|
||||
// 22.07.96 J.Allison Changed SendPolyhedronTo to CreatePolyhedron.
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4TUBS_HH
|
||||
#define G4TUBS_HH
|
||||
@@ -117,7 +123,6 @@ public:
|
||||
|
||||
// Visualisation functions
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4VisExtent GetExtent () const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
|
||||
@@ -1,271 +0,0 @@
|
||||
//
|
||||
// G4VCSGface.hh
|
||||
//
|
||||
#ifndef G4VCSGface_hh
|
||||
#define G4VCSGface_hh
|
||||
//
|
||||
// Definition of the virtual base class G4VCSGface, one side (or face)
|
||||
// of a CSG solid. It should be possible to build a CSG entirely out of connecting
|
||||
// CSG faces.
|
||||
//
|
||||
// Each face has an inside and outside surface, the former represents the inside
|
||||
// of the volume, the latter, the outside.
|
||||
//
|
||||
// Virtual members:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// Intersect( const G4ThreeVector &p, const G4ThreeVector &v, const G4bool outGoing, const G4double surfTolerance,
|
||||
// const G4bool outgoing, const G4double surfTolerance,
|
||||
// G4double &distance, G4double &distFromSurface,
|
||||
// G4ThreeVector &normal, G4bool &allBehind );
|
||||
//
|
||||
// p - (in) position
|
||||
// v - (in) direction (assumed to be a unit vector)
|
||||
// outgoing - (in) true, to consider only inside surfaces
|
||||
// false, to consider only outside surfaces
|
||||
// distance - (out) distance to intersection
|
||||
// distFromSurface - (out) distance from surface (along surface normal),
|
||||
// < 0 if the point is in front of the surface
|
||||
// normal - (out) normal of surface at intersection point
|
||||
// allBehind - (out) true, if entire surface is behind normal
|
||||
//
|
||||
// return value = true if there is an intersection,
|
||||
// false if there is no intersection (all output arguments undefined)
|
||||
//
|
||||
// Determine the distance along a line to the face.
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// Distance( const G4ThreeVector &p, const G4bool outgoing );
|
||||
//
|
||||
// p - (in) position
|
||||
// outgoing - (in) true, to consider only inside surfaces
|
||||
// false, to consider only outside surfaces
|
||||
//
|
||||
// return value = distance to closest surface satisifying requirements,
|
||||
// or kInfinity if no such surface exists
|
||||
//
|
||||
// Determine the distance of a point from either the inside or outside
|
||||
// surfaces of the face.
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// Inside( const G4ThreeVector &p, const G4double tolerance,
|
||||
// G4double *bestDistance );
|
||||
//
|
||||
// p - (in) position
|
||||
// tolerance - (in) tolerance defining the bounds of the "kSurface",
|
||||
// nominally equal to kCarTolerance/2
|
||||
// bestDistance - (out) distance to closest surface (in or out)
|
||||
//
|
||||
// return value = kInside if the point is closest to the inside surface
|
||||
// kOutside if the point is closest to the outside surface
|
||||
// kSurface if the point is withing tolerance of the surface
|
||||
//
|
||||
// Determine whether a point is inside, outside, or on the surface of
|
||||
// the face.
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// Normal( const G4ThreeVector &p, G4double *bestDistance );
|
||||
//
|
||||
// p - (in) position
|
||||
// bestDistance - (out) distance to closest surface (in or out)
|
||||
//
|
||||
// return value = the normal of the surface nearest the point
|
||||
//
|
||||
// Return normal of surface closest to the point.
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// Extent( const G4ThreeVector axis );
|
||||
//
|
||||
// axis - (in) unit vector defining direction
|
||||
//
|
||||
// return value = the largest point along the given axis of the
|
||||
// the face's extent.
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// CalculateExtent( const EAxis pAxis,
|
||||
// const G4VoxelLimit &pVoxelLimit,
|
||||
// const G4AffineTransform &pTransform,
|
||||
// G4double &min, G4double &max )
|
||||
//
|
||||
// pAxis - (in) The x,y, or z axis in which to check
|
||||
// the shapes 3D extent against
|
||||
// pVoxelLimit - (in) Limits along x, y, and/or z axes
|
||||
// pTransform - (in) A coordinate transformation on which
|
||||
// to apply to the shape before testing
|
||||
// min - (out) If the face has any point on its
|
||||
// surface after tranformation and limits
|
||||
// along pAxis
|
||||
// that is smaller than the value of min,
|
||||
// than it is used to replace min.
|
||||
// Undefined if the return value is false.
|
||||
// max - (out) Same as min, except for the largest
|
||||
// point. Undefined if the return value is false.
|
||||
//
|
||||
// return value = true if anything remains of the face
|
||||
//
|
||||
// Calculate the extent of the face for the voxel navigator.
|
||||
// In analogy with CalculateExtent for G4VCSGfaceted, this is
|
||||
// done in the following steps:
|
||||
//
|
||||
// 1. Transform the face using pTranform, an arbitrary 3D
|
||||
// rotation/offset/reflection
|
||||
// 2. Clip the face to those boundaries as specified in
|
||||
// pVoxelLimit. This may include limits in any number
|
||||
// of x, y, or z axes.
|
||||
// 3. For each part of the face that remains (there could
|
||||
// be many separate pieces in general):
|
||||
// 4. Check to see if the piece overlaps the currently
|
||||
// existing limits along axis pAxis. For
|
||||
// pVoxelLimit.IsLimited(pAxis) = false, there are
|
||||
// no limits.
|
||||
// 5. For a piece that does overlap, update min/max
|
||||
// accordingly (within confines of pre-existing
|
||||
// limits) along the direction pAxis.
|
||||
// 6. If min/max were updated, return true
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// G3VCSGface *Clone()
|
||||
//
|
||||
// This method is invoked by G4CSGfaceted during the copy constructor
|
||||
// or the assignment operator. Its purpose is to return a pointer
|
||||
// (of type G4VCSGface) to a duplicate copy of the face. The implementation
|
||||
// is straight forward for inherited classes. Example:
|
||||
//
|
||||
// G4VCSGface G4PolySideFace::Clone() { return new G4PolySideFace(*this); }
|
||||
//
|
||||
// Of course, this assumes the copy constructor of G4PolySideFace is
|
||||
// correctly implemented.
|
||||
//
|
||||
// Implementation notes:
|
||||
// * distance.
|
||||
// The meaning of distance includes the boundaries of the face. For example.
|
||||
// for a rectangular, planer face:
|
||||
//
|
||||
// A | B | C
|
||||
// | |
|
||||
// -------+--------------+-----
|
||||
// D | I | E
|
||||
// | |
|
||||
// -------+--------------+-----
|
||||
// F | G | H
|
||||
// | |
|
||||
//
|
||||
// A, C, F, and H: closest distance is the distance to
|
||||
// the adjacent corner.
|
||||
//
|
||||
// B, D, E, and G: closest distance is the distance to
|
||||
// the adjacent line.
|
||||
//
|
||||
// I: normal distance to plane
|
||||
//
|
||||
// For non-planer faces, one can use the normal to decide when
|
||||
// a point falls off the edge and then act accordingly.
|
||||
//
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// A CSG shape can be defined by putting together any number of generic faces,
|
||||
// as long as the faces cover the entire surface of the shape without overlapping.
|
||||
//
|
||||
// G4VSolid::CalculateExtent
|
||||
//
|
||||
// Define unit vectors along the specified transform axis. Use the inverse of the
|
||||
// specified coordinate transformation to rotate these unit vectors. Loop over
|
||||
// each face, call face->Extent, and save the maximum value.
|
||||
//
|
||||
// G4VSolid::Inside
|
||||
//
|
||||
// To decide if a point is inside, outside, or on the surface of the shape,
|
||||
// loop through all faces, and find the answer from face->Inside which gives
|
||||
// a value of "bestDistance" smaller than any other. While looping, if any
|
||||
// face->Inside returns kSurface, this value can be returned immediately.
|
||||
//
|
||||
// EInside answer;
|
||||
// G4VCSGface *face = faces;
|
||||
// G4double best = kInfinity;
|
||||
// do {
|
||||
// G4double distance;
|
||||
// EInside result = (*face)->Inside( p, kCarTolerance/2, distance );
|
||||
// if (result == kSurface) return kSurface;
|
||||
// if (distance < best) {
|
||||
// best = distance;
|
||||
// answer = result;
|
||||
// }
|
||||
// } while( ++face < faces + numFaces );
|
||||
//
|
||||
// return(answer);
|
||||
//
|
||||
// G4VSolid::SurfaceNormal
|
||||
//
|
||||
// Loop over all faces, call face->Normal, and return the normal to the face
|
||||
// that is closest to the point.
|
||||
//
|
||||
// G4VSolid::DistanceToIn(p)
|
||||
//
|
||||
// Loop over all faces, invoking face->Distance with outgoing = false,
|
||||
// and save the answer that is smallest.
|
||||
//
|
||||
// G4VSolid::DistanceToIn(p,v)
|
||||
//
|
||||
// Loop over all faces, invoking face->Intersect with outgoing = false,
|
||||
// and save the answer that is smallest.
|
||||
//
|
||||
// G4VSolid::DistanceToOut(p)
|
||||
//
|
||||
// Loop over all faces, invoking face->Distance with outgoing = true,
|
||||
// and save the answer that is smallest.
|
||||
//
|
||||
// G4VSolid::DistanceToOut(p,v)
|
||||
//
|
||||
// Loop over all faces, invoking face->Intersect with outgoing = true,
|
||||
// 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.
|
||||
//
|
||||
// ----------------------------------------------------------
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "geomdefs.hh"
|
||||
|
||||
class G4VoxelLimits;
|
||||
class G4AffineTransform;
|
||||
class G4SolidExtentList;
|
||||
|
||||
class G4VCSGface {
|
||||
public:
|
||||
G4VCSGface() {;}
|
||||
virtual ~G4VCSGface() {;}
|
||||
|
||||
virtual G4bool Intersect( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
const G4bool outgoing, const G4double surfTolerance,
|
||||
G4double &distance, G4double &distFromSurface,
|
||||
G4ThreeVector &normal, G4bool &allBehind ) = 0;
|
||||
|
||||
virtual G4double Distance( const G4ThreeVector &p, const G4bool outgoing ) = 0;
|
||||
|
||||
virtual EInside Inside( const G4ThreeVector &p, const G4double tolerance,
|
||||
G4double *bestDistance ) = 0;
|
||||
|
||||
virtual G4ThreeVector Normal( const G4ThreeVector &p, G4double *bestDistance ) = 0;
|
||||
|
||||
virtual G4double Extent( const G4ThreeVector axis ) = 0;
|
||||
|
||||
virtual void CalculateExtent( const EAxis axis,
|
||||
const G4VoxelLimits &voxelLimit,
|
||||
const G4AffineTransform &tranform,
|
||||
G4SolidExtentList &extentList ) = 0;
|
||||
|
||||
virtual G4VCSGface* Clone() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
//
|
||||
// G4VCSGfaceted.hh
|
||||
//
|
||||
// Declaration of a virtual class CSG type shape that is built entire of G4CSGface faces.
|
||||
//
|
||||
|
||||
#ifndef G4VCSGfaceted_hh
|
||||
#define G4VCSGfaceted_hh
|
||||
|
||||
#include "G4CSGSolid.hh"
|
||||
|
||||
class G4VCSGface;
|
||||
|
||||
class G4VCSGfaceted : public G4CSGSolid
|
||||
{
|
||||
public:
|
||||
G4VCSGfaceted( G4String name) : G4CSGSolid(name) {;}
|
||||
virtual ~G4VCSGfaceted();
|
||||
|
||||
G4VCSGfaceted( const G4VCSGfaceted &source );
|
||||
const G4VCSGfaceted &operator=( const G4VCSGfaceted &source );
|
||||
|
||||
virtual G4bool CalculateExtent( const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
G4double& pmin, G4double& pmax) const;
|
||||
|
||||
virtual EInside Inside( const G4ThreeVector& p) const;
|
||||
|
||||
virtual G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
|
||||
|
||||
virtual G4double DistanceToIn( const G4ThreeVector& p,const G4ThreeVector& v ) const;
|
||||
virtual G4double DistanceToIn( const G4ThreeVector& p ) const;
|
||||
virtual G4double DistanceToOut( const G4ThreeVector& p,const G4ThreeVector& v,
|
||||
const G4bool calcNorm=false,
|
||||
G4bool *validNorm=0,G4ThreeVector *n=0 ) const;
|
||||
virtual G4double DistanceToOut( const G4ThreeVector& p ) const;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4CSGfaceted"); }
|
||||
|
||||
virtual G4Polyhedron* CreatePolyhedron() const = 0;
|
||||
|
||||
virtual void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
|
||||
|
||||
virtual G4VisExtent GetExtent() const;
|
||||
|
||||
protected:
|
||||
G4int numFace;
|
||||
G4VCSGface **faces;
|
||||
|
||||
virtual G4double DistanceTo( const G4ThreeVector &p, const G4bool outgoing ) const;
|
||||
|
||||
void CopyStuff( const G4VCSGfaceted &source );
|
||||
void DeleteStuff();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user