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

FX::FXGLViewer Class Reference

OpenGL viewer widget. More...

#include <FXGLViewer.h>

Inheritance diagram for FX::FXGLViewer:

FX::FXGLCanvas FX::FXCanvas FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject List of all members.

Public Types

enum  {
  PARALLEL,
  PERSPECTIVE
}

Public Member Functions

virtual long onDefault (FXObject *, FXSelector, void *)
 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)
 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)
virtual void create ()
virtual void detach ()
virtual void layout ()
FXdouble worldPix () const
FXdouble modelPix () const
FXGLObject ** lasso (FXint x1, FXint y1, FXint x2, FXint y2)
virtual FXGLObject ** select (FXint x, FXint y, FXint w, FXint h)
virtual FXGLObjectpick (FXint x, FXint y)
virtual FXbool setBounds (const FXRangef &box)
FXbool fitToBounds (const FXRangef &box)
void getViewport (FXViewport &v) const
void eyeToScreen (FXint &sx, FXint &sy, FXVec3f e)
FXVec3f screenToEye (FXint sx, FXint sy, FXfloat eyez=0.0)
FXVec3f screenToTarget (FXint sx, FXint sy)
FXVec3f worldToEye (FXVec3f w)
FXfloat worldToEyeZ (FXVec3f w)
FXVec3f eyeToWorld (FXVec3f e)
FXVec3f worldVector (FXint fx, FXint fy, FXint tx, FXint ty)
void setMaterial (const FXMaterial &mtl)
void getMaterial (FXMaterial &mtl) const
void setFieldOfView (FXdouble fv)
FXdouble getFieldOfView () const
void setZoom (FXdouble zm)
FXdouble getZoom () const
void setDistance (FXdouble ed)
FXdouble getDistance () const
void setScale (FXVec3f s)
const FXVec3fgetScale () const
void setOrientation (FXQuatf rot)
const FXQuatfgetOrientation () const
void setCenter (FXVec3f cntr)
const FXVec3fgetCenter () const
void translate (FXVec3f vec)
FXbool getBoreVector (FXint sx, FXint sy, FXVec3f &point, FXVec3f &dir)
FXVec3f getEyeVector () const
FXVec3f getEyePosition () const
void setHelpText (const FXString &text)
const FXStringgetHelpText () const
void setTipText (const FXString &text)
const FXStringgetTipText () const
const FXMat4fgetTransform () const
const FXMat4fgetInvTransform () const
void setScene (FXGLObject *sc)
FXGLObjectgetScene () const
void setSelection (FXGLObject *sel)
FXGLObjectgetSelection () const
void setProjection (FXuint proj)
FXuint getProjection () const
void setBackgroundColor (const FXVec4f &clr, FXbool bottom=MAYBE)
const FXVec4fgetBackgroundColor (FXbool bottom=FALSE) const
void setAmbientColor (const FXVec4f &clr)
const FXVec4fgetAmbientColor () const
FXbool readPixels (FXColor *&buffer, FXint x, FXint y, FXint w, FXint h)
FXbool readFeedback (FXfloat *&buffer, FXint &used, FXint &size, FXint x, FXint y, FXint w, FXint h)
void setZSortFunc (FXZSortFunc func)
FXZSortFunc getZSortFunc () const
void setMaxHits (FXint maxh)
FXint getMaxHits () const
FXbool doesTurbo () const
FXbool getTurboMode () const
void setTurboMode (FXbool turbo=TRUE)
void getLight (FXLight &lite) const
void setLight (const FXLight &lite)
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXGLViewer ()

Static Public Attributes

static FXDragType objectType
static const FXchar objectTypeName []

Friends

class FXGLObject

Detailed Description

OpenGL viewer widget.

See also:


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
PARALLEL  Parallel projection.
PERSPECTIVE  Perspective projection.


Constructor & Destructor Documentation

FX::FXGLViewer::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.

FX::FXGLViewer::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 FX::FXGLViewer::~FXGLViewer  )  [virtual]
 

Destructor.


Member Function Documentation

virtual long FX::FXGLViewer::onDefault FXObject ,
FXSelector  ,
void * 
[virtual]
 

Called for unhandled messages.

Reimplemented from FX::FXObject.

virtual void FX::FXGLViewer::create  )  [virtual]
 

Create all of the server-side resources for this window.

Reimplemented from FX::FXGLCanvas.

virtual void FX::FXGLViewer::detach  )  [virtual]
 

Detach server-side resources.

Reimplemented from FX::FXGLCanvas.

virtual void FX::FXGLViewer::layout  )  [virtual]
 

Perform layout.

Reimplemented from FX::FXWindow.

FXdouble FX::FXGLViewer::worldPix  )  const [inline]
 

Return size of pixel in world coordinates.

FXdouble FX::FXGLViewer::modelPix  )  const [inline]
 

Return size of pixel in model coordinates.

FXGLObject** FX::FXGLViewer::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** FX::FXGLViewer::select FXint  x,
FXint  y,
FXint  w,
FXint  h
[virtual]
 

Return a NULL-terminated list of all objects in the given rectangle, or NULL.

virtual FXGLObject* FX::FXGLViewer::pick FXint  x,
FXint  y
[virtual]
 

Perform a pick operation, returning the object at the given x,y position, or NULL.

virtual FXbool FX::FXGLViewer::setBounds const FXRangef box  )  [virtual]
 

Change the model bounding box; this adjusts the viewer.

FXbool FX::FXGLViewer::fitToBounds const FXRangef box  ) 
 

Fit viewer to the given bounding box.

void FX::FXGLViewer::getViewport FXViewport v  )  const
 

Return the viewer's viewport.

void FX::FXGLViewer::eyeToScreen FXint sx,
FXint sy,
FXVec3f  e
 

Translate eye-coordinate to screen coordinate.

FXVec3f FX::FXGLViewer::screenToEye FXint  sx,
FXint  sy,
FXfloat  eyez = 0.0
 

Translate screen coordinate to eye coordinate at the given depth.

FXVec3f FX::FXGLViewer::screenToTarget FXint  sx,
FXint  sy
 

Translate screen coordinate to eye coordinate at the target point depth.

FXVec3f FX::FXGLViewer::worldToEye FXVec3f  w  ) 
 

Translate world coordinate to eye coordinate.

FXfloat FX::FXGLViewer::worldToEyeZ FXVec3f  w  ) 
 

Translate world coordinate to eye coordinate depth.

FXVec3f FX::FXGLViewer::eyeToWorld FXVec3f  e  ) 
 

Translate eye coordinate to eye coordinate.

FXVec3f FX::FXGLViewer::worldVector FXint  fx,
FXint  fy,
FXint  tx,
FXint  ty
 

Calculate world coordinate vector from screen movement.

void FX::FXGLViewer::setMaterial const FXMaterial mtl  ) 
 

Change default object material setting.

void FX::FXGLViewer::getMaterial FXMaterial mtl  )  const
 

Return default object material setting.

void FX::FXGLViewer::setFieldOfView FXdouble  fv  ) 
 

Change camera field of view angle (in degrees).

FXdouble FX::FXGLViewer::getFieldOfView  )  const [inline]
 

Return camera field of view angle.

void FX::FXGLViewer::setZoom FXdouble  zm  ) 
 

Change camera zoom factor.

FXdouble FX::FXGLViewer::getZoom  )  const [inline]
 

Return camera zoom factor.

void FX::FXGLViewer::setDistance FXdouble  ed  ) 
 

Change target point distance.

FXdouble FX::FXGLViewer::getDistance  )  const [inline]
 

Return target point distance.

void FX::FXGLViewer::setScale FXVec3f  s  ) 
 

Change unequal model scaling factors.

const FXVec3f& FX::FXGLViewer::getScale  )  const [inline]
 

Return current scaling factors.

void FX::FXGLViewer::setOrientation FXQuatf  rot  ) 
 

Change camera orientation from quaternion.

const FXQuatf& FX::FXGLViewer::getOrientation  )  const [inline]
 

Return current camera orientation quaternion.

void FX::FXGLViewer::setCenter FXVec3f  cntr  ) 
 

Change object center (tranlation).

const FXVec3f& FX::FXGLViewer::getCenter  )  const [inline]
 

Return object center.

void FX::FXGLViewer::translate FXVec3f  vec  ) 
 

Translate object center.

FXbool FX::FXGLViewer::getBoreVector FXint  sx,
FXint  sy,
FXVec3f point,
FXVec3f dir
 

Return boresight vector.

FXVec3f FX::FXGLViewer::getEyeVector  )  const
 

Return eyesight vector.

FXVec3f FX::FXGLViewer::getEyePosition  )  const
 

Return eye position.

void FX::FXGLViewer::setHelpText const FXString text  ) 
 

Change help text.

const FXString& FX::FXGLViewer::getHelpText  )  const [inline]
 

Return help text.

void FX::FXGLViewer::setTipText const FXString text  ) 
 

Change tip text.

const FXString& FX::FXGLViewer::getTipText  )  const [inline]
 

Return tip text.

const FXMat4f& FX::FXGLViewer::getTransform  )  const [inline]
 

Return the current transformation matrix.

const FXMat4f& FX::FXGLViewer::getInvTransform  )  const [inline]
 

Return the inverse of the current transformation matrix.

void FX::FXGLViewer::setScene FXGLObject sc  ) 
 

Change the scene, i.e. the object being displayed.

FXGLObject* FX::FXGLViewer::getScene  )  const [inline]
 

Return the current scene object.

void FX::FXGLViewer::setSelection FXGLObject sel  ) 
 

Change selection.

FXGLObject* FX::FXGLViewer::getSelection  )  const [inline]
 

Return selection.

void FX::FXGLViewer::setProjection FXuint  proj  ) 
 

Change the projection mode, PERSPECTIVE or PARALLEL.

FXuint FX::FXGLViewer::getProjection  )  const [inline]
 

Return the projection mode.

void FX::FXGLViewer::setBackgroundColor const FXVec4f clr,
FXbool  bottom = MAYBE
 

Change top or bottom or both background colors.

const FXVec4f& FX::FXGLViewer::getBackgroundColor FXbool  bottom = FALSE  )  const [inline]
 

Return top or bottom window background color.

void FX::FXGLViewer::setAmbientColor const FXVec4f clr  ) 
 

Change global ambient light color.

const FXVec4f& FX::FXGLViewer::getAmbientColor  )  const [inline]
 

Return global ambient light color.

FXbool FX::FXGLViewer::readPixels FXColor *&  buffer,
FXint  x,
FXint  y,
FXint  w,
FXint  h
 

Read the pixels off the screen as array of FXColor; this array can be directly passed to fxsaveBMP and other image output routines.

FXbool FX::FXGLViewer::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 FX::FXGLViewer::setZSortFunc FXZSortFunc  func  )  [inline]
 

Change hidden-surface feedback buffer sorting algorithm.

This can be used for move/draw printed output depth sorting.

FXZSortFunc FX::FXGLViewer::getZSortFunc  )  const [inline]
 

Return hidden surface sorting function.

void FX::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.

FXint FX::FXGLViewer::getMaxHits  )  const [inline]
 

Return maximum pickbuffer size.

FXbool FX::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.

FXbool FX::FXGLViewer::getTurboMode  )  const [inline]
 

Return turbo mode setting.

void FX::FXGLViewer::setTurboMode FXbool  turbo = TRUE  ) 
 

Set turbo mode.

void FX::FXGLViewer::getLight FXLight lite  )  const
 

Return light source settings.

void FX::FXGLViewer::setLight const FXLight lite  ) 
 

Change light source settings.

virtual void FX::FXGLViewer::save FXStream store  )  const [virtual]
 

Save viewer to a stream.

Reimplemented from FX::FXGLCanvas.

virtual void FX::FXGLViewer::load FXStream store  )  [virtual]
 

Load viewer from a stream.

Reimplemented from FX::FXGLCanvas.


Friends And Related Function Documentation

friend class FXGLObject [friend]
 


Member Data Documentation

FXDragType FX::FXGLViewer::objectType [static]
 

const FXchar FX::FXGLViewer::objectTypeName[] [static]
 

Copyright © 1997-2005 Jeroen van der Zijp