- Timestamp:
- Aug 14, 2007, 12:27:44 PM (17 years ago)
- Location:
- trunk/geant4
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/N03/G4History.macro
r487 r561 5 5 /vis/sceneHandler/attach 6 6 /vis/viewer/create ! ! 600 7 /vis/open OGLI X8 /vis/sceneHandler/create OGLI X7 /vis/open OGLIQT 8 /vis/sceneHandler/create OGLIQT 9 9 /vis/sceneHandler/attach 10 10 /vis/viewer/create ! ! 600 -
trunk/geant4/N03/exampleN03.cc
r484 r561 113 113 visManager->Initialize(); 114 114 #endif 115 115 116 116 // Set user action classes 117 117 // -
trunk/geant4/N03/vis.mac
r483 r561 21 21 # 22 22 # Use this open statement instead for OpenGL in immediate mode. 23 /vis/open OGLIX 23 /vis/open OGLSQT 24 #/vis/open OGLIX 24 25 # 25 26 # Use this open statement instead to get a HepRep version 1 file -
trunk/geant4/N03/visTutor/exN03Vis12.mac
r483 r561 1 1 ####################################################################### 2 # MACRO FILE NAME: exN03Vis12.mac #2 # MACRO FILE NAME: exN03Vis12.mac # 3 3 # # 4 # AUTHOR(S): John Allison#4 # AUTHOR(S): Laurent Garnier # 5 5 # # 6 # DATE: 16th August 2006#6 # DATE: July 01, 2007 # 7 7 # # 8 # CONTENTS: A basic macro for demonstrating time slicing#8 # CONTENTS: A basic macro for demonstrating Inventor driver # 9 9 # # 10 # USAGE: % $G4BINDIR/exampleN03 visTutor/exN03Vis12.mac 10 # USAGE: % $G4BINDIR/exampleN03 visTutor/exN03Vis12.mac # 11 11 # # 12 # REQUIRED PLATFORMS & SOFTWARES: Mac/Unix with X-Windows, OpenGL # 12 # REQUIRED PLATFORMS & SOFTWARES: Unix, Motif, X-window, OpenGL,Qt # 13 # HEPVis # 14 # Inventor (TGS or SoFree) # 13 15 # # 16 # ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: # 17 # (See geant4/source/visualization/README for details.) # 18 # # 19 # % setenv G4VIS_BUILD_OIX_DRIVER 1 # 20 # # 21 # ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: # 22 # (See geant4/source/visualization/README for details.) # 23 # # 24 # % setenv G4VIS_USE_OIQT 1 # 25 # # 14 26 # ADDITIONAL NOTES: # 15 27 # # 16 28 ####################################################################### 17 29 30 # Create "scene-0" 31 /vis/scene/create 32 33 # Invoke the OpenInventor driver 34 /vis/sceneHandler/create OGLIQT 35 /vis/viewer/create 36 37 # Add the world volume to the current scene 38 /vis/scene/add/volume 39 #/vis/scene/add/volume Layer 40 # Name of the absorbers = name of their material (Lead) ! 41 #/vis/scene/add/volume Lead 42 # Name of the gaps = name of their material (liquidArgon) ! 43 #/vis/scene/add/volume liquidArgon 44 #/vis/scene/add/trajectories 45 /tracking/storeTrajectory 1 46 47 # Bird-eye view of events 48 /vis/viewer/reset 49 /vis/viewer/set/viewpointThetaPhi 45 45 50 51 /vis/scene/notifyHandlers 52 18 53 /control/verbose 2 19 /vis/verbose confirmations 54 ####################################################################### 55 # Controls on an Inventor examiner viewer are : # 56 # - in picking mode (cursor is the upper left arrow) # 57 # Ctrl + pick a volume : see daughters. # 58 # Shift + pick a volume : see mother. # 59 # - in viewing mode (cursor is the hand) # 60 # Left-button + pointer move : rotate. # 61 # Ctrl+Left-button + pointer move : pane. # 62 # Ctrl+Shift+Left-button + pointer move : scale. # 63 # Middle-button + pointer move : pane. # 64 # # 65 ####################################################################### 20 66 21 /vis/open OGLSX 22 /vis/drawVolume 23 /vis/scene/add/eventID 24 /vis/scene/add/trajectories rich 67 /vis/viewer/update 25 68 26 # Set up drawByCharge with time slicing 27 /vis/modeling/trajectories/create/drawByCharge 28 /vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true 29 /vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 5 30 /vis/modeling/trajectories/drawByCharge-0/default/setDrawAuxPts true 31 /vis/modeling/trajectories/drawByCharge-0/default/setAuxPtsSize 5 32 /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.001 ns 33 /vis/modeling/trajectories/list 34 #/N03/det/setField 5 T 35 #/N03/det/update 36 /run/beamOn 69 /run/beamOn 1 37 70 38 # Configure OpenGL for display-by-time39 /vis/ogl/set/fade 140 /vis/ogl/set/displayHeadTime true41 /control/alias timeRange 0.142 /vis/verbose warnings43 /control/verbose 044 /control/loop visTutor/exN03Vis12.loop startTime -{timeRange} 0.7 0.00545 /control/verbose 246 /vis/verbose confirmations47 /vis/ogl/set/displayHeadTime false48 49 # Set up drawByParticleID with time slicing50 /vis/modeling/trajectories/create/drawByParticleID51 /vis/modeling/trajectories/drawByParticleID-0/set e- red52 /vis/modeling/trajectories/drawByParticleID-0/set e+ blue53 /vis/modeling/trajectories/drawByParticleID-0/set pi- cyan54 /vis/modeling/trajectories/drawByParticleID-0/set pi+ magenta55 #/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true56 /vis/modeling/trajectories/drawByParticleID-0/default/setStepPtsSize 557 #/vis/modeling/trajectories/drawByParticleID-0/default/setDrawAuxPts true58 /vis/modeling/trajectories/drawByParticleID-0/default/setAuxPtsSize 559 /vis/modeling/trajectories/drawByParticleID-0/default/setTimeSliceInterval 0.001 ns60 /vis/modeling/trajectories/list61 62 # Remove gammas63 /vis/filtering/trajectories/create/particleFilter64 /vis/filtering/trajectories/particleFilter-0/add gamma65 /vis/filtering/trajectories/particleFilter-0/invert true66 67 /gun/energy 1 GeV68 /run/beamOn69 /control/alias timeRange 0.170 /vis/ogl/set/displayHeadTime true71 /vis/ogl/set/displayLightFront true -90 0 0 mm72 /vis/verbose warnings73 /control/verbose 074 /control/loop visTutor/exN03Vis12.loop startTime -{timeRange} 0.7 0.00175 /control/verbose 276 /vis/verbose confirmations77 /vis/ogl/set/displayLightFront false78 /vis/ogl/set/displayHeadTime false79 80 # To see pi -> mu -> e decay.81 /gun/particle pi+82 /vis/filtering/trajectories/particleFilter-0/add anti_nu_mu83 /vis/filtering/trajectories/particleFilter-0/add nu_mu84 /vis/filtering/trajectories/particleFilter-0/add anti_nu_e85 /vis/filtering/trajectories/particleFilter-0/add nu_e86 # Accumulate several events for effect87 # /vis/scene/endOfEventAction accumulate88 /gun/energy 100 MeV89 #/vis/viewer/set/globalLineWidthScale 290 /run/beamOn91 /control/alias timeRange 100092 /vis/ogl/set/displayHeadTime true93 /vis/verbose warnings94 /control/verbose 095 /control/loop visTutor/exN03Vis12.loop startTime -{timeRange} 3000 596 /control/verbose 297 /vis/verbose confirmations -
trunk/geant4/N03/visTutor/gui.mac
r474 r561 33 33 /gui/addButton vis Vis3(OGLSX) "/control/execute visTutor/exN03Vis3.mac" 34 34 /gui/addButton vis Vis4(OGLIX) "/control/execute visTutor/exN03Vis4.mac" 35 /gui/addButton vis Vis12(OGLIQT) "/control/execute visTutor/exN03Vis12.mac" 36 /gui/addButton vis Vis14(OGLSQT) "/control/execute visTutor/exN03Vis14.mac" 35 37 /gui/addButton vis Vis5(OIX) "/control/execute visTutor/exN03Vis5.mac" 36 38 /gui/addButton vis Vis6(VRML2FILE) "/control/execute visTutor/exN03Vis6.mac" -
trunk/geant4/OpenGLQT_exemple/cmt/requirements
r548 r561 7 7 8 8 #document moc moc_glwidget FROM=../src/glwidget.h TO=../src/moc_glwidget.cpp 9 #document moc moc_window FROM=../src/window.h TO=../src/window.cpp9 document moc moc_window FROM=../src/window.h TO=../src/moc_window.cpp 10 10 11 11 #application glwidget moc_window.cpp moc_glwidget.cpp window.cpp glwidget.cpp main.cpp 12 application glwidget window.cpp glwidget.cpp main.cpp 12 application glwidget moc_window.cpp window.cpp glwidget.cpp main.cpp 13 14 # DEBUG : 15 macro_append cflags " -W -Wall -g" WIN32 "-W /ZI /Od" 16 macro_append cppflags " -W -Wall -g" WIN32 " /ZI /Od" 17 macro_append cpplinkflags " -W -Wall -g" WIN32 "/DEBUG /VERBOSE:LIB" -
trunk/geant4/OpenGLQT_exemple/src/glwidget.cpp
r549 r561 7 7 8 8 GLWidget::GLWidget(QWidget *parent) 9 : QGLWidget( parent)9 : QGLWidget() 10 10 { 11 11 printf("GLWidget::GLWidget \n"); … … 20 20 } 21 21 22 void GLWidget::initialize() { 23 printf("GLWidget::Initialise \n"); 24 } 25 22 26 GLWidget::~GLWidget() 23 27 { … … 28 32 } 29 33 30 QSize GLWidget::minimumSizeHint() const 31 { 32 printf("GLWidget::minimumSizeHint \n"); 33 return QSize(50, 50); 34 } 35 36 QSize GLWidget::sizeHint() const 37 { 38 printf("GLWidget::SizeHint \n"); 39 return QSize(400, 400); 40 } 41 42 // void GLWidget::setXRotation(int angle) 34 // QSize GLWidget::minimumSizeHint() const 43 35 // { 44 // normalizeAngle(&angle); 45 // if (angle != xRot) { 46 // xRot = angle; 47 // emit xRotationChanged(angle); 48 // updateGL(); 49 // } 36 // printf("GLWidget::minimumSizeHint \n"); 37 // return QSize(50, 50); 50 38 // } 51 39 52 // void GLWidget::setYRotation(int angle)40 // QSize GLWidget::sizeHint() const 53 41 // { 54 // normalizeAngle(&angle); 55 // if (angle != yRot) { 56 // yRot = angle; 57 // emit yRotationChanged(angle); 58 // updateGL(); 59 // } 42 // printf("GLWidget::SizeHint \n"); 43 // return QSize(400, 400); 60 44 // } 61 45 62 // void GLWidget::setZRotation(int angle) 63 // { 64 // normalizeAngle(&angle); 65 // if (angle != zRot) { 66 // zRot = angle; 67 // emit zRotationChanged(angle); 68 // updateGL(); 69 // } 70 // } 46 void GLWidget::setXRotation(int angle) 47 { 48 normalizeAngle(&angle); 49 if (angle != xRot) { 50 xRot = angle; 51 // emit xRotationChanged(angle); 52 updateGL(); 53 } 54 } 55 56 void GLWidget::setYRotation(int angle) 57 { 58 normalizeAngle(&angle); 59 if (angle != yRot) { 60 yRot = angle; 61 // emit yRotationChanged(angle); 62 updateGL(); 63 } 64 } 65 66 void GLWidget::setZRotation(int angle) 67 { 68 normalizeAngle(&angle); 69 if (angle != zRot) { 70 zRot = angle; 71 // emit zRotationChanged(angle); 72 updateGL(); 73 } 74 } 71 75 72 76 void GLWidget::initializeGL() … … 87 91 glLoadIdentity(); 88 92 glTranslated(0.0, 0.0, -10.0); 89 glRotated(xRot / 16 .0, 1.0, 0.0, 0.0);90 glRotated(yRot / 16 .0, 0.0, 1.0, 0.0);91 glRotated(zRot / 16 .0, 0.0, 0.0, 1.0);93 glRotated(xRot / 16, 1.0, 0.0, 0.0); 94 glRotated(yRot / 16, 0.0, 1.0, 0.0); 95 glRotated(zRot / 16, 0.0, 0.0, 1.0); 92 96 glCallList(object); 93 97 printf("GLWidget::paintGL END\n"); … … 102 106 glMatrixMode(GL_PROJECTION); 103 107 glLoadIdentity(); 104 glOrtho(- 0.5, +0.5, +0.5, -0.5, 4.0, 15.0);108 glOrtho(-1., +1., -1., +1., -10., 15.0); 105 109 glMatrixMode(GL_MODELVIEW); 106 110 printf("GLWidget::resizeGL END\n"); 107 111 } 108 112 109 // void GLWidget::mousePressEvent(QMouseEvent *event) 110 // { 111 // lastPos = event->pos(); 112 // } 113 114 // void GLWidget::mouseMoveEvent(QMouseEvent *event) 115 // { 116 // int dx = event->x() - lastPos.x(); 117 // int dy = event->y() - lastPos.y(); 118 119 // if (event->buttons() & Qt::LeftButton) { 120 // setXRotation(xRot + 8 * dy); 121 // setYRotation(yRot + 8 * dx); 122 // } else if (event->buttons() & Qt::RightButton) { 123 // setXRotation(xRot + 8 * dy); 124 // setZRotation(zRot + 8 * dx); 125 // } 126 // lastPos = event->pos(); 127 // } 113 void GLWidget::mousePressEvent(QMouseEvent *event) 114 { 115 printf("GLWidget::mousePress \n"); 116 lastPos = event->pos(); 117 printf("GLWidget::mousePress END\n"); 118 } 119 120 void GLWidget::mouseMoveEvent(QMouseEvent *event) 121 { 122 printf("GLWidget::mouseEvent \n"); 123 int dx = event->x() - lastPos.x(); 124 int dy = event->y() - lastPos.y(); 125 126 if (event->buttons() & Qt::LeftButton) { 127 printf("GLWidget::mouseEvent Left 1\n"); 128 setXRotation(xRot + 8 * dy); 129 printf("GLWidget::mouseEvent Left 2\n"); 130 setYRotation(yRot + 8 * dx); 131 printf("GLWidget::mouseEvent Left 3\n"); 132 } else if (event->buttons() & Qt::RightButton) { 133 printf("GLWidget::mouseEvent Right 1\n"); 134 setXRotation(xRot + 8 * dy); 135 printf("GLWidget::mouseEvent Right 2\n"); 136 setZRotation(zRot + 8 * dx); 137 printf("GLWidget::mouseEvent Right 3\n"); 138 } 139 lastPos = event->pos(); 140 printf("GLWidget::mouseEvent END\n"); 141 } 128 142 129 143 GLuint GLWidget::makeObject() -
trunk/geant4/OpenGLQT_exemple/src/glwidget.h
r548 r561 11 11 GLWidget(QWidget *parent = 0); 12 12 ~GLWidget(); 13 void initializeGL(); 14 void initialize(); 15 void resizeGL(int width, int height); 16 void paintGL(); 13 17 14 QSize minimumSizeHint() const; 15 QSize sizeHint() const; 18 /* QSize minimumSizeHint() const; */ 19 /* QSize sizeHint() const; */ 16 20 17 /* public slots: */ 18 /* void setXRotation(int angle); */ 19 /* void setYRotation(int angle); */ 20 /* void setZRotation(int angle); */ 21 protected: 22 void setXRotation(int angle); 23 void setYRotation(int angle); 24 void setZRotation(int angle); 21 25 22 26 /* signals: */ … … 25 29 /* void zRotationChanged(int angle); */ 26 30 27 protected: 28 void initializeGL(); 29 void paintGL(); 30 void resizeGL(int width, int height); 31 /* void mousePressEvent(QMouseEvent *event); */ 32 /* void mouseMoveEvent(QMouseEvent *event); */ 31 void mousePressEvent(QMouseEvent*); 32 void mouseMoveEvent(QMouseEvent*); 33 void normalizeAngle(int *angle); 33 34 34 35 private: … … 37 38 GLdouble x3, GLdouble y3, GLdouble x4, GLdouble y4); 38 39 void extrude(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); 39 void normalizeAngle(int *angle);40 40 41 41 GLuint object; … … 43 43 int yRot; 44 44 int zRot; 45 float reelXRot; 46 float realYRot; 47 float realZRot; 45 48 QPoint lastPos; 46 49 QColor trolltechGreen; -
trunk/geant4/OpenGLQT_exemple/src/window.cpp
r549 r561 4 4 #include "window.h" 5 5 6 Window::Window()6 Window::Window(): QDialog(0,Qt::Dialog) 7 7 { 8 8 printf("Window::Window 1\n"); … … 22 22 23 23 QHBoxLayout *mainLayout = new QHBoxLayout; 24 24 25 mainLayout->addWidget(glWidget); 25 26 printf("Window::Window 3\n"); … … 51 52 // return slider; 52 53 // } 54 55 void Window::mousePressEvent(QMouseEvent *event) 56 { 57 printf("Window::mousePressEvent \n"); 58 } 59 60 void Window::mouseReleaseEvent(QMouseEvent *event) 61 { 62 printf("Window::mouseReleaseEvent \n"); 63 } 64 65 void Window::mouseMoveEvent(QMouseEvent *event) 66 { 67 printf("Window::mouseMoveEvent \n"); 68 // int dx = event->x() - lastPos.x(); 69 // int dy = event->y() - lastPos.y(); 70 71 // if (event->buttons() & Qt::LeftButton) { 72 // } else if (event->buttons() & Qt::RightButton) { 73 // } 74 } -
trunk/geant4/OpenGLQT_exemple/src/window.h
r548 r561 3 3 4 4 #include <QWidget> 5 #include <QMenuBar> 6 #include <QDialog> 5 7 6 8 class QSlider; 7 9 class GLWidget; 8 10 9 class Window : public Q Widget11 class Window : public QDialog 10 12 { 11 /* Q_OBJECT */ 13 Q_OBJECT 12 14 13 15 public: … … 15 17 16 18 private: 19 void mousePressEvent(QMouseEvent*); 20 void mouseReleaseEvent(QMouseEvent*); 21 void mouseMoveEvent(QMouseEvent*); 17 22 /* QSlider *createSlider(); */ 18 23 19 GLWidget *glWidget; 24 GLWidget *glWidget; 25 QMenuBar *menuBar; 26 20 27 /* QSlider *xSlider; */ 21 28 /* QSlider *ySlider; */ -
trunk/geant4/config/G4UI_BUILD.gmk
r502 r561 5 5 # Include this *after* architecture.gmk 6 6 # Include this *before* interactivity.gmk 7 8 7 9 8 ifndef G4UI_NONE -
trunk/geant4/specific-geant4.8.2.sh
r486 r561 41 41 export G4VIS_USE_OPENGLXM=1 42 42 export G4VIS_USE_OPENGLX=1 43 unset G4VIS_BUILD_OPENGLXM_DRIVER 44 unset G4VIS_BUILD_OPENGLX_DRIVER 45 unset G4VIS_USE_OPENGLXM 46 unset G4VIS_USE_OPENGLX 47 48 export G4VIS_BUILD_OPENGLQT_DRIVER=1 49 export G4VIS_USE_OPENGLQT=1 43 50 #////////////////////////////////////////////////////////// 44 51 # Inventor : -
trunk/geant4/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh
r559 r561 41 41 #include "G4OpenGLQtViewer.hh" 42 42 #include <QGLWidget> 43 #include <QPaintEvent>44 43 45 44 #include "globals.hh" … … 57 56 void initializeGL (); 58 57 void DrawView (); 59 void DrawView2 ();60 58 void FinishView (); 61 59 void resizeGL(int width,int height); 62 60 void paintGL(); 63 void paintEvent(QPaintEvent*); 61 void updateQWidget(); 62 64 63 private : 65 64 int readyToPaint; -
trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r541 r561 42 42 #include "G4OpenGLSceneHandler.hh" 43 43 44 #include <QObject> 44 45 #include <QGLWidget> 45 46 #include <QDialog> 47 #include <QContextMenuEvent> 48 #include <QMenu> 49 #include <QPoint> 46 50 47 51 class G4OpenGLSceneHandler; 48 52 49 class G4OpenGLQtViewer: virtual public G4OpenGLViewer { 53 class G4OpenGLQtViewer: public QObject, virtual public G4OpenGLViewer { 54 55 Q_OBJECT 50 56 51 57 public: … … 54 60 void SetView (); 55 61 void ShowView (); 62 virtual void DrawView()=0; 63 virtual void updateQWidget()=0; 64 56 65 protected: 57 // void GetQtConnection ();58 66 void CreateGLQtContext (); 59 virtual void CreateMainWindow (); 60 void CreateMainWindow (QGLWidget*); 67 virtual void CreateMainWindow (QGLWidget*); 68 void manageContextMenuEvent(QContextMenuEvent *e); 69 void G4MousePressEvent(QPoint); 70 void G4MouseMoveEvent(int, int, Qt::MouseButtons); 71 void setXRotation(int angle); 72 void setYRotation(int angle); 73 void setZRotation(int angle); 74 void normalizeAngle(int *angle); 75 float getXRot(); 76 float getYRot(); 77 float getZRot(); 78 61 79 protected: 62 80 G4int WinSize_x; … … 64 82 QGLWidget* fWindow; 65 83 QDialog* GLWindow; 84 66 85 private: 67 // static LRESULT CALLBACK WindowProc(HWND,UINT,WPARAM,LPARAM); 68 // static bool SetWindowPixelFormat(HDC); 69 private: 70 // HGLRC fHGLRC; 86 void createPopupMenu(); 87 void createRadioAction(QAction *,QAction *, const std::string&,unsigned int a=1); 88 QMenu *fContextMenu; 89 bool fMouseAction; // 1: rotate 0:move 90 QPoint lastPos; 91 float xRot; 92 float yRot; 93 float zRot; 94 QAction *fDrawingWireframe; 95 QAction *fDrawingLineRemoval; 96 QAction *fDrawingSurfaceRemoval; 97 QAction *fDrawingLineSurfaceRemoval; 98 99 private slots : 100 void actionDrawingWireframe(); 101 void actionDrawingLineRemoval(); 102 void actionDrawingSurfaceRemoval(); 103 void actionDrawingLineSurfaceRemoval(); 104 void toggleDrawingAction(int); 105 void toggleMouseAction(bool); 106 void toggleRepresentation(bool); 107 void toggleBackground(bool); 108 void toggleTransparency(bool); 109 void toggleAntialiasing(bool); 110 void toggleHaloing(bool); 111 void toggleAux(bool); 112 void toggleFullScreen(bool); 71 113 }; 72 114 -
trunk/geant4/visualization/OpenGL/include/G4OpenGLStoredQt.hh
r533 r561 25 25 // 26 26 // 27 // $Id: G4OpenGLStoredQt.hh,v 1.7 2007/06/25 21:1 8:04 $27 // $Id: G4OpenGLStoredQt.hh,v 1.7 2007/06/25 21:17:44 $ 28 28 // GEANT4 tag $Name: geant4-08-01-patch-01 $ 29 29 // -
trunk/geant4/visualization/OpenGL/include/G4OpenGLStoredQtViewer.hh
r533 r561 25 25 // 26 26 // 27 // $Id: G4OpenGLStoredQtViewer.hh,v 1. 7 2007/06/25 21:18:06 $27 // $Id: G4OpenGLStoredQtViewer.hh,v 1.9 2007/06/25 21:17:46 $ 28 28 // GEANT4 tag $Name: geant4-08-01-patch-01 $ 29 29 // … … 34 34 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER 35 35 36 #ifndef G4O PENGLSTOREDQTVIEWER_HH37 #define G4O PENGLSTOREDQTVIEWER_HH36 #ifndef G4OpenGLSTOREDQTVIEWER_HH 37 #define G4OpenGLSTOREDQTVIEWER_HH 38 38 39 39 #include "G4VViewer.hh" 40 40 #include "G4OpenGLStoredViewer.hh" 41 41 #include "G4OpenGLQtViewer.hh" 42 #include <QGLWidget> 43 #include <QApplication> 44 #include <QMouseEvent> 45 #include <QContextMenuEvent> 42 46 43 47 class G4OpenGLStoredSceneHandler; 44 48 45 49 class G4OpenGLStoredQtViewer: 46 public G4OpenGLQtViewer, public G4OpenGLStoredViewer{50 public G4OpenGLQtViewer, public G4OpenGLStoredViewer, public QGLWidget { 47 51 48 52 public: 49 53 G4OpenGLStoredQtViewer (G4OpenGLStoredSceneHandler& scene, 50 const G4String& name = ""); 54 const G4String& name = ""); 55 ~G4OpenGLStoredQtViewer (); 51 56 void Initialise (); 57 void initializeGL (); 52 58 void DrawView (); 53 59 void FinishView (); 60 void resizeGL(int width,int height); 61 void paintGL(); 62 void updateQWidget(); 63 64 protected: 65 void mousePressEvent(QMouseEvent *event); 66 void mouseMoveEvent(QMouseEvent *event); 67 void contextMenuEvent(QContextMenuEvent *e); 68 69 private : 70 bool hasToRepaint; 71 bool readyToPaint; 72 int nbPaint; 54 73 }; 55 74 … … 57 76 58 77 #endif 59 -
trunk/geant4/visualization/management/include/G4VisExecutive.icc
r537 r561 105 105 RegisterGraphicsSystem (new G4VRML1File); 106 106 RegisterGraphicsSystem (new G4VRML2File); 107 107 108 // Graphics systems needing external packages or libraries... 108 109 -
trunk/geant4/visualization/management/src/G4VSceneHandler.cc
r542 r561 566 566 if (events) nKeptEvents = events->size(); 567 567 if (runManager) { 568 printf("G4VSceneHandler::ProcessScene 4 : run manager OK\n"); 568 569 if (fpScene->GetRefreshAtEndOfEvent()) { 569 570 printf("G4VSceneHandler::ProcessScene 4 : fpScene->GetRefreshAtEndOfEvent()\n"); 571 //if (verbosity >= G4VisManager::confirmations) {572 //G4cout << "Refreshing event..." << G4endl;573 //}574 //const G4Event* event = 0;575 //if (events && events->size()) event = events->back();576 //if (event) DrawEvent(event);577 578 //} else { // Accumulating events.579 //printf("G4VSceneHandler::ProcessScene 7\n");580 581 //if (verbosity >= G4VisManager::confirmations) {582 //G4cout << "Refreshing events in run..." << G4endl;583 //}584 //for (size_t i = 0; i < nKeptEvents; ++i) {585 //const G4Event* event = (*events)[i];586 //if (event) DrawEvent(event);587 //}588 589 //if (!fpScene->GetRefreshAtEndOfRun()) {590 //if (verbosity >= G4VisManager::warnings) {591 //G4cout <<592 //"WARNING: Cannot refresh events accumulated over more"593 //"\n than one runs. Refreshed just the last run..."594 //<< G4endl;595 //}596 //}570 printf("G4VSceneHandler::ProcessScene 5 : fpScene->GetRefreshAtEndOfEvent()\n"); 571 572 if (verbosity >= G4VisManager::confirmations) { 573 G4cout << "Refreshing event..." << G4endl; 574 } 575 const G4Event* event = 0; 576 if (events && events->size()) event = events->back(); 577 if (event) DrawEvent(event); 578 579 } else { // Accumulating events. 580 printf("G4VSceneHandler::ProcessScene 7\n"); 581 582 if (verbosity >= G4VisManager::confirmations) { 583 G4cout << "Refreshing events in run..." << G4endl; 584 } 585 for (size_t i = 0; i < nKeptEvents; ++i) { 586 const G4Event* event = (*events)[i]; 587 if (event) DrawEvent(event); 588 } 589 590 if (!fpScene->GetRefreshAtEndOfRun()) { 591 if (verbosity >= G4VisManager::warnings) { 592 G4cout << 593 "WARNING: Cannot refresh events accumulated over more" 594 "\n than one runs. Refreshed just the last run..." 595 << G4endl; 596 } 597 } 597 598 } 598 599 } … … 607 608 void G4VSceneHandler::DrawEvent(const G4Event* event) 608 609 { 610 printf("G4VSceneHandler::DrawEvent \n"); 609 611 const std::vector<G4VModel*>& EOEModelList = 610 612 fpScene -> GetEndOfEventModelList (); -
trunk/geant4/visualization/management/src/G4VisStateDependent.cc
r531 r561 46 46 } 47 47 else if (previousState == G4State_EventProc && requestedState == G4State_GeomClosed) { 48 printf("G4VisStateDependent::EndOfEvent \n"); 48 49 fpVisManager -> EndOfEvent (); 49 50 }
Note: See TracChangeset
for help on using the changeset viewer.