Import Geant4 10.5.0 source tree
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ClippablePolygon.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4Ellipsoid.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
// class G4Ellipsoid
|
||||
//
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EllipticalCone.cc 105454 2017-07-27 13:16:40Z gcosmo $
|
||||
//
|
||||
// Implementation of G4EllipticalCone class
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EllipticalTube.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EnclosingCylinder.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExtrudedSolid.cc 108078 2017-12-20 08:15:44Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GenericPolycone.cc 72131 2013-07-11 07:12:24Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GenericTrap.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Hype.cc 108078 2017-12-20 08:15:44Z gcosmo $
|
||||
// $Original: G4Hype.cc,v 1.0 1998/06/09 16:57:50 safai Exp $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectingCone.cc 95997 2016-03-07 13:16:25Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4Paraboloid.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
// class G4Paraboloid
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PolyPhiFace.cc 101041 2016-11-04 09:39:24Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Polycone.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PolyconeSide.cc 100427 2016-10-21 12:58:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyhedra.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PolyhedraSide.cc 100427 2016-10-21 12:58:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QuadrangularFacet.cc 95945 2016-03-03 09:54:38Z gcosmo $
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ReduciblePolygon.cc 92024 2015-08-13 14:16:00Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SolidExtentList.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
G4SolidsWorkspace::pool_type thePool;
|
||||
}
|
||||
|
||||
G4SolidsWorkspace::pool_type*
|
||||
G4SolidsWorkspace::GetPool() { return &thePool; }
|
||||
|
||||
G4SolidsWorkspace::G4SolidsWorkspace(G4bool verbose)
|
||||
: fVerbose(verbose)
|
||||
{
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#include "G4Types.hh"
|
||||
|
||||
#include "G4SolidsWorkspacePool.hh"
|
||||
#include "G4SolidsWorkspace.hh"
|
||||
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
G4Mutex singletonMutexSWP = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
G4SolidsWorkspace*& G4SolidsWorkspacePool::fMyWorkspace()
|
||||
{
|
||||
G4ThreadLocalStatic G4SolidsWorkspace* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
G4SolidsWorkspacePool* G4SolidsWorkspacePool::thePool=0;
|
||||
|
||||
G4SolidsWorkspacePool* G4SolidsWorkspacePool::GetInstance()
|
||||
{
|
||||
G4AutoLock l(&singletonMutexSWP);
|
||||
if( !thePool ) { thePool= new G4SolidsWorkspacePool(); }
|
||||
return thePool;
|
||||
}
|
||||
|
||||
// For use with MT and current G4WorkerThread -- which uses static methods
|
||||
//
|
||||
G4SolidsWorkspace* G4SolidsWorkspacePool::CreateWorkspace()
|
||||
{
|
||||
G4SolidsWorkspace* geometryWrk=0;
|
||||
if( !fMyWorkspace() )
|
||||
{
|
||||
geometryWrk= new G4SolidsWorkspace();
|
||||
|
||||
if( !geometryWrk )
|
||||
{
|
||||
G4Exception("GeometryWorspacePool::CreateWorkspace", "Geom-003",
|
||||
FatalException, "Failed to create workspace.");
|
||||
}
|
||||
else
|
||||
{
|
||||
// geometryWrk->UseWorkspace(); // Do not assign it already.
|
||||
fMyWorkspace()= geometryWrk;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception("GeometryWorspacePool::CreateWorkspace", "Geom-003",
|
||||
FatalException,
|
||||
"Cannot create workspace twice for the same thread.");
|
||||
geometryWrk= fMyWorkspace();
|
||||
}
|
||||
|
||||
return geometryWrk;
|
||||
}
|
||||
|
||||
// Create it (as above) and use it
|
||||
//
|
||||
void G4SolidsWorkspacePool::CreateAndUseWorkspace()
|
||||
{
|
||||
(this->CreateWorkspace())->UseWorkspace();
|
||||
}
|
||||
|
||||
// Reuse an existing workspace - or create a new one if needed.
|
||||
//
|
||||
G4SolidsWorkspace* G4SolidsWorkspacePool::FindOrCreateWorkspace()
|
||||
{
|
||||
G4SolidsWorkspace* geometryWrk= fMyWorkspace();
|
||||
if( !geometryWrk )
|
||||
{
|
||||
geometryWrk= this->CreateWorkspace();
|
||||
}
|
||||
geometryWrk->UseWorkspace();
|
||||
|
||||
fMyWorkspace()= geometryWrk; // assign it for use by this thread.
|
||||
return geometryWrk;
|
||||
}
|
||||
|
||||
|
||||
// Keep the unused Workspace - for recycling
|
||||
//
|
||||
void G4SolidsWorkspacePool::Recycle( G4SolidsWorkspace *geometryWrk )
|
||||
{
|
||||
geometryWrk->ReleaseWorkspace();
|
||||
delete geometryWrk;
|
||||
}
|
||||
|
||||
|
||||
void G4SolidsWorkspacePool::CleanUpAndDestroyAllWorkspaces()
|
||||
{
|
||||
if (fMyWorkspace())
|
||||
{
|
||||
fMyWorkspace()->DestroyWorkspace();
|
||||
delete fMyWorkspace();
|
||||
fMyWorkspace()=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4SolidsWorkspacePool::G4SolidsWorkspacePool()
|
||||
{
|
||||
// fWarehouse=0;
|
||||
}
|
||||
|
||||
|
||||
G4SolidsWorkspacePool::~G4SolidsWorkspacePool()
|
||||
{
|
||||
}
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SurfBits.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TessellatedGeometryAlgorithms.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4TessellatedSolid.cc 108288 2018-01-31 09:36:41Z gcosmo $
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
// * *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4Tet.cc 106603 2017-10-16 09:17:44Z gcosmo $
|
||||
//
|
||||
// class G4Tet
|
||||
//
|
||||
@@ -59,7 +58,7 @@
|
||||
|
||||
//#if !defined(G4GEOM_USE_UTET)
|
||||
|
||||
const char G4Tet::CVSVers[]="$Id: G4Tet.cc 106603 2017-10-16 09:17:44Z gcosmo $";
|
||||
const char G4Tet::CVSVers[]="$Id: G4Tet.cc 113723 2018-12-06 14:12:07Z gunter $";
|
||||
|
||||
#include "G4VoxelLimits.hh"
|
||||
#include "G4AffineTransform.hh"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4TriangularFacet.cc 95945 2016-03-03 09:54:38Z gcosmo $
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistBoxSide.cc 72937 2013-08-14 13:20:38Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistTrapAlphaSide.cc 80289 2014-04-10 09:51:38Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistTrapFlatSide.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistTrapParallelSide.cc,v
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistTubsFlatSide.cc 72937 2013-08-14 13:20:38Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistTubsHypeSide.cc 72937 2013-08-14 13:20:38Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistTubsSide.cc 72937 2013-08-14 13:20:38Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistedBox.cc 79492 2014-03-05 15:25:30Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistedTrap.cc 79492 2014-03-05 15:25:30Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistedTrd.cc 79492 2014-03-05 15:25:30Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TwistedTubs.cc 105776 2017-08-17 08:09:09Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation of G4UExtrudedSolid wrapper class
|
||||
@@ -257,7 +256,7 @@ void G4UExtrudedSolid::BoundingLimits(G4ThreeVector& pMin,
|
||||
//
|
||||
if (checkBBox)
|
||||
{
|
||||
UVector3 vmin, vmax;
|
||||
U3Vector vmin, vmax;
|
||||
Base_t::Extent(vmin,vmax);
|
||||
if (std::abs(pMin.x()-vmin.x()) > kCarTolerance ||
|
||||
std::abs(pMin.y()-vmin.y()) > kCarTolerance ||
|
||||
@@ -392,7 +391,7 @@ G4Polyhedron* G4UExtrudedSolid::CreatePolyhedron () const
|
||||
G4int v[3]; // Facets are only triangular in VecGeom
|
||||
for (unsigned int j = 0; j < 3; ++j)
|
||||
{
|
||||
UVector3 vtx = Base_t::GetStruct().fTslHelper.fFacets[i]->fVertices[j];
|
||||
U3Vector vtx = Base_t::GetStruct().fTslHelper.fFacets[i]->fVertices[j];
|
||||
polyhedron->AddVertex(G4ThreeVector(vtx.x(), vtx.y(), vtx.z()));
|
||||
v[j] = Base_t::GetStruct().fTslHelper.fFacets[i]->fIndices[j]+1;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation of G4UGenericPolycone wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation of G4UGenericTrap wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// Implementation for G4UHype wrapper class
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// Implementation for G4UParaboloid wrapper class
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// Implementation of G4UPolycone wrapper class
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// Implementation of G4UPolycone wrapper class
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation of G4UTessellatedSolid wrapper class
|
||||
@@ -131,13 +130,13 @@ G4bool G4UTessellatedSolid::AddFacet(G4VFacet* aFacet)
|
||||
if (aFacet->GetNumberOfVertices() == 3)
|
||||
{
|
||||
G4TriangularFacet* a3Facet = dynamic_cast<G4TriangularFacet*>(aFacet);
|
||||
return Base_t::AddTriangularFacet(UVector3(a3Facet->GetVertex(0).x(),
|
||||
return Base_t::AddTriangularFacet(U3Vector(a3Facet->GetVertex(0).x(),
|
||||
a3Facet->GetVertex(0).y(),
|
||||
a3Facet->GetVertex(0).z()),
|
||||
UVector3(a3Facet->GetVertex(1).x(),
|
||||
U3Vector(a3Facet->GetVertex(1).x(),
|
||||
a3Facet->GetVertex(1).y(),
|
||||
a3Facet->GetVertex(1).z()),
|
||||
UVector3(a3Facet->GetVertex(2).x(),
|
||||
U3Vector(a3Facet->GetVertex(2).x(),
|
||||
a3Facet->GetVertex(2).y(),
|
||||
a3Facet->GetVertex(2).z()),
|
||||
true);
|
||||
@@ -145,16 +144,16 @@ G4bool G4UTessellatedSolid::AddFacet(G4VFacet* aFacet)
|
||||
else if (aFacet->GetNumberOfVertices() == 4)
|
||||
{
|
||||
G4QuadrangularFacet* a4Facet = dynamic_cast<G4QuadrangularFacet*>(aFacet);
|
||||
return Base_t::AddQuadrilateralFacet(UVector3(a4Facet->GetVertex(0).x(),
|
||||
return Base_t::AddQuadrilateralFacet(U3Vector(a4Facet->GetVertex(0).x(),
|
||||
a4Facet->GetVertex(0).y(),
|
||||
a4Facet->GetVertex(0).z()),
|
||||
UVector3(a4Facet->GetVertex(1).x(),
|
||||
U3Vector(a4Facet->GetVertex(1).x(),
|
||||
a4Facet->GetVertex(1).y(),
|
||||
a4Facet->GetVertex(1).z()),
|
||||
UVector3(a4Facet->GetVertex(2).x(),
|
||||
U3Vector(a4Facet->GetVertex(2).x(),
|
||||
a4Facet->GetVertex(2).y(),
|
||||
a4Facet->GetVertex(2).z()),
|
||||
UVector3(a4Facet->GetVertex(3).x(),
|
||||
U3Vector(a4Facet->GetVertex(3).x(),
|
||||
a4Facet->GetVertex(3).y(),
|
||||
a4Facet->GetVertex(3).z()),
|
||||
true);
|
||||
@@ -187,7 +186,7 @@ void G4UTessellatedSolid::SetSolidClosed(const G4bool t)
|
||||
G4int nFacets = fTessellated.fFacets.size();
|
||||
for (G4int j = 0; j < nVertices; ++j)
|
||||
{
|
||||
UVector3 vt = fTessellated.fVertices[j];
|
||||
U3Vector vt = fTessellated.fVertices[j];
|
||||
fVertexList.push_back(G4ThreeVector(vt.x(), vt.y(), vt.z()));
|
||||
}
|
||||
for (G4int i = 0; i < nFacets; ++i)
|
||||
@@ -224,37 +223,37 @@ void G4UTessellatedSolid::SetMaxVoxels(G4int)
|
||||
|
||||
G4double G4UTessellatedSolid::GetMinXExtent() const
|
||||
{
|
||||
UVector3 aMin, aMax;
|
||||
U3Vector aMin, aMax;
|
||||
Base_t::Extent(aMin, aMax);
|
||||
return aMin.x();
|
||||
}
|
||||
G4double G4UTessellatedSolid::GetMaxXExtent() const
|
||||
{
|
||||
UVector3 aMin, aMax;
|
||||
U3Vector aMin, aMax;
|
||||
Base_t::Extent(aMin, aMax);
|
||||
return aMax.x();
|
||||
}
|
||||
G4double G4UTessellatedSolid::GetMinYExtent() const
|
||||
{
|
||||
UVector3 aMin, aMax;
|
||||
U3Vector aMin, aMax;
|
||||
Base_t::Extent(aMin, aMax);
|
||||
return aMin.y();
|
||||
}
|
||||
G4double G4UTessellatedSolid::GetMaxYExtent() const
|
||||
{
|
||||
UVector3 aMin, aMax;
|
||||
U3Vector aMin, aMax;
|
||||
Base_t::Extent(aMin, aMax);
|
||||
return aMax.y();
|
||||
}
|
||||
G4double G4UTessellatedSolid::GetMinZExtent() const
|
||||
{
|
||||
UVector3 aMin, aMax;
|
||||
U3Vector aMin, aMax;
|
||||
Base_t::Extent(aMin, aMax);
|
||||
return aMin.z();
|
||||
}
|
||||
G4double G4UTessellatedSolid::GetMaxZExtent() const
|
||||
{
|
||||
UVector3 aMin, aMax;
|
||||
U3Vector aMin, aMax;
|
||||
Base_t::Extent(aMin, aMax);
|
||||
return aMax.z();
|
||||
}
|
||||
@@ -295,7 +294,7 @@ void G4UTessellatedSolid::DisplayAllocatedMemory()
|
||||
void G4UTessellatedSolid::BoundingLimits(G4ThreeVector& pMin,
|
||||
G4ThreeVector& pMax) const
|
||||
{
|
||||
UVector3 aMin, aMax;
|
||||
U3Vector aMin, aMax;
|
||||
Base_t::Extent(aMin, aMax);
|
||||
pMin = G4ThreeVector(aMin.x(), aMin.y(), aMin.z());
|
||||
pMax = G4ThreeVector(aMax.x(), aMax.y(), aMax.z());
|
||||
|
||||
@@ -15,26 +15,20 @@
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * Vanderbilt University Free Electron Laser Center *
|
||||
// * Vanderbilt University, Nashville, TN, USA *
|
||||
// * Development supported by: *
|
||||
// * United States MFEL program under grant FA9550-04-1-0045 *
|
||||
// * and NASA under contract number NNG04CT05P *
|
||||
// * Written by Marcus H. Mendenhall and Robert A. Weller. *
|
||||
// * *
|
||||
// * Contributed to the Geant4 Core, January, 2005. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UTet wrapper class
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4Tet.hh"
|
||||
#if 0
|
||||
#include "G4UTet.hh"
|
||||
|
||||
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
|
||||
@@ -59,13 +53,40 @@ G4UTet::G4UTet(const G4String& pName,
|
||||
G4ThreeVector p2,
|
||||
G4ThreeVector p3,
|
||||
G4ThreeVector p4, G4bool* degeneracyFlag)
|
||||
: G4USolid(pName, new UTet(pName,
|
||||
UVector3(anchor.x(),anchor.y(),anchor.z()),
|
||||
UVector3(p2.x(), p2.y(), p2.z()),
|
||||
UVector3(p3.x(), p3.y(), p3.z()),
|
||||
UVector3(p4.x(), p4.y(), p4.z()),
|
||||
degeneracyFlag))
|
||||
: Base_t(pName, U3Vector(anchor.x(),anchor.y(),anchor.z()),
|
||||
U3Vector(p2.x(), p2.y(), p2.z()),
|
||||
U3Vector(p3.x(), p3.y(), p3.z()),
|
||||
U3Vector(p4.x(), p4.y(), p4.z()))
|
||||
{
|
||||
G4double fXMin=std::min(std::min(std::min(anchor.x(), p2.x()),p3.x()),p4.x());
|
||||
G4double fXMax=std::max(std::max(std::max(anchor.x(), p2.x()),p3.x()),p4.x());
|
||||
G4double fYMin=std::min(std::min(std::min(anchor.y(), p2.y()),p3.y()),p4.y());
|
||||
G4double fYMax=std::max(std::max(std::max(anchor.y(), p2.y()),p3.y()),p4.y());
|
||||
G4double fZMin=std::min(std::min(std::min(anchor.z(), p2.z()),p3.z()),p4.z());
|
||||
G4double fZMax=std::max(std::max(std::max(anchor.z(), p2.z()),p3.z()),p4.z());
|
||||
|
||||
G4ThreeVector fMiddle=G4ThreeVector(fXMax+fXMin,fYMax+fYMin,fZMax+fZMin)*0.5;
|
||||
G4double fMaxSize=std::max(std::max(std::max((anchor-fMiddle).mag(),
|
||||
(p2-fMiddle).mag()),
|
||||
(p3-fMiddle).mag()),
|
||||
(p4-fMiddle).mag());
|
||||
// fV<x><y> is vector from vertex <y> to vertex <x>
|
||||
//
|
||||
G4ThreeVector fV21=p2-anchor;
|
||||
G4ThreeVector fV31=p3-anchor;
|
||||
G4ThreeVector fV41=p4-anchor;
|
||||
|
||||
// make sure this is a correctly oriented set of points for the tetrahedron
|
||||
//
|
||||
G4double signed_vol=fV21.cross(fV31).dot(fV41);
|
||||
G4bool degenerate=std::fabs(signed_vol) < 1e-9*fMaxSize*fMaxSize*fMaxSize;
|
||||
|
||||
if(degeneracyFlag) *degeneracyFlag=degenerate;
|
||||
else if (degenerate)
|
||||
{
|
||||
G4Exception("G4UTet::G4UTet()", "GeomSolids0002", FatalException,
|
||||
"Degenerate tetrahedron not allowed.");
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -74,7 +95,7 @@ G4UTet::G4UTet(const G4String& pName,
|
||||
// for usage restricted to object persistency.
|
||||
//
|
||||
G4UTet::G4UTet( __void__& a )
|
||||
: G4USolid(a)
|
||||
: Base_t(a)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -91,7 +112,7 @@ G4UTet::~G4UTet()
|
||||
// Copy constructor
|
||||
//
|
||||
G4UTet::G4UTet(const G4UTet& rhs)
|
||||
: G4USolid(rhs)
|
||||
: Base_t(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -108,7 +129,7 @@ G4UTet& G4UTet::operator = (const G4UTet& rhs)
|
||||
|
||||
// Copy base class data
|
||||
//
|
||||
G4USolid::operator=(rhs);
|
||||
Base_t::operator=(rhs);
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -119,9 +140,10 @@ G4UTet& G4UTet::operator = (const G4UTet& rhs)
|
||||
//
|
||||
std::vector<G4ThreeVector> G4UTet::GetVertices() const
|
||||
{
|
||||
std::vector<UVector3> vec = GetShape()->GetVertices();
|
||||
std::vector<U3Vector> vec(4);
|
||||
Base_t::GetVertices(vec[0], vec[1], vec[2], vec[3]);
|
||||
std::vector<G4ThreeVector> vertices;
|
||||
for (unsigned int i=0; i<vec.size(); ++i)
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
{
|
||||
G4ThreeVector v(vec[i].x(), vec[i].y(), vec[i].z());
|
||||
vertices.push_back(v);
|
||||
@@ -135,8 +157,8 @@ std::vector<G4ThreeVector> G4UTet::GetVertices() const
|
||||
|
||||
void G4UTet::BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const
|
||||
{
|
||||
UVector3 vmin, vmax;
|
||||
GetShape()->Extent(vmin,vmax);
|
||||
U3Vector vmin, vmax;
|
||||
Base_t::Extent(vmin,vmax);
|
||||
pMin.set(vmin.x(),vmin.y(),vmin.z());
|
||||
pMax.set(vmax.x(),vmax.y(),vmax.z());
|
||||
|
||||
@@ -182,15 +204,15 @@ G4UTet::CalculateExtent(const EAxis pAxis,
|
||||
|
||||
// Set bounding envelope (benv) and calculate extent
|
||||
//
|
||||
std::vector<UVector3> vec = GetShape()->GetVertices();
|
||||
std::vector<G4ThreeVector> vec = GetVertices();
|
||||
|
||||
G4ThreeVectorList anchor(1);
|
||||
anchor[0].set(vec[0].x(),vec[0].y(),vec[0].z());
|
||||
anchor[0] = vec[0];
|
||||
|
||||
G4ThreeVectorList base(3);
|
||||
base[0].set(vec[1].x(),vec[1].y(),vec[1].z());
|
||||
base[1].set(vec[2].x(),vec[2].y(),vec[2].z());
|
||||
base[2].set(vec[3].x(),vec[3].y(),vec[3].z());
|
||||
base[0] = vec[1];
|
||||
base[1] = vec[2];
|
||||
base[2] = vec[3];
|
||||
|
||||
std::vector<const G4ThreeVectorList *> polygons(2);
|
||||
polygons[0] = &anchor;
|
||||
@@ -209,7 +231,7 @@ G4Polyhedron* G4UTet::CreatePolyhedron() const
|
||||
{
|
||||
G4int index = 0;
|
||||
G4double array[12];
|
||||
GetShape()->GetParametersList(index, array);
|
||||
Base_t::GetParametersList(index, array);
|
||||
|
||||
G4Polyhedron *ph=new G4Polyhedron;
|
||||
G4double xyz[4][3];
|
||||
@@ -225,4 +247,3 @@ G4Polyhedron* G4UTet::CreatePolyhedron() const
|
||||
}
|
||||
|
||||
#endif // G4GEOM_USE_USOLIDS
|
||||
#endif
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VCSGfaceted.cc 92024 2015-08-13 14:16:00Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VFacet.cc 92024 2015-08-13 14:16:00Z gcosmo $
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VTwistSurface.cc 104105 2017-05-11 08:23:18Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VTwistedFaceted.cc 105776 2017-08-17 08:09:09Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
Reference in New Issue
Block a user