arrow_create Function

public function arrow_create(base, direction, body_length, head_length, body_radius, head_radius, rgba, n_segments) result(mesh)

An arrow mesh node (see arrow) of color rgba, with 24 segments by default. Null on failure.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: base(3)

the arrow's base, and its axis (need not be unit length)

real(kind=c_double), intent(in) :: direction(3)

the arrow's base, and its axis (need not be unit length)

real(kind=c_double), intent(in) :: body_length

lengths along the axis, and radii

real(kind=c_double), intent(in) :: head_length

lengths along the axis, and radii

real(kind=c_double), intent(in) :: body_radius

lengths along the axis, and radii

real(kind=c_double), intent(in) :: head_radius

lengths along the axis, and radii

real(kind=c_float), intent(in), dimension(4) :: rgba

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

integer, intent(in), optional :: n_segments

segments around (default 24, at least 3)

Return Value type(c_ptr)


Calls

proc~~arrow_create~~CallsGraph proc~arrow_create arrow_create interface~vkf_mesh_create vkf_mesh_create proc~arrow_create->interface~vkf_mesh_create proc~arrow arrow proc~arrow_create->proc~arrow proc~arrow_size arrow_size proc~arrow_create->proc~arrow_size proc~mesh_arrays mesh_arrays proc~arrow_create->proc~mesh_arrays proc~cross cross proc~arrow->proc~cross interface~vkf_mesh_array vkf_mesh_array proc~mesh_arrays->interface~vkf_mesh_array

Called by

proc~~arrow_create~~CalledByGraph proc~arrow_create arrow_create proc~make_axis make_axis proc~make_axis->proc~arrow_create proc~build_decorations build_decorations proc~build_decorations->proc~make_axis proc~move_axis move_axis proc~move_axis->proc~make_axis proc~remake_axes remake_axes proc~remake_axes->proc~make_axis proc~set_x_label ReferenceFrame%set_x_label proc~set_x_label->proc~make_axis proc~set_y_label ReferenceFrame%set_y_label proc~set_y_label->proc~make_axis proc~set_z_label ReferenceFrame%set_z_label proc~set_z_label->proc~make_axis proc~move_x_axis ReferenceFrame%move_x_axis proc~move_x_axis->proc~move_axis proc~move_y_axis ReferenceFrame%move_y_axis proc~move_y_axis->proc~move_axis proc~move_z_axis ReferenceFrame%move_z_axis proc~move_z_axis->proc~move_axis proc~realize ReferenceFrame%realize proc~realize->proc~build_decorations proc~realize->proc~realize proc~relayout_labels relayout_labels proc~relayout_labels->proc~remake_axes proc~set_color~2 ReferenceFrame%set_color proc~set_color~2->proc~remake_axes proc~set_label_font ReferenceFrame%set_label_font proc~set_label_font->proc~remake_axes proc~add_child ReferenceFrame%add_child proc~add_child->proc~realize proc~axes_set_color CoordinateAxes%axes_set_color proc~axes_set_color->proc~set_color~2 proc~frame WindowProxy%frame proc~frame->proc~realize proc~grid_set_color LatLonGrid%grid_set_color proc~grid_set_color->proc~set_color~2 proc~new_reference_frame new_reference_frame proc~new_reference_frame->proc~set_color~2 proc~place_axes place_axes proc~place_axes->proc~move_x_axis proc~place_axes->proc~move_y_axis proc~place_axes->proc~move_z_axis proc~place_grid_axes place_grid_axes proc~place_grid_axes->proc~move_x_axis proc~place_grid_axes->proc~move_y_axis proc~place_grid_axes->proc~move_z_axis proc~segments_set_color CustomLineSegments%segments_set_color proc~segments_set_color->proc~set_color~2 proc~set_label_alignment ReferenceFrame%set_label_alignment proc~set_label_alignment->proc~relayout_labels proc~set_label_size ReferenceFrame%set_label_size proc~set_label_size->proc~relayout_labels proc~sphere_set_color Sphere%sphere_set_color proc~sphere_set_color->proc~set_color~2 proc~time_set_color TimeHandle%time_set_color proc~time_set_color->proc~set_color~2 proc~vector_set_color VectorHandle%vector_set_color proc~vector_set_color->proc~set_color~2 interface~referenceframe ReferenceFrame interface~referenceframe->proc~new_reference_frame proc~grid_set_parameters LatLonGrid%grid_set_parameters proc~grid_set_parameters->proc~place_grid_axes proc~new_coordinate_axes new_coordinate_axes proc~new_coordinate_axes->proc~place_axes proc~new_lat_lon_grid new_lat_lon_grid proc~new_lat_lon_grid->proc~place_grid_axes proc~new_radial_plane new_radial_plane proc~new_radial_plane->proc~place_axes proc~plane_set_parameters RadialPlane%plane_set_parameters proc~plane_set_parameters->proc~place_axes proc~resize WindowProxy%resize proc~resize->proc~frame proc~run WindowProxy%run proc~run->proc~frame proc~set_axis_length CoordinateAxes%set_axis_length proc~set_axis_length->proc~place_axes interface~coordinateaxes CoordinateAxes interface~coordinateaxes->proc~new_coordinate_axes interface~latlongrid LatLonGrid interface~latlongrid->proc~new_lat_lon_grid interface~radialplane RadialPlane interface~radialplane->proc~new_radial_plane

Source Code

    function arrow_create(base, direction, body_length, head_length, body_radius, head_radius, rgba, n_segments) &
            result(mesh)
        real(c_double), intent(in) :: base(3), direction(3) !! the arrow's base, and its axis (need not be unit length)
        real(c_double), intent(in) :: body_length, head_length, body_radius, head_radius !! lengths along the axis, and radii
        real(c_float), dimension(4), intent(in) :: rgba     !! color [r, g, b, a] (0 to 1)
        integer, intent(in), optional :: n_segments         !! segments around (default 24, at least 3)
        type(c_ptr) :: mesh
        real(c_float), dimension(:,:), pointer :: xyz, normals, uv
        integer(c_int32_t), dimension(:), pointer :: indices
        integer :: n, n_vertices, n_indices
        n = 24
        if (present(n_segments)) n = max(3, n_segments)
        call arrow_size(n, n_vertices, n_indices)
        ! view lighting: the same from any side, whatever the scene's lights (axes)
        mesh = vkf_mesh_create(int(n_vertices, c_int), int(n_indices, c_int), rgba, c_null_ptr, c_null_ptr, 2_c_int)
        if (.not. c_associated(mesh)) return
        call mesh_arrays(mesh, n_vertices, n_indices, xyz, normals, uv, indices)
        call arrow(base, direction, body_length, head_length, body_radius, head_radius, n, xyz, normals, uv, indices)
    end function arrow_create