From: Andrew R. <and...@us...> - 2006-11-14 18:12:18
|
Update of /cvsroot/plplot/plplot/bindings/octave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20002/bindings/octave Modified Files: plplot_octave.h.in plplot_octave_rej.h Log Message: Add plvect and plsvect to octave bindings. Implement example 22 for octave. Index: plplot_octave.h.in =================================================================== RCS file: /cvsroot/plplot/plplot/bindings/octave/plplot_octave.h.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- plplot_octave.h.in 16 Sep 2006 01:00:12 -0000 1.8 +++ plplot_octave.h.in 14 Nov 2006 18:12:11 -0000 1.9 @@ -151,6 +151,9 @@ typedef int PLINT; #endif +/* For identifying logical (boolean) arguments */ +typedef PLINT PLBOOL; + /* For passing user data, as with X's XtPointer */ typedef void* PLPointer; @@ -532,6 +535,7 @@ #define plstripc c_plstripc #define plstripd c_plstripd #define plstyl c_plstyl +#define plsvect c_plsvect #define plsvpa c_plsvpa #define plsxax c_plsxax #define plsyax c_plsyax @@ -539,6 +543,7 @@ #define plszax c_plszax #define pltext c_pltext #define plvasp c_plvasp +#define plvect c_plvect #define plvpas c_plvpas #define plvpor c_plvpor #define plvsta c_plvsta @@ -1308,6 +1313,10 @@ void c_plstyl(PLINT nms, PLINT *mark, PLINT *space); //%name plstyl +/* Set the vector style */ + +void c_plsvect(PLFLT *arrowx, PLFLT *arrowy, PLINT npts, PLBOOL fill); //%name plsvect //%input arrowx(npts), arrowy(npts) + /* Sets the edges of the viewport to the specified absolute coordinates */ void c_plsvpa(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax); //%name plsvpa @@ -1341,6 +1350,37 @@ void c_plvasp(PLFLT aspect); //%name plvasp +/* Plot an array of vector arrows - uses the same function pointer + * convention as plcont */ + +void my_plvect(PLFLT *u, PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, PLFLT *tr) { + f2c(u,uu,nx,ny); + f2c(v,vv,nx,ny); + c_plvect(uu,vv,nx,ny,scale,xform,tr); +} //%name plvect //%input u(nx,ny), v(nx,ny), tr(6) + +/* plvect() for use with pltr1 */ +void my_plvect1(PLFLT *u, PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, PLFLT *xg, PLFLT *yg) { + PLcGrid grid1; + grid1.nx = nx; grid1.ny = ny; + grid1.xg = xg; grid1.yg = yg; + f2c(u,uu,nx,ny); + f2c(v,vv,nx,ny); + c_plvect(uu,vv,nx,ny,scale,pltr1,&grid1); +} //%name plvect1 //%input u(nx,ny), v(nx,ny), xg(nx), yg(ny) + +/* plvect() for use with pltr2 */ +void my_plvect2(PLFLT *u, PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, PLFLT *xg, PLFLT *yg) { + PLcGrid2 grid2; + f2c(xg,xgg,nx,ny); f2c(yg,ygg,nx,ny); + grid2.nx = nx; grid2.ny = ny; + grid2.xg = xgg; grid2.yg = ygg; + f2c(u,uu,nx,ny); + f2c(v,vv,nx,ny); + c_plvect(uu,vv,nx,ny,scale,pltr2,&grid2); +} //%name plvect2 //%input u(nx,ny), v(nx,ny), xg(nx,ny), yg(nx,ny) + + /* Creates the largest viewport of the specified aspect ratio that fits */ /* within the specified normalized subpage coordinates. */ Index: plplot_octave_rej.h =================================================================== RCS file: /cvsroot/plplot/plplot/bindings/octave/plplot_octave_rej.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- plplot_octave_rej.h 14 Mar 2001 03:42:26 -0000 1.2 +++ plplot_octave_rej.h 14 Nov 2006 18:12:11 -0000 1.3 @@ -99,6 +99,12 @@ PLINT *colline, PLINT *styline, char *legline[], char *labx, char *laby, char *labtop); //%nowrap +/* Plot vector arrows */ +void c_plvect(PLFLT **u, PLFLT **v, PLINT nx, PLINT ny, PLFLT scale, + void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), + PLPointer pltr_data); + + /* Set the function pointer for the keyboard event handler */ void plsKeyEH(void (*KeyEH) (PLGraphicsIn *, void *, int *), void *KeyEH_data); //%nowrap |