set_opacity Subroutine

private subroutine set_opacity(self, opacity)

The body's opacity, 0 (invisible) to 1 (opaque, the default): below 1 it is drawn translucent (see the module documentation). Set below 1 before a window first shows it to make it translucent; then the opacity can change at any time (a translucent body stays translucent, an opaque one opaque).

Type Bound

Sphere

Arguments

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

0 to 1


Calls

proc~~set_opacity~~CallsGraph proc~set_opacity Sphere%set_opacity proc~apply_material apply_material proc~set_opacity->proc~apply_material proc~apply_material_to apply_material_to proc~apply_material->proc~apply_material_to interface~vkf_mesh_set_twilight vkf_mesh_set_twilight proc~apply_material_to->interface~vkf_mesh_set_twilight proc~color~2 ReferenceFrame%color proc~apply_material_to->proc~color~2 proc~mesh_set_material mesh_set_material proc~apply_material_to->proc~mesh_set_material proc~name ReferenceFrame%name proc~apply_material_to->proc~name interface~vkf_mesh_material vkf_mesh_material proc~mesh_set_material->interface~vkf_mesh_material interface~vkf_mesh_material_changed vkf_mesh_material_changed proc~mesh_set_material->interface~vkf_mesh_material_changed

Source Code

    subroutine set_opacity(self, opacity)
        class(Sphere), intent(inout) :: self
        real(wp), intent(in) :: opacity                     !! 0 to 1
        self%opacity_ = max(0.0_wp, min(1.0_wp, opacity))
        call apply_material(self)
    end subroutine set_opacity