The tail: the quad from the pair at point k to the pair interpolated at time t toward point k2 (as the curve's tail: none if either isn't a point written).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RibbonArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the current time |
||
| integer, | intent(in) | :: | k |
the tail's ends (0: none) |
||
| integer, | intent(in) | :: | k2 |
the tail's ends (0: none) |
subroutine update_ribbon_tail(self, t, k, k2) class(RibbonArtist), intent(inout) :: self real(wp), intent(in) :: t !! the current time integer, intent(in) :: k, k2 !! the tail's ends (0: none) real(c_float), dimension(:,:,:), pointer :: p real(c_float), dimension(:,:), pointer :: c real(wp) :: frac, xyz(3, 4), c0(4), c1(4) integer(c_int) :: capacity type(c_ptr) :: data self%tail_shown = .false. if (.not. c_associated(self%tail)) return if (min(k, k2) < 1 .or. max(k, k2) > self%n_written) then call check_status(vkf_line_set_range(self%tail, 1_c_int, 0_c_int), 'trajectory artists') return end if frac = self%traj%time_fraction(k, k2, t) xyz(:, 1) = art_point(self, k, self%start_) xyz(:, 2) = art_point(self, k, self%end_) xyz(:, 3) = art_point_between(self, k, k2, t, self%start_) xyz(:, 4) = art_point_between(self, k, k2, t, self%end_) call line_buffer(self%tail, p) if (.not. associated(p)) return call split_points(xyz, p(:, :, 1:4)) data = vkf_line_colors(self%tail, capacity) if (c_associated(data) .and. capacity >= 4) then call c_f_pointer(data, c, [4, 4]) if (self%chain%is_colored()) then c0 = ribbon_point_rgba(self, k) c1 = ribbon_point_rgba(self, k2) c(:, 1:2) = spread(real(c0, c_float), 2, 2) c(:, 3:4) = spread(real(c0 + frac * (c1 - c0), c_float), 2, 2) else c = 1.0_c_float end if end if call check_status(vkf_line_points_changed(self%tail, 4_c_int), 'trajectory artists') self%tail_shown = .true. end subroutine update_ribbon_tail