Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
module Fox
# OpenGL Viewer Viewport
class FXViewport
# Viewport width [Integer]
attr_accessor :w
# Viewport height
attr_accessor :h
# World left [Float]
attr_accessor :left
# World right [Float]
attr_accessor :right
# World bottom [Float]
attr_accessor :bottom
# World top [Float]
attr_accessor :top
# World hither [Float]
attr_accessor :hither
# World yon [Float]
attr_accessor :yon
# Returns an initialized FXViewport instance
def initialize; end
end
# OpenGL Light Source
class FXLight
# Ambient light color [FXVec4f]
attr_accessor :ambient
# Diffuse light color [FXVec4f]
attr_accessor :diffuse
# Specular light color [FXVec4f]
attr_accessor :specular
# Light position [FXVec4f]
attr_accessor :position
# Spot direction [FXVec3f]
attr_accessor :direction
# Spotlight exponent [Float]
attr_accessor :exponent
# Spotlight cutoff angle [Float]
attr_accessor :cutoff
# Constant attenuation factor [Float]
attr_accessor :c_attn
# Linear attenuation factor [Float]
attr_accessor :l_attn
# Quadratic attenuation factor [Float]
attr_accessor :q_attn
# Returns an initialized FXLight instance
def initialize; end
end
# OpenGL Material Description
class FXMaterial
# Ambient material color [FXVec4f]
attr_accessor :ambient
# Diffuse material color [FXVec4f]
attr_accessor :diffuse
# Specular material color [FXVec4f]
attr_accessor :specular
# Emissive material color [FXVec4f]
attr_accessor :emission
# Specular shininess [Float]
attr_accessor :shininess
# Returns an initialized FXMaterial instance
def initialize; end
end
#
# 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
#
class FXGLViewer < FXGLCanvas
# Size of pixel in world coordinates [Float]
attr_reader :worldPix
# Size of pixel in model coordinates [Float]
attr_reader :modelPix
# The viewport for this viewer [FXViewport]
attr_reader :viewport
# Default object material setting [FXMaterial]
attr_accessor :material
# Camera field of view angle (in degrees) [Float]
attr_accessor :fieldOfView
# Camera zoom factor [Float]
attr_accessor :zoom
# Target point distance [Float]
attr_accessor :distance
# Current scaling factors [FXVec3f]
attr_accessor :scale
# Camera orientation [FXQuatf]
attr_accessor :orientation
# Object center [FXVec3f]
attr_accessor :center
# Eyesight vector [FXVec3f]
attr_reader :eyeVector
# Eye position [FXVec3f]
attr_reader :eyePosition
# Status line help text [String]
attr_accessor :helpText
# Tool tip text [String]
attr_accessor :tipText
# The current transformation matrix [FXMat4f]
attr_reader :transform
# The inverse of the current transformation matrix [FXMat4f]
attr_reader :invTransform
# The current scene object [FXGLObject]
attr_accessor :scene
# The selection [FXGLObject]
attr_accessor :selection
# The projection mode (either +FXGLViewer::PERSPECTIVE+ or +FXGLViewer::PARALLEL+)
attr_accessor :projection
# Global ambient light color [FXMat4f]
attr_accessor :ambientColor
# 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.
attr_accessor :maxHits
# Set turbo mode [Boolean]
attr_writer :turboMode
# Light source settings [FXLight]
attr_accessor :light
# Returns the FXDragType for FXGLObject
def FXGLViewer.objectType; end
# Returns the drag type name
def FXGLViewer.objectTypeName; end
#
# Construct GL viewer widget
#
def initialize(p, vis, target=nil, selector=0, opts=0, x=0, y=0, width=0, height=0) # :yields: theGLViewer
end
#
# Construct GL viewer widget sharing display list with another GL viewer
#
def initialize(p, vis, sharegroup, target=nil, selector=0, opts=0, x=0, y=0, width=0, height=0) # :yields: theGLViewer
end
# Return an array of all objects in the given rectangle
def lasso(x1, y1, x2, y2); end
# Change the model bounding box; this adjusts the viewer
def setBounds(box); end
# Fit viewer to the given bounding box
def fitToBounds(box); end
#
# Translate eye-coordinate to screen coordinate.
# Returns a 2-element array [sx, sy] containing the screen coordinate.
#
def eyeToScreen(e); end
# Translate screen coordinate to eye coordinate at the given depth.
def screenToEye(sx, sy, eyez=0.0); end
# Translate screen coordinate to eye coordinate at the target point depth
def screenToTarget(sx, sy); end
# Translate world coordinate to eye coordinate
def worldToEye(w); end
# Translate world coordinate to eye coordinate depth
def worldToEyeZ(w); end
# Translate eye coordinate to eye coordinate
def eyeToWorld(e); end
# Calculate world coordinate vector from screen movement
def worldVector(fx, fy, tx, ty); end
# Translate object center
def translate(vec); end
# Return boresight vector (an array of two arrays)
def getBoreVector(sx, sy); end
# Returns +true+ if the viewer is locked
def locked?; end
# Read the pixels off the screen as R,G,B tuples.
def readPixels(x, y, w, h); end
# Read the feedback buffer containing the current scene.
def readFeedback(x, y, w, h); end
#
# 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.
#
def doesTurbo?; end
# Returns +true+ if turbo mode is enabled
def turboMode?; end
#
# Change top, bottom or both background colors.
#
def setBackgroundColor(clr, bottom=MAYBE); end
# Return top or bottom window background color.
def getBackgroundColor(bottom=false); end
end
end