From: Alan W. I. <ai...@us...> - 2006-05-13 05:22:46
|
Update of /cvsroot/plplot/plplot/bindings/c++ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7777/bindings/c++ Modified Files: plstream.cc plstream.h Log Message: Consistent treatment of "draw" array argument and ifcc argument of plpoly3 as logical rather than integer types. Index: plstream.h =================================================================== RCS file: /cvsroot/plplot/plplot/bindings/c++/plstream.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- plstream.h 12 May 2006 23:24:01 -0000 1.29 +++ plstream.h 13 May 2006 05:22:42 -0000 1.30 @@ -481,7 +481,7 @@ /* Draws a polygon in 3 space. */ - void poly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *draw, bool ifcc ); + void poly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, bool *draw, bool ifcc ); /* Set the floating point precision (in number of places) in numeric labels. */ Index: plstream.cc =================================================================== RCS file: /cvsroot/plplot/plplot/bindings/c++/plstream.cc,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- plstream.cc 12 May 2006 23:24:01 -0000 1.36 +++ plstream.cc 13 May 2006 05:22:42 -0000 1.37 @@ -1101,19 +1101,29 @@ /* Draws a polygon in 3 space. */ -void plstream::poly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *draw, bool ifcc ) +void plstream::poly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, bool *draw, bool ifcc ) { + PLBOOL * loc_draw = new PLBOOL[n-1]; + for (int i=0;i<n-1;i++) { + loc_draw[i] = (PLBOOL) draw[i]; + } + set_stream(); - plpoly3(n,x,y,z,draw,(PLBOOL) ifcc); + plpoly3(n,x,y,z,loc_draw,(PLBOOL) ifcc); } // Deprecated version using PLINT not bool void plstream::poly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *draw, PLINT ifcc ) { + PLBOOL * loc_draw = new PLBOOL[n-1]; + for (int i=0;i<n-1;i++) { + loc_draw[i] = (PLBOOL) draw[i]; + } + set_stream(); - plpoly3(n,x,y,z,draw,(PLBOOL) ifcc); + plpoly3(n,x,y,z,loc_draw,(PLBOOL) ifcc); } /* Set the floating point precision (in number of places) in numeric labels. */ @@ -1223,8 +1233,8 @@ PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, bool *rev ) { - PLBOOL * loc_rev = new PLBOOL[npts]; - for (int i=0;i<npts;i++) { + PLBOOL * loc_rev = new PLBOOL[npts-1]; + for (int i=0;i<npts-1;i++) { loc_rev[i] = (PLBOOL) rev[i]; } @@ -1240,8 +1250,8 @@ PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *rev ) { - PLBOOL * loc_rev = new PLBOOL[npts]; - for (int i=0;i<npts;i++) { + PLBOOL * loc_rev = new PLBOOL[npts-1]; + for (int i=0;i<npts-1;i++) { loc_rev[i] = (PLBOOL) rev[i]; } |