Import Geant4 9.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.$Id: History,v 1.126 2007/05/22 17:05:26 allison Exp $
|
||||
.$Id: History,v 1.127 2007/11/16 20:29:04 perl Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,12 @@ committal in the CVS repository !
|
||||
History file for visualization/HepRep sub-category
|
||||
--------------------------------------------------
|
||||
|
||||
16 Nov 2007 Joseph Perl (vis-HepRep-V09-00-01)
|
||||
- Adjust geometry hierarchy in G4HepRepFileSceneHandler to accomodate
|
||||
parallel worlds. Where used to just have world at top of hierarchy,
|
||||
now have world or worlds as one level below top level of geometry.
|
||||
- Cleaned up G4HepRepSceneHandler (just removing inaccurate old comment).
|
||||
|
||||
22 May 2007 John Allison (vis-HepRep-V08-03-00)
|
||||
- Fixed memory leak in G4HepRepFile.
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
This G4 Graphics Driver creates a HepRep File suitable for viewing
|
||||
by the WIRED Event Display client. It requires no external packages.
|
||||
by the HepRApp, Wired4 or FRED Event Display clients.
|
||||
It requires no external packages.
|
||||
|
||||
The HepRep graphics format is further described at
|
||||
http://heprep.freehep.org
|
||||
http://www.slac.stanford.edu/~perl/heprep/
|
||||
|
||||
|
||||
Two different drivers are available for either HepRep1 or HepRep2.
|
||||
@@ -33,15 +34,15 @@ choose to make them visible from within the heprep browser).
|
||||
To force culling of invisible objects,
|
||||
set G44HEPREPFILE_CULL
|
||||
|
||||
View the file using the WIRED3 HepRep Browser, available from:
|
||||
http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/
|
||||
View the file using the HepRApp HepRep Browser, available from:
|
||||
http://www.slac.stanford.edu/~perl/HepRApp
|
||||
|
||||
WIRED can read xml files in zipped format as well as unzipped,
|
||||
HepRApp can read xml files in zipped format as well as unzipped,
|
||||
so you can save space by applying gzip to the xml file.
|
||||
This will reduce the file to about five percent of its original size.
|
||||
|
||||
Joseph Perl
|
||||
2 June 2005
|
||||
15 November 2007
|
||||
|
||||
|
||||
Driver: HepRepXML
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRep.hh,v 1.17 2006/06/29 21:17:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFile.hh,v 1.8 2006/06/29 21:17:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileSceneHandler.hh,v 1.29 2006/06/29 21:17:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
// Joseph Perl 27th January 2002
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileViewer.hh,v 1.9 2006/06/29 21:17:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepMessenger.hh,v 1.7 2006/06/29 21:17:14 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
#ifndef G4HepRepMessenger_HH
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepSceneHandler.hh,v 1.42 2006/11/06 09:22:26 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepViewer.hh,v 1.18 2006/06/29 21:17:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRep.cc,v 1.22 2006/06/29 21:17:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepFile.cc,v 1.11 2007/05/22 17:05:26 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
// Joseph Perl 1 October 2001
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepFileSceneHandler.cc,v 1.64 2006/11/16 21:06:11 perl Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4HepRepFileSceneHandler.cc,v 1.65 2007/11/16 20:29:04 perl Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
// Joseph Perl 27th January 2002
|
||||
@@ -586,7 +586,6 @@ void G4HepRepFileSceneHandler::AddCompound (const G4VTrajectory& traj) {
|
||||
// Do not write out the Aux or Pos attribute. Aux does not conform to the HepRep rule
|
||||
// that each object can have only one instance of a given AttValue.
|
||||
// Both of these attributes are redundant to actual position information of the point.
|
||||
// New Wired can just tell the user the point position itself.
|
||||
if (strcmp(iAttVal->GetName(),"Aux-X")!=0 &&
|
||||
strcmp(iAttVal->GetName(),"Aux-Y")!=0 &&
|
||||
strcmp(iAttVal->GetName(),"Aux-Z")!=0 &&
|
||||
@@ -708,7 +707,6 @@ void G4HepRepFileSceneHandler::AddCompound (const G4VTrajectory& traj) {
|
||||
// Do not write out the Aux or Pos attribute. Aux does not conform to the HepRep rule
|
||||
// that each object can have only one instance of a given AttValue.
|
||||
// Both of these attributes are redundant to actual position information of the point.
|
||||
// New Wired can just tell the user the point position itself.
|
||||
if (strcmp(iAttVal->GetName(),"Aux-X")!=0 &&
|
||||
strcmp(iAttVal->GetName(),"Aux-Y")!=0 &&
|
||||
strcmp(iAttVal->GetName(),"Aux-Z")!=0 &&
|
||||
@@ -818,7 +816,6 @@ void G4HepRepFileSceneHandler::AddCompound (const G4VTrajectory& traj) {
|
||||
// Do not write out the Aux or Pos attribute. Aux does not conform to the HepRep rule
|
||||
// that each object can have only one instance of a given AttValue.
|
||||
// Both of these attributes are redundant to actual position information of the point.
|
||||
// New Wired can just tell the user the point position itself.
|
||||
if (strcmp(iAttVal->GetName(),"Aux-X")!=0 &&
|
||||
strcmp(iAttVal->GetName(),"Aux-Y")!=0 &&
|
||||
strcmp(iAttVal->GetName(),"Aux-Z")!=0 &&
|
||||
@@ -1391,42 +1388,45 @@ void G4HepRepFileSceneHandler::AddHepRepInstance(const char* primName,
|
||||
// replacing G4's top geometry level name "worldPhysical" with the
|
||||
// name "Detector Geometry".
|
||||
} else {
|
||||
//G4cout << "CurrentDepth" << currentDepth << G4endl;
|
||||
//G4cout << "currentName" << pCurrentPV->GetName() << G4endl;
|
||||
if (strcmp("Detector Geometry",hepRepXMLWriter->prevTypeName[0])!=0) {
|
||||
//G4cout << "Adding Det Geom type" << G4endl;
|
||||
hepRepXMLWriter->addType("Detector Geometry",0);
|
||||
hepRepXMLWriter->addInstance();
|
||||
}
|
||||
|
||||
// Re-insert any layers of the hierarchy that were removed by G4's culling process.
|
||||
// Don't bother checking if same type name as last instance.
|
||||
if(strcmp(hepRepXMLWriter->prevTypeName[currentDepth],pCurrentPV->GetName())!=0) {
|
||||
if(strcmp(hepRepXMLWriter->prevTypeName[currentDepth+1],pCurrentPV->GetName())!=0) {
|
||||
//G4cout << "Looking for mother of:" << pCurrentLV->GetName() << G4endl;
|
||||
typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
|
||||
typedef std::vector<PVNodeID> PVPath;
|
||||
const PVPath& drawnPVPath = pPVModel->GetDrawnPVPath();
|
||||
PVPath::const_reverse_iterator ri = ++drawnPVPath.rbegin();
|
||||
G4int drawnMotherDepth = 0;
|
||||
G4int drawnMotherDepth;
|
||||
if (ri != drawnPVPath.rend()) {
|
||||
// This volume has a mother.
|
||||
drawnMotherDepth = ri->GetNonCulledDepth();
|
||||
//G4cout << "drawnMotherDepth" << drawnMotherDepth << G4endl;
|
||||
} else {
|
||||
// This volume has no mother. Must be a top level volume.
|
||||
drawnMotherDepth = -1;
|
||||
//G4cout << "Mother must be very top" << G4endl;
|
||||
}
|
||||
|
||||
while (drawnMotherDepth < (currentDepth-1)) {
|
||||
G4String culledParentName = "Culled parent of " + pCurrentPV->GetName();
|
||||
//G4cout << "Inserting culled layer " << culledParentName << " at depth:" << drawnMotherDepth+1 << G4endl;
|
||||
hepRepXMLWriter->addType(culledParentName, drawnMotherDepth+1);
|
||||
//G4cout << "Inserting culled layer " << culledParentName << " at depth:" << drawnMotherDepth+2 << G4endl;
|
||||
hepRepXMLWriter->addType(culledParentName, drawnMotherDepth+2);
|
||||
hepRepXMLWriter->addInstance();
|
||||
drawnMotherDepth ++;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentDepth!=0) {
|
||||
// Add the HepRepType for the current volume.
|
||||
hepRepXMLWriter->addType(pCurrentPV->GetName(),currentDepth);
|
||||
hepRepXMLWriter->addInstance();
|
||||
}
|
||||
// Add the HepRepType for the current volume.
|
||||
hepRepXMLWriter->addType(pCurrentPV->GetName(),currentDepth+1);
|
||||
hepRepXMLWriter->addInstance();
|
||||
|
||||
if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
|
||||
return;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepFileViewer.cc,v 1.15 2006/06/29 21:17:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
|
||||
#include "G4HepRepFileViewer.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepMessenger.cc,v 1.10 2006/06/29 21:17:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
#include "G4HepRepMessenger.hh"
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepSceneHandler.cc,v 1.100 2006/11/16 12:17:54 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4HepRepSceneHandler.cc,v 1.101 2007/11/16 20:29:04 perl Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -1241,10 +1241,7 @@ void G4HepRepSceneHandler::addAttVals(HepRepAttribute* attribute, const map<G4St
|
||||
if (attValues == NULL) return;
|
||||
|
||||
// Copy the instance's G4AttValues to HepRepAttValues.
|
||||
for (vector<G4AttValue>::iterator attValIterator = attValues->begin(); attValIterator != attValues->end(); attValIterator++) {
|
||||
// Use GetDesc rather than GetName once WIRED can handle names with spaces in them.
|
||||
//attribute->addAttValue(iAttDef->second.GetDesc(), iAttVal->GetValue());
|
||||
|
||||
for (vector<G4AttValue>::iterator attValIterator = attValues->begin(); attValIterator != attValues->end(); attValIterator++) {
|
||||
G4String name = attValIterator->GetName();
|
||||
|
||||
HepRepPoint* point = dynamic_cast<HepRepPoint*>(attribute);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepViewer.cc,v 1.26 2006/06/29 21:17:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user