set_constellations Function

private function set_constellations(self, shown, file, rgba, width) result(ok)

Draw the constellations: faint lines between their stars, from constellation file file (found with find_data_file; read when given, or when first shown without one: default_constellations), shown (default false), in color rgba (default a faint blue, alpha 0.45) and width window units wide (default 1). Also while shown; the settings not given are kept. Returns false if the file can't be read (the constellations read before are kept) or width isn't > 0 (nothing changed).

Type Bound

SkySphere

Arguments

Type IntentOptional Attributes Name
class(SkySphere), intent(inout) :: self
logical, intent(in) :: shown

draw the constellations

character(len=*), intent(in), optional :: file

constellation file

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

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

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

window units (> 0)

Return Value logical


Calls

proc~~set_constellations~~CallsGraph proc~set_constellations SkySphere%set_constellations proc~make_line_node make_line_node proc~set_constellations->proc~make_line_node proc~read_constellations read_constellations proc~set_constellations->proc~read_constellations interface~vkf_compile_node vkf_compile_node proc~make_line_node->interface~vkf_compile_node interface~vkf_node_add_child vkf_node_add_child proc~make_line_node->interface~vkf_node_add_child interface~vkf_node_delete vkf_node_delete proc~make_line_node->interface~vkf_node_delete interface~vkf_node_remove_child vkf_node_remove_child proc~make_line_node->interface~vkf_node_remove_child interface~vkf_sky_lines_create vkf_sky_lines_create proc~make_line_node->interface~vkf_sky_lines_create interface~vkf_sky_stars vkf_sky_stars proc~make_line_node->interface~vkf_sky_stars interface~vkf_sky_stars_changed vkf_sky_stars_changed proc~make_line_node->interface~vkf_sky_stars_changed interface~vkf_sky_style vkf_sky_style proc~make_line_node->interface~vkf_sky_style proc~apply_attitude apply_attitude proc~make_line_node->proc~apply_attitude proc~apply_mode apply_mode proc~make_line_node->proc~apply_mode proc~check_status check_status proc~make_line_node->proc~check_status proc~find_data_file find_data_file proc~read_constellations->proc~find_data_file proc~sky_direction sky_direction proc~read_constellations->proc~sky_direction proc~apply_attitude->interface~vkf_sky_style proc~apply_attitude->proc~check_status interface~vkf_sky_style_changed vkf_sky_style_changed proc~apply_attitude->interface~vkf_sky_style_changed proc~quat_to_matrix quat_to_matrix proc~apply_attitude->proc~quat_to_matrix proc~apply_mode->proc~check_status interface~vkf_switch_set vkf_switch_set proc~apply_mode->interface~vkf_switch_set proc~find_in_dirs find_in_dirs proc~find_data_file->proc~find_in_dirs

Source Code

    logical function set_constellations(self, shown, file, rgba, width) result(ok)
        class(SkySphere), intent(inout) :: self
        logical, intent(in) :: shown                        !! draw the constellations
        character(len=*), intent(in), optional :: file      !! constellation file
        real(wp), intent(in), optional :: rgba(4)           !! color [r, g, b, a] (0 to 1)
        real(wp), intent(in), optional :: width             !! window units (> 0)
        ok = .true.
        if (present(width)) ok = width > 0.0_wp
        if (.not. ok) return
        self%lines_shown = shown
        if (present(rgba)) self%lines_rgba = rgba
        if (present(width)) self%lines_width = width
        if (present(file)) then
            ok = read_constellations(self, file)
        else if (shown .and. .not. allocated(self%constellation_file)) then
            ok = read_constellations(self, default_constellations)
        end if
        if (c_associated(self%root)) call make_line_node(self)
    end function set_constellations