Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EllipticalTube.cc 72937 2013-08-14 13:20:38Z gcosmo $
|
||||
// $Id: G4EllipticalTube.cc 83572 2014-09-01 15:23:27Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -49,9 +49,15 @@
|
||||
#include "Randomize.hh"
|
||||
|
||||
#include "G4VGraphicsScene.hh"
|
||||
#include "G4Polyhedron.hh"
|
||||
#include "G4VisExtent.hh"
|
||||
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
G4Mutex polyhedronMutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
using namespace CLHEP;
|
||||
|
||||
//
|
||||
@@ -61,7 +67,8 @@ G4EllipticalTube::G4EllipticalTube( const G4String &name,
|
||||
G4double theDx,
|
||||
G4double theDy,
|
||||
G4double theDz )
|
||||
: G4VSolid( name ), fCubicVolume(0.), fSurfaceArea(0.), fpPolyhedron(0)
|
||||
: G4VSolid( name ), fCubicVolume(0.), fSurfaceArea(0.),
|
||||
fRebuildPolyhedron(false), fpPolyhedron(0)
|
||||
{
|
||||
halfTol = 0.5*kCarTolerance;
|
||||
|
||||
@@ -77,7 +84,8 @@ G4EllipticalTube::G4EllipticalTube( const G4String &name,
|
||||
//
|
||||
G4EllipticalTube::G4EllipticalTube( __void__& a )
|
||||
: G4VSolid(a), dx(0.), dy(0.), dz(0.), halfTol(0.),
|
||||
fCubicVolume(0.), fSurfaceArea(0.), fpPolyhedron(0)
|
||||
fCubicVolume(0.), fSurfaceArea(0.),
|
||||
fRebuildPolyhedron(false), fpPolyhedron(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -87,7 +95,7 @@ G4EllipticalTube::G4EllipticalTube( __void__& a )
|
||||
//
|
||||
G4EllipticalTube::~G4EllipticalTube()
|
||||
{
|
||||
delete fpPolyhedron;
|
||||
delete fpPolyhedron; fpPolyhedron = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +105,7 @@ G4EllipticalTube::~G4EllipticalTube()
|
||||
G4EllipticalTube::G4EllipticalTube(const G4EllipticalTube& rhs)
|
||||
: G4VSolid(rhs), dx(rhs.dx), dy(rhs.dy), dz(rhs.dz), halfTol(rhs.halfTol),
|
||||
fCubicVolume(rhs.fCubicVolume), fSurfaceArea(rhs.fSurfaceArea),
|
||||
fpPolyhedron(0)
|
||||
fRebuildPolyhedron(false), fpPolyhedron(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -120,7 +128,8 @@ G4EllipticalTube& G4EllipticalTube::operator = (const G4EllipticalTube& rhs)
|
||||
dx = rhs.dx; dy = rhs.dy; dz = rhs.dz;
|
||||
halfTol = rhs.halfTol;
|
||||
fCubicVolume = rhs.fCubicVolume; fSurfaceArea = rhs.fSurfaceArea;
|
||||
fpPolyhedron = 0;
|
||||
fRebuildPolyhedron = false;
|
||||
delete fpPolyhedron; fpPolyhedron = 0;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -969,11 +978,15 @@ G4Polyhedron* G4EllipticalTube::CreatePolyhedron() const
|
||||
G4Polyhedron* G4EllipticalTube::GetPolyhedron () const
|
||||
{
|
||||
if (!fpPolyhedron ||
|
||||
fRebuildPolyhedron ||
|
||||
fpPolyhedron->GetNumberOfRotationStepsAtTimeOfCreation() !=
|
||||
fpPolyhedron->GetNumberOfRotationSteps())
|
||||
{
|
||||
G4AutoLock l(&polyhedronMutex);
|
||||
delete fpPolyhedron;
|
||||
fpPolyhedron = CreatePolyhedron();
|
||||
fRebuildPolyhedron = false;
|
||||
l.unlock();
|
||||
}
|
||||
return fpPolyhedron;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user