light Function

private function light(self) result(p)

The light (null if not set).

Type Bound

ShadowCones

Arguments

Type IntentOptional Attributes Name
class(ShadowCones), intent(in) :: self

Return Value class(ReferenceFrame), pointer


Source Code

    function new_shadow_cones(name, body, light, body_radius, light_radius) result(s)
        character(len=*), intent(in) :: name                !! the frame's name
        class(ReferenceFrame), intent(in), target, optional :: body, light !! the body casting the shadow, the light (not owned)
        real(wp), intent(in), optional :: body_radius, light_radius  !! scene units (default: the frames' own)
        type(ShadowCones) :: s
        s%ReferenceFrame = ReferenceFrame(name)
        call s%show_axes(NO_AXES)
        call s%show_axes_labels(NO_AXES)
        call s%show_name_label(.false.)
        if (present(body)) s%body_ => body
        if (present(light)) s%light_ => light
        if (present(body_radius)) call s%set_body_radius(body_radius)
        if (present(light_radius)) call s%set_light_radius(light_radius)
        s%region(umbra)%color = [0.95_wp, 0.25_wp, 0.2_wp, 0.25_wp]
        s%region(penumbra)%color = [0.95_wp, 0.75_wp, 0.25_wp, 0.08_wp]
        s%region(antumbra)%color = [0.35_wp, 0.5_wp, 1.0_wp, 0.25_wp]
    end function new_shadow_cones

    !> The body casting the shadow (it must stay alive while set), and its
    !> radius (optional: see set_body_radius).
    subroutine set_body(self, body, radius)
        class(ShadowCones), intent(inout) :: self
        class(ReferenceFrame), intent(in), target :: body   !! the body casting the shadow (not owned)
        real(wp), intent(in), optional :: radius            !! scene units (see set_body_radius)
        self%body_ => body
        if (present(radius)) call self%set_body_radius(radius)
    end subroutine set_body

    !> The body casting the shadow (null if not set).
    function body(self) result(p)
        class(ShadowCones), intent(in) :: self
        class(ReferenceFrame), pointer :: p
        p => self%body_
    end function body

    !> The light (e.g. the Sun; it must stay alive while set), and its radius
    !> (optional: see set_light_radius).
    subroutine set_light(self, light, radius)
        class(ShadowCones), intent(inout) :: self
        class(ReferenceFrame), intent(in), target :: light  !! the light, e.g. the Sun (not owned)
        real(wp), intent(in), optional :: radius            !! scene units (see set_light_radius)
        self%light_ => light
        if (present(radius)) call self%set_light_radius(radius)
    end subroutine set_light

    !> The light (null if not set).
    function light(self) result(p)
        class(ShadowCones), intent(in) :: self
        class(ReferenceFrame), pointer :: p
        p => self%light_
    end function light