A view (see the module documentation).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | private | :: | camera_pending | = | .false. |
true if |
|
| real(kind=wp), | private | :: | center(3) | = | 0.0_wp |
kept center |
|
| real(kind=wp), | private | :: | default_center(3) | = | 0.0_wp |
camera center after a reset (view-frame coordinates) |
|
| real(kind=wp), | private | :: | default_distance | = | 0.0_wp |
radius framed on reset (<= 0: the frame's bound) |
|
| real(kind=wp), | private | :: | default_eye(3) | = | 0.0_wp |
camera eye after a reset (view-frame coordinates) |
|
| real(kind=wp), | private | :: | default_up(3) | = | 0.0_wp |
camera up after a reset (zero: no default camera) |
|
| real(kind=wp), | private | :: | eye(3) | = | 0.0_wp |
kept eye |
|
| real(kind=wp), | private | :: | fovy | = | 45.0_wp |
vertical field of view (degrees) |
|
| class(ReferenceFrame), | private, | pointer | :: | frame | => | null() |
the viewed frame (not owned) |
| integer, | private | :: | frame_type | = | RELATIVE_FRAME |
ABSOLUTE_FRAME or RELATIVE_FRAME |
|
| logical, | private | :: | has_state | = | .false. |
true if eye, center, up are kept |
|
| class(ReferenceFrame), | private, | pointer | :: | lookat | => | null() |
the frame looked at (view between frames; not owned) |
| real(kind=wp), | private | :: | ortho(4) | = | [-1.0_wp, 1.0_wp, -1.0_wp, 1.0_wp] |
left, right, bottom, top |
|
| real(kind=wp), | private | :: | pending(3,3) | = | 0.0_wp |
a camera set (eye, center, up), for when it is shown |
|
| integer, | private | :: | projection | = | PERSPECTIVE |
ORTHOGRAPHIC or PERSPECTIVE |
|
| logical, | private | :: | reset_pending | = | .true. |
true if the camera is to be reset when shown |
|
| class(ReferenceFrame), | private, | pointer | :: | root | => | null() |
the root of the frames' tree (not owned) |
| integer, | private | :: | rotation_type | = | VIEW_AZEL |
VIEW_DIRECT or VIEW_AZEL |
|
| real(kind=wp), | private | :: | up(3) | = | 0.0_wp |
kept up direction |
The View constructor: View(...) makes one (see new_view for its
arguments).
A view of frame (in the tree of root), with base frame_type
(default RELATIVE_FRAME); with lookat, a view from frame at lookat,
turned by rotation_type (default VIEW_AZEL). Without frames, the view
looks at the root frame's origin. The frames must stay alive while the
view is used.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in), | optional, | target | :: | root |
the tree's root, viewed and looked-at frames |
| class(ReferenceFrame), | intent(in), | optional, | target | :: | frame |
the tree's root, viewed and looked-at frames |
| class(ReferenceFrame), | intent(in), | optional, | target | :: | lookat |
the tree's root, viewed and looked-at frames |
| integer, | intent(in), | optional | :: | frame_type |
ABSOLUTE_FRAME or RELATIVE_FRAME |
|
| integer, | intent(in), | optional | :: | rotation_type |
VIEW_DIRECT or VIEW_AZEL |
Forget the camera set by set_default_view_parameters (back to the default view distance).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self |
The radius framed when the view is reset (<= 0: the viewed frame's bound).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
The camera after a reset (view-frame coordinates; all zero if none is set).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self | |||
| real(kind=wp), | intent(out) | :: | eye(3) |
the camera (view-frame coordinates; zero if not set) |
||
| real(kind=wp), | intent(out) | :: | center(3) |
the camera (view-frame coordinates; zero if not set) |
||
| real(kind=wp), | intent(out) | :: | up(3) |
the camera (view-frame coordinates; zero if not set) |
The vertical field of view (degrees) of the perspective projection.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
The default camera (eye, center, up in view-frame coordinates) for a
viewport of aspect ratio aspect (width / height): OpenFrames' resetView.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | aspect |
viewport width / height |
||
| real(kind=wp), | intent(out) | :: | eye(3) |
the default camera (view-frame coordinates) |
||
| real(kind=wp), | intent(out) | :: | center(3) |
the default camera (view-frame coordinates) |
||
| real(kind=wp), | intent(out) | :: | up(3) |
the default camera (view-frame coordinates) |
The frame looked at, for a view between frames (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
The bounds [left, right, bottom, top] of the orthographic projection.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
The projection: ORTHOGRAPHIC or PERSPECTIVE.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
Put the camera back at the default position (applied at the next frame in which the view is shown).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self |
Keep the trackball state while another view is shown.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | eye(3) |
the trackball state (view-frame coordinates) |
||
| real(kind=wp), | intent(in) | :: | center(3) |
the trackball state (view-frame coordinates) |
||
| real(kind=wp), | intent(in) | :: | up(3) |
the trackball state (view-frame coordinates) |
The kept trackball state; false if there is none.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self | |||
| real(kind=wp), | intent(out) | :: | eye(3) |
the kept trackball state (view-frame coordinates) |
||
| real(kind=wp), | intent(out) | :: | center(3) |
the kept trackball state (view-frame coordinates) |
||
| real(kind=wp), | intent(out) | :: | up(3) |
the kept trackball state (view-frame coordinates) |
The camera (view-frame coordinates) to show the next time the view is drawn (at once if it is shown: the window's set_camera can also fly there). It replaces a pending reset.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | eye(3) |
the camera (view-frame coordinates) |
||
| real(kind=wp), | intent(in) | :: | center(3) |
the camera (view-frame coordinates) |
||
| real(kind=wp), | intent(in) | :: | up(3) |
the camera (view-frame coordinates) |
The radius to frame when the view is reset (<= 0: the viewed frame's bound, the default), as OpenFrames' default view distance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | distance |
radius (<= 0: the frame's bound) |
The camera after a reset, in view-frame coordinates (overrides the default view distance).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | eye(3) |
the camera (view-frame coordinates) |
||
| real(kind=wp), | intent(in) | :: | center(3) |
the camera (view-frame coordinates) |
||
| real(kind=wp), | intent(in) | :: | up(3) |
the camera (view-frame coordinates) |
An orthographic projection with the given bounds (in view units).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | left |
bounds (view units) |
||
| real(kind=wp), | intent(in) | :: | right |
bounds (view units) |
||
| real(kind=wp), | intent(in) | :: | bottom |
bounds (view units) |
||
| real(kind=wp), | intent(in) | :: | top |
bounds (view units) |
A perspective projection with vertical field of view fovy (degrees; default 45).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | fovy |
vertical field of view (degrees) |
Look from frame at lookat (both in the tree of root).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| class(ReferenceFrame), | intent(in), | target | :: | root |
the tree's root, viewed and looked-at frames |
|
| class(ReferenceFrame), | intent(in), | target | :: | frame |
the tree's root, viewed and looked-at frames |
|
| class(ReferenceFrame), | intent(in), | target | :: | lookat |
the tree's root, viewed and looked-at frames |
|
| integer, | intent(in), | optional | :: | frame_type |
ABSOLUTE_FRAME or RELATIVE_FRAME (default) |
|
| integer, | intent(in), | optional | :: | rotation_type |
VIEW_DIRECT or VIEW_AZEL (default) |
View frame (in the tree of root) with base frame_type (default RELATIVE_FRAME).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| class(ReferenceFrame), | intent(in), | target | :: | root |
the tree's root; the viewed frame (not owned) |
|
| class(ReferenceFrame), | intent(in), | target | :: | frame |
the tree's root; the viewed frame (not owned) |
|
| integer, | intent(in), | optional | :: | frame_type |
ABSOLUTE_FRAME or RELATIVE_FRAME |
True (once) if a camera was set (set_camera), and that camera.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(out) | :: | cam(3,3) |
(columns: eye, center, up (view-frame coordinates)) |
True (once) if a reset is pending.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(inout) | :: | self |
The viewed frame (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
The base of the trackball: ABSOLUTE_FRAME or RELATIVE_FRAME.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
The root of the viewed frames' tree (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
How a view between frames turns: VIEW_DIRECT or VIEW_AZEL.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
The transform from the root frame to the view frame (4x4), from the frames' current positions and attitudes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(View), | intent(in) | :: | self |
type, public :: View private class(ReferenceFrame), pointer :: root => null() !! the root of the frames' tree (not owned) class(ReferenceFrame), pointer :: frame => null() !! the viewed frame (not owned) class(ReferenceFrame), pointer :: lookat => null() !! the frame looked at (view between frames; not owned) integer :: frame_type = RELATIVE_FRAME !! ABSOLUTE_FRAME or RELATIVE_FRAME integer :: rotation_type = VIEW_AZEL !! VIEW_DIRECT or VIEW_AZEL integer :: projection = PERSPECTIVE !! ORTHOGRAPHIC or PERSPECTIVE real(wp) :: fovy = 45.0_wp !! vertical field of view (degrees) real(wp) :: ortho(4) = [-1.0_wp, 1.0_wp, -1.0_wp, 1.0_wp] !! left, right, bottom, top real(wp) :: default_distance = 0.0_wp !! radius framed on reset (<= 0: the frame's bound) real(wp) :: default_eye(3) = 0.0_wp !! camera eye after a reset (view-frame coordinates) real(wp) :: default_center(3) = 0.0_wp !! camera center after a reset (view-frame coordinates) real(wp) :: default_up(3) = 0.0_wp !! camera up after a reset (zero: no default camera) ! the trackball state of this view (view-frame coordinates), kept while another view is shown real(wp) :: eye(3) = 0.0_wp !! kept eye real(wp) :: center(3) = 0.0_wp !! kept center real(wp) :: up(3) = 0.0_wp !! kept up direction logical :: has_state = .false. !! true if eye, center, up are kept logical :: reset_pending = .true. !! true if the camera is to be reset when shown real(wp) :: pending(3,3) = 0.0_wp !! a camera set (eye, center, up), for when it is shown logical :: camera_pending = .false. !! true if `pending` is to be applied when shown contains procedure :: set_view_frame, set_view_between_frames procedure :: view_root, view_frame, lookat_frame, view_frame_type, view_rotation_type, is_valid procedure :: set_perspective, field_of_view, set_orthographic, orthographic_bounds, projection_type procedure :: set_default_view_distance, default_view_distance procedure :: set_default_view_parameters, default_view_parameters, clear_default_view_parameters procedure :: reset_view procedure :: world_to_view, home procedure :: save_state, saved_state, take_reset procedure :: set_camera => view_set_camera, take_camera end type View