Import Geant4 10.5.1 source tree
This commit is contained in:
@@ -34,16 +34,20 @@
|
||||
//
|
||||
// Declaration of a CSG volume representing a tube with elliptical
|
||||
// cross section (geant3 solid 'ELTU'):
|
||||
//
|
||||
// G4EllipticalTube( const G4String& name,
|
||||
//
|
||||
// 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
|
||||
// The equation of the lateral surface : (x/dx)^2 + (y/dy)^2 = 1
|
||||
|
||||
// Author:
|
||||
// First implementation:
|
||||
// David C. Williams (davidw@scipp.ucsc.edu)
|
||||
//
|
||||
// Revision:
|
||||
// Evgueni Tcherniaev (evgueni.tcherniaev@cern.ch), 23.12.2019
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4EllipticalTube_hh
|
||||
@@ -56,34 +60,37 @@ class G4EllipticalTube : public G4VSolid
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4EllipticalTube( const G4String &name,
|
||||
G4double theDx,
|
||||
G4double theDy,
|
||||
G4double theDz );
|
||||
G4EllipticalTube( const G4String &name,
|
||||
G4double Dx,
|
||||
G4double Dy,
|
||||
G4double Dz );
|
||||
|
||||
virtual ~G4EllipticalTube();
|
||||
|
||||
// Standard solid methods
|
||||
|
||||
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
|
||||
// Standard methods
|
||||
//
|
||||
void BoundingLimits( G4ThreeVector& pMin, G4ThreeVector& pMax ) const;
|
||||
|
||||
G4bool CalculateExtent( const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
G4double& pmin, G4double& pmax ) const;
|
||||
|
||||
|
||||
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=false,
|
||||
G4bool *validNorm=0,
|
||||
G4ThreeVector *n=0 ) const;
|
||||
|
||||
G4double DistanceToOut( const G4ThreeVector& p ) const;
|
||||
|
||||
G4GeometryType GetEntityType() const;
|
||||
@@ -98,57 +105,67 @@ class G4EllipticalTube : public G4VSolid
|
||||
G4ThreeVector GetPointOnSurface() const;
|
||||
|
||||
// Visualisation methods
|
||||
|
||||
//
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
G4Polyhedron* GetPolyhedron () const;
|
||||
void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
|
||||
G4VisExtent GetExtent() const;
|
||||
|
||||
// Accessors
|
||||
|
||||
//
|
||||
inline G4double GetDx() const;
|
||||
inline G4double GetDy() const;
|
||||
inline G4double GetDz() const;
|
||||
|
||||
inline void SetDx( const G4double newDx );
|
||||
inline void SetDy( const G4double newDy );
|
||||
inline void SetDz( const G4double newDz );
|
||||
inline void SetDx( G4double Dx );
|
||||
inline void SetDy( G4double Dy );
|
||||
inline void SetDz( G4double Dz );
|
||||
|
||||
public: // without description
|
||||
|
||||
G4EllipticalTube(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
// persistifiable objects
|
||||
|
||||
G4EllipticalTube(const G4EllipticalTube& rhs);
|
||||
G4EllipticalTube& operator=(const G4EllipticalTube& rhs);
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
protected: // without description
|
||||
|
||||
G4double dx, dy, dz;
|
||||
|
||||
// Utility
|
||||
|
||||
inline G4double CheckXY( const G4double x,
|
||||
const G4double y,
|
||||
const G4double toler ) const;
|
||||
inline G4double CheckXY( const G4double x, const G4double y ) const;
|
||||
|
||||
G4int IntersectXY( const G4ThreeVector &p,
|
||||
const G4ThreeVector &v, G4double s[2] ) const;
|
||||
G4EllipticalTube& operator=(const G4EllipticalTube& rhs);
|
||||
// Copy constructor and assignment operator
|
||||
|
||||
private:
|
||||
|
||||
void CheckParameters();
|
||||
// Check parameters and set pre-calculated values
|
||||
|
||||
G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
|
||||
// Algorithm for SurfaceNormal() following the original
|
||||
// specification for points not on the surface.
|
||||
// specification for points not on the surface
|
||||
|
||||
G4double halfTol;
|
||||
G4double GetCachedSurfaceArea() const;
|
||||
// Calculate surface area and cache it
|
||||
|
||||
private:
|
||||
|
||||
G4double halfTolerance;
|
||||
|
||||
G4double fDx; // semi-axis in X
|
||||
G4double fDy; // semi-axis in Y
|
||||
G4double fDz; // half length in Z
|
||||
|
||||
G4double fCubicVolume; // volume
|
||||
G4double fSurfaceArea; // surface area
|
||||
|
||||
// Cached pre-calculated values
|
||||
G4double fRsph; // R of bounding sphere
|
||||
G4double fDDx; // Dx squared
|
||||
G4double fDDy; // Dy squared
|
||||
G4double fSx; // X scale factor
|
||||
G4double fSy; // Y scale factor
|
||||
G4double fR; // resulting Radius, after scaling elipse to circle
|
||||
G4double fQ1; // distance approximation : dist = Q1*(x^2 + y^2) - Q2
|
||||
G4double fQ2; // distance approximation : dist = Q1*(x^2 + y^2) - Q2
|
||||
G4double fScratch; // half length of scratching segment squared
|
||||
|
||||
G4double fCubicVolume;
|
||||
G4double fSurfaceArea;
|
||||
mutable G4bool fRebuildPolyhedron;
|
||||
mutable G4Polyhedron* fpPolyhedron;
|
||||
};
|
||||
|
||||
@@ -36,57 +36,47 @@
|
||||
inline
|
||||
G4double G4EllipticalTube::GetDx() const
|
||||
{
|
||||
return dx;
|
||||
return fDx;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4EllipticalTube::GetDy() const
|
||||
{
|
||||
return dy;
|
||||
return fDy;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4EllipticalTube::GetDz() const
|
||||
{
|
||||
return dz;
|
||||
return fDz;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4EllipticalTube::SetDx( const G4double newDx )
|
||||
inline
|
||||
void G4EllipticalTube::SetDx(G4double Dx)
|
||||
{
|
||||
dx = newDx;
|
||||
fDx = Dx;
|
||||
CheckParameters();
|
||||
fCubicVolume = 0.;
|
||||
fSurfaceArea = 0.;
|
||||
fRebuildPolyhedron = true;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4EllipticalTube::SetDy( const G4double newDy )
|
||||
void G4EllipticalTube::SetDy( G4double Dy )
|
||||
{
|
||||
dy = newDy;
|
||||
fDy = Dy;
|
||||
CheckParameters();
|
||||
fCubicVolume = 0.;
|
||||
fSurfaceArea = 0.;
|
||||
fRebuildPolyhedron = true;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4EllipticalTube::SetDz( const G4double newDz )
|
||||
void G4EllipticalTube::SetDz( G4double Dz )
|
||||
{
|
||||
dz = newDz;
|
||||
fDz = Dz;
|
||||
CheckParameters();
|
||||
fCubicVolume = 0.;
|
||||
fSurfaceArea = 0.;
|
||||
fRebuildPolyhedron = true;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4EllipticalTube::CheckXY( const G4double x,
|
||||
const G4double y,
|
||||
const G4double toler ) const
|
||||
{
|
||||
G4double rx = x/(dx+toler), ry = y/(dy+toler);
|
||||
return rx*rx + ry*ry;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4EllipticalTube::CheckXY( const G4double x, const G4double y ) const
|
||||
{
|
||||
G4double rx = x/dx, ry = y/dy;
|
||||
return rx*rx + ry*ry;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class G4Tet : public G4VSolid
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
const char* CVSHeaderVers()
|
||||
{ return "$Id: G4Tet.hh 113723 2018-12-06 14:12:07Z gunter $"; }
|
||||
{ return "$Id$"; }
|
||||
const char* CVSFileVers()
|
||||
{ return CVSVers; }
|
||||
void PrintWarnings(G4bool flag)
|
||||
|
||||
Reference in New Issue
Block a user