Import Geant4 4.0.0 source tree
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PGeometryObjectMap.cc,v 1.7.2.1 2001/06/28 19:11:28 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4PGeometryObjectMap.cc,v 1.9 2001/07/11 10:02:19 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// class G4PGeometryObjectMap
|
||||
//
|
||||
@@ -40,10 +40,6 @@
|
||||
#include "G4PLogicalVolume.hh"
|
||||
#include "G4PVSolid.hh"
|
||||
|
||||
#include "G4VPhysVolRefArray.hh"
|
||||
#include "G4LogVolRefArray.hh"
|
||||
#include "G4VSolidRefArray.hh"
|
||||
|
||||
G4PGeometryObjectMap::G4PGeometryObjectMap()
|
||||
: noPhysVol(0),noLogVol(0),noSolids(0)
|
||||
{
|
||||
@@ -75,7 +71,7 @@ HepRef(G4PVPhysicalVolume) G4PGeometryObjectMap::LookUp(
|
||||
assert(inGeomObj != 0);
|
||||
for(G4int i=0;i<noPhysVol;i++)
|
||||
{
|
||||
if( transPhysVolPtrs->Get(i) == inGeomObj )
|
||||
if( (*transPhysVolPtrs)[i] == inGeomObj )
|
||||
{
|
||||
return persPhysVolPtrs[i];
|
||||
}
|
||||
@@ -93,8 +89,7 @@ void G4PGeometryObjectMap::Add( G4VPhysicalVolume* inGeomObj,
|
||||
{
|
||||
// assert( inGeomObj == aGeomObj );
|
||||
noPhysVol++;
|
||||
transPhysVolPtrs->Resize(noPhysVol);
|
||||
transPhysVolPtrs->Insert(noPhysVol-1, inGeomObj);
|
||||
transPhysVolPtrs->push_back(inGeomObj);
|
||||
persPhysVolPtrs.insert_element(outGeomObj);
|
||||
}
|
||||
}
|
||||
@@ -109,7 +104,7 @@ G4VPhysicalVolume* G4PGeometryObjectMap::LookUp(
|
||||
{
|
||||
if( persPhysVolPtrs[i] == inGeomObj )
|
||||
{
|
||||
return transPhysVolPtrs->Get(i);
|
||||
return (*transPhysVolPtrs)[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,11 +115,11 @@ void G4PGeometryObjectMap::Add( HepRef(G4PVPhysicalVolume) inGeomObj,
|
||||
G4VPhysicalVolume* outGeomObj )
|
||||
{
|
||||
assert(inGeomObj != 0);
|
||||
for(G4int i=0;i<noPhysVol;i++)
|
||||
for(G4int i=0; i<noPhysVol; i++)
|
||||
{
|
||||
if( persPhysVolPtrs[i] == inGeomObj )
|
||||
{
|
||||
transPhysVolPtrs->Insert(i, outGeomObj);
|
||||
(*transPhysVolPtrs)[i]= outGeomObj;
|
||||
break;
|
||||
}
|
||||
G4cerr << "G4PGeometryObjectMap::Add -- transient solid not assigned" << G4endl;
|
||||
@@ -139,7 +134,7 @@ HepRef(G4PLogicalVolume) G4PGeometryObjectMap::LookUp(
|
||||
assert(inGeomObj != 0);
|
||||
for(G4int i=0;i<noLogVol;i++)
|
||||
{
|
||||
if( transLogVolPtrs->Get(i) == inGeomObj )
|
||||
if( (*transLogVolPtrs)[i] == inGeomObj )
|
||||
{
|
||||
return persLogVolPtrs[i];
|
||||
}
|
||||
@@ -157,8 +152,7 @@ void G4PGeometryObjectMap::Add( G4LogicalVolume* inGeomObj,
|
||||
{
|
||||
// assert( inGeomObj == aGeomObj );
|
||||
noLogVol++;
|
||||
transLogVolPtrs->Resize(noLogVol);
|
||||
transLogVolPtrs->Insert(noLogVol-1, inGeomObj);
|
||||
transLogVolPtrs->push_back(inGeomObj);
|
||||
persLogVolPtrs.insert_element(outGeomObj);
|
||||
}
|
||||
}
|
||||
@@ -173,7 +167,7 @@ G4LogicalVolume* G4PGeometryObjectMap::LookUp(
|
||||
{
|
||||
if( persLogVolPtrs[i] == inGeomObj )
|
||||
{
|
||||
return transLogVolPtrs->Get(i);
|
||||
return (*transLogVolPtrs)[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,11 +178,11 @@ void G4PGeometryObjectMap::Add( HepRef(G4PLogicalVolume) inGeomObj,
|
||||
G4LogicalVolume* outGeomObj )
|
||||
{
|
||||
assert(inGeomObj != 0);
|
||||
for(G4int i=0;i<noLogVol;i++)
|
||||
for(G4int i=0; i<noLogVol; i++)
|
||||
{
|
||||
if( persLogVolPtrs[i] == inGeomObj )
|
||||
{
|
||||
transLogVolPtrs->Insert(i, outGeomObj);
|
||||
(*transLogVolPtrs)[i] = outGeomObj;
|
||||
break;
|
||||
}
|
||||
G4cerr << "G4PGeometryObjectMap::Add -- transient solid not assigned" << G4endl;
|
||||
@@ -209,14 +203,14 @@ HepRef(G4PVSolid) G4PGeometryObjectMap::LookUp( G4VSolid* inGeomObj )
|
||||
for(G4int i=0;i<noSolids;i++)
|
||||
{
|
||||
#ifdef G4PERSISTENCY_DEBUG
|
||||
G4VSolid* tmpSolid = transSolidPtrs->Get(i);
|
||||
G4VSolid* tmpSolid = (*transSolidPtrs)[i];
|
||||
cout << "[" << i << "] transSolidPtrs[i]=" << tmpSolid <<G4endl;
|
||||
cout << " persSolidPtrs[i]=";
|
||||
HepRef(G4PVSolid) tmpPSolid = persSolidPtrs[i];
|
||||
tmpPSolid.print();
|
||||
#endif
|
||||
|
||||
if( transSolidPtrs->Get(i) == inGeomObj )
|
||||
if( (*transSolidPtrs)[i] == inGeomObj )
|
||||
{
|
||||
return persSolidPtrs[i];
|
||||
}
|
||||
@@ -234,8 +228,7 @@ void G4PGeometryObjectMap::Add( G4VSolid* inGeomObj,
|
||||
{
|
||||
// assert( inGeomObj == aGeomObj );
|
||||
noSolids++;
|
||||
transSolidPtrs->Resize(noSolids);
|
||||
transSolidPtrs->Insert(noSolids-1, inGeomObj);
|
||||
transSolidPtrs->push_back(inGeomObj);
|
||||
persSolidPtrs.insert_element(outGeomObj);
|
||||
}
|
||||
}
|
||||
@@ -260,12 +253,12 @@ G4VSolid* G4PGeometryObjectMap::LookUp(
|
||||
cout << "[" << i << "] persSolidPtrs[i]=";
|
||||
HepRef(G4PVSolid) tmpPSolid = persSolidPtrs[i];
|
||||
tmpPSolid.print();
|
||||
G4VSolid* tmpSolid = transSolidPtrs->Get(i);
|
||||
G4VSolid* tmpSolid = (*transSolidPtrs)[i];
|
||||
cout << " transSolidPtrs[i]=" << tmpSolid <<G4endl;
|
||||
#endif
|
||||
if( persSolidPtrs[i] == inGeomObj )
|
||||
{
|
||||
return transSolidPtrs->Get(i);
|
||||
return (*transSolidPtrs)[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,11 +269,11 @@ void G4PGeometryObjectMap::Add( HepRef(G4PVSolid) inGeomObj,
|
||||
G4VSolid* outGeomObj )
|
||||
{
|
||||
assert(inGeomObj != 0);
|
||||
for(G4int i=0;i<noSolids;i++)
|
||||
for(G4int i=0; i<noSolids; i++)
|
||||
{
|
||||
if( persSolidPtrs[i] == inGeomObj )
|
||||
{
|
||||
transSolidPtrs->Insert(i, outGeomObj);
|
||||
(*transSolidPtrs)[i] = outGeomObj;
|
||||
break;
|
||||
}
|
||||
G4cerr << "G4PGeometryObjectMap::Add -- transient solid not assigned" << G4endl;
|
||||
@@ -293,7 +286,7 @@ G4VSolid* G4PGeometryObjectMap::GetSolid(G4int i)
|
||||
{
|
||||
if( i >= 0 && i < noSolids)
|
||||
{
|
||||
return transSolidPtrs->Get(i);
|
||||
return (*transSolidPtrs)[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -315,30 +308,30 @@ HepRef(G4PVSolid) G4PGeometryObjectMap::GetPSolid(G4int i)
|
||||
|
||||
void G4PGeometryObjectMap::InitTransientMap()
|
||||
{
|
||||
transPhysVolPtrs->Resize(noPhysVol);
|
||||
transLogVolPtrs->Resize(noLogVol);
|
||||
transSolidPtrs->Resize(noSolids);
|
||||
transPhysVolPtrs->resize(noPhysVol);
|
||||
transLogVolPtrs->resize(noLogVol);
|
||||
transSolidPtrs->resize(noSolids);
|
||||
|
||||
#ifdef G4PERSISTENCY_DEBUG
|
||||
cout << "G4PGeometryObjectMap::InitTransientMap()" << G4endl;
|
||||
cout << " -- noPhysVol: " << noPhysVol << G4endl;
|
||||
cout << " -- transPhysVolPtrs.length: " << transPhysVolPtrs->length() << G4endl;
|
||||
cout << " -- transLogVolPtrs.length: " << transLogVolPtrs->length() << G4endl;
|
||||
cout << " -- transSolidPtrs.length: " << transSolidPtrs->length() << G4endl;
|
||||
cout << " -- transPhysVolPtrs.length: " << transPhysVolPtrs->size() << G4endl;
|
||||
cout << " -- transLogVolPtrs.length: " << transLogVolPtrs->size() << G4endl;
|
||||
cout << " -- transSolidPtrs.length: " << transSolidPtrs->size() << G4endl;
|
||||
#endif
|
||||
|
||||
G4int i;
|
||||
for(i=0;i<noPhysVol;i++)
|
||||
{
|
||||
transPhysVolPtrs->Insert(i, 0);
|
||||
transPhysVolPtrs->push_back(0);
|
||||
}
|
||||
for(i=0;i<noLogVol;i++)
|
||||
{
|
||||
transLogVolPtrs->Insert(i, 0);
|
||||
transLogVolPtrs->push_back(0);
|
||||
}
|
||||
for(i=0;i<noSolids;i++)
|
||||
{
|
||||
transSolidPtrs->Insert(i, 0);
|
||||
transSolidPtrs->push_back(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user