From: <ai...@us...> - 2011-01-02 01:06:03
|
Revision: 11422 http://plplot.svn.sourceforge.net/plplot/?rev=11422&view=rev Author: airwin Date: 2011-01-02 01:05:57 +0000 (Sun, 02 Jan 2011) Log Message: ----------- Implement plmesh-related wrappers. This allows example 28 to work and give consistent results with the C equivalent. Modified Paths: -------------- trunk/bindings/octave/plplot_octave.i trunk/plplot_test/test_octave.sh.in Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2011-01-02 00:44:44 UTC (rev 11421) +++ trunk/bindings/octave/plplot_octave.i 2011-01-02 01:05:57 UTC (rev 11422) @@ -437,9 +437,9 @@ /* Set Y length for later consistency checking, with trailing count */ /* and 2D array, check for consistency input / output version */ -%typemap(in) (PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk) (Matrix temp) {} -%typemap(argout) (PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk) {} -%typemap(freearg) (PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk) {} +%typemap(in) (PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) (Matrix temp) {} +%typemap(argout) (PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) {} +%typemap(freearg) (PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) {} //----------------------------------------------------------------------------- @@ -680,10 +680,63 @@ void my_plcont2p( PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT *Array, PLINT n, PLFLT *MatrixCk, PLFLT *MatrixCk ); +// plgriddata wrapper. +%ignore plgriddata; +%rename(plgriddata) my_plgriddata; + +%{ +void my_plgriddata( PLFLT *x, PLFLT *y, PLFLT *z, int npts, + PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, + PLFLT *zg, int type, PLFLT data ) +{ + f2c( zg, zgg, nptsx, nptsy ); + plgriddata( x, y, z, npts, xg, nptsx, yg, nptsy, zgg, type, data ); + for ( int i = 0; i < nptsx; i++ ) + for ( int j = 0; j < nptsy; j++ ) + *( zg + nptsx * j + i ) = zgg[i][j]; +} +%} +void my_plgriddata( PLFLT *x, PLFLT *y, PLFLT *z, int npts, + PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, + PLFLT *zg, int type, PLFLT data ); + +void +my_plgriddata( PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLINT n, + PLFLT *ArrayX, PLINT nx, PLFLT *ArrayY, PLINT ny, + PLFLT *OutMatrixCk, PLINT type, PLFLT data ); + +// plmesh-related wrappers. +%ignore plmesh; +%rename(plmesh) my_plmesh; +%ignore plmeshc; +%rename(plmeshc) my_plmeshc; + +%{ +// Plots a mesh representation of the function z[x][y]. + +void my_plmesh( PLFLT *x, PLFLT *y, PLFLT *z, PLINT nx, PLINT ny, PLINT opt ) +{ + f2c( z, zz, nx, ny ); + c_plmesh( x, y, zz, nx, ny, opt ); +} + +// Plots a mesh representation of the function z[x][y] with contour + +void my_plmeshc( PLFLT *x, PLFLT *y, PLFLT *z, PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel ) +{ + f2c( z, zz, nx, ny ); + c_plmeshc( x, y, zz, nx, ny, opt, clevel, nlevel ); +} +%} + +void my_plmesh( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT *MatrixCk, + PLINT nx, PLINT ny, PLINT opt ); + +void my_plmeshc( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT *MatrixCk, + PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); + // Deal with these later. %ignore pllegend; -%ignore plmesh; -%ignore plmeshc; %ignore plot3d; %ignore plot3dc; %ignore plot3dcl; Modified: trunk/plplot_test/test_octave.sh.in =================================================================== --- trunk/plplot_test/test_octave.sh.in 2011-01-02 00:44:44 UTC (rev 11421) +++ trunk/plplot_test/test_octave.sh.in 2011-01-02 01:05:57 UTC (rev 11422) @@ -77,7 +77,7 @@ # 15, 16: shade plots, callbacks, # 20: plimage # until typemaps for swig-generated interface are done. -@swig_octave_comment@for i=[1:7 9 10 12 13 14 17 18 23:27 29:31] ; +@swig_octave_comment@for i=[1:7 9 10 12 13 14 17 18 23:31] ; @matwrap_octave_comment@for i=[1:18 20:31 ] ; ofile = sprintf("${OUTPUT_DIR}/x%.2d${lang}_${dsuffix}.txt",i); strm = fopen(ofile,"w"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |