update_bounds Subroutine

private subroutine update_bounds(self, n, zero)

The bounds of the points (for the attenuation radius: OpenFrames uses the artist's bounding sphere).

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
integer, intent(in) :: n

the points

logical, intent(in) :: zero

all sources zero, or no trajectory: a marker at the origin


Calls

proc~~update_bounds~~CallsGraph proc~update_bounds update_bounds proc~art_points art_points proc~update_bounds->proc~art_points proc~marker_style marker_style proc~update_bounds->proc~marker_style proc~points Trajectory%points proc~art_points->proc~points proc~to_shown_at to_shown_at proc~art_points->proc~to_shown_at proc~is_colored LineChain%is_colored proc~marker_style->proc~is_colored proc~set_marker_style LineChain%set_marker_style proc~marker_style->proc~set_marker_style proc~apply_style apply_style proc~set_marker_style->proc~apply_style proc~to_shown to_shown proc~to_shown_at->proc~to_shown proc~transformed transformed proc~to_shown_at->proc~transformed interface~vkf_line_set_dash_mode vkf_line_set_dash_mode proc~apply_style->interface~vkf_line_set_dash_mode interface~vkf_line_set_highlight vkf_line_set_highlight proc~apply_style->interface~vkf_line_set_highlight interface~vkf_line_set_trail vkf_line_set_trail proc~apply_style->interface~vkf_line_set_trail proc~check_status check_status proc~apply_style->proc~check_status proc~line_set_pattern line_set_pattern proc~apply_style->proc~line_set_pattern proc~line_set_style line_set_style proc~apply_style->proc~line_set_style proc~marker_set_style marker_set_style proc~apply_style->proc~marker_set_style proc~data_to_shown data_to_shown proc~to_shown->proc~data_to_shown proc~moves moves proc~to_shown->proc~moves proc~rigid_inverse rigid_inverse proc~data_to_shown->proc~rigid_inverse proc~world_matrix_at ReferenceFrame%world_matrix_at proc~data_to_shown->proc~world_matrix_at interface~vkf_line_style vkf_line_style proc~line_set_pattern->interface~vkf_line_style interface~vkf_line_style_changed vkf_line_style_changed proc~line_set_pattern->interface~vkf_line_style_changed proc~line_set_style->interface~vkf_line_style proc~line_set_style->interface~vkf_line_style_changed proc~marker_set_style->interface~vkf_line_style proc~marker_set_style->interface~vkf_line_style_changed proc~moves->proc~moves proc~is_following ReferenceFrame%is_following proc~moves->proc~is_following proc~num_parents ReferenceFrame%num_parents proc~moves->proc~num_parents proc~parent ReferenceFrame%parent proc~moves->proc~parent proc~num_trajectories TrajectoryFollower%num_trajectories proc~is_following->proc~num_trajectories proc~world_matrix_at->proc~world_matrix_at proc~local_matrix_at ReferenceFrame%local_matrix_at proc~world_matrix_at->proc~local_matrix_at proc~followed_pose followed_pose proc~local_matrix_at->proc~followed_pose proc~frame_matrix frame_matrix proc~local_matrix_at->proc~frame_matrix proc~followed_pose->proc~rigid_inverse proc~followed_pose->proc~world_matrix_at proc~quat_from_matrix quat_from_matrix proc~followed_pose->proc~quat_from_matrix proc~quat_multiply quat_multiply proc~followed_pose->proc~quat_multiply proc~quat_normalize quat_normalize proc~followed_pose->proc~quat_normalize proc~state_at TrajectoryFollower%state_at proc~followed_pose->proc~state_at proc~quat_to_matrix quat_to_matrix proc~frame_matrix->proc~quat_to_matrix proc~chosen_trajectory chosen_trajectory proc~state_at->proc~chosen_trajectory proc~data_valid TrajectoryFollower%data_valid proc~state_at->proc~data_valid proc~interpolate_attitude interpolate_attitude proc~state_at->proc~interpolate_attitude proc~interpolate_position interpolate_position proc~state_at->proc~interpolate_position proc~time_index Trajectory%time_index proc~state_at->proc~time_index proc~wrapped_time wrapped_time proc~state_at->proc~wrapped_time proc~time_distance Trajectory%time_distance proc~chosen_trajectory->proc~time_distance proc~verify_data Trajectory%verify_data proc~data_valid->proc~verify_data proc~attitude~3 Trajectory%attitude proc~interpolate_attitude->proc~attitude~3 proc~num_attitudes Trajectory%num_attitudes proc~interpolate_attitude->proc~num_attitudes proc~quat_slerp quat_slerp proc~interpolate_attitude->proc~quat_slerp proc~num_points Trajectory%num_points proc~interpolate_position->proc~num_points proc~point_between Trajectory%point_between proc~interpolate_position->proc~point_between proc~point~2 Trajectory%point proc~interpolate_position->proc~point~2 proc~time_index->proc~time_distance proc~time_range~3 Trajectory%time_range proc~wrapped_time->proc~time_range~3 proc~point_between->proc~num_points proc~point_between->proc~point~2 proc~time_fraction Trajectory%time_fraction proc~point_between->proc~time_fraction

Called by

proc~~update_bounds~~CalledByGraph proc~update_bounds update_bounds proc~marker_update MarkerArtist%marker_update proc~marker_update->proc~update_bounds

Source Code

    subroutine update_bounds(self, n, zero)
        type(MarkerArtist), intent(inout) :: self
        integer, intent(in) :: n                    !! the points
        logical, intent(in) :: zero                 !! all sources zero, or no trajectory: a marker at the origin
        real(wp), allocatable :: v(:,:)
        real(wp) :: r
        if (zero) then
            self%lo = 0.0_wp
            self%hi = 0.0_wp
        else if (n > self%n_seen) then                      ! the new points, a range at a time
            allocate(v(3, n - self%n_seen))
            call art_points(self, self%n_seen + 1, n, self%sources_, v)
            if (self%n_seen == 0) then
                self%lo = v(:, 1)
                self%hi = v(:, 1)
            end if
            self%lo = min(self%lo, minval(v, dim=2))
            self%hi = max(self%hi, maxval(v, dim=2))
        end if
        self%n_seen = n
        r = 0.5_wp * norm2(self%hi - self%lo)
        if (r < 1.0e-8_wp) r = 0.0_wp                 ! too small: no attenuation (as OpenFrames)
        if (r /= self%radius) then
            self%radius = r
            if (self%attenuate) call marker_style(self)
        end if
    end subroutine update_bounds