Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXGLViewer Class Reference

Canvas, an area drawn by another object.

#include <FXGLViewer.h>

Inheritance diagram for FXGLViewer:

FXGLCanvas FXCanvas FXWindow FXDrawable FXId FXObject List of all members.

Public Types

enum  {
  HOVERING,
  PICKING,
  ROTATING,
  POSTING,
  TRANSLATING,
  ZOOMING,
  FOVING,
  DRAGGING,
  TRUCKING,
  GYRATING,
  DO_LASSOSELECT,
  LASSOSELECT,
  DO_LASSOZOOM,
  LASSOZOOM
}
enum  {
  PARALLEL,
  PERSPECTIVE
}
enum  {
  OFFSETPROJECTION = 1,
  SURFACEPROJECTION = 2
}
enum  {
  ID_PERSPECTIVE = FXGLCanvas::ID_LAST,
  ID_PARALLEL,
  ID_FRONT,
  ID_BACK,
  ID_LEFT,
  ID_RIGHT,
  ID_TOP,
  ID_BOTTOM,
  ID_RESETVIEW,
  ID_FITVIEW,
  ID_TIPTIMER,
  ID_BACK_COLOR,
  ID_AMBIENT_COLOR,
  ID_LIGHT_AMBIENT,
  ID_LIGHT_DIFFUSE,
  ID_LIGHT_SPECULAR,
  ID_LIGHTING,
  ID_TURBO,
  ID_FOG,
  ID_DITHER,
  ID_SCALE_X,
  ID_SCALE_Y,
  ID_SCALE_Z,
  ID_DIAL_X,
  ID_DIAL_Y,
  ID_DIAL_Z,
  ID_ROLL,
  ID_PITCH,
  ID_YAW,
  ID_FOV,
  ID_ZOOM,
  ID_LOCK,
  ID_CUT_SEL,
  ID_COPY_SEL,
  ID_PASTE_SEL,
  ID_DELETE_SEL,
  ID_PRINT_IMAGE,
  ID_PRINT_VECTOR,
  ID_LASSO_ZOOM,
  ID_LASSO_SELECT,
  ID_LAST
}

Public Methods

 FXGLViewer ()
void glsetup ()
void updateProjection ()
void updateTransform ()
FXVec spherePoint (FXint px, FXint py)
FXQuat turn (FXint fx, FXint fy, FXint tx, FXint ty)
void drawWorld (FXViewport &wv)
void drawAnti (FXViewport &wv)
void drawLasso (FXint x0, FXint y0, FXint x1, FXint y1)
FXint selectHits (FXuint *&hits, FXint &nhits, FXint x, FXint y, FXint w, FXint h)
FXint renderFeedback (FXfloat *buffer, FXint x, FXint y, FXint w, FXint h, FXint maxbuffer)
void drawFeedback (FXDCPrint &pdc, const FXfloat *buffer, FXint used)
virtual FXGLObjectprocessHits (FXuint *pickbuffer, FXint nhits)
void setOp (FXuint o)
virtual void layout ()
 FXGLViewer (const FXGLViewer &)
FXGLViewer & operator= (const FXGLViewer &)
void initialize ()
virtual long onDefault (FXObject *, FXSelector, void *)
 Called for unhandled messages.

 FXGLViewer (FXComposite *p, FXGLVisual *vis, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
 Construct GL viewer widget.

 FXGLViewer (FXComposite *p, FXGLVisual *vis, FXGLViewer *sharegroup, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
 Construct GL viewer widget sharing display list with another GL viewer.

virtual void create ()
 Create all of the server-side resources for this window.

virtual void detach ()
 Detach server-side resources.

FXdouble worldPix () const
 Return size of pixel in world coordinates.

FXdouble modelPix () const
 Return size of pixel in model coordinates.

FXGLObject ** lasso (FXint x1, FXint y1, FXint x2, FXint y2)
 Return a NULL-terminated list of all objects in the given rectangle, or NULL.

virtual FXGLObject ** select (FXint x, FXint y, FXint w, FXint h)
 Return a NULL-terminated list of all objects in the given rectangle, or NULL.

virtual FXGLObjectpick (FXint x, FXint y)
 Perform a pick operation, returning the object at the given x,y position, or NULL.

FXbool setBounds (const FXRange &box)
 Change the model bounding box; this adjusts the viewer.

FXbool fitToBounds (const FXRange &box)
 Fit viewer to the given bounding box.

void getViewport (FXViewport &v) const
 Return the viewer's viewport.

void eyeToScreen (FXint &sx, FXint &sy, FXVec e)
 Translate eye-coordinate to screen coordinate.

FXVec screenToEye (FXint sx, FXint sy, FXfloat eyez=0.0)
 Translate screen coordinate to eye coordinate at the given depth.

FXVec screenToTarget (FXint sx, FXint sy)
 Translate screen coordinate to eye coordinate at the target point depth.

FXVec worldToEye (FXVec w)
 Translate world coordinate to eye coordinate.

FXfloat worldToEyeZ (FXVec w)
 Translate world coordinate to eye coordinate depth.

FXVec eyeToWorld (FXVec e)
 Translate eye coordinate to eye coordinate.

FXVec worldVector (FXint fx, FXint fy, FXint tx, FXint ty)
 Calculate world coordinate vector from screen movement.

void setMaterial (const FXMaterial &mtl)
 Change default object material setting.

void getMaterial (FXMaterial &mtl) const
 Return default object material setting.

void setFieldOfView (FXdouble fv)
 Change camera field of view angle (in degrees).

FXdouble getFieldOfView () const
 Return camera field of view angle.

void setZoom (FXdouble zm)
 Change camera zoom factor.

FXdouble getZoom () const
 Return camera zoom factor.

void setDistance (FXdouble ed)
 Change target point distance.

FXdouble getDistance () const
 Return target point distance.

void setScale (FXVec s)
 Change unequal model scaling factors.

void setOrientation (FXQuat rot)
 Change camera orientation from quaternion.

void setCenter (FXVec cntr)
 Change object center (tranlation).

const FXVecgetCenter () const
 Return object center.

void translate (FXVec vec)
 Translate object center.

FXbool getBoreVector (FXint sx, FXint sy, FXVec &point, FXVec &dir)
 Return boresight vector.

void setHelpText (const FXString &text)
 Change help text.

void setTipText (const FXString &text)
 Change tip text.

void setOffset (FXdouble offs)
 Change line offset.

FXdouble getOffset () const
 Return line offset.

const FXHMatgetTransform () const
 Return the current transformation matrix.

const FXHMatgetInvTransform () const
 Return the inverse of the current transformation matrix.

void setScene (FXGLObject *sc)
 Change the scene, i.e. the object being displayed.

FXGLObjectgetScene () const
 Return the current scene object.

void setSelection (FXGLObject *sel)
 Change selection.

FXGLObjectgetSelection () const
 Return selection.

void setProjection (FXuint proj)
 Change the projection mode, PERSPECTIVE or PARALLEL.

FXuint getProjection () const
 Return the projection mode.

void setViewLock (FXbool lock=TRUE)
 Lock the viewer, i.e. prevent mouse-based viewing operations.

FXbool getViewLock () const
 Return viewer lock status.

void setBackgroundColor (const FXHVec &clr)
 Change window background color.

void setAmbientColor (const FXHVec &clr)
 Change global ambient light color.

FXbool readPixels (FXuchar *&buffer, FXint x, FXint y, FXint w, FXint h)
 Read the pixels off the screen as R,G,B tuples.

FXbool readFeedback (FXfloat *&buffer, FXint &used, FXint &size, FXint x, FXint y, FXint w, FXint h)
 Read the feedback buffer containing the current scene, returning used and allocated size.

void setZSortFunc (FXZSortFunc func)
FXZSortFunc getZSortFunc () const
 Return hidden surface sorting function.

void setMaxHits (FXint maxh)
FXint getMaxHits () const
 Return maximum pickbuffer size.

FXbool doesTurbo () const
FXbool getTurboMode () const
 Return turbo mode setting.

void setTurboMode (FXbool turbo=TRUE)
 Set turbo mode.

void getLight (FXLight &lite) const
 Return light source settings.

void setLight (const FXLight &lite)
 Change light source settings.

virtual void save (FXStream &store) const
 Save viewer to a stream.

virtual void load (FXStream &store)
 Load viewer from a stream.

virtual ~FXGLViewer ()
 Destructor.


Public Attributes

FXVec getScale () const
 Return current scaling factors.

FXQuat getOrientation () const
 Return current camera orientation quaternion.

FXVec getEyeVector () const
 Return eyesight vector.

FXVec getEyePosition () const
 Return eye position.

FXString getHelpText () const
 Return help text.

FXString getTipText () const
 Return tip text.

FXHVec getBackgroundColor () const
 Return window background color.

FXHVec getAmbientColor () const
 Return global ambient light color.


Static Public Attributes

FXDragType objectType
const FXchar objectTypeName []

Friends

class FXGLObject

Member Function Documentation

void FXGLViewer::setZSortFunc FXZSortFunc    func [inline]
 

Change hidden-surface feedback buffer sorting algorithm. This can be used for move/draw printed output depth sorting.

void FXGLViewer::setMaxHits FXint    maxh [inline]
 

Change the maximum hits, i.e. the maximum size of the pick buffer. When set to less than or equal to zero, picking is essentially turned off.

FXbool FXGLViewer::doesTurbo   const [inline]
 

When drawing a GL object, if doesTurbo() is true, the object may choose to perform a reduced complexity drawing as the user is interactively manipulating; another update will be done later when the full complexity drawing can be performed again.