Draws a trajectory's points connected by a line (OpenFrames' CurveArtist). The x, y and z of the points come from data sources (default: the trajectory's positions). The line is in the artist's color, or in the trajectory's point colors if it has any (see the module documentation).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | color_(4) | = | [1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp] |
line color [r, g, b, a] (default white) |
|
| logical, | private | :: | default_data | = | .true. |
sources not set: the positions, per the DOF |
|
| type(HighlightStyle), | private | :: | highlight_ |
(see set_highlight) |
|||
| logical, | private | :: | lod_ | = | .true. |
level of detail (see set_level_of_detail) |
|
| integer, | private | :: | pattern_ | = | int(z'FFFF') |
16-bit dash pattern (z'FFFF': solid) |
|
| integer, | private | :: | pattern_factor | = | 1 |
window units per pattern bit (>= 1) |
|
| type(DataSource), | private | :: | sources_(3) |
x, y, z data sources (default: the positions) |
|||
| integer, | private | :: | tail_from | = | 0 |
the tail: from point tail_from toward tail_to |
|
| integer, | private | :: | tail_to | = | 0 |
the tail: from point tail_from toward tail_to |
|
| type(TrailStyle), | private | :: | trail_ |
(see set_trail) |
|||
| real(kind=wp), | private | :: | width_ | = | 1.0_wp |
line width (window units) |
The CurveArtist constructor: CurveArtist(...) makes one (see new_curve_artist for its
arguments).
A curve artist for traj (optional), drawn in color color ([r, g, b]
or [r, g, b, a]; default white) and width (window units; default 1).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Trajectory), | intent(in), | optional, | target | :: | traj |
the trajectory to draw (not owned) |
| real(kind=wp), | intent(in), | optional | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1); width (window units, default 1) |
|
| real(kind=wp), | intent(in), | optional | :: | width |
[r, g, b] or [r, g, b, a] (0 to 1); width (window units, default 1) |
The style: the artist's color, or white if the points' colors are drawn (the shader multiplies them by it).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self |
Create the chain of buffers (sized for the points now) and the trace
tail under group.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(inout) | :: | self | |||
| type(c_ptr), | intent(in) | :: | viewer |
compiles what is made later (null: nothing to) |
||
| type(c_ptr), | intent(in) | :: | group |
the artist's group |
The chain: a line strip.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
The line's color [r, g, b, a].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
The dash pattern's layout: DASH_SCENE, DASH_SCREEN or DASH_FIXED.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
The x, y and z data sources.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
The tail: from point k (the latest passed) to the point interpolated at time t toward point k2 (the next in time: k + 1, or k - 1 for decreasing times); none if either isn't a point written (before the start, or everything passed).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the current time |
||
| integer, | intent(in) | :: | k |
the tail's ends (0: none) |
||
| integer, | intent(in) | :: | k2 |
the tail's ends (0: none) |
The color of point i (1 to num_drawn) as drawn: read back from the line buffers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
the point (1 to num_drawn) |
The distance along the curve at point i (1 to num_drawn), as drawn (for the dash pattern): read back from the line buffers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
the point (1 to num_drawn) |
Point i (of the trajectory's: first_drawn to first_drawn + num_drawn - 1 drawn) as written: read back from the line buffers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
the trajectory point |
The first point drawn (1, or in trace mode of decreasing times the earliest point passed): points first_drawn .. first_drawn + num_drawn - 1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(in) | :: | self |
The trajectory drawn (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryArtist), | intent(in) | :: | self |
Whether the curve has a trail (set_trail).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
The curve's highlight: HIGHLIGHT_* (added; HIGHLIGHT_NONE: not highlighted).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
The chain (ChainArtist's), with the curve's level of detail.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self |
Whether level of detail is on.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
The error bounds of chunk j of the curve's points (for checks): how far the points skipped can be from the segments drawn at stride 2^k, k = 1, 2, ... (scene units).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | j |
the chunk (1 to num_chunks) |
The trace tail: a line of two points (white unless the points' colors are drawn).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
Number of buffers the artist is drawn with (0 until built).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(in) | :: | self |
Number of trajectory points drawn now (all of them, or in trace mode those passed).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(in) | :: | self |
The dash pattern: its factor and 16 pattern bits.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self | |||
| integer, | intent(out) | :: | factor |
window units per bit, 16 bits |
||
| integer, | intent(out) | :: | bits |
window units per bit, 16 bits |
Whether pick tests what this artist draws.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryArtist), | intent(in) | :: | self |
Whether a trajectory's colors are drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(in) | :: | self |
Number of points to draw (1 if all sources are zero: a point at the origin).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
Forget the render nodes: the chain and the tail (see artist_release).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(inout) | :: | self |
No trail: the whole curve (or trace mode, if set) again.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self |
The line's color: [r, g, b] (alpha unchanged) or [r, g, b, a], 0 to 1 (with the trajectory's point colors drawn: for points without one).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
How the dash pattern (and a trail's) is laid out: DASH_SCENE (the
default) anchored to the line: a dash stays put on it as the view
changes, its size in scene units (one per line and view, from 0.7 to
1.4 times the pattern's on screen, changing by doubling as it zooms);
DASH_SCREEN screen-locked, as OpenGL's line stipple (OpenFrames'):
every dash the pattern's length in pixels, at any zoom and depth,
sliding along the line as the view changes; DASH_FIXED a fixed
length of the line, as paint on it: never changing, so zooming in the
dashes grow on screen, and out they shrink (under a pixel, blending
into a fainter solid line); length (scene units, for the whole
pattern: the other patterns, a trail's future's and the arrows', in
proportion), else the pattern's length on screen where the line is
first drawn. DASH_SCREEN and DASH_FIXED cost projecting the points
drawn on the CPU, per view and frame.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | mode |
DASH_SCENE, DASH_SCREEN or DASH_FIXED |
||
| real(kind=wp), | intent(in), | optional | :: | length |
(DASH_FIXED) the pattern's length, scene units |
Highlight the curve (see the module documentation): mode a sum of
HIGHLIGHT_PULSE and HIGHLIGHT_ARROWS (HIGHLIGHT_NONE: not highlighted),
in color ([r, g, b] or [r, g, b, a]; default white). The other
settings are kept when not given.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | mode |
HIGHLIGHT_* (added) |
||
| real(kind=wp), | intent(in), | optional | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
|
| real(kind=wp), | intent(in), | optional | :: | arrow_spacing |
between arrows (window units; default 40) |
|
| real(kind=wp), | intent(in), | optional | :: | arrow_speed |
(window units per second; default 50) |
|
| real(kind=wp), | intent(in), | optional | :: | band_width |
of the arrows' band (window units; default 12) |
|
| real(kind=wp), | intent(in), | optional | :: | pulse_period |
(s; default 1.5) |
Level of detail (default on): seen from far away, the curve is drawn from every 2nd, 4th, ... point (and its last), as many as can be skipped while staying within half a pixel of all of them, chosen per view and per chunk of points. Off: every point is drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | enabled |
true: level of detail on (default) |
A dash pattern, as OpenGL's line stipple (OpenFrames' setPattern): each
bit of the 16-bit pattern (bit 0 first; z'FFFF', the default, is
solid) covers factor window units, along the whole curve (the dashes
run on across its points). The dashes' length on screen is kept within
0.7 to 1.4 times the pattern's (see shaders/line.vert).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | factor |
window units per bit (>= 1), 16 bits (z'FFFF': solid) |
||
| integer, | intent(in) | :: | pattern |
window units per bit (>= 1), 16 bits (z'FFFF': solid) |
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) |
Whether a trajectory with colors is drawn in them (default true); points without a color yet (colors arriving after positions) in the artist's color. A curve: each segment blended from its first point's color to its second's (with level of detail, a color lasting fewer points than are skipped may not show from far away); a surface: each point's pair in its color, times the artist's alpha. False: all in the artist's color.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | enabled |
true: the trajectory's colors |
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 |
A trail (see the module documentation): only the part within past
before the current time and future after it (s, >= 0; 0: none of
it; huge(1.0_wp): no limit), each fading out over the last fade (0
to 1, default 0.25) of its window toward its cutoff. Replaces trace
mode while set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | past |
s before and after the current time |
||
| real(kind=wp), | intent(in) | :: | future |
s before and after the current time |
||
| real(kind=wp), | intent(in), | optional | :: | fade |
of each part's window (default 0.25) |
The style of a trail's part, which TRAIL_PAST or TRAIL_FUTURE:
color ([r, g, b] or [r, g, b, a]: drawn in it instead of the line's
colors), opacity (its alpha multiplied by it: translucency, default
1), a dash pattern (factor and 16 pattern bits, as set_pattern;
default solid). Settings not given are kept.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | which |
TRAIL_PAST or TRAIL_FUTURE |
||
| real(kind=wp), | intent(in), | optional | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
|
| real(kind=wp), | intent(in), | optional | :: | opacity |
0 to 1 |
|
| integer, | intent(in), | optional | :: | factor |
window units per bit (>= 1), 16 bits |
|
| integer, | intent(in), | optional | :: | pattern |
window units per bit (>= 1), 16 bits |
Draw traj; with the default data sources, its positions (per its DOF).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| type(Trajectory), | intent(in), | target | :: | traj |
the trajectory to draw (not owned) |
The line's width in window units (logical pixels).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | width |
window units |
Where the x (y, z) of the points come from. Returns whether the trajectory has those data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the x data source |
Where the y of the points come from (see set_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the y data source |
Where the z of the points come from (see set_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the z data source |
In trace mode, the end of the line (the point at the current time) as drawn; false if no tail is drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self | |||
| real(kind=wp), | intent(out) | :: | v(3) |
the tail's end (frame coordinates) |
Whether only the part up to the current time is drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryArtist), | intent(in) | :: | self |
Write the points added (all of them on a redraw), and draw them all, or in trace mode those passed and the tail to the point at time t, or with a trail the window about time t.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the current time |
The line's width (window units).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(in) | :: | self |
Write points i1 .. i2 into the chain (and upload the chunks written to).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | i1 |
the trajectory points |
||
| integer, | intent(in) | :: | i2 |
the trajectory points |
type, extends(ChainArtist), public :: CurveArtist 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 real(wp) :: color_(4) = [1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp] !! line color [r, g, b, a] (default white) real(wp) :: width_ = 1.0_wp !! line width (window units) integer :: pattern_factor = 1 !! window units per pattern bit (>= 1) integer :: pattern_ = int(z'FFFF') !! 16-bit dash pattern (z'FFFF': solid) logical :: lod_ = .true. !! level of detail (see set_level_of_detail) type(HighlightStyle) :: highlight_ !! (see set_highlight) type(TrailStyle) :: trail_ !! (see set_trail) ! rendering (the chain: a line strip; the tail: a line of two points) integer :: tail_from = 0, tail_to = 0 !! the tail: from point tail_from toward tail_to contains procedure :: set_trajectory => curve_set_trajectory procedure :: set_x_data, set_y_data, set_z_data, data_sources procedure :: set_color => curve_set_color, color => curve_color procedure :: set_width => curve_set_width, width => curve_width procedure :: set_pattern => curve_set_pattern, pattern => curve_pattern procedure :: set_highlight => curve_set_highlight, highlight => curve_highlight procedure :: set_trail, remove_trail, has_trail, set_trail_style procedure :: set_dash_mode => curve_set_dash_mode, dash_mode => curve_dash_mode procedure :: set_level_of_detail, level_of_detail, lod_error procedure :: drawn_color procedure :: update => curve_update procedure :: drawn_point, drawn_distance, trace_end procedure :: init_chain => curve_init_chain procedure :: chain_kind => curve_chain_kind procedure :: points => curve_points procedure :: new_tail => curve_new_tail procedure :: apply_style => curve_style procedure :: write_points => write_curve procedure :: draw_tail => update_tail end type CurveArtist