pick Subroutine

private subroutine pick(self, cam, to_root, hits, n)

Pick what the frame draws (see the module documentation): to_root is its transform to the root frame; hits are added to hits(1:n). A plain frame: its origin, if it shows axes or its name label.

Type Bound

ReferenceFrame

Arguments

Type IntentOptional Attributes Name
class(ReferenceFrame), intent(in), target :: self
type(PickCamera), intent(in) :: cam

the cursor's ray and the pick's settings

real(kind=wp), intent(in) :: to_root(4,4)

the frame's transform to the root frame

type(PickHit), intent(inout), allocatable :: hits(:)

hits so far (grown as needed)

integer, intent(inout) :: n

number of hits in hits


Calls

proc~~pick~~CallsGraph proc~pick ReferenceFrame%pick proc~add_pick_hit add_pick_hit proc~pick->proc~add_pick_hit proc~point_pick point_pick proc~pick->proc~point_pick proc~wants wants proc~pick->proc~wants proc~project project proc~point_pick->proc~project

Called by

proc~~pick~~CalledByGraph proc~pick ReferenceFrame%pick proc~drawable_pick DrawableTrajectory%drawable_pick proc~drawable_pick->proc~pick proc~model_pick Model%model_pick proc~model_pick->proc~pick proc~sphere_pick Sphere%sphere_pick proc~sphere_pick->proc~pick proc~terrain_pick TerrainBody%terrain_pick proc~terrain_pick->proc~pick proc~time_pick TimeHandle%time_pick proc~time_pick->proc~pick proc~vector_pick VectorHandle%vector_pick proc~vector_pick->proc~pick proc~window_pick WindowProxy%window_pick proc~window_pick->proc~pick proc~hover_handle hover_handle proc~hover_handle->proc~window_pick proc~dispatch_event dispatch_event proc~dispatch_event->proc~hover_handle proc~release_handle release_handle proc~dispatch_event->proc~release_handle proc~release_handle->proc~hover_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 pick(self, cam, to_root, hits, n)
        class(ReferenceFrame), intent(in), target :: self
        type(PickCamera), intent(in) :: cam                 !! the cursor's ray and the pick's settings
        real(wp), intent(in) :: to_root(4,4)                !! the frame's transform to the root frame
        type(PickHit), allocatable, intent(inout) :: hits(:)  !! hits so far (grown as needed)
        integer, intent(inout) :: n                         !! number of hits in hits
        type(PickHit) :: h
        if (self%axes == NO_AXES .and. .not. self%name_label) return
        if (.not. wants(cam, PICK_FRAME)) return
        if (.not. point_pick(cam, to_root(1:3, 4), h%pixels, h%distance)) return
        h%kind = PICK_FRAME
        h%frame => self
        h%position = to_root(1:3, 4)
        call add_pick_hit(hits, n, h)
    end subroutine pick