Import Geant4 8.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:55:03 +02:00
parent 216a75eeb1
commit fe73f43734
6714 changed files with 118229 additions and 68144 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4XXX.cc,v 1.6 2006/06/29 21:27:22 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 5th April 2001
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4XXXFile.cc,v 1.2 2006/06/29 21:27:24 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 7th March 2006
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4XXXFileSceneHandler.cc,v 1.4 2006/06/29 21:27:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4XXXFileSceneHandler.cc,v 1.5 2006/07/03 16:52:49 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 7th March 2006
@@ -44,10 +44,6 @@
#include "G4Circle.hh"
#include "G4Square.hh"
#include "G4Polyhedron.hh"
#include "G4NURBS.hh"
#include "G4VTrajectory.hh"
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4UnitsTable.hh"
#include <sstream>
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4XXXFileViewer.cc,v 1.2 2006/06/29 21:27:28 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4XXXFileViewer.cc,v 1.3 2006/07/03 16:52:49 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 7th March 2006
@@ -36,14 +36,50 @@
#include "G4VSceneHandler.hh"
#include "G4XXXFileSceneHandler.hh"
#include <sstream>
void G4XXXFileViewer::FileWriter::Close()
{
if (fOpen) {
G4cout << "Closing file " << fFileName << G4endl;
fFile.close();
fOpen = false;
}
}
void G4XXXFileViewer::FileWriter::WriteItem(const G4String& item)
{
if (!fOpen)
{
std::ifstream ifs;
std::ostringstream oss;
G4int i = 0;
do {
oss.str("");
oss << "g4_" << i << ".XXXFile";
ifs.open(oss.str().c_str());
if (!ifs) break; // Doesn't exist, so can open a new file.
else ifs.close();
++i;
} while(true);
fFileName = oss.str();
G4cout << "Opening file " << fFileName << G4endl;
fFile.open(fFileName.c_str());
fOpen = true;
}
if (fFile.good()) fFile << item << std::endl;
else G4cout << "G4XXXFileViewer::FileWriter::WriteItem: ERROR" << G4endl;
}
G4XXXFileViewer::G4XXXFileViewer
(G4VSceneHandler& sceneHandler, const G4String& name):
G4VViewer(sceneHandler, sceneHandler.IncrementViewCount(), name),
fFileWriter(name + ".out")
G4VViewer(sceneHandler, sceneHandler.IncrementViewCount(), name)
{}
G4XXXFileViewer::~G4XXXFileViewer() {}
G4XXXFileViewer::~G4XXXFileViewer()
{
fFileWriter.Close();
}
void G4XXXFileViewer::SetView() {
#ifdef G4XXXFileDEBUG
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4XXXSG.cc,v 1.2 2006/06/29 21:27:33 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 10th March 2005
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4XXXSGSceneHandler.cc,v 1.3 2006/06/29 21:27:39 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4XXXSGSceneHandler.cc,v 1.6 2006/11/05 20:41:36 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 10th March 2006
@@ -46,10 +46,6 @@
#include "G4Circle.hh"
#include "G4Square.hh"
#include "G4Polyhedron.hh"
#include "G4NURBS.hh"
#include "G4VTrajectory.hh"
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4UnitsTable.hh"
#include <sstream>
@@ -61,9 +57,9 @@ G4XXXSGSceneHandler::G4XXXSGSceneHandler(G4VGraphicsSystem& system,
const G4String& name):
G4VSceneHandler(system, fSceneIdCount++, name)
{
fRoot = fSceneGraph.setRoot("root");
fPermanentsRoot = fRoot.push_back("permanentsRoot");
fTransientsRoot = fRoot.push_back("transientsRoot");
fRoot = fSceneGraph.setRoot("\nroot\n");
fPermanentsRoot = fRoot.push_back("\npermanentsRoot\n");
fTransientsRoot = fRoot.push_back("\ntransientsRoot\n");
}
G4XXXSGSceneHandler::~G4XXXSGSceneHandler() {}
@@ -117,6 +113,7 @@ void G4XXXSGSceneHandler::CreateCurrentItem(const G4String& header) {
//G4VPhysicalVolume* pCurrentPV = pPVModel->GetCurrentPV();
G4LogicalVolume* pCurrentLV = pPVModel->GetCurrentLV();
//G4Material* pCurrentMaterial = pPVModel->GetCurrentMaterial();
// Note: pCurrentMaterial may be zero (parallel world).
// The simplest algorithm, used by the Open Inventor Driver
// developers, is to rely on the fact the G4PhysicalVolumeModel
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4XXXSGViewer.cc,v 1.3 2006/06/29 21:27:42 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4XXXSGViewer.cc,v 1.4 2006/08/29 16:11:25 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 10th March 2006
@@ -121,19 +121,17 @@ G4bool G4XXXSGViewer::CompareForKernelVisit(G4ViewParameters& lastVP)
// Typical comparison. Taken from OpenGL.
if (
(lastVP.GetDrawingStyle () != fVP.GetDrawingStyle ()) ||
(lastVP.IsAuxEdgeVisible () != fVP.IsAuxEdgeVisible ()) ||
(lastVP.GetRepStyle () != fVP.GetRepStyle ()) ||
(lastVP.IsCulling () != fVP.IsCulling ()) ||
(lastVP.IsCullingInvisible () != fVP.IsCullingInvisible ()) ||
(lastVP.IsDensityCulling () != fVP.IsDensityCulling ()) ||
(lastVP.IsCullingCovered () != fVP.IsCullingCovered ()) ||
(lastVP.IsSection () != fVP.IsSection ()) ||
// No need to visit kernel if section plane changes.
(lastVP.IsCutaway () != fVP.IsCutaway ()) ||
(lastVP.GetCutawayPlanes ().size () !=
fVP.GetCutawayPlanes ().size ()) ||
// No need to visit kernel if cutaway planes change.
(lastVP.IsExplode () != fVP.IsExplode ()) ||
(lastVP.GetNoOfSides () != fVP.GetNoOfSides ()) ||
(lastVP.IsMarkerNotHidden () != fVP.IsMarkerNotHidden ()) ||
(lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())
) {
return true;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4XXXSceneHandler.cc,v 1.31 2006/06/29 21:27:44 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4XXXSceneHandler.cc,v 1.32 2006/07/03 16:52:49 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 5th April 2001
@@ -42,12 +42,6 @@
#include "G4Circle.hh"
#include "G4Square.hh"
#include "G4Polyhedron.hh"
/*
#include "G4NURBS.hh"
#include "G4VTrajectory.hh"
#include "G4AttDef.hh"
#include "G4AttValue.hh"
*/
#include "G4UnitsTable.hh"
G4int G4XXXSceneHandler::fSceneIdCount = 0;
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4XXXStored.cc,v 1.2 2006/06/29 21:27:46 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 7th March 2006
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4XXXStoredSceneHandler.cc,v 1.4 2006/06/29 21:27:48 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4XXXStoredSceneHandler.cc,v 1.9 2006/10/26 11:30:10 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 7th March 2006
@@ -44,11 +44,10 @@
#include "G4Circle.hh"
#include "G4Square.hh"
#include "G4Polyhedron.hh"
#include "G4NURBS.hh"
#include "G4VTrajectory.hh"
#include "G4UnitsTable.hh"
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4UnitsTable.hh"
#include "G4AttCheck.hh"
#include <sstream>
@@ -93,9 +92,59 @@ void G4XXXStoredSceneHandler::PrintThings() {
void G4XXXStoredSceneHandler::PreAddSolid
(const G4Transform3D& objectTransformation,
const G4VisAttributes& visAttribs)
{
{
G4VSceneHandler::PreAddSolid(objectTransformation, visAttribs);
// Get user G4Atts...
const std::map<G4String,G4AttDef>* userAttDefs = visAttribs.GetAttDefs();
if (userAttDefs) {
#ifdef G4XXXStoredDEBUG
const std::vector<G4AttValue>* userAttValues =
visAttribs.CreateAttValues();
G4cout << "\nProvided G4Atts:\n"
<< G4AttCheck(userAttValues, userAttDefs);
// Extra checks...
G4AttCheck attCheck(userAttValues, userAttDefs);
if (attCheck.Check()) G4cout << "Error" << G4endl;
else {
std::vector<G4AttValue> standardValues;
std::map<G4String,G4AttDef> standardDefinitions;
attCheck.Standard(&standardValues, &standardDefinitions);
G4cout << "\nStandard G4Atts:\n"
<< G4AttCheck(&standardValues, &standardDefinitions);
}
// End of extra checks.
delete userAttValues; // (Must be deleted after use.)
#endif
}
// Get solid's G4Atts created by G4PhysicalVolumeModel...
G4PhysicalVolumeModel* pPVModel =
dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
if (pPVModel) {
const std::map<G4String,G4AttDef>* solidAttDefs = pPVModel->GetAttDefs();
if (solidAttDefs) {
#ifdef G4XXXStoredDEBUG
std::vector<G4AttValue>* solidAttValues =
pPVModel->CreateCurrentAttValues();
G4cout << "\nProvided G4Atts:\n"
<< G4AttCheck(solidAttValues, solidAttDefs);
// Extra checks...
G4AttCheck attCheck(solidAttValues,solidAttDefs);
if (attCheck.Check()) G4cout << "Error" << G4endl;
else {
std::vector<G4AttValue> standardValues;
std::map<G4String,G4AttDef> standardDefinitions;
attCheck.Standard(&standardValues, &standardDefinitions);
G4cout << "\nStandard G4Atts:\n"
<< G4AttCheck(&standardValues, &standardDefinitions);
}
// End of extra checks.
delete solidAttValues; // (Must be deleted after use.)
#endif
}
}
// Create a place for current solid...
fCurrentItem = fStore.insert(fStore.end(), G4String("\nPreAddSolid:\n"));
if (fReadyForTransients) {
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4XXXStoredViewer.cc,v 1.4 2006/06/29 21:27:50 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4XXXStoredViewer.cc,v 1.5 2006/08/29 16:11:25 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 7th March 2006
@@ -117,19 +117,17 @@ G4bool G4XXXStoredViewer::CompareForKernelVisit(G4ViewParameters& lastVP)
// Typical comparison. Taken from OpenGL.
if (
(lastVP.GetDrawingStyle () != fVP.GetDrawingStyle ()) ||
(lastVP.IsAuxEdgeVisible () != fVP.IsAuxEdgeVisible ()) ||
(lastVP.GetRepStyle () != fVP.GetRepStyle ()) ||
(lastVP.IsCulling () != fVP.IsCulling ()) ||
(lastVP.IsCullingInvisible () != fVP.IsCullingInvisible ()) ||
(lastVP.IsDensityCulling () != fVP.IsDensityCulling ()) ||
(lastVP.IsCullingCovered () != fVP.IsCullingCovered ()) ||
(lastVP.IsSection () != fVP.IsSection ()) ||
// No need to visit kernel if section plane changes.
(lastVP.IsCutaway () != fVP.IsCutaway ()) ||
(lastVP.GetCutawayPlanes ().size () !=
fVP.GetCutawayPlanes ().size ()) ||
// No need to visit kernel if cutaway planes change.
(lastVP.IsExplode () != fVP.IsExplode ()) ||
(lastVP.GetNoOfSides () != fVP.GetNoOfSides ()) ||
(lastVP.IsMarkerNotHidden () != fVP.IsMarkerNotHidden ()) ||
(lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())
) {
return true;
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4XXXViewer.cc,v 1.9 2006/06/29 21:27:52 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 5th April 2001