G4CurveRayIntersection Class Reference

#include <G4CurveRayIntersection.hh>

Inheritance diagram for G4CurveRayIntersection:

G4CurvePoint

Public Member Functions

 G4CurveRayIntersection ()
 G4CurveRayIntersection (G4Curve &c0, const G4Ray &r0)
 ~G4CurveRayIntersection ()
 G4CurveRayIntersection (const G4CurveRayIntersection &cr)
G4CurveRayIntersectionoperator= (const G4CurveRayIntersection &cr)
void Init (G4Curve &c0, const G4Ray &r0)
const G4RayGetRay () const
void Reset ()
void ResetPPoint (G4double u0)
void Reset (const G4Point3D &p0)
void Reset (G4double u0, const G4Point3D &p0)
void ResetDistance (G4double d0)
void Reset (G4double u0, G4double d0)
void Reset (const G4Point3D &p0, G4double d0)
void Reset (G4double u0, const G4Point3D &p0, G4double d0)
G4double GetPPoint ()
const G4Point3DGetPoint ()
G4double GetDistance ()
void Update (G4CurveRayIntersection &is)
void UpdateWithPointOnCurve (G4CurveRayIntersection &is)

Protected Attributes

const G4Rayr
G4double d
G4double kCarTolerance

Static Protected Attributes

static const G4int dFlag = 4

Detailed Description

Definition at line 47 of file G4CurveRayIntersection.hh.


Constructor & Destructor Documentation

G4CurveRayIntersection::G4CurveRayIntersection (  ) 

Definition at line 41 of file G4CurveRayIntersection.cc.

References G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetSurfaceTolerance(), and kCarTolerance.

00042   : r(0), d(kInfinity)
00043 {
00044   kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
00045 }

G4CurveRayIntersection::G4CurveRayIntersection ( G4Curve c0,
const G4Ray r0 
)

Definition at line 47 of file G4CurveRayIntersection.cc.

References G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetSurfaceTolerance(), Init(), and kCarTolerance.

00048 {
00049   Init(c0, r0);
00050   kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
00051 }

G4CurveRayIntersection::~G4CurveRayIntersection (  ) 

Definition at line 53 of file G4CurveRayIntersection.cc.

00054 {
00055 }

G4CurveRayIntersection::G4CurveRayIntersection ( const G4CurveRayIntersection cr  ) 

Definition at line 57 of file G4CurveRayIntersection.cc.

References G4CurvePoint::c, kCarTolerance, G4CurvePoint::notComputed, G4CurvePoint::p, and G4CurvePoint::u.

00058   : G4CurvePoint(), r(cr.r), d(cr.d)
00059 {
00060   c = cr.c;
00061   p = cr.p;
00062   u = cr.u;
00063   notComputed = cr.notComputed;
00064   kCarTolerance = cr.kCarTolerance;
00065 }


Member Function Documentation

G4double G4CurveRayIntersection::GetDistance (  )  [inline]

Definition at line 152 of file G4CurveRayIntersection.icc.

References G4CurvePoint::c, d, dFlag, G4Curve::GetPoint(), G4Ray::GetPPoint(), G4CurvePoint::notComputed, G4CurvePoint::p, G4CurvePoint::pFlag, r, and G4CurvePoint::u.

Referenced by G4SurfaceBoundary::Tangent(), G4CompositeCurve::Tangent(), and UpdateWithPointOnCurve().

00153 {
00154   if (notComputed & dFlag) {
00155     if (notComputed & pFlag) {
00156       p= c->GetPoint(u);
00157       notComputed &= ~pFlag;
00158     }
00159     d= r->GetPPoint(p);
00160     notComputed &= ~dFlag;
00161   }
00162   return d;
00163 }

const G4Point3D & G4CurveRayIntersection::GetPoint (  )  [inline]

Reimplemented from G4CurvePoint.

Definition at line 138 of file G4CurveRayIntersection.icc.

References G4CurvePoint::c, d, dFlag, G4Ray::GetPoint(), G4Curve::GetPoint(), G4CurvePoint::notComputed, G4CurvePoint::p, G4CurvePoint::pFlag, r, and G4CurvePoint::u.

00139 {
00140   if (notComputed & pFlag) {
00141     if (notComputed & dFlag) {
00142       p= c->GetPoint(u);
00143     } else {
00144       p= r->GetPoint(d);
00145     }
00146     notComputed &= ~pFlag;
00147   }
00148   return p;
00149 }

G4double G4CurveRayIntersection::GetPPoint (  )  [inline]

Reimplemented from G4CurvePoint.

Definition at line 124 of file G4CurveRayIntersection.icc.

References G4CurvePoint::c, d, G4Ray::GetPoint(), G4Curve::GetPPoint(), G4CurvePoint::notComputed, G4CurvePoint::p, G4CurvePoint::pFlag, r, G4CurvePoint::u, and G4CurvePoint::uFlag.

Referenced by Update().

00125 {
00126   if (notComputed & uFlag) {
00127     if (notComputed & pFlag) {
00128       p= r->GetPoint(d);
00129       notComputed &= ~pFlag;
00130     }
00131     u= c->GetPPoint(p);
00132     notComputed &= ~uFlag;
00133   }
00134   return u;
00135 }

const G4Ray & G4CurveRayIntersection::GetRay (  )  const [inline]

Definition at line 49 of file G4CurveRayIntersection.icc.

References r.

00050 {
00051   return *r;
00052 }

void G4CurveRayIntersection::Init ( G4Curve c0,
const G4Ray r0 
) [inline]

Definition at line 38 of file G4CurveRayIntersection.icc.

References G4CurvePoint::allFlags, G4CurvePoint::c, d, G4CurvePoint::notComputed, and r.

Referenced by G4CurveRayIntersection().

00039 {
00040   c= &c0;
00041   r= &r0;
00042   d= kInfinity;
00043   notComputed= allFlags;
00044 }

G4CurveRayIntersection & G4CurveRayIntersection::operator= ( const G4CurveRayIntersection cr  ) 

Definition at line 68 of file G4CurveRayIntersection.cc.

References G4CurvePoint::c, d, kCarTolerance, G4CurvePoint::notComputed, G4CurvePoint::p, r, and G4CurvePoint::u.

00069 {
00070   if (&cr == this) return *this;
00071   c = cr.c;
00072   p = cr.p;
00073   u = cr.u;
00074   r = cr.r;
00075   d = cr.d;
00076   notComputed = cr.notComputed;
00077   kCarTolerance = cr.kCarTolerance;
00078 
00079   return *this;
00080 }

void G4CurveRayIntersection::Reset ( G4double  u0,
const G4Point3D p0,
G4double  d0 
) [inline]

Definition at line 112 of file G4CurveRayIntersection.icc.

References d, G4CurvePoint::notComputed, G4CurvePoint::p, and G4CurvePoint::u.

00114 {
00115   d= d0;
00116   u= u0;
00117   p= p0;
00118   notComputed= 0;
00119 }

void G4CurveRayIntersection::Reset ( const G4Point3D p0,
G4double  d0 
) [inline]

Definition at line 104 of file G4CurveRayIntersection.icc.

References d, G4CurvePoint::notComputed, G4CurvePoint::p, and G4CurvePoint::uFlag.

00105 {
00106   d= d0;
00107   p= p0;
00108   notComputed= uFlag;
00109 }

void G4CurveRayIntersection::Reset ( G4double  u0,
G4double  d0 
) [inline]

Definition at line 96 of file G4CurveRayIntersection.icc.

References d, G4CurvePoint::notComputed, G4CurvePoint::pFlag, and G4CurvePoint::u.

00097 {
00098   d= d0;
00099   u= u0;
00100   notComputed= pFlag;
00101 }

void G4CurveRayIntersection::Reset ( G4double  u0,
const G4Point3D p0 
) [inline]

Reimplemented from G4CurvePoint.

Definition at line 80 of file G4CurveRayIntersection.icc.

References d, dFlag, G4CurvePoint::notComputed, G4CurvePoint::p, and G4CurvePoint::u.

00081 {
00082   d= 0;
00083   u= u0;
00084   p= p0;
00085   notComputed= dFlag;
00086 }

void G4CurveRayIntersection::Reset ( const G4Point3D p0  )  [inline]

Reimplemented from G4CurvePoint.

Definition at line 72 of file G4CurveRayIntersection.icc.

References d, dFlag, G4CurvePoint::notComputed, G4CurvePoint::p, and G4CurvePoint::uFlag.

00073 {
00074   d= 0;
00075   p= p0;
00076   notComputed= uFlag|dFlag;
00077 }

void G4CurveRayIntersection::Reset (  )  [inline]

Reimplemented from G4CurvePoint.

Definition at line 57 of file G4CurveRayIntersection.icc.

References d, G4CurvePoint::notComputed, G4CurvePoint::pFlag, and G4CurvePoint::uFlag.

Referenced by G4SurfaceBoundary::Init(), and G4CompositeCurve::Init().

00058 {
00059   d= +kInfinity;
00060   notComputed= uFlag|pFlag;
00061 }

void G4CurveRayIntersection::ResetDistance ( G4double  d0  )  [inline]

Definition at line 89 of file G4CurveRayIntersection.icc.

References d, G4CurvePoint::notComputed, G4CurvePoint::pFlag, and G4CurvePoint::uFlag.

00090 {
00091   d= d0;
00092   notComputed= uFlag|pFlag;
00093 }

void G4CurveRayIntersection::ResetPPoint ( G4double  u0  )  [inline]

Definition at line 64 of file G4CurveRayIntersection.icc.

References d, dFlag, G4CurvePoint::notComputed, G4CurvePoint::pFlag, and G4CurvePoint::u.

00065 {
00066   d= 0;
00067   u= u0;
00068   notComputed= pFlag|dFlag;
00069 }

void G4CurveRayIntersection::Update ( G4CurveRayIntersection is  )  [inline]

Definition at line 183 of file G4CurveRayIntersection.icc.

References G4CurvePoint::c, GetPPoint(), G4Curve::IsBounded(), G4Curve::IsPOn(), and UpdateWithPointOnCurve().

00184 {
00185   if (c->IsBounded()) {
00186     if (!c->IsPOn(is.GetPPoint())) {
00187       return;
00188     }   
00189   }
00190   UpdateWithPointOnCurve(is);
00191 }

void G4CurveRayIntersection::UpdateWithPointOnCurve ( G4CurveRayIntersection is  )  [inline]

Definition at line 168 of file G4CurveRayIntersection.icc.

References d, GetDistance(), and kCarTolerance.

Referenced by Update().

00169 {
00170   if (d!=kInfinity) {
00171     // not the first intersection
00172     G4double dTmp= is.GetDistance();
00173     if (dTmp < kCarTolerance || GetDistance() <= dTmp) {
00174       // not on ray or not the closest intersection
00175       return;
00176     }
00177   }
00178   // accepted
00179   *this= is;
00180 }       


Field Documentation

G4double G4CurveRayIntersection::d [protected]

Definition at line 101 of file G4CurveRayIntersection.hh.

Referenced by GetDistance(), GetPoint(), GetPPoint(), Init(), operator=(), Reset(), ResetDistance(), ResetPPoint(), and UpdateWithPointOnCurve().

const G4int G4CurveRayIntersection::dFlag = 4 [static, protected]

Definition at line 103 of file G4CurveRayIntersection.hh.

Referenced by GetDistance(), GetPoint(), Reset(), and ResetPPoint().

G4double G4CurveRayIntersection::kCarTolerance [protected]

Definition at line 102 of file G4CurveRayIntersection.hh.

Referenced by G4CurveRayIntersection(), operator=(), and UpdateWithPointOnCurve().

const G4Ray* G4CurveRayIntersection::r [protected]

Definition at line 100 of file G4CurveRayIntersection.hh.

Referenced by GetDistance(), GetPoint(), GetPPoint(), GetRay(), Init(), and operator=().


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:44 2013 for Geant4 by  doxygen 1.4.7