Draws a translucent surface swept between two points at each point of a trajectory (not in OpenFrames): from the point given by the start data sources to the one given by the end data sources, with a quad between each point's pair and the next's. Default: from the frame's origin to the positions, sweeping out an orbit's plane (a fan, as the radius vectors of a SegmentArtist would fill it); other sources give e.g. a curtain from the positions down to a ground track stored as an optional. Unlit, seen from both sides, depth tested but writing no depth (as the equatorial plane of a RadialPlane), drawn to double precision as the curves (its edge on a CurveArtist's line through the same points).
Trace mode draws the surface up to the current time: the quads passed (a draw range, no upload) and one from the last point passed to the point interpolated at the time. Point colors: a trajectory with colors colors the surface, each point's pair in its color, with the artist's opacity (its alpha times theirs); see set_point_colors. A trajectory going round several times covers the surface again each time, so it gets more opaque: trace one revolution, or lower the alpha.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | color_(4) | = | [1.0_wp, 1.0_wp, 1.0_wp, 0.25_wp] |
surface color (default white, alpha 0.25) |
|
| logical, | private | :: | default_data | = | .true. |
sources not set: the origin to the positions, per the DOF |
|
| type(DataSource), | private | :: | end_(3) |
start and end points' x, y, z data sources |
|||
| type(DataSource), | private | :: | start_(3) |
start and end points' x, y, z data sources |
The RibbonArtist constructor: RibbonArtist(...) makes one (see new_ribbon_artist for its
arguments).
A ribbon artist for traj (optional), of color color ([r, g, b], alpha
unchanged, or [r, g, b, a]; default white, alpha 0.25), from the frame's
origin to the positions (see set_start_x_data, ... for others).
| 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; default white, alpha 0.25) |
The style: the artist's color, or white with its alpha if the points' colors are drawn (the shader multiplies them by it).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | 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 surface (a pair of points per trajectory point).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(in) | :: | self |
The surface's color [r, g, b, a].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(in) | :: | self |
The tail: the quad from the pair at point k to the pair interpolated at time t toward point k2 (as the curve's tail: none if either isn't a point written).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | 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 the pair at trajectory point i as drawn (rgba: the trajectory's color times the artist's alpha, or the artist's color).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
the trajectory point |
The pair at trajectory point i (1 to num_drawn) as drawn, its start a and end b: read back from the buffers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
the trajectory point (1 to num_drawn) |
||
| real(kind=wp), | intent(out) | :: | a(3) |
the pair's start and end (frame coordinates) |
||
| real(kind=wp), | intent(out) | :: | b(3) |
the pair's start and end (frame coordinates) |
The x, y and z data sources of the surface's end points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(in) | :: | self |
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 |
The chain, colored if the trajectory's colors are drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(inout) | :: | self |
The trace tail: a quad (white unless the points' colors are drawn).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | 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 |
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 trajectory points to draw the surface through (none if all sources are zero).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | 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 |
The surface's color: [r, g, b] (alpha unchanged) or [r, g, b, a]; its alpha is the surface's opacity (also with the trajectory's colors).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
Where the x of the surface's end points come from (see set_start_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the end points' x data source |
Where the y of the surface's end points come from (see set_start_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the end points' y data source |
Where the z of the surface's end points come from (see set_start_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the end points' z data source |
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 |
Where the x (y, z) of the surface's start (end) points come from. Returns whether the trajectory has the data of all sources.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the start points' x data source |
Where the y of the surface's start points come from (see set_start_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the start points' y data source |
Where the z of the surface's start points come from (see set_start_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
the start points' z data source |
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, from the origin to its
positions (per its DOF).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| type(Trajectory), | intent(in), | target | :: | traj |
the trajectory to draw (not owned) |
The x, y and z data sources of the surface's start points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(in) | :: | self |
In trace mode, the pair at the current time (the tail's end) as drawn; false if no tail is drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(in) | :: | self | |||
| real(kind=wp), | intent(out) | :: | a(3) |
the pair's start (frame coordinates) |
||
| real(kind=wp), | intent(out) | :: | b(3) |
its end |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the current time |
Write the pairs of trajectory points i1 .. i2 into the chain, with their colors (and upload the chunks written to).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | i1 |
the trajectory points |
||
| integer, | intent(in) | :: | i2 |
the trajectory points |
type, extends(ChainArtist), public :: RibbonArtist private type(DataSource) :: start_(3), end_(3) !! start and end points' x, y, z data sources logical :: default_data = .true. !! sources not set: the origin to the positions, per the DOF real(wp) :: color_(4) = [1.0_wp, 1.0_wp, 1.0_wp, 0.25_wp] !! surface color (default white, alpha 0.25) ! rendering: the chain a surface, trajectory point i its points 2i-1 (start) and 2i (end); the tail a quad contains procedure :: set_trajectory => ribbon_set_trajectory procedure :: set_start_x_data => ribbon_set_start_x_data, set_start_y_data => ribbon_set_start_y_data procedure :: set_start_z_data => ribbon_set_start_z_data procedure :: set_end_x_data => ribbon_set_end_x_data, set_end_y_data => ribbon_set_end_y_data procedure :: set_end_z_data => ribbon_set_end_z_data procedure :: start_data_sources => ribbon_start_data_sources, end_data_sources => ribbon_end_data_sources procedure :: set_color => ribbon_set_color, color => ribbon_color procedure :: drawn_pair, drawn_color => ribbon_drawn_color, trace_end => ribbon_trace_end procedure :: chain_kind => ribbon_chain_kind procedure :: points => ribbon_points procedure :: new_tail => ribbon_new_tail procedure :: apply_style => ribbon_style procedure :: write_points => write_ribbon procedure :: draw_tail => update_ribbon_tail end type RibbonArtist