Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredQtViewer.cc 97241 2016-05-30 12:06:54Z gcosmo $
|
||||
// $Id: G4OpenGLStoredQtViewer.cc 101714 2016-11-22 08:53:13Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Class G4OpenGLStoredQtViewer : a class derived from G4OpenGLQtViewer and
|
||||
@@ -52,6 +52,7 @@ G4OpenGLStoredQtViewer::G4OpenGLStoredQtViewer
|
||||
G4OpenGLStoredViewer (sceneHandler), // FIXME : gerer le pb du parent !
|
||||
QGLWidget()
|
||||
{
|
||||
fQGLWidgetInitialiseCompleted = false;
|
||||
|
||||
// Indicates that the widget has no background, i.e. when the widget receives paint events, the background is not automatically repainted. Note: Unlike WA_OpaquePaintEvent, newly exposed areas are never filled with the background (e.g., after showing a window for the first time the user can see "through" it until the application processes the paint events). This flag is set or cleared by the widget's author.
|
||||
QGLWidget::setAttribute (Qt::WA_NoSystemBackground);
|
||||
@@ -61,8 +62,6 @@ G4OpenGLStoredQtViewer::G4OpenGLStoredQtViewer
|
||||
fPaintEventLock = false;
|
||||
fUpdateGLLock = false;
|
||||
|
||||
resize(fVP.GetWindowSizeHintX(),fVP.GetWindowSizeHintY());
|
||||
|
||||
if (fViewId < 0) return; // In case error in base class instantiation.
|
||||
}
|
||||
|
||||
@@ -134,13 +133,21 @@ G4bool G4OpenGLStoredQtViewer::CompareForKernelVisit(G4ViewParameters& lastVP)
|
||||
(lastVP.GetDefaultTextVisAttributes()->GetColour() !=
|
||||
fVP.GetDefaultTextVisAttributes()->GetColour()) ||
|
||||
(lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())||
|
||||
(lastVP.IsPicking () != fVP.IsPicking ())
|
||||
// ||
|
||||
// (lastVP.GetVisAttributesModifiers() !=
|
||||
// fVP.GetVisAttributesModifiers())
|
||||
)
|
||||
(lastVP.IsPicking () != fVP.IsPicking ()))
|
||||
return true;
|
||||
|
||||
// Don't check VisAttributesModifiers if this comparison has been
|
||||
// initiated by a mouse interaction on the scene tree.
|
||||
if (fMouseOnSceneTree) {
|
||||
// Reset the flag.
|
||||
fMouseOnSceneTree = false;
|
||||
} else {
|
||||
// Not initiated by a mouse so compare for kernel visit.
|
||||
if (lastVP.GetVisAttributesModifiers() != fVP.GetVisAttributesModifiers()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (lastVP.IsDensityCulling () &&
|
||||
(lastVP.GetVisibleDensity () != fVP.GetVisibleDensity ()))
|
||||
return true;
|
||||
@@ -168,7 +175,7 @@ G4bool G4OpenGLStoredQtViewer::CompareForKernelVisit(G4ViewParameters& lastVP)
|
||||
if (lastVP.IsExplode () &&
|
||||
(lastVP.GetExplodeFactor () != fVP.GetExplodeFactor ()))
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -203,9 +210,10 @@ void G4OpenGLStoredQtViewer::ComputeView () {
|
||||
G4bool kernelVisitWasNeeded = fNeedKernelVisit; // Keep (ProcessView resets).
|
||||
ProcessView ();
|
||||
|
||||
if (fNeedKernelVisit) {
|
||||
if (kernelVisitWasNeeded) {
|
||||
displaySceneTreeComponent();
|
||||
}
|
||||
|
||||
if(dstyle!=G4ViewParameters::hlr &&
|
||||
haloing_enabled) {
|
||||
|
||||
@@ -320,6 +328,8 @@ void G4OpenGLStoredQtViewer::paintEvent(QPaintEvent *) {
|
||||
if (! fQGLWidgetInitialiseCompleted) {
|
||||
return;
|
||||
}
|
||||
// Force a repaint next time if the FRAMEBUFFER is not READY
|
||||
fHasToRepaint = isFramebufferReady();
|
||||
if ( fHasToRepaint) {
|
||||
// Will really update the widget by calling CGLFlushDrawable
|
||||
// The widget's rendering context will become the current context and initializeGL()
|
||||
@@ -385,15 +395,20 @@ void G4OpenGLStoredQtViewer::updateQWidget() {
|
||||
if (fUpdateGLLock) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! isCurrentWidget()){
|
||||
return;
|
||||
}
|
||||
|
||||
fUpdateGLLock = true;
|
||||
fHasToRepaint= true;
|
||||
// Will really update the widget by calling CGLFlushDrawable
|
||||
// The widget's rendering context will become the current context and initializeGL()
|
||||
// will be called if it hasn't already been called.
|
||||
// Copies the back buffer of a double-buffered context to the front buffer.
|
||||
updateGL();
|
||||
updateSceneTreeComponentTreeWidgetInfos();
|
||||
fHasToRepaint= false;
|
||||
repaint(); // will read scene tree state
|
||||
updateViewerPropertiesTableWidget();
|
||||
updateSceneTreeWidget();
|
||||
fUpdateGLLock = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user