add_point Subroutine

private subroutine add_point(self, t, pos, att, color)

Add a point: a time with an optional position, attitude and color ([r, g, b] or [r, g, b, a]).

A circular orbit, a point a minute (with orbit%add, the generic name):

orbit = Trajectory()
do k = 0, 360
    t = 60.0_wp * k
    a = 2.0_wp * pi * t / 5400.0_wp
    call orbit%add(t, pos=7000.0_wp * [cos(a), sin(a), 0.0_wp])
end do

Type Bound

Trajectory

Arguments

Type IntentOptional Attributes Name
class(Trajectory), intent(inout) :: self
real(kind=wp), intent(in) :: t

time

real(kind=wp), intent(in), optional :: pos(:)

position (first dof elements used)

real(kind=wp), intent(in), optional :: att(4)

attitude quaternion [x, y, z, w]

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)


Calls

proc~~add_point~~CallsGraph proc~add_point Trajectory%add_point proc~add_attitude Trajectory%add_attitude proc~add_point->proc~add_attitude proc~add_color Trajectory%add_color proc~add_point->proc~add_color proc~add_position Trajectory%add_position proc~add_point->proc~add_position proc~add_time Trajectory%add_time proc~add_point->proc~add_time proc~grow_attitudes grow_attitudes proc~add_attitude->proc~grow_attitudes proc~grow_colors grow_colors proc~add_color->proc~grow_colors proc~to_float_rgba to_float_rgba proc~add_color->proc~to_float_rgba proc~grow_positions grow_positions proc~add_position->proc~grow_positions proc~grow_times grow_times proc~add_time->proc~grow_times proc~new_capacity new_capacity proc~grow_attitudes->proc~new_capacity proc~grow_colors->proc~new_capacity proc~grow_positions->proc~new_capacity proc~grow_times->proc~new_capacity

Source Code

    subroutine add_point(self, t, pos, att, color)
        class(Trajectory), intent(inout) :: self
        real(wp), intent(in) :: t                       !! time
        real(wp), intent(in), optional :: pos(:)        !! position (first [[dof]] elements used)
        real(wp), intent(in), optional :: att(4)        !! attitude quaternion [x, y, z, w]
        real(wp), intent(in), optional :: color(:)      !! [r, g, b] or [r, g, b, a] (0 to 1)
        call self%add_time(t)
        if (present(pos)) call self%add_position(pos)
        if (present(att)) call self%add_attitude(att)
        if (present(color)) call self%add_color(color)
    end subroutine add_point