Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXX.cc,v 1.6 2006-06-29 21:27:22 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXFile.cc,v 1.2 2006-06-29 21:27:24 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 7th March 2006
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXFileSceneHandler.cc,v 1.5 2006-07-03 16:52:49 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 7th March 2006
|
||||
@@ -36,6 +35,7 @@
|
||||
|
||||
#include "G4XXXFileViewer.hh"
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
#include "G4LogicalVolumeModel.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Box.hh"
|
||||
@@ -78,6 +78,7 @@ void G4XXXFileSceneHandler::PrintThings() {
|
||||
"\n current physical volume: "
|
||||
<< pPVModel->GetCurrentPV()->GetName() <<
|
||||
"\n current logical volume: "
|
||||
// There might be a problem with the LV pointer if this is a G4LogicalVolumeModel
|
||||
<< pPVModel->GetCurrentLV()->GetName() <<
|
||||
"\n current depth of geometry tree: "
|
||||
<< pPVModel->GetCurrentDepth();
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXFileViewer.cc,v 1.3 2006-07-03 16:52:49 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 7th March 2006
|
||||
|
||||
@@ -24,16 +24,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXSG.cc,v 1.2 2006-06-29 21:27:33 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 10th March 2005
|
||||
// A template for a sophisticated graphics driver with a scene graph.
|
||||
//?? Lines or sections marked like this require specialisation for your driver.
|
||||
|
||||
#ifdef G4VIS_BUILD_XXXSG_DRIVER
|
||||
|
||||
#include "G4XXXSG.hh"
|
||||
#include "G4XXXSGSceneHandler.hh"
|
||||
#include "G4XXXSGViewer.hh"
|
||||
@@ -73,5 +70,3 @@ G4VViewer* G4XXXSG::CreateViewer(G4VSceneHandler& scene,
|
||||
}
|
||||
return pView;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXSGSceneHandler.cc,v 1.6 2006-11-05 20:41:36 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 10th March 2006
|
||||
@@ -36,6 +35,7 @@
|
||||
|
||||
#include "G4XXXSGViewer.hh"
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
#include "G4LogicalVolumeModel.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Box.hh"
|
||||
@@ -78,6 +78,7 @@ void G4XXXSGSceneHandler::PrintThings() {
|
||||
"\n current physical volume: "
|
||||
<< pPVModel->GetCurrentPV()->GetName() <<
|
||||
"\n current logical volume: "
|
||||
// There might be a problem with the LV pointer if this is a G4LogicalVolumeModel
|
||||
<< pPVModel->GetCurrentLV()->GetName() <<
|
||||
"\n current depth of geometry tree: "
|
||||
<< pPVModel->GetCurrentDepth();
|
||||
@@ -91,8 +92,9 @@ void G4XXXSGSceneHandler::CreateCurrentItem(const G4String& /*header*/) {
|
||||
|
||||
G4PhysicalVolumeModel* pPVModel =
|
||||
dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
|
||||
|
||||
if (pPVModel) {
|
||||
G4LogicalVolumeModel* pLVModel =
|
||||
dynamic_cast<G4LogicalVolumeModel*>(pPVModel);
|
||||
if (pPVModel && !pLVModel) {
|
||||
|
||||
// This call comes from a G4PhysicalVolumeModel. drawnPVPath is
|
||||
// the path of the current drawn (non-culled) volume in terms of
|
||||
@@ -407,17 +409,13 @@ void G4XXXSGSceneHandler::AddPrimitive(const G4NURBS&) {
|
||||
//?? Don't bother implementing this. NURBS are not functional.
|
||||
}
|
||||
|
||||
void G4XXXSGSceneHandler::ClearStore () {
|
||||
|
||||
G4VSceneHandler::ClearStore (); // Sets need kernel visit, etc.
|
||||
|
||||
void G4XXXSGSceneHandler::ClearStore ()
|
||||
{
|
||||
JA::Clear(&fSceneGraph);
|
||||
}
|
||||
|
||||
void G4XXXSGSceneHandler::ClearTransientStore () {
|
||||
|
||||
G4VSceneHandler::ClearTransientStore ();
|
||||
|
||||
void G4XXXSGSceneHandler::ClearTransientStore ()
|
||||
{
|
||||
JA::Clear(&fSceneGraph);
|
||||
}
|
||||
|
||||
@@ -440,8 +438,8 @@ void Insert(const PVNodeID* pvPath, size_t pathLength,
|
||||
|
||||
// See if node has been encountered before
|
||||
G4bool found = false; size_t foundPosition = 0;
|
||||
for (size_t i = 0; i < node->daughters.size(); ++i) {
|
||||
PVNodeID& daughterPVNodeID = node->daughters[i]->pvNodeID;
|
||||
for (size_t i = 0; i < node->fDaughters.size(); ++i) {
|
||||
PVNodeID& daughterPVNodeID = node->fDaughters[i]->fPVNodeID;
|
||||
// It is enough to compare volume and copy number at a given position in the tree
|
||||
if (daughterPVNodeID.GetPhysicalVolume() == pvPath[0].GetPhysicalVolume() &&
|
||||
daughterPVNodeID.GetCopyNo() == pvPath[0].GetCopyNo()) {
|
||||
@@ -453,9 +451,9 @@ void Insert(const PVNodeID* pvPath, size_t pathLength,
|
||||
|
||||
if (pathLength == 1) { // This is a leaf
|
||||
if (found) { // Update index
|
||||
node->daughters[foundPosition]->index = index;
|
||||
node->fDaughters[foundPosition]->fIndex = index;
|
||||
} else { // Make a new full entry
|
||||
node->daughters.push_back(new Node(pvPath[0],index));
|
||||
node->fDaughters.push_back(new Node(pvPath[0],index));
|
||||
}
|
||||
/* Debug
|
||||
std::cout << std::endl;
|
||||
@@ -463,11 +461,11 @@ void Insert(const PVNodeID* pvPath, size_t pathLength,
|
||||
} else { // Not a leaf - carry on with rest of path
|
||||
if (found) { // Just carry on
|
||||
Insert(pvPath+1,--pathLength,index,
|
||||
node->daughters[foundPosition]);
|
||||
node->fDaughters[foundPosition]);
|
||||
} else { // Insert place holder, then carry on
|
||||
node->daughters.push_back(new Node(pvPath[0]));
|
||||
node->fDaughters.push_back(new Node(pvPath[0]));
|
||||
Insert(pvPath+1,--pathLength,index,
|
||||
node->daughters[node->daughters.size()-1]);
|
||||
node->fDaughters[node->fDaughters.size()-1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -476,9 +474,9 @@ void PrintTree(std::ostream& os, Node* node)
|
||||
{
|
||||
static G4int depth = -1;
|
||||
depth++;
|
||||
PVNodeID& thisPVNodeID = node->pvNodeID;
|
||||
G4int& thisIndex = node->index;
|
||||
const size_t& nDaughters = node->daughters.size();
|
||||
PVNodeID& thisPVNodeID = node->fPVNodeID;
|
||||
G4int& thisIndex = node->fIndex;
|
||||
const size_t& nDaughters = node->fDaughters.size();
|
||||
G4VPhysicalVolume* thisPhysicalVolume= thisPVNodeID.GetPhysicalVolume();
|
||||
if (!thisPhysicalVolume) os << "Root" << std::endl;
|
||||
else {
|
||||
@@ -488,17 +486,17 @@ void PrintTree(std::ostream& os, Node* node)
|
||||
<< thisIndex << ")" << std::endl;;
|
||||
}
|
||||
for (size_t i = 0; i < nDaughters; ++i) {
|
||||
PrintTree(os, node->daughters[i]);
|
||||
PrintTree(os, node->fDaughters[i]);
|
||||
}
|
||||
depth--;
|
||||
}
|
||||
|
||||
void Clear(Node* node)
|
||||
{
|
||||
const size_t& nDaughters = node->daughters.size();
|
||||
const size_t& nDaughters = node->fDaughters.size();
|
||||
for (size_t i = 0; i < nDaughters; ++i) {
|
||||
Clear(node->daughters[i]);
|
||||
delete node->daughters[i];
|
||||
Clear(node->fDaughters[i]);
|
||||
delete node->fDaughters[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXSGViewer.cc,v 1.5 2010-10-06 10:12:03 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 10th March 2006
|
||||
@@ -105,7 +104,7 @@ void G4XXXSGViewer::KernelVisitDecision () {
|
||||
|
||||
SceneGraph& sceneGraph =
|
||||
static_cast<G4XXXSGSceneHandler&>(fSceneHandler).fSceneGraph;
|
||||
if (sceneGraph.daughters.size() == 3 // I.e., only the root nodes.
|
||||
if (sceneGraph.fDaughters.size() == 3 // I.e., only the root nodes.
|
||||
// (The above needs re-thinking.)
|
||||
|| CompareForKernelVisit(fLastVP)) {
|
||||
NeedKernelVisit (); // Sets fNeedKernelVisit.
|
||||
@@ -133,7 +132,9 @@ G4bool G4XXXSGViewer::CompareForKernelVisit(G4ViewParameters& lastVP)
|
||||
fVP.GetDefaultVisAttributes()->GetColour()) ||
|
||||
(lastVP.GetDefaultTextVisAttributes()->GetColour() !=
|
||||
fVP.GetDefaultTextVisAttributes()->GetColour()) ||
|
||||
(lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())
|
||||
(lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())||
|
||||
(lastVP.GetVisAttributesModifiers().size() !=
|
||||
fVP.GetVisAttributesModifiers().size())
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXSceneHandler.cc,v 1.32 2006-07-03 16:52:49 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
@@ -35,6 +34,7 @@
|
||||
#include "G4XXXSceneHandler.hh"
|
||||
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
#include "G4LogicalVolumeModel.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Polyline.hh"
|
||||
@@ -73,6 +73,7 @@ void G4XXXSceneHandler::PrintThings() {
|
||||
"\n current physical volume: "
|
||||
<< pPVModel->GetCurrentPV()->GetName() <<
|
||||
"\n current logical volume: "
|
||||
// There might be a problem with the LV pointer if this is a G4LogicalVolumeModel
|
||||
<< pPVModel->GetCurrentLV()->GetName() <<
|
||||
"\n current depth of geometry tree: "
|
||||
<< pPVModel->GetCurrentDepth();
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXStored.cc,v 1.2 2006-06-29 21:27:46 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 7th March 2006
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXStoredSceneHandler.cc,v 1.9 2006-10-26 11:30:10 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 7th March 2006
|
||||
@@ -36,6 +35,7 @@
|
||||
|
||||
#include "G4XXXStoredViewer.hh"
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
#include "G4LogicalVolumeModel.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Box.hh"
|
||||
@@ -81,6 +81,7 @@ void G4XXXStoredSceneHandler::PrintThings() {
|
||||
"\n current physical volume: "
|
||||
<< pPVModel->GetCurrentPV()->GetName() <<
|
||||
"\n current logical volume: "
|
||||
// There might be a problem with the LV pointer if this is a G4LogicalVolumeModel
|
||||
<< pPVModel->GetCurrentLV()->GetName() <<
|
||||
"\n current depth of geometry tree: "
|
||||
<< pPVModel->GetCurrentDepth();
|
||||
@@ -375,21 +376,15 @@ void G4XXXStoredSceneHandler::AddPrimitive(const G4NURBS&) {
|
||||
//?? Don't bother implementing this. NURBS are not functional.
|
||||
}
|
||||
|
||||
void G4XXXStoredSceneHandler::ClearStore () {
|
||||
|
||||
G4VSceneHandler::ClearStore (); // Sets need kernel visit, etc.
|
||||
|
||||
void G4XXXStoredSceneHandler::ClearStore ()
|
||||
{
|
||||
fStore.clear();
|
||||
fPermanents.clear();
|
||||
fTransients.clear();
|
||||
}
|
||||
|
||||
void G4XXXStoredSceneHandler::ClearTransientStore () {
|
||||
|
||||
G4VSceneHandler::ClearTransientStore ();
|
||||
|
||||
typedef std::list<G4String> Store;
|
||||
typedef std::list<G4String>::iterator StoreIterator;
|
||||
void G4XXXStoredSceneHandler::ClearTransientStore ()
|
||||
{
|
||||
typedef std::vector<StoreIterator>::iterator StoreIteratorIterator;
|
||||
for (StoreIteratorIterator i = fTransients.begin();
|
||||
i != fTransients.end(); ++i) {
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXStoredViewer.cc,v 1.6 2010-10-06 10:12:03 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 7th March 2006
|
||||
@@ -132,7 +131,9 @@ G4bool G4XXXStoredViewer::CompareForKernelVisit(G4ViewParameters& lastVP)
|
||||
fVP.GetDefaultVisAttributes()->GetColour()) ||
|
||||
(lastVP.GetDefaultTextVisAttributes()->GetColour() !=
|
||||
fVP.GetDefaultTextVisAttributes()->GetColour()) ||
|
||||
(lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())
|
||||
(lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())||
|
||||
(lastVP.GetVisAttributesModifiers().size() !=
|
||||
fVP.GetVisAttributesModifiers().size())
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4XXXViewer.cc,v 1.9 2006-06-29 21:27:52 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
|
||||
Reference in New Issue
Block a user