Import Geant4 11.4.0 source tree
This commit is contained in:
@@ -28,59 +28,93 @@
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// The G4TessellatedGeometryAlgorithms class is used to contain standard
|
||||
// routines to determine whether (and if so where) simple geometric shapes
|
||||
// intersect.
|
||||
// The G4TessellatedGeometryAlgorithms class is used to contain standard
|
||||
// routines to determine whether (and if so where) simple geometric shapes
|
||||
// intersect.
|
||||
//
|
||||
// The constructor doesn't need to do anything, and neither does the
|
||||
// destructor.
|
||||
// The constructor doesn't need to do anything, and neither does the
|
||||
// destructor.
|
||||
//
|
||||
// IntersectLineAndTriangle2D
|
||||
// Determines whether there is an intersection between a line defined
|
||||
// by r = p + s.v and a triangle defined by verticies P0, P0+E0 and P0+E1.
|
||||
// Here:
|
||||
// IntersectLineAndTriangle2D
|
||||
// Determines whether there is an intersection between a line defined
|
||||
// by r = p + s.v and a triangle defined by verticies P0, P0+E0 and P0+E1.
|
||||
// Here:
|
||||
// p = 2D vector
|
||||
// s = scaler on [0,infinity)
|
||||
// v = 2D vector
|
||||
// P0, E0 and E1 are 2D vectors
|
||||
// Information about where the intersection occurs is returned in the
|
||||
// variable location.
|
||||
// Information about where the intersection occurs is returned in the
|
||||
// variable location.
|
||||
//
|
||||
// IntersectLineAndLineSegment2D
|
||||
// Determines whether there is an intersection between a line defined
|
||||
// by r = P0 + s.D0 and a line-segment with endpoints P1 and P1+D1.
|
||||
// Here:
|
||||
// IntersectLineAndLineSegment2D
|
||||
// Determines whether there is an intersection between a line defined
|
||||
// by r = P0 + s.D0 and a line-segment with endpoints P1 and P1+D1.
|
||||
// Here:
|
||||
// P0 = 2D vector
|
||||
// s = scaler on [0,infinity)
|
||||
// D0 = 2D vector
|
||||
// P1 and D1 are 2D vectors
|
||||
// Information about where the intersection occurs is returned in the
|
||||
// variable location.
|
||||
// Information about where the intersection occurs is returned in the
|
||||
// variable location.
|
||||
|
||||
// 07 August 2007, P R Truscott, QinetiQ Ltd, UK - Created, with member
|
||||
// functions based on the work of Rickard Holmberg.
|
||||
// 12 October 2012, M Gayer, CERN, - Reviewed optimized implementation.
|
||||
// Author: P.R.Truscott (QinetiQ Ltd, UK), 07.08.2007 - Created, with member
|
||||
// functions based on the work of Rickard Holmberg.
|
||||
// M.Gayer (CERN), 12.10.2012 - Reviewed and optimized implementation.
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4TESSELLATEDGEOMETRYALGORITHMS_HH
|
||||
#define G4TESSELLATEDGEOMETRYALGORITHMS_HH 1
|
||||
#define G4TESSELLATEDGEOMETRYALGORITHMS_HH
|
||||
|
||||
#include "G4TwoVector.hh"
|
||||
|
||||
/**
|
||||
* @brief G4TessellatedGeometryAlgorithms contains standard methods to
|
||||
* determine whether (and if so where) simple geometric shapes intersect.
|
||||
*/
|
||||
|
||||
class G4TessellatedGeometryAlgorithms
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Determines whether there is an intersection between a line defined
|
||||
* by r = p + s.v and a triangle defined by vertices p0, p0+e0 and p0+e1.
|
||||
* @param[in] p Coefficient of line equation.
|
||||
* @param[in] v Coefficient of line equation.
|
||||
* @param[in] p0 First vertex of triangle.
|
||||
* @param[in] e0 Second vertex of triangle.
|
||||
* @param[in] e1 Third vertex of triangle.
|
||||
* @param[out] location The returned location of the intersection.
|
||||
* @returns false if no intersection occours.
|
||||
*/
|
||||
static G4bool IntersectLineAndTriangle2D (const G4TwoVector& p,
|
||||
const G4TwoVector& v,
|
||||
const G4TwoVector& p0,
|
||||
const G4TwoVector& e0,
|
||||
const G4TwoVector& e1,
|
||||
G4TwoVector location[2]);
|
||||
|
||||
/**
|
||||
* Determines whether there is an intersection between a line defined
|
||||
* by r = p0 + s.d0 and a line-segment with endpoints p1 and p1+d1.
|
||||
* @param[in] p0 Coefficient of line equation.
|
||||
* @param[in] d0 Coefficient of line equation.
|
||||
* @param[in] p1 First line-segment end-point..
|
||||
* @param[in] d1 Delta line-segment end-point.
|
||||
* @param[out] location The returned location of the intersection.
|
||||
* @returns false if no intersection occours.
|
||||
*/
|
||||
static G4int IntersectLineAndLineSegment2D (const G4TwoVector& p0,
|
||||
const G4TwoVector& d0,
|
||||
const G4TwoVector& p1,
|
||||
const G4TwoVector& d1,
|
||||
G4TwoVector location[2]);
|
||||
|
||||
/**
|
||||
* Ficticious "cross-product" function for two 2D vectors.
|
||||
* @param[in] v1 First 2D vector.
|
||||
* @param[in] v2 Second 2D vector.
|
||||
* @returns The cross-product of v1 and v2.
|
||||
*/
|
||||
static G4double cross(const G4TwoVector& v1, const G4TwoVector& v2);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user