make_star_node Subroutine

private subroutine make_star_node(self)

The star node for the current stars, in place of the old one.

Arguments

Type IntentOptional Attributes Name
type(SkySphere), intent(inout) :: self

Calls

proc~~make_star_node~~CallsGraph proc~make_star_node make_star_node interface~vkf_compile_node vkf_compile_node proc~make_star_node->interface~vkf_compile_node interface~vkf_node_add_child vkf_node_add_child proc~make_star_node->interface~vkf_node_add_child interface~vkf_node_delete vkf_node_delete proc~make_star_node->interface~vkf_node_delete interface~vkf_node_remove_child vkf_node_remove_child proc~make_star_node->interface~vkf_node_remove_child interface~vkf_sky_stars vkf_sky_stars proc~make_star_node->interface~vkf_sky_stars interface~vkf_sky_stars_changed vkf_sky_stars_changed proc~make_star_node->interface~vkf_sky_stars_changed interface~vkf_stars_create vkf_stars_create proc~make_star_node->interface~vkf_stars_create proc~apply_attitude apply_attitude proc~make_star_node->proc~apply_attitude proc~apply_mode apply_mode proc~make_star_node->proc~apply_mode proc~check_status check_status proc~make_star_node->proc~check_status proc~make_name_node make_name_node proc~make_star_node->proc~make_name_node proc~apply_attitude->proc~check_status interface~vkf_sky_style vkf_sky_style proc~apply_attitude->interface~vkf_sky_style 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~make_name_node->interface~vkf_compile_node proc~make_name_node->interface~vkf_node_add_child proc~make_name_node->interface~vkf_node_delete proc~make_name_node->interface~vkf_node_remove_child proc~make_name_node->proc~apply_mode proc~make_name_node->proc~check_status interface~vkf_label_set_at_infinity vkf_label_set_at_infinity proc~make_name_node->interface~vkf_label_set_at_infinity interface~vkf_transform_create vkf_transform_create proc~make_name_node->interface~vkf_transform_create proc~apply_name_attitude apply_name_attitude proc~make_name_node->proc~apply_name_attitude proc~label_create label_create proc~make_name_node->proc~label_create proc~apply_name_attitude->proc~check_status proc~apply_name_attitude->proc~quat_to_matrix interface~vkf_transform_set_matrix vkf_transform_set_matrix proc~apply_name_attitude->interface~vkf_transform_set_matrix interface~vkf_label_create vkf_label_create proc~label_create->interface~vkf_label_create proc~get_font get_font proc~label_create->proc~get_font proc~vsg_alignment vsg_alignment proc~label_create->proc~vsg_alignment interface~vkf_font_read vkf_font_read proc~get_font->interface~vkf_font_read proc~find_font find_font proc~get_font->proc~find_font proc~find_in_dirs find_in_dirs proc~find_font->proc~find_in_dirs

Called by

proc~~make_star_node~~CalledByGraph proc~make_star_node make_star_node proc~node~2 SkySphere%node proc~node~2->proc~make_star_node proc~set_star_data SkySphere%set_star_data proc~set_star_data->proc~make_star_node proc~set_sky WindowProxy%set_sky proc~set_sky->proc~node~2

Source Code

    subroutine make_star_node(self)
        type(SkySphere), intent(inout) :: self
        real(c_float), dimension(:,:), pointer :: p
        integer(c_int) :: capacity
        type(c_ptr) :: data
        if (c_associated(self%star_node)) then
            call check_status(vkf_node_remove_child(self%star_switch, self%star_node), 'SkySphere')
            call vkf_node_delete(self%star_node)
            self%star_node = c_null_ptr
        end if
        if (self%n_stars > 0) then
            self%star_node = vkf_stars_create(int(self%n_stars, c_int))
            if (c_associated(self%star_node)) then
                data = vkf_sky_stars(self%star_node, capacity)
                if (c_associated(data)) then
                    call c_f_pointer(data, p, [8, int(capacity)])
                    p(:, 1:self%n_stars) = self%stars(:, 1:self%n_stars)
                    call check_status(vkf_sky_stars_changed(self%star_node, int(self%n_stars, c_int)), 'SkySphere')
                end if
                call apply_attitude(self, self%star_node)
                if (self%shown) call check_status(vkf_compile_node(self%star_node), 'SkySphere')
                call check_status(vkf_node_add_child(self%star_switch, self%star_node), 'SkySphere')
            end if
        end if
        call make_name_node(self)                     ! (the names after the stars: in front of them)
        call apply_mode(self)
    end subroutine make_star_node