Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4OpenGL.hh 75567 2013-11-04 11:35:11Z gcosmo $
//
// G.Barrand.
@@ -56,13 +56,16 @@
//# Do NOT include glx Here ! It has to be done, after all <Qxx...> includes
//# include <GL/glx.h>
#ifdef G4VIS_BUILD_OPENGLWT_DRIVER
#include <Wt/WGLWidget>
#include <qgl.h>
#endif
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
#ifdef G4VIS_BUILD_OPENGLWT_DRIVER
# include <Wt/WGLWidget>
# define G4OPENGL_VERSION_2 1
// include all redefinitions of gl functions for Wt
# include "G4OpenGLWtDrawer.hh"
#endif
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
#ifndef G4VIS_BUILD_OPENGLX_DRIVER
#ifdef __MACH__
//# define G4OPENGL_VERSION_2 1
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4OpenGLFontBaseStore.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// J.Allison Apr 2005.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateQt.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// OpenGLImmediateQt graphics system factory.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateQtViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Class G4OpenGLImmediateQtViewer : a class derived from
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateSceneHandler.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -59,7 +59,6 @@ public:
void AddPrimitive (const G4Square&);
void AddPrimitive (const G4Scale& scale);
void AddPrimitive (const G4Polyhedron&);
void AddPrimitive (const G4NURBS&);
protected:
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 7th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateWin32.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// OpenGLImmediateWin32 graphics system factory.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateWin32Viewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Class G4OpenGLImmediateWin32Viewer : a class derived from
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateWt.hh 75567 2013-11-04 11:35:11Z gcosmo $
//
//
// OpenGLImmediateWt graphics system factory.
@@ -34,11 +34,18 @@
#include "G4VGraphicsSystem.hh"
namespace Wt {
class WContainerWidget;
}
class G4OpenGLImmediateWt: public G4VGraphicsSystem {
public:
G4OpenGLImmediateWt ();
G4VSceneHandler* CreateSceneHandler (const G4String& name = "");
G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name = "");
private:
Wt::WContainerWidget* fWGLContainer;
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateWtViewer.hh 75567 2013-11-04 11:35:11Z gcosmo $
//
//
// Class G4OpenGLImmediateWtViewer : a class derived from
@@ -36,47 +36,69 @@
#define G4OPENGLIMMEDIATEWTVIEWER_HH
#include "G4OpenGLImmediateViewer.hh"
#include "G4OpenGLImmediateQtViewer.hh"
#include "G4OpenGLWtViewer.hh"
#include <Wt/WPaintedWidget>
#include <Wt/WEvent>
//#include <qgl.h> // include <qglwidget.h>
#include "globals.hh"
class G4OpenGLImmediateSceneHandler;
class QMouseEvent;
class G4OpenGLImmediateWtViewer : public G4VViewer,
/* public G4OpenGLImmediateViewer ,*/ public Wt::WPaintedWidget {
class G4OpenGLImmediateWtViewer :
public G4OpenGLWtViewer, public G4OpenGLImmediateViewer, public Wt::WGLWidget {
public:
G4OpenGLImmediateWtViewer (G4OpenGLImmediateSceneHandler& scene, Wt::WContainerWidget *,
const G4String& name = "");
G4OpenGLImmediateWtViewer (G4OpenGLImmediateSceneHandler& scene, Wt::WContainerWidget*, const G4String& name = "");
~G4OpenGLImmediateWtViewer ();
void Initialise ();
void resizeGL(int, int);
void paintGL();
void initializeGL ();
void DrawView();
void ShowView();
void SetView();
//
void popMatrix();
void pushMatrix();
void multMatrixd(const GLdouble*);
void setMatrixUniforms();
void loadIdentity();
void wtDrawArrays(GLenum mode,int first, G4int nPoints, std::vector<double> a_vertices);
void ComputeView ();
void drawScene ();
void FinishView();
private:
G4OpenGLImmediateQtViewer * fQtViewer;
// void WtShowEvent(QShowEvent event );
void WtWheelEvent(Wt::WMouseEvent event);
void WtMousePressEvent(Wt::WMouseEvent event);
void WtMouseMoveEvent(Wt::WMouseEvent event);
void WtMouseDoubleClickEvent(Wt::WMouseEvent event);
// void WtMouseReleaseEvent(Wt::WMouseEvent event);
// void showEvent(QShowEvent event );
void mousePressEvent(Wt::WMouseEvent *event);
void mouseMoveEvent(Wt::WMouseEvent *event);
void mouseDoubleClickEvent(Wt::WMouseEvent *event);
void mouseReleaseEvent(Wt::WMouseEvent event);
// void WtContextMenuEvent(QContextMenuEvent e);
void WtKeyPressEvent (Wt::WKeyEvent event);
void keyPressEvent (Wt::WKeyEvent *event);
void paintEvent(Wt::WPaintDevice * event);
QMouseEvent * ConvertWtMouseEventToQt(Wt::WMouseEvent event);
QWheelEvent * ConvertWtWheelEventToQt(Wt::WMouseEvent event);
QKeyEvent * ConvertWtKeyEventToQt(Wt::WKeyEvent event);
void updateWWidget();
// A client-side JavaScript matrix variable
JavaScriptMatrix4x4 jsMatrix_;
// The so-called VBOs, Vertex Buffer Objects
// This one contains both vertex (xyz) and normal (xyz) data
Buffer objBuffer_;
// void ComputeView ();
// implements G4VViewer::SetView() and ClearView()
void SetView ();
void ClearView ();
// void SetView ();
// void ClearView ();
// To avoid copying large constant data around, the data points are stored
// in a global variable.
std::vector<double> data;
std::vector <Buffer> VBO_Buffer;
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateX.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateXViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 7th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateXm.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLImmediateXmViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -25,7 +25,6 @@
//
//
// $Id:$
// GEANT4 tag $Name: not supported by cvs2svn $
//
// John Allison 27th October 2012
// Base class for OpenGLImmediate/StoredQt graphics system factories.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLQtExportDialog.hh 66373 2012-12-18 09:41:34Z gcosmo $
// GEANT4 tag $Name:
//
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLQtMovieDialog.hh 66373 2012-12-18 09:41:34Z gcosmo $
// GEANT4 tag $Name:
//
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLQtViewer.hh 77479 2013-11-25 10:01:22Z gcosmo $
//
//
// G4OpenGLQtViewer : Class to provide WindowsNT specific
@@ -144,6 +144,12 @@ protected:
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;
protected:
QGLWidget* fWindow;
@@ -207,6 +213,10 @@ private:
// 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);
QMenu *fContextMenu;
QPoint fLastPos1;
@@ -263,8 +273,9 @@ private:
QWidget* fSceneTreeWidget;
bool fPVRootNodeCreate;
QLineEdit* fHelpLine;
QString fFileSavePath;
QString fDefaultSaveFileFormat;
int fNbRotation ;
int fTimeRotation;
QString fTouchableVolumes;
@@ -293,10 +304,12 @@ private:
QSignalMapper *signalMapperSurface;
// quick map index to find next item
std::map <int, QTreeWidgetItem*>::const_iterator fLastSceneTreeWidgetAskFor;
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 fOldLastSceneTreeWidgetAskFor;
std::map <int, QTreeWidgetItem*>::const_iterator fOldLastSceneTreeWidgetAskForIterator;
std::map <int, QTreeWidgetItem*>::const_iterator fOldLastSceneTreeWidgetAskForIteratorEnd;
public Q_SLOTS :
@@ -315,7 +328,6 @@ private Q_SLOTS :
void showShortcuts();
void toggleMouseAction(int);
void toggleSurfaceAction(int);
void toggleRepresentation(bool);
void toggleProjection(bool);
void toggleTransparency(bool);
void toggleAntialiasing(bool);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLSceneHandler.hh 75567 2013-11-04 11:35:11Z gcosmo $
//
//
// Andrew Walkden 27th March 1996
@@ -64,7 +64,6 @@ public:
void AddPrimitivesSquare (const std::vector <G4VMarker>&);
void AddPrimitive (const G4Scale&);
void AddPrimitive (const G4Polyhedron&);
void AddPrimitive (const G4NURBS&);
void PreAddSolid (const G4Transform3D& objectTransformation,
const G4VisAttributes&);
@@ -87,6 +86,36 @@ public:
G4int GetEventsDrawInterval() {return fEventsDrawInterval;}
void SetEventsDrawInterval(G4int interval) {fEventsDrawInterval = interval;}
#ifdef G4OPENGL_VERSION_2
private :
// vertex vector to be given to the graphic card
std::vector<double> fOglVertex;
// indices vector to be given to the graphic card
std::vector<unsigned short> fOglIndices;
// before, drawyType (as GL_QUADS, GL_TRIANGLES...) was
// given in glBegin. Now it has to be given in glDrawArray (at the end)
GLenum fDrawArrayType;
// emulate GL_QUADS behaviour by inverting two last positions
bool fEmulate_GL_QUADS;
// Try to optimize a bit the pipeline
void OptimizeVBOForTrd();
void OptimizeVBOForCons(G4int aNoFacet);
// emulating glEnd and glBegin
void glEndVBO();
void glBeginVBO(GLenum type);
void drawVBOArray(std::vector<double> vertices);
// Buffers used to access vertex and indices elements
#ifndef G4VIS_BUILD_OPENGLWT_DRIVER
GLuint fVertexBufferObject;
GLuint fIndicesBufferObject;
#else
Wt::WGLWidget::Buffer fVertexBufferObject;
Wt::WGLWidget::Buffer fIndicesBufferObject;
#endif
#endif
protected:
G4OpenGLSceneHandler (G4VGraphicsSystem& system,
@@ -100,6 +129,17 @@ protected:
void ClearAndDestroyAtts(); // Destroys att holders and clears pick map.
#ifdef G4VIS_BUILD_OPENGLWT_DRIVER
// Special case for Wt, we want to have acces to the Wt drawer everywhere
// because instead of OpenGL call which are static, Wt openGL functions are functions of an WGLWidget
// object(G4OpenGLImmediateViewer in our case)
inline void setWtDrawer(G4OpenGLWtDrawer* drawer) {
fWtDrawer = drawer;
}
G4OpenGLWtDrawer* fWtDrawer;
#endif
GLuint fPickName;
std::map<GLuint, G4AttHolder*> fPickMap; // For picking.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLSceneHandler.icc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 20th January 1998
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredQt.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// OpenGLStoredQt graphics system factory.
@@ -25,7 +25,6 @@
//
//
// $Id: G4OpenGLStoredSceneHandler.hh,v 1.32 2010-11-10 17:10:49 allison Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// Laurent Garnier 27th October 2011
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredQtViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Class G4OpenGLStoredQtViewer : a class derived from
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredSceneHandler.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -64,7 +64,6 @@ public:
void AddPrimitive (const G4Text&);
void AddPrimitive (const G4Scale&);
void AddPrimitive (const G4Polyhedron&);
void AddPrimitive (const G4NURBS&);
void ClearStore ();
void ClearTransientStore ();
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 7th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredWin32.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// OpenGLStoredWin32 graphics system factory.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredWin32Viewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Class G4OpenGLStoredWin32Viewer : a class derived from
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredX.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredXViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 7th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredXm.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLStoredXmViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLTransform3D.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 24th October 1996
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLViewer.hh 75567 2013-11-04 11:35:11Z gcosmo $
//
//
// Andrew Walkden 27th March 1996
@@ -41,6 +41,9 @@
class G4OpenGLSceneHandler;
class G4OpenGL2PSAction;
class G4Text;
#ifdef G4VIS_BUILD_OPENGLWT_DRIVER
#include "G4OpenGLWtDrawer.hh"
#endif
// Base class for various OpenGLView classes.
class G4OpenGLViewer: virtual public G4VViewer {
@@ -56,6 +59,15 @@ public:
//////////////////////////////Vectored PostScript production functions///
void printEPS();
// Special case for Wt, we want to have acces to the drawer
#ifdef G4VIS_BUILD_OPENGLWT_DRIVER
inline G4OpenGLWtDrawer* getWtDrawer() {return fWtDrawer;}
// Associate the Wt drawer to the OpenGLViewer and the OpenGLSceneHandler
void setWtDrawer(G4OpenGLWtDrawer* drawer);
G4OpenGLWtDrawer* fWtDrawer;
#endif
protected:
G4OpenGLViewer (G4OpenGLSceneHandler& scene);
virtual ~G4OpenGLViewer ();
@@ -94,8 +106,8 @@ protected:
// set print filename.
// if inc, then the filename will be increment by one each time
std::string getRealPrintFilename();
unsigned int getWinWidth();
unsigned int getWinHeight();
unsigned int getWinWidth() const;
unsigned int getWinHeight() const;
G4bool sizeHasChanged();
// return true if size has change since last redraw
GLdouble getSceneNearWidth();
@@ -126,6 +138,47 @@ protected:
G4double fRot_sens; // Rotation sensibility in degrees
G4double fPan_sens; // Translation sensibility
public :
#ifdef G4OPENGL_VERSION_2
// define the shaders for vertex and fragment in plain text format
std::string vertexShader_;
std::string fragmentShader_;
// define the keyword shader to handle it in a better way for OpenGL and WebGL
#ifdef G4VIS_BUILD_OPENGLWT_DRIVER
#define Shader Wt::WGLWidget::Shader
#else
#define Shader GLuint
#endif
// define some attributes and variables for OpenGL and WebGL
#ifdef G4VIS_BUILD_OPENGLWT_DRIVER
Wt::WGLWidget::Program shaderProgram_;
// Program and related variables
Wt::WGLWidget::AttribLocation vertexPositionAttribute_;
Wt::WGLWidget::AttribLocation vertexNormalAttribute_;
Wt::WGLWidget::UniformLocation pMatrixUniform_;
Wt::WGLWidget::UniformLocation cMatrixUniform_;
Wt::WGLWidget::UniformLocation mvMatrixUniform_;
Wt::WGLWidget::UniformLocation nMatrixUniform_;
Wt::WGLWidget::UniformLocation tMatrixUniform_;
#else
GLuint shaderProgram_;
// Program and related variables
GLuint vertexPositionAttribute_;
GLuint vertexNormalAttribute_;
GLuint pMatrixUniform_;
GLuint cMatrixUniform_;
GLuint mvMatrixUniform_;
GLuint nMatrixUniform_;
GLuint tMatrixUniform_;
#endif
#endif
private :
static G4int fPrintSizeX;
static G4int fPrintSizeY;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLViewerMessenger.hh 66373 2012-12-18 09:41:34Z gcosmo $
#ifndef G4OPENGLVIEWERMESSENGER_HH
#define G4OPENGLVIEWERMESSENGER_HH
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLWin32Viewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// G4OpenGLWin32Viewer : Class to provide WindowsNT specific
@@ -0,0 +1,292 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4OpenGLWtViewer.hh 74103 2013-09-23 07:52:38Z lgarnier $
//
//
// G4OpenGLWtViewer : Class to provide WindowsNT specific
// functionality for OpenGL in GEANT4
#ifdef G4VIS_BUILD_OPENGLWT_DRIVER
#ifndef G4OPENGLWTDRAWER_HH
#define G4OPENGLWTDRAWER_HH
# include <Wt/WGLWidget>
// specific definition for WT :
// WARNING fWtDrawer should be the exact name of the object!
#define glViewport(a, b, width, height) (fWtDrawer->wglViewport(a, b, width, height))
#define glEnable fWtDrawer->wglEnable
#define glDisable fWtDrawer->wglDisable
#define glBlendFunc fWtDrawer->wglBlendFunc
#define glClear(a) (fWtDrawer->wglClear(a))
#define glClearColor fWtDrawer->wglClearColor
#define glClearDepth fWtDrawer->wglClearDepth
#define glDepthFunc fWtDrawer->wglDepthFunc
#define glDepthMask fWtDrawer->wglDepthMask
#define glFlush() fWtDrawer->wglFlush()
#define glColorMask fWtDrawer->wglColorMask
#define glLineWidth fWtDrawer->wglLineWidth
#define glUniformMatrix4 fWtDrawer->wglUniformMatrix4
#define glDrawArrays fWtDrawer->wglDrawArrays
#define glCreateBuffer fWtDrawer->wglCreateBuffer
#define glVertexPointer fWtDrawer->wglVertexPointer
#define glBindBuffer fWtDrawer->wglBindBuffer
#define glDeleteBuffer fWtDrawer->wglDeleteBuffer
#define glBufferDatafv fWtDrawer->wglBufferDatafv
#define glBufferDataiv fWtDrawer->wglBufferDataiv
#define glGetAttribLocation fWtDrawer->wglGetAttribLocation
#define glEnableVertexAttribArray fWtDrawer->wglEnableVertexAttribArray
#define glDisableVertexAttribArray fWtDrawer->wglDisableVertexAttribArray
#define glShaderSource fWtDrawer->wglShaderSource
#define glCompileShader fWtDrawer->wglCompileShader
#define glCreateShader fWtDrawer->wglCreateShader
#define glCreateProgram fWtDrawer->wglCreateProgram
#define glAttachShader fWtDrawer->wglAttachShader
#define glLinkProgram fWtDrawer->wglLinkProgram
#define glUseProgram fWtDrawer->wglUseProgram
#define glDrawElements fWtDrawer->wglDrawElements
#define glVertexAttribPointer fWtDrawer->wglVertexAttribPointer
#define glGetUniformLocation fWtDrawer->wglGetUniformLocation
#define glPointSize fWtDrawer->wglPointSize
#define glColor4d fWtDrawer->wglColor4d
#define glColor4fv fWtDrawer->wglColor4fv
#define glMultMatrixd fWtDrawer->wglMultMatrixd
#define glGetUniformLocation fWtDrawer->wglGetUniformLocation
#define glGetAttribLocation fWtDrawer->wglGetAttribLocation
#define glEdgeFlag(a) (printf("?"))// FIXME : Small debug message for: printf("glEdgeFlag Not implemented\n"))
#define glRenderMode(a) (printf("glRenderMode Not implemented\n"))
#define glClipPlane(a, b) (printf("glClipPane Not implemented\n"))
#define glGetIntegerv(a, b) (printf("glGetIntegerv Not implemented %d %d\n",a,*b))
#define glGetFloatv(a, b) (printf("glGetFloatv Not implemented\n"))
#define glGetDoublev(a,b) (printf("glDoublev Not implemented\n"))
#define glPassThrough(a) (printf("pathTrough Not implemented\n"))
#define glGetBooleanv(a,b) (printf("glGetBooleanv Not implemented\n"))
#define glLoadName(a) (printf("glLoadName Not implemented\n"))
#define glColor3d(a,b,c) (printf("glColor3d Not implemented\n"))
#define glMatrixMode(a) (printf("glMatrixMode Not implemented\n"))
#define glPushMatrix() (printf("glPushMatrix Not implemented\n"))
#define glLoadIdentity() (printf("glLoadIdentity Not implemented\n"))
#define glOrtho(a,b,c,d,e,f) (printf("glOrtho Not implemented %f %f %f %f %f %f\n",a,b,c,d,e,f))
#define glPopMatrix() (printf("glPopMatrix Not implemented\n"))
#define glCallList(a) (printf("glCallList Not implemented\n"))
#define glGenLists(a) (printf("glGenLists Not implemented\n"))
#define glGetError() (printf("glGetError Not implemented\n"))
#define glVertex3d(a,b,c) (printf("glVertex3d Not implemented\n"))
#define glBegin (printf("glBegin Not implemented\n"))
#define glEnd() (printf("glEnd Not implemented\n"))
#define glNewList(a,b) (printf("glNewList Not implemented\n"))
#define glEndList() (printf("glEndList Not implemented\n"))
#define glPolygonMode(a,b) (printf("glPolygonMode Not implemented\n"))
#define glDrawBuffer(a) (printf("glDrawBuffer Not implemented\n"))
#define glDeleteLists(a,b) (printf("glDeleteLists Not implemented\n"))
#define glStencilFunc(a,b,c) (printf("glStencilFunc Not implemented\n"))
#define glStencilOp(a,b,c) (printf("glStencilOp Not implemented\n"))
#define glColorMaterial(a,b) (printf("glColorMaterial Not implemented\n"))
#define glLightfv(a,b,c) (printf("glLightfv Not implemented %u %u %f\n",a,b,*c))
#define glScaled(a,b,c) (printf("glScaled Not implemented\n"))
#define glFrustum(a,b,c,d,e,f) (printf("glFrustum Not implemented\n"))
#define gluLookAt(a,b,c,d,e,f,g,h,i) (printf("gluLookAt Not implemented %f %f %f %f %f %f %f %f %f\n",a,b,c,d,e,f,g,h,i))
#define gluPickMatrix(a,b,c,d,e) (printf("gluPickMatrix Not implemented %f %f %f %f %d\n",a,b,c,d,*e))
#define glSelectBuffer(a,b) (printf("glSelectBuffer Not implemented\n"))
#define glInitNames() (printf("glInitNames Not implemented\n"))
#define glPushNames(a) (printf("glPushNames Not implemented\n"))
#define glPushName(a) (printf("glPushName Not implemented\n"))
#define glPixelStorei(a,b) (printf("glPixelStorei Not implemented\n"))
#define glRasterPos3d(a,b,c) (printf("glRasterPos3d Not implemented\n"))
#define Geant4_gl2psTextOpt(a,b,c,d,e) (printf("gl2psTextOpt Not implemented\n"))
#define glMaterialfv(a,b,c) (printf("glMaterialfv Not implemented\n"))
#define glCullFace(a) (printf("glCullFace Not implemented\n"))
#define glReadBuffer(a) (printf("glReadBuffer Not implemented\n"))
#define glReadPixels(a,b,c,d,e,f,g) (printf("glReadPixels Not implemented\n"))
#define GL_VIEWPORT Wt::WGLWidget::VIEWPORT
#define GL_RGBA Wt::WGLWidget::RGBA
#define GL_ONE_MINUS_SRC_ALPHA Wt::WGLWidget::ONE_MINUS_SRC_ALPHA
#define GL_BLEND Wt::WGLWidget::BLEND
#define GL_SRC_ALPHA Wt::WGLWidget::SRC_ALPHA
#define GL_LEQUAL Wt::WGLWidget::LEQUAL
#define GL_FALSE false
#define GL_LESS Wt::WGLWidget::LESS
#define GL_SELECT Wt::WGLWidget::SELECT
#define GL_TRUE true
#define GL_RGB Wt::WGLWidget::RGB
#define GL_CURRENT_RASTER_POSITION_VALID Wt::WGLWidget::CURRENT_RASTER_POSITION_VALID
#define GL_ONE Wt::WGLWidget::ONE
#define GL_ZERO Wt::WGLWidget::ZERO
#define GL_COLOR_INDEX Wt::WGLWidget::COLOR_INDEX
#define GL_LINE_TOKEN Wt::WGLWidget::LINE_TOKEN
#define GL_LINE_RESET_TOKEN Wt::WGLWidget::LINE_RESET_TOKEN
#define GL_POLYGON_TOKEN Wt::WGLWidget::POLYGON_TOKEN
#define GL_FEEDBACK Wt::WGLWidget::FEEDBACK
#define GL_COLOR_CLEAR_VALUE Wt::WGLWidget::COLOR_CLEAR_VALUE
#define GL_BITMAP_TOKEN Wt::WGLWidget::BITMAP_TOKEN
#define GL_DRAW_PIXEL_TOKEN Wt::WGLWidget::DRAW_PIXEL_TOKEN
#define GL_COPY_PIXEL_TOKEN Wt::WGLWidget::COPY_PIXEL_TOKEN
#define GL_PASS_THROUGH_TOKEN Wt::WGLWidget::PASS_THROUGH_TOKEN
#define GL_3D_COLOR Wt::WGLWidget::3D_COLOR
#define GL_DEPTH_TEST Wt::WGLWidget::DEPTH_TEST
#define GL_FRONT Wt::WGLWidget::FRONT
#define GL_BACK Wt::WGLWidget::BACK
#define GL_FRONT_AND_BACK Wt::WGLWidget::FRONT_AND_BACK
#define GL_OUT_OF_MEMORY Wt::WGLWidget::OUT_OF_MEMORY
#define GL_LINE_STRIP Wt::WGLWidget::LINE_STRIP
#define GL_QUADS Wt::WGLWidget::QUADS
#define GL_LINE_LOOP Wt::WGLWidget::LINE_LOOP
#define GL_LINES Wt::WGLWidget::LINES
#define GL_POINTS Wt::WGLWidget::POINTS
#define GL_TRIANGLES Wt::WGLWidget::TRIANGLES
#define GL_TRIANGLE_STRIP Wt::WGLWidget::TRIANGLE_STRIP
#define GL_TRIANGLE_FAN Wt::WGLWidget::TRIANGLE_FAN
#define GL_FLOAT Wt::WGLWidget::FLOAT
#define GL_STENCIL_TEST Wt::WGLWidget::STENCIL_TEST
#define GL_ALWAYS Wt::WGLWidget::ALWAYS
#define GL_INVERT Wt::WGLWidget::INVERT
#define GL_COMPILE_AND_EXECUTE Wt::WGLWidget::COMPILE_AND_EXECUTE
#define GL_COMPILE Wt::WGLWidget::COMPILE
#define GL_COLOR_BUFFER_BIT Wt::WGLWidget::COLOR_BUFFER_BIT
#define GL_DEPTH_BUFFER_BIT Wt::WGLWidget::DEPTH_BUFFER_BIT
#define GL_STENCIL_BUFFER_BIT Wt::WGLWidget::STENCIL_BUFFER_BIT
#define GL_UNSIGNED_BYTE UNSIGNED_BYTE
#define GL_ARRAY_BUFFER Wt::WGLWidget::ARRAY_BUFFER
#define GL_ELEMENT_ARRAY_BUFFER Wt::WGLWidget::ELEMENT_ARRAY_BUFFER
#define GL_RENDER Wt::WGLWidget::RENDER
#define GL_LUMINANCE Wt::WGLWidget::LUMINANCE
#define GL_STATIC_DRAW Wt::WGLWidget::STATIC_DRAW
#define GL_FRAGMENT_SHADER Wt::WGLWidget::FRAGMENT_SHADER
#define GL_VERTEX_SHADER Wt::WGLWidget::VERTEX_SHADER
#define GL_UNSIGNED_INT Wt::WGLWidget::UNSIGNED_INT
#define GL_UNSIGNED_SHORT Wt::WGLWidget::UNSIGNED_SHORT
#define GL_CULL_FACE Wt::WGLWidget::CULL_FACE
#define GL_MAX_VIEWPORT_DIMS Wt::WGLWidget::MAX_VIEWPORT_DIMS
// to be implemented
#define GL_LINE 0
#define GL_FILL 0
#define GL_PROJECTION_MATRIX 0
#define GL_UNPACK_SWAP_BYTES 0
#define GL_UNPACK_LSB_FIRST 0
#define GL_UNPACK_SKIP_ROWS 0
#define GL_UNPACK_LOW_LENGHT 0
#define GL_UNPACK_SKIP_PIXELS 0
#define GL_UNPACK_ALIGNMENT 0
#define GL_UNPACK_ROW_LENGTH 0
#define GL_PROJECTION 0
#define GL_MODELVIEW 0
#define GL_CLIP_PLANE0 Wt::WGLWidget::ZERO
#define GL_CLIP_PLANE1 Wt::WGLWidget::ZERO
#define GL_CLIP_PLANE2 Wt::WGLWidget::ZERO
#define GL_CLIP_PLANE3 Wt::WGLWidget::ZERO
#define GL_CLIP_PLANE4 Wt::WGLWidget::ZERO
#define GL_COLOR_MATERIAL Wt::WGLWidget::ZERO
#define GL_AMBIENT_AND_DIFFUSE Wt::WGLWidget::ZERO
#define GL_POLYGON 0
#define GL_LIGHTING Wt::WGLWidget::ZERO
#define GL_POINT_SMOOTH Wt::WGLWidget::ZERO
#define GL_LINE_SMOOTH Wt::WGLWidget::ZERO
#define GL_POLYGON_SMOOTH Wt::WGLWidget::ZERO
#define GL_LIGHT0 Wt::WGLWidget::ZERO
#define GL_AMBIENT Wt::WGLWidget::ZERO
#define GL_DIFFUSE Wt::WGLWidget::ZERO
#define GL_POSITION Wt::WGLWidget::ZERO
#define GLenum Wt::WGLWidget::GLenum
#define GLchar char
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef void GLvoid;
typedef char GLbyte;
typedef short GLshort;
typedef int GLint;
typedef unsigned char GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef int GLsizei;
typedef float GLfloat;
typedef float GLclampf;
typedef double GLdouble;
typedef double GLclampd;
// GL2PS
#define GL2PS_TEXT_B 4
#define GL2PS_TEXT_BL 5
#define GL2PS_TEXT_BR 6
class G4OpenGLViewer;
class G4OpenGLImmediateWtViewer;
class G4OpenGLWtDrawer {
public:
G4OpenGLWtDrawer (G4OpenGLViewer*);
virtual ~G4OpenGLWtDrawer ();
void wglClearColor (double r, double g, double b, double a);
void wglClearDepth(double depth);
void wglClear(Wt::WFlags< GLenum > mask);
void wglFlush();
void wglViewport(int x, int y, unsigned width, unsigned height);
void wglEnable(GLenum cap);
void wglDisable(GLenum cap);
void wglBlendFunc (GLenum sfactor, GLenum dfactor);
void wglDepthFunc (GLenum func);
void wglDepthMask(bool flag);
void wglColorMask (bool red, bool green, bool blue, bool alpha);
void wglLineWidth(double width);
void wglUniformMatrix4(const Wt::WGLWidget::UniformLocation &location, const Wt::WMatrix4x4 &mat);
void wglUniformMatrix4(const Wt::WGLWidget::UniformLocation &location, const Wt::WGLWidget::JavaScriptMatrix4x4 &mat);
void wglDrawArrays(GLenum mode, int first, unsigned count);
Wt::WGLWidget::Buffer wglCreateBuffer();
void wglBindBuffer(GLenum target, Wt::WGLWidget::Buffer buffer);
void wglDeleteBuffer(Wt::WGLWidget::Buffer buffer);
void wglBufferDatafv(GLenum target, const std::vector<double>::iterator begin, const std::vector<double>::iterator end, GLenum usage);
void wglBufferDataiv(GLenum target, const std::vector<unsigned short>::iterator begin, const std::vector<unsigned short>::iterator end, GLenum usage);
void wglDrawElements(GLenum mode, unsigned count, GLenum type, unsigned offset);
void wglVertexAttribPointer(Wt::WGLWidget::AttribLocation location, int size, GLenum type, bool normalized, unsigned stride, unsigned offset);
void wglPointSize(float size);
void wglColor4d(int red,int green,int blue,int alpha);
void wglColor4fv(const GLfloat*);
void wglMultMatrixd( const GLdouble *m );
void wglShaderSource(Wt::WGLWidget::Shader shader, GLsizei , const GLchar **src, const GLint *);
void wglCompileShader(Wt::WGLWidget::Shader shader);
Wt::WGLWidget::Shader wglCreateShader(GLenum shader);
Wt::WGLWidget::Program wglCreateProgram();
void wglAttachShader(Wt::WGLWidget::Program program, Wt::WGLWidget::Shader shader);
void wglLinkProgram(Wt::WGLWidget::Program program);
void wglUseProgram(Wt::WGLWidget::Program program);
void wglEnableVertexAttribArray(Wt::WGLWidget::AttribLocation pointer);
void wglDisableVertexAttribArray(Wt::WGLWidget::AttribLocation pointer);
Wt::WGLWidget::UniformLocation wglGetUniformLocation(Wt::WGLWidget::Program programm,const std::string &src);
Wt::WGLWidget::AttribLocation wglGetAttribLocation(Wt::WGLWidget::Shader shader,const std::string &src);
private:
G4OpenGLImmediateWtViewer* fWtViewer;
};
#endif
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLWtViewer.hh 75567 2013-11-04 11:35:11Z gcosmo $
//
//
// G4OpenGLWtViewer : Class to provide WindowsNT specific
@@ -42,6 +42,8 @@
#include <Wt/WObject>
#include <Wt/WPoint>
#include <Wt/WTime>
#include <Wt/WContainerWidget>
#include <Wt/WMatrix4x4>
class G4OpenGLSceneHandler;
class G4UImanager;
@@ -56,17 +58,20 @@ class WImage;
class WWheelEvent;
#endif
class WProcess;
class G4UIWt;
class G4OpenGLSceneHandler;
class G4OpenGLWtMovieDialog;
class G4OpenGLWtViewer: public Wt::WObject, virtual public G4OpenGLViewer {
class G4OpenGLWtViewer: virtual public G4OpenGLViewer {
public:
G4OpenGLWtViewer (G4OpenGLSceneHandler& scene);
virtual ~G4OpenGLWtViewer ();
void SetView ();
virtual void updateWWidget()=0;
Wt::WMatrix4x4 mMatrix;
#ifdef _A_FINIR_FIXME
Wt::WString setEncoderPath(Wt::WString path);
Wt::WString getEncoderPath();
@@ -97,7 +102,6 @@ public:
void displayRecordingStatus();
#endif
void drawText(const char * ,int x,int y,int z, int size);
protected:
void CreateGLWtContext ();
virtual void CreateMainWindow (Wt::WGLWidget*,Wt::WString);
@@ -108,24 +112,26 @@ protected:
void G4MouseReleaseEvent();
void G4MouseDoubleClickEvent();
void G4MouseMoveEvent(Wt::WMouseEvent *event);
#ifdef _A_FINIR_FIXME
void G4wheelEvent (Wt::WWheelEvent * event);
#endif
// void G4wheelEvent (Wt::WWheelEvent * event);
void G4keyPressEvent (Wt::WKeyEvent * event);
void rotateWtScene(float, float);
void rotateWtCamera(float, float);
void rotateWtSceneInViewDirection(float, float);
void rotateWtCameraInViewDirection(float, float);
void rotateWtSceneToggle(float, float);
void moveScene(float, float, float,bool);
void FinishView();
#ifdef _A_FINIR_FIXME
void updateKeyModifierState(Wt::KeyboardModifiers);
#endif
inline Wt::WGLWidget* getGLWindow() {
return fWindow;
}
protected:
Wt::WGLWidget* fWindow;
Wt::WWidget* fGLWindow;
bool hasPendingEvents();
void resizeGL(int width, int height);
#ifdef _A_FINIR_FIXME
void savePPMToTemp();
#endif
@@ -202,6 +208,7 @@ private:
int fNbMaxFramesPerSec;
float fNbMaxAnglePerSec;
int fLaunchSpinDelay;
Wt::WTabWidget* fUISceneTreeComponentsTBWidget;
G4double fXRot;
G4double fYRot;
@@ -209,6 +216,8 @@ private:
bool fAltKeyPress;
bool fControlKeyPress;
bool fShiftKeyPress;
bool fBatchMode;
G4UIWt* fUiWt;
#ifdef _A_FINIR_FIXME
void rotateTheta(int);
@@ -254,6 +263,8 @@ private :
void processEncodeStdout();
// Only use for Wt>4.0
// void dialogClosed();
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 7th February 1997
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmBox.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Box container class
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmFourArrowButtons.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Four arrow buttons class. Inherits from G4OpenGLXmVWidgetComponent
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmFramedBox.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Framed box container class
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmPushButton.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Push button class. Inherits from G4OpenGLXmVWidgetComponent
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmRadioButton.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Radio button class. Inherits from G4OpenGLXmVWidgetComponent
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmResources.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Default resources file for GEANT4 OpenGL Motif windows.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmSeparator.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Separator class. Inherits from G4OpenGLXmVWidgetComponent
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmSliderBar.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Slider bar class. Inherits from G4OpenGLXmVWidgetComponent
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmTextField.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Text field class. Inherits from G4OpenGLXmVWidgetComponent
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmTopLevelShell.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Top level shell class
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmVWidgetComponent.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Base class for all Motif component widgets
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmVWidgetContainer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Base class for all Motif container widgets
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmVWidgetObject.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Virtual base class for all Motif widgets.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmVWidgetShell.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
//Base class for all Motif window widgets (shells)
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmViewer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Andrew Walkden 10th February 1997
@@ -73,8 +73,7 @@ protected:
actions_cascade,
misc_cascade,
spec_cascade,
rep_style_pullright,
drawing_style_pullright,
drawing_style_pullright,
background_color_pullright,
transparency_pullright,
antialias_pullright,
@@ -87,10 +86,8 @@ protected:
actions_str,
misc_str,
spec_str,
rep_str,
draw_str,
polyhedron_str,
nurbs_str,
wireframe_str,
hlr_str,
hsr_str,
@@ -250,11 +247,7 @@ public:
XtPointer clientData,
XtPointer callData);
static void rep_style_callback (Widget w,
XtPointer clientData,
XtPointer callData);
static void background_color_callback (Widget w,
static void background_color_callback (Widget w,
XtPointer clientData,
XtPointer callData);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenGLXmViewerMessenger.hh 66373 2012-12-18 09:41:34Z gcosmo $
#ifdef G4VIS_BUILD_OPENGLXM_DRIVER