vector_build_contents Subroutine

private subroutine vector_build_contents(self, viewer, group)

The arrow: a unit shaft and head under their transforms, in a switch.

Type Bound

VectorHandle

Arguments

Type IntentOptional Attributes Name
class(VectorHandle), intent(inout) :: self
type(c_ptr), intent(in) :: viewer

a window's viewer (null: headless)

type(c_ptr), intent(in) :: group

the frame's contents group


Calls

proc~~vector_build_contents~~CallsGraph proc~vector_build_contents VectorHandle%vector_build_contents interface~vkf_node_add_child vkf_node_add_child proc~vector_build_contents->interface~vkf_node_add_child interface~vkf_switch_create vkf_switch_create proc~vector_build_contents->interface~vkf_switch_create interface~vkf_transform_create vkf_transform_create proc~vector_build_contents->interface~vkf_transform_create proc~check_status check_status proc~vector_build_contents->proc~check_status proc~name ReferenceFrame%name proc~vector_build_contents->proc~name proc~unit_part unit_part proc~vector_build_contents->proc~unit_part proc~update_arrow update_arrow proc~vector_build_contents->proc~update_arrow proc~vector_show_state VectorHandle%vector_show_state proc~vector_build_contents->proc~vector_show_state interface~vkf_mesh_create vkf_mesh_create proc~unit_part->interface~vkf_mesh_create proc~arrow arrow proc~unit_part->proc~arrow proc~arrow_size arrow_size proc~unit_part->proc~arrow_size proc~mesh_arrays mesh_arrays proc~unit_part->proc~mesh_arrays proc~update_arrow->proc~check_status interface~vkf_switch_set vkf_switch_set proc~update_arrow->interface~vkf_switch_set interface~vkf_transform_set_matrix vkf_transform_set_matrix proc~update_arrow->interface~vkf_transform_set_matrix proc~arrow_sizes arrow_sizes proc~update_arrow->proc~arrow_sizes proc~cross cross proc~update_arrow->proc~cross proc~tip VectorHandle%tip proc~update_arrow->proc~tip proc~vector_show_state->proc~check_status proc~color~2 ReferenceFrame%color proc~vector_show_state->proc~color~2 proc~dragged DragHandle%dragged proc~vector_show_state->proc~dragged proc~hovered DragHandle%hovered proc~vector_show_state->proc~hovered proc~mesh_set_material mesh_set_material proc~vector_show_state->proc~mesh_set_material proc~arrow->proc~cross proc~arrow_sizes->proc~tip interface~vkf_mesh_array vkf_mesh_array proc~mesh_arrays->interface~vkf_mesh_array 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 vector_build_contents(self, viewer, group)
        class(VectorHandle), intent(inout) :: self
        type(c_ptr), intent(in) :: viewer                   !! a window's viewer (null: headless)
        type(c_ptr), intent(in) :: group                    !! the frame's contents group
        self%shaft_mesh = unit_part(1.0_c_double, 0.0_c_double, 1.0_c_double, 1.0_c_double)   ! (a closed cylinder)
        self%head_mesh = unit_part(0.0_c_double, 1.0_c_double, 0.0_c_double, 1.0_c_double)    ! (a cone on a disk)
        if (.not. (c_associated(self%shaft_mesh) .and. c_associated(self%head_mesh))) then
            write(*, '(a)') 'vkframes: VectorHandle '//self%name()//': could not build its arrow'
            return
        end if
        self%switch = vkf_switch_create()
        self%shaft = vkf_transform_create()
        self%head = vkf_transform_create()
        call check_status(vkf_node_add_child(self%shaft, self%shaft_mesh))
        call check_status(vkf_node_add_child(self%head, self%head_mesh))
        call check_status(vkf_node_add_child(self%switch, self%shaft))
        call check_status(vkf_node_add_child(self%switch, self%head))
        call check_status(vkf_node_add_child(group, self%switch))
        call self%show_state()
        call update_arrow(self)
        if (c_associated(viewer)) n_shown = n_shown + 1
    end subroutine vector_build_contents