Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -5,18 +5,25 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4BREPSolidSphere.cc,v 1.2 1999/12/15 14:50:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4BREPSolidSphere.cc,v 1.4 2000/11/08 14:22:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4BREPSolidSphere.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4BREPSolidSphere.hh"
|
||||
#include "G4SphericalSurface.hh"
|
||||
|
||||
G4BREPSolidSphere::G4BREPSolidSphere(const G4String name,
|
||||
G4BREPSolidSphere::G4BREPSolidSphere(const G4String& name,
|
||||
const G4Vector3D& o,
|
||||
const G4Vector3D& xhat,
|
||||
const G4Vector3D& zhat,
|
||||
G4double r): G4BREPSolid(name)
|
||||
G4double r)
|
||||
: G4BREPSolid(name)
|
||||
{
|
||||
SurfaceVec = new G4Surface*[1];
|
||||
G4double ph1 = 0;
|
||||
@@ -29,6 +36,9 @@ G4BREPSolidSphere::G4BREPSolidSphere(const G4String name,
|
||||
Initialize();
|
||||
}
|
||||
|
||||
G4BREPSolidSphere::~G4BREPSolidSphere()
|
||||
{
|
||||
}
|
||||
|
||||
EInside G4BREPSolidSphere::Inside(register const G4ThreeVector& Pt) const
|
||||
{
|
||||
@@ -56,15 +66,15 @@ G4double G4BREPSolidSphere::DistanceToIn(const G4ThreeVector& Pt) const
|
||||
G4double G4BREPSolidSphere::DistanceToIn(register const G4ThreeVector& Pt,
|
||||
register const G4ThreeVector& V) const
|
||||
{
|
||||
SphReset();
|
||||
// SphReset();
|
||||
G4Vector3D Pttmp(Pt);
|
||||
G4Vector3D Vtmp(V);
|
||||
G4Ray r(Pttmp, Vtmp);
|
||||
int Result = SurfaceVec[0]->Intersect( r );
|
||||
G4int Result = SurfaceVec[0]->Intersect( r );
|
||||
|
||||
if(Result>0)
|
||||
{
|
||||
ShortestDistance = SurfaceVec[0]->Distance();
|
||||
ShortestDistance = SurfaceVec[0]->GetDistance();
|
||||
return sqrt(ShortestDistance);
|
||||
}
|
||||
return kInfinity;
|
||||
@@ -77,9 +87,8 @@ G4double G4BREPSolidSphere::DistanceToOut(register const G4ThreeVector& Pt,
|
||||
G4bool *validNorm,
|
||||
G4ThreeVector *n) const
|
||||
{
|
||||
if(validNorm)
|
||||
*validNorm = false;
|
||||
SphReset();
|
||||
if(validNorm) *validNorm = false;
|
||||
// SphReset();
|
||||
G4Vector3D Pttmp(Pt);
|
||||
G4Vector3D Vtmp(V);
|
||||
G4Ray r(Pttmp, Vtmp);
|
||||
@@ -92,7 +101,7 @@ G4double G4BREPSolidSphere::DistanceToOut(register const G4ThreeVector& Pt,
|
||||
*n = SurfaceNormal(Pt);
|
||||
}
|
||||
|
||||
ShortestDistance = SurfaceVec[0]->Distance();
|
||||
ShortestDistance = SurfaceVec[0]->GetDistance();
|
||||
return sqrt(ShortestDistance);
|
||||
}
|
||||
return kInfinity;
|
||||
@@ -103,8 +112,3 @@ G4double G4BREPSolidSphere::DistanceToOut(const G4ThreeVector& Pt) const
|
||||
{
|
||||
return fabs(SurfaceVec[0]->HowNear(Pt));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user