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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MarkerArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the current time |
subroutine marker_update(self, t) class(MarkerArtist), intent(inout) :: self real(wp), intent(in) :: t !! the current time logical :: changed, redraw, zero, passed_start, passed_end integer :: n if (.not. c_associated(self%group)) return zero = all(self%sources_%src == SOURCE_ZERO) .or. .not. associated(self%traj) ! (a marker at the origin) if (zero) then n = 1 ! a marker at the origin else n = source_points(self%traj, self%sources_) end if ! the trajectory's colors drawn or not (its first colors, or the setting, ! changed): the marker nodes made again, with or without colors if (marker_uses_colors(self) .neqv. self%inter%is_colored()) call rebuild_markers(self) changed = data_changed(self, redraw) if (.not. self%drawn) then changed = .true. redraw = .true. self%drawn = .true. end if if (changed) then if (self%inter%is_colored()) then ! (colors added or changed: all written again) if (self%traj%num_colors() /= self%n_colors_seen) redraw = .true. self%n_colors_seen = self%traj%num_colors() end if if (redraw .or. n < self%n_seen) call reset_markers(self) call update_bounds(self, n, zero) if (n >= 1) call write_marker(self%start_node, marker_point(self, 1, zero), & ! (none: nothing drawn) end_rgba(self, 1, self%start_color)) if (n > 1) call write_marker(self%end_node, marker_point(self, n, zero), end_rgba(self, n, self%end_color)) if (iand(self%markers_, MARKER_INTERMEDIATE) /= 0 .and. .not. zero .and. n > 2) call add_intermediates(self, n) end if ! what is drawn: everything, or in trace mode the markers whose times ! have passed (the start and end markers at their points' times) passed_start = .true. passed_end = .true. if (self%trace .and. .not. zero .and. n >= 1) then passed_start = self%traj%time(1) <= t passed_end = self%traj%time(n) <= t end if self%start_shown = iand(self%markers_, MARKER_START) /= 0 .and. n >= 1 .and. passed_start call self%start_node%draw(merge(1, 0, self%start_shown)) self%end_shown = iand(self%markers_, MARKER_END) /= 0 .and. n > 1 .and. passed_end call self%end_node%draw(merge(1, 0, self%end_shown)) self%inter_first = 1 self%n_inter_drawn = self%n_inter_written if (self%trace .and. self%n_inter_written > 0) call markers_passed(self, t, self%inter_first, self%n_inter_drawn) call self%inter%draw_range(self%inter_first, self%inter_first + self%n_inter_drawn - 1) end subroutine marker_update