Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
+10
View File
@@ -19,6 +19,16 @@ committal in the CVS repository !
History file for graphics_reps category
---------------------------------------
07 November 2019 Evgueni Tcherniaev (greps-V10-05-06)
- HepPolyhedron: Added move constructor and move assignment
- BooleanProcessor::createPolyhedron(): Use return std::move()
04 October 2019 Evgueni Tcherniaev (greps-V10-05-05)
- HepPolyhedron::SetSideFacets: Fixed false defect reported by Coverity
29 August 2019 John Allison (greps-V10-05-04)
- Add G4TessellatedSolid to list of solids that may be specially treated
12 June 2019 John Allison (greps-V10-05-03)
- G4VisAttributes:
o Add G4VisAttributes::cloud and methods to force:
@@ -53,6 +53,7 @@ class G4Sphere;
class G4Ellipsoid;
class G4Polycone;
class G4Polyhedra;
class G4TessellatedSolid;
class G4PhysicalVolumeModel;
class G4VTrajectory;
@@ -105,12 +106,13 @@ public: // With description
virtual void AddSolid (const G4Tubs&) = 0;
// From geometry/solids/specific
virtual void AddSolid (const G4Ellipsoid&) = 0;
virtual void AddSolid (const G4Polycone&) = 0;
virtual void AddSolid (const G4Polyhedra&) = 0;
virtual void AddSolid (const G4Ellipsoid&) = 0;
virtual void AddSolid (const G4Polycone&) = 0;
virtual void AddSolid (const G4Polyhedra&) = 0;
virtual void AddSolid (const G4TessellatedSolid&) = 0;
// For solids not above.
virtual void AddSolid (const G4VSolid&) = 0;
// For solids not above
virtual void AddSolid (const G4VSolid&) = 0;
///////////////////////////////////////////////////////////////////
// Methods for adding "compound" GEANT4 objects to the scene
@@ -123,10 +125,10 @@ public: // With description
// use graphics-system-specific code or (d) any combination of the
// above.
virtual void AddCompound (const G4VTrajectory&) = 0;
virtual void AddCompound (const G4VHit&) = 0;
virtual void AddCompound (const G4VDigi&) = 0;
virtual void AddCompound (const G4THitsMap<G4double>&) = 0;
virtual void AddCompound (const G4VTrajectory&) = 0;
virtual void AddCompound (const G4VHit&) = 0;
virtual void AddCompound (const G4VDigi&) = 0;
virtual void AddCompound (const G4THitsMap<G4double>&) = 0;
virtual void AddCompound (const G4THitsMap<G4StatDouble>&) = 0;
///////////////////////////////////////////////////////////////////
@@ -241,12 +241,18 @@ class HepPolyhedron {
// Copy constructor
HepPolyhedron(const HepPolyhedron & from);
// Move constructor
HepPolyhedron(HepPolyhedron && from);
// Destructor
virtual ~HepPolyhedron() { delete [] pV; delete [] pF; }
// Assignment
HepPolyhedron & operator=(const HepPolyhedron & from);
// Move assignment
HepPolyhedron & operator=(HepPolyhedron && from);
// Get number of vertices
G4int GetNoVertices() const { return nvert; }
G4int GetNoVerteces() const { return nvert; } // Old spelling.
@@ -1929,7 +1929,7 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
// A L L O C A T E M E M O R Y
ExtPolyhedron polyhedron;
if (nface == 0) return polyhedron;
if (nface == 0) return std::move(polyhedron);
polyhedron.AllocateMemory(nnode, nface);
// S E T N O D E S
@@ -1967,7 +1967,7 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
polyhedron.pF[faces[i].inew] =
G4Facet(v[0],f[0], v[1],f[1], v[2],f[2], v[3],f[3]);
}
return polyhedron;
return std::move(polyhedron);
}
G4ThreadLocal int BooleanProcessor::ishift = 0; //G.Barrand
+49 -1
View File
@@ -118,6 +118,27 @@ HepPolyhedron::HepPolyhedron(const HepPolyhedron &from)
for (G4int k=1; k<=nface; k++) pF[k] = from.pF[k];
}
HepPolyhedron::HepPolyhedron(HepPolyhedron&& from)
/***********************************************************************
* *
* Name: HepPolyhedron move constructor Date: 04.11.2019 *
* Author: E.Tcherniaev (E.Cheryaev) Revised: *
* *
***********************************************************************/
: nvert(0), nface(0), pV(nullptr), pF(nullptr)
{
nvert = from.nvert;
nface = from.nface;
pV = from.pV;
pF = from.pF;
// Release the data from the source object
from.nvert = 0;
from.nface = 0;
from.pV = nullptr;
from.pF = nullptr;
}
HepPolyhedron & HepPolyhedron::operator=(const HepPolyhedron &from)
/***********************************************************************
* *
@@ -136,6 +157,33 @@ HepPolyhedron & HepPolyhedron::operator=(const HepPolyhedron &from)
return *this;
}
HepPolyhedron & HepPolyhedron::operator=(HepPolyhedron&& from)
/***********************************************************************
* *
* Name: HepPolyhedron move operator = Date: 04.11.2019 *
* Author: E.Tcherniaev (E.Chernyaev) Revised: *
* *
* Function: Move contents of one polyhedron to another *
* *
***********************************************************************/
{
if (this != &from) {
delete [] pV;
delete [] pF;
nvert = from.nvert;
nface = from.nface;
pV = from.pV;
pF = from.pF;
// Release the data from the source object
from.nvert = 0;
from.nface = 0;
from.pV = nullptr;
from.pF = nullptr;
}
return *this;
}
G4int
HepPolyhedron::FindNeighbour(G4int iFace, G4int iNode, G4int iOrder) const
/***********************************************************************
@@ -374,7 +422,7 @@ void HepPolyhedron::SetSideFacets(G4int ii[4], G4int vv[4],
if (std::abs((G4double)(dphi-pi)) < perMillion) { // half a circle
for (G4int i=0; i<4; i++) {
k1 = ii[i];
k2 = (i == 3) ? ii[0] : ii[i+1];
k2 = ii[(i+1)%4];
if (r[k1] == 0. && r[k2] == 0.) vv[i] = -1;
}
}