25 #include "FXGLCanvas.h" 38 GLVIEWER_LIGHTING = 0x00010000,
39 GLVIEWER_FOG = 0x00020000,
40 GLVIEWER_DITHER = 0x00040000
86 typedef FXbool (*FXZSortFunc)(FXfloat*& buffer,FXint& used,FXint& size);
121 FXZSortFunc zsortfunc;
129 static FXDragType objectType;
154 virtual void updateProjection();
155 virtual void updateTransform();
156 FXVec3f spherePoint(FXint px,FXint py);
157 FXQuatf turn(FXint fx,FXint fy,FXint tx,FXint ty);
160 void drawLasso(FXint x0,FXint y0,FXint x1,FXint y1);
161 FXint selectHits(FXuint*& hits,FXint& nhits,FXint x,FXint y,FXint w,FXint h);
162 FXint renderFeedback(FXfloat *buffer,FXint x,FXint y,FXint w,FXint h,FXint maxbuffer);
163 void drawFeedback(
FXDCPrint& pdc,
const FXfloat* buffer,FXint used);
164 virtual FXGLObject* processHits(FXuint *pickbuffer,FXint nhits);
165 void setOp(FXuint o);
173 long onPaint(
FXObject*,FXSelector,
void*);
174 long onEnter(
FXObject*,FXSelector,
void*);
175 long onLeave(
FXObject*,FXSelector,
void*);
176 long onMotion(
FXObject*,FXSelector,
void*);
177 long onMouseWheel(
FXObject*,FXSelector,
void*);
178 long onChanged(
FXObject*,FXSelector,
void*);
179 long onPick(
FXObject*,FXSelector,
void*);
180 long onClicked(
FXObject*,FXSelector,
void*);
181 long onDoubleClicked(
FXObject*,FXSelector,
void*);
182 long onTripleClicked(
FXObject*,FXSelector,
void*);
183 long onLassoed(
FXObject*,FXSelector,
void*);
184 long onSelected(
FXObject*,FXSelector,
void*);
185 long onDeselected(
FXObject*,FXSelector,
void*);
186 long onInserted(
FXObject*,FXSelector,
void*);
187 long onDeleted(
FXObject*,FXSelector,
void*);
188 long onLeftBtnPress(
FXObject*,FXSelector,
void*);
189 long onLeftBtnRelease(
FXObject*,FXSelector,
void*);
190 long onMiddleBtnPress(
FXObject*,FXSelector,
void*);
191 long onMiddleBtnRelease(
FXObject*,FXSelector,
void*);
192 long onRightBtnPress(
FXObject*,FXSelector,
void*);
193 long onRightBtnRelease(
FXObject*,FXSelector,
void*);
194 long onSpaceBallMotion(
FXObject*,FXSelector,
void*);
195 long onUngrabbed(
FXObject*,FXSelector,
void*);
196 long onKeyPress(
FXObject*,FXSelector,
void*);
197 long onKeyRelease(
FXObject*,FXSelector,
void*);
198 long onFocusIn(
FXObject*,FXSelector,
void*);
199 long onFocusOut(
FXObject*,FXSelector,
void*);
200 long onClipboardLost(
FXObject*,FXSelector,
void*);
201 long onClipboardGained(
FXObject*,FXSelector,
void*);
202 long onClipboardRequest(
FXObject*,FXSelector,
void*);
205 long onCmdPerspective(
FXObject*,FXSelector,
void*);
206 long onUpdPerspective(
FXObject*,FXSelector,
void*);
207 long onCmdParallel(
FXObject*,FXSelector,
void*);
208 long onUpdParallel(
FXObject*,FXSelector,
void*);
209 long onCmdFront(
FXObject*,FXSelector,
void*);
210 long onUpdFront(
FXObject*,FXSelector,
void*);
211 long onCmdBack(
FXObject*,FXSelector,
void*);
212 long onUpdBack(
FXObject*,FXSelector,
void*);
213 long onCmdLeft(
FXObject*,FXSelector,
void*);
214 long onUpdLeft(
FXObject*,FXSelector,
void*);
215 long onCmdRight(
FXObject*,FXSelector,
void*);
216 long onUpdRight(
FXObject*,FXSelector,
void*);
217 long onCmdTop(
FXObject*,FXSelector,
void*);
218 long onUpdTop(
FXObject*,FXSelector,
void*);
219 long onCmdBottom(
FXObject*,FXSelector,
void*);
220 long onUpdBottom(
FXObject*,FXSelector,
void*);
221 long onCmdResetView(
FXObject*,FXSelector,
void*);
222 long onCmdFitView(
FXObject*,FXSelector,
void*);
223 long onDNDEnter(
FXObject*,FXSelector,
void*);
224 long onDNDLeave(
FXObject*,FXSelector,
void*);
225 long onDNDMotion(
FXObject*,FXSelector,
void*);
226 long onDNDDrop(
FXObject*,FXSelector,
void*);
227 long onTipTimer(
FXObject*,FXSelector,
void*);
228 long onCmdXYZDial(
FXObject*,FXSelector,
void*);
229 long onUpdXYZDial(
FXObject*,FXSelector,
void*);
230 long onCmdRollPitchYaw(
FXObject*,FXSelector,
void*);
231 long onUpdRollPitchYaw(
FXObject*,FXSelector,
void*);
232 long onCmdXYZScale(
FXObject*,FXSelector,
void*);
233 long onUpdXYZScale(
FXObject*,FXSelector,
void*);
234 long onUpdCurrent(
FXObject*,FXSelector,
void*);
235 long onCmdCutSel(
FXObject*,FXSelector,
void*);
236 long onCmdCopySel(
FXObject*,FXSelector,
void*);
237 long onCmdPasteSel(
FXObject*,FXSelector,
void*);
238 long onCmdDeleteSel(
FXObject*,FXSelector,
void*);
239 long onUpdDeleteSel(
FXObject*,FXSelector,
void*);
240 long onCmdBackColor(
FXObject*,FXSelector,
void*);
241 long onUpdBackColor(
FXObject*,FXSelector,
void*);
242 long onCmdGradientBackColor(
FXObject*,FXSelector,
void*);
243 long onUpdGradientBackColor(
FXObject*,FXSelector,
void*);
244 long onCmdAmbientColor(
FXObject*,FXSelector,
void*);
245 long onUpdAmbientColor(
FXObject*,FXSelector,
void*);
246 long onCmdLighting(
FXObject*,FXSelector,
void*);
247 long onUpdLighting(
FXObject*,FXSelector,
void*);
248 long onCmdFog(
FXObject*,FXSelector,
void*);
249 long onUpdFog(
FXObject*,FXSelector,
void*);
250 long onCmdDither(
FXObject*,FXSelector,
void*);
251 long onUpdDither(
FXObject*,FXSelector,
void*);
252 long onCmdFov(
FXObject*,FXSelector,
void*);
253 long onUpdFov(
FXObject*,FXSelector,
void*);
254 long onCmdZoom(
FXObject*,FXSelector,
void*);
255 long onUpdZoom(
FXObject*,FXSelector,
void*);
256 long onCmdLightAmbient(
FXObject*,FXSelector,
void*);
257 long onUpdLightAmbient(
FXObject*,FXSelector,
void*);
258 long onCmdLightDiffuse(
FXObject*,FXSelector,
void*);
259 long onUpdLightDiffuse(
FXObject*,FXSelector,
void*);
260 long onCmdLightSpecular(
FXObject*,FXSelector,
void*);
261 long onUpdLightSpecular(
FXObject*,FXSelector,
void*);
262 long onCmdTurbo(
FXObject*,FXSelector,
void*);
263 long onUpdTurbo(
FXObject*,FXSelector,
void*);
264 long onCmdPrintImage(
FXObject*,FXSelector,
void*);
265 long onCmdPrintVector(
FXObject*,FXSelector,
void*);
266 long onCmdLassoZoom(
FXObject*,FXSelector,
void*);
267 long onCmdLassoSelect(
FXObject*,FXSelector,
void*);
268 long onQueryHelp(
FXObject*,FXSelector,
void*);
269 long onQueryTip(
FXObject*,FXSelector,
void*);
270 virtual long onDefault(
FXObject*,FXSelector,
void*);
282 ID_PERSPECTIVE=FXGLCanvas::ID_LAST,
328 static const FXchar objectTypeName[];
342 virtual void create();
345 virtual void detach();
348 virtual void layout();
357 FXGLObject** lasso(FXint x1,FXint y1,FXint x2,FXint y2);
360 virtual FXGLObject** select(FXint x,FXint y,FXint w,FXint h);
366 virtual FXbool setBounds(
const FXRangef& box);
369 FXbool fitToBounds(
const FXRangef& box);
375 void eyeToScreen(FXint& sx,FXint& sy,
FXVec3f e);
378 FXVec3f screenToEye(FXint sx,FXint sy,FXfloat eyez=0.0f);
381 FXVec3f screenToTarget(FXint sx,FXint sy);
387 FXfloat worldToEyeZ(
FXVec3f w);
393 FXVec3f worldVector(FXint fx,FXint fy,FXint tx,FXint ty);
402 void setFieldOfView(FXdouble fv);
408 void setZoom(FXdouble zm);
414 void setDistance(FXdouble ed);
426 void setOrientation(
const FXQuatf& rot);
441 FXbool getBoreVector(FXint sx,FXint sy,
FXVec3f& point,
FXVec3f& dir);
447 FXVec3f getEyePosition()
const;
450 void setHelpText(
const FXString& text);
456 void setTipText(
const FXString& text);
480 void setProjection(FXuint proj);
486 void setBackgroundColor(
const FXVec4f& clr);
489 void setBackgroundColor(
const FXVec4f& clr,FXbool bottom);
495 void setAmbientColor(
const FXVec4f& clr);
505 FXbool readPixels(FXColor*& buffer,FXint x,FXint y,FXint w,FXint h);
511 FXbool readFeedback(FXfloat*& buffer,FXint& used,FXint& size,FXint x,FXint y,FXint w,FXint h);
543 void setTurboMode(FXbool turbo=
true);
546 void getLight(
FXLight& lite)
const;
549 void setLight(
const FXLight& lite);
552 virtual void save(
FXStream& store)
const;
OpenGL Viewer Viewport.
Definition: FXGLViewer.h:48
OpenGL Material Description.
Definition: FXGLViewer.h:76
Basic OpenGL object.
Definition: FXGLObject.h:37
FXdouble worldPix() const
Return size of pixel in world coordinates.
Definition: FXGLViewer.h:351
FXint getMaxHits() const
Return maximum pickbuffer size.
Definition: FXGLViewer.h:529
FXbool getTurboMode() const
Return turbo mode setting.
Definition: FXGLViewer.h:540
FXdouble getFieldOfView() const
Return camera field of view angle.
Definition: FXGLViewer.h:405
FXfloat l_attn
Constant attenuation factor.
Definition: FXGLViewer.h:70
const FXString & getHelpText() const
Return help text.
Definition: FXGLViewer.h:453
const FXVec4f & getBackgroundColor(FXbool bottom) const
Return top or bottom window background color.
Definition: FXGLViewer.h:492
FXdouble right
World left.
Definition: FXGLViewer.h:52
const FXVec3f & getCenter() const
Return object center.
Definition: FXGLViewer.h:435
FXZSortFunc getZSortFunc() const
Return hidden surface sorting function.
Definition: FXGLViewer.h:520
FXdouble modelPix() const
Return size of pixel in model coordinates.
Definition: FXGLViewer.h:354
FXGLObject * getSelection() const
Return selection.
Definition: FXGLViewer.h:477
FXVec4f position
Specular light color.
Definition: FXGLViewer.h:65
OpenGL viewer widget.
Definition: FXGLViewer.h:93
Postscript Printer Device Context.
Definition: FXDCPrint.h:98
FXdouble left
Viewport height.
Definition: FXGLViewer.h:51
const FXQuatf & getOrientation() const
Return current camera orientation quaternion.
Definition: FXGLViewer.h:429
FXfloat c_attn
Spotlight cutoff angle.
Definition: FXGLViewer.h:69
void setMaxHits(FXint maxh)
Change the maximum hits, i.e.
Definition: FXGLViewer.h:526
Base composite.
Definition: FXComposite.h:32
const FXVec4f & getAmbientColor() const
Return global ambient light color.
Definition: FXGLViewer.h:498
FXuint getProjection() const
Return the projection mode.
Definition: FXGLViewer.h:483
const FXVec3f & getScale() const
Return current scaling factors.
Definition: FXGLViewer.h:423
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXbool doesTurbo() const
When drawing a GL object, if doesTurbo() is true, the object may choose to perform a reduced complexi...
Definition: FXGLViewer.h:537
FXdouble getZoom() const
Return camera zoom factor.
Definition: FXGLViewer.h:411
FXint h
Viewport width.
Definition: FXGLViewer.h:50
Definition: FX4Splitter.h:28
void setZSortFunc(FXZSortFunc func)
Change hidden-surface feedback buffer sorting algorithm.
Definition: FXGLViewer.h:517
OpenGL Light Source.
Definition: FXGLViewer.h:61
GL Context.
Definition: FXGLContext.h:32
const FXMat4f & getInvTransform() const
Return the inverse of the current transformation matrix.
Definition: FXGLViewer.h:465
Single-precision quaternion.
Definition: FXQuatf.h:32
GLCanvas, an area drawn by another object.
Definition: FXGLCanvas.h:42
Single-precision 3-element vector.
Definition: FXVec3f.h:28
Visual describes pixel format of a drawable.
Definition: FXGLVisual.h:40
Single-precision 4x4 matrix.
Definition: FXMat4f.h:32
FXfloat q_attn
Linear attenuation factor.
Definition: FXGLViewer.h:71
const FXMat4f & getTransform() const
Return the current transformation matrix.
Definition: FXGLViewer.h:462
FXfloat shininess
Emissive material color.
Definition: FXGLViewer.h:81
FXdouble top
World bottom.
Definition: FXGLViewer.h:54
Bounds.
Definition: FXRangef.h:32
FXVec4f specular
Diffuse material color.
Definition: FXGLViewer.h:79
FXVec4f specular
Diffuse light color.
Definition: FXGLViewer.h:64
FXdouble bottom
World right.
Definition: FXGLViewer.h:53
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXdouble hither
World top.
Definition: FXGLViewer.h:55
FXVec3f direction
Light position.
Definition: FXGLViewer.h:66
const FXString & getTipText() const
Return tip text.
Definition: FXGLViewer.h:459
FXVec4f diffuse
Ambient material color.
Definition: FXGLViewer.h:78
FXfloat cutoff
Spotlight exponent.
Definition: FXGLViewer.h:68
FXGLObject * getScene() const
Return the current scene object.
Definition: FXGLViewer.h:471
FXVec4f emission
Specular material color.
Definition: FXGLViewer.h:80
FXdouble yon
World hither (near)
Definition: FXGLViewer.h:56
FXVec4f diffuse
Ambient light color.
Definition: FXGLViewer.h:63
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42
FXdouble getDistance() const
Return target point distance.
Definition: FXGLViewer.h:417
Single-precision 4-element vector.
Definition: FXVec4f.h:28
FXfloat exponent
Spot direction.
Definition: FXGLViewer.h:67