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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | line |
line, marker or ribbon handle |
||
| real(kind=c_double), | intent(in), | dimension(:,:) | :: | xyz |
(3, n) points |
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