Last active
May 13, 2016 15:48
-
-
Save davidchall/b2856e2e7d4a844123bb08f280b78386 to your computer and use it in GitHub Desktop.
Changes to Geant4.10.2.p01 for TOPAS 3.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Naur geant4.10.02.p01/source/geometry/solids/specific/src/G4TessellatedSolid.cc geant4.10.02.p01-topas3/source/geometry/solids/specific/src/G4TessellatedSolid.cc | |
--- geant4.10.02.p01/source/geometry/solids/specific/src/G4TessellatedSolid.cc 2016-03-02 03:24:12.000000000 -0500 | |
+++ geant4.10.02.p01-topas3/source/geometry/solids/specific/src/G4TessellatedSolid.cc 2016-05-13 11:42:21.000000000 -0400 | |
@@ -1674,7 +1674,7 @@ | |
const G4ThreeVector& v)const | |
{ | |
G4double dist = DistanceToInCore(p,v,kInfinity); | |
-#ifdef G4SPECSDEBUG | |
+//#ifdef G4SPECSDEBUG | |
if (dist < kInfinity) | |
{ | |
if (Inside(p + dist*v) != kSurface) | |
@@ -1684,10 +1684,10 @@ | |
<< G4endl | |
<< "at point: " << p << "and direction: " << v; | |
G4Exception("G4TessellatedSolid::DistanceToIn(p,v)", | |
- "GeomSolids1002", JustWarning, message); | |
+ "GeomSolids1002", EventMustBeAborted, message); | |
} | |
} | |
-#endif | |
+//#endif | |
return dist; | |
} | |
@@ -1736,7 +1736,7 @@ | |
*norm = n; | |
*validNorm = valid; | |
} | |
-#ifdef G4SPECSDEBUG | |
+//#ifdef G4SPECSDEBUG | |
if (dist < kInfinity) | |
{ | |
if (Inside(p + dist*v) != kSurface) | |
@@ -1746,10 +1746,10 @@ | |
<< G4endl | |
<< "at point: " << p << "and direction: " << v; | |
G4Exception("G4TessellatedSolid::DistanceToOut(p,v,..)", | |
- "GeomSolids1002", JustWarning, message); | |
+ "GeomSolids1002", EventMustBeAborted, message); | |
} | |
} | |
-#endif | |
+//#endif | |
return dist; | |
} | |
diff -Naur geant4.10.02.p01/source/visualization/OpenGL/src/G4OpenGLXViewer.cc geant4.10.02.p01-topas3/source/visualization/OpenGL/src/G4OpenGLXViewer.cc | |
--- geant4.10.02.p01/source/visualization/OpenGL/src/G4OpenGLXViewer.cc 2016-03-02 03:24:12.000000000 -0500 | |
+++ geant4.10.02.p01-topas3/source/visualization/OpenGL/src/G4OpenGLXViewer.cc 2016-05-13 11:45:36.000000000 -0400 | |
@@ -92,6 +92,7 @@ | |
} | |
void G4OpenGLXViewer::SetView () { | |
+ glXMakeCurrent (dpy, win, cxMaster); | |
G4OpenGLViewer::SetView (); | |
} | |
diff -Naur geant4.10.02.p01/source/visualization/management/src/G4VisManager.cc geant4.10.02.p01-topas3/source/visualization/management/src/G4VisManager.cc | |
--- geant4.10.02.p01/source/visualization/management/src/G4VisManager.cc 2016-03-02 03:24:13.000000000 -0500 | |
+++ geant4.10.02.p01-topas3/source/visualization/management/src/G4VisManager.cc 2016-05-13 11:45:11.000000000 -0400 | |
@@ -1617,6 +1617,8 @@ | |
G4GeometryWorkspacePool::GetInstance()->CreateAndUseWorkspace(); | |
G4SolidsWorkspacePool::GetInstance()->CreateAndUseWorkspace(); | |
+ G4Navigator* navigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking(); | |
+ navigator->SetWorldVolume(G4MTRunManager::GetMasterRunManagerKernel()->GetCurrentWorld()); | |
pViewer->SwitchToVisSubThread(); | |
@@ -1657,11 +1659,9 @@ | |
if (pScene->GetRefreshAtEndOfEvent()) { | |
- // ShowView guarantees the view comes to the screen. No action | |
- // is taken for passive viewers like OGL*X (without picking enabled), | |
- // but it passes control to interactive viewers, such as OGL*X (with | |
- // picking enabled) or OGL*Xm, and allows file-writing viewers to | |
- // close the file. | |
+ // ShowView guarantees the view is flushed to the screen. It also | |
+ // triggers other features such picking (if enabled) and allows | |
+ // file-writing viewers to close the file. | |
pViewer->ShowView(); | |
pSceneHandler->SetMarkForClearingTransientStore(true); | |
@@ -1682,7 +1682,11 @@ | |
G4MUTEXLOCK(&mtVisSubThreadMutex); | |
G4int runInProgress = mtRunInProgress; | |
G4MUTEXUNLOCK(&mtVisSubThreadMutex); | |
- if (!runInProgress) break; | |
+ if (!runInProgress) { | |
+ // EndOfRun on master thread has signalled end of run. There is | |
+ // nothing to draw so... | |
+ break; | |
+ } | |
// Run still in progress but nothing to draw, so wait a while. | |
#ifdef G4VIS_USE_STD11 | |
@@ -1692,7 +1696,22 @@ | |
#endif | |
} | |
- // Inform viewer that we have finished all sub-thread drawing for now... | |
+ // EndOfRun on master thread has signalled end of run | |
+ if (pScene->GetRefreshAtEndOfRun()) { | |
+ pSceneHandler->DrawEndOfRunModels(); | |
+ // ShowView guarantees the view is flushed to the screen. It also | |
+ // triggers other features such picking (if enabled) and allows | |
+ // file-writing viewers to close the file. | |
+ pViewer->ShowView(); | |
+ // An extra refresh for auto-refresh viewers. | |
+ // ???? I DON'T THINK THIS IS NECESSARY ???? JA ???? | |
+ // if (pViewer->GetViewParameters().IsAutoRefresh()) { | |
+ // pViewer->RefreshView(); | |
+ // } | |
+ pSceneHandler->SetMarkForClearingTransientStore(true); | |
+ } | |
+ | |
+ // Inform viewer that we have finished all sub-thread drawing | |
pViewer->DoneWithVisSubThread(); | |
pViewer->MovingToMasterThread(); | |
// G4cout << "G4VisManager::G4VisSubThread: Vis sub-thread: ending" << G4endl; | |
@@ -1927,11 +1946,9 @@ | |
// Unless last event (in which case wait end of run)... | |
if (eventID < nEventsToBeProcessed - 1) { | |
- // ShowView guarantees the view comes to the screen. No action | |
- // is taken for passive viewers like OGL*X (without picking enabled), | |
- // but it passes control to interactive viewers, such as OGL*X (with | |
- // picking enabled) or OGL*Xm, and allows file-writing viewers to | |
- // close the file. | |
+ // ShowView guarantees the view is flushed to the screen. It also | |
+ // triggers other features such picking (if enabled) and allows | |
+ // file-writing viewers to close the file. | |
fpViewer->ShowView(); | |
} else { // Last event... | |
// Keep, but only if user has not kept any... | |
@@ -2103,19 +2120,21 @@ | |
// // figured out why). ???? JA ???? | |
// if (!fpSceneHandler->GetMarkForClearingTransientStore()) { | |
if (fpScene->GetRefreshAtEndOfRun()) { | |
- fpSceneHandler->DrawEndOfRunModels(); | |
- // ShowView guarantees the view comes to the screen. No action | |
- // is taken for passive viewers like OGL*X (without picking enabled), | |
- // but it passes control to interactive viewers, such as OGL*X (with | |
- // picking enabled) or OGL*Xm, and allows file-writing viewers to | |
- // close the file. | |
+ // Some instructions that should NOT be in multithreaded version. | |
+#ifndef G4MULTITHREADED | |
+ // These instructions are in G4VisSubThread for multithreading. | |
+ fpSceneHandler->DrawEndOfRunModels(); | |
+ // ShowView guarantees the view is flushed to the screen. It also | |
+ // triggers other features such picking (if enabled) and allows | |
+ // file-writing viewers to close the file. | |
fpViewer->ShowView(); | |
// // An extra refresh for auto-refresh viewers. | |
// // ???? I DON'T THINK THIS IS NECESSARY ???? JA ???? | |
// if (fpViewer->GetViewParameters().IsAutoRefresh()) { | |
// fpViewer->RefreshView(); | |
// } | |
- fpSceneHandler->SetMarkForClearingTransientStore(true); | |
+ fpSceneHandler->SetMarkForClearingTransientStore(true); | |
+#endif | |
} else { | |
if (fpGraphicsSystem->GetFunctionality() == | |
G4VGraphicsSystem::fileWriter) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment