|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4Trap is a general trapezoid: the faces perpendicular to the Z planes are trapezia, and their centres are not necessarily on a line parallel to the Z axis. A check for planarity is made in the calculation of the equation for each plane. If the planes are not parallel, a call to G4Exception is made. More...
#include <G4Trap.hh>
Protected Member Functions | |
| void | MakePlanes () |
| void | MakePlanes (const G4ThreeVector pt[8]) |
| G4bool | MakePlane (const G4ThreeVector &p1, const G4ThreeVector &p2, const G4ThreeVector &p3, const G4ThreeVector &p4, TrapSidePlane &plane) |
| void | SetCachedValues () |
| Protected Member Functions inherited from G4CSGSolid | |
| G4double | GetRadiusInRing (G4double rmin, G4double rmax) const |
| Protected Member Functions inherited from G4VSolid | |
| void | CalculateClippedPolygonExtent (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
| void | ClipCrossSection (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
| void | ClipBetweenSections (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
| void | ClipPolygon (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const |
Additional Inherited Members | |
| Protected Attributes inherited from G4CSGSolid | |
| G4double | fCubicVolume = 0.0 |
| G4double | fSurfaceArea = 0.0 |
| G4bool | fRebuildPolyhedron = false |
| G4Polyhedron * | fpPolyhedron = nullptr |
| Protected Attributes inherited from G4VSolid | |
| G4double | kCarTolerance |
G4Trap is a general trapezoid: the faces perpendicular to the Z planes are trapezia, and their centres are not necessarily on a line parallel to the Z axis. A check for planarity is made in the calculation of the equation for each plane. If the planes are not parallel, a call to G4Exception is made.
| G4Trap::G4Trap | ( | const G4String & | pName, |
| G4double | pDz, | ||
| G4double | pTheta, | ||
| G4double | pPhi, | ||
| G4double | pDy1, | ||
| G4double | pDx1, | ||
| G4double | pDx2, | ||
| G4double | pAlp1, | ||
| G4double | pDy2, | ||
| G4double | pDx3, | ||
| G4double | pDx4, | ||
| G4double | pAlp2 ) |
The most general constructor for G4Trap which prepares plane equations and corner coordinates from parameters.
| [in] | pName | The name of the solid. |
| [in] | pDz | Half-length along the Z-axis. |
| [in] | pTheta | Polar angle of the line joining the centres of the faces at -/+pDz. |
| [in] | pPhi | Azimuthal angle of the line joining the centre of the face at -pDz to the centre of the face at +pDz. |
| [in] | pDy1 | Half-length along Y of the face at -pDz. |
| [in] | pDx1 | Half-length along X of the side at y=-pDy1 of the face at -pDz. |
| [in] | pDx2 | Half-length along X of the side at y=+pDy1 of the face at -pDz. |
| [in] | pAlp1 | Angle with respect to the Y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of the face at -pDz. |
| [in] | pDy2 | Half-length along Y of the face at +pDz. |
| [in] | pDx3 | Half-length along X of the side at y=-pDy2 of the face at +pDz. |
| [in] | pDx4 | Half-length along X of the side at y=+pDy2 of the face at +pDz. |
| [in] | pAlp2 | Angle with respect to the Y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of the face at +pDz. |
Definition at line 66 of file G4Trap.cc.
Referenced by Clone(), G4Trap(), GetAlpha2(), and operator=().
| G4Trap::G4Trap | ( | const G4String & | pName, |
| const G4ThreeVector | pt[8] ) |
Prepares plane equations and parameters from corner coordinates.
| [in] | pName | The name of the solid. |
| [in] | pt | Points of the 8 vertices. |
Definition at line 92 of file G4Trap.cc.
Constructor for Right Angular Wedge from STEP (assumes pLTX<=pX).
| [in] | pName | The name of the solid. |
| [in] | pZ | Length along Z. |
| [in] | pY | Length along Y. |
| [in] | pX | Length along X at the wider side. |
| [in] | pLTX | Length along X at the narrower side (plTX<=pX). |
Definition at line 151 of file G4Trap.cc.
| G4Trap::G4Trap | ( | const G4String & | pName, |
| G4double | pDx1, | ||
| G4double | pDx2, | ||
| G4double | pDy1, | ||
| G4double | pDy2, | ||
| G4double | pDz ) |
Constructor for G4Trd.
| [in] | pName | The name of the solid. |
| [in] | pDx1 | Half-length along X at the surface positioned at -dz. |
| [in] | pDx2 | Half-length along X at the surface positioned at +dz. |
| [in] | pDy1 | Half-length along Y at the surface positioned at -dz. |
| [in] | pDy2 | Half-length along Y at the surface positioned at +dz. |
| [in] | pDz | Half-length along Z axis. |
Definition at line 169 of file G4Trap.cc.
| G4Trap::G4Trap | ( | const G4String & | pName, |
| G4double | pDx, | ||
| G4double | pDy, | ||
| G4double | pDz, | ||
| G4double | pAlpha, | ||
| G4double | pTheta, | ||
| G4double | pPhi ) |
Constructor for G4Para.
| [in] | pName | The name of the solid. |
| [in] | pDx | Half-length in X. |
| [in] | pDy | Half-length in Y. |
| [in] | pDz | Half-length in Z. |
| [in] | pAlpha | Angle formed by the Y axis and the plane joining the centre of the faces parallel to the Z-X plane at -dy and +dy. |
| [in] | pTheta | Polar angle of the line joining the centres of the faces at -dz and +dz in Z. |
| [in] | pPhi | Azimuthal angle of the line joining the centres of the faces at -dz and +dz in Z. |
Definition at line 187 of file G4Trap.cc.
| G4Trap::G4Trap | ( | const G4String & | pName | ) |
Constructor for "nominal" G4Trap whose parameters are to be set by a G4VPVParamaterisation later on.
| [in] | pName | The name of the solid. |
Definition at line 211 of file G4Trap.cc.
|
overridedefault |
Default destructor.
| G4Trap::G4Trap | ( | __void__ & | a | ) |
Fake default constructor for usage restricted to direct object persistency for clients requiring preallocation of memory for persistifiable objects.
Definition at line 225 of file G4Trap.cc.
| G4Trap::G4Trap | ( | const G4Trap & | rhs | ) |
Copy constructor and assignment operator.
Definition at line 238 of file G4Trap.cc.
|
overridevirtual |
Computes the bounding limits of the solid.
| [out] | pMin | The minimum bounding limit point. |
| [out] | pMax | The maximum bounding limit point. |
Reimplemented from G4VSolid.
Definition at line 498 of file G4Trap.cc.
Referenced by CalculateExtent().
|
overridevirtual |
Calculates the minimum and maximum extent of the solid, when under the specified transform, and within the specified limits.
| [in] | pAxis | The axis along which compute the extent. |
| [in] | pVoxelLimit | The limiting space dictated by voxels. |
| [in] | pTransform | The internal transformation applied to the solid. |
| [out] | pMin | The minimum extent value. |
| [out] | pMax | The maximum extent value. |
Implements G4VSolid.
Definition at line 538 of file G4Trap.cc.
|
overridevirtual |
Makes a clone of the object for use in multi-treading.
Reimplemented from G4VSolid.
Definition at line 1088 of file G4Trap.cc.
|
overridevirtual |
Dispatch method for parameterisation replication mechanism and dimension computation.
Reimplemented from G4VSolid.
Definition at line 487 of file G4Trap.cc.
|
overridevirtual |
Creates a Polyhedron used for Visualisation. It is the caller's responsibility to delete it. A null pointer means "not created".
Reimplemented from G4VSolid.
Definition at line 1248 of file G4Trap.cc.
|
overridevirtual |
|
overridevirtual |
Calculates the distance to the nearest surface of a shape from an outside point. The distance can be an underestimate.
| [in] | p | The point at offset p. |
Implements G4VSolid.
Definition at line 855 of file G4Trap.cc.
|
overridevirtual |
Returns the distance along the normalised vector 'v' to the shape, from the point at offset 'p'. If there is no intersection, returns kInfinity. The first intersection resulting from 'leaving' a surface/volume is discarded. Hence, it is tolerant of points on the surface of the shape.
| [in] | p | The point at offset p. |
| [in] | v | The normalised direction vector. |
Implements G4VSolid.
Definition at line 783 of file G4Trap.cc.
|
overridevirtual |
Calculates the distance to the nearest surface of a shape from an inside point 'p'. The distance can be an underestimate.
| [in] | p | The point at offset p. |
Implements G4VSolid.
Definition at line 999 of file G4Trap.cc.
|
overridevirtual |
Returns the distance along the normalised vector 'v' to the shape, from a point at an offset 'p' inside or on the surface of the shape. Intersections with surfaces, when the point is less than Tolerance/2 from a surface must be ignored.
| [in] | p | The point at offset p. |
| [in] | v | The normalised direction vector. |
| [in] | calcNorm | Flag to indicate if to calculate the normal or not. |
| [out] | validNorm | Flag set to true if the solid lies entirely behind or on the exiting surface. It is set false if the solid does not lie entirely behind or on the exiting surface. 'calcNorm' must be true, otherwise it is unused. |
| [out] | n | The exiting outwards normal vector (undefined Magnitude). 'calcNorm' must be true, otherwise it is unused. |
Implements G4VSolid.
Definition at line 912 of file G4Trap.cc.
|
inline |
Referenced by StreamInfo().
|
inline |
Referenced by StreamInfo().
|
overridevirtual |
Returning an estimation of the solid volume (capacity) and surface area, in internal units.
Reimplemented from G4VSolid.
Definition at line 1190 of file G4Trap.cc.
|
overridevirtual |
|
inline |
Accessors obtaining (re)computed values of the original parameters.
Referenced by StreamInfo().
|
overridevirtual |
Returns a random point located and uniformly distributed on the surface of the solid.
Reimplemented from G4VSolid.
Definition at line 1149 of file G4Trap.cc.
|
inline |
More accessors.
|
overridevirtual |
Returns an estimation of the solid surface area in internal units. This method may be overloaded by derived classes to compute the exact geometrical quantity for solids where this is possible, or anyway to cache the computed value. Note: the computed value is NOT cached.
Reimplemented from G4VSolid.
Definition at line 1217 of file G4Trap.cc.
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by StreamInfo().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Accessors. Returning the coordinates of a unit vector along a straight line joining centers of -/+fDz planes.
Referenced by BoundingLimits(), G4tgbGeometryDumper::GetSolidParams(), G4GDMLWriteParamvol::Trap_dimensionsWrite(), and G4GDMLWriteSolids::TrapWrite().
|
overridevirtual |
Concrete implementations of the expected query interfaces for solids, as defined in the base class G4VSolid.
Implements G4VSolid.
Definition at line 587 of file G4Trap.cc.
Referenced by DistanceToOut().
|
overridevirtual |
|
protected |
Calculates the coefficents of the plane p1->p2->p3->p4->p1 where the ThreeVectors 1-4 are in anti-clockwise order when viewed from infront of the plane (i.e. from normal direction).
Definition at line 400 of file G4Trap.cc.
Referenced by MakePlanes().
|
protected |
Internal methods for checking and building planes. Computing the vertices and setting side planes, checking for planarity.
Definition at line 333 of file G4Trap.cc.
Referenced by G4Trap(), G4Trap(), G4Trap(), G4Trap(), G4Trap(), G4Trap(), G4Trap(), MakePlanes(), and SetAllParameters().
|
protected |
Definition at line 359 of file G4Trap.cc.
Definition at line 253 of file G4Trap.cc.
| void G4Trap::SetAllParameters | ( | G4double | pDz, |
| G4double | pTheta, | ||
| G4double | pPhi, | ||
| G4double | pDy1, | ||
| G4double | pDx1, | ||
| G4double | pDx2, | ||
| G4double | pAlp1, | ||
| G4double | pDy2, | ||
| G4double | pDx3, | ||
| G4double | pDx4, | ||
| G4double | pAlp2 ) |
Sets all parameters, as for constructor. Checks and sets half-widths as well as angles. Makes a final check of co-planarity.
Definition at line 280 of file G4Trap.cc.
Referenced by G4ParameterisationTrdX::ComputeDimensions(), and G4ParameterisationTrdY::ComputeDimensions().
|
protected |
Recomputes parameters using planes.
Definition at line 432 of file G4Trap.cc.
Referenced by MakePlanes().
|
overridevirtual |
Streams the object contents to an output stream.
Reimplemented from G4CSGSolid.
Definition at line 1097 of file G4Trap.cc.
Referenced by MakePlanes().
|
overridevirtual |
Returns the outwards pointing unit normal of the shape for the surface closest to the point at offset 'p'.
| [in] | p | The point at offset p. |
Implements G4VSolid.
Definition at line 650 of file G4Trap.cc.