1 #ifndef SOQT_GLWIDGET_H
2 #define SOQT_GLWIDGET_H
29 #include <Inventor/SbBasic.h>
30 #include <Inventor/Qt/SoQtBasic.h>
31 #include <Inventor/Qt/SoQtComponent.h>
35 #endif // __COIN_SOQT__
48 #define COIN_DEFINED_BOOL
51 #define INT32 tempint32
52 #define COIN_DEFINED_INT32
59 #ifdef COIN_DEFINED_BOOL
61 #undef COIN_DEFINED_BOOL
63 #ifdef COIN_DEFINED_INT32
65 #undef COIN_DEFINED_INT32
67 #endif // __COIN_SOXT__
70 #endif // __COIN_SOGTK__
75 SO_GL_RGB = 0x01, SO_GLX_RGB = SO_GL_RGB,
76 SO_GL_DOUBLE = 0x02, SO_GLX_DOUBLE = SO_GL_DOUBLE,
77 SO_GL_ZBUFFER = 0x04, SO_GLX_ZBUFFER = SO_GL_ZBUFFER,
78 SO_GL_OVERLAY = 0x08, SO_GLX_OVERLAY = SO_GL_OVERLAY,
79 SO_GL_STEREO = 0x10, SO_GLX_STEREO = SO_GL_STEREO
89 void setBorder(
const SbBool enable);
90 SbBool isBorder(
void)
const;
92 virtual void setDoubleBuffer(
const SbBool enable);
93 SbBool isDoubleBuffer(
void)
const;
95 void setDrawToFrontBufferEnable(
const SbBool enable);
96 SbBool isDrawToFrontBufferEnable(
void)
const;
98 void setQuadBufferStereo(
const SbBool enable);
99 SbBool isQuadBufferStereo(
void)
const;
101 void setAccumulationBuffer(
const SbBool enable);
102 SbBool getAccumulationBuffer(
void)
const;
104 void setStencilBuffer(
const SbBool enable);
105 SbBool getStencilBuffer(
void)
const;
107 void setAlphaChannel(
const SbBool enable);
108 SbBool getAlphaChannel(
void)
const;
110 void setOverlayRender(
const SbBool onoff);
111 SbBool isOverlayRender(
void)
const;
113 void setSampleBuffers(
const int numsamples);
114 int getSampleBuffers(
void)
const;
116 void setStealFocus(SbBool enable);
117 SbBool isStealFocus(
void)
const;
119 QWidget * getGLWidget(
void)
const;
120 QWidget * getNormalWidget(
void)
const;
121 QWidget * getOverlayWidget(
void)
const;
123 SbBool hasOverlayGLArea(
void)
const;
124 SbBool hasNormalGLArea(
void)
const;
126 unsigned long getOverlayTransparentPixel(
void);
129 void getPointSizeLimits(SbVec2f & range,
float & granularity);
130 void getLineWidthLimits(SbVec2f & range,
float & granularity);
134 const char *
const name = NULL,
135 const SbBool embed = TRUE,
136 const int glmodes = SO_GL_RGB,
137 const SbBool build = TRUE);
140 virtual void processEvent(QEvent * event);
142 QWidget * buildWidget(QWidget * parent);
144 virtual void redraw(
void) = 0;
145 virtual void redrawOverlay(
void);
147 virtual void initGraphic(
void);
148 virtual void initOverlayGraphic(
void);
151 virtual void widgetChanged(QWidget * w);
153 void setGLSize(
const SbVec2s size);
154 SbVec2s getGLSize(
void)
const;
155 float getGLAspectRatio(
void)
const;
158 void setGlxSize(
const SbVec2s size) { this->setGLSize(size); }
162 void setStereoBuffer(SbBool flag);
163 SbBool isStereoBuffer(
void)
const;
165 SbBool isRGBMode(
void);
170 void glLockNormal(
void);
171 void glUnlockNormal(
void);
173 void glLockOverlay(
void);
174 void glUnlockOverlay(
void);
176 void glSwapBuffers(
void);
177 void glFlushBuffer(
void);
179 virtual SbBool glScheduleRedraw(
void);
182 class SoQtGLWidgetP * pimpl;
183 friend class SoGuiGLWidgetP;
184 friend class SoQtGLWidgetP;
190 GLXContext getNormalContext(
void);
191 GLXContext getOverlayContext(
void);
193 Window getNormalWindow(
void);
194 Window getOverlayWindow(
void);
196 int getOverlayColorMapSize(
void);
197 int getColorMapSize(
void);
199 virtual void setNormalVisual(XVisualInfo * visual);
200 XVisualInfo * getNormalVisual(
void);
201 virtual void setOverlayVisual(XVisualInfo * visual);
202 XVisualInfo * getOverlayVisual(
void);
205 static void eventHandler(Widget, SoXtGLWidget *, XAnyEvent *, Boolean *);
207 int getDisplayListShareGroup(GLXContext context);
208 Widget getGlxMgrWidget(
void);
209 #endif // __COIN_SOXT__
211 #ifdef __COIN_SOGTK__
213 virtual SbBool eventFilter(GtkWidget *
object, GdkEvent * event);
214 #endif // __COIN_SOGTK__
220 #endif // ! SOQT_GLWIDGET_H