segment Subroutine

private subroutine segment(self, i, a, b, color_a, color_b)

Segment i: its endpoints, and their colors (rgba).

Type Bound

CustomLineSegments

Arguments

Type IntentOptional Attributes Name
class(CustomLineSegments), intent(in) :: self
integer, intent(in) :: i

1 to num_segments

real(kind=wp), intent(out) :: a(3)

endpoints (frame coordinates)

real(kind=wp), intent(out) :: b(3)

endpoints (frame coordinates)

real(kind=wp), intent(out), optional :: color_a(4)

color at a: [r, g, b, a]

real(kind=wp), intent(out), optional :: color_b(4)

color at b: [r, g, b, a]


Calls

proc~~segment~~CallsGraph proc~segment CustomLineSegments%segment proc~segment_color~2 segment_color proc~segment->proc~segment_color~2 proc~color~2 ReferenceFrame%color proc~segment_color~2->proc~color~2

Source Code

    subroutine segment(self, i, a, b, color_a, color_b)
        class(CustomLineSegments), intent(in) :: self
        integer, intent(in) :: i                            !! 1 to num_segments
        real(wp), intent(out) :: a(3), b(3)                 !! endpoints (frame coordinates)
        real(wp), intent(out), optional :: color_a(4)       !! color at a: [r, g, b, a]
        real(wp), intent(out), optional :: color_b(4)       !! color at b: [r, g, b, a]
        a = self%a(:, i)
        b = self%b(:, i)
        if (present(color_a)) color_a = segment_color(self, self%color_a, i)
        if (present(color_b)) color_b = segment_color(self, self%color_b, i)
    end subroutine segment