add_pick_hit Subroutine

public subroutine add_pick_hit(hits, n, hit)

Add hit to hits(1:n) (growing the array).

Arguments

Type IntentOptional Attributes Name
type(PickHit), intent(inout), allocatable :: hits(:)

grown as needed

integer, intent(inout) :: n

number of hits in hits

type(PickHit), intent(in) :: hit

the hit to add


Called by

proc~~add_pick_hit~~CalledByGraph proc~add_pick_hit add_pick_hit proc~curve_pick curve_pick proc~curve_pick->proc~add_pick_hit proc~marker_pick marker_pick proc~marker_pick->proc~add_pick_hit proc~pick ReferenceFrame%pick proc~pick->proc~add_pick_hit proc~pick_ellipsoid pick_ellipsoid proc~pick_ellipsoid->proc~add_pick_hit proc~segment_artist_pick segment_artist_pick proc~segment_artist_pick->proc~add_pick_hit proc~time_pick TimeHandle%time_pick proc~time_pick->proc~add_pick_hit proc~time_pick->proc~pick proc~vector_pick VectorHandle%vector_pick proc~vector_pick->proc~add_pick_hit proc~vector_pick->proc~pick proc~drawable_pick DrawableTrajectory%drawable_pick proc~drawable_pick->proc~curve_pick proc~drawable_pick->proc~marker_pick proc~drawable_pick->proc~pick proc~drawable_pick->proc~segment_artist_pick proc~model_pick Model%model_pick proc~model_pick->proc~pick proc~model_pick->proc~pick_ellipsoid proc~sphere_pick Sphere%sphere_pick proc~sphere_pick->proc~pick proc~sphere_pick->proc~pick_ellipsoid proc~terrain_pick TerrainBody%terrain_pick proc~terrain_pick->proc~pick proc~terrain_pick->proc~pick_ellipsoid 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 add_pick_hit(hits, n, hit)
        type(PickHit), allocatable, intent(inout) :: hits(:)  !! grown as needed
        integer, intent(inout) :: n                         !! number of hits in hits
        type(PickHit), intent(in) :: hit                    !! the hit to add
        type(PickHit), allocatable :: more(:)
        if (.not. allocated(hits)) allocate(hits(8))
        if (n == size(hits)) then
            allocate(more(2 * n))
            more(1:n) = hits(1:n)
            call move_alloc(more, hits)
        end if
        n = n + 1
        hits(n) = hit
    end subroutine add_pick_hit