32#ifndef G4OPENGLVIEWER_HH
33#define G4OPENGLVIEWER_HH
37#ifdef G4OPENGL_VERSION_2
63 fAttributes.push_back(att);
93 std::vector <G4String > fAttributes;
110 virtual bool exportImage(std::string name=
"",
int width=-1,
int height=-1);
113#ifdef G4OPENGL_VERSION_2
115 void setVboDrawer(G4OpenGLVboDrawer* drawer);
116 G4OpenGLVboDrawer* fVboDrawer;
118 inline bool isInitialized() {
119 return fGlViewInitialized;
147 const std::vector < G4OpenGLViewerPickMap* > &
GetPickDetails(GLdouble x, GLdouble y);
176 void g4GluPickMatrix(GLdouble x, GLdouble y, GLdouble width, GLdouble height,
180 void g4GluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
181 GLdouble centerx, GLdouble centery, GLdouble
183 GLdouble upx, GLdouble upy, GLdouble upz );
185 void g4GlOrtho (GLdouble left, GLdouble right,
186 GLdouble bottom, GLdouble top,
187 GLdouble near, GLdouble far);
190 GLdouble bottom, GLdouble top,
191 GLdouble near, GLdouble far);
222 int fGl2psDefaultLineWith;
223 int fGl2psDefaultPointSize;
224 bool fGlViewInitialized;
230 G4int getRealExportWidth();
231 G4int getRealExportHeight();
232 GLubyte* grabPixels (
int inColor,
234 unsigned int height);
235 bool printNonVectoredEPS ();
238 bool printVectoredEPS();
241 bool fIsGettingPickInfos;
244#ifdef G4OPENGL_VERSION_2
246 inline GLuint getShaderProgram() {
247 return fShaderProgram;
249 inline GLuint getShaderProjectionMatrix() {
250 return fpMatrixUniform;
252 inline GLuint getShaderTransformMatrix() {
253 return ftMatrixUniform;
255 inline GLuint getShaderViewModelMatrix() {
256 return fmvMatrixUniform;
265 GLuint fShaderProgram;
268 GLuint fVertexPositionAttribute;
269 GLuint fVertexNormalAttribute;
270 GLuint fpMatrixUniform;
271 GLuint fcMatrixUniform;
272 GLuint fmvMatrixUniform;
273 GLuint fnMatrixUniform;
274 GLuint ftMatrixUniform;
void setSubHitNumber(G4int n)
std::vector< G4String > getAttributes()
void setHitNumber(G4int n)
void addAttributes(G4String att)
void setPickName(G4int n)
void g4GluPickMatrix(GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4])
void g4GlFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
std::vector< std::string > fExportImageFormatVector
void g4GluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz)
void rotateSceneToggle(G4double dx, G4double dy)
virtual void CreateFontLists()
bool setExportImageFormat(std::string format, bool quiet=false)
unsigned int getWinHeight() const
std::string fExportImageFormat
void ClearViewWithoutFlush()
void ResizeWindow(unsigned int, unsigned int)
unsigned int getWinWidth() const
std::string fDefaultExportImageFormat
bool setExportFilename(G4String name, G4bool inc=true)
void addExportImageFormat(std::string format)
G4bool antialiasing_enabled
void ChangeLineWidth(G4double width)
virtual void DrawText(const G4Text &)
GLdouble getSceneFarWidth()
void setExportSize(G4int, G4int)
virtual G4String Pick(GLdouble x, GLdouble y)
void rotateScene(G4double dx, G4double dy)
void ChangePointSize(G4double size)
G4bool isFramebufferReady()
G4bool transparency_enabled
virtual bool exportImage(std::string name="", int width=-1, int height=-1)
void g4GlOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
G4OpenGLSceneHandler & fOpenGLSceneHandler
virtual ~G4OpenGLViewer()
friend class G4OpenGLFileSceneHandler
std::string getRealPrintFilename()
GLdouble getSceneNearWidth()
const std::vector< G4OpenGLViewerPickMap * > & GetPickDetails(GLdouble x, GLdouble y)