Import Geant4 10.6.0.beta source tree
This commit is contained in:
@@ -16,21 +16,45 @@ committal in the source repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
15-February-2019 E.Tcherniaev (geom-specific-V10-04-16)
|
||||
11-June-2019 E.Tcherniaev (geom-specific-V10-05-10)
|
||||
- Use GetVertices() instead of GetParametersList() in the wrapper G4UTet.
|
||||
|
||||
29-May-2019 G.Cosmo (geom-specific-V10-05-09)
|
||||
- Fixed minor Coverity defects.
|
||||
|
||||
20-May-2019 G.Cosmo (geom-specific-V10-05-08)
|
||||
- Defined move constructor and move assignment operator for G4TriangularFacet.
|
||||
|
||||
14-May-2019 B.Morgan (geom-specific-V10-05-07)
|
||||
- Add inclusion of new G4GeomTypes.hh header to those headers allowing
|
||||
VecGeom replacement.
|
||||
- See also geommng-10-05-05
|
||||
|
||||
23-April-2019 G.Cosmo (geom-specific-V10-05-06)
|
||||
- Modified G4PolyconeSide and G4PolyhedraSide to use only trivial types for
|
||||
MT splitted data in G4PlSideData and G4PhSideData respectively.
|
||||
|
||||
16-April-2019 G.Cosmo (geom-specific-V10-05-05)
|
||||
- Protected check in G4TwistTubsSide::DistanceToPlane() withing debug flag.
|
||||
|
||||
4-April-2019 G.Cosmo (geom-specific-V10-05-04)
|
||||
- Enabled wrapper for VecGeom implementation of G4GenericPolycone.
|
||||
|
||||
15-February-2019 E.Tcherniaev (geom-specific-V10-05-03)
|
||||
- Accurate calculation of radical in G4IntersectingCone.
|
||||
It addresses the problem report #2111.
|
||||
|
||||
4-February-2019 G.Cosmo
|
||||
4-February-2019 G.Cosmo (geom-specific-V10-05-02)
|
||||
- Fix in G4EllipticalTube::CheckParameters() for typo in condition.
|
||||
|
||||
30-January-2019 G.Cosmo
|
||||
30-January-2019 G.Cosmo (geom-specific-V10-05-01)
|
||||
- Disabled precise computation of extent and use simple bounding-box
|
||||
in CalculateExtent() for G4Tet and G4TessellatedSolid, to speed up
|
||||
intialisation in setups with relatively complex meshes.
|
||||
- Apply bounding-box calculation for extent also for corresponding
|
||||
VecGeom wrappers.
|
||||
|
||||
24-January-2019 E.Tcherniaev
|
||||
24-January-2019 E.Tcherniaev (geom-specific-V10-05-00)
|
||||
- Completely revised, more robust and performant G4EllipticalTube;
|
||||
new exhaustive test/testEllipticalTube.cc based on Shape Conventions.
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
// Parameters in the constructor:
|
||||
// const G4String& pName - solid name
|
||||
// std::vector<G4TwoVector> polygon - the vertices of the outlined polygon
|
||||
// defined in clockwise or anti-clockwise order
|
||||
// defined in clockwise or anti-clockwise order
|
||||
// std::vector<ZSection> - the z-sections defined by
|
||||
// z position, offset and scale
|
||||
// in increasing z-position order
|
||||
@@ -62,6 +62,8 @@
|
||||
#ifndef G4ExtrudedSolid_HH
|
||||
#define G4ExtrudedSolid_HH
|
||||
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UEXTRUDEDSOLID 1
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
@@ -35,21 +35,23 @@
|
||||
// Class description:
|
||||
//
|
||||
// Class implementing a GenericPolycone constructed by points with
|
||||
// (r,z)coordinates, allows Z 'go back'
|
||||
// (r,z)coordinates, allows Z 'go back'
|
||||
//
|
||||
//
|
||||
// G4GenericPolycone( const G4String& name,
|
||||
// G4GenericPolycone( const G4String& name,
|
||||
// G4double phiStart, // initial phi starting angle
|
||||
// G4double phiTotal, // total phi angle
|
||||
// G4int numRZ, // number corners in r,z space
|
||||
// const G4double r[], // r coordinate of these corners
|
||||
// const G4double z[]) // z coordinate of these corners
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4GenericPolycone_hh
|
||||
#define G4GenericPolycone_hh
|
||||
/*
|
||||
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UGENERICPOLYCONE 1
|
||||
#endif
|
||||
@@ -58,7 +60,7 @@
|
||||
#define G4UGenericPolycone G4GenericPolycone
|
||||
#include "G4UGenericPolycone.hh"
|
||||
#else
|
||||
*/
|
||||
|
||||
#include "G4VCSGfaceted.hh"
|
||||
#include "G4PolyconeSide.hh"
|
||||
|
||||
@@ -66,12 +68,12 @@ class G4EnclosingCylinder;
|
||||
class G4ReduciblePolygon;
|
||||
class G4VCSGface;
|
||||
|
||||
class G4GenericPolycone : public G4VCSGfaceted
|
||||
class G4GenericPolycone : public G4VCSGfaceted
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4GenericPolycone( const G4String& name,
|
||||
G4GenericPolycone( const G4String& name,
|
||||
G4double phiStart, // initial phi starting angle
|
||||
G4double phiTotal, // total phi angle
|
||||
G4int numRZ, // number corners in r,z space
|
||||
@@ -79,7 +81,7 @@ class G4GenericPolycone : public G4VCSGfaceted
|
||||
const G4double z[] ); // z coordinate of these corners
|
||||
|
||||
virtual ~G4GenericPolycone();
|
||||
|
||||
|
||||
// Methods for solid
|
||||
|
||||
EInside Inside( const G4ThreeVector &p ) const;
|
||||
@@ -115,7 +117,7 @@ class G4GenericPolycone : public G4VCSGfaceted
|
||||
inline G4bool IsOpen() const;
|
||||
inline G4int GetNumRZCorner() const;
|
||||
inline G4PolyconeSideRZ GetCorner(G4int index) const;
|
||||
|
||||
|
||||
public: // without description
|
||||
|
||||
G4GenericPolycone(__void__&);
|
||||
@@ -131,8 +133,6 @@ class G4GenericPolycone : public G4VCSGfaceted
|
||||
|
||||
// Generic initializer, called by all constructors
|
||||
|
||||
// void SetOriginalParameters(G4ReduciblePolygon *rz);
|
||||
|
||||
void Create( G4double phiStart, // initial phi starting angle
|
||||
G4double phiTotal, // total phi angle
|
||||
G4ReduciblePolygon *rz ); // r/z coordinate of these corners
|
||||
@@ -150,15 +150,15 @@ class G4GenericPolycone : public G4VCSGfaceted
|
||||
G4bool phiIsOpen; // true if there is a phi segment
|
||||
G4int numCorner; // number RZ points
|
||||
G4PolyconeSideRZ *corners; // corner r,z points
|
||||
|
||||
|
||||
// Our quick test
|
||||
|
||||
G4EnclosingCylinder *enclosingCylinder;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#include "G4GenericPolycone.icc"
|
||||
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
@@ -34,14 +34,14 @@
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// G4GenericTrap is a solid which represents an arbitrary trapezoid with
|
||||
// G4GenericTrap is a solid which represents an arbitrary trapezoid with
|
||||
// up to 8 vertices standing on two parallel planes perpendicular to Z axis.
|
||||
//
|
||||
//
|
||||
// Parameters in the constructor:
|
||||
// - name - solid name
|
||||
// - halfZ - the solid half length in Z
|
||||
// - vertices - the (x,y) coordinates of vertices:
|
||||
// o first four points: vertices[i], i<4
|
||||
// o first four points: vertices[i], i<4
|
||||
// are the vertices sitting on the -halfZ plane;
|
||||
// o last four points: vertices[i], i>=4
|
||||
// are the vertices sitting on the +halfZ plane.
|
||||
@@ -66,6 +66,8 @@
|
||||
#ifndef G4GenericTrap_HH
|
||||
#define G4GenericTrap_HH
|
||||
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UGENERICTRAP 1
|
||||
#endif
|
||||
@@ -106,7 +108,7 @@ class G4GenericTrap : public G4VSolid
|
||||
inline G4int GetVisSubdivisions() const;
|
||||
inline void SetVisSubdivisions(G4int subdiv);
|
||||
|
||||
// Solid methods
|
||||
// Solid methods
|
||||
|
||||
EInside Inside(const G4ThreeVector& p) const;
|
||||
G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const;
|
||||
@@ -137,12 +139,12 @@ class G4GenericTrap : public G4VSolid
|
||||
G4double GetSurfaceArea();
|
||||
|
||||
// Visualisation functions
|
||||
|
||||
|
||||
G4Polyhedron* GetPolyhedron () const;
|
||||
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
|
||||
G4VisExtent GetExtent() const;
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
|
||||
|
||||
public: // without description
|
||||
|
||||
G4GenericTrap(__void__&);
|
||||
@@ -151,7 +153,7 @@ class G4GenericTrap : public G4VSolid
|
||||
// persistifiable objects.
|
||||
|
||||
G4GenericTrap(const G4GenericTrap& rhs);
|
||||
G4GenericTrap& operator=(const G4GenericTrap& rhs);
|
||||
G4GenericTrap& operator=(const G4GenericTrap& rhs);
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
@@ -161,25 +163,25 @@ class G4GenericTrap : public G4VSolid
|
||||
inline void SetTwistAngle(G4int index, G4double twist);
|
||||
G4bool ComputeIsTwisted() ;
|
||||
G4bool CheckOrder(const std::vector<G4TwoVector>& vertices) const;
|
||||
G4bool IsSegCrossing(const G4TwoVector& a, const G4TwoVector& b,
|
||||
G4bool IsSegCrossing(const G4TwoVector& a, const G4TwoVector& b,
|
||||
const G4TwoVector& c, const G4TwoVector& d) const;
|
||||
G4bool IsSegCrossingZ(const G4TwoVector& a, const G4TwoVector& b,
|
||||
G4bool IsSegCrossingZ(const G4TwoVector& a, const G4TwoVector& b,
|
||||
const G4TwoVector& c, const G4TwoVector& d) const;
|
||||
void ReorderVertices(std::vector<G4ThreeVector>& vertices) const;
|
||||
void ComputeBBox();
|
||||
inline G4ThreeVector GetMinimumBBox() const;
|
||||
inline G4ThreeVector GetMaximumBBox() const;
|
||||
|
||||
G4VFacet* MakeDownFacet(const std::vector<G4ThreeVector>& fromVertices,
|
||||
|
||||
G4VFacet* MakeDownFacet(const std::vector<G4ThreeVector>& fromVertices,
|
||||
G4int ind1, G4int ind2, G4int ind3) const;
|
||||
G4VFacet* MakeUpFacet(const std::vector<G4ThreeVector>& fromVertices,
|
||||
G4int ind1, G4int ind2, G4int ind3) const;
|
||||
G4VFacet* MakeSideFacet(const G4ThreeVector& downVertex0,
|
||||
G4VFacet* MakeUpFacet(const std::vector<G4ThreeVector>& fromVertices,
|
||||
G4int ind1, G4int ind2, G4int ind3) const;
|
||||
G4VFacet* MakeSideFacet(const G4ThreeVector& downVertex0,
|
||||
const G4ThreeVector& downVertex1,
|
||||
const G4ThreeVector& upVertex1,
|
||||
const G4ThreeVector& upVertex0) const;
|
||||
G4TessellatedSolid* CreateTessellatedSolid() const;
|
||||
|
||||
|
||||
EInside InsidePolygone(const G4ThreeVector& p,
|
||||
const std::vector<G4TwoVector>& poly) const;
|
||||
G4double DistToPlane(const G4ThreeVector& p,
|
||||
@@ -228,7 +230,7 @@ class G4GenericTrap : public G4VSolid
|
||||
G4double fSurfaceArea;
|
||||
G4double fCubicVolume;
|
||||
// Surface and Volume
|
||||
};
|
||||
};
|
||||
|
||||
#include "G4GenericTrap.icc"
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
//
|
||||
// $Original: G4Hype.hh,v 1.0 1998/06/09 16:57:50 safai Exp $
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
@@ -41,13 +41,13 @@
|
||||
// the z-axis. The solid has a specified half-length along the z axis,
|
||||
// about which it is centered, and a given minimum and maximum radius.
|
||||
// A minimum radius of 0 signifies a filled Hype (with hyperbolical
|
||||
// inner surface). To have a filled Hype the user must specify
|
||||
// inner surface). To have a filled Hype the user must specify
|
||||
// inner radius = 0 AND inner stereo angle = 0.
|
||||
//
|
||||
//
|
||||
// The inner and outer hyperbolical surfaces can have different
|
||||
// stereo angles. A stereo angle of 0 gives a cylindrical surface.
|
||||
|
||||
// Authors:
|
||||
// Authors:
|
||||
// Ernesto Lamanna (Ernesto.Lamanna@roma1.infn.it) &
|
||||
// Francesco Safai Tehrani (Francesco.SafaiTehrani@roma1.infn.it)
|
||||
// Rome, INFN & University of Rome "La Sapienza", 9 June 1998.
|
||||
@@ -56,6 +56,8 @@
|
||||
#ifndef G4HYPE_HH
|
||||
#define G4HYPE_HH
|
||||
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UHYPE 1
|
||||
#endif
|
||||
@@ -84,7 +86,7 @@ class G4Hype : public G4VSolid
|
||||
G4double newHalfLenZ);
|
||||
|
||||
virtual ~G4Hype();
|
||||
|
||||
|
||||
void ComputeDimensions(G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
const G4VPhysicalVolume* pRep);
|
||||
@@ -124,7 +126,7 @@ class G4Hype : public G4VSolid
|
||||
G4VSolid* Clone() const;
|
||||
|
||||
std::ostream& StreamInfo(std::ostream& os) const;
|
||||
|
||||
|
||||
G4double GetCubicVolume();
|
||||
G4double GetSurfaceArea();
|
||||
|
||||
@@ -143,11 +145,11 @@ class G4Hype : public G4VSolid
|
||||
// persistifiable objects.
|
||||
|
||||
G4Hype(const G4Hype& rhs);
|
||||
G4Hype& operator=(const G4Hype& rhs);
|
||||
G4Hype& operator=(const G4Hype& rhs);
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
protected: // without description
|
||||
|
||||
|
||||
inline G4bool InnerSurfaceExists() const;
|
||||
// whether we have an inner surface or not
|
||||
|
||||
@@ -155,13 +157,13 @@ class G4Hype : public G4VSolid
|
||||
G4double r0, G4double tanPhi );
|
||||
static G4double ApproxDistInside( G4double pr, G4double pz,
|
||||
G4double r0, G4double tan2Phi );
|
||||
// approximate isotropic distance to hyperbolic surface
|
||||
// approximate isotropic distance to hyperbolic surface
|
||||
|
||||
inline G4double HypeInnerRadius2(G4double zVal) const;
|
||||
inline G4double HypeOuterRadius2(G4double zVal) const;
|
||||
// values of hype radius at a given Z
|
||||
|
||||
static G4int IntersectHype( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
static G4int IntersectHype( const G4ThreeVector &p, const G4ThreeVector &v,
|
||||
G4double r2, G4double tan2Phi, G4double s[2] );
|
||||
// intersection with hyperbolic surface
|
||||
|
||||
@@ -185,7 +187,7 @@ class G4Hype : public G4VSolid
|
||||
G4double endOuterRadius2; // squared endcap Outer Radius
|
||||
G4double endInnerRadius; // endcap Inner Radius
|
||||
G4double endOuterRadius; // endcap Outer Radius
|
||||
|
||||
|
||||
// Used by distanceToOut
|
||||
|
||||
enum ESide {outerFace,innerFace,leftCap, rightCap};
|
||||
@@ -195,7 +197,7 @@ class G4Hype : public G4VSolid
|
||||
G4double asinh(G4double arg);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
G4double fCubicVolume;
|
||||
G4double fSurfaceArea;
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
#ifndef G4Paraboloid_HH
|
||||
#define G4Paraboloid_HH
|
||||
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UPARABOLOID 1
|
||||
#endif
|
||||
@@ -142,11 +144,11 @@ class G4Paraboloid : public G4VSolid
|
||||
// persistifiable objects.
|
||||
|
||||
G4Paraboloid(const G4Paraboloid& rhs);
|
||||
G4Paraboloid& operator=(const G4Paraboloid& rhs);
|
||||
G4Paraboloid& operator=(const G4Paraboloid& rhs);
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
protected: // without description
|
||||
|
||||
|
||||
mutable G4bool fRebuildPolyhedron;
|
||||
mutable G4Polyhedron* fpPolyhedron;
|
||||
|
||||
@@ -158,7 +160,7 @@ class G4Paraboloid : public G4VSolid
|
||||
G4double fCubicVolume;
|
||||
|
||||
G4double dz, r1, r2;
|
||||
G4double k1, k2;
|
||||
G4double k1, k2;
|
||||
// Defined to make some calculations easier to follow
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
@@ -37,7 +37,7 @@
|
||||
// Class implementing a CSG-like type "PCON" Geant 3.21 volume,
|
||||
// inherited from class G4VCSGfaceted:
|
||||
//
|
||||
// G4Polycone( const G4String& name,
|
||||
// G4Polycone( const G4String& name,
|
||||
// G4double phiStart, // initial phi starting angle
|
||||
// G4double phiTotal, // total phi angle
|
||||
// G4int numZPlanes, // number of z planes
|
||||
@@ -47,19 +47,21 @@
|
||||
//
|
||||
// Alternative constructor, but limited to increasing-only Z sections:
|
||||
//
|
||||
// G4Polycone( const G4String& name,
|
||||
// G4Polycone( const G4String& name,
|
||||
// G4double phiStart, // initial phi starting angle
|
||||
// G4double phiTotal, // total phi angle
|
||||
// G4int numRZ, // number corners in r,z space
|
||||
// const G4double r[], // r coordinate of these corners
|
||||
// const G4double z[]) // z coordinate of these corners
|
||||
|
||||
// Author:
|
||||
// Author:
|
||||
// David C. Williams (davidw@scipp.ucsc.edu)
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4Polycone_hh
|
||||
#define G4Polycone_hh
|
||||
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UPOLYCONE 1
|
||||
#endif
|
||||
@@ -78,12 +80,12 @@ class G4EnclosingCylinder;
|
||||
class G4ReduciblePolygon;
|
||||
class G4VCSGface;
|
||||
|
||||
class G4Polycone : public G4VCSGfaceted
|
||||
class G4Polycone : public G4VCSGfaceted
|
||||
{
|
||||
|
||||
public: // with description
|
||||
|
||||
G4Polycone( const G4String& name,
|
||||
G4Polycone( const G4String& name,
|
||||
G4double phiStart, // initial phi starting angle
|
||||
G4double phiTotal, // total phi angle
|
||||
G4int numZPlanes, // number of z planes
|
||||
@@ -91,7 +93,7 @@ class G4Polycone : public G4VCSGfaceted
|
||||
const G4double rInner[], // tangent distance to inner surface
|
||||
const G4double rOuter[] ); // tangent distance to outer surface
|
||||
|
||||
G4Polycone( const G4String& name,
|
||||
G4Polycone( const G4String& name,
|
||||
G4double phiStart, // initial phi starting angle
|
||||
G4double phiTotal, // total phi angle
|
||||
G4int numRZ, // number corners in r,z space
|
||||
@@ -99,7 +101,7 @@ class G4Polycone : public G4VCSGfaceted
|
||||
const G4double z[] ); // z coordinate of these corners
|
||||
|
||||
virtual ~G4Polycone();
|
||||
|
||||
|
||||
// Methods for solid
|
||||
|
||||
EInside Inside( const G4ThreeVector &p ) const;
|
||||
@@ -171,11 +173,11 @@ class G4Polycone : public G4VCSGfaceted
|
||||
G4double fRmin2, G4double fRmax2,
|
||||
G4double zOne, G4double zTwo,
|
||||
G4double& totArea) const;
|
||||
|
||||
|
||||
G4ThreeVector GetPointOnTubs(G4double fRMin, G4double fRMax,
|
||||
G4double zOne, G4double zTwo,
|
||||
G4double& totArea) const;
|
||||
|
||||
|
||||
G4ThreeVector GetPointOnCut(G4double fRMin1, G4double fRMax1,
|
||||
G4double fRMin2, G4double fRMax2,
|
||||
G4double zOne, G4double zTwo,
|
||||
@@ -199,7 +201,7 @@ class G4Polycone : public G4VCSGfaceted
|
||||
// Our quick test
|
||||
|
||||
G4EnclosingCylinder *enclosingCylinder;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#include "G4Polycone.icc"
|
||||
|
||||
@@ -77,11 +77,10 @@ class G4PlSideData
|
||||
|
||||
void initialize()
|
||||
{
|
||||
fPhi.first = G4ThreeVector(0,0,0);
|
||||
fPhi.second= 0.0;
|
||||
fPhix = 0.; fPhiy = 0.; fPhiz = 0.; fPhik = 0.;
|
||||
}
|
||||
|
||||
std::pair<G4ThreeVector, G4double> fPhi; // Cached value for phi
|
||||
G4double fPhix=0., fPhiy=0., fPhiz=0., fPhik=0.; // Cached values for phi
|
||||
};
|
||||
|
||||
// The type G4PlSideManager is introduced to
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
@@ -37,7 +37,7 @@
|
||||
// Class implementing a CSG-like type "PGON" Geant 3.21 volume,
|
||||
// inherited from class G4VCSGfaceted:
|
||||
//
|
||||
// G4Polyhedra( const G4String& name,
|
||||
// G4Polyhedra( const G4String& name,
|
||||
// G4double phiStart, - initial phi starting angle
|
||||
// G4double phiTotal, - total phi angle
|
||||
// G4int numSide, - number sides
|
||||
@@ -46,7 +46,7 @@
|
||||
// const G4double rInner[], - tangent distance to inner surface
|
||||
// const G4double rOuter[] ) - tangent distance to outer surface
|
||||
//
|
||||
// G4Polyhedra( const G4String& name,
|
||||
// G4Polyhedra( const G4String& name,
|
||||
// G4double phiStart, - initial phi starting angle
|
||||
// G4double phiTotal, - total phi angle
|
||||
// G4int numSide, - number sides
|
||||
@@ -54,12 +54,14 @@
|
||||
// const G4double r[], - r coordinate of these corners
|
||||
// const G4double z[] ) - z coordinate of these corners
|
||||
|
||||
// Author:
|
||||
// Author:
|
||||
// David C. Williams (davidw@scipp.ucsc.edu)
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4Polyhedra_hh
|
||||
#define G4Polyhedra_hh
|
||||
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UPOLYHEDRA 1
|
||||
#endif
|
||||
@@ -81,7 +83,7 @@ class G4Polyhedra : public G4VCSGfaceted
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4Polyhedra( const G4String& name,
|
||||
G4Polyhedra( const G4String& name,
|
||||
G4double phiStart, // initial phi starting angle
|
||||
G4double phiTotal, // total phi angle
|
||||
G4int numSide, // number sides
|
||||
@@ -90,7 +92,7 @@ class G4Polyhedra : public G4VCSGfaceted
|
||||
const G4double rInner[], // tangent distance to inner surface
|
||||
const G4double rOuter[] ); // tangent distance to outer surface
|
||||
|
||||
G4Polyhedra( const G4String& name,
|
||||
G4Polyhedra( const G4String& name,
|
||||
G4double phiStart, // initial phi starting angle
|
||||
G4double phiTotal, // total phi angle
|
||||
G4int numSide, // number sides
|
||||
@@ -106,7 +108,7 @@ class G4Polyhedra : public G4VCSGfaceted
|
||||
G4double DistanceToIn( const G4ThreeVector &p,
|
||||
const G4ThreeVector &v ) const;
|
||||
G4double DistanceToIn( const G4ThreeVector &p ) const;
|
||||
|
||||
|
||||
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
|
||||
G4bool CalculateExtent(const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
|
||||
@@ -75,14 +75,13 @@ struct G4PolyhedraSideRZ
|
||||
class G4PhSideData
|
||||
{
|
||||
public:
|
||||
|
||||
void initialize()
|
||||
{
|
||||
fPhi.first = G4ThreeVector(0,0,0);
|
||||
fPhi.second= 0.0;
|
||||
fPhix = 0.; fPhiy = 0.; fPhiz = 0.; fPhik = 0.;
|
||||
}
|
||||
|
||||
std::pair<G4ThreeVector, G4double> fPhi; // Cached value for phi
|
||||
|
||||
G4double fPhix=0., fPhiy=0., fPhiz=0., fPhik=0.; // Cached values for phi
|
||||
};
|
||||
|
||||
// The type G4PhSideManager is introduced to encapsulate the methods used
|
||||
|
||||
@@ -31,20 +31,20 @@
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// G4TessellatedSolid is a special Geant4 solid defined by a number of
|
||||
// G4TessellatedSolid is a special Geant4 solid defined by a number of
|
||||
// facets (UVFacet). It is important that the supplied facets shall form a
|
||||
// fully enclose space which is the solid.
|
||||
// At the moment only two types of facet can be used for the construction of
|
||||
// fully enclose space which is the solid.
|
||||
// At the moment only two types of facet can be used for the construction of
|
||||
// a G4TessellatedSolid, i.e. the G4TriangularFacet and G4QuadrangularFacet.
|
||||
//
|
||||
// How to contruct a G4TessellatedSolid:
|
||||
//
|
||||
//
|
||||
// First declare a tessellated solid:
|
||||
//
|
||||
// G4TessellatedSolid* solidTarget = new G4TessellatedSolid("Solid_name");
|
||||
//
|
||||
// Define the facets which form the solid
|
||||
//
|
||||
//
|
||||
// G4double targetSiz = 10*cm ;
|
||||
// G4TriangularFacet *facet1 = new
|
||||
// G4TriangularFacet (G4ThreeVector(-targetSize,-targetSize, 0.0),
|
||||
@@ -73,7 +73,7 @@
|
||||
// G4ThreeVector(+targetSize,-targetSize, 0.0),
|
||||
// ABSOLUTE);
|
||||
//
|
||||
// Then add the facets to the solid:
|
||||
// Then add the facets to the solid:
|
||||
//
|
||||
// solidTarget->AddFacet((UVFacet*) facet1);
|
||||
// solidTarget->AddFacet((UVFacet*) facet2);
|
||||
@@ -89,7 +89,7 @@
|
||||
// --------------
|
||||
// 31 October 2004, P R Truscott, QinetiQ Ltd, UK
|
||||
// - Created.
|
||||
// 22 November 2005, F Lei,
|
||||
// 22 November 2005, F Lei,
|
||||
// - Added GetPolyhedron().
|
||||
// 12 October 2012, M Gayer,
|
||||
// - Reviewed optimized implementation including voxelization of surfaces.
|
||||
@@ -98,6 +98,8 @@
|
||||
#ifndef G4TessellatedSolid_hh
|
||||
#define G4TessellatedSolid_hh 1
|
||||
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UTESSELLATEDSOLID 1
|
||||
#endif
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
#ifndef G4TET_HH
|
||||
#define G4TET_HH
|
||||
/*
|
||||
#include "G4GeomTypes.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
#define G4GEOM_USE_UTET 1
|
||||
#endif
|
||||
@@ -67,11 +69,11 @@ class G4Tet : public G4VSolid
|
||||
|
||||
public: // with description
|
||||
|
||||
G4Tet(const G4String& pName,
|
||||
G4Tet(const G4String& pName,
|
||||
G4ThreeVector anchor,
|
||||
G4ThreeVector p2,
|
||||
G4ThreeVector p3,
|
||||
G4ThreeVector p4,
|
||||
G4ThreeVector p4,
|
||||
G4bool *degeneracyFlag=0);
|
||||
|
||||
virtual ~G4Tet();
|
||||
@@ -128,7 +130,7 @@ class G4Tet : public G4VSolid
|
||||
// persistifiable objects.
|
||||
|
||||
G4Tet(const G4Tet& rhs);
|
||||
G4Tet& operator=(const G4Tet& rhs);
|
||||
G4Tet& operator=(const G4Tet& rhs);
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
const char* CVSHeaderVers()
|
||||
@@ -151,7 +153,7 @@ class G4Tet : public G4VSolid
|
||||
mutable G4bool fRebuildPolyhedron;
|
||||
mutable G4Polyhedron* fpPolyhedron;
|
||||
|
||||
G4ThreeVector GetPointOnFace(G4ThreeVector p1, G4ThreeVector p2,
|
||||
G4ThreeVector GetPointOnFace(G4ThreeVector p1, G4ThreeVector p2,
|
||||
G4ThreeVector p3, G4double& area) const;
|
||||
static const char CVSVers[];
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@
|
||||
#include "G4Types.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
||||
class G4TriangularFacet : public G4VFacet
|
||||
{
|
||||
public: // with desctiption
|
||||
@@ -71,8 +74,10 @@ class G4TriangularFacet : public G4VFacet
|
||||
G4TriangularFacet (const G4ThreeVector &vt0, const G4ThreeVector &vt1,
|
||||
const G4ThreeVector &vt2, G4FacetVertexType);
|
||||
G4TriangularFacet (const G4TriangularFacet &right);
|
||||
G4TriangularFacet ( G4TriangularFacet &&right);
|
||||
|
||||
G4TriangularFacet &operator=(const G4TriangularFacet &right);
|
||||
G4TriangularFacet &operator=( G4TriangularFacet &&right);
|
||||
|
||||
G4VFacet *GetClone ();
|
||||
G4TriangularFacet *GetFlippedFacet ();
|
||||
@@ -110,13 +115,13 @@ class G4TriangularFacet : public G4VFacet
|
||||
private:
|
||||
|
||||
void CopyFrom(const G4TriangularFacet &rhs);
|
||||
void MoveFrom(G4TriangularFacet &rhs);
|
||||
|
||||
G4ThreeVector fSurfaceNormal;
|
||||
G4double fArea;
|
||||
G4ThreeVector fCircumcentre;
|
||||
G4double fRadius;
|
||||
G4int fIndices[3];
|
||||
|
||||
std::array<G4int, 3> fIndices;
|
||||
std::vector<G4ThreeVector> *fVertices;
|
||||
|
||||
G4double fA, fB, fC;
|
||||
|
||||
@@ -42,15 +42,20 @@
|
||||
#ifndef G4UGENERICPOLYCONE_hh
|
||||
#define G4UGENERICPOLYCONE_hh
|
||||
|
||||
#include "G4USolid.hh"
|
||||
#include "G4UAdapter.hh"
|
||||
|
||||
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
|
||||
|
||||
#include "UGenericPolycone.hh"
|
||||
#include <volumes/UnplacedGenericPolycone.h>
|
||||
|
||||
#include "G4TwoVector.hh"
|
||||
#include "G4PolyconeSide.hh"
|
||||
|
||||
class G4UGenericPolycone : public G4USolid
|
||||
class G4UGenericPolycone : public G4UAdapter<vecgeom::UnplacedGenericPolycone>
|
||||
{
|
||||
using Shape_t = vecgeom::UnplacedGenericPolycone;
|
||||
using Base_t = G4UAdapter<vecgeom::UnplacedGenericPolycone>;
|
||||
|
||||
public: // with description
|
||||
|
||||
G4UGenericPolycone(const G4String& name,
|
||||
@@ -62,8 +67,6 @@ class G4UGenericPolycone : public G4USolid
|
||||
|
||||
~G4UGenericPolycone();
|
||||
|
||||
inline UGenericPolycone* GetShape() const;
|
||||
|
||||
G4double GetStartPhi() const;
|
||||
G4double GetEndPhi() const;
|
||||
G4double GetSinStartPhi() const;
|
||||
@@ -76,6 +79,8 @@ class G4UGenericPolycone : public G4USolid
|
||||
|
||||
inline G4GeometryType GetEntityType() const;
|
||||
|
||||
G4VSolid* Clone() const;
|
||||
|
||||
public: // without description
|
||||
|
||||
G4UGenericPolycone(__void__&);
|
||||
@@ -95,17 +100,18 @@ class G4UGenericPolycone : public G4USolid
|
||||
G4double& pMin, G4double& pMax) const;
|
||||
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
|
||||
private:
|
||||
|
||||
G4double wrStart;
|
||||
G4double wrDelta;
|
||||
std::vector<G4TwoVector> rzcorners;
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// Inline methods
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
inline UGenericPolycone* G4UGenericPolycone::GetShape() const
|
||||
{
|
||||
return (UGenericPolycone*) fShape;
|
||||
}
|
||||
|
||||
inline G4GeometryType G4UGenericPolycone::GetEntityType() const
|
||||
{
|
||||
return "G4GenericPolycone";
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
#include "G4GenericPolycone.hh"
|
||||
|
||||
//#if !defined(G4GEOM_USE_UGENERICPOLYCONE)
|
||||
#if !defined(G4GEOM_USE_UGENERICPOLYCONE)
|
||||
|
||||
#include "G4PolyconeSide.hh"
|
||||
#include "G4PolyPhiFace.hh"
|
||||
@@ -595,16 +595,7 @@ G4GenericPolycone::CalculateExtent(const EAxis pAxis,
|
||||
return (pMin < pMax);
|
||||
}
|
||||
|
||||
//
|
||||
// ComputeDimensions
|
||||
//
|
||||
/*void G4GenericPolycone::ComputeDimensions( G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
const G4VPhysicalVolume* pRep )
|
||||
{
|
||||
p->ComputeDimensions(*this,n,pRep);
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// GetEntityType
|
||||
//
|
||||
@@ -945,4 +936,4 @@ G4Polyhedron* G4GenericPolycone::CreatePolyhedron() const
|
||||
}
|
||||
}
|
||||
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,10 @@ G4PlSideManager G4PolyconeSide::subInstanceManager;
|
||||
// This macro changes the references to fields that are now encapsulated
|
||||
// in the class G4PlSideData.
|
||||
//
|
||||
#define G4MT_pcphi ((subInstanceManager.offset[instanceID]).fPhi)
|
||||
#define G4MT_pcphix ((subInstanceManager.offset[instanceID]).fPhix)
|
||||
#define G4MT_pcphiy ((subInstanceManager.offset[instanceID]).fPhiy)
|
||||
#define G4MT_pcphiz ((subInstanceManager.offset[instanceID]).fPhiz)
|
||||
#define G4MT_pcphik ((subInstanceManager.offset[instanceID]).fPhik)
|
||||
|
||||
// Returns the private data instance manager.
|
||||
//
|
||||
@@ -84,8 +87,7 @@ G4PolyconeSide::G4PolyconeSide( const G4PolyconeSideRZ *prevRZ,
|
||||
|
||||
kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
||||
fSurfaceArea = 0.0;
|
||||
G4MT_pcphi.first = G4ThreeVector(0,0,0);
|
||||
G4MT_pcphi.second= 0.0;
|
||||
G4MT_pcphix = 0.0; G4MT_pcphiy = 0.0; G4MT_pcphiz = 0.0; G4MT_pcphik = 0.0;
|
||||
|
||||
//
|
||||
// Record values
|
||||
@@ -885,16 +887,17 @@ void G4PolyconeSide::CalculateExtent( const EAxis axis,
|
||||
G4double G4PolyconeSide::GetPhi( const G4ThreeVector& p )
|
||||
{
|
||||
G4double val=0.;
|
||||
G4ThreeVector vphi(G4MT_pcphix, G4MT_pcphiy, G4MT_pcphiz);
|
||||
|
||||
if (G4MT_pcphi.first != p)
|
||||
if (vphi != p)
|
||||
{
|
||||
val = p.phi();
|
||||
G4MT_pcphi.first = p;
|
||||
G4MT_pcphi.second = val;
|
||||
G4MT_pcphix = p.x(); G4MT_pcphiy = p.y(); G4MT_pcphiz = p.z();
|
||||
G4MT_pcphik = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
val = G4MT_pcphi.second;
|
||||
val = G4MT_pcphik;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,10 @@ G4PhSideManager G4PolyhedraSide::subInstanceManager;
|
||||
// This macro changes the references to fields that are now encapsulated
|
||||
// in the class G4PhSideData.
|
||||
//
|
||||
#define G4MT_phphi ((subInstanceManager.offset[instanceID]).fPhi)
|
||||
#define G4MT_phphix ((subInstanceManager.offset[instanceID]).fPhix)
|
||||
#define G4MT_phphiy ((subInstanceManager.offset[instanceID]).fPhiy)
|
||||
#define G4MT_phphiz ((subInstanceManager.offset[instanceID]).fPhiz)
|
||||
#define G4MT_phphik ((subInstanceManager.offset[instanceID]).fPhik)
|
||||
|
||||
// Returns the private data instance manager.
|
||||
//
|
||||
@@ -82,9 +85,9 @@ G4PolyhedraSide::G4PolyhedraSide( const G4PolyhedraSideRZ *prevRZ,
|
||||
instanceID = subInstanceManager.CreateSubInstance();
|
||||
|
||||
kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
||||
fSurfaceArea=0.;
|
||||
G4MT_phphi.first = G4ThreeVector(0,0,0);
|
||||
G4MT_phphi.second= 0.0;
|
||||
fSurfaceArea = 0.0;
|
||||
G4MT_phphix = 0.0; G4MT_phphiy = 0.0; G4MT_phphiz = 0.0;
|
||||
G4MT_phphik = 0.0;
|
||||
|
||||
//
|
||||
// Record values
|
||||
@@ -1011,16 +1014,17 @@ G4int G4PolyhedraSide::PhiSegment( G4double phi0 )
|
||||
G4double G4PolyhedraSide::GetPhi( const G4ThreeVector& p )
|
||||
{
|
||||
G4double val=0.;
|
||||
G4ThreeVector vphi(G4MT_phphix, G4MT_phphiy, G4MT_phphiz);
|
||||
|
||||
if (G4MT_phphi.first != p)
|
||||
if (vphi != p)
|
||||
{
|
||||
val = p.phi();
|
||||
G4MT_phphi.first = p;
|
||||
G4MT_phphi.second = val;
|
||||
G4MT_phphix = p.x(); G4MT_phphiy = p.y(); G4MT_phphiz = p.z();
|
||||
G4MT_phphik = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
val = G4MT_phphi.second;
|
||||
val = G4MT_phphik;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
@@ -202,6 +202,24 @@ void G4TriangularFacet::CopyFrom (const G4TriangularFacet &rhs)
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void G4TriangularFacet::MoveFrom (G4TriangularFacet &rhs)
|
||||
{
|
||||
fSurfaceNormal = move(rhs.fSurfaceNormal);
|
||||
fArea = move(rhs.fArea);
|
||||
fCircumcentre = move(rhs.fCircumcentre);
|
||||
fRadius = move(rhs.fRadius);
|
||||
fIndices = move(rhs.fIndices);
|
||||
fA = move(rhs.fA); fB = move(rhs.fB); fC = move(rhs.fC);
|
||||
fDet = move(rhs.fDet);
|
||||
fSqrDist = move(rhs.fSqrDist);
|
||||
fE1 = move(rhs.fE1); fE2 = move(rhs.fE2);
|
||||
fIsDefined = move(rhs.fIsDefined);
|
||||
fVertices = move(rhs.fVertices);
|
||||
rhs.fVertices = 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4TriangularFacet::G4TriangularFacet (const G4TriangularFacet &rhs)
|
||||
@@ -210,6 +228,14 @@ G4TriangularFacet::G4TriangularFacet (const G4TriangularFacet &rhs)
|
||||
CopyFrom(rhs);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4TriangularFacet::G4TriangularFacet (G4TriangularFacet &&rhs)
|
||||
: G4VFacet(rhs)
|
||||
{
|
||||
MoveFrom(rhs);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4TriangularFacet &
|
||||
@@ -218,7 +244,26 @@ G4TriangularFacet::operator=(const G4TriangularFacet &rhs)
|
||||
SetVertices(0);
|
||||
|
||||
if (this != &rhs)
|
||||
{
|
||||
delete fVertices;
|
||||
CopyFrom(rhs);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4TriangularFacet &
|
||||
G4TriangularFacet::operator=(G4TriangularFacet &&rhs)
|
||||
{
|
||||
SetVertices(0);
|
||||
|
||||
if (this != &rhs)
|
||||
{
|
||||
delete fVertices;
|
||||
MoveFrom(rhs);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -703,14 +703,14 @@ G4double G4TwistTubsSide::DistanceToPlane(const G4ThreeVector &p,
|
||||
|
||||
G4double distToanm = G4VTwistSurface::DistanceToPlane(p, A, (N - A), (M - A), xxanm, nanm) * parity;
|
||||
G4double distTocmn = G4VTwistSurface::DistanceToPlane(p, C, (M - C), (N - C), xxcmn, ncmn) * parity;
|
||||
|
||||
#ifdef G4SPECSDEBUG
|
||||
// if p is behind of both surfaces, abort.
|
||||
if (distToanm * distTocmn > 0 && distToanm < 0) {
|
||||
G4Exception("G4TwistTubsSide::DistanceToPlane()",
|
||||
"GeomSolids0003", FatalException,
|
||||
"Point p is behind the surfaces.");
|
||||
}
|
||||
|
||||
#endif
|
||||
// if p is on surface, return 0.
|
||||
if (std::fabs(distToanm) <= halftol) {
|
||||
xx = xxanm;
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4GenericPolycone.hh"
|
||||
#if 0
|
||||
#include "G4UGenericPolycone.hh"
|
||||
|
||||
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
|
||||
@@ -54,8 +53,22 @@ G4UGenericPolycone::G4UGenericPolycone(const G4String& name,
|
||||
G4int numRZ,
|
||||
const G4double r[],
|
||||
const G4double z[] )
|
||||
: G4USolid(name, new UGenericPolycone(name, phiStart, phiTotal, numRZ, r, z))
|
||||
: Base_t(name, phiStart, phiTotal, numRZ, r, z)
|
||||
{
|
||||
wrStart = phiStart; while (wrStart < 0) wrStart += twopi;
|
||||
wrDelta = phiTotal;
|
||||
if (wrDelta <= 0 || wrDelta >= twopi*(1-DBL_EPSILON))
|
||||
{
|
||||
wrStart = 0;
|
||||
wrDelta = twopi;
|
||||
}
|
||||
rzcorners.resize(0);
|
||||
for (G4int i=0; i<numRZ; ++i)
|
||||
{
|
||||
rzcorners.push_back(G4TwoVector(r[i],z[i]));
|
||||
}
|
||||
std::vector<G4int> iout;
|
||||
G4GeomTools::RemoveRedundantVertices(rzcorners,iout,2*kCarTolerance);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +78,7 @@ G4UGenericPolycone::G4UGenericPolycone(const G4String& name,
|
||||
// for usage restricted to object persistency.
|
||||
//
|
||||
G4UGenericPolycone::G4UGenericPolycone(__void__& a)
|
||||
: G4USolid(a)
|
||||
: Base_t(a)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -84,8 +97,11 @@ G4UGenericPolycone::~G4UGenericPolycone()
|
||||
// Copy constructor
|
||||
//
|
||||
G4UGenericPolycone::G4UGenericPolycone(const G4UGenericPolycone &source)
|
||||
: G4USolid(source)
|
||||
: Base_t(source)
|
||||
{
|
||||
wrStart = source.wrStart;
|
||||
wrDelta = source.wrDelta;
|
||||
rzcorners = source.rzcorners;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,59 +114,71 @@ G4UGenericPolycone::operator=(const G4UGenericPolycone &source)
|
||||
{
|
||||
if (this == &source) return *this;
|
||||
|
||||
G4USolid::operator=( source );
|
||||
|
||||
Base_t::operator=( source );
|
||||
wrStart = source.wrStart;
|
||||
wrDelta = source.wrDelta;
|
||||
rzcorners = source.rzcorners;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4double G4UGenericPolycone::GetStartPhi() const
|
||||
{
|
||||
return GetShape()->GetStartPhi();
|
||||
return wrStart;
|
||||
}
|
||||
G4double G4UGenericPolycone::GetEndPhi() const
|
||||
{
|
||||
return GetShape()->GetEndPhi();
|
||||
return (wrStart + wrDelta);
|
||||
}
|
||||
G4double G4UGenericPolycone::GetSinStartPhi() const
|
||||
{
|
||||
if (!GetShape()->IsOpen()) return 0;
|
||||
G4double phi = GetShape()->GetStartPhi();
|
||||
if (IsOpen()) return 0;
|
||||
G4double phi = GetStartPhi();
|
||||
return std::sin(phi);
|
||||
}
|
||||
G4double G4UGenericPolycone::GetCosStartPhi() const
|
||||
{
|
||||
if (!GetShape()->IsOpen()) return 1;
|
||||
G4double phi = GetShape()->GetStartPhi();
|
||||
if (IsOpen()) return 1;
|
||||
G4double phi = GetStartPhi();
|
||||
return std::cos(phi);
|
||||
}
|
||||
G4double G4UGenericPolycone::GetSinEndPhi() const
|
||||
{
|
||||
if (!GetShape()->IsOpen()) return 0;
|
||||
G4double phi = GetShape()->GetEndPhi();
|
||||
if (IsOpen()) return 0;
|
||||
G4double phi = GetEndPhi();
|
||||
return std::sin(phi);
|
||||
}
|
||||
G4double G4UGenericPolycone::GetCosEndPhi() const
|
||||
{
|
||||
if (!GetShape()->IsOpen()) return 1;
|
||||
G4double phi = GetShape()->GetEndPhi();
|
||||
if (IsOpen()) return 1;
|
||||
G4double phi = GetEndPhi();
|
||||
return std::cos(phi);
|
||||
}
|
||||
G4bool G4UGenericPolycone::IsOpen() const
|
||||
{
|
||||
return GetShape()->IsOpen();
|
||||
return (wrDelta < twopi);
|
||||
}
|
||||
G4int G4UGenericPolycone::GetNumRZCorner() const
|
||||
{
|
||||
return GetShape()->GetNumRZCorner();
|
||||
return rzcorners.size();
|
||||
}
|
||||
G4PolyconeSideRZ G4UGenericPolycone::GetCorner(G4int index) const
|
||||
{
|
||||
UPolyconeSideRZ pside = GetShape()->GetCorner(index);
|
||||
G4PolyconeSideRZ psiderz = { pside.r, pside.z };
|
||||
G4TwoVector rz = rzcorners.at(index);
|
||||
G4PolyconeSideRZ psiderz = { rz.x(), rz.y() };
|
||||
|
||||
return psiderz;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Make a clone of the object
|
||||
|
||||
G4VSolid* G4UGenericPolycone::Clone() const
|
||||
{
|
||||
return new G4UGenericPolycone(*this);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get bounding box
|
||||
@@ -629,4 +657,3 @@ G4Polyhedron* G4UGenericPolycone::CreatePolyhedron() const
|
||||
}
|
||||
|
||||
#endif // G4GEOM_USE_USOLIDS
|
||||
#endif
|
||||
|
||||
@@ -234,20 +234,20 @@ G4UTet::CalculateExtent(const EAxis pAxis,
|
||||
//
|
||||
G4Polyhedron* G4UTet::CreatePolyhedron() const
|
||||
{
|
||||
G4int index = 0;
|
||||
G4double array[12];
|
||||
Base_t::GetParametersList(index, array);
|
||||
std::vector<U3Vector> vec(4);
|
||||
Base_t::GetVertices(vec[0], vec[1], vec[2], vec[3]);
|
||||
|
||||
G4Polyhedron *ph=new G4Polyhedron;
|
||||
G4double xyz[4][3];
|
||||
const G4int faces[4][4]={{1,3,2,0},{1,4,3,0},{1,2,4,0},{2,3,4,0}};
|
||||
xyz[0][0]=array[0]; xyz[0][1]=array[1]; xyz[0][2]=array[2]; // fAnchor
|
||||
xyz[1][0]=array[3]; xyz[1][1]=array[4]; xyz[1][2]=array[5]; // fP2
|
||||
xyz[2][0]=array[6]; xyz[2][1]=array[7]; xyz[2][2]=array[8]; // fP3
|
||||
xyz[3][0]=array[9]; xyz[3][1]=array[10]; xyz[3][2]=array[11]; // fP4
|
||||
const G4int faces[4][4] = {{1,3,2,0},{1,4,3,0},{1,2,4,0},{2,3,4,0}};
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
{
|
||||
xyz[i][0] = vec[i].x();
|
||||
xyz[i][1] = vec[i].y();
|
||||
xyz[i][2] = vec[i].z();
|
||||
}
|
||||
|
||||
G4Polyhedron *ph = new G4Polyhedron;
|
||||
ph->createPolyhedron(4,4,xyz,faces);
|
||||
|
||||
return ph;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user