write_curve Subroutine

private subroutine write_curve(self, i1, i2)

Write points i1 .. i2 into the chain (and upload the chunks written to).

Type Bound

CurveArtist

Arguments

Type IntentOptional Attributes Name
class(CurveArtist), intent(inout) :: self
integer, intent(in) :: i1

the trajectory points

integer, intent(in) :: i2

the trajectory points


Calls

proc~~write_curve~~CallsGraph proc~write_curve CurveArtist%write_curve is_colored is_colored proc~write_curve->is_colored num_chunks num_chunks proc~write_curve->num_chunks positions positions proc~write_curve->positions proc~art_points art_points proc~write_curve->proc~art_points proc~is_position_xyz is_position_xyz proc~write_curve->proc~is_position_xyz proc~split_points split_points proc~write_curve->proc~split_points proc~transformed transformed proc~write_curve->proc~transformed proc~write_colors write_colors proc~write_curve->proc~write_colors slice slice proc~write_curve->slice written written proc~write_curve->written proc~points Trajectory%points proc~art_points->proc~points proc~to_shown_at to_shown_at proc~art_points->proc~to_shown_at proc~write_colors->num_chunks color_slice color_slice proc~write_colors->color_slice colors colors proc~write_colors->colors num_colors num_colors proc~write_colors->num_colors proc~to_shown_at->proc~transformed proc~to_shown to_shown proc~to_shown_at->proc~to_shown 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 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

Source Code

    subroutine write_curve(self, i1, i2)
        class(CurveArtist), intent(inout) :: self
        integer, intent(in) :: i1, i2                       !! the trajectory points
        real(c_float), dimension(:,:,:), pointer :: p
        real(wp), dimension(:,:), pointer :: pos
        real(wp), allocatable :: v(:,:)
        integer :: j, lo, hi
        do j = 1, self%chain%num_chunks()
            call self%chain%slice(j, i1, i2, lo, hi, p)
            if (.not. associated(p)) cycle
            if (is_position_xyz(self%sources_) .and. .not. transformed(self)) then   ! the usual case: the positions
                call self%traj%positions(pos)
                call split_points(pos(:, lo:hi), p)
            else                                            ! other sources, or transformed: a range at a time
                allocate(v(3, hi - lo + 1))
                call art_points(self, lo, hi, self%sources_, v)
                call split_points(v, p)
                deallocate(v)
            end if
        end do
        if (self%chain%is_colored()) call write_colors(self, i1, i2)
        if (is_position_xyz(self%sources_) .and. .not. transformed(self)) then   ! distances from the positions in double
            call self%traj%positions(pos)
            call self%chain%written(i1, i2, pos)
        else
            call self%chain%written(i1, i2)
        end if
    end subroutine write_curve