vkf_artists Module

Trajectory artists: what draws a Trajectory, in a DrawableTrajectory frame, as OpenFrames' TrajectoryArtist, CurveArtist, SegmentArtist, MarkerArtist and DrawableTrajectory, and RibbonArtist (not in OpenFrames: a translucent surface swept between two points at each trajectory point, e.g. an orbit's plane from the origin to the positions).

A DrawableTrajectory is a frame (its points are in its coordinates) holding artists. Each frame update, an artist draws what changed in its trajectory: appended points are written into the GPU buffers in place, and only the buffers written to are uploaded (see vkf_line_chain); a cleared trajectory is redrawn into the same buffers. The last point drawn is always rewritten, since set_optional changes it.

Trace mode (set_trace_mode) draws only the part of the trajectory up to the current time: the points whose times are at most the current time, whatever order they were added in (a change of the draw ranges, no upload): for increasing times its first points, for decreasing ones (a trajectory propagated backwards) its last. A curve adds a two-point tail from the latest of them to the point interpolated at the current time (the only data uploaded each frame). So a trajectory propagated forwards and one propagated backwards to the same state trace one history as time runs (example/trace_directions.f90); with time running backwards, the history shrinks back. (A highlight's arrows still run in the order the points were added: the propagation's direction.)

Point colors (not in OpenFrames): a CurveArtist draws a trajectory with colors (add_color, or add's color) in them, each segment blended from its first point's color to its second's (one color: that color); without colors, or with set_point_colors(.false.), in its own color. Its line buffers hold colors only then.

Trails (not in OpenFrames): CurveArtist%set_trail(past, future, fade) draws only the part of the curve within past before the current time and future after it, each fading out over the last fade of its window toward its cutoff; set_trail_style(TRAIL_PAST or TRAIL_FUTURE, ...) gives each part its own color (or translucency) and dash pattern (e.g. a solid past and a dashed future). The GPU fades and cuts the line by its distance along it (shaders/line.vert): each frame only the distances at the current time and at the window's edges are uploaded (a few floats per chunk), and the range of points drawn changed. It replaces trace mode while set.

Highlight (not in OpenFrames; e.g. a trajectory selected by the program or by picking): set_highlight on a curve or segment artist, or on a DrawableTrajectory for all of them. HIGHLIGHT_PULSE: the line widens and brightens towards the highlight color, and back, over and over; HIGHLIGHT_ARROWS: a translucent band of the highlight color around it, with chevrons moving along it from its first point to its last (a trajectory's initial time to its final; a segment's start to its end). Both together: HIGHLIGHT_PULSE + HIGHLIGHT_ARROWS. The GPU animates them (shaders/ line.vert), so nothing is uploaded or computed each frame. In trace mode, only the part drawn is highlighted.

Artists and their trajectories are not owned: they must stay alive while drawn.

Picking (pick): a DrawableTrajectory picks what its artists draw, as drawn (in trace mode, up to the current time): a curve's segments (its chunks skipped by their bounds when far from the cursor), with the point and the time there (interpolated); a segment artist's segments; a marker artist's start, end and intermediate markers, with their times. Lines are reached within the tolerance plus half their width, markers plus half their size. Each artist gives its best hit: the closest to the cursor (and of those, the nearest).

Data in another frame (not in OpenFrames): a DrawableTrajectory's points are in its own coordinates, unless set_data_frame says which frame of the scene its trajectories' data are in. Each point is then drawn where it is in the drawable's frame at the point's own time: q = T(t_i) p_i, T(t) the transform from the data frame to the drawable's from both frames' poses at time t (vkf_frames' world_matrix_at: fixed poses, and followed trajectories' states at t). So a trajectory computed in an inertial frame is drawn in a rotating frame, or relative to a spacecraft's frame (its attitude the program's, e.g. LVLH), as it moves through that frame, with no second copy of its data. The frames are the program's own (vkframes builds none). Only the points written are transformed; when a frame's motion changes (vkf_frames' motion_key: a pose set, parents changed, what is followed, the followed data), or the drawable moves to another parent, all are written again. At the current time this agrees with the scene: a frame following the same data with follow(..., data_frame=) rides on the curve. Everything an artist draws from the data is in the data frame: a segment's relative end is added to its start before the transform, and zero sources are the data frame's origin. (A frame the program moves each frame has no history: its current pose is used for all times, and every move writes the points again.)


Uses

  • module~~vkf_artists~~UsesGraph module~vkf_artists vkf_artists iso_c_binding iso_c_binding module~vkf_artists->iso_c_binding module~vkf_frames vkf_frames module~vkf_artists->module~vkf_frames module~vkf_layer vkf_layer module~vkf_artists->module~vkf_layer module~vkf_line_chain vkf_line_chain module~vkf_artists->module~vkf_line_chain module~vkf_math vkf_math module~vkf_artists->module~vkf_math module~vkf_pick vkf_pick module~vkf_artists->module~vkf_pick module~vkf_trajectory vkf_trajectory module~vkf_artists->module~vkf_trajectory module~vkf_frames->iso_c_binding module~vkf_frames->module~vkf_layer module~vkf_frames->module~vkf_math module~vkf_frames->module~vkf_pick module~vkf_frames->module~vkf_trajectory module~vkf_follower vkf_follower module~vkf_frames->module~vkf_follower module~vkf_geometry vkf_geometry module~vkf_frames->module~vkf_geometry module~vkf_text vkf_text module~vkf_frames->module~vkf_text module~vkf_layer->iso_c_binding module~vkf_line_chain->iso_c_binding module~vkf_line_chain->module~vkf_layer module~vkf_line_chain->module~vkf_math iso_fortran_env iso_fortran_env module~vkf_math->iso_fortran_env module~vkf_pick->module~vkf_math module~vkf_trajectory->iso_c_binding module~vkf_trajectory->module~vkf_math module~vkf_trajectory->iso_fortran_env module~vkf_follower->module~vkf_math module~vkf_follower->module~vkf_trajectory module~vkf_geometry->iso_c_binding module~vkf_geometry->module~vkf_layer module~vkf_geometry->module~vkf_math module~vkf_text->iso_c_binding module~vkf_text->module~vkf_layer module~vkf_text->module~vkf_math module~vkf_files vkf_files module~vkf_text->module~vkf_files

Used by

  • module~~vkf_artists~~UsedByGraph module~vkf_artists vkf_artists module~vkf_handles vkf_handles module~vkf_handles->module~vkf_artists module~vkf_shapes vkf_shapes module~vkf_shapes->module~vkf_artists module~vkframes vkframes module~vkframes->module~vkf_artists module~vkframes->module~vkf_handles module~vkframes->module~vkf_shapes module~vkf_window vkf_window module~vkframes->module~vkf_window module~vkf_window->module~vkf_handles

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: DASH_FIXED = 2

a fixed length of the line, as paint on it (curves)

integer, public, parameter :: DASH_SCENE = 0

how a curve's or segments' dash pattern is laid out (set_dash_mode) anchored to the line (sizes in scene units; the default)

integer, public, parameter :: DASH_SCREEN = 1

screen-locked (a constant length in pixels; OpenGL's stipple)

integer, public, parameter :: HIGHLIGHT_ARROWS = 2

a band around the line, with arrows moving along it

integer, public, parameter :: HIGHLIGHT_NONE = 0

highlights of curve and segment artists (set_highlight; combine by adding) not highlighted

integer, public, parameter :: HIGHLIGHT_PULSE = 1

the line widens and brightens, and back, over and over

integer, public, parameter :: INTERMEDIATE_DATA = 3

every spacing-th data point

integer, public, parameter :: INTERMEDIATE_DISTANCE = 2

every spacing of arc length

integer, public, parameter :: INTERMEDIATE_TIME = 1

how intermediate markers are spaced (OpenFrames' IntermediateType) every spacing time units

integer, public, parameter :: MARKER_CIRCLE = 1

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_CIRCLE_PULSE = 7

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_DISK = 0

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_DISK_PULSE = 8

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_END = 4

which markers a MarkerArtist draws (OpenFrames' DrawnMarkers; combine with ior)

integer, public, parameter :: MARKER_IMAGE = 10

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_INTERMEDIATE = 2

which markers a MarkerArtist draws (OpenFrames' DrawnMarkers; combine with ior)

integer, public, parameter :: MARKER_PLUS = 3

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_ROSE = 6

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_SPIRAL = 9

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_SQUARE = 2

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_START = 1

which markers a MarkerArtist draws (OpenFrames' DrawnMarkers; combine with ior)

integer, public, parameter :: MARKER_TARGET = 5

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: MARKER_X = 4

marker shapes (OpenFrames' disk, image, and its Demos/Shaders/Marker_*.frag)

integer, public, parameter :: TRAIL_FUTURE = 2

the parts of a curve's trail (set_trail_style)

integer, public, parameter :: TRAIL_PAST = 1

the parts of a curve's trail (set_trail_style)


Interfaces

public interface CurveArtist

The CurveArtist constructor: CurveArtist(...) makes one (see new_curve_artist for its arguments).

  • private function new_curve_artist(traj, color, width) result(a)

    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).

    Arguments

    Type IntentOptional 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)

    Return Value type(CurveArtist)

public interface DrawableTrajectory

The DrawableTrajectory constructor: DrawableTrajectory(...) makes one (see new_drawable_trajectory for its arguments).

  • private function new_drawable_trajectory(name, color) result(d)

    A drawable trajectory frame named name (decorations of color color).

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    the frame's name

    real(kind=wp), intent(in), optional :: color(:)

    [r, g, b] or [r, g, b, a] (0 to 1)

    Return Value type(DrawableTrajectory)

public interface MarkerArtist

The MarkerArtist constructor: MarkerArtist(...) makes one (see new_marker_artist for its arguments).

  • private function new_marker_artist(traj, markers, size, color) result(a)

    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).

    Arguments

    Type IntentOptional 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]

    Return Value type(MarkerArtist)

public interface RibbonArtist

The RibbonArtist constructor: RibbonArtist(...) makes one (see new_ribbon_artist for its arguments).

  • private function new_ribbon_artist(traj, color) result(a)

    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).

    Arguments

    Type IntentOptional 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)

    Return Value type(RibbonArtist)

public interface SegmentArtist

The SegmentArtist constructor: SegmentArtist(...) makes one (see new_segment_artist for its arguments).

  • private function new_segment_artist(traj, color, width, stride) result(a)

    A segment artist for traj (optional), drawn in color color ([r, g, b] or [r, g, b, a]; default white) and width (window units; default 1), at every stride-th point (default 1).

    Arguments

    Type IntentOptional 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)

    integer, intent(in), optional :: stride

    a segment at every stride-th point (default 1)

    Return Value type(SegmentArtist)


Abstract Interfaces

abstract interface

  • private subroutine apply_style_interface(self)

    The style (the artist's color, width, ...) given to the chain and the tail.

    Arguments

    Type IntentOptional Attributes Name
    class(ChainArtist), intent(inout) :: self

abstract interface

  • private subroutine artist_build(self, viewer, group)

    Create the artist's render nodes under group. viewer (may be null) compiles the nodes it creates later.

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), 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

abstract interface

  • private subroutine artist_update(self, t)

    Bring the drawing up to date with the trajectory at simulation time t.

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(inout) :: self
    real(kind=wp), intent(in) :: t

    the current time

abstract interface

  • private pure function chain_kind_interface(self)

    The kind of chain (LineChain's CHAIN_STRIP or CHAIN_RIBBON).

    Arguments

    Type IntentOptional Attributes Name
    class(ChainArtist), intent(in) :: self

    Return Value integer

abstract interface

  • private function chain_points_interface(self) result(n)

    The number of trajectory points to draw (0 if none).

    Arguments

    Type IntentOptional Attributes Name
    class(ChainArtist), intent(in) :: self

    Return Value integer

abstract interface

  • private subroutine draw_tail_interface(self, t, k, k2)

    The trace tail: from point k (the latest passed) to the point interpolated at time t toward point k2 (the next in time); none if either isn't a point written.

    Arguments

    Type IntentOptional Attributes Name
    class(ChainArtist), 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)

abstract interface

  • private function new_tail_interface(self) result(node)

    The trace tail's node (null on failure), made with the chain.

    Arguments

    Type IntentOptional Attributes Name
    class(ChainArtist), intent(in) :: self

    Return Value type(c_ptr)

abstract interface

  • private subroutine write_points_interface(self, i1, i2)

    Write trajectory points i1 .. i2 into the chain (and upload the chunks written to).

    Arguments

    Type IntentOptional Attributes Name
    class(ChainArtist), intent(inout) :: self
    integer, intent(in) :: i1

    the trajectory points

    integer, intent(in) :: i2

    the trajectory points


Derived Types

type, private ::  ArtistPointer

One of a DrawableTrajectory's artists: a pointer to it (Fortran has no arrays of pointers) and the node it is drawn under.

Components

Type Visibility Attributes Name Initial
type(c_ptr), public :: group = c_null_ptr

the artist's node (null until built)

class(TrajectoryArtist), public, pointer :: p => null()

the artist (not owned)

type, private, abstract, extends(TrajectoryArtist) ::  ChainArtist

The base of the artists drawing a trajectory's points through one chain of buffers (CurveArtist: a line, a chain point per trajectory point; RibbonArtist: a surface, a pair of chain points per trajectory point): the chain and how much of it is written and drawn, the trace tail, the trajectory's colors, and the update (chain_update: the points written as they change, then drawn all or, in trace mode, those passed and the tail to the point at the current time). Each extension says what its chain is (chain_kind), how many points it draws (points), its tail's node (new_tail), its style (apply_style), how its points are written (write_points) and its tail drawn (draw_tail).

Components

Type Visibility Attributes Name Initial
type(LineChain), private :: chain

the buffers

logical, private :: compile = .false.

(chunks made later are compiled)

integer, private :: first_drawn_ = 1

the first of them (trace mode, decreasing times: later)

type(c_ptr), private :: group = c_null_ptr

the chain's group (to make it again, colored or not)

integer, private :: n_colored = 0

points written with the trajectory's own colors

integer, private :: n_drawn = 0

trajectory points drawn from it

integer, private :: n_written = 0

trajectory points written to the chain

logical, private :: point_colors_ = .true.

the trajectory's colors, if any (see set_point_colors)

type(c_ptr), private :: tail = c_null_ptr

to the point at the current time (trace mode)

logical, private :: tail_shown = .false.

the tail is drawn

real(kind=wp), private :: tail_time = huge(1.0_wp)

the time the tail was drawn for

Type-Bound Procedures

procedure(apply_style_interface), public, deferred :: apply_style
procedure, public :: build => chain_build
procedure(chain_kind_interface), public, deferred :: chain_kind
procedure(draw_tail_interface), public, deferred :: draw_tail
procedure, public :: first_drawn
procedure, public :: get_trajectory
procedure, public :: init_chain => chain_init
procedure(new_tail_interface), public, deferred :: new_tail
procedure, public :: num_chunks
procedure, public :: num_drawn
procedure, public :: pickable => artist_pickable
procedure, public :: point_colors
procedure(chain_points_interface), public, deferred :: points
procedure, public :: release => chain_release
procedure, public :: set_pickable => artist_set_pickable
procedure, public :: set_point_colors
procedure, public :: set_trace_mode
procedure, public :: set_trajectory
procedure, public :: trace_mode
procedure, public :: update => chain_update
procedure(write_points_interface), public, deferred :: write_points

type, public, extends(ChainArtist) ::  CurveArtist

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).

Components

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)

Constructor

The CurveArtist constructor: CurveArtist(...) makes one (see new_curve_artist for its arguments).

private function new_curve_artist (traj, color, width)

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-Bound Procedures

procedure, public :: apply_style => curve_style
procedure, public :: build => chain_build
procedure, public :: chain_kind => curve_chain_kind
procedure, public :: color => curve_color
procedure, public :: dash_mode => curve_dash_mode
procedure, public :: data_sources
procedure, public :: draw_tail => update_tail
procedure, public :: drawn_color
procedure, public :: drawn_distance
procedure, public :: drawn_point
procedure, public :: first_drawn
procedure, public :: get_trajectory
procedure, public :: has_trail
procedure, public :: highlight => curve_highlight
procedure, public :: init_chain => curve_init_chain
procedure, public :: level_of_detail
procedure, public :: lod_error
procedure, public :: new_tail => curve_new_tail
procedure, public :: num_chunks
procedure, public :: num_drawn
procedure, public :: pattern => curve_pattern
procedure, public :: pickable => artist_pickable
procedure, public :: point_colors
procedure, public :: points => curve_points
procedure, public :: release => chain_release
procedure, public :: remove_trail
procedure, public :: set_color => curve_set_color
procedure, public :: set_dash_mode => curve_set_dash_mode
procedure, public :: set_highlight => curve_set_highlight
procedure, public :: set_level_of_detail
procedure, public :: set_pattern => curve_set_pattern
procedure, public :: set_pickable => artist_set_pickable
procedure, public :: set_point_colors
procedure, public :: set_trace_mode
procedure, public :: set_trail
procedure, public :: set_trail_style
procedure, public :: set_trajectory => curve_set_trajectory
procedure, public :: set_width => curve_set_width
procedure, public :: set_x_data
procedure, public :: set_y_data
procedure, public :: set_z_data
procedure, public :: trace_end
procedure, public :: trace_mode
procedure, public :: update => curve_update
procedure, public :: width => curve_width
procedure, public :: write_points => write_curve

type, public, extends(ReferenceFrame) ::  DrawableTrajectory

A frame for drawing trajectories (OpenFrames' DrawableTrajectory): it holds artists, which draw in its coordinates.

Components

Type Visibility Attributes Name Initial
type(ArtistPointer), private, allocatable :: artists(:)

the artists (1:n_artists; not owned)

type(c_ptr), private :: contents_group = c_null_ptr

the artists' group (null until built)

class(ReferenceFrame), private, pointer :: data_frame_ => null()

the frame the data are in (null: this frame)

logical, private :: data_frame_ok = .false.

data_frame_ is in this frame's tree (checked each update)

integer, private :: n_artists = 0

number of artists

logical, private :: shown = .false.

built for a window (artists added later are compiled)

logical, private :: warned = .false.

warned that the data frame is in another tree

Constructor

The DrawableTrajectory constructor: DrawableTrajectory(...) makes one (see new_drawable_trajectory for its arguments).

private function new_drawable_trajectory (name, color)

A drawable trajectory frame named name (decorations of color color).

Type-Bound Procedures

procedure, public :: add_artist
procedure, public :: add_child
procedure, public :: artist
procedure, public :: attitude
procedure, public :: axes_labels_shown
procedure, public :: axes_shown
procedure, public :: axis_label
procedure, public :: bound
procedure, public :: build_contents => drawable_build_contents
procedure, public :: child
procedure, public :: child_index
procedure, public :: color
procedure, public :: contents_shown
procedure, public :: data_frame
procedure, public :: detach
procedure, public :: follow
procedure, public :: follow_frame
procedure, public :: follower
procedure, public :: frame_info => drawable_frame_info
procedure, public :: frame_string
procedure, public :: has_light_source
procedure, public :: is_following
procedure, public :: label_alignment
procedure, public :: label_font
procedure, public :: label_size
procedure, public :: late_update
procedure, public :: light_ambient
procedure, public :: light_diffuse
procedure, public :: light_source_enabled
procedure, public :: light_specular
procedure, public :: local_matrix
procedure, public :: local_matrix_at
procedure, public :: motion_key
procedure, public :: move_x_axis
procedure, public :: move_y_axis
procedure, public :: move_z_axis
procedure, public :: name
procedure, public :: name_label_on_top
procedure, public :: name_label_shown
procedure, public :: node
procedure, public :: num_artists
procedure, public :: num_children
procedure, public :: num_parents
procedure, public :: parent
procedure, public :: parent_index
procedure, public :: pick => drawable_pick
procedure, public :: pickable
procedure, public :: position
procedure, public :: position_of
procedure, public :: realize
procedure, public :: remove_all_artists
procedure, public :: remove_artist
procedure, public :: remove_child
procedure, public :: reposition_axes
procedure, public :: set_attitude
procedure, public :: set_color
procedure, public :: set_data_frame
procedure, public :: set_highlight => drawable_set_highlight
procedure, public :: set_label_alignment
procedure, public :: set_label_font
procedure, public :: set_label_size
procedure, public :: set_light_ambient
procedure, public :: set_light_diffuse
procedure, public :: set_light_source_enabled
procedure, public :: set_light_specular
procedure, public :: set_name
procedure, public :: set_name_label_on_top
procedure, public :: set_pickable
procedure, public :: set_position
procedure, public :: set_x_label
procedure, public :: set_y_label
procedure, public :: set_z_label
procedure, public :: show_axes
procedure, public :: show_axes_labels
procedure, public :: show_contents
procedure, public :: show_decorations
procedure, public :: show_name_label
procedure, public :: sync
procedure, public :: unfollow
procedure, public :: update => drawable_update
procedure, public :: world_matrix
procedure, public :: world_matrix_at

type, private ::  HighlightStyle

A line artist's highlight (see the module documentation and set_highlight).

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: arrow_spacing = 40.0_wp

between arrows (window units)

real(kind=wp), public :: arrow_speed = 50.0_wp

window units per second

real(kind=wp), public :: band_width = 12.0_wp

(window units)

real(kind=wp), public :: color(4) = [1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp]

[r, g, b, a] (default white)

integer, public :: mode = HIGHLIGHT_NONE

HIGHLIGHT_* (added)

real(kind=wp), public :: pulse_period = 1.5_wp

(s)

type, public, extends(TrajectoryArtist) ::  MarkerArtist

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).

Components

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

Constructor

The MarkerArtist constructor: MarkerArtist(...) makes one (see new_marker_artist for its arguments).

private function new_marker_artist (traj, markers, size, color)

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-Bound Procedures

procedure, public :: auto_attenuate
procedure, public :: build => marker_build
procedure, public :: data_sources => marker_data_sources
procedure, public :: drawn_color => marker_drawn_color
procedure, public :: drawn_marker
procedure, public :: get_trajectory
procedure, public :: intermediate_direction
procedure, public :: intermediate_spacing
procedure, public :: intermediate_type
procedure, public :: marker_color
procedure, public :: marker_image_file
procedure, public :: marker_shape
procedure, public :: marker_size
procedure, public :: markers
procedure, public :: num_intermediate
procedure, public :: pickable => artist_pickable
procedure, public :: point_colors => marker_point_colors
procedure, public :: release => marker_release
procedure, public :: set_auto_attenuate
procedure, public :: set_intermediate_direction
procedure, public :: set_intermediate_spacing
procedure, public :: set_intermediate_type
procedure, public :: set_marker_color
procedure, public :: set_marker_image
procedure, public :: set_marker_shape
procedure, public :: set_marker_size
procedure, public :: set_markers
procedure, public :: set_pickable => artist_set_pickable
procedure, public :: set_point_colors => marker_set_point_colors
procedure, public :: set_trace_mode
procedure, public :: set_trajectory => marker_set_trajectory
procedure, public :: set_x_data => marker_set_x_data
procedure, public :: set_y_data => marker_set_y_data
procedure, public :: set_z_data => marker_set_z_data
procedure, public :: trace_mode
procedure, public :: update => marker_update

type, public, extends(ChainArtist) ::  RibbonArtist

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).

Read more…

Components

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

Constructor

The RibbonArtist constructor: RibbonArtist(...) makes one (see new_ribbon_artist for its arguments).

private function new_ribbon_artist (traj, color)

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-Bound Procedures

procedure, public :: apply_style => ribbon_style
procedure, public :: build => chain_build
procedure, public :: chain_kind => ribbon_chain_kind
procedure, public :: color => ribbon_color
procedure, public :: draw_tail => update_ribbon_tail
procedure, public :: drawn_color => ribbon_drawn_color
procedure, public :: drawn_pair
procedure, public :: end_data_sources => ribbon_end_data_sources
procedure, public :: first_drawn
procedure, public :: get_trajectory
procedure, public :: init_chain => chain_init
procedure, public :: new_tail => ribbon_new_tail
procedure, public :: num_chunks
procedure, public :: num_drawn
procedure, public :: pickable => artist_pickable
procedure, public :: point_colors
procedure, public :: points => ribbon_points
procedure, public :: release => chain_release
procedure, public :: set_color => ribbon_set_color
procedure, public :: set_end_x_data => ribbon_set_end_x_data
procedure, public :: set_end_y_data => ribbon_set_end_y_data
procedure, public :: set_end_z_data => ribbon_set_end_z_data
procedure, public :: set_pickable => artist_set_pickable
procedure, public :: set_point_colors
procedure, public :: set_start_x_data => ribbon_set_start_x_data
procedure, public :: set_start_y_data => ribbon_set_start_y_data
procedure, public :: set_start_z_data => ribbon_set_start_z_data
procedure, public :: set_trace_mode
procedure, public :: set_trajectory => ribbon_set_trajectory
procedure, public :: start_data_sources => ribbon_start_data_sources
procedure, public :: trace_end => ribbon_trace_end
procedure, public :: trace_mode
procedure, public :: update => chain_update
procedure, public :: write_points => write_ribbon

type, public, extends(TrajectoryArtist) ::  SegmentArtist

Draws a line segment at every stride-th point of a trajectory (OpenFrames' SegmentArtist), from the point given by the start data sources to the one given by the end data sources: e.g. radius vectors (the origin to the positions), or from the positions to points stored as an optional (a target). Default (an addition to OpenFrames, which draws nothing until the sources are set): from the frame's origin to the trajectory's positions.

Read more…

Components

Type Visibility Attributes Name Initial
type(LineChain), private :: chain

the line buffers (a pair of points per segment)

real(kind=wp), private :: color_(4) = [1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp]

segment color [r, g, b, a] (default white)

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

logical, private :: end_relative_ = .false.

the end sources: an offset from the start

integer, private :: first_drawn_ = 1

the first of them (trace mode, decreasing times: later)

type(HighlightStyle), private :: highlight_

(see set_highlight)

integer, private :: n_drawn = 0

segments drawn from it

integer, private :: n_written = 0

segments written to the chain

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 :: start_(3)

start and end points' x, y, z data sources

integer, private :: stride_ = 1

a segment at every stride_-th point (>= 1)

real(kind=wp), private :: width_ = 1.0_wp

segment width (window units)

Constructor

The SegmentArtist constructor: SegmentArtist(...) makes one (see new_segment_artist for its arguments).

private function new_segment_artist (traj, color, width, stride)

A segment artist for traj (optional), drawn in color color ([r, g, b] or [r, g, b, a]; default white) and width (window units; default 1), at every stride-th point (default 1).

Type-Bound Procedures

procedure, public :: build => segment_build
procedure, public :: color => segment_color
procedure, public :: dash_mode => segment_dash_mode
procedure, public :: drawn_segment
procedure, public :: end_data_sources
procedure, public :: end_relative
procedure, public :: first_drawn => segment_first_drawn
procedure, public :: get_trajectory
procedure, public :: highlight => segment_highlight
procedure, public :: num_chunks => segment_num_chunks
procedure, public :: num_drawn => segment_num_drawn
procedure, public :: pattern => segment_pattern
procedure, public :: pickable => artist_pickable
procedure, public :: release => segment_release
procedure, public :: set_color => segment_set_color
procedure, public :: set_dash_mode => segment_set_dash_mode
procedure, public :: set_end_data
procedure, public :: set_end_relative
procedure, public :: set_end_scale
procedure, public :: set_end_x_data
procedure, public :: set_end_y_data
procedure, public :: set_end_z_data
procedure, public :: set_highlight => segment_set_highlight
procedure, public :: set_pattern => segment_set_pattern
procedure, public :: set_pickable => artist_set_pickable
procedure, public :: set_start_data
procedure, public :: set_start_x_data
procedure, public :: set_start_y_data
procedure, public :: set_start_z_data
procedure, public :: set_stride
procedure, public :: set_trace_mode
procedure, public :: set_trajectory => segment_set_trajectory
procedure, public :: set_width => segment_set_width
procedure, public :: start_data_sources
procedure, public :: stride
procedure, public :: trace_mode
procedure, public :: update => segment_update
procedure, public :: width => segment_width

type, private ::  TrailStyle

A curve's trail (see the module documentation and set_trail).

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: color(4,2) = 1.0_wp

each part's color (if replace) [r, g, b, a]

integer, public :: factor(2) = 1

each part's dash pattern

real(kind=wp), public :: fade = 0.25_wp

of each part's window, faded toward its cutoff (0 to 1)

real(kind=wp), public :: future = 0.0_wp

the window (s before and after the current time; huge: no limit)

logical, public :: on = .false.
real(kind=wp), public :: opacity(2) = 1.0_wp

each part's alpha multiplied by it

real(kind=wp), public :: past = 0.0_wp

the window (s before and after the current time; huge: no limit)

integer, public :: pattern(2) = int(z'FFFF')

each part's dash pattern

logical, public :: replace(2) = .false.

each part in its own color (else the line's)

type, public, abstract ::  TrajectoryArtist

The base of the trajectory artists (OpenFrames' TrajectoryArtist).

Components

Type Visibility Attributes Name Initial
class(ReferenceFrame), private, pointer :: data_frame => null()

the frame the data are in (null: shown_in's)

logical, private :: pickable_ = .true.

picked (pick)

class(ReferenceFrame), private, pointer :: seen_data_frame => null()

the data frame drawn for

integer, private :: seen_generation = -1

trajectory generation and revision drawn (-1: none)

integer, private :: seen_motion(4) = -1

both frames' motion keys drawn for (-1: not transformed)

integer, private :: seen_revision = -1

trajectory generation and revision drawn (-1: none)

class(ReferenceFrame), private, pointer :: shown_in => null()

the DrawableTrajectory drawing it (its points' coordinates)

logical, private :: trace = .false.

trace mode: drawn up to the current time

type(Trajectory), private, pointer :: traj => null()

the trajectory drawn (not owned; null if none)

Type-Bound Procedures

procedure(artist_build), public, deferred :: build
procedure, public :: get_trajectory
procedure, public :: pickable => artist_pickable
procedure, public :: release => artist_release
procedure, public :: set_pickable => artist_set_pickable
procedure, public :: set_trace_mode
procedure, public :: set_trajectory
procedure, public :: trace_mode
procedure(artist_update), public, deferred :: update

Functions

private function art_point(self, i, sources) result(v)

Point i from sources, in the drawable's coordinates.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self
integer, intent(in) :: i

the point

type(DataSource), intent(in) :: sources(3)

where the components come from

Return Value real(kind=wp), (3)

private function art_point_between(self, k, k2, t, sources) result(v)

The point at time t between points k and k2 (interpolated in the data frame), in the drawable's coordinates (by the transform at time t).

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self
integer, intent(in) :: k

the points

integer, intent(in) :: k2

the points

real(kind=wp), intent(in) :: t

the time

type(DataSource), intent(in) :: sources(3)

where the components come from

Return Value real(kind=wp), (3)

private function artist(self, i) result(a)

Artist i (1 to num_artists).

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(in) :: self
integer, intent(in) :: i

the artist (1 to num_artists)

Return Value class(TrajectoryArtist), pointer

private pure function artist_pickable(self)

Whether pick tests what this artist draws.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self

Return Value logical

private pure function auto_attenuate(self)

Whether the markers are auto-attenuated.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value logical

private pure function better(pixels, depth, best_pixels, best_depth)

A candidate closer to the cursor than the best so far (or as close, and nearer).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: pixels

the candidate's distance from the cursor (pixels)

real(kind=wp), intent(in) :: depth

its depth

real(kind=wp), intent(in) :: best_pixels

the best hit's so far (pixels)

real(kind=wp), intent(in) :: best_depth

the best hit's depth

Return Value logical

private pure function chain_points_per_point(self) result(m)

Chain points per trajectory point: 1, or 2 for a surface (a pair each).

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(in) :: self

Return Value integer

private function color_at(self, t, own) result(rgba)

The trajectory's color at time t (between points i and i + 1: blended), own for points without one.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(in) :: self
real(kind=wp), intent(in) :: t

the time; the color for points without one

real(kind=wp), intent(in) :: own(4)

the time; the color for points without one

Return Value real(kind=wp), (4)

private pure function counted(self, j, n)

Index of the j-th point counted in the intermediate markers' direction.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(in) :: self
integer, intent(in) :: j

position in the counting order (1 to n); number of points

integer, intent(in) :: n

position in the counting order (1 to n); number of points

Return Value integer

private pure function curve_chain_kind(self)

The chain: a line strip.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value integer

private pure function curve_color(self) result(c)

The line's color [r, g, b, a].

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value real(kind=wp), (4)

private pure function curve_dash_mode(self) result(mode)

The dash pattern's layout: DASH_SCENE, DASH_SCREEN or DASH_FIXED.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value integer

private pure function curve_highlight(self) result(mode)

The curve's highlight: HIGHLIGHT_* (added; HIGHLIGHT_NONE: not highlighted).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value integer

private function curve_new_tail(self) result(node)

The trace tail: a line of two points (white unless the points' colors are drawn).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value type(c_ptr)

private function curve_points(self) result(n)

Number of points to draw (1 if all sources are zero: a point at the origin).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value integer

private pure function curve_width(self)

The line's width (window units).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value real(kind=wp)

private function data_changed(self, redraw) result(changed)

Whether the trajectory changed since last drawn; redraw if everything must be drawn again (cleared, or a new trajectory or data sources).

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(inout) :: self
logical, intent(out) :: redraw

true: everything must be drawn again

Return Value logical

private function data_frame(self) result(f)

The frame the data are in (set_data_frame; null: this frame).

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(in) :: self

Return Value class(ReferenceFrame), pointer

private pure function data_sources(self) result(s)

The x, y and z data sources.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value type(DataSource), (3)

private function data_to_shown(self, t) result(m)

The transform from the data frame's coordinates to the drawable's at time t.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self
real(kind=wp), intent(in) :: t

simulation time

Return Value real(kind=wp), (4,4)

private function decreasing_times(traj, n)

Whether points 1 .. n have decreasing times (a trajectory propagated backwards).

Arguments

Type IntentOptional Attributes Name
type(Trajectory), intent(in) :: traj

the trajectory

integer, intent(in) :: n

the points considered (1 .. n)

Return Value logical

private function drawable_frame_info(self) result(info)

What kind of frame this is: 'DrawableTrajectory'.

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(in) :: self

Return Value character(len=:), allocatable

private function drawn_color(self, i) result(rgba)

The color of point i (1 to num_drawn) as drawn: read back from the line buffers.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self
integer, intent(in) :: i

the point (1 to num_drawn)

Return Value real(kind=wp), (4)

private function drawn_distance(self, i) result(s)

The distance along the curve at point i (1 to num_drawn), as drawn (for the dash pattern): read back from the line buffers.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self
integer, intent(in) :: i

the point (1 to num_drawn)

Return Value real(kind=wp)

private function drawn_marker(self, which, v, i) result(shown)

Where marker which (MARKER_START, MARKER_END, or MARKER_INTERMEDIATE number i) is drawn, read back from its buffer; false if not drawn.

Arguments

Type IntentOptional 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)

Return Value logical

private function drawn_point(self, i) result(v)

Point i (of the trajectory's: first_drawn to first_drawn + num_drawn - 1 drawn) as written: read back from the line buffers.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self
integer, intent(in) :: i

the trajectory point

Return Value real(kind=wp), (3)

private pure function end_data_sources(self) result(s)

The x, y and z data sources of the segments' end points.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value type(DataSource), (3)

private pure function end_relative(self)

Whether the ends are relative (see set_end_relative).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value logical

private function end_rgba(self, i, own) result(rgba)

The color of point i for a start or end marker: the trajectory's (its own if none), with point colors.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(in) :: self
integer, intent(in) :: i

the trajectory point

real(kind=wp), intent(in) :: own(4)

the marker's own color

Return Value real(kind=wp), (4)

private pure function first_drawn(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.

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(in) :: self

Return Value integer

private function get_trajectory(self) result(traj)

The trajectory drawn (null if none).

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self

Return Value type(Trajectory), pointer

private pure function has_trail(self)

Whether the curve has a trail (set_trail).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value logical

private pure function intermediate_direction(self)

Where intermediate markers are counted from (MARKER_START or MARKER_END).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value integer

private pure function intermediate_spacing(self)

Spacing of intermediate markers.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value real(kind=wp)

private pure function intermediate_type(self)

How intermediate markers are spaced (INTERMEDIATE_*).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value integer

private pure function is_position_xyz(s)

The sources are x, y, z of the position, unscaled.

Arguments

Type IntentOptional Attributes Name
type(DataSource), intent(in) :: s(3)

x, y, z data sources

Return Value logical

private pure function level_of_detail(self)

Whether level of detail is on.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self

Return Value logical

private function lod_error(self, j) result(error)

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).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self
integer, intent(in) :: j

the chunk (1 to num_chunks)

Return Value real(kind=wp), allocatable, (:)

private pure function marker_color(self, which) result(c)

The color of the start, intermediate or end markers (which: one MARKER_* flag).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self
integer, intent(in) :: which

MARKER_START, MARKER_INTERMEDIATE or MARKER_END

Return Value real(kind=wp), (4)

private pure function marker_data_sources(self) result(s)

The x, y and z data sources.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value type(DataSource), (3)

private function marker_drawn_color(self, which, k) result(rgba)

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.

Arguments

Type IntentOptional 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)

Return Value real(kind=wp), (4)

private function marker_image_file(self) result(file)

The marker image file ('' for none).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value character(len=:), allocatable

private function marker_point(self, i, zero) result(v)

Point i from the data sources (the origin if zero).

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(in) :: self
integer, intent(in) :: i

the trajectory point

logical, intent(in) :: zero

all sources zero, or no trajectory: the origin

Return Value real(kind=wp), (3)

private pure function marker_point_colors(self)

Whether the trajectory's colors are drawn (set_point_colors).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value logical

private function marker_set_x_data(self, src) result(valid)

Where the x (y, z) of the markers come from. Returns whether the trajectory has those data.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the x data source

Return Value logical

private function marker_set_y_data(self, src) result(valid)

Where the y of the markers come from (see set_x_data).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the y data source

Return Value logical

private function marker_set_z_data(self, src) result(valid)

Where the z of the markers come from (see set_x_data).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the z data source

Return Value logical

private pure function marker_shape(self)

Marker shape (a MARKER_* shape constant).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value integer

private pure function marker_size(self)

Marker size (window units).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value real(kind=wp)

private function marker_uses_colors(self)

Whether the markers are drawn in the trajectory's colors: wanted, and it has some.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(in) :: self

Return Value logical

private pure function markers(self)

Which markers are drawn (an ior of MARKER_* flags).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value integer

private recursive function moves(f) result(m)

Whether a frame moves in time: it or an ancestor (first parents) follows trajectories.

Arguments

Type IntentOptional Attributes Name
class(ReferenceFrame), intent(in) :: f

the frame

Return Value logical

private function new_curve_artist(traj, color, width) result(a)

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).

Arguments

Type IntentOptional 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)

Return Value type(CurveArtist)

private function new_drawable_trajectory(name, color) result(d)

A drawable trajectory frame named name (decorations of color color).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

the frame's name

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

Return Value type(DrawableTrajectory)

private function new_marker_artist(traj, markers, size, color) result(a)

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).

Arguments

Type IntentOptional 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]

Return Value type(MarkerArtist)

private function new_ribbon_artist(traj, color) result(a)

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).

Arguments

Type IntentOptional 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)

Return Value type(RibbonArtist)

private function new_segment_artist(traj, color, width, stride) result(a)

A segment artist for traj (optional), drawn in color color ([r, g, b] or [r, g, b, a]; default white) and width (window units; default 1), at every stride-th point (default 1).

Arguments

Type IntentOptional 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)

integer, intent(in), optional :: stride

a segment at every stride-th point (default 1)

Return Value type(SegmentArtist)

private pure function num_artists(self)

Number of artists.

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(in) :: self

Return Value integer

private pure function num_chunks(self)

Number of buffers the artist is drawn with (0 until built).

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(in) :: self

Return Value integer

private pure function num_drawn(self)

Number of trajectory points drawn now (all of them, or in trace mode those passed).

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(in) :: self

Return Value integer

private pure function num_intermediate(self)

Number of intermediate markers drawn now.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in) :: self

Return Value integer

private pure function point_colors(self)

Whether a trajectory's colors are drawn.

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(in) :: self

Return Value logical

private function point_rgba(self, i) result(rgba)

Color of point i as drawn by a colored chain: the trajectory's, or the artist's if it has none yet.

Arguments

Type IntentOptional Attributes Name
type(CurveArtist), intent(in) :: self
integer, intent(in) :: i

the trajectory point

Return Value real(kind=wp), (4)

private pure function point_rgba_or(traj, i, own) result(rgba)

Color of point i: the trajectory's, or own if it has none yet.

Arguments

Type IntentOptional Attributes Name
type(Trajectory), intent(in) :: traj

the trajectory

integer, intent(in) :: i

the point

real(kind=wp), intent(in) :: own(4)

the color if it has none

Return Value real(kind=wp), (4)

private pure function ribbon_chain_kind(self)

The chain: a surface (a pair of points per trajectory point).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(in) :: self

Return Value integer

private pure function ribbon_color(self) result(c)

The surface's color [r, g, b, a].

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(in) :: self

Return Value real(kind=wp), (4)

private function ribbon_drawn_color(self, i) result(rgba)

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).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(in) :: self
integer, intent(in) :: i

the trajectory point

Return Value real(kind=wp), (4)

private pure function ribbon_end_data_sources(self) result(s)

The x, y and z data sources of the surface's end points.

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(in) :: self

Return Value type(DataSource), (3)

private function ribbon_new_tail(self) result(node)

The trace tail: a quad (white unless the points' colors are drawn).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(in) :: self

Return Value type(c_ptr)

private function ribbon_point_rgba(self, i) result(rgba)

Color of point i in a colored chain: the trajectory's, or the artist's (opaque: the style has the alpha) if it has none yet.

Arguments

Type IntentOptional Attributes Name
type(RibbonArtist), intent(in) :: self
integer, intent(in) :: i

the trajectory point

Return Value real(kind=wp), (4)

private function ribbon_points(self) result(n)

Number of trajectory points to draw the surface through (none if all sources are zero).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(in) :: self

Return Value integer

private function ribbon_set_end_x_data(self, src) result(valid)

Where the x of the surface's end points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the end points' x data source

Return Value logical

private function ribbon_set_end_y_data(self, src) result(valid)

Where the y of the surface's end points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the end points' y data source

Return Value logical

private function ribbon_set_end_z_data(self, src) result(valid)

Where the z of the surface's end points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the end points' z data source

Return Value logical

private function ribbon_set_start_x_data(self, src) result(valid)

Where the x (y, z) of the surface's start (end) points come from. Returns whether the trajectory has the data of all sources.

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the start points' x data source

Return Value logical

private function ribbon_set_start_y_data(self, src) result(valid)

Where the y of the surface's start points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the start points' y data source

Return Value logical

private function ribbon_set_start_z_data(self, src) result(valid)

Where the z of the surface's start points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the start points' z data source

Return Value logical

private pure function ribbon_start_data_sources(self) result(s)

The x, y and z data sources of the surface's start points.

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(in) :: self

Return Value type(DataSource), (3)

private function ribbon_trace_end(self, a, b)

In trace mode, the pair at the current time (the tail's end) as drawn; false if no tail is drawn.

Arguments

Type IntentOptional 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

Return Value logical

private function root_of(f) result(r)

The root of a frame's tree (through first parents).

Arguments

Type IntentOptional Attributes Name
class(ReferenceFrame), intent(in), target :: f

the frame

Return Value class(ReferenceFrame), pointer

private function same_pointer(a, b)

Whether two frame pointers are both null or point to the same frame.

Arguments

Type IntentOptional Attributes Name
class(ReferenceFrame), intent(in), pointer :: a

the pointers

class(ReferenceFrame), intent(in), pointer :: b

the pointers

Return Value logical

private pure function segment_color(self) result(c)

The segments' color [r, g, b, a].

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value real(kind=wp), (4)

private function segment_count(self) result(m)

Number of segments to draw (none if all sources are zero).

Arguments

Type IntentOptional Attributes Name
type(SegmentArtist), intent(in) :: self

Return Value integer

private pure function segment_dash_mode(self) result(mode)

The dash pattern's layout: DASH_SCENE or DASH_SCREEN.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value integer

private pure function segment_first_drawn(self)

The first segment drawn (1, or in trace mode of decreasing times the earliest passed): segments first_drawn .. first_drawn + num_drawn - 1.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value integer

private pure function segment_highlight(self) result(mode)

The segments' highlight: HIGHLIGHT_* (added; HIGHLIGHT_NONE: not highlighted).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value integer

private pure function segment_num_chunks(self)

Number of line buffers the segments are drawn with (0 until built).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value integer

private pure function segment_num_drawn(self)

Number of segments drawn now (all of them, or in trace mode those at the points passed).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value integer

private pure function segment_width(self)

The segments' width (window units).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value real(kind=wp)

private function set_curve_source(self, k, src) result(valid)

Set data source k (1: x, 2: y, 3: z); returns whether the trajectory has the data.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
integer, intent(in) :: k

the component (1: x, 2: y, 3: z)

type(DataSource), intent(in) :: src

its data source

Return Value logical

private function set_end_data(self, src) result(valid)

All three end sources at once (see set_start_data).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(DataSource), intent(in) :: src(3)

the end points' x, y, z data sources

Return Value logical

private function set_end_x_data(self, src) result(valid)

Where the x of the segments' end points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the end points' x data source

Return Value logical

private function set_end_y_data(self, src) result(valid)

Where the y of the segments' end points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the end points' y data source

Return Value logical

private function set_end_z_data(self, src) result(valid)

Where the z of the segments' end points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the end points' z data source

Return Value logical

private function set_marker_image(self, file) result(ok)

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).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
character(len=*), intent(in) :: file

the image file ('': a disk again)

Return Value logical

private function set_marker_source(self, k, src) result(valid)

Set data source k (1: x, 2: y, 3: z), redrawing the markers; returns whether the trajectory has the data.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
integer, intent(in) :: k

the component (1: x, 2: y, 3: z)

type(DataSource), intent(in) :: src

its data source

Return Value logical

private function set_ribbon_source(self, side, k, src) result(valid)

Set component k of the start (side 1) or end (side 2) sources.

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
integer, intent(in) :: side

1: start, 2: end; the component (1: x, 2: y, 3: z)

integer, intent(in) :: k

1: start, 2: end; the component (1: x, 2: y, 3: z)

type(DataSource), intent(in) :: src

its data source

Return Value logical

private function set_segment_source(self, side, k, src) result(valid)

Set component k of the start (side 1) or end (side 2) sources.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
integer, intent(in) :: side

1: start, 2: end; the component (1: x, 2: y, 3: z)

integer, intent(in) :: k

1: start, 2: end; the component (1: x, 2: y, 3: z)

type(DataSource), intent(in) :: src

its data source

Return Value logical

private function set_start_data(self, src) result(valid)

All three start (end) sources at once, e.g. position_sources(3) or optional_sources(1). Returns whether the trajectory has their data.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(DataSource), intent(in) :: src(3)

the start points' x, y, z data sources

Return Value logical

private function set_start_x_data(self, src) result(valid)

Where the x (y, z) of the segments' start (end) points come from. Returns whether the trajectory has the data of all sources.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the start points' x data source

Return Value logical

private function set_start_y_data(self, src) result(valid)

Where the y of the segments' start points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the start points' y data source

Return Value logical

private function set_start_z_data(self, src) result(valid)

Where the z of the segments' start points come from (see set_start_x_data).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the start points' z data source

Return Value logical

private function set_x_data(self, src) result(valid)

Where the x (y, z) of the points come from. Returns whether the trajectory has those data.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the x data source

Return Value logical

private function set_y_data(self, src) result(valid)

Where the y of the points come from (see set_x_data).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the y data source

Return Value logical

private function set_z_data(self, src) result(valid)

Where the z of the points come from (see set_x_data).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
type(DataSource), intent(in) :: src

the z data source

Return Value logical

private function source_points(traj, sources) result(n)

Number of points the data sources give: 0 for invalid sources or no trajectory, huge() if all are zero.

Arguments

Type IntentOptional Attributes Name
type(Trajectory), intent(in), pointer :: traj

the trajectory (null: none)

type(DataSource), intent(in) :: sources(3)

x, y, z data sources

Return Value integer

private pure function start_data_sources(self) result(s)

The x, y and z data sources of the segments' start points.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value type(DataSource), (3)

private pure function stride(self)

The stride: a segment at every stride-th point.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self

Return Value integer

private function trace_end(self, v)

In trace mode, the end of the line (the point at the current time) as drawn; false if no tail is drawn.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in) :: self
real(kind=wp), intent(out) :: v(3)

the tail's end (frame coordinates)

Return Value logical

private pure function trace_mode(self)

Whether only the part up to the current time is drawn.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self

Return Value logical

private function transformed(self)

Whether the artist's data are in another frame than the drawable's (DrawableTrajectory's set_data_frame), so its points are transformed.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self

Return Value logical

private function uses_colors(self)

Whether the trajectory's colors are drawn: wanted, and it has some.

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(in) :: self

Return Value logical

private function write_changed(self, changed) result(built)

The points written as the trajectory changed: the chain made again if its colors are drawn now or no longer (its first colors, or the setting), then the points new since the last written (and the last one again: set_optional; and those whose colors came since), or all of them on a redraw (cleared, a new trajectory or data sources). False if the chain isn't built.

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(inout) :: self
logical, intent(out) :: changed

points written (or the chain emptied)

Return Value logical


Subroutines

private subroutine add_artist(self, a)

Add an artist (it must stay alive while added). Artists added after the frame is shown are built and compiled at the next update.

Read more…

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(inout) :: self
class(TrajectoryArtist), intent(in), target :: a

the artist to add (not owned)

private subroutine add_intermediates(self, n)

Compute the intermediate markers not computed yet (all of them when counted from the end), and write them.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
integer, intent(in) :: n

the points

private subroutine apply_highlight(h, chain)

Give the highlight h to the line buffers chain.

Arguments

Type IntentOptional Attributes Name
type(HighlightStyle), intent(in) :: h

the highlight

type(LineChain), intent(inout) :: chain

the line buffers given it

private subroutine art_points(self, i1, i2, sources, v, stride)

Points i1 .. i2 (every stride-th) from sources, in the drawable's coordinates.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self
integer, intent(in) :: i1

first and last points

integer, intent(in) :: i2

first and last points

type(DataSource), intent(in) :: sources(3)

where the components come from

real(kind=wp), intent(out) :: v(:,:)

(3, number of points)

integer, intent(in), optional :: stride

step between points (default 1)

private subroutine artist_release(self)

Forget the render nodes (after the artist's group was removed from the scene): build starts again.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(inout) :: self

private subroutine artist_set_pickable(self, pickable)

Whether pick tests what this artist draws (default true; e.g. false for a spacecraft's marker beside its orbit's curve).

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(inout) :: self
logical, intent(in) :: pickable

true: picked (default)

private subroutine attach_frames(self)

Give the artists the frames: this one (their points' coordinates) and the data frame (if set, and in the same tree).

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(in), target :: self

private subroutine build_artist(self, k, compile)

Create artist k's node (compiled now if the frame is already shown).

Arguments

Type IntentOptional Attributes Name
type(DrawableTrajectory), intent(inout) :: self
integer, intent(in) :: k

the artist (1 to n_artists)

logical, intent(in) :: compile

true: compiled now (if the frame is shown)

private subroutine build_marker_nodes(self, compile)

The start, end and intermediate marker nodes, in the artist's group (compiled now if it is already shown).

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
logical, intent(in) :: compile

true: compiled now (if shown)

private subroutine chain_build(self, viewer, group)

Create the chain of buffers (sized for the points now) and the trace tail under group.

Arguments

Type IntentOptional 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

private subroutine chain_init(self)

The chain, colored if the trajectory's colors are drawn.

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(inout) :: self

private subroutine chain_release(self)

Forget the render nodes: the chain and the tail (see artist_release).

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(inout) :: self

private subroutine chain_update(self, t)

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.

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(inout) :: self
real(kind=wp), intent(in) :: t

the current time

private subroutine curve_init_chain(self)

The chain (ChainArtist's), with the curve's level of detail.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self

private pure subroutine curve_pattern(self, factor, bits)

The dash pattern: its factor and 16 pattern bits.

Arguments

Type IntentOptional 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

private subroutine curve_pick(a, frame, cam, m, hits, n)

A curve's best hit: on the segments drawn (and the trace tail).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(in), target :: a

the artist

class(ReferenceFrame), intent(in), target :: frame

the frame drawing it (for the hit)

type(PickCamera), intent(in) :: cam

the pick camera

real(kind=wp), intent(in) :: m(4,4)

the frame's transform to the root frame

type(PickHit), intent(inout), allocatable :: hits(:)

hits are added to hits(1:n)

integer, intent(inout) :: n

number of hits

private subroutine curve_set_color(self, color)

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).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
real(kind=wp), intent(in) :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine curve_set_dash_mode(self, mode, length)

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.

Arguments

Type IntentOptional 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

private subroutine curve_set_highlight(self, mode, color, arrow_spacing, arrow_speed, band_width, pulse_period)

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.

Arguments

Type IntentOptional 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)

private subroutine curve_set_pattern(self, factor, pattern)

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).

Arguments

Type IntentOptional 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)

private subroutine curve_set_trajectory(self, traj)

Draw traj; with the default data sources, its positions (per its DOF).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
type(Trajectory), intent(in), target :: traj

the trajectory to draw (not owned)

private subroutine curve_set_width(self, width)

The line's width in window units (logical pixels).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
real(kind=wp), intent(in) :: width

window units

private subroutine curve_style(self)

The style: the artist's color, or white if the points' colors are drawn (the shader multiplies them by it).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self

private subroutine curve_update(self, t)

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.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
real(kind=wp), intent(in) :: t

the current time

private subroutine draw_trail(self, t)

A trail at time t: the points within its window (and the one beyond each end: the GPU cuts the segments at the cutoffs) drawn, and the distances along the curve at t and at the window's edges given to the shader (see vkf_line_set_trail), as distances from t's in the direction of time; times beyond the trajectory's are extrapolated from its end segments.

Arguments

Type IntentOptional Attributes Name
type(CurveArtist), intent(inout) :: self
real(kind=wp), intent(in) :: t

the current time

private subroutine draw_written(self, t, changed)

Draw the points written: all of them (the tail hidden) or, in trace mode, those passed by time t (times up to it) and the tail from the latest of them to the point at t (unchanged if nothing changed and t is the time it was drawn for).

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(inout) :: self
real(kind=wp), intent(in) :: t

the current time

logical, intent(in) :: changed

points were written (write_changed)

private subroutine drawable_build_contents(self, viewer, group)

Build the artists' nodes under group (viewer, may be null: those made later are compiled if not null).

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), 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

private subroutine drawable_pick(self, cam, to_root, hits, n)

Picks what the artists draw (see the module documentation), then the frame's origin (if it shows axes or its name label).

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(in), target :: self
type(PickCamera), intent(in) :: cam

the pick camera

real(kind=wp), intent(in) :: to_root(4,4)

the frame's transform to the root frame

type(PickHit), intent(inout), allocatable :: hits(:)

hits are added to hits(1:n)

integer, intent(inout) :: n

number of hits

private subroutine drawable_set_highlight(self, mode, color, arrow_spacing, arrow_speed, band_width, pulse_period)

Highlight all the frame's curve and segment artists (see set_highlight; HIGHLIGHT_NONE: none of them).

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), 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)

private recursive subroutine drawable_update(self, t)

Update the frame (and its descendants), then its artists.

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(inout), target :: self
real(kind=wp), intent(in) :: t

the current time

private subroutine drawn_pair(self, i, a, b)

The pair at trajectory point i (1 to num_drawn) as drawn, its start a and end b: read back from the buffers.

Arguments

Type IntentOptional 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)

private subroutine drawn_segment(self, s, a, b)

Segment s (at point 1 + (s-1) stride; first_drawn to first_drawn + num_drawn - 1 drawn) as written: read back from the line buffers.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self
integer, intent(in) :: s

the segment (first_drawn to first_drawn + num_drawn - 1)

real(kind=wp), intent(out) :: a(3)

the segment's start (frame coordinates)

real(kind=wp), intent(out) :: b(3)

its end

private subroutine intermediates_by_data(self, n)

Every int(spacing)-th point after the first, before the last.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
integer, intent(in) :: n

the points

private subroutine intermediates_by_distance(self, n)

Every spacing of arc length (the points joined by straight lines).

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
integer, intent(in) :: n

the points

private subroutine intermediates_by_time(self, n)

Every spacing time units after the first time, before the last (counted from the start or the end).

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
integer, intent(in) :: n

the points

private subroutine marker_build(self, viewer, group)

Create the marker nodes under group (see artist_build).

Arguments

Type IntentOptional 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

private subroutine marker_pick(a, frame, cam, m, hits, n)

A marker artist's best hit: its start, end and intermediate markers drawn.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(in), target :: a

the artist

class(ReferenceFrame), intent(in), target :: frame

the frame drawing it (for the hit)

type(PickCamera), intent(in) :: cam

the pick camera

real(kind=wp), intent(in) :: m(4,4)

the frame's transform to the root frame

type(PickHit), intent(inout), allocatable :: hits(:)

hits are added to hits(1:n)

integer, intent(inout) :: n

number of hits

private subroutine marker_release(self)

Forget the render nodes (see artist_release).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self

private subroutine marker_set_point_colors(self, enabled)

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.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
logical, intent(in) :: enabled

true: the trajectory's colors (default false)

private subroutine marker_set_trajectory(self, traj)

Draw traj; with the default data sources, its positions (per its DOF).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
type(Trajectory), intent(in), target :: traj

the trajectory to draw (not owned)

private subroutine marker_style(self)

Apply the colors, size, shape and attenuation radius (0: off) to the marker nodes.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self

private subroutine marker_update(self, t)

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.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
real(kind=wp), intent(in) :: t

the current time

private subroutine markers_passed(self, t, first, count)

The intermediate markers (in trajectory order) whose times are at most t: count from first (the first ones for increasing times, the last for decreasing), by bisection.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(in) :: self
real(kind=wp), intent(in) :: t

the current time

integer, intent(out) :: first

the markers passed: the first, how many

integer, intent(out) :: count

the markers passed: the first, how many

private subroutine motion_changed(self, redraw)

With data in another frame (transformed): redraw set if either frame's motion changed, the data frame changed, or the transform began or ended since the points were written.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(inout) :: self
logical, intent(inout) :: redraw

set to true if everything must be drawn again

private subroutine push_intermediate(self, v, t)

Append an intermediate marker at v, time t (the arrays grown as needed).

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
real(kind=wp), intent(in) :: v(3)

the marker's point; its time

real(kind=wp), intent(in) :: t

the marker's point; its time

private subroutine rebuild_markers(self)

New marker nodes (for a new image), in place of the old ones.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self

private subroutine redraw_markers(self)

Compute and write everything again at the next update.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self

private subroutine remove_all_artists(self)

Remove all the artists.

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(inout) :: self

private subroutine remove_artist(self, a)

Remove an artist (it stops being drawn; it can be added again, also to another frame).

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(inout) :: self
class(TrajectoryArtist), intent(in), target :: a

the artist to remove

private subroutine remove_trail(self)

No trail: the whole curve (or trace mode, if set) again.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self

private subroutine reset_markers(self)

Start the intermediate markers and the bounds again.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self

private subroutine ribbon_set_color(self, color)

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).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
real(kind=wp), intent(in) :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine ribbon_set_trajectory(self, traj)

Draw traj; with the default data sources, from the origin to its positions (per its DOF).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
type(Trajectory), intent(in), target :: traj

the trajectory to draw (not owned)

private subroutine ribbon_style(self)

The style: the artist's color, or white with its alpha if the points' colors are drawn (the shader multiplies them by it).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self

private subroutine segment_artist_pick(a, frame, cam, m, hits, n)

A segment artist's best hit: on the segments drawn (as drawn: relative ends included; a segment of no length isn't drawn).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in), target :: a

the artist

class(ReferenceFrame), intent(in), target :: frame

the frame drawing it (for the hit)

type(PickCamera), intent(in) :: cam

the pick camera

real(kind=wp), intent(in) :: m(4,4)

the frame's transform to the root frame

type(PickHit), intent(inout), allocatable :: hits(:)

hits are added to hits(1:n)

integer, intent(inout) :: n

number of hits

private subroutine segment_build(self, viewer, group)

Create the chain of line buffers (sized for the segments now) under group.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), 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

private pure subroutine segment_pattern(self, factor, bits)

The dash pattern: its factor and 16 pattern bits.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(in) :: self
integer, intent(out) :: factor

window units per bit, 16 bits

integer, intent(out) :: bits

window units per bit, 16 bits

private subroutine segment_release(self)

Forget the render nodes (see artist_release).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self

private subroutine segment_set_color(self, color)

The segments' color: [r, g, b] (alpha unchanged) or [r, g, b, a], 0 to 1.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
real(kind=wp), intent(in) :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine segment_set_dash_mode(self, mode)

The dash pattern's layout (see set_dash_mode): screen-locked dashes start again at each segment's start, as GL_LINES; DASH_FIXED (strips only) is taken as DASH_SCENE.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
integer, intent(in) :: mode

DASH_SCENE or DASH_SCREEN

private subroutine segment_set_highlight(self, mode, color, arrow_spacing, arrow_speed, band_width, pulse_period)

Highlight the segments (see set_highlight): the arrows run along each segment from its start to its end.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), 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)

private subroutine segment_set_pattern(self, factor, pattern)

A dash pattern (see set_pattern), starting again at the start of each segment.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), 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)

private subroutine segment_set_trajectory(self, traj)

Draw traj; with the default data sources, from the origin to its positions (per its DOF).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
type(Trajectory), intent(in), target :: traj

the trajectory to draw (not owned)

private subroutine segment_set_width(self, width)

The segments' width in window units (logical pixels).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
real(kind=wp), intent(in) :: width

window units

private subroutine segment_update(self, t)

Write the segments added (all of them on a redraw), and draw them all or, in trace mode, those at the points passed at time t.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
real(kind=wp), intent(in) :: t

the current time

private subroutine set_auto_attenuate(self, attenuate)

Shrink markers farther from the camera than the trajectory's size (OpenFrames' auto-attenuation; see shaders/marker.vert). On by default (OpenFrames': off).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
logical, intent(in) :: attenuate

true: auto-attenuation on (default)

private subroutine set_data_frame(self, frame)

The frame of the scene its trajectories' data are in (see the module documentation): each point drawn where it is in this frame at the point's own time. Absent: this frame's own coordinates (the default). frame must be in the same tree (else the data are drawn as they are, with a warning) and stay alive while set. The frames' poses at the points' times are as the scene would place them then, follow modes included: a frame following with FOLLOW_LOOP (the default) wraps the points' times into its data's range too (at its data's last time, the first), so a frame following an ephemeris usually wants FOLLOW_LIMIT.

Read more…

Arguments

Type IntentOptional Attributes Name
class(DrawableTrajectory), intent(inout) :: self
class(ReferenceFrame), intent(in), optional, target :: frame

the frame the data are in (absent: this one's)

private subroutine set_end_relative(self, relative)

Relative ends (default false): each segment ends at its start plus the end sources' values (a vector drawn from each point), not at them.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
logical, intent(in) :: relative

true: the ends are offsets from the starts

private subroutine set_end_scale(self, scale)

Set the scale of all three end sources (with relative ends: the length drawn per unit of the stored vector, e.g. km per newton). Only this artist's segments are written again.

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
real(kind=wp), intent(in) :: scale

the end sources' scale (e.g. km per newton)

private subroutine set_intermediate_direction(self, direction)

Count intermediate markers from the start (MARKER_START, default) or from the end (MARKER_END; recomputed whenever points are added).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
integer, intent(in) :: direction

MARKER_START or MARKER_END

private subroutine set_intermediate_spacing(self, spacing)

Spacing of intermediate markers (> 0): time units, arc length, or a number of data points (rounded down, at least 1).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
real(kind=wp), intent(in) :: spacing

time units, arc length or data points (> 0)

private subroutine set_intermediate_type(self, type)

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
integer, intent(in) :: type

INTERMEDIATE_TIME, _DISTANCE or _DATA

private subroutine set_level_of_detail(self, enabled)

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.

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
logical, intent(in) :: enabled

true: level of detail on (default)

private subroutine set_marker_color(self, which, color)

The color of the markers in which (an ior of MARKER_* flags): [r, g, b] (alpha unchanged) or [r, g, b, a].

Arguments

Type IntentOptional 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)

private subroutine set_marker_shape(self, shape)

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.

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
integer, intent(in) :: shape

a MARKER_* shape constant

private subroutine set_marker_size(self, size)

Marker size in window units (logical pixels; > 0).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
real(kind=wp), intent(in) :: size

window units (> 0; else ignored)

private subroutine set_markers(self, markers)

Which markers to draw: an ior of MARKER_START, MARKER_INTERMEDIATE and MARKER_END (0 for none).

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
integer, intent(in) :: markers

an ior of MARKER_* flags (0: none)

private subroutine set_point_colors(self, enabled)

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.

Arguments

Type IntentOptional Attributes Name
class(ChainArtist), intent(inout) :: self
logical, intent(in) :: enabled

true: the trajectory's colors

private subroutine set_stride(self, stride)

Draw a segment at points 1, 1 + stride, 1 + 2 stride, ... (stride >= 1).

Arguments

Type IntentOptional Attributes Name
class(SegmentArtist), intent(inout) :: self
integer, intent(in) :: stride

a segment at every stride-th point (>= 1)

private subroutine set_trace_mode(self, enabled)

Draw only the part up to the current time (see the module documentation).

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(inout) :: self
logical, intent(in) :: enabled

true: draw only up to the current time

private subroutine set_trail(self, past, future, fade)

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.

Arguments

Type IntentOptional 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)

private subroutine set_trail_style(self, which, color, opacity, factor, pattern)

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.

Arguments

Type IntentOptional 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

private subroutine set_trajectory(self, traj)

Draw traj (it must stay alive while drawn).

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(inout) :: self
type(Trajectory), intent(in), target :: traj

the trajectory to draw (not owned)

private subroutine tail_colors(self, k, k2, frac)

The tail's colors: from point k's to the color at frac along to point k2's (white, showing the style's color, if the chain has none).

Arguments

Type IntentOptional Attributes Name
type(CurveArtist), intent(inout) :: self
integer, intent(in) :: k

the tail's ends

integer, intent(in) :: k2

the tail's ends

real(kind=wp), intent(in) :: frac

of the way from k's time to k2's (0 to 1)

private subroutine tail_ends(traj, n, i1, i2, k, k2)

Trace mode's tail, for the points passed i1 .. i2 of the n written: from the latest passed (k) toward the next in time (k2: i2 + 1, or i1 - 1 for decreasing times); none (0, 0) without a trajectory.

Arguments

Type IntentOptional Attributes Name
type(Trajectory), intent(in), pointer :: traj

the trajectory (null: none)

integer, intent(in) :: n

the points written

integer, intent(in) :: i1

the points passed

integer, intent(in) :: i2

the points passed

integer, intent(out) :: k

the tail's ends

integer, intent(out) :: k2

the tail's ends

private subroutine to_shown(self, times, v)

Points v (data frame) at times times into the drawable's coordinates, each by the transform at its own time (one transform for all if neither frame moves).

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self
real(kind=wp), intent(in) :: times(:)

each point's time

real(kind=wp), intent(inout) :: v(:,:)

(3, size(times)): the points

private subroutine to_shown_at(self, i1, v, stride)

Points i1, i1 + stride, ... (data frame; their times the trajectory's) into the drawable's coordinates, if transformed.

Arguments

Type IntentOptional Attributes Name
class(TrajectoryArtist), intent(in) :: self
integer, intent(in) :: i1

the first point

real(kind=wp), intent(inout) :: v(:,:)

(3, n): the points

integer, intent(in), optional :: stride

step between points (default 1)

private subroutine trace_range(traj, t, n, i1, i2)

The points of 1 .. n whose times are at most t (trace mode): i1 .. i2 (none: i2 < i1), the first points for increasing times, the last for decreasing ones (by bisection).

Arguments

Type IntentOptional Attributes Name
type(Trajectory), intent(in) :: traj

the trajectory

real(kind=wp), intent(in) :: t

the current time

integer, intent(in) :: n

the points considered (1 .. n)

integer, intent(out) :: i1

the points passed (none: i2 < i1)

integer, intent(out) :: i2

the points passed (none: i2 < i1)

private subroutine update_bounds(self, n, zero)

The bounds of the points (for the attenuation radius: OpenFrames uses the artist's bounding sphere).

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
integer, intent(in) :: n

the points

logical, intent(in) :: zero

all sources zero, or no trajectory: a marker at the origin

private subroutine update_highlight(h, mode, color, arrow_spacing, arrow_speed, band_width, pulse_period)

Change the settings given (see set_highlight).

Arguments

Type IntentOptional Attributes Name
type(HighlightStyle), intent(inout) :: h

the highlight changed

integer, intent(in) :: mode

HIGHLIGHT_* (added)

real(kind=wp), intent(in), optional :: color(:)

as set_highlight

real(kind=wp), intent(in), optional :: arrow_spacing

as set_highlight

real(kind=wp), intent(in), optional :: arrow_speed

as set_highlight

real(kind=wp), intent(in), optional :: band_width

as set_highlight

real(kind=wp), intent(in), optional :: pulse_period

as set_highlight

private subroutine update_ribbon_tail(self, t, k, k2)

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).

Arguments

Type IntentOptional 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)

private subroutine update_tail(self, t, k, k2)

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).

Arguments

Type IntentOptional 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)

private subroutine write_colors(self, i1, i2)

The colors of points i1 .. i2 into the chain: the trajectory's, and the artist's color for points without one yet.

Arguments

Type IntentOptional Attributes Name
type(CurveArtist), intent(inout) :: self
integer, intent(in) :: i1

the trajectory points

integer, intent(in) :: i2

the trajectory points

private subroutine write_curve(self, i1, i2)

Write points i1 .. i2 into the chain (and upload the chunks written to).

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
integer, intent(in) :: i1

the trajectory points

integer, intent(in) :: i2

the trajectory points

private subroutine write_intermediates(self, i1, i2)

Write intermediate markers i1 .. i2 into their chain, with their colors (with point colors), and upload the chunks written to.

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
integer, intent(in) :: i1

the intermediate markers

integer, intent(in) :: i2

the intermediate markers

private subroutine write_marker(chain, v, rgba)

A single marker's point (in a chain of one marker), and its color (a colored chain), uploaded.

Arguments

Type IntentOptional Attributes Name
type(LineChain), intent(inout) :: chain

the marker's buffers (one marker)

real(kind=wp), intent(in) :: v(3)

the marker's point; its color

real(kind=wp), intent(in) :: rgba(4)

the marker's point; its color

private subroutine write_ribbon(self, i1, i2)

Write the pairs of trajectory points i1 .. i2 into the chain, with their colors (and upload the chunks written to).

Arguments

Type IntentOptional Attributes Name
class(RibbonArtist), intent(inout) :: self
integer, intent(in) :: i1

the trajectory points

integer, intent(in) :: i2

the trajectory points

private subroutine write_segments(self, s1, s2)

Write segments s1 .. s2 into the chain (and upload the chunks written to).

Arguments

Type IntentOptional Attributes Name
type(SegmentArtist), intent(inout) :: self
integer, intent(in) :: s1

the segments

integer, intent(in) :: s2

the segments