Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -61,13 +61,7 @@ G4OpenGLImmediateXViewer::~G4OpenGLImmediateXViewer () {}
|
||||
|
||||
void G4OpenGLImmediateXViewer::Initialise () {
|
||||
|
||||
// CreateGLXContext (vi_immediate);
|
||||
// Force double buffer context. (This can happen anyway when the display
|
||||
// list limit is reached in stored mode. Seems to be no problem. We were
|
||||
// finding that the single buffer visual gave an X Error (BadMatch) on
|
||||
// some systems, so let us force the use if a double buffer. All systems
|
||||
// have double buffers nowadays.
|
||||
CreateGLXContext (vi_stored);
|
||||
CreateGLXContext (vi_immediate);
|
||||
CreateMainWindow ();
|
||||
CreateFontLists ();
|
||||
|
||||
|
||||
@@ -34,16 +34,6 @@
|
||||
|
||||
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
|
||||
|
||||
#include "G4OpenGLQtViewer.hh"
|
||||
|
||||
#include "G4OpenGLSceneHandler.hh"
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4OpenGLQtExportDialog.hh"
|
||||
#include "G4OpenGLQtMovieDialog.hh"
|
||||
#include "G4Qt.hh"
|
||||
#include "G4UIQt.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4VisCommandsGeometrySet.hh"
|
||||
@@ -53,6 +43,15 @@
|
||||
#include "G4OpenGLStoredQtViewer.hh"
|
||||
#include "G4Threading.hh"
|
||||
|
||||
#include "G4OpenGLQtViewer.hh"
|
||||
#include "G4OpenGLSceneHandler.hh"
|
||||
#include "G4OpenGLQtExportDialog.hh"
|
||||
#include "G4OpenGLQtMovieDialog.hh"
|
||||
#include "G4Qt.hh"
|
||||
#include "G4UIQt.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include <typeinfo>
|
||||
@@ -84,7 +83,11 @@
|
||||
#include <qgroupbox.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qlineedit.h>
|
||||
#if QT_VERSION < 0x050600
|
||||
#include <qsignalmapper.h>
|
||||
#else
|
||||
#include <qscreen.h>
|
||||
#endif
|
||||
#include <qmainwindow.h>
|
||||
#include <qtablewidget.h>
|
||||
#include <qheaderview.h>
|
||||
@@ -94,8 +97,6 @@
|
||||
#include <qcursor.h>
|
||||
#include <qthread.h>
|
||||
|
||||
#include "G4Threading.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
G4Mutex mWaitForVisSubThreadQtOpenGLContextMoved = G4MUTEX_INITIALIZER;
|
||||
@@ -184,9 +185,14 @@ void G4OpenGLQtViewer::CreateMainWindow (
|
||||
|
||||
|
||||
//useful for MACOSX, we have to compt the menuBar height
|
||||
int offset = QApplication::desktop()->height()
|
||||
- QApplication::desktop()->availableGeometry().height();
|
||||
|
||||
#if QT_VERSION >= 0x050a00
|
||||
G4int offset = QApplication::desktop()->height()
|
||||
- QGuiApplication::screenAt(QPoint(20,20))->availableGeometry().height();
|
||||
#else
|
||||
G4int offset = QApplication::desktop()->height()
|
||||
- QApplication::desktop()->availableGeometry().height();
|
||||
#endif
|
||||
|
||||
G4int YPos= fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height());
|
||||
if (fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height())< offset) {
|
||||
YPos = offset;
|
||||
@@ -259,9 +265,11 @@ G4OpenGLQtViewer::G4OpenGLQtViewer (
|
||||
,fModelShortNameItem(NULL)
|
||||
,fMaxPOindexInserted(-1)
|
||||
,fUiQt(NULL)
|
||||
#if QT_VERSION < 0x050600
|
||||
,fSignalMapperMouse(NULL)
|
||||
,fSignalMapperSurface(NULL)
|
||||
,fSignalMapperPicking(NULL)
|
||||
#endif
|
||||
,fTreeIconOpen(NULL)
|
||||
,fTreeIconClosed(NULL)
|
||||
,fLastExportSliderValue(80)
|
||||
@@ -289,9 +297,10 @@ G4OpenGLQtViewer::G4OpenGLQtViewer (
|
||||
initMovieParameters();
|
||||
|
||||
fLastEventTime = new QTime();
|
||||
#if QT_VERSION < 0x050600
|
||||
fSignalMapperMouse = new QSignalMapper(this);
|
||||
fSignalMapperSurface = new QSignalMapper(this);
|
||||
|
||||
#endif
|
||||
// Set default path and format
|
||||
fFileSavePath = QDir::currentPath();
|
||||
|
||||
@@ -532,11 +541,19 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
|
||||
QMenu *mMouseAction = fContextMenu->addMenu("&Mouse actions");
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
fMouseRotateAction = mMouseAction->addAction("Rotate", fSignalMapperMouse, SLOT(map()));
|
||||
fMouseMoveAction = mMouseAction->addAction("Move", fSignalMapperMouse, SLOT(map()));
|
||||
fMousePickAction = mMouseAction->addAction("Pick", fSignalMapperMouse, SLOT(map()));
|
||||
fMouseZoomOutAction = mMouseAction->addAction("Zoom out", fSignalMapperMouse, SLOT(map()));
|
||||
fMouseZoomInAction = mMouseAction->addAction("Zoom in", fSignalMapperMouse, SLOT(map()));
|
||||
#else
|
||||
fMouseRotateAction = mMouseAction->addAction("Rotate", this, [=](){ this->toggleMouseAction(1); });
|
||||
fMouseMoveAction = mMouseAction->addAction("Move", this, [=](){ this->toggleMouseAction(2); });
|
||||
fMousePickAction = mMouseAction->addAction("Pick", this, [=](){ this->toggleMouseAction(3); });
|
||||
fMouseZoomOutAction = mMouseAction->addAction("Zoom out", this, [=](){ this->toggleMouseAction(4); });
|
||||
fMouseZoomInAction = mMouseAction->addAction("Zoom in", this, [=](){ this->toggleMouseAction(5); });
|
||||
#endif
|
||||
QAction *shortcutsAction = mMouseAction->addAction("Show shortcuts");
|
||||
|
||||
fMouseRotateAction->setCheckable(true);
|
||||
@@ -546,14 +563,16 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
fMouseZoomInAction->setCheckable(true);
|
||||
shortcutsAction->setCheckable(false);
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
connect(fSignalMapperMouse, SIGNAL(mapped(int)),this, SLOT(toggleMouseAction(int)));
|
||||
fSignalMapperMouse->setMapping(fMouseRotateAction,1);
|
||||
fSignalMapperMouse->setMapping(fMouseMoveAction,2);
|
||||
fSignalMapperMouse->setMapping(fMousePickAction,3);
|
||||
fSignalMapperMouse->setMapping(fMouseZoomOutAction,4);
|
||||
fSignalMapperMouse->setMapping(fMouseZoomInAction,5);
|
||||
#endif
|
||||
|
||||
QObject::connect(shortcutsAction,
|
||||
QObject::connect(shortcutsAction,
|
||||
SIGNAL(triggered(bool)),
|
||||
this,
|
||||
SLOT(showShortcuts()));
|
||||
@@ -563,6 +582,7 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
|
||||
QMenu *mProjection = mStyle->addMenu("&Projection");
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
fProjectionOrtho = mProjection->addAction("Orthographic", fSignalMapperSurface, SLOT(map()));
|
||||
fProjectionPerspective = mProjection->addAction("Persepective", fSignalMapperSurface, SLOT(map()));
|
||||
|
||||
@@ -572,10 +592,15 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
} else {
|
||||
createRadioAction(fProjectionOrtho, fProjectionPerspective,SLOT(toggleProjection(bool)),2);
|
||||
}
|
||||
|
||||
#else
|
||||
// no more radioAction, not realy useful and could be confusing to use context menu and icon at the same time
|
||||
fProjectionOrtho = mProjection->addAction("Orthographic", this, [=](){ this->toggleProjection(1); });
|
||||
fProjectionPerspective = mProjection->addAction("Persepective", this, [=](){ this->toggleProjection(2); });
|
||||
#endif
|
||||
// === Drawing Menu ===
|
||||
QMenu *mDrawing = mStyle->addMenu("&Drawing");
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
fDrawingWireframe = mDrawing->addAction("Wireframe", fSignalMapperSurface, SLOT(map()));
|
||||
|
||||
fDrawingLineRemoval = mDrawing->addAction("Hidden line removal", fSignalMapperSurface, SLOT(map()));
|
||||
@@ -583,18 +608,25 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
fDrawingSurfaceRemoval = mDrawing->addAction("Hidden Surface removal", fSignalMapperSurface, SLOT(map()));
|
||||
|
||||
fDrawingLineSurfaceRemoval = mDrawing->addAction("Hidden line and surface removal", fSignalMapperSurface, SLOT(map()));
|
||||
#endif
|
||||
|
||||
fDrawingWireframe->setCheckable(true);
|
||||
fDrawingLineRemoval->setCheckable(true);
|
||||
fDrawingSurfaceRemoval->setCheckable(true);
|
||||
fDrawingLineSurfaceRemoval->setCheckable(true);
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
connect(fSignalMapperSurface, SIGNAL(mapped(int)),this, SLOT(toggleSurfaceAction(int)));
|
||||
fSignalMapperSurface->setMapping(fDrawingWireframe,1);
|
||||
fSignalMapperSurface->setMapping(fDrawingLineRemoval,2);
|
||||
fSignalMapperSurface->setMapping(fDrawingSurfaceRemoval,3);
|
||||
fSignalMapperSurface->setMapping(fDrawingLineSurfaceRemoval,4);
|
||||
#else
|
||||
fDrawingWireframe = mDrawing->addAction("Wireframe", this, [=](){ this->toggleSurfaceAction(1); });
|
||||
fDrawingLineRemoval = mDrawing->addAction("Hidden line removal", this, [=](){ this->toggleSurfaceAction(2); });
|
||||
fDrawingSurfaceRemoval = mDrawing->addAction("Hidden Surface removal", this, [=](){ this->toggleSurfaceAction(3); });
|
||||
fDrawingLineSurfaceRemoval = mDrawing->addAction("Hidden line and surface removal", this, [=](){ this->toggleSurfaceAction(4); });
|
||||
#endif
|
||||
|
||||
fDrawingWireframe->setCheckable(true);
|
||||
fDrawingLineRemoval->setCheckable(true);
|
||||
fDrawingSurfaceRemoval->setCheckable(true);
|
||||
fDrawingLineSurfaceRemoval->setCheckable(true);
|
||||
|
||||
// Background Color
|
||||
|
||||
@@ -1855,7 +1887,7 @@ void G4OpenGLQtViewer::initMovieParameters() {
|
||||
|
||||
QObject ::connect(fProcess,SIGNAL(finished ( int)),
|
||||
this,SLOT(processLookForFinished()));
|
||||
fProcess->setReadChannelMode(QProcess::MergedChannels);
|
||||
fProcess->setProcessChannelMode(QProcess::MergedChannels);
|
||||
fProcess->start ("which ppmtompeg");
|
||||
|
||||
}
|
||||
@@ -2171,12 +2203,6 @@ bool G4OpenGLQtViewer::exportImage(std::string name, int width, int height) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool G4OpenGLQtViewer::hasPendingEvents () {
|
||||
return ((QApplication*)G4Qt::getInstance ())->hasPendingEvents ();
|
||||
}
|
||||
|
||||
bool G4OpenGLQtViewer::generateMpegEncoderParameters () {
|
||||
|
||||
// save the parameter file
|
||||
@@ -2344,7 +2370,11 @@ void G4OpenGLQtViewer::encodeVideo()
|
||||
QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
|
||||
this,SLOT(processEncodeStdout()));
|
||||
#endif
|
||||
#if QT_VERSION < 0x050a00
|
||||
fProcess->setReadChannelMode(QProcess::MergedChannels);
|
||||
#else
|
||||
fProcess->setProcessChannelMode(QProcess::MergedChannels);
|
||||
#endif
|
||||
fProcess->start (fEncoderPath, QStringList(fMovieTempFolderPath+fParameterFileName));
|
||||
}
|
||||
}
|
||||
@@ -2777,7 +2807,11 @@ void G4OpenGLQtViewer::DrawText(const G4Text& g4text)
|
||||
|
||||
// Calculate move for centre and right adjustment
|
||||
QFontMetrics* f = new QFontMetrics (font);
|
||||
#if QT_VERSION > 0x050110
|
||||
G4double span = f->boundingRect(textCString[0]).width();
|
||||
#else
|
||||
G4double span = f->width(textCString);
|
||||
#endif
|
||||
G4double xmove = 0., ymove = 0.;
|
||||
switch (g4text.GetLayout()) {
|
||||
case G4Text::left: break;
|
||||
@@ -4480,8 +4514,10 @@ void G4OpenGLQtViewer::updatePickInfosWidget(int aX, int aY) {
|
||||
}
|
||||
|
||||
// Create a new signalMapper
|
||||
#if QT_VERSION < 0x050600
|
||||
delete fSignalMapperPicking;
|
||||
fSignalMapperPicking = new QSignalMapper(this);
|
||||
#endif
|
||||
|
||||
// parse all pick results
|
||||
G4int nPickedObjectsWithAttributes = 0;
|
||||
@@ -4544,19 +4580,24 @@ void G4OpenGLQtViewer::updatePickInfosWidget(int aX, int aY) {
|
||||
newStr = QStringList(QString(content.str().c_str()).trimmed());
|
||||
|
||||
QTextEdit* ed = new QTextEdit();
|
||||
ed->setFontFamily("Courier");
|
||||
ed->setFontPointSize(12);
|
||||
ed->setReadOnly(true);
|
||||
fPickInfosWidget->layout()->addWidget(ed);
|
||||
ed->setVisible((false));
|
||||
ed->append(newStr.join(""));
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
connect(pickCoutButton, SIGNAL(clicked()), fSignalMapperPicking, SLOT(map()));
|
||||
fSignalMapperPicking->setMapping(pickCoutButton,fPickInfosWidget->layout()->count()-1);
|
||||
#else
|
||||
std::cout << pickCoutButton->text().toStdString() << " "<< fPickInfosWidget->layout()->count()-1<< std::endl;
|
||||
int tmp = fPickInfosWidget->layout()->count()-1;
|
||||
connect(pickCoutButton, &QPushButton::clicked , [=](){ this->toggleSceneTreeComponentPickingCout(tmp);});
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
connect(fSignalMapperPicking, SIGNAL(mapped(int)),this, SLOT(toggleSceneTreeComponentPickingCout(int)));
|
||||
#endif
|
||||
|
||||
// add a label to push everything up!
|
||||
QLabel * pushUp = new QLabel("");
|
||||
|
||||
@@ -120,28 +120,31 @@ void G4OpenGLSceneHandler::ScaledFlush()
|
||||
// Drawing transients, e.g., trajectories.
|
||||
|
||||
if (!fpScene) {
|
||||
// No scene, so probably not in event loop.
|
||||
// No scene - shouldn't happen
|
||||
glFlush();
|
||||
return;
|
||||
}
|
||||
// Get event from modeling parameters
|
||||
if (!fpModel) {
|
||||
// No model, so probably not in event loop
|
||||
// No model - shouldn't happen
|
||||
glFlush();
|
||||
return;
|
||||
}
|
||||
const G4ModelingParameters* modelingParameters =
|
||||
fpModel->GetModelingParameters();
|
||||
if (!modelingParameters) {
|
||||
// No modeling parameters, so probably not in event loop.
|
||||
// No modeling parameters - shouldn't happen
|
||||
glFlush();
|
||||
return;
|
||||
}
|
||||
const G4Event* thisEvent = modelingParameters->GetEvent();
|
||||
if (!thisEvent) {
|
||||
// No event, so probably not in event loop.
|
||||
glFlush();
|
||||
return;
|
||||
// No event, so not in event loop.
|
||||
if (fFlushAction == endOfEvent) {
|
||||
fFlushAction = endOfRun;
|
||||
} else if (fFlushAction == NthEvent) {
|
||||
fFlushAction = NthPrimitive;
|
||||
}
|
||||
}
|
||||
G4RunManager* runMan = G4RunManager::GetRunManager();
|
||||
#ifdef G4MULTITHREADED
|
||||
@@ -150,13 +153,18 @@ void G4OpenGLSceneHandler::ScaledFlush()
|
||||
}
|
||||
#endif
|
||||
if (!runMan) {
|
||||
// No run manager - shouldn't happen
|
||||
glFlush();
|
||||
return;
|
||||
}
|
||||
const G4Run* thisRun = runMan->GetCurrentRun();
|
||||
if (!thisRun) {
|
||||
glFlush();
|
||||
return;
|
||||
// No run, so not in event loop.
|
||||
if (fFlushAction == endOfRun) {
|
||||
fFlushAction = NthPrimitive;
|
||||
} else if (fFlushAction == NthEvent) {
|
||||
fFlushAction = NthPrimitive;
|
||||
}
|
||||
}
|
||||
|
||||
switch (fFlushAction) {
|
||||
|
||||
@@ -353,7 +353,7 @@ end_of_display_list_reuse_test:
|
||||
"********************* WARNING! ********************"
|
||||
"\n* Display list limit reached in OpenGL."
|
||||
"\n* Continuing drawing WITHOUT STORING. Scene only partially refreshable."
|
||||
"\n* Current limit: " << fDisplayListLimit <<
|
||||
"\n* Current limit: " << fDisplayListLimit << " primitives"
|
||||
". Change with \"/vis/ogl/set/displayListLimit\"."
|
||||
"\n***************************************************"
|
||||
<< G4endl;
|
||||
|
||||
@@ -203,7 +203,7 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
|
||||
fpCommandDisplayListLimit =
|
||||
new G4UIcmdWithAnInteger("/vis/ogl/set/displayListLimit", this);
|
||||
fpCommandDisplayListLimit->SetGuidance
|
||||
("Set/reset display list limit (to avoid memory exhaustion).");
|
||||
("Set/reset display list number of primitive limit (to avoid memory exhaustion).");
|
||||
fpCommandDisplayListLimit->SetParameterName("limit", omitable = true);
|
||||
fpCommandDisplayListLimit->SetDefaultValue(50000);
|
||||
fpCommandDisplayListLimit->SetRange("limit>=10000");
|
||||
|
||||
@@ -190,7 +190,6 @@ void G4OpenGLXViewer::CreateGLXContext (XVisualInfo* v) {
|
||||
// New stab at getting a colormap
|
||||
|
||||
Status status;
|
||||
XStandardColormap *standardCmaps = XAllocStandardColormap ();
|
||||
int i, numCmaps;
|
||||
|
||||
status = XmuLookupStandardColormap (dpy,
|
||||
@@ -203,36 +202,48 @@ void G4OpenGLXViewer::CreateGLXContext (XVisualInfo* v) {
|
||||
|
||||
if (status == 1) {
|
||||
cmap = 0;
|
||||
XStandardColormap* standardCmaps = XAllocStandardColormap ();
|
||||
status = XGetRGBColormaps (dpy,
|
||||
XRootWindow (dpy, vi -> screen),
|
||||
&standardCmaps,
|
||||
&numCmaps,
|
||||
XA_RGB_BEST_MAP);
|
||||
if (status == 1)
|
||||
if (status == 1) {
|
||||
for (i = 0; i < numCmaps; i++) {
|
||||
if (standardCmaps[i].visualid == vi -> visualid) {
|
||||
cmap = standardCmaps[i].colormap;
|
||||
XFree (standardCmaps);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!cmap) {
|
||||
fViewId = -1; // This flags an error.
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cerr <<
|
||||
"G4OpenGLXViewer::G4OpenGLXViewer failed to allocate a standard colormap."
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Got standard cmap" << G4endl;
|
||||
XFree (standardCmaps);
|
||||
if(cmap) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Got standard cmap" << G4endl;
|
||||
} else {
|
||||
//if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
// G4cerr << "G4OpenGLXViewer::G4OpenGLXViewer failed to allocate a standard colormap."
|
||||
// << G4endl;
|
||||
cmap = XCreateColormap (dpy,
|
||||
XRootWindow(dpy, vi -> screen),
|
||||
vi -> visual,
|
||||
AllocNone);
|
||||
if(cmap) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Created own cmap" << G4endl;
|
||||
}
|
||||
//G.Barrand : at end, we should do a XFreeColormap(dpy,cmap) when cmap is no more used.
|
||||
}
|
||||
} else {
|
||||
cmap = XCreateColormap (dpy,
|
||||
XRootWindow(dpy, vi -> screen),
|
||||
vi -> visual,
|
||||
AllocNone);
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Created own cmap" << G4endl;
|
||||
if(cmap) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Created own cmap" << G4endl;
|
||||
}
|
||||
//G.Barrand : at end, we should do a XFreeColormap(dpy,cmap) when cmap is no more used.
|
||||
}
|
||||
|
||||
if (!cmap) {
|
||||
@@ -467,10 +478,12 @@ cmap (0)
|
||||
if (!vi_single_buffer) {
|
||||
vi_single_buffer =
|
||||
glXChooseVisual (dpy, XDefaultScreen (dpy), snglBuf_RGBA);
|
||||
//G.Barrand : we should do a XFree(vi_single_buffer) at end;
|
||||
}
|
||||
if (!vi_double_buffer) {
|
||||
vi_double_buffer =
|
||||
glXChooseVisual (dpy, XDefaultScreen (dpy), dblBuf_RGBA);
|
||||
//G.Barrand : we should do a XFree(vi_double_buffer) at end;
|
||||
}
|
||||
|
||||
if (vi_single_buffer || vi_double_buffer) {
|
||||
@@ -531,6 +544,7 @@ G4OpenGLXViewer::~G4OpenGLXViewer () {
|
||||
glXDestroyContext (dpy, cxMaster);
|
||||
if (win) XDestroyWindow (dpy, win); // ...if already deleted in
|
||||
// sub-class G4OpenGLXmViewer.
|
||||
// We should do a XFreeColormap(dpy,cmap); if cmap had been get with XCreateColormap.
|
||||
XFlush (dpy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,10 +247,10 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
|
||||
menubar = XmVaCreateSimpleMenuBar (main_win,
|
||||
(char*)"menubar",
|
||||
XmVaCASCADEBUTTON, style_str, 'S',
|
||||
XmVaCASCADEBUTTON, actions_str, 'A',
|
||||
XmVaCASCADEBUTTON, misc_str, 'M',
|
||||
XmVaCASCADEBUTTON, spec_str, 'p',
|
||||
XmVaCASCADEBUTTON, style_str, (KeySym)XK_S, /*G.Barrand : cast to KeySym and use XK_*/
|
||||
XmVaCASCADEBUTTON, actions_str, (KeySym)XK_A,
|
||||
XmVaCASCADEBUTTON, misc_str, (KeySym)XK_M,
|
||||
XmVaCASCADEBUTTON, spec_str, (KeySym)XK_p,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
XtNcolormap, cmap,
|
||||
@@ -275,8 +275,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"style",
|
||||
0,
|
||||
NULL,
|
||||
XmVaCASCADEBUTTON, draw_str, 'D',
|
||||
XmVaCASCADEBUTTON, bgnd_str, 'B',
|
||||
XmVaCASCADEBUTTON, draw_str, (KeySym)XK_D,
|
||||
XmVaCASCADEBUTTON, bgnd_str, (KeySym)XK_B,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
XtNcolormap, cmap,
|
||||
@@ -300,10 +300,10 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"drawing_style",
|
||||
1,
|
||||
drawing_style_callback,
|
||||
XmVaRADIOBUTTON, wireframe_str, 'W', NULL, NULL,
|
||||
XmVaRADIOBUTTON, hlr_str, 'L', NULL, NULL,
|
||||
XmVaRADIOBUTTON, hsr_str, 'S', NULL, NULL,
|
||||
XmVaRADIOBUTTON, hlhsr_str, 'H', NULL, NULL,
|
||||
XmVaRADIOBUTTON, wireframe_str, (KeySym)XK_W, NULL, NULL,
|
||||
XmVaRADIOBUTTON, hlr_str, (KeySym)XK_L, NULL, NULL,
|
||||
XmVaRADIOBUTTON, hsr_str, (KeySym)XK_S, NULL, NULL,
|
||||
XmVaRADIOBUTTON, hlhsr_str, (KeySym)XK_H, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -362,8 +362,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"background_color",
|
||||
2,
|
||||
background_color_callback,
|
||||
XmVaRADIOBUTTON, white_str, 'W', NULL, NULL,
|
||||
XmVaRADIOBUTTON, black_str, 'B', NULL, NULL,
|
||||
XmVaRADIOBUTTON, white_str, (KeySym)XK_W, NULL, NULL,
|
||||
XmVaRADIOBUTTON, black_str, (KeySym)XK_B, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -403,9 +403,9 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"actions",
|
||||
1,
|
||||
actions_callback,
|
||||
XmVaPUSHBUTTON, rot_str, 'R', NULL, NULL,
|
||||
XmVaPUSHBUTTON, pan_str, 'P', NULL, NULL,
|
||||
XmVaPUSHBUTTON, set_str, 'S', NULL, NULL,
|
||||
XmVaPUSHBUTTON, rot_str, (KeySym)XK_R, NULL, NULL,
|
||||
XmVaPUSHBUTTON, pan_str, (KeySym)XK_P, NULL, NULL,
|
||||
XmVaPUSHBUTTON, set_str, (KeySym)XK_S, NULL, NULL,
|
||||
XmNuserData, this,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
@@ -429,9 +429,9 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"miscellany",
|
||||
2,
|
||||
misc_callback,
|
||||
XmVaPUSHBUTTON, misc_str, 'M', NULL, NULL,
|
||||
XmVaPUSHBUTTON, exit_str, 'E', NULL, NULL,
|
||||
XmVaPUSHBUTTON, print_str, 'P', NULL, NULL,
|
||||
XmVaPUSHBUTTON, misc_str, (KeySym)XK_M, NULL, NULL,
|
||||
XmVaPUSHBUTTON, exit_str, (KeySym)XK_E, NULL, NULL,
|
||||
XmVaPUSHBUTTON, print_str, (KeySym)XK_P, NULL, NULL,
|
||||
XmNuserData, this,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
@@ -456,10 +456,10 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"special",
|
||||
3,
|
||||
NULL,
|
||||
XmVaCASCADEBUTTON, trans_str, 'T',
|
||||
XmVaCASCADEBUTTON, anti_str, 'A',
|
||||
XmVaCASCADEBUTTON, halo_str, 'H',
|
||||
XmVaCASCADEBUTTON, aux_edge_str, 'E',
|
||||
XmVaCASCADEBUTTON, trans_str, (KeySym)XK_T,
|
||||
XmVaCASCADEBUTTON, anti_str, (KeySym)XK_A,
|
||||
XmVaCASCADEBUTTON, halo_str, (KeySym)XK_H,
|
||||
XmVaCASCADEBUTTON, aux_edge_str, (KeySym)XK_E,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
XtNcolormap, cmap,
|
||||
@@ -483,8 +483,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"transparency",
|
||||
0,
|
||||
transparency_callback,
|
||||
XmVaRADIOBUTTON, off_str, 'f', NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, 'n', NULL, NULL,
|
||||
XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -518,8 +518,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"antialias",
|
||||
1,
|
||||
antialias_callback,
|
||||
XmVaRADIOBUTTON, off_str, 'f', NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, 'n', NULL, NULL,
|
||||
XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -553,8 +553,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"haloing",
|
||||
2,
|
||||
haloing_callback,
|
||||
XmVaRADIOBUTTON, off_str, 'f', NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, 'n', NULL, NULL,
|
||||
XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -588,8 +588,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"aux_edge",
|
||||
3,
|
||||
aux_edge_callback,
|
||||
XmVaRADIOBUTTON, off_str, 'f', NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, 'n', NULL, NULL,
|
||||
XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
|
||||
Reference in New Issue
Block a user