make_line_node Subroutine

private subroutine make_line_node(self)

The constellations node for the lines read and the settings, in place of the old one (none unless shown).

Arguments

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

Calls

proc~~make_line_node~~CallsGraph proc~make_line_node make_line_node 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~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

Called by

proc~~make_line_node~~CalledByGraph proc~make_line_node make_line_node proc~node~2 SkySphere%node proc~node~2->proc~make_line_node proc~set_constellations SkySphere%set_constellations proc~set_constellations->proc~make_line_node proc~set_sky WindowProxy%set_sky proc~set_sky->proc~node~2

Source Code

    subroutine make_line_node(self)
        type(SkySphere), intent(inout) :: self
        real(c_float), dimension(:,:), pointer :: p
        real(c_float), dimension(:), pointer :: style
        integer(c_int) :: capacity
        type(c_ptr) :: data
        if (c_associated(self%line_node)) then
            call check_status(vkf_node_remove_child(self%line_switch, self%line_node), 'SkySphere')
            call vkf_node_delete(self%line_node)
            self%line_node = c_null_ptr
        end if
        if (self%lines_shown .and. self%n_lines > 0) then
            self%line_node = vkf_sky_lines_create(int(self%n_lines, c_int))
            if (c_associated(self%line_node)) then
                data = vkf_sky_stars(self%line_node, capacity)
                if (c_associated(data)) then
                    call c_f_pointer(data, p, [8, int(capacity)])
                    p(:, 1:self%n_lines) = self%lines(:, 1:self%n_lines)
                    call check_status(vkf_sky_stars_changed(self%line_node, int(self%n_lines, c_int)), 'SkySphere')
                end if
                data = vkf_sky_style(self%line_node)
                if (c_associated(data)) then                ! (the attitude: apply_attitude)
                    call c_f_pointer(data, style, [24])
                    style(17:24) = real([self%lines_width, 0.0_wp, 0.0_wp, 0.0_wp, self%lines_rgba], c_float)
                end if
                call apply_attitude(self, self%line_node)
                if (self%shown) call check_status(vkf_compile_node(self%line_node), 'SkySphere')
                call check_status(vkf_node_add_child(self%line_switch, self%line_node), 'SkySphere')
            end if
        end if
        call apply_mode(self)
    end subroutine make_line_node