line_set_points Function

public function line_set_points(line, xyz) result(status)

Set the points of a line strip (xyz(3, n), double precision), splitting each coordinate, and the distance along the strip, into the (high, low) float pair the line shader reads, in place in the strip's buffer. Returns 0, or -1 if n exceeds the capacity.

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: line

line, marker or ribbon handle

real(kind=c_double), intent(in), dimension(:,:) :: xyz

(3, n) points

Return Value integer(kind=c_int)


Calls

proc~~line_set_points~~CallsGraph proc~line_set_points line_set_points interface~vkf_line_points vkf_line_points proc~line_set_points->interface~vkf_line_points interface~vkf_line_points_changed vkf_line_points_changed proc~line_set_points->interface~vkf_line_points_changed

Called by

proc~~line_set_points~~CalledByGraph proc~line_set_points line_set_points proc~line_node line_node proc~line_node->proc~line_set_points proc~marker_node marker_node proc~marker_node->proc~line_set_points proc~time_build_contents TimeHandle%time_build_contents proc~time_build_contents->proc~line_set_points proc~make_axes make_axes proc~make_axes->proc~line_node proc~make_axes->proc~marker_node proc~make_cone make_cone proc~make_cone->proc~line_node proc~make_grid make_grid proc~make_grid->proc~line_node proc~make_plane make_plane proc~make_plane->proc~line_node proc~make_polyhedron make_polyhedron proc~make_polyhedron->proc~line_node proc~make_polyhedron->proc~marker_node proc~axes_build_contents CoordinateAxes%axes_build_contents proc~axes_build_contents->proc~make_axes proc~axes_set_color CoordinateAxes%axes_set_color proc~axes_set_color->proc~make_axes proc~cone_build_contents PolyhedralCone%cone_build_contents proc~cone_build_contents->proc~make_cone proc~cone_set_line_color PolyhedralCone%cone_set_line_color proc~cone_set_line_color->proc~make_cone proc~elliptic_set_primary_angles EllipticCone%elliptic_set_primary_angles proc~elliptic_set_primary_angles->proc~make_cone proc~grid_build_contents LatLonGrid%grid_build_contents proc~grid_build_contents->proc~make_grid proc~grid_set_color LatLonGrid%grid_set_color proc~grid_set_color->proc~make_grid proc~grid_set_parameters LatLonGrid%grid_set_parameters proc~grid_set_parameters->proc~make_grid proc~plane_build_contents RadialPlane%plane_build_contents proc~plane_build_contents->proc~make_plane proc~plane_set_line_color RadialPlane%plane_set_line_color proc~plane_set_line_color->proc~make_plane proc~plane_set_parameters RadialPlane%plane_set_parameters proc~plane_set_parameters->proc~make_plane proc~poly_build_contents Polyhedron%poly_build_contents proc~poly_build_contents->proc~make_polyhedron proc~poly_set_draw_mode Polyhedron%poly_set_draw_mode proc~poly_set_draw_mode->proc~make_polyhedron proc~poly_set_line_color Polyhedron%poly_set_line_color proc~poly_set_line_color->proc~make_polyhedron proc~poly_set_line_width Polyhedron%poly_set_line_width proc~poly_set_line_width->proc~make_polyhedron proc~poly_set_opacity Polyhedron%poly_set_opacity proc~poly_set_opacity->proc~make_polyhedron proc~rect_set_primary_angles RectangularCone%rect_set_primary_angles proc~rect_set_primary_angles->proc~make_cone proc~remove_vertex_colors Polyhedron%remove_vertex_colors proc~remove_vertex_colors->proc~make_polyhedron proc~set_axis_length CoordinateAxes%set_axis_length proc~set_axis_length->proc~make_axes proc~set_axis_width CoordinateAxes%set_axis_width proc~set_axis_width->proc~make_axes proc~set_cone_color PolyhedralCone%set_cone_color proc~set_cone_color->proc~make_cone proc~set_cone_length PolyhedralCone%set_cone_length proc~set_cone_length->proc~make_cone proc~set_draw_axes CoordinateAxes%set_draw_axes proc~set_draw_axes->proc~make_axes proc~set_draw_mode PolyhedralCone%set_draw_mode proc~set_draw_mode->proc~make_cone proc~set_edges Polyhedron%set_edges proc~set_edges->proc~make_polyhedron proc~set_face_color Polyhedron%set_face_color proc~set_face_color->proc~make_polyhedron proc~set_faces Polyhedron%set_faces proc~set_faces->proc~make_polyhedron proc~set_grid Polyhedron%set_grid proc~set_grid->proc~make_polyhedron proc~set_line_widths LatLonGrid%set_line_widths proc~set_line_widths->proc~make_grid proc~set_lit Polyhedron%set_lit proc~set_lit->proc~make_polyhedron proc~set_plane_color RadialPlane%set_plane_color proc~set_plane_color->proc~make_plane proc~set_point_color Polyhedron%set_point_color proc~set_point_color->proc~make_polyhedron proc~set_point_size Polyhedron%set_point_size proc~set_point_size->proc~make_polyhedron proc~set_smooth Polyhedron%set_smooth proc~set_smooth->proc~make_polyhedron proc~set_tick_image CoordinateAxes%set_tick_image proc~set_tick_image->proc~make_axes proc~set_tick_shape CoordinateAxes%set_tick_shape proc~set_tick_shape->proc~make_axes proc~set_tick_size CoordinateAxes%set_tick_size proc~set_tick_size->proc~make_axes proc~set_tick_spacing CoordinateAxes%set_tick_spacing proc~set_tick_spacing->proc~make_axes proc~set_triangles Polyhedron%set_triangles proc~set_triangles->proc~make_polyhedron proc~set_two_sided Polyhedron%set_two_sided proc~set_two_sided->proc~make_polyhedron proc~set_vertex_angles PolyhedralCone%set_vertex_angles proc~set_vertex_angles->proc~make_cone proc~set_vertex_colors Polyhedron%set_vertex_colors proc~set_vertex_colors->proc~make_polyhedron proc~set_vertices Polyhedron%set_vertices proc~set_vertices->proc~make_polyhedron

Source Code

    integer(c_int) function line_set_points(line, xyz) result(status)
        type(c_ptr), intent(in) :: line                   !! line, marker or ribbon handle
        real(c_double), dimension(:,:), intent(in) :: xyz !! (3, n) points
        real(c_float), dimension(:,:,:), pointer :: p  !! (xyz and distance, high/low, point)
        type(c_ptr) :: buffer
        integer(c_int) :: capacity, n
        real(c_double) :: s                            !! distance along the strip
        integer :: i
        n = int(size(xyz, 2), c_int)
        buffer = vkf_line_points(line, capacity)
        if (.not. c_associated(buffer) .or. n > capacity) then
            status = -1
            return
        end if
        call c_f_pointer(buffer, p, [4, 2, int(capacity)])
        s = 0.0_c_double
        do i = 1, n
            if (i > 1) s = s + norm2(xyz(:, i) - xyz(:, i - 1))
            p(1:3, 1, i) = real(xyz(:, i), c_float)
            p(1:3, 2, i) = real(xyz(:, i) - real(p(1:3, 1, i), c_double), c_float)
            p(4, 1, i) = real(s, c_float)
            p(4, 2, i) = real(s - real(p(4, 1, i), c_double), c_float)
        end do
        status = vkf_line_points_changed(line, n)
    end function line_set_points