Import Geant4 11.1.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2022-07-01 10:44:02 +02:00
parent b3bf75a2a1
commit c07cea1fe0
2172 changed files with 183300 additions and 123938 deletions
+40 -5
View File
@@ -78,6 +78,10 @@
// tan1,tan2,halfz) - create polyhedron for Hype;
// G4PolyhedronHyperbolicMirror(a,h,r) - create polyhedron for Hyperbolic mirror;
//
// G4PolyhedronTetMesh(vector<p>) - create polyhedron for tetrahedron mesh;
//
// G4PolyhedronBoxMesh(sx,sy,sz,vector<p>) - create polyhedron for box mesh;
//
// Public functions inherited from HepPolyhedron (this list might be
// incomplete):
// GetNoVertices() - returns number of vertices
@@ -100,8 +104,13 @@
// returns false for the last edge;
// GetNextEdge(p1, p2, edgeFlag) - get next edge;
// returns false for the last edge;
// SetNumberOfRotationSteps(G4int n) - Set number of steps for whole circle;
// SetVertex(index, v) - set vertex;
// SetFacet(index,iv1,iv2,iv3,iv4) - set facet;
// SetReferences() - set references to neighbouring facets;
// JoinCoplanarFacets(tol) - join couples of triangles into quadrilaterals;
// InvertFacets() - invert the order on nodes in facets;
// SetNumberOfRotationSteps(G4int n) - set number of steps for whole circle;
//
// History:
// 21st February 2000 Evgeni Chernaev, John Allison
// - Re-written to inherit HepPolyhedron.
@@ -122,17 +131,29 @@
class G4Polyhedron : public HepPolyhedron, public G4Visible {
public:
// Default constructor
G4Polyhedron ();
// Constructors
G4Polyhedron (G4int Nvert, G4int Nface);
G4Polyhedron (const HepPolyhedron& from);
// Use compiler defaults for copy contructor and assignment. (They
// invoke their counterparts in HepPolyhedron and G4Visible.)
// Copy and move constructors
G4Polyhedron (const G4Polyhedron& from) = default;
G4Polyhedron (G4Polyhedron&& from) = default;
// Assignment and move assignment
G4Polyhedron & operator=(const G4Polyhedron & from) = default;
G4Polyhedron & operator=(G4Polyhedron && from) = default;
// Destructor
virtual ~G4Polyhedron ();
G4int GetNumberOfRotationStepsAtTimeOfCreation() const {
return fNumberOfRotationStepsAtTimeOfCreation;
}
private:
G4int fNumberOfRotationStepsAtTimeOfCreation;
G4int fNumberOfRotationStepsAtTimeOfCreation = fNumberOfRotationSteps;
};
class G4PolyhedronBox: public G4Polyhedron {
@@ -281,6 +302,20 @@ class G4PolyhedronHyperbolicMirror : public G4Polyhedron {
virtual ~G4PolyhedronHyperbolicMirror ();
};
class G4PolyhedronTetMesh : public G4Polyhedron {
public:
G4PolyhedronTetMesh(const std::vector<G4ThreeVector>& tetrahedra);
virtual ~G4PolyhedronTetMesh ();
};
class G4PolyhedronBoxMesh : public G4Polyhedron {
public:
G4PolyhedronBoxMesh(G4double sizeX, G4double sizeY, G4double sizeZ,
const std::vector<G4ThreeVector>& positions);
virtual ~G4PolyhedronBoxMesh ();
};
std::ostream& operator<<(std::ostream& os, const G4Polyhedron&);
#endif /* G4POLYHEDRON_HH */
@@ -143,19 +143,11 @@ public: // With description
void SetScreenRadius (G4double);
void SetFillStyle (FillStyle);
// Access functions to the string for user customizable information
virtual const G4String& GetInfo() const;
virtual void SetInfo( const G4String& info );
private:
G4Point3D fPosition;
G4double fWorldSize; // Default 0. means use screen size.
G4double fScreenSize; // Default 0. means use global default.
FillStyle fFillStyle;
// String for user customizable information
G4String fInfo ;
};
#include "G4VMarker.icc"
@@ -104,7 +104,3 @@ inline void G4VMarker::SetScreenRadius (G4double scr) {
inline void G4VMarker::SetFillStyle (G4VMarker::FillStyle style) {
fFillStyle = style;
}
inline const G4String& G4VMarker::GetInfo() const {return fInfo;}
inline void G4VMarker::SetInfo(const G4String& info) {fInfo = info;}
@@ -77,8 +77,13 @@ public: // With description
// A copy of the G4VisAttributes object is created on the heap to
// ensure a long life.
// Access functions to the string for user customizable information
virtual const G4String& GetInfo() const;
virtual void SetInfo(const G4String& info);
protected:
G4String fInfo; // String for user customizable information
const G4VisAttributes* fpVisAttributes;
G4bool fAllocatedVisAttributes;
};
@@ -28,6 +28,11 @@
//
// John Allison 30th October 1996
inline const G4String& G4Visible::GetInfo() const {return fInfo;}
inline void G4Visible::SetInfo(const G4String& info) {fInfo = info;}
inline const G4VisAttributes* G4Visible::GetVisAttributes () const {
return fpVisAttributes;
}
+55 -8
View File
@@ -71,6 +71,10 @@
// - create polyhedron for Hype;
// HepPolyhedronHyperbolicMirror (a,h,r)
// - create polyhedron for Hyperbolic mirror;
// HepPolyhedronTetMesh (vector<p>)
// - create polyhedron for tetrahedron mesh;
// HepPolyhedronBoxMesh (sx,sy,sz,vector<p>)
// - create polyhedron for box mesh;
// Public functions:
//
// GetNoVertices () - returns number of vertices;
@@ -107,7 +111,12 @@
// in order; returns false when finished all faces;
// GetSurfaceArea() - get surface area of the polyhedron;
// GetVolume() - get volume of the polyhedron;
// GetNumberOfRotationSteps() - get number of steps for whole circle;
// GetNumberOfRotationSteps() - get number of steps for whole circle;
// SetVertex(index, v) - set vertex;
// SetFacet(index,iv1,iv2,iv3,iv4) - set facet;
// SetReferences() - set references to neighbouring facets;
// JoinCoplanarFacets(tolerance) - join coplanar facets where it is possible
// InvertFacets() - invert the order on nodes in facets;
// SetNumberOfRotationSteps (n) - set number of steps for whole circle;
// ResetNumberOfRotationSteps() - reset number of steps for whole circle
// to default value;
@@ -180,6 +189,14 @@
// - added TriangulatePolygon(), RotateContourAroundZ()
// - added HepPolyhedronPgon, HepPolyhedronPcon given by rz-countour
//
// 26.03.22 E.Chernyaev
// - added HepPolyhedronTetMesh
//
// 04.04.22 E.Chernyaev
// - added JoinCoplanarFacets()
//
// 07.04.22 E.Chernyaev
// - added HepPolyhedronBoxMesh
#ifndef HEP_POLYHEDRON_HH
#define HEP_POLYHEDRON_HH
@@ -187,6 +204,7 @@
#include <vector>
#include "G4Types.hh"
#include "G4TwoVector.hh"
#include "G4ThreeVector.hh"
#include "G4Point3D.hh"
#include "G4Normal3D.hh"
#include "G4Transform3D.hh"
@@ -261,16 +279,13 @@ class HepPolyhedron {
G4int a, G4int b, G4int c,
G4int n, const G4int* V);
// For each edge set reference to neighbouring facet
void SetReferences();
// Invert the order on nodes in facets
void InvertFacets();
public:
// Constructor
// Default constructor
HepPolyhedron() : nvert(0), nface(0), pV(0), pF(0) {}
// Constructor with allocation of memory
HepPolyhedron(G4int Nvert, G4int Nface);
// Copy constructor
HepPolyhedron(const HepPolyhedron & from);
@@ -366,6 +381,23 @@ class HepPolyhedron {
// Get number of steps for whole circle
static G4int GetNumberOfRotationSteps();
// Set vertex (1 <= index <= Nvert)
void SetVertex(G4int index, const G4Point3D& v);
// Set facet (1 <= index <= Nface)
void SetFacet(G4int index, G4int iv1, G4int iv2, G4int iv3, G4int iv4 = 0);
// For each edge set reference to neighbouring facet,
// call this after all vertices and facets have been set
void SetReferences();
// Join couples of triangular facets to quadrangular facets
// where it is possible
void JoinCoplanarFacets(G4double tolerance);
// Invert the order on nodes in facets
void InvertFacets();
// Set number of steps for whole circle
static void SetNumberOfRotationSteps(G4int n);
@@ -575,4 +607,19 @@ class HepPolyhedronHyperbolicMirror : public HepPolyhedron
virtual ~HepPolyhedronHyperbolicMirror();
};
class HepPolyhedronTetMesh : public HepPolyhedron
{
public:
HepPolyhedronTetMesh(const std::vector<G4ThreeVector>& tetrahedra);
virtual ~HepPolyhedronTetMesh();
};
class HepPolyhedronBoxMesh : public HepPolyhedron
{
public:
HepPolyhedronBoxMesh(G4double sizeX, G4double sizeY, G4double sizeZ,
const std::vector<G4ThreeVector>& positions);
virtual ~HepPolyhedronBoxMesh();
};
#endif /* HEP_POLYHEDRON_HH */