Draws markers at a trajectory's points (OpenFrames' MarkerArtist): at its start and end, and intermediate markers spaced by time, arc length or data points, counted from the start or from the end. Markers keep their size on screen (window units), or with auto-attenuation shrink when the camera is farther than the trajectory's size. In trace mode (an addition), the markers passed are drawn: the end marker (at the trajectory's end) only once the time reaches the end. Point colors (an addition, off by default: set_point_colors): each marker in the trajectory's color there (see set_point_colors).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | arc | = | 0.0_wp |
arc length (INTERMEDIATE_DISTANCE): so far, at prev_point, and of the next marker; the last point |
|
| logical, | private | :: | attenuate | = | .true. |
auto-attenuation (see set_auto_attenuate; on by default) |
|
| logical, | private | :: | default_data | = | .true. |
sources not set: the positions, per the DOF |
|
| integer, | private | :: | direction_ | = | MARKER_START |
intermediate markers counted from MARKER_START or MARKER_END |
|
| logical, | private | :: | drawn | = | .false. |
drawn at least once since built |
|
| real(kind=wp), | private | :: | end_color(4) | = | [1.0_wp, 0.0_wp, 0.0_wp, 1.0_wp] |
end marker color (red) |
|
| type(LineChain), | private | :: | end_node |
start, end and intermediate marker buffers |
|||
| logical, | private | :: | end_shown | = | .false. |
the start and end markers are drawn |
|
| type(c_ptr), | private | :: | group | = | c_null_ptr |
the artist's group (null until built) |
|
| real(kind=wp), | private | :: | hi(3) | = | 0.0_wp |
bounds of the points seen |
|
| type(c_ptr), | private | :: | image | = | c_null_ptr |
the image read from it (owned; null: none) |
|
| character(len=:), | private, | allocatable | :: | image_file |
the marker image file ('': none) |
||
| type(LineChain), | private | :: | inter |
start, end and intermediate marker buffers |
|||
| integer, | private | :: | inter_first | = | 1 |
the first intermediate marker drawn (trace, decreasing times: later) |
|
| real(kind=wp), | private, | allocatable | :: | inter_rgba(:,:) |
(4, :) their colors (with point colors) |
||
| real(kind=wp), | private, | allocatable | :: | inter_t(:) |
intermediate markers' points and times (1:n_inter) |
||
| real(kind=wp), | private, | allocatable | :: | inter_xyz(:,:) |
intermediate markers' points and times (1:n_inter) |
||
| real(kind=wp), | private | :: | intermediate_color(4) | = | [1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp] |
intermediate marker color (white) |
|
| integer, | private | :: | intermediate_type_ | = | INTERMEDIATE_DATA |
INTERMEDIATE_TIME, _DISTANCE or _DATA |
|
| real(kind=wp), | private | :: | lo(3) | = | 0.0_wp |
bounds of the points seen |
|
| integer, | private | :: | markers_ | = | ior(MARKER_START, MARKER_END) |
markers drawn (an ior of MARKER_* flags) |
|
| integer, | private | :: | n_colors_seen | = | 0 |
the trajectory's colors when the markers were written |
|
| integer, | private | :: | n_inter | = | 0 |
intermediate markers computed, written, drawn |
|
| integer, | private | :: | n_inter_drawn | = | 0 |
intermediate markers computed, written, drawn |
|
| integer, | private | :: | n_inter_written | = | 0 |
intermediate markers computed, written, drawn |
|
| integer, | private | :: | n_seen | = | 0 |
points seen (for the bounds) |
|
| integer, | private | :: | next_index | = | 0 |
where to continue (0: not started) |
|
| real(kind=wp), | private | :: | next_time | = | 0.0_wp |
time of the next marker (INTERMEDIATE_TIME) |
|
| logical, | private | :: | point_colors_ | = | .false. |
the trajectory's colors, if any (see set_point_colors) |
|
| real(kind=wp), | private | :: | prev_arc | = | 0.0_wp |
arc length (INTERMEDIATE_DISTANCE): so far, at prev_point, and of the next marker; the last point |
|
| real(kind=wp), | private | :: | prev_point(3) | = | 0.0_wp |
arc length (INTERMEDIATE_DISTANCE): so far, at prev_point, and of the next marker; the last point |
|
| real(kind=wp), | private | :: | radius | = | 0.0_wp |
attenuation radius applied |
|
| integer, | private | :: | shape_ | = | MARKER_DISK |
marker shape: a MARKER_* shape constant |
|
| logical, | private | :: | shown | = | .false. |
built for a window (marker nodes made later are compiled) |
|
| real(kind=wp), | private | :: | size_ | = | 10.0_wp |
marker size (window units) |
|
| type(DataSource), | private | :: | sources_(3) |
x, y, z data sources (default: the positions) |
|||
| real(kind=wp), | private | :: | spacing_ | = | 1.0_wp |
intermediate spacing: time units, arc length or data points |
|
| real(kind=wp), | private | :: | start_color(4) | = | [1.0_wp, 0.0_wp, 0.0_wp, 1.0_wp] |
start marker color [r, g, b, a] (red) |
|
| type(LineChain), | private | :: | start_node |
start, end and intermediate marker buffers |
|||
| logical, | private | :: | start_shown | = | .false. |
the start and end markers are drawn |
|
| real(kind=wp), | private | :: | target | = | 0.0_wp |
arc length (INTERMEDIATE_DISTANCE): so far, at prev_point, and of the next marker; the last point |
The MarkerArtist constructor: MarkerArtist(...) makes one (see new_marker_artist for its
arguments).
A marker artist for traj (optional; without one, or with all data
sources zero, a start marker at the origin: in a DrawableTrajectory that
follows a trajectory, or is a child of a frame that does, it marks the
current position, as in OpenFrames), drawing markers (an ior
of MARKER_START, MARKER_INTERMEDIATE, MARKER_END; default start and end)
of size window units (default 10) in color (all markers; default red
start and end, white intermediate).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Trajectory), | intent(in), | optional, | target | :: | traj |
the trajectory to draw (not owned) |
| integer, | intent(in), | optional | :: | markers |
an ior of MARKER_* flags (default start and end) |
|
| real(kind=wp), | intent(in), | optional | :: | size |
window units (default 10); [r, g, b] or [r, g, b, a] |
|
| real(kind=wp), | intent(in), | optional | :: | color(:) |
window units (default 10); [r, g, b] or [r, g, b, a] |
Whether the markers are auto-attenuated.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
Create the marker nodes under group (see artist_build).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| type(c_ptr), | intent(in) | :: | viewer |
compiles nodes made later (may be null); the parent group |
||
| type(c_ptr), | intent(in) | :: | group |
compiles nodes made later (may be null); the parent group |
The x, y and z data sources.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
The color marker k of which (one MARKER_* flag; k: the intermediate
marker's number) is drawn in: read back from its buffer with point
colors, else the marker's own color.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | which |
MARKER_START, MARKER_INTERMEDIATE or MARKER_END |
||
| integer, | intent(in), | optional | :: | k |
the intermediate marker's number (default 1) |
Where marker which (MARKER_START, MARKER_END, or MARKER_INTERMEDIATE
number i) is drawn, read back from its buffer; false if not drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | which |
MARKER_START, MARKER_END or MARKER_INTERMEDIATE |
||
| real(kind=wp), | intent(out) | :: | v(3) |
where it is drawn (frame coordinates) |
||
| integer, | intent(in), | optional | :: | i |
the intermediate marker's number (1 to num_intermediate) |
The trajectory drawn (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryArtist), | intent(in) | :: | self |
Where intermediate markers are counted from (MARKER_START or MARKER_END).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
Spacing of intermediate markers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
How intermediate markers are spaced (INTERMEDIATE_*).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
The color of the start, intermediate or end markers (which: one MARKER_* flag).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | which |
MARKER_START, MARKER_INTERMEDIATE or MARKER_END |
The marker image file ('' for none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
Marker shape (a MARKER_* shape constant).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
Marker size (window units).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
Which markers are drawn (an ior of MARKER_* flags).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
Number of intermediate markers drawn now.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
Whether pick tests what this artist draws.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryArtist), | intent(in) | :: | self |
Whether the trajectory's colors are drawn (set_point_colors).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(in) | :: | self |
Forget the render nodes (see artist_release).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self |
Shrink markers farther from the camera than the trajectory's size (OpenFrames' auto-attenuation; see shaders/marker.vert). On by default (OpenFrames': off).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | attenuate |
true: auto-attenuation on (default) |
Count intermediate markers from the start (MARKER_START, default) or from the end (MARKER_END; recomputed whenever points are added).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | direction |
MARKER_START or MARKER_END |
Spacing of intermediate markers (> 0): time units, arc length, or a number of data points (rounded down, at least 1).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | spacing |
time units, arc length or data points (> 0) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | type |
INTERMEDIATE_TIME, _DISTANCE or _DATA |
The color of the markers in which (an ior of MARKER_* flags): [r, g,
b] (alpha unchanged) or [r, g, b, a].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | which |
the markers (an ior of MARKER_* flags) |
||
| real(kind=wp), | intent(in) | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
Draw the markers as an image file (tinted by the marker color; its transparent parts left out), or as a disk again with ''. Returns false if the image cannot be read (the markers are then unchanged).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | file |
the image file ('': a disk again) |
Marker shape: a MARKER_ shape constant (MARKER_DISK to MARKER_SPIRAL; MARKER_IMAGE after set_marker_image). These are OpenFrames' disk and its marker shaders (Demos/Shaders/Marker_.frag), built in.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | shape |
a MARKER_* shape constant |
Marker size in window units (logical pixels; > 0).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | size |
window units (> 0; else ignored) |
Which markers to draw: an ior of MARKER_START, MARKER_INTERMEDIATE and MARKER_END (0 for none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | markers |
an ior of MARKER_* flags (0: none) |
Whether pick tests what this artist draws (default true; e.g. false for a spacecraft's marker beside its orbit's curve).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryArtist), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | pickable |
true: picked (default) |
How intermediate markers are spaced: INTERMEDIATE_TIME, _DISTANCE or _DATA.
Point colors (default off): with the trajectory's colors (Trajectory%
add_color, or add's color), each marker is drawn in the color at its
point (intermediate markers between points: blended between theirs, by
time), points without a color yet in the marker's own color
(set_marker_color). Off, or without colors: the markers' own colors.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | enabled |
true: the trajectory's colors (default false) |
Draw only the part up to the current time (see the module documentation).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryArtist), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | enabled |
true: draw only up to the current time |
Draw traj; with the default data sources, its positions (per its DOF).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| type(Trajectory), | intent(in), | target | :: | traj |
the trajectory to draw (not owned) |
Where the x (y, z) of the markers come from. Returns whether the trajectory has those data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the x data source |
Where the y of the markers come from (see set_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the y data source |
Where the z of the markers come from (see set_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the z data source |
Whether only the part up to the current time is drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryArtist), | intent(in) | :: | self |
Write the start, end and new intermediate markers if the trajectory changed, and draw them all or, in trace mode, those passed at time t.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the current time |
type, extends(TrajectoryArtist), public :: MarkerArtist private type(DataSource) :: sources_(3) !! x, y, z data sources (default: the positions) logical :: default_data = .true. !! sources not set: the positions, per the DOF integer :: markers_ = ior(MARKER_START, MARKER_END) !! markers drawn (an ior of MARKER_* flags) integer :: intermediate_type_ = INTERMEDIATE_DATA !! INTERMEDIATE_TIME, _DISTANCE or _DATA real(wp) :: spacing_ = 1.0_wp !! intermediate spacing: time units, arc length or data points integer :: direction_ = MARKER_START !! intermediate markers counted from MARKER_START or MARKER_END real(wp) :: start_color(4) = [1.0_wp, 0.0_wp, 0.0_wp, 1.0_wp] !! start marker color [r, g, b, a] (red) real(wp) :: end_color(4) = [1.0_wp, 0.0_wp, 0.0_wp, 1.0_wp] !! end marker color (red) real(wp) :: intermediate_color(4) = [1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp] !! intermediate marker color (white) real(wp) :: size_ = 10.0_wp !! marker size (window units) integer :: shape_ = MARKER_DISK !! marker shape: a MARKER_* shape constant character(len=:), allocatable :: image_file !! the marker image file ('': none) type(c_ptr) :: image = c_null_ptr !! the image read from it (owned; null: none) logical :: attenuate = .true. !! auto-attenuation (see set_auto_attenuate; on by default) logical :: point_colors_ = .false. !! the trajectory's colors, if any (see set_point_colors) ! rendering type(c_ptr) :: group = c_null_ptr !! the artist's group (null until built) logical :: shown = .false. !! built for a window (marker nodes made later are compiled) integer :: n_colors_seen = 0 !! the trajectory's colors when the markers were written type(LineChain) :: start_node, end_node, inter !! start, end and intermediate marker buffers logical :: drawn = .false. !! drawn at least once since built integer :: n_seen = 0 !! points seen (for the bounds) real(wp) :: lo(3) = 0.0_wp, hi(3) = 0.0_wp !! bounds of the points seen real(wp) :: radius = 0.0_wp !! attenuation radius applied ! intermediate markers: in trajectory order, and where to continue real(wp), allocatable :: inter_xyz(:,:), inter_t(:) !! intermediate markers' points and times (1:n_inter) real(wp), allocatable :: inter_rgba(:,:) !! (4, :) their colors (with point colors) integer :: n_inter = 0, n_inter_written = 0, n_inter_drawn = 0 !! intermediate markers computed, written, drawn integer :: inter_first = 1 !! the first intermediate marker drawn (trace, decreasing times: later) real(wp) :: next_time = 0.0_wp !! time of the next marker (INTERMEDIATE_TIME) integer :: next_index = 0 !! where to continue (0: not started) real(wp) :: arc = 0.0_wp, prev_arc = 0.0_wp, target = 0.0_wp, prev_point(3) = 0.0_wp !! arc length (INTERMEDIATE_DISTANCE): so far, at prev_point, and of the next marker; the last point logical :: start_shown = .false., end_shown = .false. !! the start and end markers are drawn contains procedure :: set_trajectory => marker_set_trajectory procedure :: set_x_data => marker_set_x_data, set_y_data => marker_set_y_data procedure :: set_z_data => marker_set_z_data, data_sources => marker_data_sources procedure :: set_markers, markers procedure :: set_marker_color, marker_color procedure :: set_marker_size, marker_size procedure :: set_marker_shape, marker_shape procedure :: set_marker_image, marker_image_file procedure :: set_auto_attenuate, auto_attenuate procedure :: set_point_colors => marker_set_point_colors, point_colors => marker_point_colors procedure :: drawn_color => marker_drawn_color procedure :: set_intermediate_type, intermediate_type procedure :: set_intermediate_spacing, intermediate_spacing procedure :: set_intermediate_direction, intermediate_direction procedure :: build => marker_build procedure :: update => marker_update procedure :: release => marker_release procedure :: num_intermediate, drawn_marker end type MarkerArtist