grab_handle Subroutine

private subroutine grab_handle(self, x, y)

A left press grabbed the mouse (the grab armed): the hovered handle grabbed.

Arguments

Type IntentOptional Attributes Name
class(WindowProxy), intent(inout), target :: self
real(kind=wp), intent(in) :: x

the cursor: -1 to 1 across the window, y up

real(kind=wp), intent(in) :: y

the cursor: -1 to 1 across the window, y up


Calls

proc~~grab_handle~~CallsGraph proc~grab_handle grab_handle proc~cursor_ray WindowProxy%cursor_ray proc~grab_handle->proc~cursor_ray proc~grab DragHandle%grab proc~grab_handle->proc~grab proc~handler_handle_drag WindowEventHandler%handler_handle_drag proc~grab_handle->proc~handler_handle_drag proc~ray ray proc~cursor_ray->proc~ray proc~view_camera view_camera proc~cursor_ray->proc~view_camera handle_point handle_point proc~grab->handle_point proc~constrained constrained proc~grab->proc~constrained proc~ray_sphere ray_sphere proc~grab->proc~ray_sphere proc~world_matrix ReferenceFrame%world_matrix proc~grab->proc~world_matrix show_state show_state proc~grab->show_state proc~constrained->proc~ray_sphere proc~ray_line ray_line proc~constrained->proc~ray_line proc~ray_plane ray_plane proc~constrained->proc~ray_plane interface~vkf_viewer_pixel_ratio vkf_viewer_pixel_ratio proc~view_camera->interface~vkf_viewer_pixel_ratio interface~vkf_viewer_size vkf_viewer_size proc~view_camera->interface~vkf_viewer_size proc~aspect_ratio aspect_ratio proc~view_camera->proc~aspect_ratio proc~field_of_view View%field_of_view proc~view_camera->proc~field_of_view proc~get_camera WindowProxy%get_camera proc~view_camera->proc~get_camera proc~is_open WindowProxy%is_open proc~view_camera->proc~is_open proc~orthographic_bounds View%orthographic_bounds proc~view_camera->proc~orthographic_bounds proc~pick_camera pick_camera proc~view_camera->proc~pick_camera proc~projection_type View%projection_type proc~view_camera->proc~projection_type proc~world_matrix->proc~world_matrix proc~local_matrix ReferenceFrame%local_matrix proc~world_matrix->proc~local_matrix proc~aspect_ratio->interface~vkf_viewer_size proc~get_camera->proc~is_open interface~vkf_viewer_get_look_at vkf_viewer_get_look_at proc~get_camera->interface~vkf_viewer_get_look_at proc~rigid_inverse rigid_inverse proc~get_camera->proc~rigid_inverse proc~transform_camera transform_camera proc~get_camera->proc~transform_camera proc~world_to_view View%world_to_view proc~get_camera->proc~world_to_view proc~frame_matrix frame_matrix proc~local_matrix->proc~frame_matrix proc~cross cross proc~pick_camera->proc~cross proc~quat_to_matrix quat_to_matrix proc~frame_matrix->proc~quat_to_matrix proc~world_to_view->proc~rigid_inverse proc~frame_to_root frame_to_root proc~world_to_view->proc~frame_to_root proc~identity_matrix identity_matrix proc~world_to_view->proc~identity_matrix proc~quat_from_vectors quat_from_vectors proc~world_to_view->proc~quat_from_vectors proc~world_to_view->proc~quat_to_matrix proc~rotated rotated proc~world_to_view->proc~rotated proc~translation_matrix translation_matrix proc~world_to_view->proc~translation_matrix proc~frame_to_root->proc~world_matrix proc~frame_to_root->proc~rigid_inverse proc~quat_from_vectors->proc~cross proc~quat_normalize quat_normalize proc~quat_from_vectors->proc~quat_normalize proc~translation_matrix->proc~identity_matrix

Called by

proc~~grab_handle~~CalledByGraph proc~grab_handle grab_handle proc~dispatch_event dispatch_event proc~dispatch_event->proc~grab_handle proc~dispatch_events dispatch_events proc~dispatch_events->proc~dispatch_event proc~frame WindowProxy%frame proc~frame->proc~dispatch_events proc~resize WindowProxy%resize proc~resize->proc~frame proc~run WindowProxy%run proc~run->proc~frame

Source Code

    subroutine grab_handle(self, x, y)
        class(WindowProxy), intent(inout), target :: self
        real(wp), intent(in) :: x, y                        !! the cursor: -1 to 1 across the window, y up
        real(wp) :: origin(3), dir(3)
        if (.not. associated(self%hovered_handle)) return
        if (.not. self%cursor_ray(x, y, origin, dir)) return
        if (.not. self%hovered_handle%grab(origin, dir)) return
        self%dragged_handle => self%hovered_handle
        if (associated(self%handler)) call self%handler%handle_drag(self, self%dragged_handle, DRAG_START)
    end subroutine grab_handle