time_grab Function

private function time_grab(self, origin, dir) result(ok)

Grab the handle with the cursor's ray (origin, unit dir; root frame): the path sampled over the time range. False if it isn't draggable or has no path.

Type Bound

TimeHandle

Arguments

Type IntentOptional Attributes Name
class(TimeHandle), intent(inout) :: self
real(kind=wp), intent(in) :: origin(3)

the cursor's ray (root frame)

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

the cursor's ray (root frame)

Return Value logical


Calls

proc~~time_grab~~CallsGraph proc~time_grab TimeHandle%time_grab position position proc~time_grab->position proc~draggable DragHandle%draggable proc~time_grab->proc~draggable proc~time_show_state TimeHandle%time_show_state proc~time_grab->proc~time_show_state proc~check_status check_status proc~time_show_state->proc~check_status proc~color~2 ReferenceFrame%color proc~time_show_state->proc~color~2 proc~dragged DragHandle%dragged proc~time_show_state->proc~dragged proc~hovered DragHandle%hovered proc~time_show_state->proc~hovered proc~marker_set_style marker_set_style proc~time_show_state->proc~marker_set_style interface~vkf_line_style vkf_line_style proc~marker_set_style->interface~vkf_line_style interface~vkf_line_style_changed vkf_line_style_changed proc~marker_set_style->interface~vkf_line_style_changed

Source Code

    logical function time_grab(self, origin, dir) result(ok)
        class(TimeHandle), intent(inout) :: self
        real(wp), intent(in) :: origin(3), dir(3)           !! the cursor's ray (root frame)
        integer :: k
        ok = .false.
        if (.not. (self%draggable() .and. associated(self%path_))) return
        if (allocated(self%sample_t)) deallocate(self%sample_t, self%sample_p)
        allocate(self%sample_t(path_samples), self%sample_p(3, path_samples))
        do k = 1, path_samples
            self%sample_t(k) = self%t_min + (self%t_max - self%t_min) * (k - 1) / (path_samples - 1)
            self%sample_p(:, k) = self%path_%position(self%sample_t(k))
        end do
        self%dragged_ = .true.
        call self%show_state()
        ok = .true.
    end function time_grab