Import Geant4 11.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2024-06-28 13:08:51 +02:00
parent f7b23877ed
commit e58e650b32
5232 changed files with 239416 additions and 244360 deletions
@@ -0,0 +1,83 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// G.Barrand.
#ifndef G4OpenGL_h
#define G4OpenGL_h
#ifdef WIN32
#include <windows.h>
#undef min
#undef max
#endif
#if defined (G4VIS_BUILD_OPENGLX_DRIVER) || defined (G4VIS_USE_OPENGLX)
#if defined (G4VIS_BUILD_OPENGLQT_DRIVER) || defined (G4VIS_USE_OPENGLQT)
#ifdef __MACH__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#else
#include <GL/gl.h>
#endif
#endif
#if defined (G4VIS_BUILD_OPENGLXM_DRIVER) || defined (G4VIS_USE_OPENGLXM)
#if defined (G4VIS_BUILD_OPENGLQT_DRIVER) || defined (G4VIS_USE_OPENGLQT)
#ifdef __MACH__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#else
#include <GL/gl.h>
#endif
#endif
#if defined (G4VIS_BUILD_OPENGLWIN32_DRIVER) || defined (G4VIS_USE_OPENGLWIN32)
# include <GL/gl.h>
#endif
//# Do NOT include glx Here ! It has to be done, after all <Qxx...> includes
//# include <GL/glx.h>
#if defined (G4VIS_BUILD_OPENGLQT_DRIVER) || defined (G4VIS_USE_OPENGLQT)
#if defined (G4VIS_BUILD_OPENGLX_DRIVER) || defined (G4VIS_USE_OPENGLX)
#else
#ifdef __MACH__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#endif
#endif
#define G4OPENGL_FLT_BIG 1.e20
#endif
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// J.Allison Apr 2005.
// Class Description:
// Facilitates sharing of font bases between scene handler and viewers.
#ifndef G4OPENGLFONTBASESTORE_HH
#define G4OPENGLFONTBASESTORE_HH
#include "globals.hh"
#include <map>
#include <vector>
class G4VViewer;
class G4OpenGLFontBaseStore {
public:
struct FontInfo {
FontInfo():
fFontName(""), fSize(0), fFontBase(-1), fWidth(-1) {}
FontInfo
(const G4String& fontName, G4double size, G4int fontBase, G4int width):
fFontName(fontName), fSize(size), fFontBase(fontBase), fWidth(width) {}
G4String fFontName;
G4double fSize; // In terms of G4VMarker Screen Size.
G4int fFontBase;
G4int fWidth;
};
static void AddFontBase(G4VViewer*, G4int fontBase,
G4double size, const G4String& fontName,
G4int width);
static const FontInfo& GetFontInfo(G4VViewer*, G4double size);
private:
static std::map<G4VViewer*,std::vector<FontInfo> > fFontBaseMap;
};
#endif
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Class G4OpenGLImmediateQtViewer : a class derived from
// G4OpenGLQtViewer and G4OpenGLImmediateViewer.
#ifndef G4OPENGLIMMEDIATEQTVIEWER_HH
#define G4OPENGLIMMEDIATEQTVIEWER_HH
#include "G4OpenGLImmediateViewer.hh"
#include "G4OpenGLQtViewer.hh"
#include "globals.hh"
class G4OpenGLImmediateSceneHandler;
class G4OpenGLImmediateQtViewer:
public G4OpenGLQtViewer, public G4OpenGLImmediateViewer, public G4QGLWidgetType {
public:
G4OpenGLImmediateQtViewer (G4OpenGLImmediateSceneHandler& scene,
const G4String& name = "");
~G4OpenGLImmediateQtViewer ();
void Initialise ();
void initializeGL ();
void DrawView ();
void resizeGL(int width,int height);
void paintGL();
void updateQWidget();
void ShowView ();
#if QT_VERSION < 0x060000
#else
//G.Barrand: macOS: to avoid a crash at startup at first gl call.
virtual void ClearView() {
if(!G4QGLWidgetType::isValid()) return;
G4OpenGLViewer::ClearView();
}
virtual void SetView() {
if(!G4QGLWidgetType::isValid()) return;
G4OpenGLViewer::SetView();
}
#endif
protected:
void showEvent(QShowEvent * event );
void wheelEvent(QWheelEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void contextMenuEvent(QContextMenuEvent *e);
void keyPressEvent (QKeyEvent * event);
void keyReleaseEvent (QKeyEvent * event);
#if QT_VERSION < 0x060000
void paintEvent(QPaintEvent *event);
#endif
private:
void ComputeView ();
};
#endif
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 10th February 1997
// G4OpenGLImmediateSceneHandler - no Display lists.
#ifndef G4OPENGLIMMEDIATESCENEHANDLER_HH
#define G4OPENGLIMMEDIATESCENEHANDLER_HH
#include "G4OpenGLSceneHandler.hh"
#include "globals.hh"
class G4OpenGLImmediate;
class G4OpenGLImmediateSceneHandler: public G4OpenGLSceneHandler {
public:
G4OpenGLImmediateSceneHandler (G4VGraphicsSystem& system, const G4String& name);
virtual ~G4OpenGLImmediateSceneHandler ();
void BeginPrimitives (const G4Transform3D& objectTransformation);
void EndPrimitives ();
void BeginPrimitives2D (const G4Transform3D& objectTransformation);
void EndPrimitives2D ();
void BeginModeling ();
void EndModeling ();
using G4VSceneHandler::AddPrimitive;
void AddPrimitive (const G4Polyline&);
void AddPrimitive (const G4Polymarker&);
void AddPrimitive (const G4Text& text);
void AddPrimitive (const G4Circle&);
void AddPrimitive (const G4Square&);
void AddPrimitive (const G4Polyhedron&);
protected:
G4bool AddPrimitivePreamble(const G4VMarker& visible);
G4bool AddPrimitivePreamble(const G4Polyline& visible);
G4bool AddPrimitivePreamble(const G4Polyhedron& visible);
void ClearTransientStore ();
static G4int fSceneIdCount; // static counter for OpenGLImmediate scenes.
private:
bool AddPrimitivePreambleInternal(const G4Visible& visible, bool isMarker, bool isPolyline);
};
#endif
@@ -0,0 +1,50 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 7th February 1997
// Class G4OpenGLImmediateViewer : Encapsulates the `immediateness' of
// an OpenGL viewer, for inheritance by
// derived (X, Xm...) classes.
#ifndef G4OPENGLIMMEDIATEVIEWER_HH
#define G4OPENGLIMMEDIATEVIEWER_HH
#include "G4OpenGLViewer.hh"
#include "globals.hh"
class G4OpenGLSceneHandler;
class G4OpenGLImmediateSceneHandler;
class G4OpenGLImmediateViewer: virtual public G4OpenGLViewer {
public:
G4OpenGLImmediateViewer (G4OpenGLImmediateSceneHandler& scene);
void ProcessView ();
};
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Class G4OpenGLImmediateWin32Viewer : a class derived from
// G4OpenGLWin32Viewer and G4OpenGLImmediateViewer.
#ifndef G4OpenGLIMMEDIATEWIN32VIEWER_HH
#define G4OpenGLIMMEDIATEWIN32VIEWER_HH
#include "G4OpenGLImmediateViewer.hh"
#include "G4OpenGLWin32Viewer.hh"
#include "globals.hh"
class G4OpenGLImmediateSceneHandler;
class G4OpenGLImmediateWin32Viewer:
public G4OpenGLWin32Viewer, public G4OpenGLImmediateViewer{
public:
G4OpenGLImmediateWin32Viewer (G4OpenGLImmediateSceneHandler& scene,
const G4String& name = "");
void Initialise ();
void DrawView ();
void FinishView ();
};
#endif
@@ -0,0 +1,55 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 7th February 1997
// Class G4OpenGLImmediateXViewer : a class derived from G4OpenGLXViewer and
// G4OpenGLImmediateViewer.
#ifndef G4OpenGLIMMEDIATEXVIEWER_HH
#define G4OpenGLIMMEDIATEXVIEWER_HH
#include "G4OpenGLImmediateViewer.hh"
#include "G4OpenGLXViewer.hh"
#include "globals.hh"
class G4OpenGLImmediateSceneHandler;
class G4OpenGLImmediateXViewer:
public G4OpenGLXViewer, public G4OpenGLImmediateViewer{
public:
G4OpenGLImmediateXViewer (G4OpenGLImmediateSceneHandler& scene,
const G4String& name = "");
virtual ~G4OpenGLImmediateXViewer ();
void Initialise ();
void DrawView ();
void FinishView ();
};
#endif
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 10th February 1997
// G4OpenGLXmViewer : Class derived from G4OpenGLXViewer, to provide
// (Motif) widget OpenGL functionality for GEANT4.
#ifndef G4OPENGLIMMEDIATEXMVIEWER_HH
#define G4OPENGLIMMEDIATEXMVIEWER_HH
#include "G4OpenGLImmediateViewer.hh"
#include "G4OpenGLXmViewer.hh"
#include "globals.hh"
class G4OpenGLImmediateSceneHandler;
class G4OpenGLImmediateXmViewer:
public G4OpenGLXmViewer, public G4OpenGLImmediateViewer{
public:
G4OpenGLImmediateXmViewer (G4OpenGLImmediateSceneHandler& scene,
const G4String& name = "");
virtual ~G4OpenGLImmediateXmViewer ();
void Initialise ();
void DrawView ();
void FinishView ();
};
#endif
@@ -0,0 +1,121 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
#ifndef G4OPENGLQTEXPORTDIALOG_HH
#define G4OPENGLQTEXPORTDIALOG_HH
#include <qdialog.h>
class QButtonGroup;
class QPushButton;
class QRadioButton;
class QCheckBox;
class QSlider;
class QComboBox;
class QLabel;
class QLineEdit;
class QGroupBox;
/** The G4OpenGLQtExportDialog class provide a Dialog displaying differents options
for each file format
*/
class G4OpenGLQtExportDialog : public QDialog
{
Q_OBJECT
public:
/** Construct a G4OpenGLQtExportDialog
@param parentw : parent widget
@param format : format of save file in lower case
@param height : height of the original file
@param width : width of the original file
*/
G4OpenGLQtExportDialog(QWidget* parentw, QString format, int height =0, int width=0);
/** Destroys G4OpenGLQtExportDialog */
~G4OpenGLQtExportDialog();
/** @return the value of the slider if format has a slider widget, instead return -1 */
int getSliderValue();
/** return the new width for file if format has a width widget, instead return
the original value */
int getWidth();
/** return the new height for file if format has a height widget, instead return
the original value */
int getHeight();
/** return if vector EPS is checked, if button does'nt exist, return 0 */
bool getVectorEPS();
public Q_SLOTS:
/** Called by a clic on modify/original size button.This will
invert buttons and hide/unhide size
*/
void changeSizeBox();
/** Called by a clic on vectorEPS check box.If vectorEPS checkBox is checked,
it will enable change size buttons. Else it will disable them.
*/
void changeVectorEPS();
/** Called by changing value in height lineEdit. If ratio is keep, will also change the width
*/
void textWidthChanged(const QString &);
/** Called by changing value in width lineEdit. If ratio is keep, will also change the height
*/
void textHeightChanged(const QString &);
private:
QString f_name, f_type, f_dir;
// QLabel* qualityLabel;
// bool expAll;
QPushButton* buttonOk;
QPushButton* buttonCancel;
QGroupBox * sizeGroupBox;
QCheckBox/** transparencyEPS,*boxTransparency,*/*vectorEPSCheckBox;
QCheckBox* ratioCheckBox;
QSlider * qualitySlider;
// QLabel *formatLabel;
QRadioButton* colorButton,*BWButton;
QRadioButton* original,* modify;
QLineEdit* height,*width;
QWidget* heightWidget,* widthWidget;
int originalWidth;
int originalHeight;
bool isChangingSize;
};
#endif
@@ -0,0 +1,89 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
#ifndef G4OPENGLQTMOVIEDIALOG_HH
#define G4OPENGLQTMOVIEDIALOG_HH
#include <qdialog.h>
class QPushButton;
class QLabel;
class QLineEdit;
class G4OpenGLQtViewer;
class QGroupBox;
/** The G4OpenGLQtMovieDialog class provide a Dialog displaying differents options
for each file format
*/
class G4OpenGLQtMovieDialog : public QDialog
{
Q_OBJECT
public:
/** Construct a G4OpenGLQtMovieDialog
@param parent : parent widget
*/
G4OpenGLQtMovieDialog(G4OpenGLQtViewer*,QWidget*);
/** Destroys G4OpenGLQtMovieDialog */
~G4OpenGLQtMovieDialog();
void setRecordingStatus(QString);
void setRecordingInfos(QString);
private :
QLineEdit* fEncoderPath;
QLineEdit* fTempFolderPath;
QLineEdit* fSaveFileName;
G4OpenGLQtViewer *fParentViewer;
QLabel *fEncoderStatus;
QLabel *fTempFolderStatus;
QLabel *fSaveFileStatus;
QLabel *fRecordingStatus;
QLabel *fRecordingInfos;
QPushButton *fButtonStopFinishClose;
QPushButton *fButtonSave;
QPushButton *fButtonStartPause;
public Q_SLOTS :
void stopFinishClose();
void save();
bool checkEncoderSwParameters();
bool checkSaveFileNameParameters();
bool checkTempFolderParameters();
private Q_SLOTS :
void selectEncoderPathAction();
void selectTempPathAction();
void selectSaveFileNameAction();
void resetRecording();
void enabledApplyButton();
};
#endif
@@ -0,0 +1,436 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// G4OpenGLQtViewer : Class to provide WindowsNT specific
// functionality for OpenGL in GEANT4
//
// 30/06/2014 : M.Kelsey : Change QPixmap objects to pointers
#ifndef G4OPENGLQTVIEWER_HH
#define G4OPENGLQTVIEWER_HH
#include "globals.hh"
#include "G4OpenGLViewer.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4AutoLock.hh"
#include <qobject.h>
#include <qpoint.h>
#include <qpixmap.h>
class G4OpenGLSceneHandler;
class G4UImanager;
class G4Text;
class G4UIcommand;
#include <QtGlobal>
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
#include <QGLWidget>
using G4QGLWidgetType = QGLWidget;
#else
#include <QOpenGLWidget>
using G4QGLWidgetType = QOpenGLWidget;
#endif
class QDialog;
class QTextEdit;
class QContextMenuEvent;
class QMenu;
class QImage;
class QAction;
class QTabWidget;
class QMouseEvent;
class QKeyEvent;
class QWheelEvent;
class QProcess;
class QTime;
class QElapsedTimer;
class QVBoxLayout;
class QPushButton;
class QSlider;
class QTreeWidgetItem;
class QTreeWidget;
class QColor;
class G4OpenGLSceneHandler;
class G4OpenGLQtMovieDialog;
class QLineEdit;
class G4UIQt;
class QTableWidget;
class QTableWidgetItem;
class QScrollArea;
class QSplitter;
class G4OpenGLQtViewer: public QObject, virtual public G4OpenGLViewer {
Q_OBJECT
typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
typedef std::vector<PVNodeID> PVPath;
public:
G4OpenGLQtViewer (G4OpenGLSceneHandler& scene);
virtual ~G4OpenGLQtViewer ();
#ifdef G4MULTITHREADED
// In MT mode these functions are called in the following order for each run:
// Called on the master thread before starting the vis sub-thread.
virtual void DoneWithMasterThread ();
// Called on the master thread after starting the vis sub-thread.
virtual void MovingToVisSubThread ();
// Called on the vis sub-thread when waiting for events.
virtual void SwitchToVisSubThread ();
// Called on the vis sub-thread when all events have been processed.
virtual void DoneWithVisSubThread ();
// Called on the vis sub-thread when all events have been processed.
// virtual void MovingToMasterThread (); Not used in G4OpenGLQtViewer.
// Called on the master thread after the vis sub-thread has terminated.
virtual void SwitchToMasterThread ();
#endif
private:
G4OpenGLQtViewer (const G4OpenGLQtViewer&);
G4OpenGLQtViewer& operator= (const G4OpenGLQtViewer&);
public:
virtual void updateQWidget()=0;
void updateSceneTreeWidget();
void updateViewerPropertiesTableWidget();
void updatePickInfosWidget(int, int);
QString setEncoderPath(QString path);
QString getEncoderPath();
QString setTempFolderPath(QString path);
QString getTempFolderPath();
QString setSaveFileName(QString path);
QString getSaveFileName();
bool isRecording();
bool isStopped();
bool isPaused();
bool isEncoding();
bool isWaiting();
bool isFailed();
void setWaiting();
bool isBadEncoder();
bool isBadOutput();
bool isBadTmp();
bool isSuccess();
void setBadTmp();
void setBadOutput();
void setBadEncoder();
bool isReadyToEncode();
void resetRecording();
void encodeVideo();
void stopVideo();
void saveVideo();
bool generateMpegEncoderParameters();
void displayRecordingStatus();
void DrawText(const G4Text&);
void ResetView ();
void addPVSceneTreeElement(const G4String& model,
G4PhysicalVolumeModel* pPVModel,
int currentPVPOIndex);
void addNonPVSceneTreeElement(const G4String& model,
int currentPVPOIndex,
const std::string& modelDescription,
const G4Visible& visible);
bool isTouchableVisible(int POindex);
void clearTreeWidget();
bool exportImage(std::string name="", int width=-1, int height=-1);
public:
void G4MousePressEvent(QMouseEvent *event);
void G4wheelEvent (QWheelEvent * event);
void G4keyPressEvent (QKeyEvent * event);
void G4keyReleaseEvent (QKeyEvent * event);
void G4MouseDoubleClickEvent();
void G4MouseReleaseEvent(QMouseEvent *evnt);
void G4MouseMoveEvent(QMouseEvent *event);
protected:
void CreateGLQtContext ();
virtual void CreateMainWindow (G4QGLWidgetType*,const QString&);
void G4manageContextMenuEvent(QContextMenuEvent *e);
void rotateQtScene(float, float);
void rotateQtSceneToggle(float, float);
void moveScene(float, float, float,bool);
void FinishView();
void updateKeyModifierState(const Qt::KeyboardModifiers&);
void displaySceneTreeComponent();
G4Colour getColorForPoIndex(int poIndex);
// So that privately accumulated vis attributes modifiers may be
// concatenated with the standard vis attributes modifiers for commands
// such as /vis/viewer/set/all and /vis/viewer/save...
const std::vector<G4ModelingParameters::VisAttributesModifier>*
GetPrivateVisAttributesModifiers() const;
bool isCurrentWidget();
protected:
G4UIQt* fUiQt;
QWidget* fGLWidget;
void savePPMToTemp();
int fRecordFrameNumber;
bool fHasToRepaint;
bool fUpdateGLLock;
bool fQGLWidgetInitialiseCompleted;
bool fPaintEventLock;
// Flag to indicate that action was initiated by interaction (mouse
// click) on the scene tree. It is used and reset in
// G4OpenGLStoredQtViewer::CompareForKernelVisit to prevent rebuild
// in this case.
bool fMouseOnSceneTree;
private:
enum RECORDING_STEP {WAIT,START,PAUSE,CONTINUE,STOP,READY_TO_ENCODE,ENCODING,FAILED,SUCCESS,BAD_ENCODER,BAD_OUTPUT,BAD_TMP,SAVE};
void createPopupMenu();
void createRadioAction(QAction *,QAction *, const std::string&,unsigned int a=1);
void rescaleImage(int, int);
bool printPDF(const std::string,int,QImage);
void showMovieParametersDialog();
void initMovieParameters();
QString createTempFolder();
QString removeTempFolder();
void setRecordingStatus(RECORDING_STEP);
void setRecordingInfos(const QString&);
QString getProcessErrorMsg();
QWidget* getParentWidget();
bool parseAndInsertInSceneTree(QTreeWidgetItem *,
G4PhysicalVolumeModel* pPVModel,
unsigned int fullPathIndex,
const QString& parentRoot,
unsigned int currentIndex,
int currentPVPOIndex);
void setCheckComponent(QTreeWidgetItem* item,bool check);
void createSceneTreeComponent();
void createSceneTreeWidget();
void createViewerPropertiesWidget();
void createPickInfosWidget();
bool parseAndCheckVisibility(QTreeWidgetItem * treeNode,int POindex);
QTreeWidgetItem* createTreeWidgetItem(const PVPath& fullPath,
const QString& name,
int copyNb,
int POIndex,
const QString& logicalName,
Qt::CheckState state,
QTreeWidgetItem * treeNode,
const G4Colour& color);
QString getModelShortName(const G4String& modelShortName);
void cloneSceneTree(QTreeWidgetItem* rootItem);
void changeDepthOnSceneTreeItem(double lookForDepth,double currentDepth,QTreeWidgetItem* item);
void updatePositivePoIndexSceneTreeWidgetQuickMap(int POindex,QTreeWidgetItem* item);
void changeQColorForTreeWidgetItem(QTreeWidgetItem* item, const QColor&);
bool isSameSceneTreeElement(QTreeWidgetItem* parentOldItem,QTreeWidgetItem* parentNewItem);
void changeOpenCloseVisibleHiddenSelectedColorSceneTreeElement(QTreeWidgetItem* subItem);
bool isPVVolume(QTreeWidgetItem* item);
QTreeWidgetItem* cloneWidgetItem(QTreeWidgetItem* item);
void clearSceneTreeSelection(QTreeWidgetItem*);
void clearTreeWidgetElements(QTreeWidgetItem* item);
// Get the tree wigdet item for POindex if exists
QTreeWidgetItem* getTreeWidgetItem(int POindex);
// Get the old tree wigdet item for POindex if exists
QTreeWidgetItem* getOldTreeWidgetItem(int POindex);
// parse the scene tree and return a string of status that can be saved
std::string parseSceneTreeAndSaveState();
std::string parseSceneTreeElementAndSaveState(QTreeWidgetItem* item, unsigned int level);
QString GetCommandParameterList (const G4UIcommand *aCommand);
void changeColorAndTransparency(GLuint index, G4Color color);
#ifdef G4MULTITHREADED
inline void SetQGLContextVisSubThread(QThread *th) {
fQGLContextVisSubThread = th;
}
inline void SetQGLContextMainThread(QThread *th) {
fQGLContextMainThread = th;
}
#endif
QMenu *fContextMenu;
QPoint fLastPos1;
QPoint fLastPos2;
QPoint fLastPos3;
QPoint fLastPickPoint;
// delta of depth move. This delta is put in % of the scene view
G4double fDeltaDepth;
// delta of zoom move. This delta is put in % of the scene view
G4double fDeltaZoom;
// To ensure key event are keep one by one
bool fHoldKeyEvent;
// To ensure move event are keep one by one
bool fHoldMoveEvent;
// To ensure rotate event are keep one by one
bool fHoldRotateEvent;
bool fAutoMove;
QString fEncoderPath;
QString fTempFolderPath;
QString fMovieTempFolderPath;
QString fSaveFileName;
QString fParameterFileName;
QAction *fMouseRotateAction;
QAction *fMouseMoveAction;
QAction *fMousePickAction;
QAction *fMouseZoomInAction;
QAction *fMouseZoomOutAction;
QAction *fFullScreenOn;
QAction *fFullScreenOff;
QAction *fDrawingWireframe;
QAction *fDrawingLineRemoval;
QAction *fDrawingSurfaceRemoval;
QAction *fDrawingLineSurfaceRemoval;
QAction *fProjectionOrtho;
QAction *fProjectionPerspective;
G4OpenGLQtMovieDialog* fMovieParametersDialog;
RECORDING_STEP fRecordingStep;
QProcess *fProcess;
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QTime *fLastEventTime;
#else
QElapsedTimer *fLastEventTime;
#endif
int fSpinningDelay;
int fNbMaxFramesPerSec;
float fNbMaxAnglePerSec;
int fLaunchSpinDelay;
QWidget* fUISceneTreeWidget;
QWidget* fUIViewerPropertiesWidget;
QWidget* fUIPickInfosWidget;
bool fNoKeyPress;
bool fAltKeyPress;
bool fControlKeyPress;
bool fShiftKeyPress;
bool fBatchMode;
bool fCheckSceneTreeComponentSignalLock;
bool fViewerPropertiesTableWidgetIsInit;
QTreeWidget* fSceneTreeComponentTreeWidget;
// This is only use to hold the old "expand" value, see file:///Developer/Documentation/Qt/html/qtreewidgetitem.html#setExpanded
QWidget* fSceneTreeWidget;
bool fPVRootNodeCreate;
QLineEdit* fFilterOutput;
QString fFileSavePath;
int fNbRotation ;
int fTimeRotation;
QString fTouchableVolumes;
QDialog* fShortcutsDialog;
QTableWidget *fViewerPropertiesTableWidget;
QWidget* fPickInfosWidget;
QScrollArea* fPickInfosScrollArea;
int fTreeWidgetInfosIgnoredCommands;
QPushButton * fSceneTreeButtonApply;
QTextEdit *fShortcutsDialogInfos;
QSlider* fSceneTreeDepthSlider;
std::map <int, PVPath > fTreeItemModels;
std::map <int, PVPath > fOldTreeItemModels;
// quick scene tree map
std::map <int, QTreeWidgetItem*> fPositivePoIndexSceneTreeWidgetQuickMap;
// old scene tree map
std::map <int, QTreeWidgetItem*> fOldPositivePoIndexSceneTreeWidgetQuickMap;
std::vector <QTreeWidgetItem*> fOldNullPoIndexSceneTreeWidgetQuickVector;
// old vis attr color map
std::map <int, QColor> fOldVisAttrColorMap;
unsigned int fSceneTreeDepth;
QTreeWidgetItem* fModelShortNameItem;
int fNumber;
int fMaxPOindexInserted;
// quick map index to find next item
std::map <int, QTreeWidgetItem*>::const_iterator fLastSceneTreeWidgetAskForIterator;
std::map <int, QTreeWidgetItem*>::const_iterator fLastSceneTreeWidgetAskForIteratorEnd;
// quick map index to find next item
std::map <int, QTreeWidgetItem*>::const_iterator fOldLastSceneTreeWidgetAskForIterator;
std::map <int, QTreeWidgetItem*>::const_iterator fOldLastSceneTreeWidgetAskForIteratorEnd;
// icons
QPixmap* fTreeIconOpen;
QPixmap* fTreeIconClosed;
QPixmap* fSearchIcon;
int fLastExportSliderValue;
G4Color fLastHighlightColor;
GLuint fLastHighlightName;
bool fIsDeleting;
#ifdef G4MULTITHREADED
QThread* fQGLContextVisSubThread;
QThread* fQGLContextMainThread;
G4Mutex fmWaitForVisSubThreadQtOpenGLContextMoved;
G4Mutex fmWaitForVisSubThreadQtOpenGLContextInitialized;
G4Condition fc1_VisSubThreadQtOpenGLContextInitialized;
G4Condition fc2_VisSubThreadQtOpenGLContextMoved;
G4AutoLock* flWaitForVisSubThreadQtOpenGLContextInitialized;
G4AutoLock* flWaitForVisSubThreadQtOpenGLContextMoved;
#endif
public Q_SLOTS :
void startPauseVideo();
protected Q_SLOTS :
void updateToolbarAndMouseContextMenu();
private Q_SLOTS :
void actionSaveImage();
void actionChangeBackgroundColor();
void actionChangeTextColor();
void actionChangeDefaultColor();
void actionMovieParameters();
void showShortcuts();
void toggleMouseAction(int);
void toggleSurfaceAction(int);
void toggleProjection(bool);
void toggleTransparency(bool);
void toggleAntialiasing(bool);
void toggleHaloing(bool);
void toggleAux(bool);
void toggleHiddenMarkers(bool);
void toggleFullScreen(bool);
void processEncodeFinished();
void processLookForFinished();
void processEncodeStdout();
void sceneTreeComponentItemChanged(QTreeWidgetItem* item, int id);
void toggleSceneTreeComponentPickingCout(int);
void togglePicking();
void currentTabActivated(int);
// action trigger by a click on a component scene tree
void sceneTreeComponentSelected();
void changeDepthInSceneTree(int);
void changeSearchSelection();
void changeColorAndTransparency(QTreeWidgetItem* item,int val);
void tableWidgetViewerSetItemChanged(QTableWidgetItem *);
};
#endif
@@ -0,0 +1,144 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 27th March 1996
// OpenGL scene handler - base for immediate mode and stored mode classes to
// inherit from.
#ifndef G4OPENGLSCENEHANDLER_HH
#define G4OPENGLSCENEHANDLER_HH
#include "globals.hh"
#include "G4VSceneHandler.hh"
#include "G4OpenGL.hh"
#include <map>
class G4AttHolder;
// Base class for various OpenGLSceneHandler classes.
class G4OpenGLSceneHandler: public G4VSceneHandler {
friend class G4OpenGLViewer;
public:
virtual void BeginPrimitives (const G4Transform3D& objectTransformation);
virtual void EndPrimitives ();
virtual void BeginPrimitives2D (const G4Transform3D& objectTransformation);
virtual void EndPrimitives2D ();
using G4VSceneHandler::AddPrimitive;
void AddPrimitive (const G4Polyline&);
void AddPrimitive (const G4Polymarker&);
void AddPrimitive (const G4Text&);
void AddPrimitive (const G4Circle&);
void AddPrimitive (const G4Square&);
void AddPrimitivesCircle (const std::vector <G4VMarker>&);
void AddPrimitivesSquare (const std::vector <G4VMarker>&);
void AddPrimitive (const G4Polyhedron&);
void PreAddSolid (const G4Transform3D& objectTransformation,
const G4VisAttributes&);
void AddSolid (const G4Box&);
void AddSolid (const G4Cons&);
void AddSolid (const G4Tubs&);
void AddSolid (const G4Trd&);
void AddSolid (const G4Trap&);
void AddSolid (const G4Sphere&);
void AddSolid (const G4Para&);
void AddSolid (const G4Torus&);
void AddSolid (const G4Polycone&);
void AddSolid (const G4Polyhedra&);
void AddSolid (const G4Orb&);
void AddSolid (const G4Ellipsoid&);
void AddSolid (const G4TessellatedSolid&);
void AddSolid (const G4VSolid&);
void AddCompound (const G4VTrajectory&);
void AddCompound (const G4VHit&);
void AddCompound (const G4VDigi&);
void AddCompound (const G4THitsMap<G4double>&);
void AddCompound (const G4THitsMap<G4StatDouble>&);
void AddCompound (const G4Mesh&);
// enum for /vis/ogl/flushAt.
enum FlushAction {
endOfEvent,
endOfRun,
eachPrimitive,
NthPrimitive,
NthEvent,
never
};
static G4int GetEntitiesFlushInterval()
{return fEntitiesFlushInterval;}
static FlushAction GetFlushAction()
{return fFlushAction;}
static void SetEntitiesFlushInterval(G4int interval)
{fEntitiesFlushInterval = interval;}
static void SetFlushAction(FlushAction action)
{fFlushAction = action;}
protected:
G4OpenGLSceneHandler (G4VGraphicsSystem& system,
G4int id,
const G4String& name = "");
virtual ~G4OpenGLSceneHandler ();
void ProcessScene();
G4DisplacedSolid* CreateSectionSolid ();
G4DisplacedSolid* CreateCutawaySolid ();
void ClearAndDestroyAtts(); // Destroys att holders and clears pick map.
GLuint fPickName;
std::map<GLuint, G4AttHolder*> fPickMap; // For picking.
// Shared code to wait until we make a single glFlush
void ScaledFlush () ;
// Static so that they apply to all OGL scene handlers...
static FlushAction fFlushAction;
// Number of entities between flushes
static G4int fEntitiesFlushInterval;
// True if caller of primitives is capable of processing three passes.
G4bool fThreePassCapable;
G4bool fSecondPassForTransparencyRequested;
G4bool fSecondPassForTransparency;
G4bool fThirdPassForNonHiddenMarkersRequested;
G4bool fThirdPassForNonHiddenMarkers;
static const GLubyte fStippleMaskHashed [128];
bool fEdgeFlag;
};
#include "G4OpenGLSceneHandler.icc"
#endif // G4OPENGLSCENEHANDLER_HH
@@ -0,0 +1,85 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 20th January 1998
inline void G4OpenGLSceneHandler::AddSolid (const G4Box& box) {
G4VSceneHandler::AddSolid (box);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Cons& cons) {
G4VSceneHandler::AddSolid (cons);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Tubs& tubs) {
G4VSceneHandler::AddSolid (tubs);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Trd& trd) {
G4VSceneHandler::AddSolid (trd);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Trap& trap) {
G4VSceneHandler::AddSolid (trap);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Sphere& sphere) {
G4VSceneHandler::AddSolid (sphere);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Para& para) {
G4VSceneHandler::AddSolid (para);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Torus& torus) {
G4VSceneHandler::AddSolid (torus);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Polycone& polycone) {
G4VSceneHandler::AddSolid (polycone);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Polyhedra& polyhedra) {
G4VSceneHandler::AddSolid (polyhedra);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Orb& orb) {
G4VSceneHandler::AddSolid (orb);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4Ellipsoid& ellipsoid) {
G4VSceneHandler::AddSolid (ellipsoid);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4TessellatedSolid& tess) {
G4VSceneHandler::AddSolid (tess);
}
inline void G4OpenGLSceneHandler::AddSolid (const G4VSolid& vsolid) {
G4VSceneHandler::AddSolid (vsolid);
}
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Laurent Garnier 27th October 2011
#ifndef G4OPENGLSTOREDQTSCENEHANDLER_HH
#define G4OPENGLSTOREDQTSCENEHANDLER_HH
#include "G4OpenGLStoredSceneHandler.hh"
class G4OpenGLStoredQtSceneHandler: public G4OpenGLStoredSceneHandler {
public:
G4OpenGLStoredQtSceneHandler (G4VGraphicsSystem& system, const G4String& name = "");
virtual ~G4OpenGLStoredQtSceneHandler ();
// Two virtual functions for extra processing in a sub-class, for
// example, to make a display tree. They are to return true if the
// visible object uses gl commands for drawing. This is
// predominantly true; a notable exception is Qt text. In that
// case, a display list does not need to be created; all relevant
// information is assumed to be stored in the PO/TOList.
G4bool ExtraPOProcessing(const G4Visible&, size_t currentPOListIndex);
G4bool ExtraTOProcessing(const G4Visible&, size_t currentTOListIndex);
void ClearStore ();
void ClearTransientStore ();
void SetScene(G4Scene*);
};
#endif
@@ -0,0 +1,97 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Class G4OpenGLStoredQtViewer : a class derived from
// G4OpenGLQtViewer and G4OpenGLStoredViewer.
#ifndef G4OPENGLSTOREDQTVIEWER_HH
#define G4OPENGLSTOREDQTVIEWER_HH
#include "G4OpenGLStoredViewer.hh"
#include "G4OpenGLQtViewer.hh"
class QMouseEvent;
class QWheelEvent;
class QContextMenuEvent;
class G4OpenGLStoredSceneHandler;
class G4OpenGLStoredQtViewer:
public G4OpenGLQtViewer, public G4OpenGLStoredViewer, public G4QGLWidgetType {
public:
G4OpenGLStoredQtViewer (G4OpenGLStoredSceneHandler& scene,
const G4String& name = "");
~G4OpenGLStoredQtViewer ();
void Initialise ();
void initializeGL ();
void DrawView ();
void resizeGL(int width,int height);
void paintGL();
void updateQWidget();
void ShowView ();
void DisplayTimePOColourModification (G4Colour&,size_t);
#if QT_VERSION < 0x060000
#else
//G.Barrand: macOS: to avoid a crash at startup at first gl call.
virtual void ClearView() {
if(!G4QGLWidgetType::isValid()) return;
G4OpenGLViewer::ClearView();
}
virtual void SetView() {
if(!G4QGLWidgetType::isValid()) return;
G4OpenGLViewer::SetView();
}
#endif
protected:
// Special version for Qt - avoid comparing VisAttributesModifiers.
G4bool CompareForKernelVisit(G4ViewParameters&);
// Two virtual functions to return sub-class selection.
G4bool POSelected(size_t POListIndex);
G4bool TOSelected(size_t TOListIndex);
void showEvent(QShowEvent * event );
void wheelEvent(QWheelEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void contextMenuEvent(QContextMenuEvent *e);
void keyPressEvent (QKeyEvent * event);
void keyReleaseEvent (QKeyEvent * event);
#if QT_VERSION < 0x060000
void paintEvent(QPaintEvent *event);
#endif
private:
void ComputeView ();
};
#endif
@@ -0,0 +1,155 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 10th February 1997
// G4OpenGLStoredSceneHandler - creates OpenGL Display lists.
#ifndef G4OPENGLSTOREDSCENEHANDLER_HH
#define G4OPENGLSTOREDSCENEHANDLER_HH
#include "globals.hh"
#include "G4OpenGLSceneHandler.hh"
#include "G4Text.hh"
#include <map>
#include <vector>
class G4OpenGLStored;
class G4OpenGLStoredSceneHandler: public G4OpenGLSceneHandler {
friend class G4OpenGLStoredViewer; // ..allows access to P/TODLs.
public:
G4OpenGLStoredSceneHandler (G4VGraphicsSystem& system, const G4String& name = "");
virtual ~G4OpenGLStoredSceneHandler ();
void BeginPrimitives (const G4Transform3D& objectTransformation);
void EndPrimitives ();
void BeginPrimitives2D (const G4Transform3D& objectTransformation);
void EndPrimitives2D ();
void BeginModeling ();
void EndModeling ();
using G4VSceneHandler::AddPrimitive;
void AddPrimitive (const G4Polyline&);
void AddPrimitive (const G4Polymarker&);
void AddPrimitive (const G4Circle&);
void AddPrimitive (const G4Square&);
void AddPrimitive (const G4Text&);
void AddPrimitive (const G4Polyhedron&);
void ClearStore ();
void ClearTransientStore ();
protected:
G4bool AddPrimitivePreamble(const G4VMarker& visible);
G4bool AddPrimitivePreamble(const G4Polyline& visible);
G4bool AddPrimitivePreamble(const G4Polyhedron& visible);
// Return false if no further processing required.
void AddPrimitivePostamble();
// Two virtual functions for extra processing in a sub-class, for
// example, to make a display tree. They are to return true if the
// visible object uses gl commands for drawing. This is
// predominantly true; a notable exception is Qt text. In that
// case, a display list does not need to be created; all relevant
// information is assumed to be stored in the PO/TOList.
virtual G4bool ExtraPOProcessing
(const G4Visible&, size_t /*currentPOListIndex*/) {return true;}
virtual G4bool ExtraTOProcessing
(const G4Visible&, size_t /*currentTOListIndex*/) {return true;}
static G4int fSceneIdCount; // static counter for OpenGLStored scenes.
// Display list management. Static since there's only one OGL store.
// Used to link a TODL or PODL to a display list.
static G4int fDisplayListId;
// Under some circumstances we need to prevent use of a display list.
// For example, a transient display of the current time window during
// a sequence of evolving time windows. This is set in
// G4OpenGLStoredViewer::AddPrimitiveForASingleFrame and acted upon in
// AddPrimitivePreambleInternal.
G4bool fDoNotUseDisplayList; // Avoid display list use if true
// PODL = Persistent Object Display List.
// This "top PODL" was made redundant when the PO list was
// "unwrapped" 27th October 2011, but keep it for now in case we
// need to wrap it again.
GLint fTopPODL; // List which calls the other PODLs.
// G4Text plus transform and 2/3D.
struct G4TextPlus {
G4TextPlus(const G4Text& text): fG4Text(text), fProcessing2D(false) {}
G4Text fG4Text;
G4bool fProcessing2D;
};
// PO = Persistent Object, i.e., run-durantion object, e.g., geometry.
struct PO {
PO();
PO(const PO&);
PO(G4int id, const G4Transform3D& tr = G4Transform3D());
~PO();
PO& operator= (const PO&);
G4int fDisplayListId;
G4Transform3D fTransform;
GLuint fPickName;
G4Colour fColour;
G4TextPlus* fpG4TextPlus;
G4bool fMarkerOrPolyline;
};
std::vector<PO> fPOList;
// TO = Transient Object, e.g., trajectories.
struct TO {
TO();
TO(const TO&);
TO(G4int id, const G4Transform3D& tr = G4Transform3D());
~TO();
TO& operator= (const TO&);
G4int fDisplayListId;
G4Transform3D fTransform;
GLuint fPickName;
G4double fStartTime, fEndTime; // Time range (e.g., for trajectory steps).
G4Colour fColour;
G4TextPlus* fpG4TextPlus;
G4bool fMarkerOrPolyline;
};
std::vector<TO> fTOList;
// Stop-gap solution of structure re-use.
// A proper implementation would use geometry hierarchy.
std::map <const G4VSolid*, G4int, std::less <const G4VSolid*> > fSolidMap;
private:
bool AddPrimitivePreambleInternal(const G4Visible& visible, bool isMarker, bool isPolyline);
};
#endif
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 7th February 1997
// Class G4OpenGLStoredViewer : Encapsulates the `storedness' of
// an OpenGL viewer, for inheritance by
// derived (X, Xm...) classes.
#ifndef G4OPENGLSTOREDVIEWER_HH
#define G4OPENGLSTOREDVIEWER_HH
#include "G4OpenGLViewer.hh"
class G4OpenGLStoredSceneHandler;
class G4Colour;
class G4Text;
class G4Circle;
class G4OpenGLStoredViewer: virtual public G4OpenGLViewer {
public:
G4OpenGLStoredViewer (G4OpenGLStoredSceneHandler& scene);
virtual ~G4OpenGLStoredViewer ();
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.
virtual G4bool POSelected(size_t) {return true;}
virtual G4bool TOSelected(size_t) {return true;}
G4bool fDepthTestEnable;
G4Colour fOldDisplayListColor;
};
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Class G4OpenGLStoredWin32Viewer : a class derived from
// G4OpenGLWin32Viewer and G4OpenGLStoredViewer.
#ifndef G4OPENGLSTOREDWIN32VIEWER_HH
#define G4OPENGLSTOREDWIN32VIEWER_HH
#include "G4VViewer.hh"
#include "G4OpenGLStoredViewer.hh"
#include "G4OpenGLWin32Viewer.hh"
class G4OpenGLStoredSceneHandler;
class G4OpenGLStoredWin32Viewer:
public G4OpenGLWin32Viewer, public G4OpenGLStoredViewer{
public:
G4OpenGLStoredWin32Viewer (G4OpenGLStoredSceneHandler& scene,
const G4String& name = "");
void Initialise ();
void DrawView ();
void FinishView ();
};
#endif
@@ -0,0 +1,52 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 7th February 1997
// Class G4OpenGLStoredXViewer : a class derived from G4OpenGLXViewer and
// G4OpenGLStoredViewer.
#ifndef G4OPENGLSTOREDXVIEWER_HH
#define G4OPENGLSTOREDXVIEWER_HH
#include "G4OpenGLStoredViewer.hh"
#include "G4OpenGLXViewer.hh"
class G4OpenGLStoredSceneHandler;
class G4OpenGLStoredXViewer:
public G4OpenGLXViewer, public G4OpenGLStoredViewer{
public:
G4OpenGLStoredXViewer (G4OpenGLStoredSceneHandler& scene, const G4String& name = "");
virtual ~G4OpenGLStoredXViewer ();
void Initialise ();
void DrawView ();
void FinishView ();
};
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 10th February 1997
// Class G4OpenGLStoredXmViewer : a class derived from G4OpenGLXmViewer
// and G4OpenGLStoredViewer.
#ifndef G4OpenGLSTOREDXMVIEWER_HH
#define G4OpenGLSTOREDXMVIEWER_HH
#include "G4OpenGLStoredViewer.hh"
#include "G4OpenGLXmViewer.hh"
class G4OpenGLStoredSceneHandler;
class G4OpenGLStoredXmViewer:
public G4OpenGLXmViewer, public G4OpenGLStoredViewer{
public:
G4OpenGLStoredXmViewer (G4OpenGLStoredSceneHandler& scene, const G4String& name = "");
virtual ~G4OpenGLStoredXmViewer ();
void Initialise ();
void DrawView ();
void FinishView ();
};
#endif
@@ -0,0 +1,47 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 24th October 1996
// G4OpenGLTransform3D provides OpenGL style transformation matrix
// from G4Transform3D.
#ifndef G4OPENGLTRANSFORM3D_HH
#define G4OPENGLTRANSFORM3D_HH
#include "G4Transform3D.hh"
#include "G4OpenGL.hh"
class G4OpenGLTransform3D {
public:
G4OpenGLTransform3D (const G4Transform3D &t);
const GLdouble* GetGLMatrix () {return m;}
private:
GLdouble m[16];
};
#endif
@@ -0,0 +1,235 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 27th March 1996
// OpenGL viewer - opens window, hard copy, etc.
#ifndef G4OPENGLVIEWER_HH
#define G4OPENGLVIEWER_HH
#include "G4VViewer.hh"
#include "G4OpenGL.hh"
class G4OpenGLSceneHandler;
class G4gl2ps;
class G4Text;
class G4OpenGLViewerPickMap {
public :
inline void setName(G4String n) {
fName = n;
}
inline void setHitNumber(G4int n) {
fHitNumber = n;
}
inline void setSubHitNumber(G4int n) {
fSubHitNumber = n;
}
inline void setPickName(G4int n) {
fPickName= n;
}
inline void addAttributes(G4String att) {
fAttributes.push_back(att);
}
inline G4String getName() {
return fName;
}
inline G4int getHitNumber() {
return fHitNumber;
}
inline G4int getSubHitNumber() {
return fSubHitNumber;
}
inline G4int getPickName() {
return fPickName;
}
inline std::vector <G4String > getAttributes() {
return fAttributes;
}
G4String print();
private :
G4String fName;
G4int fHitNumber;
G4int fSubHitNumber;
G4int fPickName;
std::vector <G4String > fAttributes;
};
// Base class for various OpenGLView classes.
class G4OpenGLViewer: virtual public G4VViewer {
friend class G4OpenGLSceneHandler;
friend class G4OpenGLImmediateSceneHandler;
friend class G4OpenGLStoredSceneHandler;
friend class G4OpenGLFileSceneHandler;
friend class G4OpenGLViewerMessenger;
public:
virtual void ClearView ();
void ClearViewWithoutFlush ();
virtual bool exportImage(std::string name="", int width=-1, int height=-1);
bool setExportImageFormat(std::string format,bool quiet = false);
protected:
G4OpenGLViewer (G4OpenGLSceneHandler& scene);
virtual ~G4OpenGLViewer ();
private:
G4OpenGLViewer(const G4OpenGLViewer&);
G4OpenGLViewer& operator= (const G4OpenGLViewer&);
protected:
virtual void SetView ();
virtual void ResetView ();
virtual void DrawText(const G4Text&);
void ChangePointSize(G4double size);
void ChangeLineWidth(G4double width);
void HaloingFirstPass ();
void HaloingSecondPass ();
void HLRFirstPass ();
void HLRSecondPass ();
void HLRThirdPass ();
void InitializeGLView ();
void ResizeGLView();
void ResizeWindow(unsigned int, unsigned int);
virtual G4String Pick(GLdouble x, GLdouble y);
const std::vector < G4OpenGLViewerPickMap* > & GetPickDetails(GLdouble x, GLdouble y);
virtual void CreateFontLists () {}
void rotateScene (G4double dx, G4double dy);
void rotateSceneToggle (G4double dx, G4double dy);
//////////////////////////////Vectored PostScript production functions///
// print EPS file. Depending of fVectoredPs, it will print Vectored or not
void setExportSize(G4int,G4int);
// set the new print size.
// -1 means 'print size' = 'window size'
// Setting size greater than max OpenGL viewport size will set the size to
// maximum
bool setExportFilename(G4String name,G4bool inc = true);
// set export filename.
// if inc, then the filename will be increment by one each time
// try to guesss the correct format according to the extention
std::string getRealPrintFilename();
unsigned int getWinWidth() const;
unsigned int getWinHeight() const;
G4bool sizeHasChanged();
// return true if size has change since last redraw
GLdouble getSceneNearWidth();
GLdouble getSceneFarWidth();
GLdouble getSceneDepth();
void addExportImageFormat(std::string format);
// add a image format to the available export format list
G4bool isGl2psWriting();
G4bool isFramebufferReady();
void g4GluPickMatrix(GLdouble x, GLdouble y, GLdouble width, GLdouble height,
GLint viewport[4]);
// MESA implementation of gluPickMatrix
void g4GluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
GLdouble centerx, GLdouble centery, GLdouble
centerz,
GLdouble upx, GLdouble upy, GLdouble upz );
// MESA implementation of gluLookAt
void g4GlOrtho (GLdouble left, GLdouble right,
GLdouble bottom, GLdouble top,
GLdouble near, GLdouble far);
// Redefinition on glOrtho to solve precision issues
void g4GlFrustum (GLdouble left, GLdouble right,
GLdouble bottom, GLdouble top,
GLdouble near, GLdouble far);
// Redefinition on glFrustum to solve precision issues
bool IsGettingPickInfos() const {return fIsGettingPickInfos;}
G4bool fPrintColour;
G4bool fVectoredPs;
G4OpenGLSceneHandler& fOpenGLSceneHandler;
G4Colour background; //the OpenGL clear colour
G4bool
transparency_enabled, //is alpha blending enabled?
antialiasing_enabled, //is antialiasing enabled?
haloing_enabled; //is haloing enabled for wireframe?
G4gl2ps* fGL2PSAction;
G4double fRot_sens; // Rotation sensibility in degrees
G4double fPan_sens; // Translation sensibility
unsigned int fWinSize_x;
unsigned int fWinSize_y;
std::vector < std::string > fExportImageFormatVector;
std::string fDefaultExportImageFormat;
std::string fExportImageFormat;
int fExportFilenameIndex;
G4int fPrintSizeX;
G4int fPrintSizeY;
private :
G4float fPointSize;
G4String fExportFilename;
G4String fDefaultExportFilename;
G4bool fSizeHasChanged;
int fGl2psDefaultLineWith;
int fGl2psDefaultPointSize;
bool fGlViewInitialized;
// size of the OpenGL frame
void rotateSceneThetaPhi(G4double dx, G4double dy);
void rotateSceneInViewDirection (G4double dx, G4double dy);
bool printGl2PS();
G4int getRealExportWidth();
G4int getRealExportHeight();
GLubyte* grabPixels (int inColor,
unsigned int width,
unsigned int height);
bool printNonVectoredEPS ();
// print non vectored EPS files
bool printVectoredEPS();
// print vectored EPS files
bool fIsGettingPickInfos;
// Block SetView() during picking
};
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
#ifndef G4OPENGLVIEWERMESSENGER_HH
#define G4OPENGLVIEWERMESSENGER_HH
#include "G4UImessenger.hh"
#include "G4String.hh"
class G4UIdirectory;
class G4UIcommand;
class G4UIcmdWithoutParameter;
class G4UIcmdWithADouble;
class G4UIcmdWithABool;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4OpenGLViewerMessenger: public G4UImessenger {
public:
static G4OpenGLViewerMessenger* GetInstance(); // Singleton constructor.
~G4OpenGLViewerMessenger();
void SetNewValue (G4UIcommand*, G4String);
private:
G4OpenGLViewerMessenger(); // Private constructor.
static G4OpenGLViewerMessenger* fpInstance;
G4UIdirectory* fpDirectory;
G4UIcommand* fpCommandExport;
G4UIcommand* fpCommandFlushAt;
G4UIdirectory* fpDirectorySet;
G4UIcmdWithoutParameter* fpCommandDisplayListLimit;
G4UIcommand* fpCommandExportFormat;
G4UIcommand* fpCommandPrintFilename;
G4UIcmdWithAString* fpCommandPrintMode;
G4UIcommand* fpCommandPrintSize;
G4UIcmdWithABool* fpCommandTransparency;
};
#endif
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// G4OpenGLWin32Viewer : Class to provide WindowsNT specific
// functionality for OpenGL in GEANT4
#ifndef G4OPENGLWIN32VIEWER_HH
#define G4OPENGLWIN32VIEWER_HH
#include "globals.hh"
#include "G4OpenGLViewer.hh"
class G4OpenGLSceneHandler;
class G4OpenGLWin32Viewer: virtual public G4OpenGLViewer {
public:
G4OpenGLWin32Viewer (G4OpenGLSceneHandler& scene);
virtual ~G4OpenGLWin32Viewer ();
void SetView ();
void ShowView ();
protected:
void GetWin32Connection ();
void CreateGLWin32Context ();
virtual void CreateMainWindow ();
HDC fHDC;
G4bool fMouseHovered;
G4bool fMousePressed;
G4int fMousePressedX, fMousePressedY;
private:
static LRESULT CALLBACK WindowProc(HWND,UINT,WPARAM,LPARAM);
static G4bool SetWindowPixelFormat(HDC);
void TrackMouse(G4int, G4int);
void ReleaseMouse();
void SetShift(G4int, G4int);
void SetRotation(G4int, G4int);
void SetZoom(G4int);
HWND fWindow;
HGLRC fHGLRC;
G4bool fInCreateWindow;
};
#endif
@@ -0,0 +1,111 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 7th February 1997
// G4OpenGLXViewer : Class to provide XWindows specific
// functionality for OpenGL in GEANT4
#ifndef G4OPENGLXVIEWER_HH
#define G4OPENGLXVIEWER_HH
#include "G4OpenGLViewer.hh"
#include "globals.hh"
#include <X11/Intrinsic.h>
#include "G4OpenGL.hh"
#include <GL/glx.h>
class G4OpenGLSceneHandler;
class G4Text;
class G4OpenGLXViewer: virtual public G4OpenGLViewer {
friend class G4OpenGLXViewerMessenger;
friend class G4OpenGLXmViewer;
public:
G4OpenGLXViewer (G4OpenGLSceneHandler& scene);
virtual ~G4OpenGLXViewer ();
void SetView ();
void ShowView ();
#ifdef G4MULTITHREADED
void SwitchToVisSubThread();
void SwitchToMasterThread();
#endif
void DrawText(const G4Text&);
protected:
void GetXConnection ();
void CreateGLXContext (XVisualInfo* vi);
virtual void CreateMainWindow ();
virtual void CreateFontLists ();
static int snglBuf_RGBA[12];
static int dblBuf_RGBA[13];
//////////////////////////////Pixmap (screen dump) production functions/////
XWindowAttributes xwa;
Display *dpy;
static XVisualInfo *vi_single_buffer;
static XVisualInfo *vi_double_buffer;
XVisualInfo *vi_immediate,
*vi_stored,
*vi;
Colormap cmap;
XSetWindowAttributes swa;
GLXDrawable win;
GLXContext cxMaster;
#ifdef G4MULTITHREADED
GLXContext cxVisSubThread;
#endif
XEvent event;
G4int *attributeList,
errorBase,
eventBase,
major,
minor;
XSizeHints *norm_hints;
XWMHints *wm_hints;
XClassHint *class_hints;
Pixmap icon_pixmap;
XSizeHints *size_hints;
Atom Xatom;
XTextProperty windowName,
iconName;
char charViewName [100];
private:
G4OpenGLXViewer (const G4OpenGLXViewer&);
G4OpenGLXViewer& operator = (const G4OpenGLXViewer&);
GLXContext tmp_cx;
};
#endif
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Box container class
#ifndef G4OPENGLXMBOX_HH
#define G4OPENGLXMBOX_HH
#include "G4OpenGLXmVWidgetContainer.hh"
#include "globals.hh"
class G4OpenGLXmVWidgetComponent;
class G4OpenGLXmVWidgetShell;
class G4OpenGLXmBox : public G4OpenGLXmVWidgetContainer
{
public:
G4OpenGLXmBox (const char* = NULL,
G4bool = False); //constructor
virtual ~G4OpenGLXmBox (); //destructor
void AddChild (G4OpenGLXmVWidgetComponent*);
void AddYourselfTo (G4OpenGLXmVWidgetShell*);
Widget* GetPointerToParent ();
Widget* GetPointerToWidget ();
const char* GetName ();
void SetName (const char*);
protected:
const char* name;
Widget* parent;
Widget box_row_col;
G4bool radio;
private:
G4OpenGLXmBox (const G4OpenGLXmBox&);
G4OpenGLXmBox& operator = (const G4OpenGLXmBox&);
};
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Four arrow buttons class. Inherits from G4OpenGLXmVWidgetComponent
#ifndef G4OPENGLXMFOURARROWBUTTONS_HH
#define G4OPENGLXMFOURARROWBUTTONS_HH
#include "G4OpenGLXmVWidgetComponent.hh"
class G4OpenGLXmFourArrowButtons : public G4OpenGLXmVWidgetComponent
{
public:
G4OpenGLXmFourArrowButtons (XtCallbackRec** = NULL); // array of 4 callbacks
//constructor
virtual ~G4OpenGLXmFourArrowButtons (); //destructor
void SetName (char*);
char* GetName ();
void AddYourselfTo (G4OpenGLXmVWidgetContainer*);
Widget* GetPointerToParent ();
Widget* GetPointerToWidget ();
private:
XtCallbackRec** callback;
Widget arrow_form;
Widget arrow;
Widget* parent;
private:
G4OpenGLXmFourArrowButtons (const G4OpenGLXmFourArrowButtons&);
G4OpenGLXmFourArrowButtons& operator = (const G4OpenGLXmFourArrowButtons&);
};
#endif
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Framed box container class
//Inherits from G4OpenGLXmBox
#ifndef G4OPENGLXMFRAMEDBOX_HH
#define G4OPENGLXMFRAMEDBOX_HH
#include "G4OpenGLXmBox.hh"
#include "globals.hh"
class G4OpenGLXmVWidgetComponent;
class G4OpenGLXmVWidgetShell;
class G4OpenGLXmFramedBox : public G4OpenGLXmBox
{
public:
G4OpenGLXmFramedBox (const char* = NULL,
G4bool = False); //constructor
virtual ~G4OpenGLXmFramedBox (); //destructor
void AddChild (G4OpenGLXmVWidgetComponent*);
void AddYourselfTo (G4OpenGLXmVWidgetShell*);
private:
G4OpenGLXmFramedBox (const G4OpenGLXmFramedBox&);
G4OpenGLXmFramedBox& operator = (const G4OpenGLXmFramedBox&);
Widget frame;
};
#endif
@@ -0,0 +1,61 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Push button class. Inherits from G4OpenGLXmVWidgetComponent
#ifndef G4OPENGLXMPUSHBUTTON_HH
#define G4OPENGLXMPUSHBUTTON_HH
#include "G4OpenGLXmVWidgetComponent.hh"
class G4OpenGLXmPushButton : public G4OpenGLXmVWidgetComponent
{
public:
G4OpenGLXmPushButton (const char* = NULL,
XtCallbackRec* = NULL); //constructor
virtual ~G4OpenGLXmPushButton (); //destructor
void SetName (const char*);
const char* GetName ();
void AddYourselfTo (G4OpenGLXmVWidgetContainer*);
Widget* GetPointerToParent ();
Widget* GetPointerToWidget ();
private:
G4OpenGLXmPushButton (const G4OpenGLXmPushButton&);
G4OpenGLXmPushButton& operator = (const G4OpenGLXmPushButton&);
const char* name;
XtCallbackRec* callback;
Widget button;
Widget* parent;
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Radio button class. Inherits from G4OpenGLXmVWidgetComponent
#ifndef G4OPENGLXMRADIOBUTTON_HH
#define G4OPENGLXMRADIOBUTTON_HH
#include "G4OpenGLXmVWidgetComponent.hh"
class G4OpenGLXmRadioButton : public G4OpenGLXmVWidgetComponent
{
public:
G4OpenGLXmRadioButton (const char*,
XtCallbackRec*,
G4bool,
G4int); //constructor
virtual ~G4OpenGLXmRadioButton (); //destructor
void SetName (const char*);
const char* GetName ();
void AddYourselfTo (G4OpenGLXmVWidgetContainer*);
Widget* GetPointerToParent ();
Widget* GetPointerToWidget ();
private:
G4OpenGLXmRadioButton (const G4OpenGLXmRadioButton&);
G4OpenGLXmRadioButton& operator = (const G4OpenGLXmRadioButton&);
const char* name;
XtCallbackRec* callback;
Widget button;
Widget* parent;
G4bool default_button;
G4int number;
};
#endif
@@ -0,0 +1,43 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Default resources file for GEANT4 OpenGL Motif windows.
#ifndef G4OPENGLXMRESOURCES_HH
#define G4OPENGLXMRESOURCES_HH
static String fallbackResources[] = {
"*glxarea*width: 500", "*glxarea*height: 500",
"*frame*x: 10", "*frame*y: 10",
"*frame*topOffset: 10", "*frame*bottomOffset: 10",
"*frame*rightOffset: 10", "*frame*leftOffset: 10",
"*frame*shadowType: SHADOW_IN", "*useColorObj: False",
NULL
};
#endif
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Separator class. Inherits from G4OpenGLXmVWidgetComponent
#ifndef G4OPENGLXMSEPARATOR_HH
#define G4OPENGLXMSEPARATOR_HH
#include "G4OpenGLXmVWidgetComponent.hh"
class G4OpenGLXmSeparator : public G4OpenGLXmVWidgetComponent
{
public:
G4OpenGLXmSeparator (unsigned char = XmSINGLE_LINE); //constructor
virtual ~G4OpenGLXmSeparator (); //destructor
void AddYourselfTo (G4OpenGLXmVWidgetContainer*);
Widget* GetPointerToParent ();
Widget* GetPointerToWidget ();
private:
G4OpenGLXmSeparator (const G4OpenGLXmSeparator&);
G4OpenGLXmSeparator& operator = (const G4OpenGLXmSeparator&);
unsigned char line_type;
Widget line;
Widget* parent;
};
#endif
@@ -0,0 +1,92 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Slider bar class. Inherits from G4OpenGLXmVWidgetComponent
#ifndef G4OPENGLXMSLIDERBAR_HH
#define G4OPENGLXMSLIDERBAR_HH
#include "G4OpenGLXmVWidgetComponent.hh"
class G4OpenGLXmSliderBar : public G4OpenGLXmVWidgetComponent
{
public:
G4OpenGLXmSliderBar (const char* = NULL, // name of slider bar
XtCallbackRec* = NULL, // callbacks for slider bar
G4bool = False, // show current value if True
short = 0, // decimal places for show value
G4double = 0., // initial value
G4double = 0., // max value
G4double = 0., // min value
unsigned char = XmHORIZONTAL,
unsigned char = XmMAX_ON_RIGHT);
//constructor
virtual ~G4OpenGLXmSliderBar (); //destructor
void SetName (const char*);
void SetShow (G4bool);
void SetDecimalPlaces (short);
void SetInitialValue (G4double);
void SetMaxValue (G4double);
void SetMinValue (G4double);
void SetOrientation (unsigned char);
void SetDirection (unsigned char);
const char* GetName ();
G4bool GetShow ();
short GetDecimalPlaces ();
G4double GetInitialValue ();
G4double GetMaxValue ();
G4double GetMinValue ();
unsigned char GetOrientation ();
unsigned char GetDirection ();
void AddYourselfTo (G4OpenGLXmVWidgetContainer*);
Widget* GetPointerToParent ();
Widget* GetPointerToWidget ();
private:
G4OpenGLXmSliderBar (const G4OpenGLXmSliderBar&);
G4OpenGLXmSliderBar& operator = (const G4OpenGLXmSliderBar&);
const char* name;
XtCallbackRec* callback;
Widget sliderbar;
Widget* parent;
G4bool show;
short decimal_places;
G4int initial_value;
G4int max_value;
G4int min_value;
unsigned char orientation;
unsigned char direction;
};
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Text field class. Inherits from G4OpenGLXmVWidgetComponent
#ifndef G4OPENGLXMTEXTFIELD_HH
#define G4OPENGLXMTEXTFIELD_HH
#include "G4OpenGLXmVWidgetComponent.hh"
//#include "G4OpenGLXmConvenienceRoutines.hh"
class G4OpenGLXmTextField : public G4OpenGLXmVWidgetComponent
{
public:
G4OpenGLXmTextField (const char*,G4double*); //constructor
G4OpenGLXmTextField (const char*,const char*); //constructor
virtual ~G4OpenGLXmTextField (); //destructor
void SetName (const char*);
const char* GetName ();
void SetValue (G4double);
void SetValue (const char*);
const char* GetValue ();
void AddYourselfTo (G4OpenGLXmVWidgetContainer*);
Widget* GetPointerToParent ();
Widget* GetPointerToWidget ();
private:
G4OpenGLXmTextField (const G4OpenGLXmTextField&);
G4OpenGLXmTextField& operator = (const G4OpenGLXmTextField&);
const char* name;
void* value;
G4bool text;
char* initial;
Widget text_label;
Widget text_field;
Widget* parent;
};
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Top level shell class
#ifndef G4OPENGLXMTOPLEVELSHELL_HH
#define G4OPENGLXMTOPLEVELSHELL_HH
#include "G4OpenGLXmVWidgetShell.hh"
class G4OpenGLXmVWidgetContainer;
class G4OpenGLXmTopLevelShell : public G4OpenGLXmVWidgetShell
{
public:
G4OpenGLXmTopLevelShell(G4OpenGLXmViewer*, char*); //constructor
virtual ~G4OpenGLXmTopLevelShell(); //destructor
void AddChild (G4OpenGLXmVWidgetContainer*);
void Realize ();
Widget* GetPointerToWidget ();
char* GetName ();
private:
G4OpenGLXmTopLevelShell (const G4OpenGLXmTopLevelShell&);
G4OpenGLXmTopLevelShell& operator = (const G4OpenGLXmTopLevelShell&);
char* name;
Widget toplevel;
Widget top_box;
Widget frame;
};
#endif
@@ -0,0 +1,54 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Base class for all Motif component widgets
#ifndef G4OPENGLXMVWIDGETCOMPONENT_HH
#define G4OPENGLXMVWIDGETCOMPONENT_HH
#include "G4OpenGLXmVWidgetObject.hh"
class G4OpenGLXmVWidgetContainer;
class G4OpenGLXmVWidgetComponent : public G4OpenGLXmVWidgetObject
{
public:
G4OpenGLXmVWidgetComponent(); //constructor
virtual ~G4OpenGLXmVWidgetComponent(); //destructor
virtual void AddYourselfTo (G4OpenGLXmVWidgetContainer*) = 0;
virtual Widget* GetPointerToParent () = 0;
virtual Widget* GetPointerToWidget () = 0;
private:
};
#endif
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Base class for all Motif container widgets
#ifndef G4OPENGLXMVWIDGETCONTAINER_HH
#define G4OPENGLXMVWIDGETCONTAINER_HH
#include "G4OpenGLXmVWidgetObject.hh"
class G4OpenGLXmVWidgetShell;
class G4OpenGLXmVWidgetComponent;
class G4OpenGLXmVWidgetContainer : public G4OpenGLXmVWidgetObject
{
public:
G4OpenGLXmVWidgetContainer(); //constructor
virtual ~G4OpenGLXmVWidgetContainer(); //destructor
virtual void AddChild (G4OpenGLXmVWidgetComponent*) = 0;
virtual void AddYourselfTo (G4OpenGLXmVWidgetShell*) = 0;
virtual Widget* GetPointerToParent () = 0;
virtual Widget* GetPointerToWidget () = 0;
private:
};
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Virtual base class for all Motif widgets.
#ifndef G4OPENGLXMVWIDGETOBJECT_HH
#define G4OPENGLXMVWIDGETOBJECT_HH
#include "globals.hh"
#include <Xm/Xm.h>
class G4OpenGLXmViewer;
class G4OpenGLXmVWidgetObject {
public:
G4OpenGLXmVWidgetObject (); //constructor
virtual ~G4OpenGLXmVWidgetObject (); //destructor
G4OpenGLXmViewer* GetView (); //access to the pView
void ProcesspView ();
protected:
G4OpenGLXmVWidgetObject (const G4OpenGLXmVWidgetObject&);
G4OpenGLXmVWidgetObject& operator = (const G4OpenGLXmVWidgetObject&);
G4OpenGLXmViewer* pView;
Colormap cmap;
Pixel borcol;
Pixel bgnd;
unsigned int depth;
Visual* visual;
Widget top;
};
#endif
@@ -0,0 +1,52 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//Base class for all Motif window widgets (shells)
#ifndef G4OPENGLXMVWIDGETSHELL_HH
#define G4OPENGLXMVWIDGETSHELL_HH
#include "G4OpenGLXmVWidgetObject.hh"
class G4OpenGLXmVWidgetContainer;
class G4OpenGLXmVWidgetShell : public G4OpenGLXmVWidgetObject
{
public:
G4OpenGLXmVWidgetShell(); //constructor
virtual ~G4OpenGLXmVWidgetShell(); //destructor
virtual Widget* GetPointerToWidget() = 0;
virtual void AddChild (G4OpenGLXmVWidgetContainer*) = 0;
virtual void Realize () = 0;
private:
};
#endif
@@ -0,0 +1,389 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Andrew Walkden 10th February 1997
// G4OpenGLXmViewer : Class derived from G4OpenGLXViewer, to provide
// (Motif) widget OpenGL functionality for GEANT4.
#ifndef G4OPENGLXMVIEWER_HH
#define G4OPENGLXMVIEWER_HH
#include "G4OpenGLXViewer.hh"
#include "globals.hh"
#include <Xm/Xm.h>
class G4OpenGLXmTopLevelShell;
class G4OpenGLXmRadioButton;
class G4OpenGLXmPushButton;
class G4OpenGLXmSliderBar;
class G4OpenGLXmBox;
class G4OpenGLXmTextField;
class G4OpenGLXmFramedBox;
class G4OpenGLXmFourArrowButtons;
class G4OpenGLXmSeparator;
class G4OpenGLXmViewer: public G4OpenGLXViewer {
public:
G4OpenGLXmViewer (G4OpenGLSceneHandler& scene);
virtual ~G4OpenGLXmViewer ();
protected:
virtual void ShowView ();
void ResetView ();
void GetXmConnection ();
virtual void CreateMainWindow ();
XtAppContext app;
XtWorkProcId workId;
Widget toplevel,
shell,
main_win,
menubar,
style_cascade,
actions_cascade,
misc_cascade,
spec_cascade,
drawing_style_pullright,
background_color_pullright,
transparency_pullright,
antialias_pullright,
haloing_pullright,
aux_edge_pullright,
frame,
glxarea;
XmString style_str,
actions_str,
misc_str,
spec_str,
draw_str,
polyhedron_str,
wireframe_str,
hlr_str,
hsr_str,
hlhsr_str,
set_str,
rot_str,
pan_str,
exit_str,
quit_str,
print_str,
white_str,
black_str,
anti_str,
trans_str,
halo_str,
aux_edge_str,
bgnd_str,
off_str,
on_str;
G4double zoom_high,
zoom_low,
pan_low,
pan_high,
dolly_low,
dolly_high,
fov,
rot_sens_limit,
pan_sens_limit,
wob_high,
wob_low,
wob_sens;
Pixel bgnd,
borcol;
G4bool pan_right,
rotate_right,
pan_up,
rotate_up;
XtIntervalId rotation_timer,
pan_timer,
wobble_timer;
G4Vector3D original_vp;
G4int frameNo;
static const G4String e_str;
G4String menu_str[37] = { "Style", "style",
"Actions", "actions",
"Miscellany", "miscellany",
"Special", "special",
"menubar", "Drawing",
"Background color", "Wireframe",
"Hidden line removal", "Hidden surface removal",
"Hidden line and surface removal", "drawing_style",
"White", "Black",
"background_color", "Rotation control panel",
"Panning control panel", "Set control panel limits",
"Miscellany control panel",
"Exit to G4Vis>", "Create .eps file",
"Transparency", "transparency",
"Antialiasing", "antialias",
"Haloing", "haloing",
"Auxiliary edges", "aux_edge",
"Off", "On", "frame", "glxarea" };
G4OpenGLXmTopLevelShell* fprotation_top;
G4OpenGLXmBox* fprotation_button_box;
G4OpenGLXmRadioButton* fprotation_button1;
G4OpenGLXmRadioButton* fprotation_button2;
G4OpenGLXmBox* fprotation_slider_box;
G4OpenGLXmSliderBar* fprotation_slider;
G4OpenGLXmBox* fprotation_arrow_box;
G4OpenGLXmFourArrowButtons* fprotation_arrow;
G4OpenGLXmTopLevelShell* fppanning_top;
G4OpenGLXmFramedBox* fppanning_box;
G4OpenGLXmFourArrowButtons* fppanning_arrows;
G4OpenGLXmSliderBar* fppanning_slider;
G4OpenGLXmFramedBox* fpzoom_box;
G4OpenGLXmSliderBar* fpzoom_slider;
G4OpenGLXmFramedBox* fpdolly_box;
G4OpenGLXmSliderBar* fpdolly_slider;
G4OpenGLXmTopLevelShell* fpsetting_top;
G4OpenGLXmFramedBox* fpsetting_box;
G4OpenGLXmTextField* fppan_set;
G4OpenGLXmTextField* fprot_set;
G4OpenGLXmTextField* fpzoom_upper;
G4OpenGLXmTextField* fpzoom_lower;
G4OpenGLXmTextField* fpdolly_upper;
G4OpenGLXmTextField* fpdolly_lower;
G4OpenGLXmPushButton* fpok_button;
G4OpenGLXmTopLevelShell* fpmiscellany_top;
G4OpenGLXmFramedBox* fpwobble_box;
G4OpenGLXmPushButton* fpwobble_button;
G4OpenGLXmSliderBar* fpwobble_slider;
G4OpenGLXmFramedBox* fpreset_box;
G4OpenGLXmPushButton* fpreset_button;
G4OpenGLXmFramedBox* fpproj_style_box;
G4OpenGLXmRadioButton* fporthogonal_button;
G4OpenGLXmRadioButton* fpperspective_button;
G4OpenGLXmTextField* fpfov_text;
G4OpenGLXmTopLevelShell* fpprint_top;
G4OpenGLXmFramedBox* fpprint_box;
G4OpenGLXmFramedBox* fpprint_col_box;
G4OpenGLXmFramedBox* fpprint_style_box;
G4OpenGLXmTextField* fpprint_text;
G4OpenGLXmPushButton* fpprint_button;
G4OpenGLXmSeparator* fpprint_line;
G4OpenGLXmRadioButton* fpprint_col_radio1;
G4OpenGLXmRadioButton* fpprint_col_radio2;
G4OpenGLXmRadioButton* fpprint_style_radio1;
G4OpenGLXmRadioButton* fpprint_style_radio2;
public:
static void expose_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void resize_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void actions_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void misc_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void Add_set_field (char* widget,
char* widget_text,
Widget* row_col_box,
Widget* wid,
G4double* val,
G4OpenGLXmViewer* pView);
static void zoom_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void dolly_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void pan_left_right_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void left_right_pan_callback (XtPointer clientData,
XtIntervalId* timer_id);
static void theta_rotation_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void phi_rotation_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void pan_up_down_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void up_down_pan_callback (XtPointer clientData,
XtIntervalId* timer_id);
static void drawing_style_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void background_color_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void set_rot_subject_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void set_rot_sens_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void set_pan_sens_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void set_wob_sens_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void projection_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void wobble_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void reset_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void update_panels_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void wobble_timer_callback (XtPointer clientData,
XtIntervalId* timerid);
static void Add_radio_box (char* label_string,
Widget* parent_frame_widget,
XtCallbackRec* radio_box_cb,
G4int num_buttons,
G4int default_button,
char* radio_box_name,
char** button_names,
G4OpenGLXmViewer* pView);
static void Add_four_arrow_buttons (G4OpenGLXmViewer* pView,
XtCallbackRec** arrow_callbacks,
Widget* parent_widget);
static void Add_slider_box (char* label_string,
G4int num_sliders,
char** slider_name,
G4OpenGLXmViewer* pView,
G4double* min_array,
G4double* max_array,
G4double* value_array,
G4bool* show,
short* decimals,
unsigned char* orientation,
unsigned char* direction,
XtCallbackRec** slider_box_cb,
Widget* parent_frame_widget);
static void rotate_in_theta (XtPointer clientData,
XtIntervalId* timer_id);
static void rotate_in_phi (XtPointer clientData,
XtIntervalId* timer_id);
static void get_double_value_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void get_text_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void transparency_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void antialias_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void haloing_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void aux_edge_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void set_print_colour_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void set_print_style_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void print_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static G4bool get_boolean_userData (Widget w);
static G4int get_int_userData (Widget w);
friend class G4OpenGLXmVWidgetObject;
friend class G4OpenGLXmViewerMessenger;
private:
G4OpenGLXmViewer (const G4OpenGLXmViewer&);
G4OpenGLXmViewer& operator = (const G4OpenGLXmViewer&);
void UpdateControlPanel();
// Update the content of the control panel
};
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
#ifndef G4OPENGLXMVIEWERMESSENGER_HH
#define G4OPENGLXMVIEWERMESSENGER_HH
#include "G4UImessenger.hh"
#include "G4String.hh"
class G4OpenGLXmViewer;
class G4UIdirectory;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithADouble;
class G4OpenGLXmViewerMessenger: public G4UImessenger {
public:
static G4OpenGLXmViewerMessenger* GetInstance(); // Singleton constructor.
~G4OpenGLXmViewerMessenger();
void SetNewValue (G4UIcommand*, G4String);
private:
G4OpenGLXmViewerMessenger(); // Private constructor.
static G4OpenGLXmViewerMessenger* fpInstance;
G4UIdirectory* fpDirectory;
G4UIdirectory* fpDirectorySet;
G4UIcmdWithADoubleAndUnit* fpCommandSetDollyHigh;
G4UIcmdWithADoubleAndUnit* fpCommandSetDollyLow;
G4UIcmdWithADoubleAndUnit* fpCommandSetPanHigh;
G4UIcmdWithADoubleAndUnit* fpCommandSetRotationHigh;
G4UIcmdWithADouble* fpCommandSetZoomHigh;
G4UIcmdWithADouble* fpCommandSetZoomLow;
};
#endif
@@ -0,0 +1,44 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
#ifndef G4VISFEATURESOFOPENGL_HH
#define G4VISFEATURESOFOPENGL_HH
#include "globals.hh"
G4String G4VisFeaturesOfOpenGLIX ();
G4String G4VisFeaturesOfOpenGLSX ();
G4String G4VisFeaturesOfOpenGLIXm ();
G4String G4VisFeaturesOfOpenGLSXm ();
G4String G4VisFeaturesOfOpenGLIWin32 ();
G4String G4VisFeaturesOfOpenGLSWin32 ();
G4String G4VisFeaturesOfOpenGLIQt ();
G4String G4VisFeaturesOfOpenGLSQt ();
#endif
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
#ifndef G4gl2ps_h
#define G4gl2ps_h
#include "G4String.hh"
#include <tools/gl2ps_def.h>
class G4gl2ps {
public:
G4gl2ps();
~G4gl2ps();
void setOpenGLFunctions(tools_gl2ps_gl_funcs_t*);
void setFileName(const char*);
void setExportImageFormat(unsigned int);
void setExportImageFormat_PS() {setExportImageFormat(TOOLS_GL2PS_PS);}
void setExportImageFormat_EPS() {setExportImageFormat(TOOLS_GL2PS_EPS);}
void setExportImageFormat_TEX() {setExportImageFormat(TOOLS_GL2PS_TEX);}
void setExportImageFormat_PDF() {setExportImageFormat(TOOLS_GL2PS_PDF);}
void setExportImageFormat_SVG() {setExportImageFormat(TOOLS_GL2PS_SVG);}
void setExportImageFormat_PGF() {setExportImageFormat(TOOLS_GL2PS_PGF);}
bool enableFileWriting();
void disableFileWriting();
bool fileWritingEnabled() const;
bool beginPage();
bool endPage();
void setLineWidth(int);
void setPointSize(int);
void addTextOpt(const char*,const char*,
tools_GLshort,tools_GLint,tools_GLfloat);
void setViewport(int,int,int,int);
bool extendBufferSize();
void resetBufferSizeParameters();
void setBufferSize(int);
tools_GL2PScontextPointer context() const {return fContext;}
protected:
tools_gl2ps_gl_funcs_t fOpenGLFuncs;
tools_GL2PScontextPointer fContext;
FILE* fFile;
G4String fFileName;
int fViewport[4];
int fBufferSize;
int fBufferSizeLimit;
private:
unsigned int fExportImageFormat;
};
#endif