set_trail_style Subroutine

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.

Type Bound

CurveArtist

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


Calls

proc~~set_trail_style~~CallsGraph proc~set_trail_style CurveArtist%set_trail_style proc~set_rgba set_rgba proc~set_trail_style->proc~set_rgba

Source Code

    subroutine set_trail_style(self, which, color, opacity, factor, pattern)
        class(CurveArtist), intent(inout) :: self
        integer, intent(in) :: which                        !! TRAIL_PAST or TRAIL_FUTURE
        real(wp), intent(in), optional :: color(:)          !! [r, g, b] or [r, g, b, a] (0 to 1)
        real(wp), intent(in), optional :: opacity           !! 0 to 1
        integer, intent(in), optional :: factor, pattern    !! window units per bit (>= 1), 16 bits
        integer :: k
        k = merge(1, 2, which == TRAIL_PAST)
        if (present(color)) then
            call set_rgba(self%trail_%color(:, k), color)
            self%trail_%replace(k) = .true.
        end if
        if (present(opacity)) self%trail_%opacity(k) = max(0.0_wp, min(1.0_wp, opacity))
        if (present(factor)) self%trail_%factor(k) = max(1, factor)
        if (present(pattern)) self%trail_%pattern(k) = iand(pattern, int(z'FFFF'))
        self%tail_time = huge(1.0_wp)
    end subroutine set_trail_style