A window showing a scene (see the module documentation).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | background(3) | = | [0.0_wp, 0.0_wp, 0.0_wp] |
background color [r, g, b] (0 to 1) |
|
| logical, | private | :: | camera_throw_ | = | .true. |
the camera keeps moving after a drag released while moving |
|
| type(SimulationClock), | private | :: | clock_ |
the window's simulation clock |
|||
| integer, | private | :: | current | = | 0 |
number of views; the current one (0: none) |
|
| logical, | private | :: | default_keys_ | = | .true. |
the built-in keys on |
|
| type(View), | private | :: | default_view |
used when there are no views |
|||
| class(DragHandle), | private, | pointer | :: | dragged_handle | => | null() |
the handle grabbed (not owned) |
| type(CameraFlight), | private | :: | flight |
the camera flight (when active) |
|||
| real(kind=wp), | private | :: | fps_ | = | 0.0_wp |
frames per second (the last count's) |
|
| real(kind=wp), | private | :: | frame_ms_ | = | 0.0_wp |
milliseconds between frames (the last count's) |
|
| class(WindowEventHandler), | private, | pointer | :: | handler | => | null() |
the program's event handler (not owned) |
| integer, | private | :: | height_ | = | 1 |
logical size (for the views' aspect ratio) |
|
| logical, | private | :: | hosted | = | .false. |
in a host's window (its size from resize) |
|
| class(DragHandle), | private, | pointer | :: | hovered_handle | => | null() |
the handle under the cursor (not owned) |
| type(HUDEntry), | private, | allocatable | :: | huds(:) |
the HUD texts shown (first n_huds used) |
||
| real(kind=wp), | private | :: | last_frame_ms | = | 0.0_wp |
the last frame()'s duration (ms) |
|
| real(kind=wp), | private | :: | light_ambient_(3) | = | 0.2_wp |
[r, g, b] |
|
| real(kind=wp), | private | :: | light_diffuse_(3) | = | 1.0_wp |
[r, g, b] |
|
| logical, | private | :: | light_on | = | .true. |
the window's light enabled (no frame's light source) |
|
| real(kind=wp), | private | :: | light_position_(4) | = | [0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp] |
eye coordinates (w 0: directional) |
|
| real(kind=wp), | private | :: | light_specular_(3) | = | 0.0_wp |
[r, g, b] |
|
| integer, | private | :: | n_huds | = | 0 |
number of HUD texts |
|
| integer, | private | :: | n_views | = | 0 |
number of views; the current one (0: none) |
|
| real(kind=wp), | private | :: | pixel_ratio_ | = | 1.0_wp |
framebuffer pixels per window unit (a host's window) |
|
| integer, | private | :: | rate_frames | = | 0 |
frames since then |
|
| real(kind=wp), | private | :: | rate_start | = | -1.0_wp |
the wall time the frames are counted from (s; -1: none) |
|
| real(kind=wp), | private | :: | record_fps | = | 30.0_wp |
the video's frames per second |
|
| integer(kind=int64), | private | :: | record_frames | = | 0_int64 |
frames drawn while recording |
|
| real(kind=wp), | private | :: | record_wall | = | 0.0_wp |
the wall time at the start (s) |
|
| logical, | private | :: | recording_ | = | .false. |
recording (start_recording) |
|
| logical, | private | :: | running | = | .false. |
open, and not closed by the user |
|
| type(FrameManager), | private, | pointer | :: | scene | => | null() |
the scene shown (not owned) |
| logical, | private | :: | scene_added | = | .false. |
scene, sky, HUD texts given to the viewer |
|
| integer, | private | :: | scene_seen | = | -1 |
the scene's updates at this window's last frame |
|
| type(View), | private, | pointer | :: | shown | => | null() |
the view whose camera is in the renderer |
| type(SkySphere), | private, | pointer | :: | sky_ | => | null() |
the background sky |
| real(kind=wp), | private | :: | switch_duration | = | -1.0_wp |
s, for the next view change (< 0: transition_) |
|
| real(kind=wp), | private | :: | transition_ | = | 0.0_wp |
s, for view changes and resets |
|
| type(c_ptr), | private | :: | viewer_ | = | c_null_ptr |
the rendering layer's viewer (null while closed) |
|
| type(ViewPointer), | private, | allocatable | :: | views(:) |
not owned (first n_views used) |
||
| integer, | private | :: | width_ | = | 1 |
logical size (for the views' aspect ratio) |
|
| real(kind=wp), | private | :: | zoom_speed_ | = | 1.0_wp |
the trackball's zoom per scroll step and drag (1: VSG's) |
Show h in the window, on top of the scene (it must stay alive while
shown), from the next frame.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| type(HUDText), | intent(in), | target | :: | h |
the text (not owned) |
Add v to the end of the window's views (it must stay alive while added).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| type(View), | intent(in), | target | :: | v |
the view (not owned) |
The background color [r, g, b].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Whether the camera keeps moving after a released drag (set_camera_throw).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Save the last frame as an image (format from the file extension, e.g. .png). Returns false on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | file |
image file name (e.g. .png) |
Give the events to no handler (the built-in keys remain).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self |
The window's simulation clock (e.g. to synchronize it with another window's).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in), | target | :: | self |
Close the window (waiting for the GPU). The scene is kept, and can be shown again in another window. So are the window's settings (views, HUD texts, sky, handler, time): open again (e.g. on a host's new native window, after Qt destroyed the old one) shows them as before.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self |
The view shown (the default view of the scene's root if none were added).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in), | target | :: | self |
The ray from the eye through point (x, y) of the window (-1 to 1 across it, y up: as the event handler's positions), in the root frame, as at the last frame: its origin (the eye; in an orthographic view, on the eye's plane) and its direction (a unit vector). False before the first frame. E.g. where the cursor points on a plane: vkf_pick's ray_plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | x |
-1 to 1 across the window, y up |
||
| real(kind=wp), | intent(in) | :: | y |
-1 to 1 across the window, y up |
||
| real(kind=wp), | intent(out) | :: | origin(3) |
root frame (direction: a unit vector) |
||
| real(kind=wp), | intent(out) | :: | direction(3) |
root frame (direction: a unit vector) |
Whether the built-in keys are on (set_default_keys).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The window's Vulkan device and driver (see vkf_diagnostics); '' while it isn't open.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The event handler (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Render one frame: advance the clock, update the frames and draw. Returns false once the window has been closed (or on failure).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self |
The camera of the view shown (from the last frame): eye, center and up
in the view frame's coordinates (OpenFrames' trackball
getTransformation), or in its root frame's if in_root. Zero before
the window's first frame.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self | |||
| real(kind=wp), | intent(out) | :: | eye(3) |
view frame's coordinates (or root's) |
||
| real(kind=wp), | intent(out) | :: | center(3) |
view frame's coordinates (or root's) |
||
| real(kind=wp), | intent(out) | :: | up(3) |
view frame's coordinates (or root's) |
||
| logical, | intent(in), | optional | :: | in_root |
true: in the root frame's coordinates (default: the view frame's) |
The window's GUI panels (vkf_gui), made on first use: with font (a
font file name or path, as labels'; default DejaVu Sans) of size
window units (default 15), which apply then. Not valid unless open.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self | |||
| character(len=*), | intent(in), | optional | :: | font |
file name or path (default DejaVu Sans) |
|
| real(kind=wp), | intent(in), | optional | :: | size |
window units (default 15) |
True while the camera is flying (a transition).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Whether the window is open (not closed, by the program or the user).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Whether the window is recording a video.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Whether the simulation time is paused.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
A key press (pressed true) or release, as VSG key symbols and modifiers (ASCII for printable keys; vsg/ui/KeyEvent.h).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | pressed |
true: pressed; false: released |
||
| integer, | intent(in) | :: | symbol |
the key without modifiers (VSG's keyBase) |
||
| integer, | intent(in) | :: | modified_symbol |
the key with the modifiers (VSG's keyModified, e.g. 'A') |
||
| integer, | intent(in) | :: | modifier |
the modifier keys held (MOD_* bits) |
The ambient color of the window's light [r, g, b].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The diffuse color of the window's light [r, g, b].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The position of the window's light (see set_light_position).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The specular color of the window's light [r, g, b].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
A mouse event: kind MOUSE_MOVE, MOUSE_PRESS or MOUSE_RELEASE.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | kind |
MOUSE_MOVE, MOUSE_PRESS or MOUSE_RELEASE |
||
| integer, | intent(in) | :: | x |
framebuffer pixels from the top left |
||
| integer, | intent(in) | :: | y |
framebuffer pixels from the top left |
||
| integer, | intent(in) | :: | mask |
buttons held (ior: 256 left, 512 middle, 1024 right) |
||
| integer, | intent(in) | :: | button |
button pressed or released (1 left, 2 middle, 3 right) |
Show the next view (wrapping around); duration as select_view's.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in), | optional | :: | duration |
s, as select_view's |
Number of views added.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Open the window: width x height (logical pixels) titled title, or,
with native_window (a host window's native handle) and its
pixel_ratio, render into that window. vsync (default true): frames
are presented at the display's refresh; false: as soon as they are ready
(where the driver allows it), e.g. to measure frame times. Returns false
on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | width |
window units (logical pixels) |
||
| integer, | intent(in) | :: | height |
window units (logical pixels) |
||
| character(len=*), | intent(in), | optional | :: | title |
default 'vkframes' |
|
| integer(kind=c_long_long), | intent(in), | optional | :: | native_window |
host window's handle (0: own window) |
|
| real(kind=wp), | intent(in), | optional | :: | pixel_ratio |
framebuffer pixels per window unit (default 1) |
|
| logical, | intent(in), | optional | :: | vsync |
default true: at the display's refresh; false: when ready |
Pause (true) or resume (false) the simulation time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | paused |
true: pause; false: resume |
What is under point (x, y) of the window (-1 to 1 across it, y up: as
the event handler's positions), nearest first (see the module
documentation): none before the first frame. tolerance: how close
lines, markers and frames' origins must be, in window units (logical
pixels; default 4), beyond half a line's width or a marker's size.
kinds: only hits of these kinds (PICK_*; the others aren't tested).
nearest: only the nearest hit (cheaper: what is deeper than a hit
found is skipped, e.g. to pick on every mouse move). Frames and
artists can be left out (set_pickable(.false.)).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in), | target | :: | self | ||
| real(kind=wp), | intent(in) | :: | x |
-1 to 1 across the window, y up |
||
| real(kind=wp), | intent(in) | :: | y |
-1 to 1 across the window, y up |
||
| type(PickHit), | intent(out), | allocatable | :: | hits(:) |
what is there, nearest first |
|
| real(kind=wp), | intent(in), | optional | :: | tolerance |
window units (default 4) |
|
| integer, | intent(in), | optional | :: | kinds(:) |
PICK_* (default: all) |
|
| logical, | intent(in), | optional | :: | nearest |
default false |
Framebuffer pixels per window unit of a host's window (as given to open or resize; 1 for a window of its own).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Show the previous view (wrapping around); duration as select_view's.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in), | optional | :: | duration |
s, as select_view's |
Frames recorded since recording started (the video's length: frames / fps).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Remove all the window's views (the default view is then used).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self |
Stop showing h in the window.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| type(HUDText), | intent(in), | target | :: | h |
the text to stop showing |
Remove all instances of v from the window's views.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| type(View), | intent(in), | target | :: | v |
the view to remove |
The window's frame rate and frame times (see vkf_diagnostics); zeros while it isn't open.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The host window was resized (framebuffer pixels), and pixel_ratio: its
framebuffer pixels per window unit (Qt's devicePixelRatio), if it may
have changed (the window moved to a screen of another scale, or the
display's scaling changed: sizes in window units, such as line widths,
markers and labels, are scaled by it). Once the scene is shown, a frame
of the new size is rendered at once (call this from the host's resize
event), so that the window isn't shown stretched or blank while it is
resized.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | width |
framebuffer pixels |
||
| integer, | intent(in) | :: | height |
framebuffer pixels |
||
| real(kind=wp), | intent(in), | optional | :: | pixel_ratio |
framebuffer pixels per window unit |
Render frames until the window is closed (or for max_frames frames).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| integer, | intent(in), | optional | :: | max_frames |
default: until the window is closed |
The size of the window's scene graph (see vkf_diagnostics): traverses it all, for an occasional update, not every frame. Zeros while it isn't open.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Where point p (root frame) is in the window, as HUD text positions:
(x, y) from 0 to 1, left to right and bottom to top (as at the last
frame). False if it is behind the eye (or before the first frame).
E.g. to keep HUD text next to a moving object, each frame: a callout.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | p(3) |
root frame |
||
| real(kind=wp), | intent(out) | :: | position(2) |
(x, y), 0 to 1 from the bottom left |
The scroll wheel: dy > 0 away from the user.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | dy |
wheel steps (> 0: away from the user; fractions for a trackpad's small steps: Qt's angleDelta / 120) |
Show view i (1 to num_views), flying there over duration s (default:
the view transition, set_view_transition; 0: a cut).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | i |
1 to num_views |
||
| real(kind=wp), | intent(in), | optional | :: | duration |
s (default: the view transition; 0: a cut) |
The background color [r, g, b] (0 to 1; default black).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | rgb(3) |
[r, g, b], 0 to 1 |
Set the camera of the current view: eye, center and up in the view
frame's coordinates (OpenFrames' trackball setTransformation), or in its
root frame's if in_root (as the frames are now). With duration (s),
fly there from the camera shown. Before the view is shown, it is its
camera when it is (set_camera).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout), | target | :: | self | ||
| real(kind=wp), | intent(in) | :: | eye(3) |
view frame's coordinates (or root's) |
||
| real(kind=wp), | intent(in) | :: | center(3) |
view frame's coordinates (or root's) |
||
| real(kind=wp), | intent(in) | :: | up(3) |
view frame's coordinates (or root's) |
||
| real(kind=wp), | intent(in), | optional | :: | duration |
s (default: at once) |
|
| logical, | intent(in), | optional | :: | in_root |
true: eye, center and up are in the root frame's coordinates |
Whether the camera keeps moving (turning, zooming, panning) after a drag is released while the mouse moves (default true, VSG's and OSG's throw); false: it stops where it is released.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | enabled |
true: keeps moving; false: stops where released |
The built-in keys (default on): v the next view, V the previous
one, the space bar resets the view.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | on |
true: the built-in keys on |
Give the window's keyboard and mouse events to handler (not owned: it
must stay alive while set), in place of any handler set before.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| class(WindowEventHandler), | intent(in), | target | :: | handler |
not owned |
The ambient, diffuse and specular colors ([r, g, b], 0 to 1) of the window's light (OpenFrames' defaults: 0.2 gray, white, none). The window's light is used while no frame of the scene has a light source (set_light_source_enabled).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | rgb(3) |
[r, g, b], 0 to 1 (default 0.2 gray) |
The diffuse color of the window's light (see set_light_ambient).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | rgb(3) |
[r, g, b], 0 to 1 (default white) |
The light's position in eye coordinates (x right, y up, z toward the viewer): [x, y, z, 0] for a directional light from direction (x, y, z), [x, y, z, 1] for a point light (OpenFrames' setLightPosition; default [0, 0, 1, 0], a headlight).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | position(4) |
[x, y, z, w], eye coordinates (not all 0) |
The specular color of the window's light (see set_light_ambient).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | rgb(3) |
[r, g, b], 0 to 1 (default black: none) |
Show the scene of fm (which must stay alive while shown). For now, set
it before the window's first frame.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| type(FrameManager), | intent(in), | target | :: | fm |
the scene (not owned; must stay alive while shown) |
Draw sky behind the scene (it must stay alive while shown; it can be
shown in several windows), in place of the window's sky so far; at any
time (its texture and stars can change too).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| type(SkySphere), | intent(inout), | target | :: | sky |
the sky (not owned; can be shown in several windows) |
Set the simulation time (limited to the time range).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
simulation time |
Limit the simulation time to [t_min, t_max] (ignored if t_max < t_min).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t_min |
simulation times |
||
| real(kind=wp), | intent(in) | :: | t_max |
simulation times |
Simulation seconds per wall-clock second (may be 0 or negative).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | scale |
simulation s per wall-clock s (may be 0 or negative) |
The time (s) a change of view or a reset flies from one camera to the other (default 0: a cut, as OpenFrames).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | seconds |
wall-clock s (0: a cut) |
How fast the mouse zooms (default 1, VSG's: 10% per wheel step, and a right drag's rate): e.g. 0.3 for a gentler zoom. Scales scroll steps however they come (a mouse wheel, a trackpad, a host's scroll).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | speed |
(> 0; 1: the default) |
The sky drawn behind the scene (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
Start recording the frames drawn to the video file (see the module
documentation), fps frames per second (default 30). Encoded by
codec (an ffmpeg encoder; default libx264, H.264) at quality (for
libx264, libx265 and libvpx-vp9 the CRF: 0 lossless to 51, default 18,
visually lossless), scaled by scale (default 1; e.g. 0.5 for half the
size of a Retina window's pixels), the size made even. options
replaces the encoder options (codec, quality; and the scale, unless
there is a watermark), e.g. '-c:v prores_ks -profile:v 3'.
watermark: an image (e.g. a logo; PNG, SVG, ... with transparency)
drawn over the video's bottom right corner by ffmpeg, watermark_width
of the video's width (default 0.2), watermark_opacity opaque (default
0.6). ffmpeg: the program (default: VKFRAMES_FFMPEG, else ffmpeg on
the path). Returns false if the window isn't open, is already
recording or the watermark doesn't exist; ffmpeg's errors (e.g. an
unknown encoder) show when it starts, at the next frame, and end the
recording.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | file |
the video file (e.g. .mp4, .mov, .webm) |
||
| real(kind=wp), | intent(in), | optional | :: | fps |
frames per second of the video (default 30) |
|
| integer, | intent(in), | optional | :: | quality |
the CRF (default 18; lower is better) |
|
| character(len=*), | intent(in), | optional | :: | codec |
an ffmpeg encoder (default libx264) |
|
| real(kind=wp), | intent(in), | optional | :: | scale |
of the window's pixels (default 1) |
|
| character(len=*), | intent(in), | optional | :: | options |
ffmpeg's encoder options, instead of those above |
|
| character(len=*), | intent(in), | optional | :: | watermark |
an image file drawn at the bottom right |
|
| real(kind=wp), | intent(in), | optional | :: | watermark_width |
its width, of the video's (default 0.2) |
|
| real(kind=wp), | intent(in), | optional | :: | watermark_opacity |
0 to 1 (default 0.6) |
|
| character(len=*), | intent(in), | optional | :: | ffmpeg |
the ffmpeg program |
Stop recording: ffmpeg finishes the file. The window's time goes on
from where the video was, on the wall clock again. frames: the
frames written. Returns false if not recording or if the recording
failed (ffmpeg's messages are on the standard error).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| integer(kind=int64), | intent(out), | optional | :: | frames |
frames written to the video |
End a flight where the camera is now.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self |
The simulation time (at the last frame).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The simulation time range (set_time_range).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self | |||
| real(kind=wp), | intent(out) | :: | t_min |
simulation times |
||
| real(kind=wp), | intent(out) | :: | t_max |
simulation times |
Simulation seconds per wall-clock second.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
View i (1 to num_views).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
1 to num_views |
The time (s) a change of view or a reset flies (set_view_transition).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The window's viewer handle in the rendering layer (null until open), for adding low-level nodes (src/vsg/vkf_layer.f90).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
The zoom speed (set_zoom_speed).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self |
type, public :: WindowProxy private type(c_ptr) :: viewer_ = c_null_ptr !! the rendering layer's viewer (null while closed) type(FrameManager), pointer :: scene => null() !! the scene shown (not owned) integer :: scene_seen = -1 !! the scene's updates at this window's last frame type(SimulationClock) :: clock_ !! the window's simulation clock logical :: scene_added = .false. !! scene, sky, HUD texts given to the viewer real(wp) :: background(3) = [0.0_wp, 0.0_wp, 0.0_wp] !! background color [r, g, b] (0 to 1) logical :: running = .false. !! open, and not closed by the user integer :: width_ = 1, height_ = 1 !! logical size (for the views' aspect ratio) real(wp) :: pixel_ratio_ = 1.0_wp !! framebuffer pixels per window unit (a host's window) ! views type(ViewPointer), allocatable :: views(:) !! not owned (first n_views used) integer :: n_views = 0, current = 0 !! number of views; the current one (0: none) type(View) :: default_view !! used when there are no views type(View), pointer :: shown => null() !! the view whose camera is in the renderer ! HUD text type(HUDEntry), allocatable :: huds(:) !! the HUD texts shown (first n_huds used) integer :: n_huds = 0 !! number of HUD texts type(SkySphere), pointer :: sky_ => null() !! the background sky ! the window's light (OpenFrames' default: a headlight) real(wp) :: light_ambient_(3) = 0.2_wp, light_diffuse_(3) = 1.0_wp, light_specular_(3) = 0.0_wp !! [r, g, b] real(wp) :: light_position_(4) = [0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp] !! eye coordinates (w 0: directional) logical :: light_on = .true. !! the window's light enabled (no frame's light source) ! keyboard and mouse class(WindowEventHandler), pointer :: handler => null() !! the program's event handler (not owned) class(DragHandle), pointer :: hovered_handle => null() !! the handle under the cursor (not owned) class(DragHandle), pointer :: dragged_handle => null() !! the handle grabbed (not owned) logical :: default_keys_ = .true. !! the built-in keys on logical :: hosted = .false. !! in a host's window (its size from [[resize]]) ! camera transitions real(wp) :: transition_ = 0.0_wp !! s, for view changes and resets real(wp) :: switch_duration = -1.0_wp !! s, for the next view change (< 0: transition_) type(CameraFlight) :: flight !! the camera flight (when active) real(wp) :: zoom_speed_ = 1.0_wp !! the trackball's zoom per scroll step and drag (1: VSG's) logical :: camera_throw_ = .true. !! the camera keeps moving after a drag released while moving ! video recording logical :: recording_ = .false. !! recording (start_recording) real(wp) :: record_fps = 30.0_wp !! the video's frames per second real(wp) :: record_wall = 0.0_wp !! the wall time at the start (s) integer(int64) :: record_frames = 0_int64 !! frames drawn while recording ! diagnostics (render_stats) real(wp) :: rate_start = -1.0_wp !! the wall time the frames are counted from (s; -1: none) integer :: rate_frames = 0 !! frames since then real(wp) :: fps_ = 0.0_wp !! frames per second (the last count's) real(wp) :: frame_ms_ = 0.0_wp !! milliseconds between frames (the last count's) real(wp) :: last_frame_ms = 0.0_wp !! the last frame()'s duration (ms) contains procedure :: open, close, is_open, pixel_ratio procedure :: set_scene procedure :: frame, run procedure :: capture ! video recording (see the module documentation) procedure :: start_recording, stop_recording, is_recording, recorded_frames ! diagnostics (vkf_diagnostics) procedure :: render_stats, device_info, scene_counts procedure :: set_background_color, background_color ! views (OpenFrames' RenderRectangle) procedure :: add_view, remove_view, remove_all_views procedure :: select_view, next_view, previous_view procedure :: current_view, num_views ! the camera (OpenFrames' trackball transformation), smooth transitions procedure :: get_camera, set_camera procedure :: set_view_transition, view_transition, in_transition, stop_transition procedure :: set_zoom_speed, zoom_speed, set_camera_throw, camera_throw ! picking (see the module documentation), and where points are on the screen procedure :: pick => window_pick procedure :: screen_position, cursor_ray ! GUI panels (vkf_gui) procedure :: gui => window_gui ! HUD text (OpenFrames' RenderRectangle HUD) procedure :: add_hud_text, remove_hud_text procedure :: set_sky, sky procedure :: set_light_ambient, set_light_diffuse, set_light_specular, set_light_position procedure :: light_ambient, light_diffuse, light_specular, light_position procedure :: view => window_view ! simulation time (OpenFrames' WindowProxy time control) procedure :: set_time, time, pause_time, is_time_paused, set_time_scale, time_scale procedure :: set_time_range, time_range, clock procedure :: viewer => window_viewer ! events from a host window procedure :: mouse, scroll, key, resize ! the program's event handler (OpenFrames' callbacks), built-in keys procedure :: set_event_handler, clear_event_handler, event_handler procedure :: set_default_keys, default_keys end type WindowProxy