Class Fox::FXGLViewer
In: rdoc-sources/FXGLViewer.rb
Parent: FXGLCanvas

Canvas, an area drawn by another object

Events

The following messages are sent by FXGLViewer to its message target:

SEL_KEYPRESS:sent when a key goes down; the message data is an FXEvent instance.
SEL_KEYRELEASE:sent when a key goes up; the message data is an FXEvent instance.
SEL_LEFTBUTTONPRESS:sent when the left mouse button goes down; the message data is an FXEvent instance.
SEL_LEFTBUTTONRELEASE:sent when the left mouse button goes up; the message data is an FXEvent instance.
SEL_MIDDLEBUTTONPRESS:sent when the middle mouse button goes down; the message data is an FXEvent instance.
SEL_MIDDLEBUTTONRELEASE:sent when the middle mouse button goes up; the message data is an FXEvent instance.
SEL_RIGHTBUTTONPRESS:sent when the right mouse button goes down; the message data is an FXEvent instance.
SEL_RIGHTBUTTONRELEASE:sent when the right mouse button goes up; the message data is an FXEvent instance.
SEL_MOTION:sent when the mouse pointer is moved; the message data is an FXEvent instance.
SEL_MOUSEWHEEL:sent when the mouse wheel is spun; the message data is an FXEvent instance.
SEL_CLICKED:sent when the mouse is single-clicked somewhere in the widget; the message data is a reference to the clicked object (possibly nil)
SEL_DOUBLECLICKED:sent when the mouse is double-clicked somewhere in the widget; the message data is a reference to the clicked object (possibly nil)
SEL_TRIPLECLICKED:sent when the mouse is triple-clicked somewhere in the widget; the message data is a reference to the clicked object (possibly nil)
SEL_PICKED:sent when an object is picked; the message data is an FXEvent instance.
SEL_SELECTED:sent when object(s) are selected in the viewer; the message data is an array of references to the selected objects.
SEL_DESELECTED:sent when object(s) are deselected in the viewer; the message data is an array of references to the deselected objects.
SEL_LASSOED:sent when a lasso-selection has been completed; the message data is an FXEvent instance.
SEL_INSERTED:sent when the viewer receives a SEL_INSERTED message.
SEL_DELETED:sent when the viewer receives a SEL_COMMAND message with the ID_DELETE_SEL identifier; the message data is an array of references to the selected object(s).
SEL_DRAGGED:sent when the selected object is dragged around in the viewer; the message data is a reference to the selected object.
SEL_COMMAND:sent when the mouse is clicked somewhere in the widget; the message data is a reference to the clicked object (possibly nil)
SEL_CHANGED:sent when the selection changes; the message data is a reference to the newly selected object (or nil).

FXGLViewer options

VIEWER_LIGHTING:Lighting is on
VIEWER_FOG:Fog mode on
VIEWER_DITHER:Dithering

Projection modes (class constants)

PARALLEL:Parallel projection
PERSPECTIVE:Perspective projection

Message identifiers

ID_PERSPECTIVE:x
ID_PARALLEL:x
ID_FRONT:x
ID_BACK:x
ID_LEFT:x
ID_RIGHT:x
ID_TOP:x
ID_BOTTOM:x
ID_RESETVIEW:x
ID_FITVIEW:x
ID_TIPTIMER:x
ID_TOP_COLOR:x
ID_BOTTOM_COLOR:x
ID_BACK_COLOR:x
ID_AMBIENT_COLOR:x
ID_LIGHT_AMBIENT:x
ID_LIGHT_DIFFUSE:x
ID_LIGHT_SPECULAR:x
ID_LIGHTING:x
ID_TURBO:x
ID_FOG:x
ID_DITHER:x
ID_SCALE_X:x
ID_SCALE_Y:x
ID_SCALE_Z:x
ID_DIAL_X:x
ID_DIAL_Y:x
ID_DIAL_Z:x
ID_ROLL:x
ID_PITCH:x
ID_YAW:x
ID_FOV:x
ID_ZOOM:x
ID_CUT_SEL:x
ID_COPY_SEL:x
ID_PASTE_SEL:x
ID_DELETE_SEL:x
ID_PRINT_IMAGE:x
ID_PRINT_VECTOR:x
ID_LASSO_ZOOM:x
ID_LASSO_SELECT:x

Methods

Attributes

ambientColor  [RW]  Global ambient light color [FXMat4f]
center  [RW]  Object center [FXVec3f]
distance  [RW]  Target point distance [Float]
eyePosition  [R]  Eye position [FXVec3f]
eyeVector  [R]  Eyesight vector [FXVec3f]
fieldOfView  [RW]  Camera field of view angle (in degrees) [Float]
helpText  [RW]  Status line help text [String]
invTransform  [R]  The inverse of the current transformation matrix [FXMat4f]
light  [RW]  Light source settings [FXLight]
material  [RW]  Default object material setting [FXMaterial]
maxHits  [RW]  The maximum hits, i.e. the maximum size of the pick buffer [Integer]. When less than or equal to zero, picking is essentially turned off.
modelPix  [R]  Size of pixel in model coordinates [Float]
orientation  [RW]  Camera orientation [FXQuatf]
projection  [RW]  The projection mode (either +FXGLViewer::PERSPECTIVE+ or +FXGLViewer::PARALLEL+)
scale  [RW]  Current scaling factors [FXVec3f]
scene  [RW]  The current scene object [FXGLObject]
selection  [RW]  The selection [FXGLObject]
tipText  [RW]  Tool tip text [String]
transform  [R]  The current transformation matrix [FXMat4f]
turboMode  [W]  Set turbo mode [Boolean]
viewport  [R]  The viewport for this viewer [FXViewport]
worldPix  [R]  Size of pixel in world coordinates [Float]
zoom  [RW]  Camera zoom factor [Float]

Public Class methods

Construct GL viewer widget sharing display list with another GL viewer

Returns the FXDragType for FXGLObject

Returns the drag type name

Public Instance methods

When drawing a GL object, if doesTurbo? returns 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.

Translate eye-coordinate to screen coordinate. Returns a 2-element array [sx, sy] containing the screen coordinate.

Translate eye coordinate to eye coordinate

Fit viewer to the given bounding box

Return top or bottom window background color.

Return boresight vector (an array of two arrays)

Return an array of all objects in the given rectangle

Returns true if the viewer is locked

Read the feedback buffer containing the current scene.

Read the pixels off the screen as R,G,B tuples.

Translate screen coordinate to eye coordinate at the given depth.

Translate screen coordinate to eye coordinate at the target point depth

Change top, bottom or both background colors.

Change the model bounding box; this adjusts the viewer

Translate object center

Returns true if turbo mode is enabled

Translate world coordinate to eye coordinate

Translate world coordinate to eye coordinate depth

Calculate world coordinate vector from screen movement

[Validate]