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 | Intent | Optional | 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) |
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