Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DrawVoxels.cc,v 1.10 2000/01/19 17:26:30 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4DrawVoxels.cc,v 1.12 2000/11/20 17:31:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4DrawVoxels
|
||||
@@ -56,7 +56,6 @@ void G4DrawVoxels::ComputeVoxelPolyhedra(const G4LogicalVolume* lv,
|
||||
|
||||
G4double dx=kInfinity,dy=kInfinity,dz=kInfinity;
|
||||
G4double xmax=0,xmin=0,ymax=0,ymin=0,zmax=0,zmin=0;
|
||||
G4Transform3D translation_for_voxel_plane; // According to the solid's own frame
|
||||
|
||||
if (lv->GetNoDaughters()<=0) {
|
||||
#ifdef G4DrawVoxelsDebug
|
||||
@@ -84,7 +83,7 @@ void G4DrawVoxels::ComputeVoxelPolyhedra(const G4LogicalVolume* lv,
|
||||
ppl->insert(G4PlacedPolyhedron(bounding_polyhedronBox,G4Translate3D(t_centerofBoundingBox)));
|
||||
|
||||
G4ThreeVector t_FirstCenterofVoxelPlane;
|
||||
const G4VisAttributes* voxelsVisAttributes;
|
||||
const G4VisAttributes* voxelsVisAttributes=0;
|
||||
|
||||
G4ThreeVector unit_translation_vector;
|
||||
G4ThreeVector current_translation_vector;
|
||||
@@ -216,21 +215,9 @@ void G4DrawVoxels::DrawVoxels(const G4LogicalVolume* lv) const{
|
||||
G4PlacedPolyhedronList* pplist=CreatePlacedPolyhedra(lv);
|
||||
if(pVVisManager) {
|
||||
//Drawing the bounding and voxel polyhedra for the pVolume
|
||||
for (G4int i=0;i<pplist->entries();i++)
|
||||
for (size_t i=0;i<pplist->entries();i++)
|
||||
pVVisManager->Draw((*pplist)(i).GetPolyhedron(),(*pplist)(i).GetTransform()*transf3D);
|
||||
}
|
||||
else G4cout << "@@@@ void G4DrawVoxels::DrawVoxels(const G4LogicalVolume*) pVVisManager is null! @@@@" <<G4endl;
|
||||
delete pplist;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4GeometryManager.cc,v 1.2 1999/12/15 14:49:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// class G4GeometryManager
|
||||
//
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4LogicalVolume.cc,v 1.3 1999/12/15 14:49:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4LogicalVolume.cc,v 1.5 2000/11/20 17:31:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4LogicalVolume Implementation
|
||||
@@ -24,13 +24,14 @@
|
||||
|
||||
// Constructor - set member data and add to logical Store, zero voxel ptr
|
||||
// Initialises daughter vector to 0 length
|
||||
G4LogicalVolume::G4LogicalVolume( G4VSolid *pSolid, G4Material *pMaterial,
|
||||
//
|
||||
G4LogicalVolume::G4LogicalVolume( G4VSolid *pSolid, G4Material *pMaterial,
|
||||
const G4String& name,
|
||||
G4FieldManager *pFieldMgr,
|
||||
G4VSensitiveDetector *pSDetector,
|
||||
G4UserLimits *pULimits) :
|
||||
fDaughters(0), fVoxel(0), fSmartless(2.), fVisAttributes (0) , fFastSimulationManager (0),
|
||||
fIsEnvelope(FALSE), fFieldManager(pFieldMgr)
|
||||
G4UserLimits *pULimits)
|
||||
: fDaughters(0), fFieldManager(pFieldMgr), fVoxel(0), fSmartless(2.),
|
||||
fVisAttributes (0), fFastSimulationManager (0), fIsEnvelope(FALSE)
|
||||
{
|
||||
SetSolid(pSolid);
|
||||
SetMaterial(pMaterial);
|
||||
@@ -43,6 +44,7 @@ G4LogicalVolume::G4LogicalVolume( G4VSolid *pSolid, G4Material *pMaterial,
|
||||
|
||||
// Destructor - remove from solid Store
|
||||
// NOTE: Not virtual
|
||||
//
|
||||
G4LogicalVolume::~G4LogicalVolume()
|
||||
{
|
||||
G4LogicalVolumeStore::DeRegister(this);
|
||||
@@ -51,9 +53,10 @@ G4LogicalVolume::~G4LogicalVolume()
|
||||
// As this method is recursive, inlining it is harder (and asking for it
|
||||
// is pointless if not counterproductive: it will increase code size)
|
||||
//
|
||||
void G4LogicalVolume::SetFastSimulationManager (
|
||||
G4FastSimulationManager* pNewFastSimul,
|
||||
G4bool IsEnvelope)
|
||||
void
|
||||
G4LogicalVolume::SetFastSimulationManager(
|
||||
G4FastSimulationManager* pNewFastSimul,
|
||||
G4bool IsEnvelope)
|
||||
{
|
||||
if(!fIsEnvelope || IsEnvelope) {
|
||||
fIsEnvelope=IsEnvelope;
|
||||
@@ -70,8 +73,8 @@ void G4LogicalVolume::SetFastSimulationManager (
|
||||
}
|
||||
}
|
||||
|
||||
void G4LogicalVolume::
|
||||
ClearEnvelopeForFastSimulation( G4LogicalVolume* motherLogVol)
|
||||
void
|
||||
G4LogicalVolume::ClearEnvelopeForFastSimulation(G4LogicalVolume* motherLogVol)
|
||||
{
|
||||
if( fIsEnvelope ) {
|
||||
G4FastSimulationManager* NewFastSimulationVal=NULL;
|
||||
@@ -104,9 +107,9 @@ ClearEnvelopeForFastSimulation( G4LogicalVolume* motherLogVol)
|
||||
}
|
||||
}
|
||||
|
||||
void G4LogicalVolume::SetFieldManager (
|
||||
G4FieldManager* pNewFieldMgr,
|
||||
G4bool forceAllDaughters)
|
||||
void
|
||||
G4LogicalVolume::SetFieldManager(G4FieldManager* pNewFieldMgr,
|
||||
G4bool forceAllDaughters)
|
||||
{
|
||||
fFieldManager = pNewFieldMgr;
|
||||
|
||||
@@ -124,7 +127,7 @@ void G4LogicalVolume::SetFieldManager (
|
||||
// The following method returns a meaningful result IF and only IF
|
||||
// the current logical volume has exactly one physical volume that
|
||||
// uses it.
|
||||
|
||||
//
|
||||
G4LogicalVolume*
|
||||
G4LogicalVolume::FindMotherLogicalVolumeForEnvelope()
|
||||
{
|
||||
@@ -133,7 +136,7 @@ G4LogicalVolume::FindMotherLogicalVolumeForEnvelope()
|
||||
|
||||
// Look for the current volume's mother volume.
|
||||
|
||||
for (G4int LV=0;LV < Store->entries(); LV++){
|
||||
for (size_t LV=0;LV < Store->entries(); LV++){
|
||||
G4LogicalVolume *aLogVol;
|
||||
|
||||
aLogVol= Store->at(LV);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4LogicalVolumeStore.cc,v 1.4 1999/12/15 14:49:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G4LogicalVolumeStore
|
||||
//
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PVParameterised.cc,v 1.2 1999/12/15 14:49:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4PVParameterised.cc,v 1.3 2000/11/01 15:39:35 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4PVParameterised
|
||||
@@ -37,6 +37,10 @@ G4PVParameterised::G4PVParameterised(const G4String& pName,
|
||||
{
|
||||
}
|
||||
|
||||
G4PVParameterised::~G4PVParameterised()
|
||||
{
|
||||
}
|
||||
|
||||
G4VPVParameterisation* G4PVParameterised::GetParameterisation() const
|
||||
{
|
||||
return fparam;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PVPlacement.cc,v 1.2 1999/12/15 14:49:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4PVPlacement.cc,v 1.3 2000/11/20 17:31:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4PVPlacement Implementation
|
||||
@@ -23,7 +23,7 @@ G4PVPlacement::G4PVPlacement(G4RotationMatrix *pRot,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo) :
|
||||
G4VPhysicalVolume(pRot,tlate,pName,pLogical,pMother),
|
||||
fcopyNo(pCopyNo), fmany(pMany), fallocatedRotM(false)
|
||||
fmany(pMany), fallocatedRotM(false), fcopyNo(pCopyNo)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ G4PVPlacement::G4PVPlacement(const G4Transform3D &Transform3D,
|
||||
G4VPhysicalVolume( NewPtrRotMatrix(Transform3D.getRotation().inverse()),
|
||||
Transform3D.getTranslation(),
|
||||
pName,pLogical,pMother),
|
||||
fcopyNo(pCopyNo), fmany(pMany)
|
||||
fmany(pMany), fcopyNo(pCopyNo)
|
||||
{
|
||||
fallocatedRotM= (this->GetRotation() != 0);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ G4PVPlacement::G4PVPlacement(G4RotationMatrix *pRot,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo) :
|
||||
G4VPhysicalVolume(pRot,tlate,pName,pCurrentLogical,0),
|
||||
fcopyNo(pCopyNo), fmany(pMany), fallocatedRotM(false)
|
||||
fmany(pMany), fallocatedRotM(false), fcopyNo(pCopyNo)
|
||||
{
|
||||
if (pMotherLogical) pMotherLogical->AddDaughter(this);
|
||||
}
|
||||
@@ -71,8 +71,7 @@ G4PVPlacement::G4PVPlacement( const G4Transform3D &Transform3D,
|
||||
pName,
|
||||
pCurrentLogical,
|
||||
0),
|
||||
fcopyNo(pCopyNo),
|
||||
fmany(pMany)
|
||||
fmany(pMany), fcopyNo(pCopyNo)
|
||||
{
|
||||
this->SetRotation( NewPtrRotMatrix(Transform3D.getRotation().inverse()) );
|
||||
fallocatedRotM= (this->GetRotation() != 0);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PVReplica.cc,v 1.2 1999/12/15 14:49:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4PVReplica Implementation
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhysicalVolumeStore.cc,v 1.4 1999/12/15 14:49:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4PhysicalVolumeStore.cc,v 1.5 2000/11/01 15:39:35 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G4PhysicalVolumeStore
|
||||
//
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SmartVoxelHeader.cc,v 1.5 1999/12/15 14:49:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4SmartVoxelHeader.cc,v 1.7 2000/11/20 17:31:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4SmartVoxelHeader
|
||||
@@ -323,7 +323,8 @@ void G4SmartVoxelHeader::BuildVoxelsWithinLimits(G4LogicalVolume* pVolume,
|
||||
|
||||
G4ProxyVector *pGoodSlices=0,*pTestSlices,*tmpSlices;
|
||||
G4double goodSliceScore=kInfinity,testSliceScore;
|
||||
EAxis goodSliceAxis,testAxis;
|
||||
EAxis goodSliceAxis=kXAxis;
|
||||
EAxis testAxis =kXAxis;
|
||||
G4int node,maxNode,iaxis;
|
||||
G4VoxelLimits noLimits;
|
||||
|
||||
@@ -642,8 +643,8 @@ G4ProxyVector* G4SmartVoxelHeader::BuildNodes(G4LogicalVolume* pVolume,
|
||||
EAxis pAxis)
|
||||
{
|
||||
G4double motherMinExtent,motherMaxExtent,targetMinExtent,targetMaxExtent;
|
||||
G4VPhysicalVolume *pDaughter;
|
||||
G4VPVParameterisation *pParam;
|
||||
G4VPhysicalVolume *pDaughter=0;
|
||||
G4VPVParameterisation *pParam=0;
|
||||
G4VSolid *targetSolid;
|
||||
G4AffineTransform targetTransform;
|
||||
G4bool replicated;
|
||||
@@ -1120,7 +1121,9 @@ G4std::ostream& operator << (G4std::ostream&s, const G4SmartVoxelHeader& h)
|
||||
{
|
||||
s << "Axis = " << h.faxis << G4endl;
|
||||
G4SmartVoxelProxy *collectNode=0,*collectHead=0;
|
||||
G4int collectNodeNo,collectHeadNo,i,j;
|
||||
G4int collectNodeNo=0;
|
||||
G4int collectHeadNo=0;
|
||||
size_t i,j;
|
||||
G4bool haveHeaders=false;
|
||||
|
||||
for (i=0;i<h.fslices.entries();i++)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SmartVoxelNode.cc,v 1.2 1999/12/15 14:49:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// Class G4SmartVoxelNode
|
||||
//
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SolidStore.cc,v 1.4 1999/12/15 14:49:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4SolidStore.cc,v 1.5 2000/09/11 11:09:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G4SolidStore
|
||||
//
|
||||
@@ -27,7 +27,8 @@ G4SolidStore::G4SolidStore() : G4RWTPtrOrderedVector<G4VSolid>(100)
|
||||
// Destructor
|
||||
G4SolidStore::~G4SolidStore()
|
||||
{
|
||||
clearAndDestroy();
|
||||
while (!isEmpty()) removeFirst();
|
||||
// clearAndDestroy();
|
||||
}
|
||||
|
||||
// Static class variable
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VPVParameterisation.cc,v 1.2 1999/12/15 14:49:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// Default implementations for Parameterisations that do not
|
||||
// parameterise solid and/or material
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VPhysicalVolume.cc,v 1.3 1999/12/15 14:49:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4VPhysicalVolume Implementation
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VSolid.cc,v 1.4 2000/04/11 16:18:15 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4VSolid.cc,v 1.6 2000/11/16 14:29:23 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// class G4VSolid
|
||||
//
|
||||
@@ -16,6 +16,8 @@
|
||||
// History:
|
||||
// 10.07.95 P.Kent Added == operator, solid Store entry
|
||||
// 30.06.95 P.Kent
|
||||
// 15.11.00 D.Williams, V.Grichine change in CalculateClippedPolygonExtent:
|
||||
// else if(component>pMax) ---> if
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
@@ -59,34 +61,43 @@ void G4VSolid::ComputeDimensions(G4VPVParameterisation* p,
|
||||
G4Exception("G4VSolid::ComputeDimensions called illegally: not overloaded by derived class");
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Calculate the maximum and minimum extents of the convex polygon pPolygon
|
||||
// along the axis pAxis, within the limits pVoxelLimit
|
||||
//
|
||||
|
||||
void G4VSolid::CalculateClippedPolygonExtent(G4ThreeVectorList& pPolygon,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const EAxis pAxis,
|
||||
G4double& pMin, G4double& pMax) const
|
||||
{
|
||||
G4int noLeft,i;
|
||||
G4double component;
|
||||
ClipPolygon(pPolygon,pVoxelLimit);
|
||||
noLeft=pPolygon.entries();
|
||||
if (noLeft)
|
||||
{
|
||||
for (i=0;i<noLeft;i++)
|
||||
{
|
||||
component=pPolygon(i).operator()(pAxis);
|
||||
if (component<pMin)
|
||||
{
|
||||
pMin=component;
|
||||
}
|
||||
else if (component>pMax)
|
||||
{
|
||||
pMax=component;
|
||||
}
|
||||
}
|
||||
}
|
||||
G4int noLeft,i;
|
||||
G4double component;
|
||||
ClipPolygon(pPolygon,pVoxelLimit);
|
||||
noLeft = pPolygon.entries();
|
||||
|
||||
if (noLeft)
|
||||
{
|
||||
for (i=0;i<noLeft;i++)
|
||||
{
|
||||
component = pPolygon(i).operator()(pAxis);
|
||||
|
||||
if (component < pMin)
|
||||
{
|
||||
pMin = component;
|
||||
}
|
||||
// else
|
||||
if (component > pMax)
|
||||
{
|
||||
pMax = component;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Calculate the maximum and minimum extents of the polygon described
|
||||
// by the vertices: pSectionIndex->pSectionIndex+1->
|
||||
// pSectionIndex+2->pSectionIndex+3->pSectionIndex
|
||||
@@ -337,3 +348,13 @@ G4VisExtent G4VSolid::GetExtent () const {
|
||||
extent.SetZmax (vmax);
|
||||
return extent;
|
||||
}
|
||||
|
||||
G4Polyhedron* G4VSolid::CreatePolyhedron () const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4NURBS* G4VSolid::CreateNURBS () const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VoxelLimits.cc,v 1.2 1999/12/15 14:49:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4VoxelLimits.cc,v 1.3 2000/11/01 15:39:36 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// class G4VoxelLimits
|
||||
//
|
||||
@@ -105,7 +105,7 @@ G4bool G4VoxelLimits::ClipToLimits(G4ThreeVector& pStart,
|
||||
y2=pEnd.y();
|
||||
z2=pEnd.z();
|
||||
|
||||
do
|
||||
while (sCode!=eCode)
|
||||
{
|
||||
|
||||
// Copy vectors to work variables x1-z1,x2-z2
|
||||
@@ -211,7 +211,7 @@ G4bool G4VoxelLimits::ClipToLimits(G4ThreeVector& pStart,
|
||||
pEnd=G4ThreeVector(x2,y2,z2);
|
||||
sCode=OutCode(pStart);
|
||||
eCode=OutCode(pEnd);
|
||||
} while (sCode!=eCode);
|
||||
}
|
||||
|
||||
if (sCode==0&&eCode==0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user