Geant4  10.01.p02
UOrb Class Reference

#include <UOrb.hh>

+ Inheritance diagram for UOrb:
+ Collaboration diagram for UOrb:

Public Member Functions

 UOrb ()
 
 UOrb (const std::string &name, double pRmax)
 
 ~UOrb ()
 
 UOrb (const UOrb &rhs)
 
UOrboperator= (const UOrb &rhs)
 
double GetRadius () const
 
void SetRadius (double newRmax)
 
EnumInside Inside (const UVector3 &aPo6int) const
 Return whether point inside/outside/on surface Split into radius checks. More...
 
double SafetyFromInside (const UVector3 &aPoint, bool aAccurate=false) const
 
double SafetyFromOutside (const UVector3 &aPoint, bool aAccurate=false) const
 
double DistanceToIn (const UVector3 &aPoint, const UVector3 &aDirection, double aPstep=UUtils::kInfinity) const
 
double DistanceToOut (const UVector3 &aPoint, const UVector3 &aDirection, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
 
bool Normal (const UVector3 &aPoint, UVector3 &aNormal) const
 Return unit normal of surface closest to p. More...
 
void Extent (UVector3 &aMin, UVector3 &aMax) const
 Returns extent of the solid along a given cartesian axis OK. More...
 
double Capacity ()
 
double SurfaceArea ()
 
UGeometryType GetEntityType () const
 
void ComputeBBox (UBBox *, bool)
 
void GetParametersList (int, double *) const
 
VUSolidClone () const
 
double GetRadialTolerance ()
 
UVector3 GetPointOnSurface () const
 
std::ostream & StreamInfo (std::ostream &os) const
 
- Public Member Functions inherited from VUSolid
 VUSolid ()
 
 VUSolid (const std::string &name)
 
virtual ~VUSolid ()
 
double GetCarTolerance () const
 
double GetRadTolerance () const
 
double GetAngTolerance () const
 
void SetCarTolerance (double eps)
 
void SetRadTolerance (double eps)
 
void SetAngTolerance (double eps)
 
virtual void ExtentAxis (EAxisType aAxis, double &aMin, double &aMax) const
 
const std::string & GetName () const
 
void SetName (const std::string &aName)
 
virtual void SamplePointsInside (int, UVector3 *) const
 
virtual void SamplePointsOnSurface (int, UVector3 *) const
 
virtual void SamplePointsOnEdge (int, UVector3 *) const
 
double EstimateCubicVolume (int nStat, double epsilon) const
 
double EstimateSurfaceArea (int nStat, double ell) const
 

Private Member Functions

double DistanceToOutForOutsidePoints (const UVector3 &p, const UVector3 &v, UVector3 &n) const
 

Private Attributes

double fR
 
double fRTolerance
 
double fCubicVolume
 
double fSurfaceArea
 

Additional Inherited Members

- Public Types inherited from VUSolid
enum  EnumInside { eInside =0, eSurface =1, eOutside =2 }
 
enum  EAxisType { eXaxis =0, eYaxis =1, eZaxis =2 }
 
- Static Public Member Functions inherited from VUSolid
static double Tolerance ()
 
- Static Protected Attributes inherited from VUSolid
static double fgTolerance = 1.0E-9
 
static double frTolerance = 1.0E-9
 
static double faTolerance = 1.0E-9
 

Detailed Description

Definition at line 28 of file UOrb.hh.

Constructor & Destructor Documentation

UOrb::UOrb ( )
inline

Definition at line 32 of file UOrb.hh.

Referenced by Clone().

+ Here is the caller graph for this function:

UOrb::UOrb ( const std::string &  name,
double  pRmax 
)

Definition at line 26 of file UOrb.cc.

References UUtils::Exception(), VUSolid::fgTolerance, VUSolid::frTolerance, fRTolerance, G4INCL::Math::max(), and UFatalErrorInArguments.

+ Here is the call graph for this function:

UOrb::~UOrb ( )
inline

Definition at line 34 of file UOrb.hh.

UOrb::UOrb ( const UOrb rhs)

Definition at line 498 of file UOrb.cc.

Member Function Documentation

double UOrb::Capacity ( )
inlinevirtual

Implements VUSolid.

Definition at line 104 of file UOrb.hh.

References fCubicVolume, fR, and UUtils::kPi.

VUSolid * UOrb::Clone ( ) const
virtual

Implements VUSolid.

Definition at line 491 of file UOrb.cc.

References UOrb().

+ Here is the call graph for this function:

void UOrb::ComputeBBox ( UBBox ,
bool   
)
inlinevirtual

Implements VUSolid.

Definition at line 67 of file UOrb.hh.

double UOrb::DistanceToIn ( const UVector3 aPoint,
const UVector3 aDirection,
double  aPstep = UUtils::kInfinity 
) const
virtual

Implements VUSolid.

Definition at line 85 of file UOrb.cc.

References d2, UUtils::Exception(), fR, fRTolerance, UUtils::kInfinity, rad, s, UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

Referenced by DistanceToOutForOutsidePoints().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double UOrb::DistanceToOut ( const UVector3 aPoint,
const UVector3 aDirection,
UVector3 aNormalVector,
bool &  aConvex,
double  aPstep = UUtils::kInfinity 
) const
virtual

Implements VUSolid.

Definition at line 204 of file UOrb.cc.

References d2, UUtils::Exception(), fR, fRTolerance, rad, UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

Referenced by DistanceToOutForOutsidePoints().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double UOrb::DistanceToOutForOutsidePoints ( const UVector3 p,
const UVector3 v,
UVector3 n 
) const
private

Definition at line 178 of file UOrb.cc.

References DistanceToIn(), DistanceToOut(), UVector3::Dot(), and CLHEP::normal().

+ Here is the call graph for this function:

void UOrb::Extent ( UVector3 aMin,
UVector3 aMax 
) const
virtual

Returns extent of the solid along a given cartesian axis OK.

Implements VUSolid.

Definition at line 445 of file UOrb.cc.

References fR, and UVector3::Set().

+ Here is the call graph for this function:

UGeometryType UOrb::GetEntityType ( ) const
virtual

Implements VUSolid.

Definition at line 540 of file UOrb.cc.

void UOrb::GetParametersList ( int  ,
double *  aArray 
) const
virtual

Implements VUSolid.

Definition at line 532 of file UOrb.cc.

References GetRadius().

+ Here is the call graph for this function:

UVector3 UOrb::GetPointOnSurface ( ) const
virtual

Implements VUSolid.

Definition at line 476 of file UOrb.cc.

References fR, UUtils::kPi, UUtils::Random(), and UUtils::sqr().

+ Here is the call graph for this function:

double UOrb::GetRadialTolerance ( )
inline

Definition at line 74 of file UOrb.hh.

References fRTolerance.

double UOrb::GetRadius ( ) const
inline

Definition at line 93 of file UOrb.hh.

References fR.

Referenced by GetParametersList(), and G4UOrb::GetRadius().

+ Here is the caller graph for this function:

VUSolid::EnumInside UOrb::Inside ( const UVector3 p) const
virtual

Return whether point inside/outside/on surface Split into radius checks.

Classify point location with respect to solid: o eInside - inside the solid o eSurface - close to surface within tolerance o eOutside - outside the solid

Implements VUSolid.

Definition at line 54 of file UOrb.cc.

References VUSolid::eInside, VUSolid::eOutside, VUSolid::eSurface, fR, fRTolerance, UVector3::x(), UVector3::y(), and UVector3::z().

Referenced by SafetyFromInside().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool UOrb::Normal ( const UVector3 p,
UVector3 n 
) const
virtual

Return unit normal of surface closest to p.

From http://lists.trolltech.com/qt-interest/2002-09/thread01124-0.html :

does anybody here have an algorithm to calculate the normal vector in a given point in space (x, y, z) in a sphere? I know that it's not about qt but i'll like very mutch the help.

It's simply the connecting vector from the centre of the sphere to the point (other way around for inward normals) obtained through vector subtraction, normalized to unity.

You really should get an algebra book though, as you are bound to encounter more of these problems in a 3d application.

Implements VUSolid.

Definition at line 423 of file UOrb.cc.

References fR, fRTolerance, rad, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

UOrb & UOrb::operator= ( const UOrb rhs)

Definition at line 507 of file UOrb.cc.

References fCubicVolume, fR, fRTolerance, and fSurfaceArea.

double UOrb::SafetyFromInside ( const UVector3 aPoint,
bool  aAccurate = false 
) const
virtual

Implements VUSolid.

Definition at line 352 of file UOrb.cc.

References UUtils::Exception(), fR, Inside(), kOutside, rad, UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

double UOrb::SafetyFromOutside ( const UVector3 aPoint,
bool  aAccurate = false 
) const
virtual

Implements VUSolid.

Definition at line 395 of file UOrb.cc.

References fR, rad, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

void UOrb::SetRadius ( double  newRmax)
inline

Definition at line 97 of file UOrb.hh.

References fCubicVolume, fR, and fSurfaceArea.

Referenced by G4UOrb::SetRadius().

+ Here is the caller graph for this function:

std::ostream & UOrb::StreamInfo ( std::ostream &  os) const
virtual

Implements VUSolid.

Definition at line 456 of file UOrb.cc.

References fR, and VUSolid::GetName().

+ Here is the call graph for this function:

double UOrb::SurfaceArea ( )
inlinevirtual

Implements VUSolid.

Definition at line 117 of file UOrb.hh.

References fR, fSurfaceArea, and UUtils::kPi.

Member Data Documentation

double UOrb::fCubicVolume
private

Definition at line 86 of file UOrb.hh.

Referenced by Capacity(), operator=(), and SetRadius().

double UOrb::fRTolerance
private

Definition at line 85 of file UOrb.hh.

Referenced by DistanceToIn(), DistanceToOut(), GetRadialTolerance(), Inside(), Normal(), operator=(), and UOrb().

double UOrb::fSurfaceArea
private

Definition at line 87 of file UOrb.hh.

Referenced by operator=(), SetRadius(), and SurfaceArea().


The documentation for this class was generated from the following files: