Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
+35 -2
View File
@@ -1,4 +1,4 @@
$Id: History 108544 2018-02-16 09:47:30Z gcosmo $
$Id: History 110480 2018-05-25 07:25:18Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,7 +17,40 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
14th December 2017 John Allison (opengl-V10-03-05)
24 May 2015 John Allison (opengl-V10-04-06)
- G4OpenGLStoredQtSceneHandler.cc, G4OpenGLQtViewer.cc:
o Fix gcc-8 warnings.
- G4OpenGLStoredSceneHandler.cc: Cosmetic.
25 April 2015 John Allison (opengl-V10-04-05)
- G4OpenGLStoredViewer::CompareForKernelVisit,
G4OpenGLStoredQtViewer::CompareForKernelVisit:
o Implement comparison for "colour by density".
24 April 2017 John Allison (opengl-V10-04-04)
- Migrate to greps-V10-04-04.
13 February 2018 Jonathan Madsen (opengl-V10-04-03)
- Replaced explicit usage of G4Mutex locking/unlocking with
G4AutoLock pointers initialized with std::defer_lock as this
enables one to avoid any deadlock or non-locked condition_variable
waits by using G4AutoLock::owns_mutex()
12 February 2018 Jonathan Madsen (opengl-V10-04-02)
- Updated G4CONDITIONWAIT(...) to new C++11 requirements
- Found probable bug in G4OpenGLQtViewer with condition wait -- not locked
prior to entering condition, which is an undefined behavior. Adapted
G4AutoLock to accept std::defer_lock_t (doesn't lock upon construction)
to prevent deadlock that occurs when the mutex is locked
8th January 2017 John Allison (opengl-V10-04-01)
- Merged timemovebranch:
o Moved time window parameters from G4OpenGLStoredViewer to
G4ViewParameters. Now one can interpolate time window parameters (using
/vis/viewer/interpolate) and make a movie of particles moving through time.
o See vis-V10-04-00 History for more details.
14th December 2017 John Allison (opengl-V10-04-00)
- G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal:
o Remove glDrawBuffer(GL_FRONT), which seems to cause problems
for the case of display list memory being exceeded.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLQtViewer.hh 101105 2016-11-07 08:09:26Z gcosmo $
// $Id: G4OpenGLQtViewer.hh 108601 2018-02-26 10:03:17Z gcosmo $
//
//
// G4OpenGLQtViewer : Class to provide WindowsNT specific
@@ -41,6 +41,7 @@
#include "G4OpenGLViewer.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4AutoLock.hh"
#include <qobject.h>
#include <qpoint.h>
@@ -381,7 +382,11 @@ private:
QThread* fQGLContextVisSubThread;
QThread* fQGLContextMainThread;
#endif
// safe to use in serial mode
G4AutoLock* lWaitForVisSubThreadQtOpenGLContextInitialized;
G4AutoLock* lWaitForVisSubThreadQtOpenGLContextMoved;
public Q_SLOTS :
void startPauseVideo();
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLStoredViewer.hh 91268 2015-06-29 07:04:24Z gcosmo $
// $Id: G4OpenGLStoredViewer.hh 108131 2018-01-09 13:23:26Z gcosmo $
//
//
// Andrew Walkden 7th February 1997
@@ -41,6 +41,8 @@
class G4OpenGLStoredSceneHandler;
class G4Colour;
class G4Text;
class G4Circle;
class G4OpenGLStoredViewer: virtual public G4OpenGLViewer {
@@ -51,10 +53,17 @@ public:
protected:
void KernelVisitDecision ();
virtual G4bool CompareForKernelVisit(G4ViewParameters&);
void DrawDisplayLists ();
virtual void DisplayTimePOColourModification
(G4Colour&, size_t /*currentPOListIndex*/) {}
void AddPrimitiveForASingleFrame(const G4Text& text);
void AddPrimitiveForASingleFrame(const G4Circle& circle);
G4OpenGLStoredSceneHandler& fG4OpenGLStoredSceneHandler;
G4ViewParameters fLastVP; // Memory for making kernel visit decisions.
// Two virtual functions to return sub-class selection.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLViewer.hh 103926 2017-05-03 13:43:27Z gcosmo $
// $Id: G4OpenGLViewer.hh 108131 2018-01-09 13:23:26Z gcosmo $
//
//
// Andrew Walkden 27th March 1996
@@ -209,16 +209,6 @@ protected:
transparency_enabled, //is alpha blending enabled?
antialiasing_enabled, //is antialiasing enabled?
haloing_enabled; //is haloing enabled for wireframe?
G4double fStartTime, fEndTime; // Time range (e.g., for trajectory steps).
G4double fFadeFactor; // 0: no fade; 1: maximum fade with time within range.
G4bool fDisplayHeadTime; // Display head time (fEndTime) in 2D text.
G4double fDisplayHeadTimeX, fDisplayHeadTimeY; // 2D screen coords.
G4double fDisplayHeadTimeSize; // Screen size.
G4double fDisplayHeadTimeRed, fDisplayHeadTimeGreen, fDisplayHeadTimeBlue;
G4bool fDisplayLightFront;// Display light front at head time originating at
G4double fDisplayLightFrontX, fDisplayLightFrontY, fDisplayLightFrontZ,
fDisplayLightFrontT;
G4double fDisplayLightFrontRed, fDisplayLightFrontGreen, fDisplayLightFrontBlue;
G4OpenGL2PSAction* fGL2PSAction;
G4double fRot_sens; // Rotation sensibility in degrees
@@ -0,0 +1,101 @@
/****************************************************************************
** Meta object code from reading C++ file 'G4OpenGLQtExportDialog.hh'
**
** Created: Tue Jun 5 13:55:33 2018
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../include/G4OpenGLQtExportDialog.hh"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'G4OpenGLQtExportDialog.hh' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.4. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_G4OpenGLQtExportDialog[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: signature, parameters, type, tag, flags
24, 23, 23, 23, 0x0a,
40, 23, 23, 23, 0x0a,
58, 23, 23, 23, 0x0a,
84, 23, 23, 23, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_G4OpenGLQtExportDialog[] = {
"G4OpenGLQtExportDialog\0\0changeSizeBox()\0"
"changeVectorEPS()\0textWidthChanged(QString)\0"
"textHeightChanged(QString)\0"
};
void G4OpenGLQtExportDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
G4OpenGLQtExportDialog *_t = static_cast<G4OpenGLQtExportDialog *>(_o);
switch (_id) {
case 0: _t->changeSizeBox(); break;
case 1: _t->changeVectorEPS(); break;
case 2: _t->textWidthChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 3: _t->textHeightChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
default: ;
}
}
}
const QMetaObjectExtraData G4OpenGLQtExportDialog::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject G4OpenGLQtExportDialog::staticMetaObject = {
{ &QDialog::staticMetaObject, qt_meta_stringdata_G4OpenGLQtExportDialog,
qt_meta_data_G4OpenGLQtExportDialog, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &G4OpenGLQtExportDialog::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *G4OpenGLQtExportDialog::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *G4OpenGLQtExportDialog::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_G4OpenGLQtExportDialog))
return static_cast<void*>(const_cast< G4OpenGLQtExportDialog*>(this));
return QDialog::qt_metacast(_clname);
}
int G4OpenGLQtExportDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
}
return _id;
}
QT_END_MOC_NAMESPACE
@@ -0,0 +1,121 @@
/****************************************************************************
** Meta object code from reading C++ file 'G4OpenGLQtMovieDialog.hh'
**
** Created: Tue Jun 5 13:55:33 2018
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../include/G4OpenGLQtMovieDialog.hh"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'G4OpenGLQtMovieDialog.hh' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.4. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_G4OpenGLQtMovieDialog[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
10, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: signature, parameters, type, tag, flags
23, 22, 22, 22, 0x0a,
41, 22, 22, 22, 0x0a,
53, 22, 48, 22, 0x0a,
80, 22, 48, 22, 0x0a,
110, 22, 48, 22, 0x0a,
138, 22, 22, 22, 0x08,
164, 22, 22, 22, 0x08,
187, 22, 22, 22, 0x08,
214, 22, 22, 22, 0x08,
231, 22, 22, 22, 0x08,
0 // eod
};
static const char qt_meta_stringdata_G4OpenGLQtMovieDialog[] = {
"G4OpenGLQtMovieDialog\0\0stopFinishClose()\0"
"save()\0bool\0checkEncoderSwParameters()\0"
"checkSaveFileNameParameters()\0"
"checkTempFolderParameters()\0"
"selectEncoderPathAction()\0"
"selectTempPathAction()\0"
"selectSaveFileNameAction()\0resetRecording()\0"
"enabledApplyButton()\0"
};
void G4OpenGLQtMovieDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
G4OpenGLQtMovieDialog *_t = static_cast<G4OpenGLQtMovieDialog *>(_o);
switch (_id) {
case 0: _t->stopFinishClose(); break;
case 1: _t->save(); break;
case 2: { bool _r = _t->checkEncoderSwParameters();
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break;
case 3: { bool _r = _t->checkSaveFileNameParameters();
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break;
case 4: { bool _r = _t->checkTempFolderParameters();
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break;
case 5: _t->selectEncoderPathAction(); break;
case 6: _t->selectTempPathAction(); break;
case 7: _t->selectSaveFileNameAction(); break;
case 8: _t->resetRecording(); break;
case 9: _t->enabledApplyButton(); break;
default: ;
}
}
}
const QMetaObjectExtraData G4OpenGLQtMovieDialog::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject G4OpenGLQtMovieDialog::staticMetaObject = {
{ &QDialog::staticMetaObject, qt_meta_stringdata_G4OpenGLQtMovieDialog,
qt_meta_data_G4OpenGLQtMovieDialog, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &G4OpenGLQtMovieDialog::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *G4OpenGLQtMovieDialog::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *G4OpenGLQtMovieDialog::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_G4OpenGLQtMovieDialog))
return static_cast<void*>(const_cast< G4OpenGLQtMovieDialog*>(this));
return QDialog::qt_metacast(_clname);
}
int G4OpenGLQtMovieDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 10)
qt_static_metacall(this, _c, _id, _a);
_id -= 10;
}
return _id;
}
QT_END_MOC_NAMESPACE
@@ -0,0 +1,170 @@
/****************************************************************************
** Meta object code from reading C++ file 'G4OpenGLQtViewer.hh'
**
** Created: Tue Jun 5 13:55:33 2018
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../include/G4OpenGLQtViewer.hh"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'G4OpenGLQtViewer.hh' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.4. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_G4OpenGLQtViewer[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
29, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: signature, parameters, type, tag, flags
18, 17, 17, 17, 0x0a,
36, 17, 17, 17, 0x09,
71, 17, 17, 17, 0x08,
89, 17, 17, 17, 0x08,
119, 17, 17, 17, 0x08,
143, 17, 17, 17, 0x08,
170, 17, 17, 17, 0x08,
194, 17, 17, 17, 0x08,
210, 17, 17, 17, 0x08,
233, 17, 17, 17, 0x08,
258, 17, 17, 17, 0x08,
281, 17, 17, 17, 0x08,
306, 17, 17, 17, 0x08,
331, 17, 17, 17, 0x08,
351, 17, 17, 17, 0x08,
367, 17, 17, 17, 0x08,
393, 17, 17, 17, 0x08,
416, 17, 17, 17, 0x08,
440, 17, 17, 17, 0x08,
465, 17, 17, 17, 0x08,
495, 487, 17, 17, 0x08,
547, 17, 17, 17, 0x08,
588, 17, 17, 17, 0x08,
604, 17, 17, 17, 0x08,
629, 17, 17, 17, 0x08,
658, 17, 17, 17, 0x08,
686, 17, 17, 17, 0x08,
719, 710, 17, 17, 0x08,
768, 17, 17, 17, 0x08,
0 // eod
};
static const char qt_meta_stringdata_G4OpenGLQtViewer[] = {
"G4OpenGLQtViewer\0\0startPauseVideo()\0"
"updateToolbarAndMouseContextMenu()\0"
"actionSaveImage()\0actionChangeBackgroundColor()\0"
"actionChangeTextColor()\0"
"actionChangeDefaultColor()\0"
"actionMovieParameters()\0showShortcuts()\0"
"toggleMouseAction(int)\0toggleSurfaceAction(int)\0"
"toggleProjection(bool)\0toggleTransparency(bool)\0"
"toggleAntialiasing(bool)\0toggleHaloing(bool)\0"
"toggleAux(bool)\0toggleHiddenMarkers(bool)\0"
"toggleFullScreen(bool)\0processEncodeFinished()\0"
"processLookForFinished()\0processEncodeStdout()\0"
"item,id\0sceneTreeComponentItemChanged(QTreeWidgetItem*,int)\0"
"toggleSceneTreeComponentPickingCout(int)\0"
"togglePicking()\0currentTabActivated(int)\0"
"sceneTreeComponentSelected()\0"
"changeDepthInSceneTree(int)\0"
"changeSearchSelection()\0item,val\0"
"changeColorAndTransparency(QTreeWidgetItem*,int)\0"
"tableWidgetViewerSetItemChanged(QTableWidgetItem*)\0"
};
void G4OpenGLQtViewer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
G4OpenGLQtViewer *_t = static_cast<G4OpenGLQtViewer *>(_o);
switch (_id) {
case 0: _t->startPauseVideo(); break;
case 1: _t->updateToolbarAndMouseContextMenu(); break;
case 2: _t->actionSaveImage(); break;
case 3: _t->actionChangeBackgroundColor(); break;
case 4: _t->actionChangeTextColor(); break;
case 5: _t->actionChangeDefaultColor(); break;
case 6: _t->actionMovieParameters(); break;
case 7: _t->showShortcuts(); break;
case 8: _t->toggleMouseAction((*reinterpret_cast< int(*)>(_a[1]))); break;
case 9: _t->toggleSurfaceAction((*reinterpret_cast< int(*)>(_a[1]))); break;
case 10: _t->toggleProjection((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 11: _t->toggleTransparency((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 12: _t->toggleAntialiasing((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 13: _t->toggleHaloing((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 14: _t->toggleAux((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 15: _t->toggleHiddenMarkers((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 16: _t->toggleFullScreen((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 17: _t->processEncodeFinished(); break;
case 18: _t->processLookForFinished(); break;
case 19: _t->processEncodeStdout(); break;
case 20: _t->sceneTreeComponentItemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 21: _t->toggleSceneTreeComponentPickingCout((*reinterpret_cast< int(*)>(_a[1]))); break;
case 22: _t->togglePicking(); break;
case 23: _t->currentTabActivated((*reinterpret_cast< int(*)>(_a[1]))); break;
case 24: _t->sceneTreeComponentSelected(); break;
case 25: _t->changeDepthInSceneTree((*reinterpret_cast< int(*)>(_a[1]))); break;
case 26: _t->changeSearchSelection(); break;
case 27: _t->changeColorAndTransparency((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 28: _t->tableWidgetViewerSetItemChanged((*reinterpret_cast< QTableWidgetItem*(*)>(_a[1]))); break;
default: ;
}
}
}
const QMetaObjectExtraData G4OpenGLQtViewer::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject G4OpenGLQtViewer::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_G4OpenGLQtViewer,
qt_meta_data_G4OpenGLQtViewer, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &G4OpenGLQtViewer::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *G4OpenGLQtViewer::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *G4OpenGLQtViewer::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_G4OpenGLQtViewer))
return static_cast<void*>(const_cast< G4OpenGLQtViewer*>(this));
if (!strcmp(_clname, "G4OpenGLViewer"))
return static_cast< G4OpenGLViewer*>(const_cast< G4OpenGLQtViewer*>(this));
return QObject::qt_metacast(_clname);
}
int G4OpenGLQtViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 29)
qt_static_metacall(this, _c, _id, _a);
_id -= 29;
}
return _id;
}
QT_END_MOC_NAMESPACE
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLQtViewer.cc 107329 2017-11-08 16:41:26Z gcosmo $
// $Id: G4OpenGLQtViewer.cc 110480 2018-05-25 07:25:18Z gcosmo $
//
//
// G4OpenGLQtViewer : Class to provide Qt specific
@@ -57,6 +57,7 @@
#include <CLHEP/Units/SystemOfUnits.h>
#include <typeinfo>
#include <mutex>
#include <qlayout.h>
#include <qlabel.h>
@@ -94,19 +95,18 @@
#include <qcursor.h>
#include <qthread.h>
#ifdef G4MULTITHREADED
#include "G4Threading.hh"
#endif
#ifdef G4MULTITHREADED
namespace
{
G4Mutex mWaitForVisSubThreadQtOpenGLContextMoved = G4MUTEX_INITIALIZER;
G4Mutex mWaitForVisSubThreadQtOpenGLContextInitialized = G4MUTEX_INITIALIZER;
// avoid unused variable warning
#ifdef G4MULTITHREADED
G4Condition c1_VisSubThreadQtOpenGLContextInitialized = G4CONDITION_INITIALIZER;
G4Condition c2_VisSubThreadQtOpenGLContextMoved = G4CONDITION_INITIALIZER;
}
#endif
}
//////////////////////////////////////////////////////////////////////////////
void G4OpenGLQtViewer::CreateMainWindow (
@@ -270,6 +270,12 @@ G4OpenGLQtViewer::G4OpenGLQtViewer (
,fLastHighlightName(0)
,fIsDeleting(false)
{
lWaitForVisSubThreadQtOpenGLContextInitialized
= new G4AutoLock(mWaitForVisSubThreadQtOpenGLContextInitialized,
std::defer_lock);
lWaitForVisSubThreadQtOpenGLContextMoved
= new G4AutoLock(mWaitForVisSubThreadQtOpenGLContextMoved,
std::defer_lock);
// launch Qt if not
if (QCoreApplication::instance () == NULL) {
@@ -511,6 +517,10 @@ G4OpenGLQtViewer::~G4OpenGLQtViewer (
delete fTreeIconClosed;
G4cout <<removeTempFolder().toStdString().c_str() <<G4endl;
delete lWaitForVisSubThreadQtOpenGLContextInitialized;
delete lWaitForVisSubThreadQtOpenGLContextMoved;
}
@@ -3283,7 +3293,7 @@ void G4OpenGLQtViewer::addNonPVSceneTreeElement(
const G4Text& g4Text = dynamic_cast<const G4Text&>(visible);
color = fSceneHandler.GetTextColour(g4Text);
}
catch (std::bad_cast) {
catch (const std::bad_cast&) {
color = fSceneHandler.GetColour();
}
if (modelShortName == "") {
@@ -4708,7 +4718,9 @@ void G4OpenGLQtViewer::DoneWithMasterThread()
// Called by Main Thread !
// Useful to avoid two vis thread at the same time
G4MUTEXLOCK(&mWaitForVisSubThreadQtOpenGLContextInitialized);
//G4MUTEXLOCK(&mWaitForVisSubThreadQtOpenGLContextInitialized);
if(!lWaitForVisSubThreadQtOpenGLContextInitialized->owns_lock())
lWaitForVisSubThreadQtOpenGLContextInitialized->lock();
}
void G4OpenGLQtViewer::SwitchToVisSubThread()
@@ -4725,9 +4737,14 @@ void G4OpenGLQtViewer::SwitchToVisSubThread()
// - Wait for the vis thread to set its QThread
G4CONDITIONBROADCAST(&c1_VisSubThreadQtOpenGLContextInitialized);
// a condition without a locked mutex is an undefined behavior.
// we check if the mutex owns the lock, and if not, we lock it
if(!lWaitForVisSubThreadQtOpenGLContextMoved->owns_lock())
lWaitForVisSubThreadQtOpenGLContextMoved->lock();
// Unlock the vis thread if it is Qt Viewer
G4CONDITIONWAIT(&c2_VisSubThreadQtOpenGLContextMoved, &mWaitForVisSubThreadQtOpenGLContextMoved);
G4CONDITIONWAIT(&c2_VisSubThreadQtOpenGLContextMoved,
lWaitForVisSubThreadQtOpenGLContextMoved);
// make context current
qGLW->makeCurrent();
@@ -4760,7 +4777,10 @@ void G4OpenGLQtViewer::SwitchToMasterThread()
}
// Useful to avoid two vis thread at the same time
G4MUTEXUNLOCK(&mWaitForVisSubThreadQtOpenGLContextInitialized);
//G4MUTEXUNLOCK(&mWaitForVisSubThreadQtOpenGLContextInitialized);
if(lWaitForVisSubThreadQtOpenGLContextInitialized->owns_lock())
lWaitForVisSubThreadQtOpenGLContextInitialized->unlock();
qGLW->makeCurrent();
}
@@ -4773,9 +4793,14 @@ void G4OpenGLQtViewer::MovingToVisSubThread(){
return;
}
// - Wait for the vis sub thread to set its QThread
G4CONDITIONWAIT( &c1_VisSubThreadQtOpenGLContextInitialized, &mWaitForVisSubThreadQtOpenGLContextInitialized);
// a condition without a locked mutex is an undefined behavior.
// we check if the mutex owns the lock, and if not, we lock it
if(!lWaitForVisSubThreadQtOpenGLContextInitialized->owns_lock())
lWaitForVisSubThreadQtOpenGLContextInitialized->lock();
// - Wait for the vis sub thread to set its QThread
G4CONDITIONWAIT(&c1_VisSubThreadQtOpenGLContextInitialized,
lWaitForVisSubThreadQtOpenGLContextInitialized);
// Set current QThread for the way back
SetQGLContextMainThread(QThread::currentThread());
@@ -62,7 +62,7 @@ G4bool G4OpenGLStoredQtSceneHandler::ExtraPOProcessing
fPOList[currentPOListIndex].fpG4TextPlus = pG4TextPlus;
usesGLCommands = false;
}
catch (std::bad_cast) {} // No special action if not text. Just carry on.
catch (const std::bad_cast&) {} // No special action if not text. Just carry on.
G4PhysicalVolumeModel* pPVModel =
dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
@@ -128,7 +128,7 @@ G4bool G4OpenGLStoredQtSceneHandler::ExtraTOProcessing
fTOList[currentTOListIndex].fpG4TextPlus = pG4TextPlus;
usesGLCommands = false;
}
catch (std::bad_cast) {} // Do nothing if not text.
catch (const std::bad_cast&) {} // Do nothing if not text.
return usesGLCommands;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLStoredQtViewer.cc 103926 2017-05-03 13:43:27Z gcosmo $
// $Id: G4OpenGLStoredQtViewer.cc 109510 2018-04-26 07:15:57Z gcosmo $
//
//
// Class G4OpenGLStoredQtViewer : a class derived from G4OpenGLQtViewer and
@@ -119,6 +119,8 @@ G4bool G4OpenGLStoredQtViewer::CompareForKernelVisit(G4ViewParameters& lastVP)
(lastVP.IsCullingInvisible () != fVP.IsCullingInvisible ()) ||
(lastVP.IsDensityCulling () != fVP.IsDensityCulling ()) ||
(lastVP.IsCullingCovered () != fVP.IsCullingCovered ()) ||
(lastVP.GetCBDAlgorithmNumber() !=
fVP.GetCBDAlgorithmNumber()) ||
(lastVP.IsSection () != fVP.IsSection ()) ||
// Section (DCUT) implemented locally. But still need to visit
// kernel if status changes so that back plane culling can be
@@ -172,6 +174,11 @@ G4bool G4OpenGLStoredQtViewer::CompareForKernelVisit(G4ViewParameters& lastVP)
}
***************************************************************/
if (lastVP.GetCBDAlgorithmNumber() > 0) {
if (lastVP.GetCBDParameters().size() != fVP.GetCBDParameters().size()) return true;
else if (lastVP.GetCBDParameters() != fVP.GetCBDParameters()) return true;
}
if (lastVP.IsExplode () &&
(lastVP.GetExplodeFactor () != fVP.GetExplodeFactor ()))
return true;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLStoredSceneHandler.cc 108544 2018-02-16 09:47:30Z gcosmo $
// $Id: G4OpenGLStoredSceneHandler.cc 110480 2018-05-25 07:25:18Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -102,8 +102,8 @@ G4OpenGLStoredSceneHandler::PO& G4OpenGLStoredSceneHandler::PO::operator=
G4OpenGLStoredSceneHandler::TO::TO():
fDisplayListId(0),
fPickName(0),
fStartTime(-DBL_MAX),
fEndTime(DBL_MAX),
fStartTime(-G4VisAttributes::fVeryLongTime),
fEndTime(G4VisAttributes::fVeryLongTime),
fpG4TextPlus(0),
fMarkerOrPolyline(false)
{}
@@ -123,8 +123,8 @@ G4OpenGLStoredSceneHandler::TO::TO(G4int id, const G4Transform3D& tr):
fDisplayListId(id),
fTransform(tr),
fPickName(0),
fStartTime(-DBL_MAX),
fEndTime(DBL_MAX),
fStartTime(-G4VisAttributes::fVeryLongTime),
fEndTime(G4VisAttributes::fVeryLongTime),
fpG4TextPlus(0),
fMarkerOrPolyline(false)
{}
@@ -203,7 +203,8 @@ G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreamble(const G4Polyhedron& visi
return AddPrimitivePreambleInternal(visible, false, false);
}
G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(const G4Visible& visible, bool isMarker, bool isPolyline)
G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal
(const G4Visible& visible, bool isMarker, bool isPolyline)
{
// Get applicable vis attributes for all primitives.
fpVisAttribs = fpViewer->GetApplicableVisAttributes(visible.GetVisAttributes());
@@ -212,10 +213,10 @@ G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(const G4Visible&
G4bool transparency_enabled = true;
G4bool isMarkerNotHidden = true;
G4OpenGLViewer* pViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer);
if (pViewer) {
transparency_enabled = pViewer->transparency_enabled;
isMarkerNotHidden = pViewer->fVP.IsMarkerNotHidden();
G4OpenGLViewer* pOGLViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer);
if (pOGLViewer) {
transparency_enabled = pOGLViewer->transparency_enabled;
isMarkerNotHidden = pOGLViewer->fVP.IsMarkerNotHidden();
}
G4bool isTransparent = opacity < 1.;
@@ -260,7 +261,6 @@ G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(const G4Visible&
if (fThirdPassForNonHiddenMarkers) {
if (!treatAsNotHidden) {
return false; // No further processing.
}
}
} // fThreePassCapable
@@ -432,8 +432,8 @@ end_of_display_list_reuse_test:
glMatrixMode (GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
if (pViewer) {
pViewer->g4GlOrtho (-1., 1., -1., 1., -G4OPENGL_FLT_BIG, G4OPENGL_FLT_BIG);
if (pOGLViewer) {
pOGLViewer->g4GlOrtho (-1., 1., -1., 1., -G4OPENGL_FLT_BIG, G4OPENGL_FLT_BIG);
}
glMatrixMode (GL_MODELVIEW);
glPushMatrix();
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLStoredViewer.cc 101714 2016-11-22 08:53:13Z gcosmo $
// $Id: G4OpenGLStoredViewer.cc 109510 2018-04-26 07:15:57Z gcosmo $
//
//
// Andrew Walkden 7th February 1997
@@ -78,6 +78,8 @@ G4bool G4OpenGLStoredViewer::CompareForKernelVisit(G4ViewParameters& lastVP) {
(lastVP.IsCullingInvisible () != fVP.IsCullingInvisible ()) ||
(lastVP.IsDensityCulling () != fVP.IsDensityCulling ()) ||
(lastVP.IsCullingCovered () != fVP.IsCullingCovered ()) ||
(lastVP.GetCBDAlgorithmNumber() !=
fVP.GetCBDAlgorithmNumber()) ||
(lastVP.IsSection () != fVP.IsSection ()) ||
// Section (DCUT) implemented locally. But still need to visit
// kernel if status changes so that back plane culling can be
@@ -122,15 +124,46 @@ G4bool G4OpenGLStoredViewer::CompareForKernelVisit(G4ViewParameters& lastVP) {
}
***************************************************************/
if (lastVP.GetCBDAlgorithmNumber() > 0) {
if (lastVP.GetCBDParameters().size() != fVP.GetCBDParameters().size()) return true;
else if (lastVP.GetCBDParameters() != fVP.GetCBDParameters()) return true;
}
if (lastVP.IsExplode () &&
(lastVP.GetExplodeFactor () != fVP.GetExplodeFactor ()))
return true;
// Time window parameters operate on the existing database so no need
// to rebuild even if they change.
return false;
}
void G4OpenGLStoredViewer::DrawDisplayLists () {
// We moved these from G4OpenGLViewer to G4ViewParamaters. To avoid
// editing many lines below we introduce these convenient aliases.
#define CONVENIENT_DOUBLE_ALIAS(q) const G4double& f##q = fVP.Get##q();
#define CONVENIENT_BOOL_ALIAS(q) const G4bool& f##q = fVP.Is##q();
CONVENIENT_DOUBLE_ALIAS(StartTime)
CONVENIENT_DOUBLE_ALIAS(EndTime)
CONVENIENT_DOUBLE_ALIAS(FadeFactor)
CONVENIENT_BOOL_ALIAS(DisplayHeadTime)
CONVENIENT_DOUBLE_ALIAS(DisplayHeadTimeX)
CONVENIENT_DOUBLE_ALIAS(DisplayHeadTimeY)
CONVENIENT_DOUBLE_ALIAS(DisplayHeadTimeSize)
CONVENIENT_DOUBLE_ALIAS(DisplayHeadTimeRed)
CONVENIENT_DOUBLE_ALIAS(DisplayHeadTimeGreen)
CONVENIENT_DOUBLE_ALIAS(DisplayHeadTimeBlue)
CONVENIENT_BOOL_ALIAS(DisplayLightFront)
CONVENIENT_DOUBLE_ALIAS(DisplayLightFrontX)
CONVENIENT_DOUBLE_ALIAS(DisplayLightFrontY)
CONVENIENT_DOUBLE_ALIAS(DisplayLightFrontZ)
CONVENIENT_DOUBLE_ALIAS(DisplayLightFrontT)
CONVENIENT_DOUBLE_ALIAS(DisplayLightFrontRed)
CONVENIENT_DOUBLE_ALIAS(DisplayLightFrontGreen)
CONVENIENT_DOUBLE_ALIAS(DisplayLightFrontBlue)
const G4Planes& cutaways = fVP.GetCutawayPlanes();
G4bool cutawayUnion = fVP.IsCutaway() &&
fVP.GetCutawayMode() == G4ViewParameters::cutawayUnion;
@@ -209,14 +242,14 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
glLoadIdentity();
G4OpenGLTransform3D oglt (po.fTransform);
glMultMatrixd (oglt.GetGLMatrix ());
fOpenGLSceneHandler.G4OpenGLSceneHandler::AddPrimitive
(po.fpG4TextPlus->fG4Text);
// This text is from a PODL. We don't want to create a new PODL.
AddPrimitiveForASingleFrame(po.fpG4TextPlus->fG4Text);
} else {
glPushMatrix();
G4OpenGLTransform3D oglt (po.fTransform);
glMultMatrixd (oglt.GetGLMatrix ());
fOpenGLSceneHandler.G4OpenGLSceneHandler::AddPrimitive
(po.fpG4TextPlus->fG4Text);
// This text is from a PODL. We don't want to create a new PODL.
AddPrimitiveForASingleFrame(po.fpG4TextPlus->fG4Text);
glPopMatrix();
}
@@ -238,7 +271,7 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
G4Transform3D lastMatrixTransform;
G4bool first = true;
for (size_t iTO = 0;
iTO < fG4OpenGLStoredSceneHandler.fTOList.size(); ++iTO) {
if (TOSelected(iTO)) {
@@ -294,8 +327,8 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
} else {
glColor3d(c.GetRed(),c.GetGreen(),c.GetBlue());
}
fOpenGLSceneHandler.G4OpenGLSceneHandler::AddPrimitive
(to.fpG4TextPlus->fG4Text);
// This text is from a TODL. We don't want to create a new TODL.
AddPrimitiveForASingleFrame(to.fpG4TextPlus->fG4Text);
if (to.fpG4TextPlus->fProcessing2D) {
glMatrixMode (GL_PROJECTION);
glPopMatrix();
@@ -362,7 +395,7 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
} while (true);
// Display time at "head" of time range, which is fEndTime...
if (fDisplayHeadTime && fEndTime < DBL_MAX) {
if (fDisplayHeadTime && fEndTime < G4VisAttributes::fVeryLongTime) {
glMatrixMode (GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
@@ -378,7 +411,7 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
fDisplayHeadTimeGreen,
fDisplayHeadTimeBlue));
headTimeText.SetVisAttributes(&visAtts);
fOpenGLSceneHandler.G4OpenGLSceneHandler::AddPrimitive(headTimeText);
AddPrimitiveForASingleFrame(headTimeText);
glMatrixMode (GL_PROJECTION);
glPopMatrix();
glMatrixMode (GL_MODELVIEW);
@@ -386,7 +419,7 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
}
// Display light front...
if (fDisplayLightFront && fEndTime < DBL_MAX) {
if (fDisplayLightFront && fEndTime < G4VisAttributes::fVeryLongTime) {
G4double lightFrontRadius = (fEndTime - fDisplayLightFrontT) * c_light;
if (lightFrontRadius > 0.) {
G4Point3D lightFrontCentre(fDisplayLightFrontX, fDisplayLightFrontY, fDisplayLightFrontZ);
@@ -431,10 +464,30 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
glColor3d(fDisplayLightFrontRed,
fDisplayLightFrontGreen,
fDisplayLightFrontBlue);
fOpenGLSceneHandler.G4OpenGLSceneHandler::AddPrimitive(lightFront);
AddPrimitiveForASingleFrame(lightFront);
}
}
}
}
void G4OpenGLStoredViewer::AddPrimitiveForASingleFrame(const G4Text& text)
{
// We don't want this to get into a display list or a TODL or a PODL so
// use the fMemoryForDisplayLists flag.
G4bool memoryForDisplayListsKeep = fG4OpenGLStoredSceneHandler.fMemoryForDisplayLists;
fG4OpenGLStoredSceneHandler.fMemoryForDisplayLists = false;
fG4OpenGLStoredSceneHandler.G4OpenGLStoredSceneHandler::AddPrimitive(text);
fG4OpenGLStoredSceneHandler.fMemoryForDisplayLists = memoryForDisplayListsKeep;
}
void G4OpenGLStoredViewer::AddPrimitiveForASingleFrame(const G4Circle& circle)
{
// We don't want this to get into a display list or a TODL or a PODL so
// use the fMemoryForDisplayLists flag.
G4bool memoryForDisplayListsKeep = fG4OpenGLStoredSceneHandler.fMemoryForDisplayLists;
fG4OpenGLStoredSceneHandler.fMemoryForDisplayLists = false;
fG4OpenGLStoredSceneHandler.G4OpenGLStoredSceneHandler::AddPrimitive(circle);
fG4OpenGLStoredSceneHandler.fMemoryForDisplayLists = memoryForDisplayListsKeep;
}
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLViewer.cc 107329 2017-11-08 16:41:26Z gcosmo $
// $Id: G4OpenGLViewer.cc 108131 2018-01-09 13:23:26Z gcosmo $
//
//
// Andrew Walkden 27th March 1996
@@ -74,24 +74,6 @@ background (G4Colour(0.,0.,0.)),
transparency_enabled (true),
antialiasing_enabled (false),
haloing_enabled (false),
fStartTime(-DBL_MAX),
fEndTime(DBL_MAX),
fFadeFactor(0.),
fDisplayHeadTime(false),
fDisplayHeadTimeX(-0.9),
fDisplayHeadTimeY(-0.9),
fDisplayHeadTimeSize(24.),
fDisplayHeadTimeRed(0.),
fDisplayHeadTimeGreen(1.),
fDisplayHeadTimeBlue(1.),
fDisplayLightFront(false),
fDisplayLightFrontX(0.),
fDisplayLightFrontY(0.),
fDisplayLightFrontZ(0.),
fDisplayLightFrontT(0.),
fDisplayLightFrontRed(0.),
fDisplayLightFrontGreen(1.),
fDisplayLightFrontBlue(0.),
fRot_sens(1.),
fPan_sens(0.01),
fWinSize_x(0),
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OpenGLViewerMessenger.cc 101105 2016-11-07 08:09:26Z gcosmo $
// $Id: G4OpenGLViewerMessenger.cc 109510 2018-04-26 07:15:57Z gcosmo $
#ifdef G4VIS_BUILD_OPENGL_DRIVER
@@ -122,7 +122,8 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
fpCommandDisplayHeadTime =
new G4UIcommand("/vis/ogl/set/displayHeadTime", this);
fpCommandDisplayHeadTime->SetGuidance
("Display head time of range in 2D text.");
("DEPRECATED. Use /vis/viewer/set/timeWindow/displayHeadTime."
"\n Display head time of range in 2D text.");
parameter = new G4UIparameter ("displayHeadTime", 'b', omitable = false);
parameter->SetDefaultValue(false);
fpCommandDisplayHeadTime->SetParameter(parameter);
@@ -155,7 +156,8 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
fpCommandDisplayLightFront =
new G4UIcommand("/vis/ogl/set/displayLightFront", this);
fpCommandDisplayLightFront->SetGuidance
("Display the light front at head time.");
("DEPRECATED. Use /vis/viewer/set/timeWindow/displayLightFront."
"\n Display the light front at head time.");
fpCommandDisplayLightFront->SetGuidance
("Tip: The trajectories can appear of jump ahead of the light front"
"\nbecause their time range overlaps the viewer's time range. To"
@@ -209,9 +211,11 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
fpCommandEndTime =
new G4UIcommand("/vis/ogl/set/endTime", this);
fpCommandEndTime->SetGuidance("Set end and range of track time.");
fpCommandEndTime->SetGuidance
("DEPRECATED. Use /vis/viewer/set/timeWindow/endTime."
"\n Set end and range of time window.");
parameter = new G4UIparameter ("end-time", 'd', omitable = false);
parameter->SetDefaultValue(DBL_MAX);
parameter->SetDefaultValue(G4VisAttributes::fVeryLongTime);
fpCommandEndTime->SetParameter(parameter);
parameter = new G4UIparameter ("end-time-unit", 's', omitable = false);
parameter->SetDefaultValue("ns");
@@ -234,7 +238,8 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
fpCommandFade = new G4UIcmdWithADouble("/vis/ogl/set/fade", this);
fpCommandFade->SetGuidance
("0: no fade; 1: maximum fade with time within range.");
("DEPRECATED. Use /vis/viewer/set/timeWindow/fadeFactor."
"\n 0: no fade; 1: maximum fade with time within range.");
fpCommandFade->SetParameterName("fadefactor", omitable = false);
fpCommandFade->SetRange("fadefactor>=0.&&fadefactor<=1.");
fpCommandFade->SetDefaultValue(0.);
@@ -284,9 +289,11 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
fpCommandStartTime =
new G4UIcommand("/vis/ogl/set/startTime", this);
fpCommandStartTime->SetGuidance("Set start and range of track time.");
fpCommandStartTime->SetGuidance
("DEPRECATED. Use /vis/viewer/set/timeWindow/startTime."
"\n Set start and range of time window.");
parameter = new G4UIparameter ("start-time", 'd', omitable = false);
parameter->SetDefaultValue(-DBL_MAX);
parameter->SetDefaultValue(-G4VisAttributes::fVeryLongTime);
fpCommandStartTime->SetParameter(parameter);
parameter = new G4UIparameter ("start-time-unit", 's', omitable = false);
parameter->SetDefaultValue("ns");
@@ -500,13 +507,16 @@ void G4OpenGLViewerMessenger::SetNewValue
std::istringstream iss(newValue);
iss >> display >> screenX >> screenY
>> screenSize >> red >> green >> blue;
pOGLSViewer->fDisplayHeadTime = command->ConvertToBool(display);
pOGLSViewer->fDisplayHeadTimeX = screenX;
pOGLSViewer->fDisplayHeadTimeY = screenY;
pOGLSViewer->fDisplayHeadTimeSize = screenSize;
pOGLSViewer->fDisplayHeadTimeRed = red;
pOGLSViewer->fDisplayHeadTimeGreen = green;
pOGLSViewer->fDisplayHeadTimeBlue = blue;
pOGLSViewer->fVP.SetDisplayHeadTime(command->ConvertToBool(display));
pOGLSViewer->fVP.SetDisplayHeadTimeX(screenX);
pOGLSViewer->fVP.SetDisplayHeadTimeY(screenY);
pOGLSViewer->fVP.SetDisplayHeadTimeSize(screenSize);
pOGLSViewer->fVP.SetDisplayHeadTimeRed(red);
pOGLSViewer->fVP.SetDisplayHeadTimeGreen(green);
pOGLSViewer->fVP.SetDisplayHeadTimeBlue(blue);
G4cout
<< "DEPRECATED. Use /vis/viewer/set/timeWindow/displayHeadTime."
<< G4endl;
return;
}
@@ -519,18 +529,21 @@ void G4OpenGLViewerMessenger::SetNewValue
>> originX >> originY >> originZ >> unitS
>> originT >> unitT
>> red >> green >> blue;
pOGLSViewer->fDisplayLightFront = command->ConvertToBool(display);
pOGLSViewer->fDisplayLightFrontX =
command->ConvertToDimensionedDouble(G4String(originX + ' ' + unitS));
pOGLSViewer->fDisplayLightFrontY =
command->ConvertToDimensionedDouble(G4String(originY + ' ' + unitS));
pOGLSViewer->fDisplayLightFrontZ =
command->ConvertToDimensionedDouble(G4String(originZ + ' ' + unitS));
pOGLSViewer->fDisplayLightFrontT =
command->ConvertToDimensionedDouble(G4String(originT + ' ' + unitT));
pOGLSViewer->fDisplayLightFrontRed = red;
pOGLSViewer->fDisplayLightFrontGreen = green;
pOGLSViewer->fDisplayLightFrontBlue = blue;
pOGLSViewer->fVP.SetDisplayLightFront(command->ConvertToBool(display));
pOGLSViewer->fVP.SetDisplayLightFrontX
(command->ConvertToDimensionedDouble(G4String(originX + ' ' + unitS)));
pOGLSViewer->fVP.SetDisplayLightFrontY
(command->ConvertToDimensionedDouble(G4String(originY + ' ' + unitS)));
pOGLSViewer->fVP.SetDisplayLightFrontZ
(command->ConvertToDimensionedDouble(G4String(originZ + ' ' + unitS)));
pOGLSViewer->fVP.SetDisplayLightFrontT
(command->ConvertToDimensionedDouble(G4String(originT + ' ' + unitT)));
pOGLSViewer->fVP.SetDisplayLightFrontRed(red);
pOGLSViewer->fVP.SetDisplayLightFrontGreen(green);
pOGLSViewer->fVP.SetDisplayLightFrontBlue(blue);
G4cout
<< "DEPRECATED. Use /vis/viewer/set/timeWindow/displayLightFront."
<< G4endl;
return;
}
@@ -541,23 +554,31 @@ void G4OpenGLViewerMessenger::SetNewValue
std::istringstream iss(newValue);
iss >> end_time_string >> end_time_unit
>> time_range_string >> time_range_unit;
pOGLSViewer->fEndTime = command->ConvertToDimensionedDouble
(G4String(end_time_string + ' ' + end_time_unit));
pOGLSViewer->fVP.SetEndTime
(command->ConvertToDimensionedDouble
(G4String(end_time_string + ' ' + end_time_unit)));
G4double timeRange = command->ConvertToDimensionedDouble
(G4String(time_range_string + ' ' + time_range_unit));
if (timeRange > 0.) {
pOGLSViewer->fStartTime = pOGLSViewer->fEndTime - timeRange;
pOGLSViewer->fVP.SetStartTime
(pOGLSViewer->fVP.GetEndTime() - timeRange);
}
if (pOGLSViewer->fVP.IsAutoRefresh())
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/refresh");
G4cout
<< "DEPRECATED. Use /vis/viewer/set/timeWindow/endTime."
<< G4endl;
return;
}
if (command == fpCommandFade)
{
pOGLSViewer->fFadeFactor = command->ConvertToDouble(newValue);
pOGLSViewer->fVP.SetFadeFactor(command->ConvertToDouble(newValue));
if (pOGLSViewer->fVP.IsAutoRefresh())
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/refresh");
G4cout
<< "DEPRECATED. Use /vis/viewer/set/timeWindow/fadeFactor."
<< G4endl;
return;
}
@@ -568,15 +589,20 @@ void G4OpenGLViewerMessenger::SetNewValue
std::istringstream iss(newValue);
iss >> start_time_string >> start_time_unit
>> time_range_string >> time_range_unit;
pOGLSViewer->fStartTime = command->ConvertToDimensionedDouble
(G4String(start_time_string + ' ' + start_time_unit));
pOGLSViewer->fVP.SetStartTime
(command->ConvertToDimensionedDouble
(G4String(start_time_string + ' ' + start_time_unit)));
G4double timeRange = command->ConvertToDimensionedDouble
(G4String(time_range_string + ' ' + time_range_unit));
if (timeRange > 0.) {
pOGLSViewer->fEndTime = pOGLSViewer->fStartTime + timeRange;
pOGLSViewer->fVP.SetEndTime
(pOGLSViewer->fVP.GetStartTime() + timeRange);
}
if (pOGLSViewer->fVP.IsAutoRefresh())
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/refresh");
G4cout
<< "DEPRECATED. Use /vis/viewer/set/timeWindow/startTime."
<< G4endl;
return;
}