27 use iso_c_binding,
only: c_ptr, c_int32_t, c_float, c_double
29 private :: c_ptr, c_int32_t, c_float, c_double
46 include
'included_plplot_configured_types.f90'
74 type,
bind(c) :: PLfGrid
76 integer(kind=private_plint) :: nx, ny, nz
79 type,
bind(c) :: PLcGrid
80 type(c_ptr) :: xg, yg,
zg
81 integer(kind=private_plint) :: nx, ny, nz
87 use iso_c_binding,
only: c_ptr, c_char, c_null_char, c_loc, c_size_t, c_f_pointer
88 use iso_fortran_env,
only: error_unit
90 private :: c_ptr, c_char, c_null_char, c_loc, c_size_t, c_f_pointer, error_unit
109 import c_ptr, c_size_t
112 type(c_ptr),
intent(in),
value :: s
124 character(len=*),
dimension(:),
intent(in) :: character_array
125 character(len=1),
dimension(:,:),
allocatable,
target,
intent(out) :: cstring_array
126 type(c_ptr),
dimension(:),
allocatable,
intent(out) :: cstring_address
128 integer :: j_local, length_local, number_local, length_column_local
131 length_local = len(character_array)
133 number_local =
size(character_array)
137 allocate( cstring_array(length_local+1, number_local) )
138 allocate( cstring_address(number_local) )
140 do j_local = 1, number_local
141 length_column_local = len(trim(character_array(j_local))) + 1
143 cstring_array(1:length_column_local, j_local) = &
144 transfer(trim(character_array(j_local))//c_null_char,
" ", length_column_local)
145 cstring_address(j_local) = c_loc(cstring_array(1,j_local))
154 character(len=*),
dimension(:),
intent(out) :: character_array
155 type(c_ptr),
dimension(:),
intent(in) :: cstring_address_array
157 integer :: i_local, j_local, length_local, number_local, length_column_local
159 character(kind=c_char),
pointer :: string_ptr(:)
161 length_local = len(character_array)
162 number_local =
size(cstring_address_array)
163 if(number_local >
size(character_array))
then
164 write(error_unit, *)
"Error in c_to_character_array: size of character_array too small to hold converted result."
167 do j_local = 1, number_local
169 if(length_column_local > length_local)
then
170 write(error_unit, *) &
171 "Error in c_to_character_array: length of character_array too small to hold converted result."
178 call c_f_pointer(cstring_address_array(j_local), string_ptr, [length_column_local])
179 do i_local = 1, length_column_local
180 character_array(j_local)(i_local:i_local) = string_ptr(i_local)
183 character_array(j_local)(length_column_local+1:) =
" "
189 character(len=*),
intent(out) :: fstring
190 character(len=1),
dimension(:),
intent(in) :: cstring
195 do i_local = 1,
min(len(fstring),
size(cstring))
196 if ( cstring(i_local) /= c_null_char )
then
197 fstring(i_local:i_local) = cstring(i_local)
208 type(c_ptr),
dimension(:),
intent(in) :: cstring_address_array
210 integer :: j_local, number_local
211 number_local =
size(cstring_address_array)
214 do j_local = 1, number_local
236 character(len=16) :: string
264 type,
bind(c) :: private_plgraphicsin
265 integer(kind=private_plint) ::
type
266 integer(kind=private_plint) :: state
267 integer(kind=private_plint) :: keysym
268 integer(kind=private_plint) :: button
269 integer(kind=private_plint) :: subwindow
270 character(len=1),
dimension(16) :: string
271 integer(kind=private_plint) :: px, py
272 real(kind=private_plflt) :: dx, dy
273 real(kind=private_plflt) :: wx, wy
274 end type private_plgraphicsin
280 type(private_plgraphicsin) :: gin_out
283 function interface_plgetcursor( gin ) bind(c,name='plGetCursor')
286 integer(kind=private_plint) :: interface_plgetcursor
287 type(private_plgraphicsin),
intent(out) :: gin
288 end function interface_plgetcursor
294 gin%type = int(gin_out%type)
295 gin%state = int(gin_out%state)
296 gin%keysym = int(gin_out%keysym)
297 gin%button = int(gin_out%button)
298 gin%subwindow = int(gin_out%subwindow)
300 gin%pX = int(gin_out%pX)
301 gin%pY = int(gin_out%pY)
312 use iso_c_binding,
only: c_ptr, c_f_pointer
315 private :: c_ptr, private_plflt
318 real(kind=private_plflt),
value,
intent(in) :: x, y
319 real(kind=private_plflt),
intent(out) :: tx, ty
320 type(c_ptr),
value,
intent(in) :: tr_in
322 real(kind=private_plflt),
dimension(:),
pointer :: tr
324 call c_f_pointer( tr_in, tr, [6] )
326 tx = tr(1) * x + tr(2) * y + tr(3)
327 ty = tr(4) * x + tr(5) * y + tr(6)
integer function, private plgetcursor_impl(gin)
subroutine plplot_private_pltr(x, y, tx, ty, tr_in)
subroutine character_array_to_c(cstring_array, cstring_address, character_array)
integer function max_cstring_length(cstring_address_array)
subroutine copystring2f(fstring, cstring)
integer function c_to_character_array(character_array, cstring_address_array)
integer, parameter private_plunicode
integer, parameter private_double
integer, parameter private_plbool
integer, parameter private_plint
integer, parameter private_single
plgriddata(x, y, z, xg, yg, type, data)\n\ \n\ \n\ This function is used in example 21.\n\ \n\ \n\ \n\ SYNOPSIS:\n\ \n\ plgriddata(x, y, z, npts, xg, nptsx, yg, nptsy, zg, type, data)\n\ \n\ ARGUMENTS:\n\ \n\ x(PLFLT_VECTOR, input) :The input x vector.\n\ \n\ y(PLFLT_VECTOR, input) :The input y vector.\n\ \n\ z(PLFLT_VECTOR, input) :The input z vector. Each triple x[i],\n\ y[i], z[i] represents one data sample coordinate.\n\ \n\ npts(PLINT, input) :The number of data samples in the x, y and z\n\ vectors.\n\ \n\ xg(PLFLT_VECTOR, input) :A vector that specifies the grid spacing\n\ in the x direction. Usually xg has nptsx equally spaced values\n\ from the minimum to the maximum values of the x input vector.\n\ \n\ nptsx(PLINT, input) :The number of points in the xg vector.\n\ \n\ yg(PLFLT_VECTOR, input) :A vector that specifies the grid spacing\n\ in the y direction. Similar to the xg parameter.\n\ \n\ nptsy(PLINT, input) :The number of points in the yg vector.\n\ \n\ zg(PLFLT_NC_MATRIX, output) :The matrix of interpolated results\n\ where data lies in the grid specified by xg and yg. Therefore the\n\ zg matrix must be dimensioned\n\ nptsx by\n\ nptsy.\n\ \n\ type(PLINT, input) :The type of grid interpolation algorithm to\n\ use, which can be:GRID_CSA:Bivariate Cubic Spline approximation\n\ GRID_DTLI:Delaunay Triangulation Linear Interpolation\n\ GRID_NNI:Natural Neighbors Interpolation\n\ GRID_NNIDW:Nearest Neighbors Inverse Distance Weighted\n\ GRID_NNLI:Nearest Neighbors Linear Interpolation\n\ GRID_NNAIDW:Nearest Neighbors Around Inverse Distance\n\ Weighted\n\ For details of the algorithms read the source file plgridd.c.\n\ \n\ data(PLFLT, input) :Some gridding algorithms require extra data,\n\ which can be specified through this argument. Currently, for\n\ algorithm:GRID_NNIDW, data specifies the number of neighbors to\n\ use, the lower the value, the noisier(more local) the\n\ approximation is.\n\ GRID_NNLI, data specifies what a thin triangle is, in the\n\ range[1. .. 2.]. High values enable the usage of very thin\n\ triangles for interpolation, possibly resulting in error in\n\ the approximation.\n\ GRID_NNI, only weights greater than data will be accepted. If\n\ 0, all weights will be accepted.\n\ " zg