Class: Fox::FXGLViewer

Inherits:
FXGLCanvas show all
Defined in:
rdoc-sources/FXGLViewer.rb

Overview

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

Instance Attribute Summary collapse

Attributes inherited from FXWindow

#accelTable, #backColor, #defaultCursor, #dragCursor, #first, #focus, #key, #last, #layoutHints, #next, #numChildren, #owner, #parent, #prev, #root, #selector, #shell, #target, #x, #y

Attributes inherited from FXDrawable

#height, #visual, #width

Attributes inherited from FXId

#app, #userData, #xid

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FXGLCanvas

#context, #current?, #makeCurrent, #makeNonCurrent, #shared?, #swapBuffers

Methods inherited from FXWindow

#acceptDrop, #acquireClipboard, #acquireSelection, #active?, #addHotKey, #after?, after?, #before?, before?, #beginDrag, #canFocus?, #changeFocus, #childAtIndex, #childOf?, #children, #clearDragRectangle, #clearShape, colorType, colorTypeName, commonAncestor, #composeContext, #composite?, #contains?, #containsChild?, #create, #createComposeContext, #cursorPosition, #default?, #defaultHeight, #defaultWidth, deleteType, deleteTypeName, #destroy, #destroyComposeContext, #detach, #didAccept, #disable, #doesSaveUnder?, #dragging?, #dropDisable, #dropEnable, #dropEnabled?, #dropFinished, #dropTarget?, #each_child, #each_child_recursive, #enable, #enabled?, #endDrag, #forceRefresh, #getChildAt, #getDNDData, #getHeightForWidth, #getWidthForHeight, #grab, #grabKeyboard, #grabbed?, #grabbedKeyboard?, #handleDrag, #hasClipboard?, #hasFocus?, #hasSelection?, #height, #height=, #hide, imageType, #inFocusChain?, #indexOfChild, #initial?, #inquireDNDAction, #inquireDNDTypes, #killFocus, #layout, #linkAfter, #linkBefore, #lower, #move, octetType, octetTypeName, #offeredDNDType?, #position, #raiseWindow, #recalc, #releaseClipboard, #releaseSelection, #remHotKey, #removeChild, #repaint, #reparent, #resize, #scroll, #setCursorPosition, #setDNDData, #setDefault, #setDragRectangle, #setFocus, #setInitial, #setShape, #shell?, #show, #shown?, stringType, textType, textTypeName, #tr, #translateCoordinatesFrom, #translateCoordinatesTo, #underCursor?, #ungrab, #ungrabKeyboard, #update, urilistType, urilistTypeName, utf16Type, utf16TypeName, utf8Type, utf8TypeName, #visible=, #width, #width=

Methods included from Responder2

#connect

Methods inherited from FXDrawable

#resize

Methods inherited from FXId

#create, #created?, #destroy, #detach, #runOnUiThread

Methods inherited from FXObject

#bind, #handle, #load, #save, subclasses

Constructor Details

#initialize(p, vis, sharegroup, target = nil, selector = 0, opts = 0, x = 0, y = 0, width = 0, height = 0) ⇒ FXGLViewer

Construct GL viewer widget sharing display list with another GL viewer



255
256
# File 'rdoc-sources/FXGLViewer.rb', line 255

def initialize(p, vis, target=nil, selector=0, opts=0, x=0, y=0, width=0, height=0) # :yields: theGLViewer
end

Instance Attribute Details

#ambientColorObject

Global ambient light color FXMat4f



234
235
236
# File 'rdoc-sources/FXGLViewer.rb', line 234

def ambientColor
  @ambientColor
end

#centerObject

Object center Fox::FXVec3f



204
205
206
# File 'rdoc-sources/FXGLViewer.rb', line 204

def center
  @center
end

#distanceObject

Target point distance [Float]



195
196
197
# File 'rdoc-sources/FXGLViewer.rb', line 195

def distance
  @distance
end

#eyePositionObject (readonly)

Eye position Fox::FXVec3f



210
211
212
# File 'rdoc-sources/FXGLViewer.rb', line 210

def eyePosition
  @eyePosition
end

#eyeVectorObject (readonly)

Eyesight vector Fox::FXVec3f



207
208
209
# File 'rdoc-sources/FXGLViewer.rb', line 207

def eyeVector
  @eyeVector
end

#fieldOfViewObject

Camera field of view angle (in degrees) [Float]



189
190
191
# File 'rdoc-sources/FXGLViewer.rb', line 189

def fieldOfView
  @fieldOfView
end

#helpTextObject

Status line help text [String]



213
214
215
# File 'rdoc-sources/FXGLViewer.rb', line 213

def helpText
  @helpText
end

#invTransformObject (readonly)

The inverse of the current transformation matrix FXMat4f



222
223
224
# File 'rdoc-sources/FXGLViewer.rb', line 222

def invTransform
  @invTransform
end

#lightObject

Light source settings Fox::FXLight



244
245
246
# File 'rdoc-sources/FXGLViewer.rb', line 244

def light
  @light
end

#materialObject

Default object material setting Fox::FXMaterial



186
187
188
# File 'rdoc-sources/FXGLViewer.rb', line 186

def material
  @material
end

#maxHitsObject

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.



238
239
240
# File 'rdoc-sources/FXGLViewer.rb', line 238

def maxHits
  @maxHits
end

#modelPixObject (readonly)

Size of pixel in model coordinates [Float]



180
181
182
# File 'rdoc-sources/FXGLViewer.rb', line 180

def modelPix
  @modelPix
end

#orientationObject

Camera orientation Fox::FXQuatf



201
202
203
# File 'rdoc-sources/FXGLViewer.rb', line 201

def orientation
  @orientation
end

#projectionObject

The projection mode (either FXGLViewer::PERSPECTIVE or FXGLViewer::PARALLEL)



231
232
233
# File 'rdoc-sources/FXGLViewer.rb', line 231

def projection
  @projection
end

#scaleObject

Current scaling factors Fox::FXVec3f



198
199
200
# File 'rdoc-sources/FXGLViewer.rb', line 198

def scale
  @scale
end

#sceneObject

The current scene object Fox::FXGLObject



225
226
227
# File 'rdoc-sources/FXGLViewer.rb', line 225

def scene
  @scene
end

#selectionObject

The selection Fox::FXGLObject



228
229
230
# File 'rdoc-sources/FXGLViewer.rb', line 228

def selection
  @selection
end

#tipTextObject

Tool tip text [String]



216
217
218
# File 'rdoc-sources/FXGLViewer.rb', line 216

def tipText
  @tipText
end

#transformObject (readonly)

The current transformation matrix FXMat4f



219
220
221
# File 'rdoc-sources/FXGLViewer.rb', line 219

def transform
  @transform
end

#turboMode=(value) ⇒ Object (writeonly)

Set turbo mode [Boolean]



241
242
243
# File 'rdoc-sources/FXGLViewer.rb', line 241

def turboMode=(value)
  @turboMode = value
end

#viewportObject (readonly)

The viewport for this viewer Fox::FXViewport



183
184
185
# File 'rdoc-sources/FXGLViewer.rb', line 183

def viewport
  @viewport
end

#worldPixObject (readonly)

Size of pixel in world coordinates [Float]



177
178
179
# File 'rdoc-sources/FXGLViewer.rb', line 177

def worldPix
  @worldPix
end

#zoomObject

Camera zoom factor [Float]



192
193
194
# File 'rdoc-sources/FXGLViewer.rb', line 192

def zoom
  @zoom
end

Class Method Details

.objectTypeObject

Returns the FXDragType for FXGLObject



247
# File 'rdoc-sources/FXGLViewer.rb', line 247

def FXGLViewer.objectType; end

.objectTypeNameObject

Returns the drag type name



250
# File 'rdoc-sources/FXGLViewer.rb', line 250

def FXGLViewer.objectTypeName; end

Instance Method Details

#doesTurbo?Boolean

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.

Returns:

  • (Boolean)


318
# File 'rdoc-sources/FXGLViewer.rb', line 318

def doesTurbo?; end

#eyeToScreen(e) ⇒ Object

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



277
# File 'rdoc-sources/FXGLViewer.rb', line 277

def eyeToScreen(e); end

#eyeToWorld(e) ⇒ Object

Translate eye coordinate to eye coordinate



292
# File 'rdoc-sources/FXGLViewer.rb', line 292

def eyeToWorld(e); end

#fitToBounds(box) ⇒ Object

Fit viewer to the given bounding box



271
# File 'rdoc-sources/FXGLViewer.rb', line 271

def fitToBounds(box); end

#getBackgroundColor(bottom = false) ⇒ Object

Return top or bottom window background color.



329
# File 'rdoc-sources/FXGLViewer.rb', line 329

def getBackgroundColor(bottom=false); end

#getBoreVector(sx, sy) ⇒ Object

Return boresight vector (an array of two arrays)



301
# File 'rdoc-sources/FXGLViewer.rb', line 301

def getBoreVector(sx, sy); end

#lasso(x1, y1, x2, y2) ⇒ Object

Return an array of all objects in the given rectangle



265
# File 'rdoc-sources/FXGLViewer.rb', line 265

def lasso(x1, y1, x2, y2); end

#locked?Boolean

Returns true if the viewer is locked

Returns:

  • (Boolean)


304
# File 'rdoc-sources/FXGLViewer.rb', line 304

def locked?; end

#readFeedback(x, y, w, h) ⇒ Object

Read the feedback buffer containing the current scene.



310
# File 'rdoc-sources/FXGLViewer.rb', line 310

def readFeedback(x, y, w, h); end

#readPixels(x, y, w, h) ⇒ Object

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



307
# File 'rdoc-sources/FXGLViewer.rb', line 307

def readPixels(x, y, w, h); end

#screenToEye(sx, sy, eyez = 0.0) ⇒ Object

Translate screen coordinate to eye coordinate at the given depth.



280
# File 'rdoc-sources/FXGLViewer.rb', line 280

def screenToEye(sx, sy, eyez=0.0); end

#screenToTarget(sx, sy) ⇒ Object

Translate screen coordinate to eye coordinate at the target point depth



283
# File 'rdoc-sources/FXGLViewer.rb', line 283

def screenToTarget(sx, sy); end

#setBackgroundColor(clr, bottom = MAYBE) ⇒ Object

Change top, bottom or both background colors.



326
# File 'rdoc-sources/FXGLViewer.rb', line 326

def setBackgroundColor(clr, bottom=MAYBE); end

#setBounds(box) ⇒ Object

Change the model bounding box; this adjusts the viewer



268
# File 'rdoc-sources/FXGLViewer.rb', line 268

def setBounds(box); end

#translate(vec) ⇒ Object

Translate object center



298
# File 'rdoc-sources/FXGLViewer.rb', line 298

def translate(vec); end

#turboMode?Boolean

Returns true if turbo mode is enabled

Returns:

  • (Boolean)


321
# File 'rdoc-sources/FXGLViewer.rb', line 321

def turboMode?; end

#worldToEye(w) ⇒ Object

Translate world coordinate to eye coordinate



286
# File 'rdoc-sources/FXGLViewer.rb', line 286

def worldToEye(w); end

#worldToEyeZ(w) ⇒ Object

Translate world coordinate to eye coordinate depth



289
# File 'rdoc-sources/FXGLViewer.rb', line 289

def worldToEyeZ(w); end

#worldVector(fx, fy, tx, ty) ⇒ Object

Calculate world coordinate vector from screen movement



295
# File 'rdoc-sources/FXGLViewer.rb', line 295

def worldVector(fx, fy, tx, ty); end