Geant4_10
G4OpenGLImmediateWtViewer.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4OpenGLImmediateWtViewer.hh 75567 2013-11-04 11:35:11Z gcosmo $
28 //
29 //
30 // Class G4OpenGLImmediateWtViewer : a class derived from
31 // G4OpenGLWtViewer and G4OpenGLImmediateViewer.
32 
33 #ifdef G4VIS_BUILD_OPENGLWT_DRIVER
34 
35 #ifndef G4OPENGLIMMEDIATEWTVIEWER_HH
36 #define G4OPENGLIMMEDIATEWTVIEWER_HH
37 
39 #include "G4OpenGLWtViewer.hh"
40 #include <Wt/WEvent>
41 
42 #include "globals.hh"
43 
44 class G4OpenGLImmediateSceneHandler;
45 
46 class G4OpenGLImmediateWtViewer :
47 public G4OpenGLWtViewer, public G4OpenGLImmediateViewer, public Wt::WGLWidget {
48 
49 public:
50  G4OpenGLImmediateWtViewer (G4OpenGLImmediateSceneHandler& scene, Wt::WContainerWidget*, const G4String& name = "");
51  ~G4OpenGLImmediateWtViewer ();
52  void Initialise ();
53  void resizeGL(int, int);
54  void paintGL();
55  void initializeGL ();
56  void DrawView();
57  void ShowView();
58  void SetView();
59  //
60  void popMatrix();
61  void pushMatrix();
62  void multMatrixd(const GLdouble*);
63  void setMatrixUniforms();
64  void loadIdentity();
65 
66  void wtDrawArrays(GLenum mode,int first, G4int nPoints, std::vector<double> a_vertices);
67 
68  void ComputeView ();
69  void drawScene ();
70  void FinishView();
71 
72 private:
73  // void showEvent(QShowEvent event );
74  void mousePressEvent(Wt::WMouseEvent *event);
75  void mouseMoveEvent(Wt::WMouseEvent *event);
76  void mouseDoubleClickEvent(Wt::WMouseEvent *event);
77  void mouseReleaseEvent(Wt::WMouseEvent event);
78  // void WtContextMenuEvent(QContextMenuEvent e);
79  void keyPressEvent (Wt::WKeyEvent *event);
80  void paintEvent(Wt::WPaintDevice * event);
81 
82  void updateWWidget();
83 
84  // A client-side JavaScript matrix variable
85  JavaScriptMatrix4x4 jsMatrix_;
86 
87  // The so-called VBOs, Vertex Buffer Objects
88  // This one contains both vertex (xyz) and normal (xyz) data
89  Buffer objBuffer_;
90  // void ComputeView ();
91  // implements G4VViewer::SetView() and ClearView()
92  // void SetView ();
93  // void ClearView ();
94 
95 
96 
97  // To avoid copying large constant data around, the data points are stored
98  // in a global variable.
99  std::vector<double> data;
100  std::vector <Buffer> VBO_Buffer;
101 
102 };
103 
104 #endif
105 
106 #endif
const XML_Char * name
Definition: expat.h:151
int G4int
Definition: G4Types.hh:78
G4int first
const XML_Char const XML_Char * data
Definition: expat.h:268