From: <arj...@us...> - 2011-02-03 08:15:57
|
Revision: 11543 http://plplot.svn.sourceforge.net/plplot/?rev=11543&view=rev Author: arjenmarkus Date: 2011-02-03 08:15:51 +0000 (Thu, 03 Feb 2011) Log Message: ----------- Correct some details in the Fortran 77 interface to pllegend. Add example 33 to the mix (commenting all things related to plcolorbar; there are still a few differences in the displayed text!) Modified Paths: -------------- trunk/bindings/f77/plplotf77.def trunk/bindings/f77/sfstubs.fm4 trunk/examples/f77/CMakeLists.txt trunk/examples/f77/x33f.fm4 Modified: trunk/bindings/f77/plplotf77.def =================================================================== --- trunk/bindings/f77/plplotf77.def 2011-02-01 07:31:56 UTC (rev 11542) +++ trunk/bindings/f77/plplotf77.def 2011-02-03 08:15:51 UTC (rev 11543) @@ -17,7 +17,7 @@ _PLIMAGEFR2@56 _PLIMAGEFR@48 _PLLAB@24 - _PLLEGEND@128 + _PLLEGEND@132 _PLLEGEND_CNV_TEXT@16 _PLMAP@28 _PLMAP_NONE@24 Modified: trunk/bindings/f77/sfstubs.fm4 =================================================================== --- trunk/bindings/f77/sfstubs.fm4 2011-02-01 07:31:56 UTC (rev 11542) +++ trunk/bindings/f77/sfstubs.fm4 2011-02-03 08:15:51 UTC (rev 11543) @@ -308,8 +308,8 @@ integer nrow, ncolumn, nlegend integer opt_array, text_colors, box_colors, box_patterns - integer box_scales, line_colors, line_styles - real*8 box_line_widths, line_widths, symbol_scales + integer box_scales, line_colors, line_styles, line_widths + real*8 box_line_widths, symbol_scales integer symbol_colors, symbol_numbers character*(*) text, symbols Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2011-02-01 07:31:56 UTC (rev 11542) +++ trunk/examples/f77/CMakeLists.txt 2011-02-03 08:15:51 UTC (rev 11543) @@ -57,6 +57,7 @@ "29" "30" "31" + "33" ) if(CORE_BUILD) Modified: trunk/examples/f77/x33f.fm4 =================================================================== --- trunk/examples/f77/x33f.fm4 2011-02-01 07:31:56 UTC (rev 11542) +++ trunk/examples/f77/x33f.fm4 2011-02-03 08:15:51 UTC (rev 11543) @@ -669,20 +669,23 @@ c Color bar examples - call plcolorbar_example_1( PL_COLORBAR_IMAGE, 0.0d0, 0, 2, - & values_small, 'Image Color Bars' ) - call plcolorbar_example_2( PL_COLORBAR_IMAGE, 0.0d0, 0, 2, - & values_small, 'Image Color Bars' ) - call plcolorbar_example_1( - & PL_COLORBAR_SHADE + PL_COLORBAR_SHADE_LABEL, - & 0.0d0, 0, 9, values_uneven, - & 'Shade Color Bars - Uneven Steps' ) - call plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0d0, 3, 9, - & values_even, 'Shade Color Bars - Even Steps' ) - call plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5d0, 5, 2, - & values_small, 'Gradient Color Bars' ) - call plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5d0, 5, 2, - & values_small, 'Gradient Color Bars' ) +c +c Note: commented until plcolorbar is ready! +c +c call plcolorbar_example_1( PL_COLORBAR_IMAGE, 0.0d0, 0, 2, +c & values_small, 'Image Color Bars' ) +c call plcolorbar_example_2( PL_COLORBAR_IMAGE, 0.0d0, 0, 2, +c & values_small, 'Image Color Bars' ) +c call plcolorbar_example_1( +c & PL_COLORBAR_SHADE + PL_COLORBAR_SHADE_LABEL, +c & 0.0d0, 0, 9, values_uneven, +c & 'Shade Color Bars - Uneven Steps' ) +c call plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0d0, 3, 9, +c & values_even, 'Shade Color Bars - Even Steps' ) +c call plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5d0, 5, 2, +c & values_small, 'Gradient Color Bars' ) +c call plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5d0, 5, 2, +c & values_small, 'Gradient Color Bars' ) call plend() end @@ -717,174 +720,174 @@ end c Color bar routines - - subroutine plcolorbar_example_1( bar_type, ticks, sub_ticks, n, - & values, title ) - - implicit none - - include 'plplot_parameters.h' - - integer bar_type, position - real*8 ticks - integer sub_ticks - integer n - real*8 values(*) - character(*) title - c +c subroutine plcolorbar_example_1( bar_type, ticks, sub_ticks, n, +c & values, title ) +c +c implicit none +c +c include 'plplot_parameters.h' +c +c integer bar_type, position +c real*8 ticks +c integer sub_ticks +c integer n +c real*8 values(*) +c character(*) title +c +c c FORTRAN 77: array fixed c - real*8 colors(20) - real*8 color_step - integer i - integer opt - character(10) axis_opts_1, axis_opts_2 - - call pladv( 0 ) - +c real*8 colors(20) +c real*8 color_step +c integer i +c integer opt +c character(10) axis_opts_1, axis_opts_2 +c +c call pladv( 0 ) +c c Setup color palette 1 - call plspal1( 'cmap1_blue_red.pal', 1 ) - - color_step = 1.0d0 / ( n - 1 ) - do 110 i = 1,n - colors(i) = 0.0d0 + color_step * i - 110 continue - - position = PL_POSITION_LEFT - opt = bar_type + PL_COLORBAR_LABEL_LEFT + - & PL_COLORBAR_CAP_HIGH - - if ( mod( bar_type, 2*PL_COLORBAR_SHADE_LABEL ) / - & PL_COLORBAR_SHADE_LABEL .eq. 1 ) then - axis_opts_1 = 'iv' - axis_opts_2 = 'i' - else - if ( sub_ticks .ne. 0 ) then - axis_opts_1 = 'stv' - axis_opts_2 = 'st' - else - axis_opts_1 = 'tv' - axis_opts_2 = 't' - endif - endif - - call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, - & ticks, sub_ticks, - & axis_opts_1, 'Test label - Left, High Cap', - & n, colors, values ) - - position = PL_POSITION_RIGHT - opt = bar_type + PL_COLORBAR_LABEL_RIGHT + - & PL_COLORBAR_CAP_LOW - - call plcolorbar( opt, 0.1d0, 0.4d0, 0.5d0, 0.1d0, - & ticks, sub_ticks, - & axis_opts_1, 'Test label - Right, Low Cap', - & n, colors, values ) - - position = PL_POSITION_TOP - opt = bar_type + PL_COLORBAR_LABEL_TOP + - & PL_COLORBAR_CAP_HIGH - - call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, - & ticks, sub_ticks, - & axis_opts_2, 'Test label - Upper, High Cap', - & n, colors, values ) - - position = PL_POSITION_TOP - opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + - & PL_COLORBAR_CAP_LOW - - call plcolorbar( opt, 0.4d0, 0.1d0, 0.5d0, 0.1d0, - & ticks, sub_ticks, - & axis_opts_2, 'Test label - Lower, Low Cap', - & n, colors, values ) - - call plvpor( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) - call plwind( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) - call plptex( 0.5d0, 0.5d0, 0.0d0, 0.0d0, 0.5d0, title ) - end - - subroutine plcolorbar_example_2( bar_type, ticks, sub_ticks, n, - & values, title ) - - implicit none - - include 'plplot_parameters.h' - - integer bar_type, position - real*8 ticks - integer sub_ticks - integer n - real*8 values(*) - character(*) title - - real*8 colors(20) - integer i - real*8 color_step - integer opt - character(10) axis_opts_1, axis_opts_2 - - call pladv( 0 ) +c call plspal1( 'cmap1_blue_red.pal', 1 ) +c +c color_step = 1.0d0 / ( n - 1 ) +c do 110 i = 1,n +c colors(i) = 0.0d0 + color_step * i +c 110 continue +c +c position = PL_POSITION_LEFT +c opt = bar_type + PL_COLORBAR_LABEL_LEFT + +c & PL_COLORBAR_CAP_HIGH +c +c if ( mod( bar_type, 2*PL_COLORBAR_SHADE_LABEL ) / +c & PL_COLORBAR_SHADE_LABEL .eq. 1 ) then +c axis_opts_1 = 'iv' +c axis_opts_2 = 'i' +c else +c if ( sub_ticks .ne. 0 ) then +c axis_opts_1 = 'stv' +c axis_opts_2 = 'st' +c else +c axis_opts_1 = 'tv' +c axis_opts_2 = 't' +c endif +c endif +c +c call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, +c & ticks, sub_ticks, +c & axis_opts_1, 'Test label - Left, High Cap', +c & n, colors, values ) +c +c position = PL_POSITION_RIGHT +c opt = bar_type + PL_COLORBAR_LABEL_RIGHT + +c & PL_COLORBAR_CAP_LOW +c +c call plcolorbar( opt, 0.1d0, 0.4d0, 0.5d0, 0.1d0, +c & ticks, sub_ticks, +c & axis_opts_1, 'Test label - Right, Low Cap', +c & n, colors, values ) +c +c position = PL_POSITION_TOP +c opt = bar_type + PL_COLORBAR_LABEL_TOP + +c & PL_COLORBAR_CAP_HIGH +c +c call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, +c & ticks, sub_ticks, +c & axis_opts_2, 'Test label - Upper, High Cap', +c & n, colors, values ) +c +c position = PL_POSITION_TOP +c opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + +c & PL_COLORBAR_CAP_LOW +c +c call plcolorbar( opt, 0.4d0, 0.1d0, 0.5d0, 0.1d0, +c & ticks, sub_ticks, +c & axis_opts_2, 'Test label - Lower, Low Cap', +c & n, colors, values ) +c +c call plvpor( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) +c call plwind( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) +c call plptex( 0.5d0, 0.5d0, 0.0d0, 0.0d0, 0.5d0, title ) +c end +c +c subroutine plcolorbar_example_2( bar_type, ticks, sub_ticks, n, +c & values, title ) +c +c implicit none +c +c include 'plplot_parameters.h' +c +c integer bar_type, position +c real*8 ticks +c integer sub_ticks +c integer n +c real*8 values(*) +c character(*) title +c +c real*8 colors(20) +c integer i +c real*8 color_step +c integer opt +c character(10) axis_opts_1, axis_opts_2 +c +c call pladv( 0 ) c Setup color palette 1 - call plspal1( 'cmap1_blue_yellow.pal', 1 ) - - color_step = 1.0d0 / ( n - 1 ) - do 110 i = 1,n - colors(i) = 0.0d0 + color_step * i - 110 continue - - position = PL_POSITION_LEFT - opt = bar_type + PL_COLORBAR_LABEL_LEFT + - & PL_COLORBAR_CAP_LOW - - if ( bar_type .eq. PL_COLORBAR_SHADE_LABEL ) then - axis_opts_1 = '' - axis_opts_2 = '' - else - if ( sub_ticks .ne. 0 ) then - axis_opts_1 = 'stv' - axis_opts_2 = 'st' - else - axis_opts_1 = 'tv' - axis_opts_2 = 't' - endif - endif - - call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, - & ticks, sub_ticks, - & axis_opts_1, 'Test label - Left, Low Cap', - & n, colors, values ) - - position = PL_POSITION_RIGHT - opt = bar_type + PL_COLORBAR_LABEL_RIGHT + - & PL_COLORBAR_CAP_HIGH - - call plcolorbar( opt, 0.1d0, 0.4d0, 0.5d0, 0.1d0, - & ticks, sub_ticks, - & axis_opts_1, 'Test label - Right, High Cap', - & n, colors, values ) - - position = PL_POSITION_TOP - opt = bar_type + PL_COLORBAR_LABEL_TOP + - & PL_COLORBAR_CAP_LOW - - call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, - & ticks, sub_ticks, - & axis_opts_2, 'Test label - Upper, Low Cap', - & n, colors, values ) - - position = PL_POSITION_BOTTOM - opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + - & PL_COLORBAR_CAP_HIGH - - call plcolorbar( opt, 0.4d0, 0.1d0, 0.5d0, 0.1d0, - & ticks, sub_ticks, - & axis_opts_2, 'Test label - Lower, High Cap', - & n, colors, values ) - - call plvpor( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) - call plwind( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) - call plptex( 0.5d0, 0.5d0, 0.0d0, 0.0d0, 0.5d0, title ) - end +c call plspal1( 'cmap1_blue_yellow.pal', 1 ) +c +c color_step = 1.0d0 / ( n - 1 ) +c do 110 i = 1,n +c colors(i) = 0.0d0 + color_step * i +c 110 continue +c +c position = PL_POSITION_LEFT +c opt = bar_type + PL_COLORBAR_LABEL_LEFT + +c & PL_COLORBAR_CAP_LOW +c +c if ( bar_type .eq. PL_COLORBAR_SHADE_LABEL ) then +c axis_opts_1 = '' +c axis_opts_2 = '' +c else +c if ( sub_ticks .ne. 0 ) then +c axis_opts_1 = 'stv' +c axis_opts_2 = 'st' +c else +c axis_opts_1 = 'tv' +c axis_opts_2 = 't' +c endif +c endif +c +c call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, +c & ticks, sub_ticks, +c & axis_opts_1, 'Test label - Left, Low Cap', +c & n, colors, values ) +c +c position = PL_POSITION_RIGHT +c opt = bar_type + PL_COLORBAR_LABEL_RIGHT + +c & PL_COLORBAR_CAP_HIGH +c +c call plcolorbar( opt, 0.1d0, 0.4d0, 0.5d0, 0.1d0, +c & ticks, sub_ticks, +c & axis_opts_1, 'Test label - Right, High Cap', +c & n, colors, values ) +c +c position = PL_POSITION_TOP +c opt = bar_type + PL_COLORBAR_LABEL_TOP + +c & PL_COLORBAR_CAP_LOW +c +c call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, +c & ticks, sub_ticks, +c & axis_opts_2, 'Test label - Upper, Low Cap', +c & n, colors, values ) +c +c position = PL_POSITION_BOTTOM +c opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + +c & PL_COLORBAR_CAP_HIGH +c +c call plcolorbar( opt, 0.4d0, 0.1d0, 0.5d0, 0.1d0, +c & ticks, sub_ticks, +c & axis_opts_2, 'Test label - Lower, High Cap', +c & n, colors, values ) +c +c call plvpor( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) +c call plwind( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) +c call plptex( 0.5d0, 0.5d0, 0.0d0, 0.0d0, 0.5d0, title ) +c end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2011-02-03 08:19:58
|
Revision: 11544 http://plplot.svn.sourceforge.net/plplot/?rev=11544&view=rev Author: arjenmarkus Date: 2011-02-03 08:19:52 +0000 (Thu, 03 Feb 2011) Log Message: ----------- Implementation of the Fortran 95 interface to pllegend. Extended example 4 with the appropriate calls. No formal comparisons yet. Note: the interface uses the nlegend arguments just as the C version. I could have used the size of the text argument to determine this, but that would have meant that the user has to select the right section, e.g. call pllegend(..., text(1:nlegend), ...) to limit the number of entries. It would not have been as convenient as with the other cases where a "size" argument is derived on the Fortran 95 side. Modified Paths: -------------- trunk/bindings/f95/plplotf95.def trunk/bindings/f95/plplotf95_ifort.def trunk/bindings/f95/plplotf95_mingw.def trunk/bindings/f95/plstubs.h trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubsf95.f90 trunk/examples/f95/x04f.f90 Modified: trunk/bindings/f95/plplotf95.def =================================================================== --- trunk/bindings/f95/plplotf95.def 2011-02-03 08:15:51 UTC (rev 11543) +++ trunk/bindings/f95/plplotf95.def 2011-02-03 08:19:52 UTC (rev 11544) @@ -55,6 +55,7 @@ _PLPLOTP_mp_PLIMAGEFR_1@44 _PLPLOTP_mp_PLIMAGEFR_2@44 _PLPLOTP_mp_PLIMAGEFR_TR@40 + _PLPLOT_mp_PLLEGEND@132 _PLPLOT_mp_PLLINE@8 _PLPLOT_mp_PLLINE3@12 _PLPLOT_mp_PLMESH@16 Modified: trunk/bindings/f95/plplotf95_ifort.def =================================================================== --- trunk/bindings/f95/plplotf95_ifort.def 2011-02-03 08:15:51 UTC (rev 11543) +++ trunk/bindings/f95/plplotf95_ifort.def 2011-02-03 08:19:52 UTC (rev 11544) @@ -57,6 +57,7 @@ PLPLOTP_mp_PLIMAGEFR_1 PLPLOTP_mp_PLIMAGEFR_2 PLPLOTP_mp_PLIMAGEFR_TR + PLPLOT_mp_PLLEGEND PLPLOT_mp_PLLINE PLPLOT_mp_PLLINE3 PLPLOT_mp_PLMESH Modified: trunk/bindings/f95/plplotf95_mingw.def =================================================================== --- trunk/bindings/f95/plplotf95_mingw.def 2011-02-03 08:15:51 UTC (rev 11543) +++ trunk/bindings/f95/plplotf95_mingw.def 2011-02-03 08:19:52 UTC (rev 11544) @@ -55,6 +55,7 @@ __plplot_MOD_plgriddata __plplot_MOD_plhist __plplot_MOD_plimage + __plplot_MOD_pllegend __plplot_MOD_plline __plplot_MOD_plline3 __plplot_MOD_plmesh Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2011-02-03 08:15:51 UTC (rev 11543) +++ trunk/bindings/f95/plstubs.h 2011-02-03 08:19:52 UTC (rev 11544) @@ -245,6 +245,8 @@ #define PLINIT FNAME( PLINIT, plinit ) #define PLJOIN FNAME( PLJOIN, pljoin ) #define PLLAB7 FNAME( PLLAB7, pllab7 ) +#define PLLEGEND_CNV_TEXT FNAME( PLLEGEND07_CNV_TEXT, pllegend07_cnv_text ) +#define PLLEGEND FNAME( PLLEGEND07, pllegend07 ) #define PLLIGHTSOURCE FNAME( PLLIGHTSOURCE, pllightsource ) #define PLLINE FNAME( PLLINEF77, pllinef77 ) #define PLLINE3 FNAME( PLLINE3F77, plline3f77 ) Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-02-03 08:15:51 UTC (rev 11543) +++ trunk/bindings/f95/scstubs.c 2011-02-03 08:19:52 UTC (rev 11544) @@ -43,6 +43,10 @@ // Slightly different to C version as we don't support PLPointer for additional data static void ( STDCALL *pltransform )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ); + +static char **pllegend_text; +static char **pllegend_symbols; + static void pltransformf2c( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer data ) { @@ -552,7 +556,80 @@ label[i + 1] = '\0'; } +// Auxiliary function to create a C-compatible string array +// Note the hidden argument void +PLLEGEND_CNV_TEXT( PLINT *id, PLINT *number, char *string, PLINT length ) +{ + int j; + int i; + char **p_string; + char *data; + + // Ensure the strings are null terminated + + p_string = (char **) malloc( sizeof ( char * ) * ( *number ) ); + data = (char *) malloc( sizeof ( char * ) * ( *number ) * ( length + 1 ) ); + + for ( j = 0; j < ( *number ); j++ ) + { + p_string[j] = data + j * ( length + 1 ); + memcpy( p_string[j], &string[j * length], length ); + p_string[j][length] = '\0'; + i = length - 1; + while ( ( i >= 0 ) && ( p_string[j][i] == ' ' ) ) + i--; + p_string[j][i + 1] = '\0'; + } + + if ( *id == 1 ) + { + pllegend_text = p_string; + } + else + { + pllegend_symbols = p_string; + } +} + +void PLLEGEND( + PLFLT *p_legend_width, PLFLT *p_legend_height, + PLINT *position, PLINT *opt, PLFLT *x, PLFLT *y, PLFLT *plot_width, + PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, + PLINT *nrow, PLINT *ncolumn, + PLINT *nlegend, const PLINT *opt_array, + PLFLT *text_offset, PLFLT *text_scale, PLFLT *text_spacing, + PLFLT *text_justification, + const PLINT *text_colors, + const PLINT *box_colors, const PLINT *box_patterns, + const PLFLT *box_scales, const PLINT *box_line_widths, + const PLINT *line_colors, const PLINT *line_styles, + const PLINT *line_widths, + const PLINT *symbol_colors, const PLFLT *symbol_scales, + const PLINT *symbol_numbers ) +{ + c_pllegend( p_legend_width, p_legend_height, + *position, *opt, *x, *y, *plot_width, + *bg_color, *bb_color, *bb_style, + *nrow, *ncolumn, + *nlegend, opt_array, + *text_offset, *text_scale, *text_spacing, + *text_justification, + text_colors, (const char **)pllegend_text, + box_colors, box_patterns, + box_scales, box_line_widths, + line_colors, line_styles, + line_widths, + symbol_colors, symbol_scales, + symbol_numbers, (const char **)pllegend_symbols ) ; + + free( *pllegend_text ); + free( pllegend_text ); + free( *pllegend_symbols ); + free( pllegend_symbols ); +} + +void PLLIGHTSOURCE( PLFLT *x, PLFLT *y, PLFLT *z ) { c_pllightsource( *x, *y, *z ); Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2011-02-03 08:15:51 UTC (rev 11543) +++ trunk/bindings/f95/sfstubsf95.f90 2011-02-03 08:19:52 UTC (rev 11544) @@ -1059,6 +1059,52 @@ dxmin, dxmax, dymin, dymax ) end subroutine plimage + subroutine pllegend( legend_width, legend_height, & + & position, opt, x, y, & + & plot_width, bg_color, bb_color, bb_style, & + & nrow, ncolumn, nlegend, opt_array, & + & text_offset, text_scale, text_spacing, & + & text_justification, text_colors, text, & + & box_colors, box_patterns, box_scales, & + & box_line_widths, & + & line_colors, line_styles, line_widths, & + & symbol_colors, symbol_scales, & + & symbol_numbers, symbols ) + + real(kind=plflt) :: legend_width, legend_height, plot_width, x, y + real(kind=plflt) :: text_offset, text_scale, text_spacing, text_justification + integer :: position, opt, bg_color, bb_color, bb_style + integer :: nrow, ncolumn, nlegend + + character(len=*), dimension(:) :: text, symbols + + integer, dimension(:) :: opt_array, text_colors, box_colors + integer, dimension(:) :: box_patterns, box_line_widths + integer, dimension(:) :: line_colors, line_styles, line_widths + integer, dimension(:) :: symbol_colors, symbol_numbers + real(kind=plflt), dimension(:) :: box_scales, symbol_scales + + ! + ! Convert the text arrays and store the results in a convenient + ! albeit global location. This way we avoid all manner of complications. + ! (Though introducing a potentially nasty one: non-threadsafety) + ! + call pllegend07_cnv_text( 1, nlegend, text ) + call pllegend07_cnv_text( 2, nlegend, symbols ) + + call pllegend07( legend_width, legend_height, position, opt, x, y, & + plot_width, bg_color, bb_color, bb_style, & + nrow, ncolumn, nlegend, opt_array, & + text_offset, text_scale, text_spacing, & + text_justification, text_colors, & + box_colors, box_patterns, box_scales, & + box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, & + symbol_numbers ) + + end subroutine pllegend + subroutine plline( x, y ) real(kind=plflt), dimension(:) :: x, y @@ -1145,8 +1191,8 @@ real(kind=plflt), dimension(:) :: x, y, clevel real(kind=plflt), dimension(:,:) :: z - call plmeshcf77( x, y, z, size(x), size(y), opt, & - clevel, size(clevel), size(x)) + call plmeshcf77( x, y, z, size(x), size(y), opt, & + clevel, size(clevel), size(x)) end subroutine plmeshc @@ -1155,10 +1201,10 @@ logical :: side real(kind=plflt), dimension(:) :: x, y real(kind=plflt), dimension(:,:) :: z - integer :: iside + integer :: iside iside = convert_to_int(side) - call plot3df77( x, y, z, size(x), size(y), opt, iside, size(x)) + call plot3df77( x, y, z, size(x), size(y), opt, iside, size(x)) end subroutine plot3d @@ -1184,7 +1230,7 @@ subroutine plsurf3d( x, y, z, opt, clevel ) integer :: opt real(kind=plflt), dimension(:) :: x, y, clevel - real(kind=plflt), dimension(:,:) :: z + real(kind=plflt), dimension(:,:) :: z call plsurf3df77( x, y, z, size(x), size(y), opt, clevel, & size(clevel), size(x)) @@ -1354,8 +1400,8 @@ subroutine plsvect( arrowx, arrowy, fill ) logical :: fill real(kind=plflt), dimension(:) :: arrowx, arrowy - integer ifill - ifill = convert_to_int(fill) + integer ifill + ifill = convert_to_int(fill) call plsvectf77( arrowx, arrowy, size(arrowx), ifill ) end subroutine plsvect Modified: trunk/examples/f95/x04f.f90 =================================================================== --- trunk/examples/f95/x04f.f90 2011-02-03 08:15:51 UTC (rev 11543) +++ trunk/examples/f95/x04f.f90 2011-02-03 08:19:52 UTC (rev 11544) @@ -21,6 +21,7 @@ use plplot implicit none + ! Process command-line arguments call plparseopts(PL_PARSE_FULL) @@ -38,6 +39,17 @@ real(kind=plflt) freql(0:100),ampl(0:100),phase(0:100), freq, f0 integer i, type + real(kind=plflt) legend_width, legend_height + integer nlegend + integer opt_array(2), text_colors(2), line_colors(2), & + line_styles(2), line_widths(2), symbol_colors(2), & + symbol_numbers(2) + real(kind=plflt) symbol_scales(2), box_scales(0) + integer box_colors(0), box_patterns(0) + integer box_line_widths(0) + character(len=20) text(2) + character(len=1) symbols(2) + call pladv(0) ! Set up data for log plot. f0 = 1._plflt @@ -71,6 +83,7 @@ 'Single Pole Low-Pass Filter') call plcol0(2) call plmtex('l', 5.0_plflt, 0.5_plflt, 0.5_plflt, 'Amplitude (dB)') + nlegend = 1 ! For the gridless case, put phase vs freq on same plot. if(type.eq.0) then call plcol0(1) @@ -82,5 +95,44 @@ call plcol0(3) call plmtex('r', 5.0_plflt, 0.5_plflt, 0.5_plflt, & 'Phase shift (degrees)') + nlegend = 2 endif + +! Draw a legend +! First legend entry. + opt_array(1) = PL_LEGEND_LINE + text_colors(1) = 2 + text(1) = 'Amplitude' + line_colors(1) = 2 + line_styles(1) = 1 + line_widths(1) = 1 +! note from the above opt_array the first symbol (and box) indices +! do not have to be specified + +! Second legend entry. + opt_array(2) = PL_LEGEND_LINE + PL_LEGEND_SYMBOL + text_colors(2) = 3 + text(2) = 'Phase shift' + line_colors(2) = 3 + line_styles(2) = 1 + line_widths(2) = 1 + symbol_colors(2) = 3 + symbol_scales(2) = 1.0 + symbol_numbers(2) = 4 + symbols(2) = '*' +! from the above opt_arrays we can completely ignore everything +! to do with boxes. (Hence the size 0 for the associated arrays) + + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + call pllegend( legend_width, legend_height, & + 0, PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX, & + 0.0_plflt, 0.0_plflt, 0.1_plflt, 15, & + 1, 1, 0, 0, & + nlegend, opt_array, & + 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1.0_plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2011-02-07 10:54:13
|
Revision: 11547 http://plplot.svn.sourceforge.net/plplot/?rev=11547&view=rev Author: arjenmarkus Date: 2011-02-07 10:54:06 +0000 (Mon, 07 Feb 2011) Log Message: ----------- Corrections in example 33 for F77, (more or less) completed work on F95 binding for pllegend() and the examples. They produce results that are identical to the C examples. The interface for F95 needs some tweaking: we do not want the nlegend argument and we need additional checking of the arguments. This means example 4 will change a bit and the implementation of the interface will change (more sanity checking). Rationale: we want to take advantage of more Fortran 95 features. Modified Paths: -------------- trunk/bindings/f95/plplotf95.def trunk/bindings/f95/plplotf95_ifort.def trunk/bindings/f95/plplotf95_mingw.def trunk/bindings/f95/sfstubsf95.f90 trunk/examples/f77/x33f.fm4 trunk/examples/f95/CMakeLists.txt trunk/examples/f95/x04f.f90 trunk/examples/f95/x26f.f90 Added Paths: ----------- trunk/examples/f95/x33f.f90 Modified: trunk/bindings/f95/plplotf95.def =================================================================== --- trunk/bindings/f95/plplotf95.def 2011-02-04 22:26:31 UTC (rev 11546) +++ trunk/bindings/f95/plplotf95.def 2011-02-07 10:54:06 UTC (rev 11547) @@ -55,7 +55,8 @@ _PLPLOTP_mp_PLIMAGEFR_1@44 _PLPLOTP_mp_PLIMAGEFR_2@44 _PLPLOTP_mp_PLIMAGEFR_TR@40 - _PLPLOT_mp_PLLEGEND@132 + _PLPLOT_mp_PLLEGEND_1@132 + _PLPLOT_mp_PLLEGEND_2@128 _PLPLOT_mp_PLLINE@8 _PLPLOT_mp_PLLINE3@12 _PLPLOT_mp_PLMESH@16 Modified: trunk/bindings/f95/plplotf95_ifort.def =================================================================== --- trunk/bindings/f95/plplotf95_ifort.def 2011-02-04 22:26:31 UTC (rev 11546) +++ trunk/bindings/f95/plplotf95_ifort.def 2011-02-07 10:54:06 UTC (rev 11547) @@ -57,7 +57,8 @@ PLPLOTP_mp_PLIMAGEFR_1 PLPLOTP_mp_PLIMAGEFR_2 PLPLOTP_mp_PLIMAGEFR_TR - PLPLOT_mp_PLLEGEND + PLPLOT_mp_PLLEGEND_1 + PLPLOT_mp_PLLEGEND_2 PLPLOT_mp_PLLINE PLPLOT_mp_PLLINE3 PLPLOT_mp_PLMESH Modified: trunk/bindings/f95/plplotf95_mingw.def =================================================================== --- trunk/bindings/f95/plplotf95_mingw.def 2011-02-04 22:26:31 UTC (rev 11546) +++ trunk/bindings/f95/plplotf95_mingw.def 2011-02-07 10:54:06 UTC (rev 11547) @@ -55,7 +55,8 @@ __plplot_MOD_plgriddata __plplot_MOD_plhist __plplot_MOD_plimage - __plplot_MOD_pllegend + __plplot_MOD_pllegend_1 + __plplot_MOD_pllegend_2 __plplot_MOD_plline __plplot_MOD_plline3 __plplot_MOD_plmesh Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2011-02-04 22:26:31 UTC (rev 11546) +++ trunk/bindings/f95/sfstubsf95.f90 2011-02-07 10:54:06 UTC (rev 11547) @@ -452,6 +452,11 @@ end subroutine pllightsource end interface + interface pllegend + module procedure pllegend_1 + module procedure pllegend_2 + end interface + interface plline module procedure plline end interface @@ -1059,17 +1064,17 @@ dxmin, dxmax, dymin, dymax ) end subroutine plimage - subroutine pllegend( legend_width, legend_height, & - & position, opt, x, y, & - & plot_width, bg_color, bb_color, bb_style, & - & nrow, ncolumn, nlegend, opt_array, & - & text_offset, text_scale, text_spacing, & - & text_justification, text_colors, text, & - & box_colors, box_patterns, box_scales, & - & box_line_widths, & - & line_colors, line_styles, line_widths, & - & symbol_colors, symbol_scales, & - & symbol_numbers, symbols ) + subroutine pllegend_1( legend_width, legend_height, & + & position, opt, x, y, & + & plot_width, bg_color, bb_color, bb_style, & + & nrow, ncolumn, nlegend, opt_array, & + & text_offset, text_scale, text_spacing, & + & text_justification, text_colors, text, & + & box_colors, box_patterns, box_scales, & + & box_line_widths, & + & line_colors, line_styles, line_widths, & + & symbol_colors, symbol_scales, & + & symbol_numbers, symbols ) real(kind=plflt) :: legend_width, legend_height, plot_width, x, y real(kind=plflt) :: text_offset, text_scale, text_spacing, text_justification @@ -1103,8 +1108,54 @@ symbol_colors, symbol_scales, & symbol_numbers ) - end subroutine pllegend + end subroutine pllegend_1 + subroutine pllegend_2( legend_width, legend_height, & + & position, opt, x, y, & + & plot_width, bg_color, bb_color, bb_style, & + & nrow, ncolumn, opt_array, & + & text_offset, text_scale, text_spacing, & + & text_justification, text_colors, text, & + & box_colors, box_patterns, box_scales, & + & box_line_widths, & + & line_colors, line_styles, line_widths, & + & symbol_colors, symbol_scales, & + & symbol_numbers, symbols ) + + real(kind=plflt) :: legend_width, legend_height, plot_width, x, y + real(kind=plflt) :: text_offset, text_scale, text_spacing, text_justification + integer :: position, opt, bg_color, bb_color, bb_style + integer :: nrow, ncolumn + + character(len=*), dimension(:) :: text, symbols + + integer, dimension(:) :: opt_array, text_colors, box_colors + integer, dimension(:) :: box_patterns, box_line_widths + integer, dimension(:) :: line_colors, line_styles, line_widths + integer, dimension(:) :: symbol_colors, symbol_numbers + real(kind=plflt), dimension(:) :: box_scales, symbol_scales + + integer :: nlegend + + ! + ! Determine number of legend entries + ! + nlegend = min( size(opt_array), size(text) ) + + call pllegend_1( legend_width, legend_height, & + position, opt, x, y, & + plot_width, bg_color, bb_color, bb_style, & + nrow, ncolumn, nlegend, opt_array, & + text_offset, text_scale, text_spacing, & + text_justification, text_colors, text, & + box_colors, box_patterns, box_scales, & + box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, & + symbol_numbers, symbols ) + + end subroutine pllegend_2 + subroutine plline( x, y ) real(kind=plflt), dimension(:) :: x, y Modified: trunk/examples/f77/x33f.fm4 =================================================================== --- trunk/examples/f77/x33f.fm4 2011-02-04 22:26:31 UTC (rev 11546) +++ trunk/examples/f77/x33f.fm4 2011-02-07 10:54:06 UTC (rev 11547) @@ -323,7 +323,7 @@ nlegend = 0 position = PL_POSITION_TOP + PL_POSITION_LEFT opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX - opt = opt_base + PL_LEGEND_TEXT_LEFT + opt = opt_base do 140 i = 1,9 c Set up legend arrays with the correct size, type. @@ -489,7 +489,7 @@ text_colors(i) = i symbol_colors(i) = i symbol_scales(i) = text_scale - symbol_numbers(i) = i + 2 + symbol_numbers(i) = i + 1 symbols(i) = special_symbols(3) 160 continue @@ -500,7 +500,7 @@ call pllegend( legend_width, legend_height, position, opt, x, y, & 0.1d0, 15, 1, 1, 0, 0, & nlegend, opt_array, 1.0d0, text_scale, 2.0d0, - & 0., text_colors, text, + & 0.d0, text_colors, text, & box_colors, box_patterns, box_scales, box_line_widths, & line_colors, line_styles, line_widths, & symbol_colors, symbol_scales, symbol_numbers, symbols ) @@ -709,9 +709,9 @@ integer number if ( number .lt. 10 ) then - write( text, '(a,1x,i1)' ) number + write( text, '(a,1x,i1)' ) string, number else - write( text, '(a,1x,i2)' ) number + write( text, '(a,1x,i2)' ) string, number endif end Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2011-02-04 22:26:31 UTC (rev 11546) +++ trunk/examples/f95/CMakeLists.txt 2011-02-07 10:54:06 UTC (rev 11547) @@ -57,6 +57,7 @@ "29" "30" "31" + "33" ) if(CORE_BUILD) Modified: trunk/examples/f95/x04f.f90 =================================================================== --- trunk/examples/f95/x04f.f90 2011-02-04 22:26:31 UTC (rev 11546) +++ trunk/examples/f95/x04f.f90 2011-02-07 10:54:06 UTC (rev 11547) @@ -36,11 +36,11 @@ subroutine plot1(type) use plplot, PI => PL_PI implicit none - real(kind=plflt) freql(0:100),ampl(0:100),phase(0:100), freq, f0 - integer i, type + real(kind=plflt) freql(0:100),ampl(0:100),phase(0:100), freq, f0 + integer i, type + integer nlegend - real(kind=plflt) legend_width, legend_height - integer nlegend + real(kind=plflt) legend_width, legend_height integer opt_array(2), text_colors(2), line_colors(2), & line_styles(2), line_widths(2), symbol_colors(2), & symbol_numbers(2) @@ -120,8 +120,10 @@ symbol_scales(2) = 1.0 symbol_numbers(2) = 4 symbols(2) = '*' + ! from the above opt_arrays we can completely ignore everything ! to do with boxes. (Hence the size 0 for the associated arrays) +! (note: use the argument nlegend explicitly) call plscol0a( 15, 32, 32, 32, 0.70_plflt ) call pllegend( legend_width, legend_height, & Modified: trunk/examples/f95/x26f.f90 =================================================================== --- trunk/examples/f95/x26f.f90 2011-02-04 22:26:31 UTC (rev 11546) +++ trunk/examples/f95/x26f.f90 2011-02-07 10:54:06 UTC (rev 11547) @@ -247,13 +247,15 @@ ! from the above opt_arrays we can completely ignore everything ! to do with boxes. + ! (note: number of legend entries determined from size of + ! opt_array) call plscol0a( 15, 32, 32, 32, 0.70d0 ) call pllegend( legend_width, legend_height, & 0, PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX, & 0.0_plflt, 0.0_plflt, 0.10_plflt, 15, & 1, 1, 0, 0, & - nlegend, opt_array, & + opt_array, & 1.0_plflt, 1.0_plflt, 2.0_plflt, & 1.0_plflt, text_colors, legend_text, & box_colors, box_patterns, box_scales, box_line_widths, & Added: trunk/examples/f95/x33f.f90 =================================================================== --- trunk/examples/f95/x33f.f90 (rev 0) +++ trunk/examples/f95/x33f.f90 2011-02-07 10:54:06 UTC (rev 11547) @@ -0,0 +1,829 @@ +! -*- coding: utf-8; -*- +! +! $Id: x33c.c 11465 2011-01-10 21:59:30Z andrewross $ +! +! Demonstrate most pllegend capability including unicode symbols. +! +! Copyright (C) 2010 Alan Irwin +! +! This file is part of PLplot. +! +! PLplot is free software; you can redistribute it and/or modify +! it under the terms of the GNU General Library Public License as published +! by the Free Software Foundation; either version 2 of the License, or +! (at your option) any later version. +! +! PLplot is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Library General Public License for more details. +! +! You should have received a copy of the GNU Library General Public License +! along with PLplot; if not, write to the Free Software +! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +! +! +! This example designed just for devices (e.g., the cairo-related and +! qt-related devices) where the best choice of glyph is automatically +! selected by the related libraries (pango/cairo or Qt4) for each +! unicode character depending on what system fonts are installed. Of +! course, you must have the appropriate TrueType fonts installed to +! have access to all the required glyphs. + + +!-------------------------------------------------------------------------- +! main +! +! Demonstrate most pllegend capability including unicode symbols. +! -------------------------------------------------------------------------- + + use plplot + + implicit none + + integer, parameter :: MAX_NLEGEND = 7 + + integer :: i, k + integer :: opt, position + integer :: nlegend, nturn + integer :: opt_array(MAX_NLEGEND) + integer :: text_colors(MAX_NLEGEND) + integer :: box_colors(MAX_NLEGEND) + integer :: box_patterns(MAX_NLEGEND) + real(kind=plflt) :: box_scales(MAX_NLEGEND) + integer :: box_line_widths(MAX_NLEGEND) + integer :: line_colors(MAX_NLEGEND) + integer :: line_styles(MAX_NLEGEND) + integer :: line_widths(MAX_NLEGEND) + integer :: symbol_numbers(MAX_NLEGEND), symbol_colors(MAX_NLEGEND) + real(kind=plflt) :: symbol_scales(MAX_NLEGEND) + character(len=200) :: text(MAX_NLEGEND) + character(len=3) :: symbols(MAX_NLEGEND) + real(kind=plflt) :: legend_width, legend_height, x, y, xstart, ystart + real(kind=plflt) :: max_height, text_scale + integer :: opt_base, nrow, ncolumn + + integer :: position_options(16) + character(len=3) :: special_symbols(5) + + real(kind=plflt) :: values_small(2) + real(kind=plflt) :: values_uneven(9) + real(kind=plflt) :: values_even(9) + + +! Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). + data special_symbols / & + '✰', & + '✴', & + '✱', & + '✽', & + '✦' / + + data values_small / 0.0_plflt, 1.0_plflt / + data values_uneven & + / 0.0_plflt, 2.0_plflt, 2.6_plflt, 3.4_plflt, 6.0_plflt, 7.0_plflt, 8.0_plflt, 9.0_plflt, 10.0_plflt / + data values_even & + / 0.0_plflt, 1.0_plflt, 2.0_plflt, 3.0_plflt, 4.0_plflt, 5.0_plflt, 6.0_plflt, 7.0_plflt, 8.0_plflt / + + position_options(1) = PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_OUTSIDE + position_options(2) = PL_POSITION_TOP + PL_POSITION_OUTSIDE + position_options(3) = PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_OUTSIDE + position_options(4) = PL_POSITION_RIGHT + PL_POSITION_OUTSIDE + position_options(5) = PL_POSITION_RIGHT + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE + position_options(6) = PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE + position_options(7) = PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE + position_options(8) = PL_POSITION_LEFT + PL_POSITION_OUTSIDE + position_options(9) = PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_INSIDE + position_options(10) = PL_POSITION_TOP + PL_POSITION_INSIDE + position_options(11) = PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_INSIDE + position_options(12) = PL_POSITION_RIGHT + PL_POSITION_INSIDE + position_options(13) = PL_POSITION_RIGHT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE + position_options(14) = PL_POSITION_BOTTOM + PL_POSITION_INSIDE + position_options(15) = PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE + position_options(16) = PL_POSITION_LEFT + PL_POSITION_INSIDE + +! Parse and process command line arguments + + call plparseopts(PL_PARSE_FULL) + +! Initialize plplot + call plinit + +! First page illustrating the 16 standard positions. + call pladv( 0 ) + call plvpor( 0.25_plflt, 0.75_plflt, 0.25_plflt, 0.75_plflt ) + call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) + call plbox( 'bc', 0.0_plflt, 0, 'bc', 0.0_plflt, 0 ) + call plsfont( PL_FCI_SANS, -1, -1 ) + call plmtex( 't', 8.0_plflt, 0.5_plflt, 0.5_plflt, & + 'The 16 standard legend positions with' ) + call plmtex( 't', 6.0_plflt, 0.5_plflt, 0.5_plflt, & + 'the same (0.05) offset in x and y' ) + + nlegend = 1 +! Only specify legend data that are required according to the +! value of opt_array for that entry. + opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX + opt_array(1) = PL_LEGEND_LINE + PL_LEGEND_SYMBOL + line_styles(1) = 1 + line_widths(1) = 1 + symbol_scales(1) = 1._plflt + symbol_numbers(1) = 4 + symbols(1) = '*' + +! Use monotype fonts so that all legends are the same size. + call plsfont( PL_FCI_MONO, -1, -1 ) + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + do k = 1,16 + position = position_options(k) + opt = opt_base + text_colors(1) = 1 + mod( k-1, 8 ) + line_colors(1) = 1 + mod( k-1, 8 ) + symbol_colors(1) = 1 + mod( k-1, 8 ) + write( text(1), '(i2.2)' ) k-1 + + call pllegend( legend_width, legend_height, position, opt, & + 0.05_plflt, 0.05_plflt, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + enddo + +! Second page illustrating effect of nrow, ncolumn for the same legend +! data. + + call pladv( 0 ) + call plvpor( 0.25_plflt, 0.75_plflt, 0.25_plflt, 0.75_plflt ) + call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) + call plbox( 'bc', 0.0_plflt, 0, 'bc', 0.0_plflt, 0 ) + call plsfont( PL_FCI_SANS, -1, -1 ) + call plmtex( 't', 8.0_plflt, 0.5_plflt, 0.5_plflt, & + 'The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR,' ) + call plmtex( 't', 6.0_plflt, 0.5_plflt, 0.5_plflt, & + 'and position for the same legend data' ) + + nlegend = 7 + +! Only specify legend data that are required according to the +! value of opt_array for that entry. + + opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX + do 120 k = 1,nlegend + opt_array(k) = PL_LEGEND_LINE + PL_LEGEND_SYMBOL + line_styles(k) = 1 + line_widths(k) = 1 + symbol_scales(k) = 1._plflt + symbol_numbers(k) = 2 + symbols(k) = '*' + write( text(k), '(i2.2)' ) k-1 + text_colors(k) = 1 + mod( k-1, 8 ) + line_colors(k) = 1 + mod( k-1, 8 ) + symbol_colors(k) = 1 + mod( k-1, 8 ) + 120 continue + +! Use monotype fonts so that all legends are the same size. + + call plsfont( PL_FCI_MONO, -1, -1 ) + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + position = PL_POSITION_TOP + PL_POSITION_OUTSIDE + opt = opt_base + x = 0._plflt + y = 0.1_plflt + nrow = 1 + ncolumn = nlegend + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.05_plflt, 15, 1, 1, nrow, ncolumn, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + + position = PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE + opt = opt_base + x = 0._plflt + y = 0.1_plflt + nrow = 1 + ncolumn = nlegend + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.05_plflt, 15, 1, 1, nrow, ncolumn, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + + position = PL_POSITION_LEFT + PL_POSITION_OUTSIDE + opt = opt_base + x = 0.1_plflt + y = 0._plflt + nrow = nlegend + ncolumn = 1 + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.05_plflt, 15, 1, 1, nrow, ncolumn, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + + position = PL_POSITION_RIGHT + PL_POSITION_OUTSIDE + opt = opt_base + x = 0.1_plflt + y = 0._plflt + nrow = nlegend + ncolumn = 1 + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.05_plflt, 15, 1, 1, nrow, ncolumn, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + + position = PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_INSIDE + opt = opt_base + x = 0._plflt + y = 0._plflt + nrow = 6 + ncolumn = 2 + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.05_plflt, 15, 1, 1, nrow, ncolumn, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + + position = PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_INSIDE + opt = opt_base + PL_LEGEND_ROW_MAJOR + x = 0._plflt + y = 0._plflt + nrow = 6 + ncolumn = 2 + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.05_plflt, 15, 1, 1, nrow, ncolumn, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + + position = PL_POSITION_BOTTOM + PL_POSITION_INSIDE + opt = opt_base + PL_LEGEND_ROW_MAJOR + x = 0._plflt + y = 0._plflt + nrow = 3 + ncolumn = 3 + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.05_plflt, 15, 1, 1, nrow, ncolumn, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 2.0_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + +! Third page demonstrating legend alignment + + call pladv( 0 ) + call plvpor( 0._plflt, 1._plflt, 0._plflt, 1._plflt ) + call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) + call plsfont( PL_FCI_SANS, -1, -1 ) + call plmtex( 't', -2.0_plflt, 0.5_plflt, 0.5_plflt, & + 'Demonstrate legend alignment' ) + + x = 0.1_plflt + y = 0.1_plflt + nturn = 5 + nlegend = 0 + position = PL_POSITION_TOP + PL_POSITION_LEFT + opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX + opt = opt_base + do i = 1,9 + +! Set up legend arrays with the correct size, type. + + if ( i .le. nturn ) then + nlegend = nlegend + 1 + else + nlegend = nlegend - 1 + endif + nlegend = max( 1, nlegend ) + +! nly specify legend data that are required according to the +! value of opt_array for that entry. + + do k = 1,nlegend + opt_array(k) = PL_LEGEND_LINE + PL_LEGEND_SYMBOL + line_styles(k) = 1 + line_widths(k) = 1 + symbol_scales(k) = 1._plflt + symbol_numbers(k) = 2 + symbols(k) = '*' + write( text(k), '(i2.2)' ) k-1 + text_colors(k) = 1 + mod( k-1, 8 ) + line_colors(k) = 1 + mod( k-1, 8 ) + symbol_colors(k) = 1 + mod( k-1, 8 ) + enddo + +! Use monotype fonts so that all legends are the same size. + + call plsfont( PL_FCI_MONO, -1, -1 ) + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + nrow = MIN( 3, nlegend ) + ncolumn = 0 + + call pllegend( legend_width, legend_height, position, opt, & + x, y, & + 0.025_plflt, 15, 1, 1, nrow, ncolumn, & + opt_array(1:nlegend), 1.0_plflt, 1.0_plflt, 1.5_plflt, & + 1._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + + if ( i .eq. nturn ) then + position = PL_POSITION_TOP + PL_POSITION_RIGHT + opt = opt_base + x = 1._plflt - x + y = y + legend_height + else + x = x + legend_width + y = y + legend_height + endif + enddo + +! Fourth page illustrating various kinds of legends + + max_height = 0._plflt + xstart = 0.0_plflt + ystart = 0.1_plflt + x = xstart + y = ystart + text_scale = 0.90_plflt + call pladv( 0 ) + call plvpor( 0.0_plflt, 1._plflt, 0.0_plflt, 0.90_plflt ) + call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) +! call plbox('bc', 0.0, 0, 'bc', 0.0_plflt, 0) + call plsfont( PL_FCI_SANS, -1, -1 ) + call plmtex( 't', 2.0_plflt, 0.5_plflt, 0.5_plflt, & + 'Demonstrate Various Kinds of Legends' ) + + nlegend = 5 + +! Only specify legend data that are required according to the +! value of opt_array for that entry. + + position = PL_POSITION_LEFT + PL_POSITION_TOP + opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX + PL_LEGEND_TEXT_LEFT + +! Set up None, Box, Line, Symbol, and Line & Symbol legend entries. + + opt_array(1) = PL_LEGEND_NONE + text(1) = 'None' + text_colors(1) = 1 + + opt_array(2) = PL_LEGEND_COLOR_BOX + text(2) = 'Box' + text_colors(2) = 2 + box_colors(2) = 2 + box_patterns(2) = 0 + box_scales(2) = 0.8_plflt + box_line_widths(2) = 1 + + opt_array(3) = PL_LEGEND_LINE + text(3) = 'Line' + text_colors(3) = 3 + line_colors(3) = 3 + line_styles(3) = 1 + line_widths(3) = 1 + + opt_array(4) = PL_LEGEND_SYMBOL + text(4) = 'Symbol' + text_colors(4) = 4 + symbol_colors(4) = 4 + symbol_scales(4) = text_scale + symbol_numbers(4) = 4 + symbols(4) = special_symbols(3) + + opt_array(5) = PL_LEGEND_SYMBOL + PL_LEGEND_LINE + text(5) = 'L & S' + text_colors(5) = 5 + line_colors(5) = 5 + line_styles(5) = 1 + line_widths(5) = 1 + symbol_colors(5) = 5 + symbol_scales(5) = text_scale + symbol_numbers(5) = 4 + symbols(5) = special_symbols(3) + + opt = opt_base + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Set up symbol legend entries with various symbols. + + do i = 1,nlegend + opt_array(i) = PL_LEGEND_SYMBOL + text(i) = 'Symbol ' // special_symbols(i) + text_colors(i) = i + symbol_colors(i) = i + symbol_scales(i) = text_scale + symbol_numbers(i) = 4 + symbols(i) = special_symbols(i) + enddo + + opt = opt_base + x = x + legend_width + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Set up symbol legend entries with various numbers of symbols. + + do i = 1,nlegend + opt_array(i) = PL_LEGEND_SYMBOL + write( text(i), '(a,i0)' ) 'Symbol Number ', i+1 + text_colors(i) = i + symbol_colors(i) = i + symbol_scales(i) = text_scale + symbol_numbers(i) = i + 1 + symbols(i) = special_symbols(3) + enddo + + opt = opt_base + x = x + legend_width + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Set up box legend entries with various colours. + + do i = 1,nlegend + opt_array(i) = PL_LEGEND_COLOR_BOX + write( text(i), '(a,i0)' ) 'Box Color ', i + text_colors(i) = i + box_colors(i) = i + box_patterns(i) = 0 + box_scales(i) = 0.8_plflt + box_line_widths(i) = 1 + enddo + + opt = opt_base + +! Use new origin + + x = xstart + y = y + max_height + max_height = 0._plflt + call plscol0a( 15, 32, 32, 32, 0.70_plflt) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Set up box legend entries with various patterns. + + do i = 1,nlegend + opt_array(i) = PL_LEGEND_COLOR_BOX + write( text(i), '(a,i0)' ) 'Box Pattern ', i-1 + text_colors(i) = 2 + box_colors(i) = 2 + box_patterns(i) = i - 1 + box_scales(i) = 0.8_plflt + box_line_widths(i) = 1 + enddo + + opt = opt_base + x = x + legend_width + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Set up box legend entries with various box pattern line widths. + + do i = 1,nlegend + opt_array(i) = PL_LEGEND_COLOR_BOX + write( text(i), '(a,i0)' ) 'Box Line Width ', i + text_colors(i) = 2 + box_colors(i) = 2 + box_patterns(i) = 3 + box_scales(i) = 0.8_plflt + box_line_widths(i) = i + enddo + + opt = opt_base + x = x + legend_width + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Set up line legend entries with various colours. + + do i =1,nlegend + opt_array(i) = PL_LEGEND_LINE + write( text(i), '(a,i0)' ) 'Line Color ', i + text_colors(i) = i + line_colors(i) = i + line_styles(i) = 1 + line_widths(i) = 1 + enddo + + opt = opt_base + +! Use new origin + + x = xstart + y = y + max_height + max_height = 0._plflt + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Set up line legend entries with various styles. + + do i = 1,nlegend + opt_array(i) = PL_LEGEND_LINE + write( text(i), '(a,i0)' ) 'Line Style ', i + text_colors(i) = 2 + line_colors(i) = 2 + line_styles(i) = i + line_widths(i) = 1 + enddo + + opt = opt_base + x = x + legend_width + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Set up line legend entries with various widths. + + do i =1,nlegend + opt_array(i) = PL_LEGEND_LINE + write( text(i), '(a,i0)' ) 'Line Width ', i + text_colors(i) = 2 + line_colors(i) = 2 + line_styles(i) = 1 + line_widths(i) = i + enddo + + opt = opt_base + x = x + legend_width + call plscol0a( 15, 32, 32, 32, 0.70_plflt ) + + call pllegend( legend_width, legend_height, position, opt, x, y, & + 0.1_plflt, 15, 1, 1, 0, 0, & + opt_array(1:nlegend), 1.0_plflt, text_scale, 2.0_plflt, & + 0._plflt, text_colors, text, & + box_colors, box_patterns, box_scales, box_line_widths, & + line_colors, line_styles, line_widths, & + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max( max_height, legend_height ) + +! Color bar examples + +! +! Note: commented until plcolorbar is ready! +! +! call plcolorbar_example_1( PL_COLORBAR_IMAGE, 0.0_plflt, 0, 2, +! & values_small, 'Image Color Bars' ) +! call plcolorbar_example_1( +! & PL_COLORBAR_SHADE + PL_COLORBAR_SHADE_LABEL, +! & 0.0_plflt, 0, 9, values_uneven, +! & 'Shade Color Bars - Uneven Steps' ) +! call plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0_plflt, 3, 9, +! & values_even, 'Shade Color Bars - Even Steps' ) +! call plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5_plflt, 5, 2, +! & values_small, 'Gradient Color Bars' ) +! call plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5_plflt, 5, 2, +! & values_small, 'Gradient Color Bars' ) + + call plend() + +! contains + + +! Color bar routines +! +! subroutine plcolorbar_example_1( bar_type, ticks, sub_ticks, n, +! & values, title ) +! +! integer bar_type, position +! real(kind=plflt) ticks +! integer sub_ticks +! integer n +! real(kind=plflt) values(*) +! character(*) title +! +! +! FORTRAN 77: array fixed +! +! real(kind=plflt) colors(20) +! real(kind=plflt) color_step +! integer i +! integer opt +! character(10) axis_opts_1, axis_opts_2 +! +! call pladv( 0 ) +! +! Setup color palette 1 +! call plspal1( 'cmap1_blue_red.pal', 1 ) +! +! color_step = 1.0_plflt / ( n - 1 ) +! do 110 i = 1,n +! colors(i) = 0.0_plflt + color_step * i +! 110 continue +! +! position = PL_POSITION_LEFT +! opt = bar_type + PL_COLORBAR_LABEL_LEFT + +! & PL_COLORBAR_CAP_HIGH +! +! if ( mod( bar_type, 2*PL_COLORBAR_SHADE_LABEL ) / +! & PL_COLORBAR_SHADE_LABEL .eq. 1 ) then +! axis_opts_1 = 'iv' +! axis_opts_2 = 'i' +! else +! axis_opts_1 = 'stv' +! axis_opts_2 = 'st' +! else +! axis_opts_1 = 'tv' +! axis_opts_2 = 't' +! endif +! endif +! +! call plcolorbar( opt, 0.1_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, +! & ticks, sub_ticks, +! & axis_opts_1, 'Test label - Left, High Cap', +! +! position = PL_POSITION_RIGHT +! opt = bar_type + PL_COLORBAR_LABEL_RIGHT + +! & PL_COLORBAR_CAP_LOW +! +! call plcolorbar( opt, 0.1_plflt, 0.4_plflt, 0.5_plflt, 0.1_plflt, +! & ticks, sub_ticks, +! & n, colors, values ) +! +! position = PL_POSITION_TOP +! opt = bar_type + PL_COLORBAR_LABEL_TOP + +! & PL_COLORBAR_CAP_HIGH +! +! call plcolorbar( opt, 0.1_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, +! & ticks, sub_ticks, +! & axis_opts_2, 'Test label - Upper, High Cap', +! & n, colors, values ) +! +! position = PL_POSITION_TOP +! opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + +! & PL_COLORBAR_CAP_LOW +! +! call plcolorbar( opt, 0.4_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, +! & ticks, sub_ticks, +! & axis_opts_2, 'Test label - Lower, Low Cap', +! & n, colors, values ) +! +! call plvpor( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) +! call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) +! call plptex( 0.5_plflt, 0.5_plflt, 0.0_plflt, 0.0_plflt, 0.5_plflt, title ) +! end +! +! subroutine plcolorbar_example_2( bar_type, ticks, sub_ticks, n, +! & values, title ) +! +! integer bar_type, position +! real(kind=plflt) ticks +! integer sub_ticks +! integer n +! real(kind=plflt) values(*) +! character(*) title +! +! real(kind=plflt) colors(20) +! integer i +! real(kind=plflt) color_step +! integer opt +! character(10) axis_opts_1, axis_opts_2 +! +! call pladv( 0 ) +! Setup color palette 1 +! call plspal1( 'cmap1_blue_yellow.pal', 1 ) +! +! color_step = 1.0_plflt / ( n - 1 ) +! do 110 i = 1,n +! colors(i) = 0.0_plflt + color_step * i +! 110 continue +! +! position = PL_POSITION_LEFT +! opt = bar_type + PL_COLORBAR_LABEL_LEFT + +! & PL_COLORBAR_CAP_LOW +! +! if ( bar_type .eq. PL_COLORBAR_SHADE_LABEL ) then +! axis_opts_1 = '' +! axis_opts_2 = '' +! else +! if ( sub_ticks .ne. 0 ) then +! axis_opts_1 = 'stv' +! axis_opts_2 = 'st' +! else +! axis_opts_1 = 'tv' +! axis_opts_2 = 't' +! endif +! endif +! +! call plcolorbar( opt, 0.1_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, +! & ticks, sub_ticks, +! & axis_opts_1, 'Test label - Left, Low Cap', +! & n, colors, values ) +! +! position = PL_POSITION_RIGHT +! opt = bar_type + PL_COLORBAR_LABEL_RIGHT + +! & PL_COLORBAR_CAP_HIGH +! +! call plcolorbar( opt, 0.1_plflt, 0.4_plflt, 0.5_plflt, 0.1_plflt, +! & ticks, sub_ticks, +! & axis_opts_1, 'Test label - Right, High Cap', +! & n, colors, values ) +! +! position = PL_POSITION_TOP +! opt = bar_type + PL_COLORBAR_LABEL_TOP + +! & PL_COLORBAR_CAP_LOW +! +! call plcolorbar( opt, 0.1_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, +! & ticks, sub_ticks, +! & axis_opts_2, 'Test label - Upper, Low Cap', +! & n, colors, values ) +! +! position = PL_POSITION_BOTTOM +! opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + +! & PL_COLORBAR_CAP_HIGH +! +! call plcolorbar( opt, 0.4_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, +! & ticks, sub_ticks, +! & axis_opts_2, 'Test label - Lower, High Cap', +! & n, colors, values ) +! +! call plvpor( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) +! call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) +! call plptex( 0.5_plflt, 0.5_plflt, 0.0_plflt, 0.0_plflt, 0.5_plflt, title ) +! end + end program This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2011-02-07 11:00:04
|
Revision: 11548 http://plplot.svn.sourceforge.net/plplot/?rev=11548&view=rev Author: arjenmarkus Date: 2011-02-07 10:59:57 +0000 (Mon, 07 Feb 2011) Log Message: ----------- First implementation of the Tcl bindings for pllegend() with two examples extended. Note that there is still some work to do as there should be more checks on the arguments. It is too easy to get them wrong. Modified Paths: -------------- trunk/bindings/tcl/tclAPI.c trunk/examples/tcl/x04.tcl trunk/examples/tcl/x26.tcl Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-02-07 10:54:06 UTC (rev 11547) +++ trunk/bindings/tcl/tclAPI.c 2011-02-07 10:59:57 UTC (rev 11548) @@ -33,6 +33,7 @@ #include "plplotP.h" #include "pltcl.h" +#include "plplot_parameters.h" #ifndef __WIN32__ #ifdef PL_HAVE_UNISTD_H #include <unistd.h> @@ -50,6 +51,7 @@ static int loopbackCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plcontCmd( ClientData, Tcl_Interp *, int, const char ** ); +static int pllegendCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plmeshCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plmeshcCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plot3dCmd( ClientData, Tcl_Interp *, int, const char ** ); @@ -97,6 +99,7 @@ #include "tclgen_s.h" { "plcol", plcol0Cmd }, { "plcont", plcontCmd }, + { "pllegend", pllegendCmd }, { "plmap", plmapCmd }, { "plmeridians", plmeridiansCmd }, { "plstransform", plstransformCmd }, @@ -592,6 +595,10 @@ (ClientData) NULL, (Tcl_CmdDeleteProc*) NULL ); } +// Define the flags as variables in the PLPLOT namespace + + set_plplot_parameters( interp ); + // We really need this so the TEA based 'make install' can // properly determine the package we have installed @@ -4010,3 +4017,215 @@ return TCL_OK; } + +//-------------------------------------------------------------------------- +// pllegendCmd +// +// Processes pllegend Tcl command. +// C version takes: +// function, data +// (data argument is optional) +//-------------------------------------------------------------------------- + +static int *argv_to_ints( Tcl_Interp *interp, const char *list_numbers, int *number ) +{ + int i, retcode; + int *array; + Tcl_Obj *list; + Tcl_Obj *elem; + + list = Tcl_NewStringObj( list_numbers, (-1) ); + + retcode = Tcl_ListObjLength( interp, list, number ); + if ( retcode != TCL_OK || (*number) == 0 ) + { + *number = 0; + return NULL; + } + else + { + array = (int *) malloc( sizeof(int) * (*number) ); + for ( i = 0; i < (*number); i ++ ) + { + Tcl_ListObjIndex( interp, list, i, &elem ); + Tcl_GetIntFromObj( interp, elem, &array[i] ); + } + } + return array; +} + +static double *argv_to_doubles( Tcl_Interp *interp, const char *list_numbers, int *number ) +{ + int i, retcode; + double *array; + Tcl_Obj *list; + Tcl_Obj *elem; + + list = Tcl_NewStringObj( list_numbers, (-1) ); + + retcode = Tcl_ListObjLength( interp, list, number ); + if ( retcode != TCL_OK || (*number) == 0 ) + { + *number = 0; + return NULL; + } + else + { + array = (double *) malloc( sizeof(double) * (*number) ); + for ( i = 0; i < (*number); i ++ ) + { + Tcl_ListObjIndex( interp, list, i, &elem ); + Tcl_GetDoubleFromObj( interp, elem, &array[i] ); + } + } + return array; +} + +static char **argv_to_chars( Tcl_Interp *interp, const char *list_strings, int *number ) +{ + int i, retcode; + char **array; + char *string; + int length; + int idx; + Tcl_Obj *list; + Tcl_Obj *elem; + + list = Tcl_NewStringObj( list_strings, (-1) ); + + retcode = Tcl_ListObjLength( interp, list, number ); + if ( retcode != TCL_OK || (*number) == 0 ) + { + *number = 0; + return NULL; + } + else + { + array = (char **) malloc( sizeof(char*) * (*number) ); + array[0] = (char *) malloc( sizeof(char) * (strlen(list_strings)+1) ); + idx = 0; + for ( i = 0; i < (*number); i ++ ) + { + Tcl_ListObjIndex( interp, list, i, &elem ); + string = Tcl_GetStringFromObj( elem, &length ); + + array[i] = array[0] + idx; + strncpy( array[i], string, length ); + idx += length + 1; + array[0][idx-1] = '\0'; + } + } + return array; +} + +static int +pllegendCmd( ClientData clientData, Tcl_Interp *interp, + int argc, const char *argv[] ) +{ + PLFLT legend_width, legend_height; + PLFLT x, y, plot_width; + PLINT position, opt; + PLINT bg_color, bb_color, bb_style; + PLINT nrow, ncolumn; + PLINT nlegend; + PLINT *opt_array; + PLFLT text_offset, text_scale, text_spacing, text_justification; + PLINT *text_colors; + PLINT *box_colors, *box_patterns; + PLFLT *box_scales; + PLINT *box_line_widths, *line_colors, *line_styles, *line_widths; + PLINT *symbol_colors, *symbol_numbers; + PLFLT *symbol_scales; + char **text; + char **symbols; + + char string[20]; + int number_opts; + int number_texts; + int dummy; + double value; + + Tcl_Obj *result; + Tcl_Obj *data[2]; + + if ( argc != 29 ) + { + Tcl_AppendResult( interp, "bogus syntax for pllegend, see doc.", + (char *) NULL ); + return TCL_ERROR; + } + + sscanf( argv[1], "%lg", &value ); position = (PLFLT) value; + sscanf( argv[2], "%d", &opt ); + sscanf( argv[3], "%lg", &value ); x = (PLFLT) value; + sscanf( argv[4], "%lg", &value ); y = (PLFLT) value; + sscanf( argv[5], "%lg", &value ); plot_width = (PLFLT) value; + sscanf( argv[6], "%d", &bg_color ); + sscanf( argv[7], "%d", &bb_color ); + sscanf( argv[8], "%d", &bb_style ); + sscanf( argv[9], "%d", &nrow ); + sscanf( argv[10], "%d", &ncolumn ); + opt_array = argv_to_ints( interp, argv[11], &number_opts ); + sscanf( argv[12], "%lg", &value ); text_offset = (PLFLT) value; + sscanf( argv[13], "%lg", &value ); text_scale = (PLFLT) value; + sscanf( argv[14], "%lg", &value ); text_spacing = (PLFLT) value; + sscanf( argv[15], "%lg", &value ); text_justification = (PLFLT) value; + + text_colors = argv_to_ints( interp, argv[16], &dummy ); + text = argv_to_chars( interp, argv[17], &number_texts ); + box_colors = argv_to_ints( interp, argv[18], &dummy ); + box_patterns = argv_to_ints( interp, argv[19], &dummy ); + box_scales = argv_to_doubles( interp, argv[20], &dummy ); + box_line_widths = argv_to_ints( interp, argv[21], &dummy ); + line_colors = argv_to_ints( interp, argv[22], &dummy ); + line_styles = argv_to_ints( interp, argv[23], &dummy ); + line_widths = argv_to_ints( interp, argv[24], &dummy ); + symbol_colors = argv_to_ints( interp, argv[25], &dummy ); + symbol_scales = argv_to_doubles( interp, argv[26], &dummy ); + symbol_numbers = argv_to_ints( interp, argv[27], &dummy ); + symbols = argv_to_chars( interp, argv[28], &dummy ); + + nlegend = MIN( number_opts, number_texts ); + + c_pllegend( &legend_width, &legend_height, + position, opt, x, y, plot_width, + bg_color, bb_color, bb_style, + nrow, ncolumn, + nlegend, opt_array, + text_offset, text_scale, text_spacing, + text_justification, + text_colors, (const char **) text, + box_colors, box_patterns, + box_scales, box_line_widths, + line_colors, line_styles, + line_widths, + symbol_colors, symbol_scales, + symbol_numbers, (const char **) symbols ) ; + + if ( opt_array != NULL ) free( opt_array ); + if ( text_colors != NULL ) free( text_colors ); + if ( text != NULL ) { + free( text[0] ); + free( text ); + } + if ( box_colors != NULL ) free( box_colors ); + if ( box_patterns != NULL ) free( box_patterns ); + if ( box_scales != NULL ) free( box_scales ); + if ( box_line_widths != NULL ) free( box_line_widths ); + if ( line_colors != NULL ) free( line_colors ); + if ( line_styles != NULL ) free( line_styles ); + if ( line_widths != NULL ) free( line_widths ); + if ( symbol_colors != NULL ) free( symbol_colors ); + if ( symbol_scales != NULL ) free( symbol_scales ); + if ( symbol_numbers != NULL ) free( symbol_numbers ); + if ( symbols != NULL ) { + free( symbols[0] ); + free( symbols ); + } + + data[0] = Tcl_NewDoubleObj( legend_width ); + data[1] = Tcl_NewDoubleObj( legend_height ); + Tcl_SetObjResult( interp, Tcl_NewListObj( 2, data ) ); + + return TCL_OK; +} Modified: trunk/examples/tcl/x04.tcl =================================================================== --- trunk/examples/tcl/x04.tcl 2011-02-07 10:54:06 UTC (rev 11547) +++ trunk/examples/tcl/x04.tcl 2011-02-07 10:59:57 UTC (rev 11548) @@ -16,6 +16,7 @@ proc plot41 {w type} { + set pi 3.14159265358979323846 matrix freql f 101 matrix ampl f 101 @@ -46,7 +47,7 @@ $w cmd plcol0 2 $w cmd plline 101 freql ampl - $w cmd plcol0 1 + $w cmd plcol0 2 $w cmd plptex 1.6 -30.0 1.0 -20.0 0.5 "-20 dB/decade" # Put labels on @@ -56,6 +57,8 @@ $w cmd plcol0 2 $w cmd plmtex "l" 5.0 0.5 0.5 "Amplitude (dB)" + set nlegend 1 + # For the gridless case, put phase vs freq on same plot if {$type == 0} { $w cmd plcol0 1 @@ -66,5 +69,49 @@ $w cmd plstring 101 freql phase "*" $w cmd plcol0 3 $w cmd plmtex "r" 5.0 0.5 0.5 "Phase shift (degrees)" + + set nlegend 2 } + + # Draw a legend + # First legend entry. + set opt_array [list $::PLPLOT::PL_LEGEND_LINE] + set text_colors [list 2] + set text [list Amplitude] + set line_colors [list 2] + set line_styles [list 1] + set line_widths [list 1] + + # note from the above opt_array the first symbol (and box) indices + # will not be used, but they have to be specified anyway! + # (make sure the values are reasonable) + + # Second legend entry. + lappend opt_array [expr {$::PLPLOT::PL_LEGEND_LINE | $::PLPLOT::PL_LEGEND_SYMBOL}] + lappend text_colors 3 + lappend text "Phase shift" + lappend line_colors 3 + lappend line_styles 1 + lappend line_widths 1 + set symbol_colors [list 0 3] + set symbol_scales [list 0.0 1.0] + set symbol_numbers [list 0 4] + set symbols [list "" "*"] + + # from the above opt_arrays we can completely ignore everything + # to do with boxes. + + $w cmd plscol0a 15 32 32 32 0.70 + foreach { legend_width legend_height } \ + [$w cmd pllegend 0 [expr {$::PLPLOT::PL_LEGEND_BACKGROUND | $::PLPLOT::PL_LEGEND_BOUNDING_BOX}] \ + 0.0 0.0 0.1 15 \ + 1 1 0 0 \ + [lrange $opt_array 0 [expr {$nlegend-1}]] \ + 1.0 1.0 2.0 \ + 1. $text_colors $text \ + {} {} {} {} \ + $line_colors $line_styles $line_widths \ + $symbol_colors $symbol_scales $symbol_numbers $symbols] { + break + } } Modified: trunk/examples/tcl/x26.tcl =================================================================== --- trunk/examples/tcl/x26.tcl 2011-02-07 10:54:06 UTC (rev 11547) +++ trunk/examples/tcl/x26.tcl 2011-02-07 10:59:57 UTC (rev 11548) @@ -87,6 +87,11 @@ "Фазовый сдвиг (градусы)" } + # Short rearranged versions of y_label and alty_label. + set legend_text { + { "Amplitude" "Phase shift" } + { "Амплитуда" "Фазовый сдвиг" }} + set title_label { "Single Pole Low-Pass Filter" "Однополюсный Низко-Частотный Фильтр" @@ -108,8 +113,8 @@ # Make log plots using two different styles. - foreach xl $x_label yl $y_label altyl $alty_label title $title_label linel $line_label { - plot261 $w 0 $xl $yl $altyl $title $linel + foreach xl $x_label yl $y_label altyl $alty_label legend $legend_text title $title_label linel $line_label { + plot261 $w 0 $xl $yl $altyl $legend $title $linel } # Restore defauls @@ -123,7 +128,7 @@ # Log-linear plot. # -------------------------------------------------------------------------- -proc plot261 { w type x_label y_label alty_label title_label line_label } { +proc plot261 { w type x_label y_label alty_label legend_text title_label line_label } { set PI [expr {4.0*atan(1.0)}] @@ -159,7 +164,7 @@ $w cmd plcol0 2 $w cmd plline 101 freql ampl - $w cmd plcol0 1 + $w cmd plcol0 2 $w cmd plptex 1.6 -30.0 1.0 -20.0 0.5 $line_label # Put labels on @@ -178,7 +183,45 @@ $w cmd plbox "" 0.0 0 "cmstv" 30.0 3 $w cmd plcol0 3 $w cmd plline 101 freql phase + $w cmd plstring 101 freql phase "*" $w cmd plcol0 3 $w cmd plmtex "r" 5.0 0.5 0.5 $alty_label } + + # Draw a legend + # First legend entry. + set opt_array [list $::PLPLOT::PL_LEGEND_LINE] + set text_colors [list 2] + set line_colors [list 2] + set line_styles [list 1] + set line_widths [list 1] + # note from the above opt_array the first symbol (and box) indices + # will not be used, but they have to be specified anyway! + # (make sure the values are reasonable) + + # Second legend entry. + lappend opt_array [expr {$::PLPLOT::PL_LEGEND_LINE | $::PLPLOT::PL_LEGEND_SYMBOL}] + lappend text_colors 3 + lappend line_colors 3 + lappend line_styles 1 + lappend line_widths 1 + set symbol_colors [list 0 3] + set symbol_scales [list 0.0 1.] + set symbol_numbers [list 0 4] + set symbols [list "" "*"] + + # from the above opt_arrays we can completely ignore everything + # to do with boxes. + + plscol0a 15 32 32 32 0.70 + pllegend \ + 0 [expr {$::PLPLOT::PL_LEGEND_BACKGROUND | $::PLPLOT::PL_LEGEND_BOUNDING_BOX}] \ + 0.0 0.0 0.10 15 \ + 1 1 0 0 \ + $opt_array \ + 1.0 1.0 2.0 \ + 1. $text_colors $legend_text \ + {} {} {} {} \ + $line_colors $line_styles $line_widths \ + $symbol_colors $symbol_scales $symbol_numbers $symbols } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-02-09 22:10:32
|
Revision: 11552 http://plplot.svn.sourceforge.net/plplot/?rev=11552&view=rev Author: airwin Date: 2011-02-09 22:10:25 +0000 (Wed, 09 Feb 2011) Log Message: ----------- The swig-generated bindings for octave are completely mature now, AFAIK. Therefore, replace the ENABLE_swig_octave ON/OFF option with ENABLE_matwrapped_octave OFF/ON option with the default being ENABLE_matwrapped_octave=OFF. Emphasize that ENABLE_matwrapped_octave=ON is a legacy alternative that is not going to be around for much longer (my guess is we will probably drop it just after the next release). Modified Paths: -------------- trunk/README.release trunk/bindings/octave/CMakeLists.txt trunk/cmake/modules/octave.cmake trunk/plplot_test/CMakeLists.txt Modified: trunk/README.release =================================================================== --- trunk/README.release 2011-02-09 13:21:11 UTC (rev 11551) +++ trunk/README.release 2011-02-09 22:10:25 UTC (rev 11552) @@ -348,9 +348,12 @@ (all of which have now have been updated to use those functions) and get consistent results with the corresponding C examples. The swig-generated bindings for Octave are used by default, but the build -system falls back to the matwrapped bindings if swig is not available. -Users can force the matwrapped bindings by using the --DENABLE_swig_octave=OFF cmake command-line option. +system falls back to the legacy matwrapped bindings if swig is not +available. For now, users can force the legacy matwrapped bindings by +using the -DENABLE_matwrapped_octave=ON cmake command-line option for +comparison purposes, but in the near future we plan to remove the +matwrapped octave bindings because the swig-generated alternative is +more complete and easier to maintain. Like the matwrapped bindings before it, the new swig-generated octave bindings currently do not have a number of the PLplot functions @@ -1170,9 +1173,12 @@ (all of which have now have been updated to use those functions) and get consistent results with the corresponding C examples. The swig-generated bindings for Octave are used by default, but the build -system falls back to the matwrapped bindings if swig is not available. -Users can force the matwrapped bindings by using the --DENABLE_swig_octave=OFF cmake command-line option. +system falls back to the legacy matwrapped bindings if swig is not +available. For now, users can force the legacy matwrapped bindings by +using the -DENABLE_matwrapped_octave=ON cmake command-line option for +comparison purposes, but in the near future we plan to remove the +matwrapped octave bindings because the swig-generated alternative is +more complete and easier to maintain. Like the matwrapped bindings before it, the new swig-generated octave bindings currently do not have a number of the PLplot functions Modified: trunk/bindings/octave/CMakeLists.txt =================================================================== --- trunk/bindings/octave/CMakeLists.txt 2011-02-09 13:21:11 UTC (rev 11551) +++ trunk/bindings/octave/CMakeLists.txt 2011-02-09 22:10:25 UTC (rev 11552) @@ -121,6 +121,8 @@ ) # Add (Unix) custom target to check that plplot_oct_def is up to date. + # This check only relevant for legacy matwrapped octave bindings since + # swig-based bindings don't use plplot_oct_def. add_custom_target( check_plplot_octave_def COMMAND ${CMAKE_COMMAND} -E remove -f @@ -137,66 +139,11 @@ ) # Build octave interface. - if(ENABLE_swig_octave) - - add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub_hand_crafted.m - ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub_hand_crafted.m - ) - - add_custom_target( - plplot_stub.m_built ALL - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m - ) - + if(ENABLE_matwrapped_octave) set(octave_interface_INCLUDE_PATHS ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/lib/qsastime ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR} - ${OCTAVE_INCLUDE_PATH} - ${CMAKE_SOURCE_DIR}/bindings/swig-support - ) - include_directories(${octave_interface_INCLUDE_PATHS}) - set(CMAKE_SWIG_FLAGS -DSWIG_OCTAVE) - set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}) - - set_source_files_properties(plplot_octave.i - PROPERTIES - SWIG_MODULE_NAME plplot_octave - CPLUSPLUS ON - ) - - set(SWIG_MODULE_plplot_octave_EXTRA_DEPS - ${CMAKE_SOURCE_DIR}/bindings/swig-support/swig_documentation.i - ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i - ) - - # Set up swig + c wrapper. - swig_add_module(plplot_octave octave plplot_octave.i) - swig_link_libraries( - plplot_octave - plplot${LIB_TAG} - "${OCTAVE_LIBRARIES}" - "${OCTINTERP_LIBRARIES}" - ) - - # Make sure plplot_stub.m is copied to build tree before plplot_octave - # is created so can use plplot_octave in normal way. - add_dependencies(plplot_octave plplot_stub.m_built) - - else(ENABLE_swig_octave) - set(octave_interface_INCLUDE_PATHS - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${OCTAVE_INCLUDE_PATH} @@ -272,9 +219,61 @@ # serialize these custom targets so that parallel build jobs # don't interfere with each other. add_dependencies(plplot_stub.m_built make_documentation) + else(ENABLE_matwrapped_octave) + add_custom_command( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub_hand_crafted.m + ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub_hand_crafted.m + ) - endif(ENABLE_swig_octave) + add_custom_target( + plplot_stub.m_built ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m + ) + set(octave_interface_INCLUDE_PATHS + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/lib/qsastime + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/include + ${CMAKE_CURRENT_BINARY_DIR} + ${OCTAVE_INCLUDE_PATH} + ${CMAKE_SOURCE_DIR}/bindings/swig-support + ) + include_directories(${octave_interface_INCLUDE_PATHS}) + set(CMAKE_SWIG_FLAGS -DSWIG_OCTAVE) + set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}) + + set_source_files_properties(plplot_octave.i + PROPERTIES + SWIG_MODULE_NAME plplot_octave + CPLUSPLUS ON + ) + + set(SWIG_MODULE_plplot_octave_EXTRA_DEPS + ${CMAKE_SOURCE_DIR}/bindings/swig-support/swig_documentation.i + ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i + ) + + # Set up swig + c wrapper. + swig_add_module(plplot_octave octave plplot_octave.i) + swig_link_libraries( + plplot_octave + plplot${LIB_TAG} + "${OCTAVE_LIBRARIES}" + "${OCTINTERP_LIBRARIES}" + ) + + # Make sure plplot_stub.m is copied to build tree before plplot_octave + # is created so can use plplot_octave in normal way. + add_dependencies(plplot_octave plplot_stub.m_built) + endif(ENABLE_matwrapped_octave) + # Need access elsewhere (examples/octave) to the file depends of # this custom target. set_property(GLOBAL PROPERTY Modified: trunk/cmake/modules/octave.cmake =================================================================== --- trunk/cmake/modules/octave.cmake 2011-02-09 13:21:11 UTC (rev 11551) +++ trunk/cmake/modules/octave.cmake 2011-02-09 22:10:25 UTC (rev 11552) @@ -263,11 +263,11 @@ if(PL_DOUBLE) set(DEFINE_PL_DOUBLE "#define PL_DOUBLE") endif(PL_DOUBLE) - option(ENABLE_swig_octave "Enable Octave bindings generated by SWIG" ON) - if(NOT SWIG_FOUND AND ENABLE_swig_octave) + option(ENABLE_matwrapped_octave "Enable legacy Octave bindings generated by matwrap" OFF) + if(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave) message(STATUS "WARNING: " - "SWIG not found. Falling back to deprecated matwrapped octave bindings.") - set(ENABLE_swig_octave OFF CACHE BOOL "Enable Octave bindings generated by SWIG" FORCE) - endif(NOT SWIG_FOUND AND ENABLE_swig_octave) + "SWIG not found. Falling back to deprecated matwrapped Octave bindings.") + set(ENABLE_matwrapped_octave ON CACHE BOOL "Enable legacy Octave bindings generated by matwrap" FORCE) + endif(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave) endif(ENABLE_octave) Modified: trunk/plplot_test/CMakeLists.txt =================================================================== --- trunk/plplot_test/CMakeLists.txt 2011-02-09 13:21:11 UTC (rev 11551) +++ trunk/plplot_test/CMakeLists.txt 2011-02-09 22:10:25 UTC (rev 11552) @@ -123,13 +123,13 @@ endif(ENABLE_java) if(ENABLE_octave) - if(ENABLE_swig_octave) + if(ENABLE_matwrapped_octave) + set(matwrap_octave_comment) + set(swig_octave_comment "# (ignore for matwrap-generated case) ") + else(ENABLE_matwrapped_octave) set(swig_octave_comment) set(matwrap_octave_comment "# (ignore for swig-generated case) ") - else(ENABLE_swig_octave) - set(matwrap_octave_comment) - set(swig_octave_comment "# (ignore for matwrap-generated case) ") - endif(ENABLE_swig_octave) + endif(ENABLE_matwrapped_octave) configure_file( test_octave_interactive.sh.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-02-10 19:21:14
|
Revision: 11555 http://plplot.svn.sourceforge.net/plplot/?rev=11555&view=rev Author: airwin Date: 2011-02-10 19:21:06 +0000 (Thu, 10 Feb 2011) Log Message: ----------- Add Fortran 77 and 95 example 33 to build for installed examples tree and also to tests for build tree and installed examples tree. Modified Paths: -------------- trunk/examples/f77/Makefile.examples.in trunk/examples/f95/Makefile.examples.in trunk/plplot_test/test_f77.sh.in trunk/plplot_test/test_f95.sh.in Modified: trunk/examples/f77/Makefile.examples.in =================================================================== --- trunk/examples/f77/Makefile.examples.in 2011-02-10 18:49:45 UTC (rev 11554) +++ trunk/examples/f77/Makefile.examples.in 2011-02-10 19:21:06 UTC (rev 11555) @@ -61,7 +61,8 @@ x28f$(EXEEXT) \ x29f$(EXEEXT) \ x30f$(EXEEXT) \ - x31f$(EXEEXT) + x31f$(EXEEXT) \ + x33f$(EXEEXT) all: $(EXECUTABLES_list) Modified: trunk/examples/f95/Makefile.examples.in =================================================================== --- trunk/examples/f95/Makefile.examples.in 2011-02-10 18:49:45 UTC (rev 11554) +++ trunk/examples/f95/Makefile.examples.in 2011-02-10 19:21:06 UTC (rev 11555) @@ -59,8 +59,9 @@ x27f$(EXEEXT) \ x28f$(EXEEXT) \ x29f$(EXEEXT) \ + x30f$(EXEEXT) \ x31f$(EXEEXT) \ - x30f$(EXEEXT) + x33f$(EXEEXT) all: $(EXECUTABLES_list) Modified: trunk/plplot_test/test_f77.sh.in =================================================================== --- trunk/plplot_test/test_f77.sh.in 2011-02-10 18:49:45 UTC (rev 11554) +++ trunk/plplot_test/test_f77.sh.in 2011-02-10 19:21:06 UTC (rev 11555) @@ -54,7 +54,7 @@ fi # Do the standard non-interactive examples. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do + for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 ; do if [ "$verbose_test" ] ; then echo "x${index}f" fi @@ -106,7 +106,7 @@ # Do the standard non-interactive examples. # skip 17 because it is interactive. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do + for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 ; do if [ "$verbose_test" ] ; then echo "x${index}f" fi Modified: trunk/plplot_test/test_f95.sh.in =================================================================== --- trunk/plplot_test/test_f95.sh.in 2011-02-10 18:49:45 UTC (rev 11554) +++ trunk/plplot_test/test_f95.sh.in 2011-02-10 19:21:06 UTC (rev 11555) @@ -55,7 +55,7 @@ # Do the standard non-interactive examples. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do + for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}f" fi @@ -106,7 +106,7 @@ # Do the standard non-interactive examples. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do + for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}f" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-02-13 21:07:05
|
Revision: 11565 http://plplot.svn.sourceforge.net/plplot/?rev=11565&view=rev Author: airwin Date: 2011-02-13 21:06:58 +0000 (Sun, 13 Feb 2011) Log Message: ----------- Implement honoring of PL_POSITION_VIEWPORT and PL_POSITION_SUBPAGE bits of position argument for plllegend. (Note, this is not an API change for pllegend.) Use the PL_POSITION_SUBPAGE bit to make page 3 of example 33 slightly more convenient to implement. N.B. I have left it to Hez to deal with the OCaml change to example 33 because I don't grok OCaml. However, my examples changes are consistent for all our other languages where example 33 is currently implemented. Modified Paths: -------------- trunk/examples/c/x33c.c trunk/examples/c++/x33.cc trunk/examples/f77/x33f.fm4 trunk/examples/f95/x33f.f90 trunk/examples/java/x33.java trunk/examples/octave/x33c.m trunk/examples/python/xw33.py trunk/src/pllegend.c Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-02-13 20:55:15 UTC (rev 11564) +++ trunk/examples/c/x33c.c 2011-02-13 21:06:58 UTC (rev 11565) @@ -469,16 +469,16 @@ // Third page demonstrating legend alignment pladv( 0 ); - plvpor( 0., 1., 0., 1. ); + plvpor( 0.0, 1.0, 0.0, 0.9 ); plwind( 0.0, 1.0, 0.0, 1.0 ); plsfont( PL_FCI_SANS, -1, -1 ); - plmtex( "t", -2.0, 0.5, 0.5, "Demonstrate legend alignment" ); + plmtex( "t", 2.0, 0.5, 0.5, "Demonstrate legend alignment" ); x = 0.1; y = 0.1; nturn = 4; nlegend = 0; - position = PL_POSITION_TOP | PL_POSITION_LEFT; + position = PL_POSITION_TOP | PL_POSITION_LEFT | PL_POSITION_SUBPAGE; opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; opt = opt_base; for ( i = 0; i < 9; i++ ) @@ -521,7 +521,7 @@ if ( i == nturn ) { - position = PL_POSITION_TOP | PL_POSITION_RIGHT; + position = PL_POSITION_TOP | PL_POSITION_RIGHT | PL_POSITION_SUBPAGE; opt = opt_base; x = 1. - x; y += legend_height; Modified: trunk/examples/c++/x33.cc =================================================================== --- trunk/examples/c++/x33.cc 2011-02-13 20:55:15 UTC (rev 11564) +++ trunk/examples/c++/x33.cc 2011-02-13 21:06:58 UTC (rev 11565) @@ -458,16 +458,16 @@ // Third page demonstrating legend alignment pls->adv( 0 ); - pls->vpor( 0., 1., 0., 1. ); + pls->vpor( 0.0, 1.0, 0.0, 0.9 ); pls->wind( 0.0, 1.0, 0.0, 1.0 ); pls->sfont( PL_FCI_SANS, -1, -1 ); - pls->mtex( "t", -2.0, 0.5, 0.5, "Demonstrate legend alignment" ); + pls->mtex( "t", 2.0, 0.5, 0.5, "Demonstrate legend alignment" ); x = 0.1; y = 0.1; nturn = 4; nlegend = 0; - position = PL_POSITION_TOP | PL_POSITION_LEFT; + position = PL_POSITION_TOP | PL_POSITION_LEFT | PL_POSITION_SUBPAGE; opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; opt = opt_base; for ( i = 0; i < 9; i++ ) @@ -510,7 +510,7 @@ if ( i == nturn ) { - position = PL_POSITION_TOP | PL_POSITION_RIGHT; + position = PL_POSITION_TOP | PL_POSITION_RIGHT | PL_POSITION_SUBPAGE; opt = opt_base; x = 1. - x; y += legend_height; Modified: trunk/examples/f77/x33f.fm4 =================================================================== --- trunk/examples/f77/x33f.fm4 2011-02-13 20:55:15 UTC (rev 11564) +++ trunk/examples/f77/x33f.fm4 2011-02-13 21:06:58 UTC (rev 11565) @@ -311,17 +311,18 @@ c Third page demonstrating legend alignment call pladv( 0 ) - call plvpor( 0.d0, 1.d0, 0.d0, 1.d0 ) + call plvpor( 0.0d0, 1.0d0, 0.0d0, 0.9d0 ) call plwind( 0.0d0, 1.0d0, 0.0d0, 1.0d0 ) call plsfont( PL_FCI_SANS, -1, -1 ) - call plmtex( 't', -2.0d0, 0.5d0, 0.5d0, + call plmtex( 't', 2.0d0, 0.5d0, 0.5d0, & 'Demonstrate legend alignment' ) x = 0.1d0 y = 0.1d0 nturn = 5 nlegend = 0 - position = PL_POSITION_TOP + PL_POSITION_LEFT + position = PL_POSITION_TOP + PL_POSITION_LEFT + + & PL_POSITION_SUBPAGE opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX opt = opt_base do 140 i = 1,9 @@ -369,7 +370,8 @@ & symbol_colors, symbol_scales, symbol_numbers, symbols ) if ( i .eq. nturn ) then - position = PL_POSITION_TOP + PL_POSITION_RIGHT + position = PL_POSITION_TOP + PL_POSITION_RIGHT + + & PL_POSITION_SUBPAGE opt = opt_base x = 1.d0 - x y = y + legend_height Modified: trunk/examples/f95/x33f.f90 =================================================================== --- trunk/examples/f95/x33f.f90 2011-02-13 20:55:15 UTC (rev 11564) +++ trunk/examples/f95/x33f.f90 2011-02-13 21:06:58 UTC (rev 11565) @@ -291,17 +291,17 @@ ! Third page demonstrating legend alignment call pladv( 0 ) - call plvpor( 0._plflt, 1._plflt, 0._plflt, 1._plflt ) + call plvpor( 0.0_plflt, 1.0_plflt, 0.0_plflt, 0.9_plflt ) call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) call plsfont( PL_FCI_SANS, -1, -1 ) - call plmtex( 't', -2.0_plflt, 0.5_plflt, 0.5_plflt, & + call plmtex( 't', 2.0_plflt, 0.5_plflt, 0.5_plflt, & 'Demonstrate legend alignment' ) x = 0.1_plflt y = 0.1_plflt nturn = 5 nlegend = 0 - position = PL_POSITION_TOP + PL_POSITION_LEFT + position = PL_POSITION_TOP + PL_POSITION_LEFT + PL_POSITION_SUBPAGE opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX opt = opt_base do i = 1,9 @@ -349,7 +349,7 @@ symbol_colors, symbol_scales, symbol_numbers, symbols ) if ( i .eq. nturn ) then - position = PL_POSITION_TOP + PL_POSITION_RIGHT + position = PL_POSITION_TOP + PL_POSITION_RIGHT + PL_POSITION_SUBPAGE opt = opt_base x = 1._plflt - x y = y + legend_height Modified: trunk/examples/java/x33.java =================================================================== --- trunk/examples/java/x33.java 2011-02-13 20:55:15 UTC (rev 11564) +++ trunk/examples/java/x33.java 2011-02-13 21:06:58 UTC (rev 11565) @@ -458,17 +458,17 @@ // Third page demonstrating legend alignment pls.adv( 0 ); - pls.vpor( 0., 1., 0., 1. ); + pls.vpor( 0.0, 1.0, 0.0, 0.9 ); pls.wind( 0.0, 1.0, 0.0, 1.0 ); pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); - pls.mtex( "t", -2.0, 0.5, 0.5, "Demonstrate legend alignment" ); + pls.mtex( "t", 2.0, 0.5, 0.5, "Demonstrate legend alignment" ); x = 0.1; y = 0.1; nturn = 4; nlegend = 0; opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; - position = PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_LEFT; + position = PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_SUBPAGE; opt = opt_base; for ( i = 0; i < 9; i++ ) { @@ -525,7 +525,7 @@ if ( i == nturn ) { - position = PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_RIGHT; + position = PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_SUBPAGE; opt = opt_base; x = 1. - x; y = y + legend_height[0]; Modified: trunk/examples/octave/x33c.m =================================================================== --- trunk/examples/octave/x33c.m 2011-02-13 20:55:15 UTC (rev 11564) +++ trunk/examples/octave/x33c.m 2011-02-13 21:06:58 UTC (rev 11565) @@ -177,7 +177,7 @@ ## Initialize plplot ## set global attributes for PLplot variables used in this function. global PL_FCI_SANS PL_FCI_MONO PL_LEGEND_NONE PL_LEGEND_COLOR_BOX PL_LEGEND_LINE PL_LEGEND_SYMBOL PL_LEGEND_TEXT_LEFT PL_LEGEND_BACKGROUND PL_LEGEND_BOUNDING_BOX PL_LEGEND_ROW_MAJOR - global PL_POSITION_LEFT PL_POSITION_RIGHT PL_POSITION_TOP PL_POSITION_BOTTOM PL_POSITION_INSIDE PL_POSITION_OUTSIDE + global PL_POSITION_LEFT PL_POSITION_RIGHT PL_POSITION_TOP PL_POSITION_BOTTOM PL_POSITION_INSIDE PL_POSITION_OUTSIDE PL_POSITION_SUBPAGE global PL_COLORBAR_IMAGE PL_COLORBAR_SHADE PL_COLORBAR_GRADIENT PL_COLORBAR_SHADE_LABEL global position_options special_symbols plinit(); @@ -423,16 +423,16 @@ ## Third page demonstrating legend alignment pladv(0); - plvpor(0., 1., 0., 1.); + plvpor(0.0, 1.0, 0.0, 0.9); plwind(0.0, 1.0, 0.0, 1.0); plsfont(PL_FCI_SANS, -1, -1); - plmtex("t", -2.0, 0.5, 0.5, "Demonstrate legend alignment"); + plmtex("t", 2.0, 0.5, 0.5, "Demonstrate legend alignment"); x = 0.1; y = 0.1; nturn = 4; nlegend = 0; - position = bitor(PL_POSITION_LEFT, PL_POSITION_TOP); + position = bitor(bitor(PL_POSITION_LEFT, PL_POSITION_TOP), PL_POSITION_SUBPAGE); opt_base = bitor(PL_LEGEND_BACKGROUND, PL_LEGEND_BOUNDING_BOX); opt = opt_base; for i=0:8 @@ -511,7 +511,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); if(i == nturn) - position = bitor(PL_POSITION_RIGHT, PL_POSITION_TOP); + position = bitor(bitor(PL_POSITION_RIGHT, PL_POSITION_TOP), PL_POSITION_SUBPAGE); opt = opt_base; x = 1. - x; y += legend_height; Modified: trunk/examples/python/xw33.py =================================================================== --- trunk/examples/python/xw33.py 2011-02-13 20:55:15 UTC (rev 11564) +++ trunk/examples/python/xw33.py 2011-02-13 21:06:58 UTC (rev 11565) @@ -363,16 +363,16 @@ # Third page demonstrating legend alignment pladv(0) - plvpor(0., 1., 0., 1.) + plvpor(0.0, 1.0, 0.0, 0.9) plwind(0.0, 1.0, 0.0, 1.0) plsfont(PL_FCI_SANS, -1, -1) - plmtex("t", -2.0, 0.5, 0.5, "Demonstrate legend alignment") + plmtex("t", 2.0, 0.5, 0.5, "Demonstrate legend alignment") x = 0.1 y = 0.1 nturn = 4 nlegend = 0 - position = PL_POSITION_TOP | PL_POSITION_LEFT + position = PL_POSITION_TOP | PL_POSITION_LEFT | PL_POSITION_SUBPAGE opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX opt = opt_base for i in range(9): @@ -426,7 +426,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) if i == nturn: - position = PL_POSITION_TOP | PL_POSITION_RIGHT + position = PL_POSITION_TOP | PL_POSITION_RIGHT | PL_POSITION_SUBPAGE opt = opt_base x = 1. - x y += legend_height Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-02-13 20:55:15 UTC (rev 11564) +++ trunk/src/pllegend.c 2011-02-13 21:06:58 UTC (rev 11565) @@ -309,7 +309,7 @@ //! @param nx External normalized viewport X coordinate. //! -#define viewport_to_subpage_x( nx ) ( ( xdmin_save ) + ( nx ) * ( ( xdmax_save ) - ( xdmin_save ) ) ) +#define viewport_to_subpage_x( nx ) ( ( xdmin_adopted ) + ( nx ) * ( ( xdmax_adopted ) - ( xdmin_adopted ) ) ) //-------------------------------------------------------------------------- //! Convert from normalized subpage X coordinate to external normalized @@ -318,7 +318,7 @@ //! @param nx Normalized subpage X coordinate. //! -#define subpage_to_viewport_x( nx ) ( ( nx - xdmin_save ) / ( ( xdmax_save ) - ( xdmin_save ) ) ) +#define subpage_to_viewport_x( nx ) ( ( nx - xdmin_adopted ) / ( ( xdmax_adopted ) - ( xdmin_adopted ) ) ) //-------------------------------------------------------------------------- //! Convert from external normalized viewport Y coordinate to normalized @@ -327,7 +327,7 @@ //! @param ny External normalized viewport Y coordinate. //! -#define viewport_to_subpage_y( ny ) ( ( ydmin_save ) + ( ny ) * ( ( ydmax_save ) - ( ydmin_save ) ) ) +#define viewport_to_subpage_y( ny ) ( ( ydmin_adopted ) + ( ny ) * ( ( ydmax_adopted ) - ( ydmin_adopted ) ) ) //-------------------------------------------------------------------------- //! Convert from normalized subpage Y coordinate to external normalized @@ -336,7 +336,7 @@ //! @param ny Normalized subpage Y coordinate. //! -#define subpage_to_viewport_y( ny ) ( ( ny - ydmin_save ) / ( ( ydmax_save ) - ( ydmin_save ) ) ) +#define subpage_to_viewport_y( ny ) ( ( ny - ydmin_adopted ) / ( ( ydmax_adopted ) - ( ydmin_adopted ) ) ) //-------------------------------------------------------------------------- //! Plot discrete annotated legend using filled boxes, lines, and/or symbols. @@ -495,7 +495,12 @@ // Saved external world coordinates of viewport. PLFLT xwmin_save, xwmax_save, ywmin_save, ywmax_save; // Saved external normalized coordinates of viewport. + // (These are actual values used only for the restore.) PLFLT xdmin_save, xdmax_save, ydmin_save, ydmax_save; + // Saved external normalized coordinates of viewport. + // (These are adopted values used to calculate all coordinate + // transformations.) + PLFLT xdmin_adopted, xdmax_adopted, ydmin_adopted, ydmax_adopted; PLFLT x_subpage_per_mm, y_subpage_per_mm, text_width0 = 0., text_width; PLFLT width_border, column_separation, @@ -546,10 +551,33 @@ return; } - // xdmin_save, etc., are the external relative viewport - // coordinates within the current sub-page. + if ( !( position & PL_POSITION_VIEWPORT ) && !( position & PL_POSITION_SUBPAGE ) ) + { + position = position | PL_POSITION_VIEWPORT; + } + else if ( ( position & PL_POSITION_VIEWPORT ) && ( position & PL_POSITION_SUBPAGE ) ) + { + plabort( "pllegend: PL_POSITION_VIEWPORT and PL_POSITION_SUBPAGE cannot be simultaneously set." ); + return; + } + + // xdmin_save, etc., are the actual external relative viewport + // coordinates within the current sub-page used only for + // restoration at the end. plgvpd( &xdmin_save, &xdmax_save, &ydmin_save, &ydmax_save ); + if ( position & PL_POSITION_SUBPAGE ) + plvpor( 0., 1., 0., 1. ); + // xdmin_adopted, etc., are the adopted external relative viewport + // coordinates within the current sub-page used for all coordinate + // transformations. + // If position & PL_POSITION_VIEWPORT is true, these coordinates + // are the external relative viewport coordinates. + // If position & PL_POSITION_SUBPAGE is true, these + // coordinates are the relative subpage coordinates. + + plgvpd( &xdmin_adopted, &xdmax_adopted, &ydmin_adopted, &ydmax_adopted ); + // xwmin_save, etc., are the external world coordinates corresponding // to the external viewport boundaries. plgvpw( &xwmin_save, &xwmax_save, &ywmin_save, &ywmax_save ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2011-02-25 12:01:06
|
Revision: 11578 http://plplot.svn.sourceforge.net/plplot/?rev=11578&view=rev Author: arjenmarkus Date: 2011-02-25 12:00:57 +0000 (Fri, 25 Feb 2011) Log Message: ----------- Almost complete example 33 - there are a few differences with the C example (without colour bars of course). Small correction in the interfacing Modified Paths: -------------- trunk/bindings/tcl/tclAPI.c trunk/examples/tcl/x33.tcl Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-02-24 08:53:42 UTC (rev 11577) +++ trunk/bindings/tcl/tclAPI.c 2011-02-25 12:00:57 UTC (rev 11578) @@ -4155,7 +4155,7 @@ return TCL_ERROR; } - sscanf( argv[1], "%lg", &value ); position = (PLFLT) value; + sscanf( argv[1], "%d", &position ); sscanf( argv[2], "%d", &opt ); sscanf( argv[3], "%lg", &value ); x = (PLFLT) value; sscanf( argv[4], "%lg", &value ); y = (PLFLT) value; Modified: trunk/examples/tcl/x33.tcl =================================================================== --- trunk/examples/tcl/x33.tcl 2011-02-24 08:53:42 UTC (rev 11577) +++ trunk/examples/tcl/x33.tcl 2011-02-25 12:00:57 UTC (rev 11578) @@ -28,35 +28,6 @@ # course, you must have the appropriate TrueType fonts installed to # have access to all the required glyphs. -set position_options [list \ - [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_OUTSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_OUTSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_OUTSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_OUTSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_OUTSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_OUTSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_OUTSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_OUTSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_INSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_INSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_INSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_INSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_INSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_INSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_INSIDE}] \ - [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_INSIDE}] ] - -# Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). -set special_symbols [list \ - "✰" \ - "✴" \ - "✱" \ - "✽" \ - "✦" ] - -set colorbar 0 ;# By default do not plot plcolorbar pages - # for now while we are working out the API. - # TODO #set options [list { # { @@ -79,8 +50,6 @@ # } // long syntax #}; -set notes { "Make sure you get it right!" NULL } - # -------------------------------------------------------------------------- # main # @@ -91,14 +60,42 @@ proc x33 {{w loopback}} { + set position_options [list \ + [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_OUTSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_OUTSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_OUTSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_OUTSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_OUTSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_OUTSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_OUTSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_OUTSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_INSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_INSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_TOP | $::PLPLOT::PL_POSITION_INSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_INSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_RIGHT | $::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_INSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_INSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_BOTTOM | $::PLPLOT::PL_POSITION_INSIDE}] \ + [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_INSIDE}] ] + + # Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). + set special_symbols [list \ + "✰" \ + "✴" \ + "✱" \ + "✽" \ + "✦" ] + + set colorbar 0 ;# By default do not plot plcolorbar pages + # for now while we are working out the API. + + set notes { "Make sure you get it right!" NULL } + # Parse and process command line arguments # TODO # plMergeOpts options "x33c options" notes # void plparseopts &argc argv PL_PARSE_FULL - # Initialize plplot - $w cmd plinit - # First page illustrating the 16 standard positions. $w cmd pladv 0 $w cmd plvpor 0.25 0.75 0.25 0.75 @@ -127,9 +124,9 @@ set position [lindex $position_options $k] set opt $opt_base set text [list [format "%2.2d" $k]] - set text_colors [list [expr {1 + k % 8}]] - set line_colors [list [expr {1 + k % 8}]] - set symbol_colors [list [expr {1 + k % 8}]] + set text_colors [list [expr {1 + $k % 8}]] + set line_colors [list [expr {1 + $k % 8}]] + set symbol_colors [list [expr {1 + $k % 8}]] $w cmd pllegend $position $opt 0.05 0.05 \ 0.1 15 1 1 0 0 \ @@ -161,6 +158,7 @@ set symbol_scales [list] set symbol_numbers [list] set symbols [list] + set text [list] set text_colors [list] set line_colors [list] set symbol_colors [list] @@ -172,9 +170,9 @@ lappend symbol_numbers 2 lappend symbols "*" lappend text [format "%2.2d" $k] - lappend text_colors [expr {1 + k % 8}] - lappend line_colors [expr {1 + k % 8}] - lappend symbol_colors [expr {1 + k % 8}] + lappend text_colors [expr {1 + $k % 8}] + lappend line_colors [expr {1 + $k % 8}] + lappend symbol_colors [expr {1 + $k % 8}] } # Use monotype fonts so that all legends are the same size. @@ -300,7 +298,7 @@ } else { incr nlegend -1 } - set nlegend [max 1 nlegend] + set nlegend [max 1 $nlegend] # nly specify legend data that are required according to the # value of opt_array for that entry. set opt_array [list] @@ -309,6 +307,7 @@ set symbol_scales [list] set symbol_numbers [list] set symbols [list] + set text [list] set text_colors [list] set line_colors [list] set symbol_colors [list] @@ -320,15 +319,15 @@ lappend symbol_numbers 2 lappend symbols "*" lappend text [format "%2.2d" $k] - lappend text_colors [expr {1 + k % 8}] - lappend line_colors [expr {1 + k % 8}] - lappend symbol_colors [expr {1 + k % 8}] + lappend text_colors [expr {1 + $k % 8}] + lappend line_colors [expr {1 + $k % 8}] + lappend symbol_colors [expr {1 + $k % 8}] } # Use monotype fonts so that all legends are the same size. $w cmd plsfont [expr {$::PLPLOT::PL_FCI_MONO}] -1 -1 $w cmd plscol0a 15 32 32 32 0.70 - set nrow [min 3 nlegend] + set nrow [min 3 $nlegend] set ncolumn 0 set legend_data [$w cmd pllegend $position $opt $x $y \ @@ -368,31 +367,40 @@ set nlegend 5 # Only specify legend data that are required according to the # value of opt_array for that entry. - set position = [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_TOP}] - set opt_base = [expr {$::PLPLOT::PL_LEGEND_BACKGROUND | $::PLPLOT::PL_LEGEND_BOUNDING_BOX | $::PLPLOT::PL_LEGEND_TEXT_LEFT}] + set position [expr {$::PLPLOT::PL_POSITION_LEFT | $::PLPLOT::PL_POSITION_TOP}] + set opt_base [expr {$::PLPLOT::PL_LEGEND_BACKGROUND | $::PLPLOT::PL_LEGEND_BOUNDING_BOX | $::PLPLOT::PL_LEGEND_TEXT_LEFT}] # Set up None, Box, Line, Symbol, and Line & Symbol legend entries. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] - set opt_array [list [expr {$::PLPLOT::PL_LEGEND_NONE}]] - set text [list "None"] - set text_colors [list 1] + set opt_array [list [expr {$::PLPLOT::PL_LEGEND_NONE}]] + set text [list "None"] + set text_colors [list 1] + set line_colors [list {}] + set line_styles [list {}] + set line_widths [list {}] + set box_colors [list {}] + set box_patterns [list {}] + set box_scales [list {}] + set box_line_widths [list {}] + set symbol_scales [list {}] + set symbol_numbers [list {}] + set symbols [list {}] + set symbol_colors [list {}] lappend opt_array [expr {$::PLPLOT::PL_LEGEND_COLOR_BOX}] lappend text "Box" lappend text_colors 2 + lappend line_colors {} + lappend line_styles {} + lappend line_widths {} lappend box_colors 2 lappend box_patterns 0 lappend box_scales 0.8 lappend box_line_widths 1 + lappend symbol_scales {} + lappend symbol_numbers {} + lappend symbols {} + lappend symbol_colors {} lappend opt_array [expr {$::PLPLOT::PL_LEGEND_LINE}] lappend text "Line" @@ -400,10 +408,25 @@ lappend line_colors 3 lappend line_styles 1 lappend line_widths 1 + lappend box_colors {} + lappend box_patterns {} + lappend box_scales {} + lappend box_line_widths {} + lappend symbol_scales {} + lappend symbol_numbers {} + lappend symbols {} + lappend symbol_colors {} lappend opt_array [expr {$::PLPLOT::PL_LEGEND_SYMBOL}] lappend text "Symbol" lappend text_colors 4 + lappend line_colors {} + lappend line_styles {} + lappend line_widths {} + lappend box_colors {} + lappend box_patterns {} + lappend box_scales {} + lappend box_line_widths {} lappend symbol_colors 4 lappend symbol_scales $text_scale lappend symbol_numbers 4 @@ -415,6 +438,10 @@ lappend line_colors 5 lappend line_styles 1 lappend line_widths 1 + lappend box_colors {} + lappend box_patterns {} + lappend box_scales {} + lappend box_line_widths {} lappend symbol_colors 5 lappend symbol_scales $text_scale lappend symbol_numbers 4 @@ -435,15 +462,20 @@ set max_height [max $max_height $legend_height] # Set up symbol legend entries with various symbols. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] + set opt_array [list] + set line_styles [list] + set line_widths [list] + set symbol_scales [list] + set symbol_numbers [list] + set symbols [list] + set text [list] + set text_colors [list] + set line_colors [list] + set symbol_colors [list] + set box_colors [list] + set box_patterns [list] + set box_scales [list] + set box_line_widths [list] for { set i 0} {$i < $nlegend} {incr i} { lappend opt_array [expr {$::PLPLOT::PL_LEGEND_SYMBOL}] lappend text "Symbol [lindex $special_symbols $i]" @@ -469,17 +501,22 @@ set max_height [max $max_height $legend_height] # Set up symbol legend entries with various numbers of symbols. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] + set opt_array [list] + set line_styles [list] + set line_widths [list] + set symbol_scales [list] + set symbol_numbers [list] + set symbols [list] + set text [list] + set text_colors [list] + set line_colors [list] + set symbol_colors [list] + set box_colors [list] + set box_patterns [list] + set box_scales [list] + set box_line_widths [list] for {set i 0} {$i < $nlegend} {incr i} { - lappend opt_array[i] [expr {$::PLPLOT::PL_LEGEND_SYMBOL}] + lappend opt_array [expr {$::PLPLOT::PL_LEGEND_SYMBOL}] lappend text [format "%s %d" "Symbol Number" [expr {$i + 2}]] lappend text_colors [expr {$i + 1}] lappend symbol_colors [expr {$i + 1}] @@ -503,15 +540,20 @@ set max_height [max $max_height $legend_height] # Set up box legend entries with various colours. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] + set opt_array [list] + set line_styles [list] + set line_widths [list] + set symbol_scales [list] + set symbol_numbers [list] + set symbols [list] + set text [list] + set text_colors [list] + set line_colors [list] + set symbol_colors [list] + set box_colors [list] + set box_patterns [list] + set box_scales [list] + set box_line_widths [list] for {set i 0} {$i < $nlegend} {incr i} { lappend opt_array [expr {$::PLPLOT::PL_LEGEND_COLOR_BOX}] lappend text [format "%s %d" "Box Color" [expr {$i + 1}]] @@ -540,15 +582,20 @@ set max_height [max $max_height $legend_height] # Set up box legend entries with various patterns. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] + set opt_array [list] + set line_styles [list] + set line_widths [list] + set symbol_scales [list] + set symbol_numbers [list] + set symbols [list] + set text [list] + set text_colors [list] + set line_colors [list] + set symbol_colors [list] + set box_colors [list] + set box_patterns [list] + set box_scales [list] + set box_line_widths [list] for {set i 0} {$i < $nlegend} {incr i} { lappend opt_array [expr {$::PLPLOT::PL_LEGEND_COLOR_BOX}] lappend text [format "%s %d" "Box Pattern" $i] @@ -571,18 +618,23 @@ {} {} {} \ {} {} {} {}] foreach {legend_width legend_height} $legend_data {break} - set max_height = MAX max_height legend_height + set max_height [max $max_height $legend_height] # Set up box legend entries with various box pattern line widths. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] + set opt_array [list] + set line_styles [list] + set line_widths [list] + set symbol_scales [list] + set symbol_numbers [list] + set symbols [list] + set text [list] + set text_colors [list] + set line_colors [list] + set symbol_colors [list] + set box_colors [list] + set box_patterns [list] + set box_scales [list] + set box_line_widths [list] for {set i 0} {$i < $nlegend} {incr i} { lappend opt_array [expr {$::PLPLOT::PL_LEGEND_COLOR_BOX}] lappend text [format "%s %d" "Box Line Width" [expr {$i + 1}]] @@ -599,27 +651,32 @@ set legend_data [$w cmd pllegend $position $opt $x $y \ 0.1 15 1 1 0 0 \ - $nlegend opt_array 1.0 $text_scale 2.0 \ + $opt_array 1.0 $text_scale 2.0 \ 0. $text_colors $text \ $box_colors $box_patterns $box_scales $box_line_widths \ {} {} {} \ {} {} {} {}] foreach {legend_width legend_height} $legend_data {break} - set max_height [max max_height legend_height] + set max_height [max $max_height $legend_height] # Set up line legend entries with various colours. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] + set opt_array [list] + set line_styles [list] + set line_widths [list] + set symbol_scales [list] + set symbol_numbers [list] + set symbols [list] + set text [list] + set text_colors [list] + set line_colors [list] + set symbol_colors [list] + set box_colors [list] + set box_patterns [list] + set box_scales [list] + set box_line_widths [list] for {set i 0} {$i < $nlegend} {incr i} { lappend opt_array [expr {$::PLPLOT::PL_LEGEND_LINE}] - lappend text [format "%s %d" "Line Color" [expr {$i + 1}] + lappend text [format "%s %d" "Line Color" [expr {$i + 1}]] lappend text_colors [expr {$i + 1}] lappend line_colors [expr {$i + 1}] lappend line_styles 1 @@ -629,13 +686,13 @@ set opt $opt_base # Use new origin set x $xstart - set y [expr {$x + $max_height}] + set y [expr {$y + $max_height}] set max_height 0. $w cmd plscol0a 15 32 32 32 0.70 set legend_data [$w cmd pllegend $position $opt $x $y \ 0.1 15 1 1 0 0 \ - $nlegend $opt_array 1.0 $text_scale 2.0 \ + $opt_array 1.0 $text_scale 2.0 \ 0. $text_colors $text \ {} {} {} {} \ $line_colors $line_styles $line_widths \ @@ -644,15 +701,20 @@ set max_height [max $max_height $legend_height] # Set up line legend entries with various styles. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] + set opt_array [list] + set line_styles [list] + set line_widths [list] + set symbol_scales [list] + set symbol_numbers [list] + set symbols [list] + set text [list] + set text_colors [list] + set line_colors [list] + set symbol_colors [list] + set box_colors [list] + set box_patterns [list] + set box_scales [list] + set box_line_widths [list] for {set i 0} {$i < $nlegend} {incr i} { lappend opt_array [expr {$::PLPLOT::PL_LEGEND_LINE}] lappend text [format "%s %d" "Line Style" [expr {$i + 1}]] @@ -668,7 +730,7 @@ set legend_data [$w cmd pllegend $position $opt $x $y \ 0.1 15 1 1 0 0 \ - $nlegend $opt_array 1.0 $text_scale 2.0 \ + $opt_array 1.0 $text_scale 2.0 \ 0. $text_colors $text \ {} {} {} {} \ $line_colors $line_styles $line_widths \ @@ -677,15 +739,20 @@ set max_height [max $max_height $legend_height] # Set up line legend entries with various widths. - set opt_array [list] - set line_styles [list] - set line_widths [list] - set symbol_scales [list] - set symbol_numbers [list] - set symbols [list] - set text_colors [list] - set line_colors [list] - set symbol_colors [list] + set opt_array [list] + set line_styles [list] + set line_widths [list] + set symbol_scales [list] + set symbol_numbers [list] + set symbols [list] + set text [list] + set text_colors [list] + set line_colors [list] + set symbol_colors [list] + set box_colors [list] + set box_patterns [list] + set box_scales [list] + set box_line_widths [list] for {set i 0} {$i < $nlegend} {incr i} { lappend opt_array [expr {$::PLPLOT::PL_LEGEND_LINE}] lappend text [format "%s %d" "Line Width" [expr {$i + 1}]] @@ -701,7 +768,7 @@ set legend_data [$w cmd pllegend $position $opt $x $y \ 0.1 15 1 1 0 0 \ - $nlegend $opt_array 1.0 $text_scale 2.0 \ + $opt_array 1.0 $text_scale 2.0 \ 0. $text_colors $text \ {} {} {} {} \ $line_colors $line_styles $line_widths \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-02 18:16:49
|
Revision: 11584 http://plplot.svn.sourceforge.net/plplot/?rev=11584&view=rev Author: airwin Date: 2011-03-02 18:16:43 +0000 (Wed, 02 Mar 2011) Log Message: ----------- Implement the -eofill option. If this option is used, then for the case where the boundary of the filled region is self-intersecting (e.g., example 27), use the even-odd fill rule rather than the default nonzero fill rule. Note, PLplot current relies on drivers (or the library dependencies of drivers) to implement fills so it is up to the drivers to honor this option. ToDo. Get xwin, svg, cairo, and qt device drivers to honor this option. Modified Paths: -------------- trunk/include/plstrm.h trunk/src/plargs.c Modified: trunk/include/plstrm.h =================================================================== --- trunk/include/plstrm.h 2011-02-28 09:30:50 UTC (rev 11583) +++ trunk/include/plstrm.h 2011-03-02 18:16:43 UTC (rev 11584) @@ -198,6 +198,10 @@ // dev_npts PLINT Number of points we are plotting // dev_x short* Pointer to array of x values // dev_y short* Pointer to array of x values +// For the case where the boundary of the filled region is +// self-intersecting, use the even-odd fill rule rather than the +// default nonzero fill rule. +// dev_eofill PLINT // // For images // dev_nptsX PLINT Number of points we are plotting in X @@ -784,6 +788,7 @@ PLINT has_string_length; PLFLT string_length; PLINT get_string_length; + PLINT dev_eofill; } PLStream; //-------------------------------------------------------------------------- Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-02-28 09:30:50 UTC (rev 11583) +++ trunk/src/plargs.c 2011-03-02 18:16:43 UTC (rev 11584) @@ -160,6 +160,7 @@ static int opt_cmap0( const char *, const char *, void * ); static int opt_cmap1( const char *, const char *, void * ); static int opt_locale( const char *, const char *, void * ); +static int opt_eofill( const char *, const char *, void * ); // Global variables @@ -637,6 +638,15 @@ "Use locale environment (e.g., LC_ALL, LC_NUMERIC, or LANG) to set LC_NUMERIC locale (which affects decimal point separator)." }, { + "eofill", + opt_eofill, + NULL, + NULL, + PL_OPT_FUNC, + "-eofill", + "For the case where the boundary of the filled region is self-intersecting, use the even-odd fill rule rather than the default nonzero fill rule." + }, + { "drvopt", // Driver specific options opt_drvopt, NULL, @@ -2458,3 +2468,17 @@ return 0; } +//-------------------------------------------------------------------------- +// opt_eofill() +// +// For the case where the boundary of the filled region is +// self-intersecting, use the even-odd fill rule rather than the +// default nonzero fill rule. +//-------------------------------------------------------------------------- + +static int +opt_eofill( const char *opt, const char *optarg, void *client_data ) +{ + plsc->dev_eofill = 1; + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-06 02:17:27
|
Revision: 11602 http://plplot.svn.sourceforge.net/plplot/?rev=11602&view=rev Author: airwin Date: 2011-03-06 02:17:21 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Finish plstring3 bindings for f95 and use that in example 18 to get consistency with the C result. Modified Paths: -------------- trunk/bindings/f95/sfstubs.f90 trunk/examples/f95/x18f.f90 Modified: trunk/bindings/f95/sfstubs.f90 =================================================================== --- trunk/bindings/f95/sfstubs.f90 2011-03-06 00:59:27 UTC (rev 11601) +++ trunk/bindings/f95/sfstubs.f90 2011-03-06 02:17:21 UTC (rev 11602) @@ -346,6 +346,26 @@ !*********************************************************************** + subroutine plstring3(x,y,z,string) + + implicit none + real(kind=plflt) x(:), y(:), z(:) + character(len=*) string + + include 'sfstubs.h' + + integer n + + n = size(x) + + call plstrf2c(string, string1, maxlen) + s1 = transfer( string1, s1 ) + call plstring37(n,x,y,z,s1) + + end subroutine + +!*********************************************************************** + subroutine plvectors_0(u, v, scale) implicit none Modified: trunk/examples/f95/x18f.f90 =================================================================== --- trunk/examples/f95/x18f.f90 2011-03-06 00:59:27 UTC (rev 11601) +++ trunk/examples/f95/x18f.f90 2011-03-06 02:17:21 UTC (rev 11602) @@ -87,7 +87,8 @@ if ( opt(k).gt. 0 ) then call plline3(x, y, z) else - call plpoin3(x, y, z, 1) + !U+22C5 DOT OPERATOR. + call plstring3( x, y, z, "⋅" ) endif call plcol0(3) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-06 05:33:39
|
Revision: 11606 http://plplot.svn.sourceforge.net/plplot/?rev=11606&view=rev Author: airwin Date: 2011-03-06 05:33:33 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Add Tcl example 33 to build system and test system. Modified Paths: -------------- trunk/examples/tcl/CMakeLists.txt trunk/plplot_test/test_tcl.sh.in Modified: trunk/examples/tcl/CMakeLists.txt =================================================================== --- trunk/examples/tcl/CMakeLists.txt 2011-03-06 05:31:40 UTC (rev 11605) +++ trunk/examples/tcl/CMakeLists.txt 2011-03-06 05:33:33 UTC (rev 11606) @@ -66,6 +66,7 @@ "29" "30" "31" +"33" ) set(tcl_SCRIPTS) Modified: trunk/plplot_test/test_tcl.sh.in =================================================================== --- trunk/plplot_test/test_tcl.sh.in 2011-03-06 05:31:40 UTC (rev 11605) +++ trunk/plplot_test/test_tcl.sh.in 2011-03-06 05:33:33 UTC (rev 11606) @@ -76,7 +76,7 @@ if [ -n "$is_error" ] ; then exit 1 fi -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do +for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-06 05:58:04
|
Revision: 11607 http://plplot.svn.sourceforge.net/plplot/?rev=11607&view=rev Author: airwin Date: 2011-03-06 05:57:57 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Finish plstring3 binding for Lua, and use that binding in example 18 to produce results that are consistent with those from its C counterpart. Modified Paths: -------------- trunk/bindings/lua/plplotluac.i trunk/examples/lua/x18.lua Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2011-03-06 05:33:33 UTC (rev 11606) +++ trunk/bindings/lua/plplotluac.i 2011-03-06 05:57:57 UTC (rev 11607) @@ -1152,6 +1152,7 @@ %rename(star) plstar; %rename(start) plstart; %rename(string) plstring; +%rename(string3) plstring3; %rename(stripa) plstripa; %rename(stripc) plstripc; %rename(stripd) plstripd; Modified: trunk/examples/lua/x18.lua =================================================================== --- trunk/examples/lua/x18.lua 2011-03-06 05:33:33 UTC (rev 11606) +++ trunk/examples/lua/x18.lua 2011-03-06 05:57:57 UTC (rev 11607) @@ -132,11 +132,12 @@ pl.col0(2) - if opt[k]~=0 then - pl.line3( x, y, z ) + if opt[k]~=0 then + pl.line3( x, y, z ) else - pl.poin3( x, y, z, 1 ) - end + -- U+22C5 DOT OPERATOR. + pl.string3( x, y, z, "⋅" ) + end pl.col0(3) pl.mtex("t", 1.0, 0.5, 0.5, "#frPLplot Example 18 - Alt=" .. alt[k] .. ", Az=" .. az[k]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-08 18:45:27
|
Revision: 11612 http://plplot.svn.sourceforge.net/plplot/?rev=11612&view=rev Author: airwin Date: 2011-03-08 18:45:21 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Implement plstring (to eventually be used in examples 4, 26, and 33) and plstring3 (used now in example 18 to make that D example consistent with the C one). Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/x18d.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2011-03-08 18:11:27 UTC (rev 11611) +++ trunk/bindings/d/plplot.d 2011-03-08 18:45:21 UTC (rev 11612) @@ -434,6 +434,23 @@ c_plpoin3( n, x.ptr, y.ptr, z.ptr, code ); } +/* Plots array y against x for n points using (UTF-8) text string*/ +void plstring( PLFLT[] x, PLFLT[] y, string text ) +{ + PLINT n = x.length; + assert( n == y.length, "plstring(): Arrays must be of same length!" ); + c_plstring( n, x.ptr, y.ptr, toStringz( text ) ); +} + +/* Draws a series of points (described by [UTF8] text string) in 3 space. */ +void plstring3( PLFLT[] x, PLFLT[] y, PLFLT[] z, string text ) +{ + PLINT n = x.length; + assert( n == y.length, "plstring3(): Arrays must be of same length!" ); + assert( n == z.length, "plstring3(): Arrays must be of same length!" ); + c_plstring3( n, x.ptr, y.ptr, z.ptr, toStringz( text ) ); +} + /* Draws a polygon in 3 space. */ void plpoly3( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLBOOL[] draw, PLBOOL ifcc ) { @@ -1380,6 +1397,8 @@ alias c_plstripa plstripa; //alias c_plstripc plstripc; alias c_plstripd plstripd; +//alias c_plstring plstring; +//alias c_plstring3 plstring3; //alias c_plstyl plstyl; //alias c_plsurf3d plsurf3d; //alias c_plsurf3dl plsurf3dl; @@ -1767,6 +1786,12 @@ /* Draws a polygon in 3 space. */ void c_plpoly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL ifcc ); +/* Plots array y against x for n points using (UTF-8) text string*/ +void c_plstring( PLINT n, PLFLT *x, PLFLT *y, char *text ); + +/* Draws a series of points (described by [UTF8] text string) in 3 space. */ +void c_plstring3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, char * text ); + /* Set the floating point precision (in number of places) in numeric labels. */ void c_plprec( PLINT setp, PLINT prec ); Modified: trunk/examples/d/x18d.d =================================================================== --- trunk/examples/d/x18d.d 2011-03-08 18:11:27 UTC (rev 11611) +++ trunk/examples/d/x18d.d 2011-03-08 18:45:21 UTC (rev 11612) @@ -63,9 +63,14 @@ plcol0( 2 ); if ( opt[k] ) + { plline3( x, y, z ); + } else - plpoin3( x, y, z, 1 ); + { + // U+22C5 DOT OPERATOR. + plstring3( x, y, z, "⋅" ); + } plcol0( 3 ); plmtex( "t", 1.0, 0.5, 0.5, format( "#frPLplot Example 18 - Alt=%.0f, Az=%.0f", alt[k], az[k] ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-11 04:59:47
|
Revision: 11618 http://plplot.svn.sourceforge.net/plplot/?rev=11618&view=rev Author: airwin Date: 2011-03-11 04:59:40 +0000 (Fri, 11 Mar 2011) Log Message: ----------- Use const modifier on all Matrix (other than **OutMatrixCk) variants and Array variants. Make java bindings and examples work with "const" changes. According to swig documentation const is ignored with searching for the correct typemap rule _except_ for composite typemaps which must include all modifiers to get a match. However, use const modifier for all (e.g., java in this commit) typemaps to improve clarity for what is matched. For java case correct jni, jtype, jstype, javain, and javaout typemaps to a consistent identifier for the (PLFLT *ArrayX, PLINT nx) and (const PLFLT *ArrayY, PLINT ny) composite typemaps. Also update typedef for fill_func to be consistent with const plfill arguments. The result of these changes is java now works again and generates results that are consistent with the C results. Therefore, enable java by default again. Modified Paths: -------------- trunk/bindings/java/plplotjavac.i trunk/bindings/swig-support/plplotcapi.i trunk/cmake/modules/java.cmake Modified: trunk/bindings/java/plplotjavac.i =================================================================== --- trunk/bindings/java/plplotjavac.i 2011-03-11 04:30:01 UTC (rev 11617) +++ trunk/bindings/java/plplotjavac.i 2011-03-11 04:59:40 UTC (rev 11618) @@ -335,7 +335,7 @@ **********************************************************************************/ /* with preceding count */ -%typemap(in) (PLINT n, PLINT *Array) { +%typemap(in) (PLINT n, const PLINT *Array) { jint *jxdata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); $1 = (*jenv)->GetArrayLength( jenv, $input); Alen = $1; @@ -345,19 +345,19 @@ * the java array can be released immediately. */ (*jenv)->ReleaseIntArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) (PLINT n, PLINT *Array) { +%typemap(freearg) (PLINT n, const PLINT *Array) { free($2); } -%typemap(jni) (PLINT n, PLINT *Array) "jintArray" -%typemap(jtype) (PLINT n, PLINT *Array) "int[]" -%typemap(jstype) (PLINT n, PLINT *Array) "int[]" -%typemap(javain) (PLINT n, PLINT *Array) "$javainput" -%typemap(javaout) (PLINT n, PLINT *Array) { +%typemap(jni) (PLINT n, const PLINT *Array) "jintArray" +%typemap(jtype) (PLINT n, const PLINT *Array) "int[]" +%typemap(jstype) (PLINT n, const PLINT *Array) "int[]" +%typemap(javain) (PLINT n, const PLINT *Array) "$javainput" +%typemap(javaout) (PLINT n, const PLINT *Array) { return $jnicall; } /* Trailing count and check consistency with previous*/ -%typemap(in) (PLINT *ArrayCk, PLINT n) { +%typemap(in) (const PLINT *ArrayCk, PLINT n) { jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { printf("Vectors must be same length.\n"); @@ -367,19 +367,19 @@ setup_array_1d_i( &$1, jydata, Alen); (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) (PLINT *ArrayCk, PLINT n) { +%typemap(freearg) (const PLINT *ArrayCk, PLINT n) { free($1); } -%typemap(jni) (PLINT *ArrayCk, PLINT n) "jintArray" -%typemap(jtype) (PLINT *ArrayCk, PLINT n) "int[]" -%typemap(jstype) (PLINT *ArrayCk, PLINT n) "int[]" -%typemap(javain) (PLINT *ArrayCk, PLINT n) "$javainput" -%typemap(javaout) (PLINT *ArrayCk, PLINT n) { +%typemap(jni) (const PLINT *ArrayCk, PLINT n) "jintArray" +%typemap(jtype) (const PLINT *ArrayCk, PLINT n) "int[]" +%typemap(jstype) (const PLINT *ArrayCk, PLINT n) "int[]" +%typemap(javain) (const PLINT *ArrayCk, PLINT n) "$javainput" +%typemap(javaout) (const PLINT *ArrayCk, PLINT n) { return $jnicall; } /* no count but check consistency with previous */ -%typemap(in) PLINT *ArrayCk { +%typemap(in) const PLINT *ArrayCk { jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { printf("Vectors must be same length.\n"); @@ -388,19 +388,19 @@ setup_array_1d_i( &$1, jydata, Alen); (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) PLINT *ArrayCk { +%typemap(freearg) const PLINT *ArrayCk { free($1); } -%typemap(jni) PLINT *ArrayCk "jintArray" -%typemap(jtype) PLINT *ArrayCk "int[]" -%typemap(jstype) PLINT *ArrayCk "int[]" -%typemap(javain) PLINT *ArrayCk "$javainput" -%typemap(javaout) PLINT *ArrayCk { +%typemap(jni) const PLINT *ArrayCk "jintArray" +%typemap(jtype) const PLINT *ArrayCk "int[]" +%typemap(jstype) const PLINT *ArrayCk "int[]" +%typemap(javain) const PLINT *ArrayCk "$javainput" +%typemap(javaout) const PLINT *ArrayCk { return $jnicall; } /* no count but check consistency with previous or is null */ -%typemap(in) PLINT *ArrayCkNull { +%typemap(in) const PLINT *ArrayCkNull { if ( $input != NULL ) { jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { @@ -414,15 +414,15 @@ $1 == NULL; } } -%typemap(freearg) PLINT *ArrayCkNull { +%typemap(freearg) const PLINT *ArrayCkNull { if ($1 != NULL) free($1); } -%typemap(jni) PLINT *ArrayCkNull "jintArray" -%typemap(jtype) PLINT *ArrayCkNull "int[]" -%typemap(jstype) PLINT *ArrayCkNull "int[]" -%typemap(javain) PLINT *ArrayCkNull "$javainput" -%typemap(javaout) PLINT *ArrayCkNull { +%typemap(jni) const PLINT *ArrayCkNull "jintArray" +%typemap(jtype) const PLINT *ArrayCkNull "int[]" +%typemap(jstype) const PLINT *ArrayCkNull "int[]" +%typemap(javain) const PLINT *ArrayCkNull "$javainput" +%typemap(javaout) const PLINT *ArrayCkNull { return $jnicall; } @@ -432,7 +432,7 @@ * typedef PLINT PLBOOL;) * Also add version which must be one shorter than others or null. */ -%typemap(in) PLBOOL *ArrayCkMinus1 { +%typemap(in) const PLBOOL *ArrayCkMinus1 { jboolean *jydata = (*jenv)->GetBooleanArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) < Alen-1) { printf("Vector must be at least length of others minus 1.\n"); @@ -441,18 +441,18 @@ setup_array_1d_b( &$1, jydata, Alen); (*jenv)->ReleaseBooleanArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) PLBOOL *ArrayCkMinus1 { +%typemap(freearg) const PLBOOL *ArrayCkMinus1 { free($1); } -%typemap(jni) PLBOOL *ArrayCkMinus1 "jbooleanArray" -%typemap(jtype) PLBOOL *ArrayCkMinus1 "boolean[]" -%typemap(jstype) PLBOOL *ArrayCkMinus1 "boolean[]" -%typemap(javain) PLBOOL *ArrayCkMinus1 "$javainput" -%typemap(javaout) PLBOOL *ArrayCkMinus1 { +%typemap(jni) const PLBOOL *ArrayCkMinus1 "jbooleanArray" +%typemap(jtype) const PLBOOL *ArrayCkMinus1 "boolean[]" +%typemap(jstype) const PLBOOL *ArrayCkMinus1 "boolean[]" +%typemap(javain) const PLBOOL *ArrayCkMinus1 "$javainput" +%typemap(javaout) const PLBOOL *ArrayCkMinus1 { return $jnicall; } -%typemap(in) PLBOOL *ArrayCkMinus1Null { +%typemap(in) const PLBOOL *ArrayCkMinus1Null { if ($input != NULL) { jboolean *jydata = (*jenv)->GetBooleanArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) < Alen-1) { @@ -466,19 +466,19 @@ $1 = NULL; } } -%typemap(freearg) PLBOOL *ArrayCkMinus1Null { +%typemap(freearg) const PLBOOL *ArrayCkMinus1Null { if ($1 != NULL) free($1); } -%typemap(jni) PLBOOL *ArrayCkMinus1Null "jbooleanArray" -%typemap(jtype) PLBOOL *ArrayCkMinus1Null "boolean[]" -%typemap(jstype) PLBOOL *ArrayCkMinus1Null "boolean[]" -%typemap(javain) PLBOOL *ArrayCkMinus1Null "$javainput" -%typemap(javaout) PLBOOL *ArrayCkMinus1Null { +%typemap(jni) const PLBOOL *ArrayCkMinus1Null "jbooleanArray" +%typemap(jtype) const PLBOOL *ArrayCkMinus1Null "boolean[]" +%typemap(jstype) const PLBOOL *ArrayCkMinus1Null "boolean[]" +%typemap(javain) const PLBOOL *ArrayCkMinus1Null "$javainput" +%typemap(javaout) const PLBOOL *ArrayCkMinus1Null { return $jnicall; } -%typemap(in) PLINT *ArrayCkMinus1 { +%typemap(in) const PLINT *ArrayCkMinus1 { jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) < Alen-1) { printf("Vector must be at least length of others minus 1.\n"); @@ -487,18 +487,18 @@ setup_array_1d_i( &$1, jydata, Alen); (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) PLINT *ArrayCkMinus1 { +%typemap(freearg) const PLINT *ArrayCkMinus1 { free($1); } -%typemap(jni) PLINT *ArrayCkMinus1 "jintArray" -%typemap(jtype) PLINT *ArrayCkMinus1 "int[]" -%typemap(jstype) PLINT *ArrayCkMinus1 "int[]" -%typemap(javain) PLINT *ArrayCkMinus1 "$javainput" -%typemap(javaout) PLINT *ArrayCkMinus1 { +%typemap(jni) const PLINT *ArrayCkMinus1 "jintArray" +%typemap(jtype) const PLINT *ArrayCkMinus1 "int[]" +%typemap(jstype) const PLINT *ArrayCkMinus1 "int[]" +%typemap(javain) const PLINT *ArrayCkMinus1 "$javainput" +%typemap(javaout) const PLINT *ArrayCkMinus1 { return $jnicall; } -%typemap(in) PLINT *ArrayCkMinus1Null { +%typemap(in) const PLINT *ArrayCkMinus1Null { if ($input != NULL) { jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) < Alen-1) { @@ -512,33 +512,33 @@ $1 = NULL; } } -%typemap(freearg) PLINT *ArrayCkMinus1Null { +%typemap(freearg) const PLINT *ArrayCkMinus1Null { if ($1 != NULL) free($1); } -%typemap(jni) PLINT *ArrayCkMinus1Null "jintArray" -%typemap(jtype) PLINT *ArrayCkMinus1Null "int[]" -%typemap(jstype) PLINT *ArrayCkMinus1Null "int[]" -%typemap(javain) PLINT *ArrayCkMinus1Null "$javainput" -%typemap(javaout) PLINT *ArrayCkMinus1Null { +%typemap(jni) const PLINT *ArrayCkMinus1Null "jintArray" +%typemap(jtype) const PLINT *ArrayCkMinus1Null "int[]" +%typemap(jstype) const PLINT *ArrayCkMinus1Null "int[]" +%typemap(javain) const PLINT *ArrayCkMinus1Null "$javainput" +%typemap(javaout) const PLINT *ArrayCkMinus1Null { return $jnicall; } /* No length but remember size to check others */ -%typemap(in) PLINT *Array { +%typemap(in) const PLINT *Array { jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); Alen = (*jenv)->GetArrayLength( jenv, $input); setup_array_1d_i( &$1, jydata, Alen); (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) PLINT *Array { +%typemap(freearg) const PLINT *Array { free($1); } -%typemap(jni) PLINT *Array "jintArray" -%typemap(jtype) PLINT *Array "int[]" -%typemap(jstype) PLINT *Array "int[]" -%typemap(javain) PLINT *Array "$javainput" -%typemap(javaout) PLINT *Array { +%typemap(jni) const PLINT *Array "jintArray" +%typemap(jtype) const PLINT *Array "int[]" +%typemap(jstype) const PLINT *Array "int[]" +%typemap(javain) const PLINT *Array "$javainput" +%typemap(javaout) const PLINT *Array { return $jnicall; } @@ -574,7 +574,7 @@ /* temporary*/ #endif /* with preceding count */ -%typemap(in) (PLINT n, PLFLT *Array) { +%typemap(in) (PLINT n, const PLFLT *Array) { jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); $1 = (*jenv)->GetArrayLength( jenv, $input); Alen = $1; @@ -584,19 +584,19 @@ * the java array can be released immediately. */ (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) (PLINT n, PLFLT *Array) { +%typemap(freearg) (PLINT n, const PLFLT *Array) { free($2); } -%typemap(jni) (PLINT n, PLFLT *Array) jPLFLTArray -%typemap(jtype) (PLINT n, PLFLT *Array) jPLFLTbracket -%typemap(jstype) (PLINT n, PLFLT *Array) jPLFLTbracket -%typemap(javain) (PLINT n, PLFLT *Array) "$javainput" -%typemap(javaout) (PLINT n, PLFLT *Array) { +%typemap(jni) (PLINT n, const PLFLT *Array) jPLFLTArray +%typemap(jtype) (PLINT n, const PLFLT *Array) jPLFLTbracket +%typemap(jstype) (PLINT n, const PLFLT *Array) jPLFLTbracket +%typemap(javain) (PLINT n, const PLFLT *Array) "$javainput" +%typemap(javaout) (PLINT n, const PLFLT *Array) { return $jnicall; } /* trailing count, and check consistency with previous */ -%typemap(in) (PLFLT *ArrayCk, PLINT n) { +%typemap(in) (const PLFLT *ArrayCk, PLINT n) { jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); $2 = (*jenv)->GetArrayLength( jenv, $input ); if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { @@ -606,19 +606,19 @@ setup_array_1d_PLFLT( &$1, jydata, Alen ); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) (PLFLT *ArrayCk, PLINT n) { +%typemap(freearg) (const PLFLT *ArrayCk, PLINT n) { free($1); } -%typemap(jni) (PLFLT *ArrayCk, PLINT n) jPLFLTArray -%typemap(jtype) (PLFLT *ArrayCk, PLINT n) jPLFLTbracket -%typemap(jstype) (PLFLT *ArrayCk, PLINT n) jPLFLTbracket -%typemap(javain) (PLFLT *ArrayCk, PLINT n) "$javainput" -%typemap(javaout) (PLFLT *ArrayCk, PLINT n){ +%typemap(jni) (const PLFLT *ArrayCk, PLINT n) jPLFLTArray +%typemap(jtype) (const PLFLT *ArrayCk, PLINT n) jPLFLTbracket +%typemap(jstype) (const PLFLT *ArrayCk, PLINT n) jPLFLTbracket +%typemap(javain) (const PLFLT *ArrayCk, PLINT n) "$javainput" +%typemap(javaout) (const PLFLT *ArrayCk, PLINT n){ return $jnicall; } /* no count, but check consistency with previous */ -%typemap(in) PLFLT *ArrayCk { +%typemap(in) const PLFLT *ArrayCk { jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { printf("Vectors must be same length.\n"); @@ -627,19 +627,19 @@ setup_array_1d_PLFLT( &$1, jydata, Alen ); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) PLFLT *ArrayCk { +%typemap(freearg) const PLFLT *ArrayCk { free($1); } -%typemap(jni) PLFLT *ArrayCk jPLFLTArray -%typemap(jtype) PLFLT *ArrayCk jPLFLTbracket -%typemap(jstype) PLFLT *ArrayCk jPLFLTbracket -%typemap(javain) PLFLT *ArrayCk "$javainput" -%typemap(javaout) PLFLT *ArrayCk{ +%typemap(jni) const PLFLT *ArrayCk jPLFLTArray +%typemap(jtype) const PLFLT *ArrayCk jPLFLTbracket +%typemap(jstype) const PLFLT *ArrayCk jPLFLTbracket +%typemap(javain) const PLFLT *ArrayCk "$javainput" +%typemap(javaout) const PLFLT *ArrayCk{ return $jnicall; } /* no count, but check consistency with previous or NULL */ -%typemap(in) PLFLT *ArrayCkNull { +%typemap(in) const PLFLT *ArrayCkNull { if ( $input != NULL ) { jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { @@ -653,128 +653,128 @@ $1 = NULL; } } -%typemap(freearg) PLFLT *ArrayCkNull { +%typemap(freearg) const PLFLT *ArrayCkNull { if ($1 != NULL) free($1); } -%typemap(jni) PLFLT *ArrayCkNull jPLFLTArray -%typemap(jtype) PLFLT *ArrayCkNull jPLFLTbracket -%typemap(jstype) PLFLT *ArrayCkNull jPLFLTbracket -%typemap(javain) PLFLT *ArrayCkNull "$javainput" -%typemap(javaout) PLFLT *ArrayCkNull{ +%typemap(jni) const PLFLT *ArrayCkNull jPLFLTArray +%typemap(jtype) const PLFLT *ArrayCkNull jPLFLTbracket +%typemap(jstype) const PLFLT *ArrayCkNull jPLFLTbracket +%typemap(javain) const PLFLT *ArrayCkNull "$javainput" +%typemap(javaout) const PLFLT *ArrayCkNull{ return $jnicall; } /* set X length for later consistency checking */ -%typemap(in) (PLFLT *ArrayX, PLINT nx) { +%typemap(in) (const PLFLT *ArrayX, PLINT nx) { jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); Xlen = (*jenv)->GetArrayLength( jenv, $input); $2 = Xlen; setup_array_1d_PLFLT( &$1, jxdata, Xlen); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) (PLFLT *ArrayX, PLINT nx) { +%typemap(freearg) (const PLFLT *ArrayX, PLINT nx) { free($1); } -%typemap(jni) PLFLT *ArrayX jPLFLTArray -%typemap(jtype) PLFLT *ArrayX jPLFLTbracket -%typemap(jstype) PLFLT *ArrayX jPLFLTbracket -%typemap(javain) PLFLT *ArrayX "$javainput" -%typemap(javaout) PLFLT *ArrayX { +%typemap(jni) (const PLFLT *ArrayX, PLINT nx) jPLFLTArray +%typemap(jtype) (const PLFLT *ArrayX, PLINT nx) jPLFLTbracket +%typemap(jstype) (const PLFLT *ArrayX, PLINT nx) jPLFLTbracket +%typemap(javain) (const PLFLT *ArrayX, PLINT nx) "$javainput" +%typemap(javaout) (const PLFLT *ArrayX, PLINT nx) { return $jnicall; } -%typemap(in) PLFLT *ArrayX { +%typemap(in) const PLFLT *ArrayX { jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); Xlen = (*jenv)->GetArrayLength( jenv, $input); setup_array_1d_PLFLT( &$1, jxdata, Xlen); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) PLFLT *ArrayX { +%typemap(freearg) const PLFLT *ArrayX { free($1); } -%typemap(jni) PLFLT *ArrayX jPLFLTArray -%typemap(jtype) PLFLT *ArrayX jPLFLTbracket -%typemap(jstype) PLFLT *ArrayX jPLFLTbracket -%typemap(javain) PLFLT *ArrayX "$javainput" -%typemap(javaout) PLFLT *ArrayX { +%typemap(jni) const PLFLT *ArrayX jPLFLTArray +%typemap(jtype) const PLFLT *ArrayX jPLFLTbracket +%typemap(jstype) const PLFLT *ArrayX jPLFLTbracket +%typemap(javain) const PLFLT *ArrayX "$javainput" +%typemap(javaout) const PLFLT *ArrayX { return $jnicall; } /* set Y length for later consistency checking */ -%typemap(in) (PLFLT *ArrayY, PLINT ny) { +%typemap(in) (const PLFLT *ArrayY, PLINT ny) { jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); Ylen = (*jenv)->GetArrayLength( jenv, $input); $2 = Ylen; setup_array_1d_PLFLT( &$1, jydata, Ylen); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) (PLFLT *ArrayY, PLINT ny) { +%typemap(freearg) (const PLFLT *ArrayY, PLINT ny) { free($1); } -%typemap(jni) PLFLT *ArrayY jPLFLTArray -%typemap(jtype) PLFLT *ArrayY jPLFLTbracket -%typemap(jstype) PLFLT *ArrayY jPLFLTbracket -%typemap(javain) PLFLT *ArrayY "$javainput" -%typemap(javaout) PLFLT *ArrayY { +%typemap(jni) (const PLFLT *ArrayY, PLINT ny) jPLFLTArray +%typemap(jtype) (const PLFLT *ArrayY, PLINT ny) jPLFLTbracket +%typemap(jstype) (const PLFLT *ArrayY, PLINT ny) jPLFLTbracket +%typemap(javain) (const PLFLT *ArrayY, PLINT ny) "$javainput" +%typemap(javaout) (const PLFLT *ArrayY, PLINT ny) { return $jnicall; } -%typemap(in) PLFLT *ArrayY { +%typemap(in) const PLFLT *ArrayY { jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); Ylen = (*jenv)->GetArrayLength( jenv, $input); setup_array_1d_PLFLT( &$1, jydata, Ylen); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) PLFLT *ArrayY { +%typemap(freearg) const PLFLT *ArrayY { free($1); } -%typemap(jni) PLFLT *ArrayY jPLFLTArray -%typemap(jtype) PLFLT *ArrayY jPLFLTbracket -%typemap(jstype) PLFLT *ArrayY jPLFLTbracket -%typemap(javain) PLFLT *ArrayY "$javainput" -%typemap(javaout) PLFLT *ArrayY { +%typemap(jni) const PLFLT *ArrayY jPLFLTArray +%typemap(jtype) const PLFLT *ArrayY jPLFLTbracket +%typemap(jstype) const PLFLT *ArrayY jPLFLTbracket +%typemap(javain) const PLFLT *ArrayY "$javainput" +%typemap(javaout) const PLFLT *ArrayY { return $jnicall; } /* with trailing count */ -%typemap(in) (PLFLT *Array, PLINT n) { +%typemap(in) (const PLFLT *Array, PLINT n) { jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); $2 = (*jenv)->GetArrayLength( jenv, $input ); setup_array_1d_PLFLT( &$1, jxdata, $2); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) (PLFLT *Array, PLINT n) { +%typemap(freearg) (const PLFLT *Array, PLINT n) { free($1); } -%typemap(jni) (PLFLT *Array, PLINT n) jPLFLTArray -%typemap(jtype) (PLFLT *Array, PLINT n) jPLFLTbracket -%typemap(jstype) (PLFLT *Array, PLINT n) jPLFLTbracket -%typemap(javain) (PLFLT *Array, PLINT n) "$javainput" -%typemap(javaout) (PLFLT *Array, PLINT n) { +%typemap(jni) (const PLFLT *Array, PLINT n) jPLFLTArray +%typemap(jtype) (const PLFLT *Array, PLINT n) jPLFLTbracket +%typemap(jstype) (const PLFLT *Array, PLINT n) jPLFLTbracket +%typemap(javain) (const PLFLT *Array, PLINT n) "$javainput" +%typemap(javaout) (const PLFLT *Array, PLINT n) { return $jnicall; } /* with no trailing count */ -%typemap(in) PLFLT *Array { +%typemap(in) const PLFLT *Array { jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); Alen = (*jenv)->GetArrayLength( jenv, $input ); setup_array_1d_PLFLT( &$1, jxdata, Alen); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) PLFLT *Array { +%typemap(freearg) const PLFLT *Array { free($1); } -%typemap(jni) PLFLT *Array jPLFLTArray -%typemap(jtype) PLFLT *Array jPLFLTbracket -%typemap(jstype) PLFLT *Array jPLFLTbracket -%typemap(javain) PLFLT *Array "$javainput" -%typemap(javaout) PLFLT *Array { +%typemap(jni) const PLFLT *Array jPLFLTArray +%typemap(jtype) const PLFLT *Array jPLFLTbracket +%typemap(jstype) const PLFLT *Array jPLFLTbracket +%typemap(javain) const PLFLT *Array "$javainput" +%typemap(javaout) const PLFLT *Array { return $jnicall; } /* check consistency with X dimension of previous */ -%typemap(in) PLFLT *ArrayCkX { +%typemap(in) const PLFLT *ArrayCkX { jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) != Xlen) { printf("Vectors must be same length.\n"); @@ -783,19 +783,19 @@ setup_array_1d_PLFLT( &$1, jxdata, Xlen ); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) PLFLT *ArrayCkX { +%typemap(freearg) const PLFLT *ArrayCkX { free($1); } -%typemap(jni) PLFLT *ArrayCkX jPLFLTArray -%typemap(jtype) PLFLT *ArrayCkX jPLFLTbracket -%typemap(jstype) PLFLT *ArrayCkX jPLFLTbracket -%typemap(javain) PLFLT *ArrayCkX "$javainput" -%typemap(javaout) PLFLT *ArrayCkX{ +%typemap(jni) const PLFLT *ArrayCkX jPLFLTArray +%typemap(jtype) const PLFLT *ArrayCkX jPLFLTbracket +%typemap(jstype) const PLFLT *ArrayCkX jPLFLTbracket +%typemap(javain) const PLFLT *ArrayCkX "$javainput" +%typemap(javaout) const PLFLT *ArrayCkX{ return $jnicall; } /* check consistency with Y dimension of previous */ -%typemap(in) PLFLT *ArrayCkY { +%typemap(in) const PLFLT *ArrayCkY { jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); if((*jenv)->GetArrayLength( jenv, $input ) != Ylen) { printf("Vectors must be same length.\n"); @@ -804,19 +804,19 @@ setup_array_1d_PLFLT( &$1, jydata, Ylen ); (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) PLFLT *ArrayCkY { +%typemap(freearg) const PLFLT *ArrayCkY { free($1); } -%typemap(jni) PLFLT *ArrayCkY jPLFLTArray -%typemap(jtype) PLFLT *ArrayCkY jPLFLTbracket -%typemap(jstype) PLFLT *ArrayCkY jPLFLTbracket -%typemap(javain) PLFLT *ArrayCkY "$javainput" -%typemap(javaout) PLFLT *ArrayCkY{ +%typemap(jni) const PLFLT *ArrayCkY jPLFLTArray +%typemap(jtype) const PLFLT *ArrayCkY jPLFLTbracket +%typemap(jstype) const PLFLT *ArrayCkY jPLFLTbracket +%typemap(javain) const PLFLT *ArrayCkY "$javainput" +%typemap(javaout) const PLFLT *ArrayCkY{ return $jnicall; } /* 2D array with trailing dimensions, check consistency with previous */ -%typemap(in) (PLFLT **MatrixCk, PLINT nx, PLINT ny) { +%typemap(in) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) { jPLFLT **adat; jobject *ai; int nx = (*jenv)->GetArrayLength( jenv, $input ); @@ -865,20 +865,20 @@ free(ai); } -%typemap(freearg) (PLFLT **MatrixCk, PLINT nx, PLINT ny) { +%typemap(freearg) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) { free($1[0]); free($1); } -%typemap(jni) (PLFLT **MatrixCk, PLINT nx, PLINT ny) "jobjectArray" -%typemap(jtype) (PLFLT **MatrixCk, PLINT nx, PLINT ny) jPLFLTbracket2 -%typemap(jstype) (PLFLT **MatrixCk, PLINT nx, PLINT ny) jPLFLTbracket2 -%typemap(javain) (PLFLT **MatrixCk, PLINT nx, PLINT ny) "$javainput" -%typemap(javaout) (PLFLT **MatrixCk, PLINT nx, PLINT ny) { +%typemap(jni) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) "jobjectArray" +%typemap(jtype) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) jPLFLTbracket2 +%typemap(jstype) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) jPLFLTbracket2 +%typemap(javain) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) "$javainput" +%typemap(javaout) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) { return $jnicall; } /* 2D array with trailing dimensions, set the X, Y size for later checking */ -%typemap(in) (PLFLT **Matrix, PLINT nx, PLINT ny) { +%typemap(in) (const PLFLT **Matrix, PLINT nx, PLINT ny) { jPLFLT **adat; jobject *ai; int nx = (*jenv)->GetArrayLength( jenv, $input ); @@ -920,20 +920,20 @@ free(ai); } -%typemap(freearg) (PLFLT **Matrix, PLINT nx, PLINT ny) { +%typemap(freearg) (const PLFLT **Matrix, PLINT nx, PLINT ny) { free($1[0]); free($1); } -%typemap(jni) (PLFLT **Matrix, PLINT nx, PLINT ny) "jobjectArray" -%typemap(jtype) (PLFLT **Matrix, PLINT nx, PLINT ny) jPLFLTbracket2 -%typemap(jstype) (PLFLT **Matrix, PLINT nx, PLINT ny) jPLFLTbracket2 -%typemap(javain) (PLFLT **Matrix, PLINT nx, PLINT ny) "$javainput" -%typemap(javaout) (PLFLT **Matrix, PLINT nx, PLINT ny) { +%typemap(jni) (const PLFLT **Matrix, PLINT nx, PLINT ny) "jobjectArray" +%typemap(jtype) (const PLFLT **Matrix, PLINT nx, PLINT ny) jPLFLTbracket2 +%typemap(jstype) (const PLFLT **Matrix, PLINT nx, PLINT ny) jPLFLTbracket2 +%typemap(javain) (const PLFLT **Matrix, PLINT nx, PLINT ny) "$javainput" +%typemap(javaout) (const PLFLT **Matrix, PLINT nx, PLINT ny) { return $jnicall; } /* 2D array with no trailing dimensions, set the X, Y size for later checking */ -%typemap(in) PLFLT **Matrix { +%typemap(in) const PLFLT **Matrix { jPLFLT **adat; jobject *ai; int nx = (*jenv)->GetArrayLength( jenv, $input ); @@ -973,20 +973,20 @@ free(ai); } -%typemap(freearg) PLFLT **Matrix { +%typemap(freearg) const PLFLT **Matrix { free($1[0]); free($1); } -%typemap(jni) PLFLT **Matrix "jobjectArray" -%typemap(jtype) PLFLT **Matrix jPLFLTbracket2 -%typemap(jstype) PLFLT **Matrix jPLFLTbracket2 -%typemap(javain) PLFLT **Matrix "$javainput" -%typemap(javaout) PLFLT **Matrix { +%typemap(jni) const PLFLT **Matrix "jobjectArray" +%typemap(jtype) const PLFLT **Matrix jPLFLTbracket2 +%typemap(jstype) const PLFLT **Matrix jPLFLTbracket2 +%typemap(javain) const PLFLT **Matrix "$javainput" +%typemap(javaout) const PLFLT **Matrix { return $jnicall; } /* 2D array, check for consistency */ -%typemap(in) PLFLT **MatrixCk { +%typemap(in) const PLFLT **MatrixCk { jPLFLT **adat; jobject *ai; int nx = (*jenv)->GetArrayLength( jenv, $input ); @@ -1032,15 +1032,15 @@ free(ai); } -%typemap(freearg) PLFLT **MatrixCk { +%typemap(freearg) const PLFLT **MatrixCk { free($1[0]); free($1); } -%typemap(jni) PLFLT **MatrixCk "jobjectArray" -%typemap(jtype) PLFLT **MatrixCk jPLFLTbracket2 -%typemap(jstype) PLFLT **MatrixCk jPLFLTbracket2 -%typemap(javain) PLFLT **MatrixCk "$javainput" -%typemap(javaout) PLFLT **MatrixCk { +%typemap(jni) const PLFLT **MatrixCk "jobjectArray" +%typemap(jtype) const PLFLT **MatrixCk jPLFLTbracket2 +%typemap(jstype) const PLFLT **MatrixCk jPLFLTbracket2 +%typemap(javain) const PLFLT **MatrixCk "$javainput" +%typemap(javaout) const PLFLT **MatrixCk { return $jnicall; } @@ -1133,7 +1133,7 @@ %{ typedef PLINT (*defined_func)(PLFLT, PLFLT); - typedef void (*fill_func)(PLINT, PLFLT*, PLFLT*); + typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*ct_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT *, PLFLT*); @@ -1775,14 +1775,7 @@ free($1); } -%typemap(jni) (char **ArrayCk) "jobjectArray" -%typemap(jtype) (char **ArrayCk) "String[]" -%typemap(jstype) (char **ArrayCk) "String[]" -%typemap(javain) (char **ArrayCk) "$javainput" -%typemap(javaout) (char **ArrayCk) { - return $jnicall; -} -%typemap(in) (char **ArrayCk) { +%typemap(in) (const char **ArrayCk) { int i = 0; if ($input != NULL) { int size = (*jenv)->GetArrayLength(jenv, $input); @@ -1807,7 +1800,7 @@ } /* This cleans up the memory we malloc'd before the function call */ -%typemap(freearg) (char **ArrayCk) { +%typemap(freearg) (const char **ArrayCk) { int i; if ($1 != NULL) { for (i=0; i<Alen; i++) @@ -1815,6 +1808,13 @@ free($1); } } +%typemap(jni) (const char **ArrayCk) "jobjectArray" +%typemap(jtype) (const char **ArrayCk) "String[]" +%typemap(jstype) (const char **ArrayCk) "String[]" +%typemap(javain) (const char **ArrayCk) "$javainput" +%typemap(javaout) (const char **ArrayCk) { + return $jnicall; +} #if 0 %typemap(in) PLGraphicsIn *gin (PLGraphicsIn tmp) { Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-03-11 04:30:01 UTC (rev 11617) +++ trunk/bindings/swig-support/plplotcapi.i 2011-03-11 04:59:40 UTC (rev 11618) @@ -251,7 +251,7 @@ // python API. void -plarrows( PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLFLT *ArrayCk, PLINT n, +plarrows( const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk, const PLFLT *ArrayCk, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy ); #endif @@ -281,7 +281,7 @@ const char *yopt, PLFLT ytick, PLINT nysub ); void -plbin( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLINT center ); +plbin( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, PLINT center ); void plbtime( PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLFLT *OUTPUT, PLFLT ctime ); @@ -314,8 +314,8 @@ plconfigtime( PLFLT scale, PLFLT offset1, PLFLT offset2, PLINT ccontrol, PLBOOL ifbtime_offset, PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec ); void -plcont( PLFLT **Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, - PLINT ky, PLINT ly, PLFLT *Array, PLINT n, +plcont( const PLFLT **Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, + PLINT ky, PLINT ly, const PLFLT *Array, PLINT n, pltr_func pltr, PLPointer SWIG_OBJECT_DATA ); @@ -344,22 +344,22 @@ pleop( void ); void -plerrx( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk ); +plerrx( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk ); void -plerry( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk ); +plerry( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk ); void plfamadv( void ); void -plfill( PLINT n, PLFLT *Array, PLFLT *ArrayCk ); +plfill( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk ); void -plfill3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk ); +plfill3( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk ); void -plgradient( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT angle ); +plgradient( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, PLFLT angle ); void plflush( void ); @@ -423,8 +423,8 @@ plgra( void ); void -plgriddata( PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLINT n, - PLFLT *ArrayX, PLINT nx, PLFLT *ArrayY, PLINT ny, +plgriddata( const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk, PLINT n, + const PLFLT *ArrayX, PLINT nx, const PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk, PLINT type, PLFLT data ); @@ -453,7 +453,7 @@ plgzax( PLINT *OUTPUT, PLINT *OUTPUT ); void -plhist( PLINT n, PLFLT *Array, PLFLT datmin, PLFLT datmax, +plhist( PLINT n, const PLFLT *Array, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT oldwin ); #if 0 @@ -497,28 +497,28 @@ plcolorbar( PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLFLT ticks, PLFLT sub_ticks, const char *axis_opts, const char *label, - PLINT n, PLFLT *Array, PLFLT *ArrayCk ); + PLINT n, const PLFLT *Array, const PLFLT *ArrayCk ); #endif void pllightsource( PLFLT x, PLFLT y, PLFLT z ); void -plline( PLINT n, PLFLT *Array, PLFLT *ArrayCk ); +plline( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk ); void -plline3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk ); +plline3( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk ); void pllsty( PLINT lin ); void -plmesh( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, +plmesh( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT **MatrixCk, PLINT nx, PLINT ny, PLINT opt ); void -plmeshc( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, - PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); +plmeshc( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT **MatrixCk, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n ); void plmkstrm( PLINT *OUTPUT ); @@ -532,41 +532,41 @@ const char *text ); void -plot3d( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, +plot3d( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT **MatrixCk, PLINT nx, PLINT ny, PLINT opt, PLBOOL side ); void -plot3dc( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, - PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); +plot3dc( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT **MatrixCk, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n ); void -plot3dcl( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, - PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n, - PLINT ixstart, PLINT n, PLINT *Array, PLINT *ArrayCk ); +plot3dcl( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT **MatrixCk, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n, + PLINT ixstart, PLINT n, const PLINT *Array, const PLINT *ArrayCk ); void -plsurf3d( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, - PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); +plsurf3d( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT **MatrixCk, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n ); void -plsurf3dl( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, - PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n, - PLINT ixstart, PLINT n, PLINT *Array, PLINT *ArrayCk ); +plsurf3dl( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT **MatrixCk, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n, + PLINT ixstart, PLINT n, const PLINT *Array, const PLINT *ArrayCk ); PLINT plparseopts( int *p_argc, const char **argv, PLINT mode ); void -plpat( PLINT n, PLINT *Array, PLINT *ArrayCk ); +plpat( PLINT n, const PLINT *Array, const PLINT *ArrayCk ); void -plpoin( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLINT code ); +plpoin( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, PLINT code ); void -plpoin3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLINT code ); +plpoin3( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk, PLINT code ); void -plpoly3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLBOOL *ArrayCkMinus1, +plpoly3( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk, const PLBOOL *ArrayCkMinus1, PLBOOL flag ); void @@ -594,29 +594,29 @@ plschr( PLFLT def, PLFLT scale ); void -plscmap0( PLINT *Array, PLINT *ArrayCk, PLINT *ArrayCk, PLINT n ); +plscmap0( const PLINT *Array, const PLINT *ArrayCk, const PLINT *ArrayCk, PLINT n ); void -plscmap0a( PLINT *Array, PLINT *ArrayCk, PLINT *ArrayCk, PLFLT *ArrayCk, PLINT n ); +plscmap0a( const PLINT *Array, const PLINT *ArrayCk, const PLINT *ArrayCk, const PLFLT *ArrayCk, PLINT n ); void plscmap0n( PLINT ncol0 ); void -plscmap1( PLINT *Array, PLINT *ArrayCk, PLINT *ArrayCk, PLINT n ); +plscmap1( const PLINT *Array, const PLINT *ArrayCk, const PLINT *ArrayCk, PLINT n ); void -plscmap1a( PLINT *Array, PLINT *ArrayCk, PLINT *ArrayCk, PLFLT *ArrayCk, PLINT n ); +plscmap1a( const PLINT *Array, const PLINT *ArrayCk, const PLINT *ArrayCk, const PLFLT *ArrayCk, PLINT n ); void -plscmap1l( PLBOOL itype, PLINT n, PLFLT *Array, - PLFLT *ArrayCk, PLFLT *ArrayCk, PLFLT *ArrayCk, - PLBOOL *ArrayCkMinus1Null ); +plscmap1l( PLBOOL itype, PLINT n, const PLFLT *Array, + const PLFLT *ArrayCk, const PLFLT *ArrayCk, const PLFLT *ArrayCk, + const PLBOOL *ArrayCkMinus1Null ); void -plscmap1la( PLBOOL itype, PLINT n, PLFLT *Array, - PLFLT *ArrayCk, PLFLT *ArrayCk, PLFLT *ArrayCk, PLFLT *ArrayCk, - PLBOOL *ArrayCkMinus1Null ); +plscmap1la( PLBOOL itype, PLINT n, const PLFLT *Array, + const PLFLT *ArrayCk, const PLFLT *ArrayCk, const PLFLT *ArrayCk, const PLFLT *ArrayCk, + const PLBOOL *ArrayCkMinus1Null ); void plscmap1n( PLINT ncol1 ); @@ -680,16 +680,16 @@ plsfont( PLINT family, PLINT style, PLINT weight ); void -plshades( PLFLT **Matrix, PLINT nx, PLINT ny, defined_func df, +plshades( const PLFLT **Matrix, PLINT nx, PLINT ny, defined_func df, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, - PLFLT *Array, PLINT n, PLINT fill_width, + const PLFLT *Array, PLINT n, PLINT fill_width, PLINT cont_color, PLINT cont_width, fill_func ff, PLBOOL rectangular, pltr_func pltr, PLPointer SWIG_OBJECT_DATA ); void -plshade( PLFLT **Matrix, PLINT nx, PLINT ny, defined_func df, +plshade( const PLFLT **Matrix, PLINT nx, PLINT ny, defined_func df, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, @@ -755,10 +755,10 @@ #endif void -plstring( PLINT n, PLFLT *Array, PLFLT *ArrayCk, const char *string ); +plstring( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const char *string ); void -plstring3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, const char *string ); +plstring3( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk, const char *string ); void plstripa( PLINT id, PLINT pen, PLFLT x, PLFLT y ); @@ -769,17 +769,17 @@ PLFLT xlpos, PLFLT ylpos, PLBOOL y_ascl, PLBOOL acc, PLINT colbox, PLINT collab, - PLINT *Array, PLINT *ArrayCk, const char *legline[4], + const PLINT *Array, const PLINT *ArrayCk, const char *legline[4], const char *labx, const char *laby, const char *labtop ); void plstripd( PLINT id ); void -plstyl( PLINT n, PLINT *Array, PLINT *ArrayCk ); +plstyl( PLINT n, const PLINT *Array, const PLINT *ArrayCk ); void -plsvect( PLFLT *Array, PLFLT *ArrayCk, PLINT n, PLBOOL fill ); +plsvect( const PLFLT *Array, const PLFLT *ArrayCk, PLINT n, PLBOOL fill ); void plsvpa( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); @@ -791,7 +791,7 @@ plsyax( PLINT digmax, PLINT digits ); void -plsym( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLINT code ); +plsym( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, PLINT code ); void plszax( PLINT digmax, PLINT digits ); @@ -806,7 +806,7 @@ plvasp( PLFLT aspect ); void -plvect( PLFLT **Matrix, PLFLT **MatrixCk, PLINT nx, PLINT ny, PLFLT scale, +plvect( const PLFLT **Matrix, const PLFLT **MatrixCk, PLINT nx, PLINT ny, PLFLT scale, pltr_func pltr, PLPointer SWIG_OBJECT_DATA ); @@ -845,7 +845,7 @@ plrgb1( PLINT r, PLINT g, PLINT b ); void -plshade1( PLFLT *Matrix, PLINT nx, PLINT ny, defined_func df, +plshade1( const PLFLT *Matrix, PLINT nx, PLINT ny, defined_func df, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, @@ -874,7 +874,7 @@ plfcont( f2eval_func f2eval, PLPointer SWIG_OBJECT_DATA, PLINT nx, PLINT ny, PLINT kx, PLINT lx, - PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel, + PLINT ky, PLINT ly, const PLFLT *clevel, PLINT nlevel, pltr_func pltr, PLPointer SWIG_OBJECT_DATA ); @@ -927,14 +927,14 @@ // plots a 2d image (or a matrix too large for plshade() ). void -plimage( PLFLT **Matrix, PLINT nx, PLINT ny, +plimage( const PLFLT **Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax ); // plots a 2d image (or a matrix too large for plshade() ). void -plimagefr( PLFLT **Matrix, PLINT nx, PLINT ny, +plimagefr( const PLFLT **Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, pltr_func pltr_img, PLPointer SWIG_OBJECT_DATA_img ); @@ -1114,7 +1114,7 @@ #endif void -plMinMax2dGrid( PLFLT **Matrix, PLINT nx, PLINT ny, PLFLT *OUTPUT, PLFLT *OUTPUT ); +plMinMax2dGrid( const PLFLT **Matrix, PLINT nx, PLINT ny, PLFLT *OUTPUT, PLFLT *OUTPUT ); // Wait for graphics input event and translate to world coordinates Modified: trunk/cmake/modules/java.cmake =================================================================== --- trunk/cmake/modules/java.cmake 2011-03-11 04:30:01 UTC (rev 11617) +++ trunk/cmake/modules/java.cmake 2011-03-11 04:59:40 UTC (rev 11618) @@ -25,7 +25,7 @@ if(DEFAULT_NO_BINDINGS) option(ENABLE_java "Enable Java bindings" OFF) else(DEFAULT_NO_BINDINGS) - option(ENABLE_java "Enable Java bindings" OFF) + option(ENABLE_java "Enable Java bindings" ON) endif(DEFAULT_NO_BINDINGS) if(ENABLE_java AND NOT BUILD_SHARED_LIBS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-11 18:37:21
|
Revision: 11619 http://plplot.svn.sourceforge.net/plplot/?rev=11619&view=rev Author: airwin Date: 2011-03-11 18:37:14 +0000 (Fri, 11 Mar 2011) Log Message: ----------- Update Python typedefs (for fill_func case) and typemaps to be consistent with const modifier use in bindings/swig-support/plplotcapi.i. The result is python again works without obvious errors and gives results that are consistent with C results. Therefore enable python by default again. Modified Paths: -------------- trunk/bindings/python/plplotcmodule.i trunk/cmake/modules/python.cmake Modified: trunk/bindings/python/plplotcmodule.i =================================================================== --- trunk/bindings/python/plplotcmodule.i 2011-03-11 04:59:40 UTC (rev 11618) +++ trunk/bindings/python/plplotcmodule.i 2011-03-11 18:37:14 UTC (rev 11619) @@ -145,16 +145,16 @@ #endif /* With preceding count */ -%typemap(in) (PLINT n, PLINT *Array) (PyArrayObject* tmp) { +%typemap(in) (PLINT n, const PLINT *Array) (PyArrayObject* tmp) { tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); if(tmp == NULL) return NULL; $1 = Alen = tmp->dimensions[0]; $2 = (PLINT*)tmp->data; } -%typemap(freearg) (PLINT n, PLINT *Array) {Py_DECREF(tmp$argnum);} +%typemap(freearg) (PLINT n, const PLINT *Array) {Py_DECREF(tmp$argnum);} /* Trailing count and check consistency with previous */ -%typemap(in) (PLINT *ArrayCk, PLINT n) (PyArrayObject* tmp) { +%typemap(in) (const PLINT *ArrayCk, PLINT n) (PyArrayObject* tmp) { tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] != Alen) { @@ -164,10 +164,10 @@ $2 = tmp->dimensions[0]; $1 = (PLINT*)tmp->data; } -%typemap(freearg) (PLINT *ArrayCk, PLINT n) {Py_DECREF(tmp$argnum); } +%typemap(freearg) (const PLINT *ArrayCk, PLINT n) {Py_DECREF(tmp$argnum); } /* No count but check consistency with previous */ -%typemap(in) PLINT *ArrayCk (PyArrayObject* tmp) { +%typemap(in) const PLINT *ArrayCk (PyArrayObject* tmp) { tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] != Alen) { @@ -176,10 +176,10 @@ } $1 = (PLINT*)tmp->data; } -%typemap(freearg) PLINT *ArrayCk { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLINT *ArrayCk { Py_DECREF(tmp$argnum);} /* No count but check consistency with previous or NULL */ -%typemap(in) PLINT *ArrayCkNull (PyArrayObject* tmp) { +%typemap(in) const PLINT *ArrayCkNull (PyArrayObject* tmp) { tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] != Alen) { @@ -188,10 +188,10 @@ } $1 = (PLINT*)tmp->data; } -%typemap(freearg) PLINT *ArrayCkNull { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLINT *ArrayCkNull { Py_DECREF(tmp$argnum);} /* Weird case to allow argument to be one shorter than others */ -%typemap(in) PLINT *ArrayCkMinus1 (PyArrayObject* tmp) { +%typemap(in) const PLINT *ArrayCkMinus1 (PyArrayObject* tmp) { tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] < Alen-1) { @@ -200,9 +200,9 @@ } $1 = (PLINT*)tmp->data; } -%typemap(freearg) PLINT *ArrayCkMinus1 { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLINT *ArrayCkMinus1 { Py_DECREF(tmp$argnum);} -%typemap(in) PLINT *ArrayCkMinus1Null (PyArrayObject* tmp) { +%typemap(in) const PLINT *ArrayCkMinus1Null (PyArrayObject* tmp) { tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] < Alen-1) { @@ -211,16 +211,16 @@ } $1 = (PLINT*)tmp->data; } -%typemap(freearg) PLINT *ArrayCkMinus1Null { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLINT *ArrayCkMinus1Null { Py_DECREF(tmp$argnum);} /* No length but remember size to check others */ -%typemap(in) PLINT *Array (PyArrayObject* tmp) { +%typemap(in) const PLINT *Array (PyArrayObject* tmp) { tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); if(tmp == NULL) return NULL; Alen = tmp->dimensions[0]; $1 = (PLINT*)tmp->data; } -%typemap(freearg) (PLINT *Array) {Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLINT *Array {Py_DECREF(tmp$argnum);} /****************************************************************************** PLFLT Arrays @@ -250,16 +250,16 @@ #endif /* with preceding count */ -%typemap(in) (PLINT n, PLFLT *Array) (PyArrayObject* tmp) { +%typemap(in) (PLINT n, const PLFLT *Array) (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; $1 = Alen = tmp->dimensions[0]; $2 = (PLFLT*)tmp->data; } -%typemap(freearg) (PLINT n, PLFLT *Array) { Py_DECREF(tmp$argnum);} +%typemap(freearg) (PLINT n, const PLFLT *Array) { Py_DECREF(tmp$argnum);} /* trailing count and check consistency with previous */ -%typemap(in) (PLFLT *ArrayCk, PLINT n) (PyArrayObject* tmp) { +%typemap(in) (const PLFLT *ArrayCk, PLINT n) (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] != Alen) { @@ -269,10 +269,10 @@ $1 = (PLFLT*)tmp->data; $2 = tmp->dimensions[0]; } -%typemap(freearg) (PLFLT *ArrayCk, PLINT n) { Py_DECREF(tmp$argnum);} +%typemap(freearg) (const PLFLT *ArrayCk, PLINT n) { Py_DECREF(tmp$argnum);} /* no count, but check consistency with previous */ -%typemap(in) PLFLT *ArrayCk (PyArrayObject* tmp) { +%typemap(in) const PLFLT *ArrayCk (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] != Alen) { @@ -281,10 +281,10 @@ } $1 = (PLFLT*)tmp->data; } -%typemap(freearg) PLFLT *ArrayCk { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLFLT *ArrayCk { Py_DECREF(tmp$argnum);} /* no count, but check consistency with previous, or NULL */ -%typemap(in) PLFLT *ArrayCkNull (PyArrayObject* tmp) { +%typemap(in) const PLFLT *ArrayCkNull (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] != Alen) { @@ -293,10 +293,10 @@ } $1 = (PLFLT*)tmp->data; } -%typemap(freearg) PLFLT *ArrayCkNull { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLFLT *ArrayCkNull { Py_DECREF(tmp$argnum);} /* check consistency with X dimension of previous */ -%typemap(in) PLFLT *ArrayCkX (PyArrayObject* tmp) { +%typemap(in) const PLFLT *ArrayCkX (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] != Xlen) { @@ -305,10 +305,10 @@ } $1 = (PLFLT*)tmp->data; } -%typemap(freearg) PLFLT *ArrayCkX { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLFLT *ArrayCkX { Py_DECREF(tmp$argnum);} /* check consistency with Y dimension of previous */ -%typemap(in) PLFLT *ArrayCkY (PyArrayObject* tmp) { +%typemap(in) const PLFLT *ArrayCkY (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; if(tmp->dimensions[0] != Ylen) { @@ -317,67 +317,67 @@ } $1 = (PLFLT*)tmp->data; } -%typemap(freearg) PLFLT *ArrayCkY { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLFLT *ArrayCkY { Py_DECREF(tmp$argnum);} /* set X length for later consistency checking, with trailing count */ -%typemap(in) (PLFLT *ArrayX, PLINT nx) (PyArrayObject* tmp) { +%typemap(in) (const PLFLT *ArrayX, PLINT nx) (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; Xlen = tmp->dimensions[0]; $2 = Xlen; $1 = (PLFLT*)tmp->data; } -%typemap(freearg) (PLFLT *ArrayX, PLINT nx) {Py_DECREF(tmp$argnum); } +%typemap(freearg) (const PLFLT *ArrayX, PLINT nx) {Py_DECREF(tmp$argnum); } /* set X length for later consistency checking */ -%typemap(in) PLFLT *ArrayX (PyArrayObject* tmp) { +%typemap(in) const PLFLT *ArrayX (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; Xlen = tmp->dimensions[0]; $1 = (PLFLT*)tmp->data; } -%typemap(freearg) PLFLT *ArrayX {Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLFLT *ArrayX {Py_DECREF(tmp$argnum);} /* Set Y length for later consistency checking, with trailing count */ -%typemap(in) (PLFLT *ArrayY, PLINT ny) (PyArrayObject* tmp) { +%typemap(in) (const PLFLT *ArrayY, PLINT ny) (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; Ylen = tmp->dimensions[0]; $2 = Ylen; $1 = (PLFLT*)tmp->data; } -%typemap(freearg) (PLFLT *ArrayY, PLINT ny) {Py_DECREF(tmp$argnum); } +%typemap(freearg) (const PLFLT *ArrayY, PLINT ny) {Py_DECREF(tmp$argnum); } /* set Y length for later consistency checking */ -%typemap(in) PLFLT *ArrayY (PyArrayObject* tmp) { +%typemap(in) const PLFLT *ArrayY (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; Ylen = tmp->dimensions[0]; $1 = (PLFLT*)tmp->data; } -%typemap(freearg) (PLFLT *ArrayY) {Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLFLT *ArrayY {Py_DECREF(tmp$argnum);} /* with trailing count */ -%typemap(in) (PLFLT *Array, PLINT n) (PyArrayObject* tmp) { +%typemap(in) (const PLFLT *Array, PLINT n) (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; $2 = tmp->dimensions[0]; $1 = (PLFLT*)tmp->data; } -%typemap(freearg) (PLFLT *Array, PLINT n) {Py_DECREF(tmp$argnum); } +%typemap(freearg) (const PLFLT *Array, PLINT n) {Py_DECREF(tmp$argnum); } /* with no count */ -%typemap(in) PLFLT *Array (PyArrayObject* tmp) { +%typemap(in) const PLFLT *Array (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); if(tmp == NULL) return NULL; Alen = tmp->dimensions[0]; $1 = (PLFLT*)tmp->data; } -%typemap(freearg) PLFLT *Array { Py_DECREF(tmp$argnum);} +%typemap(freearg) const PLFLT *Array { Py_DECREF(tmp$argnum);} /* 2D array with trailing dimensions, check consistency with previous */ -%typemap(in) (PLFLT **MatrixCk, PLINT nx, PLINT ny) (PyArrayObject* tmp) { +%typemap(in) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) (PyArrayObject* tmp) { int i, size; tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 2, 2); if(tmp == NULL) return NULL; @@ -392,13 +392,13 @@ for(i=0; i<$2; i++) $1[i] = (PLFLT*)(tmp->data + i*size); } -%typemap(freearg) (PLFLT **MatrixCk, PLINT nx, PLINT ny) { +%typemap(freearg) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) { Py_DECREF(tmp$argnum); free($1); } /* 2D array with trailing dimensions, set the X, Y size for later checking */ -%typemap(in) (PLFLT **Matrix, PLINT nx, PLINT ny) (PyArrayObject* tmp) { +%typemap(in) (const PLFLT **Matrix, PLINT nx, PLINT ny) (PyArrayObject* tmp) { int i, size; tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 2, 2); if(tmp == NULL) return NULL; @@ -409,13 +409,13 @@ for(i=0; i<$2; i++) $1[i] = (PLFLT*)(tmp->data + i*size); } -%typemap(freearg) (PLFLT **Matrix, PLINT nx, PLINT ny) { +%typemap(freearg) (const PLFLT **Matrix, PLINT nx, PLINT ny) { Py_DECREF(tmp$argnum); free($1); } /* 2D array with no dimensions, set the X, Y size for later checking */ -%typemap(in) PLFLT **Matrix (PyArrayObject* tmp) { +%typemap(in) const PLFLT **Matrix (PyArrayObject* tmp) { int i, size; tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 2, 2); if(tmp == NULL) return NULL; @@ -426,25 +426,25 @@ for(i=0; i<Xlen; i++) $1[i] = (PLFLT*)(tmp->data + i*size); } -%typemap(freearg) PLFLT **Matrix { +%typemap(freearg) const PLFLT **Matrix { Py_DECREF(tmp$argnum); free($1); } /* for plshade1, note the difference in the type for the first arg */ -%typemap(in) (PLFLT *Matrix, PLINT nx, PLINT ny) (PyArrayObject* tmp) { +%typemap(in) (const PLFLT *Matrix, PLINT nx, PLINT ny) (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 2, 2); if(tmp == NULL) return NULL; Xlen = $2 = tmp->dimensions[0]; Ylen = $3 = tmp->dimensions[1]; $1 = (PLFLT*)tmp->data; } -%typemap(freearg) (PLFLT *Matrix, PLINT nx, PLINT ny) { +%typemap(freearg) (const PLFLT *Matrix, PLINT nx, PLINT ny) { Py_DECREF(tmp$argnum); } /* 2D array, check for consistency */ -%typemap(in) PLFLT **MatrixCk (PyArrayObject* tmp) { +%typemap(in) const PLFLT **MatrixCk (PyArrayObject* tmp) { int i, size; tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 2, 2); if(tmp == NULL) return NULL; @@ -457,7 +457,7 @@ for(i=0; i<Xlen; i++) $1[i] = (PLFLT*)(tmp->data + i*size); } -%typemap(freearg) PLFLT **MatrixCk { +%typemap(freearg) const PLFLT **MatrixCk { Py_DECREF(tmp$argnum); free($1); } @@ -485,7 +485,7 @@ special for pllegend, char ** ArrayCk ****************************/ /* no count, but check consistency with previous. Always allow NULL strings. */ -%typemap(in) char **ArrayCk (PyArrayObject* tmp) { +%typemap(in) const char **ArrayCk (PyArrayObject* tmp) { int i; tmp = (PyArrayObject *)PyArray_ContiguousFromObject($input, NPY_STRING, 1, 1); if(tmp == NULL) return NULL; @@ -502,7 +502,7 @@ } } } -%typemap(freearg) char **ArrayCk { Py_DECREF(tmp$argnum); free($1);} +%typemap(freearg) const char **ArrayCk { Py_DECREF(tmp$argnum); free($1);} /*************************** String returning functions @@ -666,7 +666,7 @@ pltr2(PLFLT x, PLFLT y, PLFLT *OUTPUT, PLFLT *OUTPUT, PLcGrid2* cgrid); typedef PLINT (*defined_func)(PLFLT, PLFLT); -typedef void (*fill_func)(PLINT, PLFLT*, PLFLT*); +typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*ct_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT *, PLFLT*); @@ -675,7 +675,7 @@ %{ typedef PLINT (*defined_func)(PLFLT, PLFLT); -typedef void (*fill_func)(PLINT, PLFLT*, PLFLT*); +typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*ct_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT *, PLFLT*); @@ -1217,7 +1217,7 @@ /* this typemap takes a sequence of strings and converts them for plstripc also checks that previous Arrays were of length 4 */ -%typemap(in) char *legline[4] { +%typemap(in) const char *legline[4] { int i; if(!PySequence_Check($input) || PySequence_Size($input) != 4) { PyErr_SetString(PyExc_ValueError, "Requires a sequence of 4 strings."); @@ -1236,14 +1236,14 @@ } } } -%typemap(freearg) char *legline[4] { +%typemap(freearg) const char *legline[4] { free($1); } /* End of all code associated with special call-back functions.*/ /* Process options list using current options info. */ -%typemap(in) (int *p_argc, char **argv) (int tmp) { +%typemap(in) (int *p_argc, const char **argv) (int tmp) { int i; if (!PyList_Check($input)) { PyErr_SetString(PyExc_ValueError, "Expecting a list"); @@ -1264,7 +1264,7 @@ $2[i] = 0; } -%typemap(freearg) (int *p_argc, char **argv) { +%typemap(freearg) (int *p_argc, const char **argv) { if ($2) free($2); } Modified: trunk/cmake/modules/python.cmake =================================================================== --- trunk/cmake/modules/python.cmake 2011-03-11 04:59:40 UTC (rev 11618) +++ trunk/cmake/modules/python.cmake 2011-03-11 18:37:14 UTC (rev 11619) @@ -23,7 +23,7 @@ if(DEFAULT_NO_BINDINGS) option(ENABLE_python "Enable Python bindings" OFF) else(DEFAULT_NO_BINDINGS) - option(ENABLE_python "Enable Python bindings" OFF) + option(ENABLE_python "Enable Python bindings" ON) endif(DEFAULT_NO_BINDINGS) if(ENABLE_python AND NOT BUILD_SHARED_LIBS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-11 18:53:38
|
Revision: 11620 http://plplot.svn.sourceforge.net/plplot/?rev=11620&view=rev Author: airwin Date: 2011-03-11 18:53:31 +0000 (Fri, 11 Mar 2011) Log Message: ----------- Update the Lua typedefs (for fill_func case) and typemaps to be consistent with const modifier use in bindings/swig-support/plplotcapi.i. The result is Lua again works without obvious errors and gives results that are consistent as before with C results. Therefore enable Lua by default again. Modified Paths: -------------- trunk/bindings/lua/plplotluac.i trunk/cmake/modules/lua.cmake Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2011-03-11 18:37:14 UTC (rev 11619) +++ trunk/bindings/lua/plplotluac.i 2011-03-11 18:53:31 UTC (rev 11620) @@ -127,16 +127,16 @@ **********************************************************************************/ /* With preceding count */ -%typemap(in) (PLINT n, PLINT *Array) { +%typemap(in) (PLINT n, const PLINT *Array) { $2 = (PLINT*)LUA_get_int_num_array_var(L, $input, &$1); if(!$2) SWIG_fail; Alen = $1; } -%typemap(freearg) (PLINT n, PLINT *Array) { LUA_FREE_ARRAY($2); } +%typemap(freearg) (PLINT n, const PLINT *Array) { LUA_FREE_ARRAY($2); } /* Trailing count and check consistency with previous */ -%typemap(in) (PLINT *ArrayCk, PLINT n) (int temp) { +%typemap(in) (const PLINT *ArrayCk, PLINT n) (int temp) { $1 = (PLINT*)LUA_get_int_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; if(temp != Alen) { @@ -145,11 +145,11 @@ } $2 = temp; } -%typemap(freearg) (PLINT *ArrayCk, PLINT n) { LUA_FREE_ARRAY($1); } +%typemap(freearg) (const PLINT *ArrayCk, PLINT n) { LUA_FREE_ARRAY($1); } /* No count but check consistency with previous */ -%typemap(in) PLINT *ArrayCk (int temp) { +%typemap(in) const PLINT *ArrayCk (int temp) { $1 = (PLINT*)LUA_get_int_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; if(temp != Alen) { @@ -157,10 +157,10 @@ SWIG_fail; } } -%typemap(freearg) PLINT *ArrayCk { LUA_FREE_ARRAY($1); } +%typemap(freearg) const PLINT *ArrayCk { LUA_FREE_ARRAY($1); } /* No count but check consistency with previous, or NULL */ -%typemap(in) PLINT *ArrayCkNull (int temp) { +%typemap(in) const PLINT *ArrayCkNull (int temp) { $1 = (PLINT*)LUA_get_int_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; if(temp != Alen) { @@ -168,11 +168,11 @@ SWIG_fail; } } -%typemap(freearg) PLINT *ArrayCkNull { LUA_FREE_ARRAY($1); } -%typemap(default) PLINT *ArrayCkNull { $1=NULL; } +%typemap(freearg) const PLINT *ArrayCkNull { LUA_FREE_ARRAY($1); } +%typemap(default) const PLINT *ArrayCkNull { $1=NULL; } /* Weird case to allow argument to be one shorter than others */ -%typemap(in) PLINT *ArrayCkMinus1 (int temp) { +%typemap(in) const PLINT *ArrayCkMinus1 (int temp) { $1 = (PLINT*)LUA_get_int_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; if(temp < Alen-1) { @@ -180,9 +180,9 @@ SWIG_fail; } } -%typemap(freearg) PLINT *ArrayCkMinus1 { LUA_FREE_ARRAY($1); } +%typemap(freearg) const PLINT *ArrayCkMinus1 { LUA_FREE_ARRAY($1); } -%typemap(in) PLINT *ArrayCkMinus1Null (int temp) { +%typemap(in) const PLINT *ArrayCkMinus1Null (int temp) { $1 = (PLINT*)LUA_get_int_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; if(temp < Alen-1) { @@ -190,17 +190,17 @@ SWIG_fail; } } -%typemap(freearg) PLINT *ArrayCkMinus1Null { LUA_FREE_ARRAY($1); } -%typemap(default) PLINT *ArrayCkMinus1Null { $1=NULL; } +%typemap(freearg) const PLINT *ArrayCkMinus1Null { LUA_FREE_ARRAY($1); } +%typemap(default) const PLINT *ArrayCkMinus1Null { $1=NULL; } /* No length but remember size to check others */ -%typemap(in) PLINT *Array (int temp) { +%typemap(in) const PLINT *Array (int temp) { $1 = (PLINT*)LUA_get_int_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; Alen = temp; } -%typemap(freearg) (PLINT *Array) { LUA_FREE_ARRAY($1); } +%typemap(freearg) (const PLINT *Array) { LUA_FREE_ARRAY($1); } /****************************************************************************** @@ -208,17 +208,17 @@ ******************************************************************************/ /* with preceding count */ -%typemap(in) (PLINT n, PLFLT *Array) { +%typemap(in) (PLINT n, const PLFLT *Array) { int temp; $2 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$2) SWIG_fail; $1 = Alen = temp; } -%typemap(freearg) (PLINT n, PLFLT *Array) { LUA_FREE_ARRAY($2); } +%typemap(freearg) (PLINT n, const PLFLT *Array) { LUA_FREE_ARRAY($2); } /* Trailing count and check consistency with previous */ -%typemap(in) (PLFLT *ArrayCk, PLINT n) { +%typemap(in) (const PLFLT *ArrayCk, PLINT n) { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; @@ -228,11 +228,11 @@ } $2 = temp; } -%typemap(freearg) (PLFLT *ArrayCk, PLINT n) { LUA_FREE_ARRAY($1); } +%typemap(freearg) (const PLFLT *ArrayCk, PLINT n) { LUA_FREE_ARRAY($1); } /* no count, but check consistency with previous */ -%typemap(in) PLFLT *ArrayCk (int temp) { +%typemap(in) const PLFLT *ArrayCk (int temp) { $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; if(temp != Alen) { @@ -240,11 +240,11 @@ SWIG_fail; } } -%typemap(freearg) PLFLT *ArrayCk { LUA_FREE_ARRAY($1); } +%typemap(freearg) const PLFLT *ArrayCk { LUA_FREE_ARRAY($1); } /* no count, but check consistency with previous, or NULL */ -%typemap(in) PLFLT *ArrayCkNull (int temp) { +%typemap(in) const PLFLT *ArrayCkNull (int temp) { $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; if(temp != Alen) { @@ -252,31 +252,31 @@ SWIG_fail; } } -%typemap(freearg) PLFLT *ArrayCkNull { LUA_FREE_ARRAY($1); } +%typemap(freearg) const PLFLT *ArrayCkNull { LUA_FREE_ARRAY($1); } /* No length but remember size to check others */ -%typemap(in) PLFLT *Array { +%typemap(in) const PLFLT *Array { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; Alen = temp; } -%typemap(freearg) (PLFLT *Array) { LUA_FREE_ARRAY($1); } -%typemap(default) PLFLT *ArrayCkNull { $1=NULL; } +%typemap(freearg) (const PLFLT *Array) { LUA_FREE_ARRAY($1); } +%typemap(default) const PLFLT *ArrayCkNull { $1=NULL; } /* with trailing count */ -%typemap(in) (PLFLT *Array, PLINT n) { +%typemap(in) (const PLFLT *Array, PLINT n) { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; $2 = Alen = temp; } -%typemap(freearg) (PLFLT *Array, PLINT n) { LUA_FREE_ARRAY($1); } +%typemap(freearg) (const PLFLT *Array, PLINT n) { LUA_FREE_ARRAY($1); } /* check consistency with X dimension of previous */ -%typemap(in) PLFLT *ArrayCkX { +%typemap(in) const PLFLT *ArrayCkX { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; @@ -285,11 +285,11 @@ SWIG_fail; } } -%typemap(freearg) PLFLT *ArrayCkX { LUA_FREE_ARRAY($1); } +%typemap(freearg) const PLFLT *ArrayCkX { LUA_FREE_ARRAY($1); } /* check consistency with Y dimension of previous */ -%typemap(in) PLFLT *ArrayCkY { +%typemap(in) const PLFLT *ArrayCkY { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; @@ -298,47 +298,47 @@ SWIG_fail; } } -%typemap(freearg) PLFLT *ArrayCkY { LUA_FREE_ARRAY($1); } +%typemap(freearg) const PLFLT *ArrayCkY { LUA_FREE_ARRAY($1); } /* set X length for later consistency checking, with trailing count */ -%typemap(in) (PLFLT *ArrayX, PLINT nx) { +%typemap(in) (const PLFLT *ArrayX, PLINT nx) { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; $2 = Xlen = temp; } -%typemap(freearg) (PLFLT *ArrayX, PLINT nx) { LUA_FREE_ARRAY($1); } +%typemap(freearg) (const PLFLT *ArrayX, PLINT nx) { LUA_FREE_ARRAY($1); } /* set X length for later consistency checking */ -%typemap(in) PLFLT *ArrayX { +%typemap(in) const PLFLT *ArrayX { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; Xlen = temp; } -%typemap(freearg) PLFLT *ArrayX { LUA_FREE_ARRAY($1); } +%typemap(freearg) const PLFLT *ArrayX { LUA_FREE_ARRAY($1); } /* Set Y length for later consistency checking, with trailing count */ -%typemap(in) (PLFLT *ArrayY, PLINT ny) { +%typemap(in) (const PLFLT *ArrayY, PLINT ny) { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; $2 = Ylen = temp; } -%typemap(freearg) (PLFLT *ArrayY, PLINT ny) { LUA_FREE_ARRAY($1); } +%typemap(freearg) (const PLFLT *ArrayY, PLINT ny) { LUA_FREE_ARRAY($1); } /* set Y length for later consistency checking */ -%typemap(in) PLFLT *ArrayY { +%typemap(in) const PLFLT *ArrayY { int temp; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); if(!$1) SWIG_fail; Ylen = temp; } -%typemap(freearg) (PLFLT *ArrayY) { LUA_FREE_ARRAY($1); } +%typemap(freearg) (const PLFLT *ArrayY) { LUA_FREE_ARRAY($1); } %{ @@ -420,7 +420,7 @@ /* 2D array with trailing dimensions, check consistency with previous */ -%typemap(in) (PLFLT **MatrixCk, PLINT nx, PLINT ny) (int ii) { +%typemap(in) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) (int ii) { int jj; $1 = read_double_Matrix(L, $input, &ii, &jj ); @@ -432,7 +432,7 @@ SWIG_fail; } } -%typemap(freearg) (PLFLT **MatrixCk, PLINT nx, PLINT ny) { +%typemap(freearg) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) { int i; if($1) { @@ -444,7 +444,7 @@ /* 2D array with trailing dimensions, set the X, Y size for later checking */ -%typemap(in) (PLFLT **Matrix, PLINT nx, PLINT ny) (int ii) { +%typemap(in) (const PLFLT **Matrix, PLINT nx, PLINT ny) (int ii) { int jj; $1 = read_double_Matrix(L, $input, &ii, &jj ); @@ -452,7 +452,7 @@ Xlen = $2 = ii; Ylen = $3 = jj; } -%typemap(freearg) (PLFLT **Matrix, PLINT nx, PLINT ny) { +%typemap(freearg) (const PLFLT **Matrix, PLINT nx, PLINT ny) { int i; if($1) { @@ -464,7 +464,7 @@ /* 2D array with no dimensions, set the X, Y size for later checking */ -%typemap(in) PLFLT **Matrix (int ii) { +%typemap(in) const PLFLT **Matrix (int ii) { int jj; $1 = read_double_Matrix(L, $input, &ii, &jj ); @@ -472,7 +472,7 @@ Xlen = ii; Ylen = jj; } -%typemap(freearg) PLFLT **Matrix { +%typemap(freearg) const PLFLT **Matrix { int i; if($1) { @@ -484,7 +484,7 @@ /* 2D array, check for consistency */ -%typemap(in) PLFLT **MatrixCk (int ii) { +%typemap(in) const PLFLT **MatrixCk (int ii) { int jj; $1 = read_double_Matrix(L, $input, &ii, &jj ); @@ -494,7 +494,7 @@ SWIG_fail; } } -%typemap(freearg) PLFLT **MatrixCk { +%typemap(freearg) const PLFLT **MatrixCk { int i; if($1) { @@ -507,7 +507,7 @@ /* 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) { +%typemap(in) (const PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk) { int temp, i; $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); @@ -524,7 +524,7 @@ if(!$3[i]) SWIG_fail; } } -%typemap(argout) (PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk) { +%typemap(argout) (const PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk) { int i; if($3) { @@ -536,7 +536,7 @@ SWIG_arg++; } } -%typemap(freearg) (PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk) { +%typemap(freearg) (const PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk) { int i; LUA_FREE_ARRAY($1); @@ -632,7 +632,7 @@ %} typedef PLINT (*defined_func)(PLFLT, PLFLT); -typedef void (*fill_func)(PLINT, PLFLT*, PLFLT*); +typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT*, PLFLT*); typedef PLFLT (*f2eval_func)(PLINT, PLINT, PLPointer); @@ -640,7 +640,7 @@ %{ typedef PLINT (*defined_func)(PLFLT, PLFLT); -typedef void (*fill_func)(PLINT, PLFLT*, PLFLT*); +typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT *, PLFLT*); typedef PLFLT (*f2eval_func)(PLINT, PLINT, PLPointer); @@ -937,7 +937,7 @@ /* this typemap takes a sequence of strings and converts them for plstripc also checks that previous Arrays were of length 4 */ -%typemap(in, checkfn="lua_istable") char *legline[4] { +%typemap(in, checkfn="lua_istable") const char *legline[4] { int i; $1=NULL; @@ -964,7 +964,7 @@ lua_pop(L,1); } } -%typemap(freearg) char *legline[4] { +%typemap(freearg) const char *legline[4] { if($1) {free($1); $1=NULL;} } Modified: trunk/cmake/modules/lua.cmake =================================================================== --- trunk/cmake/modules/lua.cmake 2011-03-11 18:37:14 UTC (rev 11619) +++ trunk/cmake/modules/lua.cmake 2011-03-11 18:53:31 UTC (rev 11620) @@ -25,7 +25,7 @@ if(DEFAULT_NO_BINDINGS) option(ENABLE_lua "Enable Lua bindings" OFF) else(DEFAULT_NO_BINDINGS) - option(ENABLE_lua "Enable Lua bindings" OFF) + option(ENABLE_lua "Enable Lua bindings" ON) endif(DEFAULT_NO_BINDINGS) if(ENABLE_lua AND NOT BUILD_SHARED_LIBS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-13 20:01:17
|
Revision: 11621 http://plplot.svn.sourceforge.net/plplot/?rev=11621&view=rev Author: airwin Date: 2011-03-13 20:01:09 +0000 (Sun, 13 Mar 2011) Log Message: ----------- Update the Octave interface to deal properly with const arguments. Also, implement special PLFLT *Array6 typemap to deal with non-const tr[6] arguments. The result is Octave again works without obvious errors and gives results that are consistent as before with C results. Therefore enable Octave by default again. Modified Paths: -------------- trunk/bindings/octave/plplot_octave.i trunk/cmake/modules/octave.cmake Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2011-03-11 18:53:31 UTC (rev 11620) +++ trunk/bindings/octave/plplot_octave.i 2011-03-13 20:01:09 UTC (rev 11621) @@ -185,7 +185,7 @@ **********************************************************************************/ // With preceding count and remember size to check others -%typemap(in) (PLINT n, PLINT *Array) (Matrix temp) { +%typemap(in) (PLINT n, const PLINT *Array) (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } $1 = Alen = (PLINT)(_dim($input, 0)); @@ -193,10 +193,10 @@ temp = $input.matrix_value(); _cvt_double_to($2, &temp(0,0), Alen); } -%typemap(freearg) (PLINT n, PLINT *Array) {delete [] $2;} +%typemap(freearg) (PLINT n, const PLINT *Array) {delete [] $2;} // With trailing count and check consistency with previous -%typemap(in) (PLINT *ArrayCk, PLINT n) (Matrix temp) { +%typemap(in) (const PLINT *ArrayCk, PLINT n) (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( _dim($input, 0) != Alen ) @@ -206,10 +206,10 @@ _cvt_double_to($1, &temp(0,0), Alen); $2 = Alen; } -%typemap(freearg) (PLINT *ArrayCk, PLINT n) {delete [] $1;} +%typemap(freearg) (const PLINT *ArrayCk, PLINT n) {delete [] $1;} // No count but check consistency with previous -%typemap(in) PLINT *ArrayCk (Matrix temp) { +%typemap(in) const PLINT *ArrayCk (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( _dim($input, 0) != Alen ) @@ -218,10 +218,10 @@ $1 = new PLINT[Alen]; _cvt_double_to($1, &temp(0,0), Alen); } -%typemap(freearg) PLINT *ArrayCk {delete [] $1;} +%typemap(freearg) const PLINT *ArrayCk {delete [] $1;} // No count but check consistency with previous -%typemap(in) PLINT *ArrayCkNull (Matrix temp) { +%typemap(in) const PLINT *ArrayCkNull (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( ! $input.is_empty() ) { @@ -235,10 +235,10 @@ $1 = NULL; } } -%typemap(freearg) PLINT *ArrayCkNull {if ($1 != NULL) delete [] $1;} +%typemap(freearg) const PLINT *ArrayCkNull {if ($1 != NULL) delete [] $1;} // No count but remember size to check others -%typemap(in) PLINT *Array (Matrix temp) { +%typemap(in) const PLINT *Array (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } Alen = (PLINT)(_dim($input, 0)); @@ -246,11 +246,11 @@ $1 = new PLINT[Alen]; _cvt_double_to($1, &temp(0,0), Alen); } -%typemap(freearg) (PLINT *Array) {delete [] $1;} +%typemap(freearg) (const PLINT *Array) {delete [] $1;} // No count but check consistency with previous // Variation to allow argument to be one shorter than others. -%typemap(in) PLINT *ArrayCkMinus1 (Matrix temp) { +%typemap(in) const PLINT *ArrayCkMinus1 (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( ! (_dim($input, 0) == Alen || _dim($input, 0) == Alen-1) ) @@ -259,11 +259,11 @@ $1 = new PLINT[Alen]; _cvt_double_to($1, &temp(0,0), Alen); } -%typemap(freearg) PLINT *ArrayCkMinus1 {delete [] $1;} +%typemap(freearg) const PLINT *ArrayCkMinus1 {delete [] $1;} // For octave there is no provision for dropping the last argument // so this typemap is identical to the previous one. -%typemap(in) PLINT *ArrayCkMinus1Null (Matrix temp) { +%typemap(in) const PLINT *ArrayCkMinus1Null (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( ! (_dim($input, 0) == Alen || _dim($input, 0) == Alen-1) ) @@ -272,7 +272,7 @@ $1 = new PLINT[Alen]; _cvt_double_to($1, &temp(0,0), Alen); } -%typemap(freearg) PLINT *ArrayCkMinus1Null {delete [] $1;} +%typemap(freearg) const PLINT *ArrayCkMinus1Null {delete [] $1;} /****************************************************************************** @@ -280,17 +280,17 @@ ******************************************************************************/ // With preceding count and remember size to check others -%typemap(in) (PLINT n, PLFLT *Array) (Matrix temp) { +%typemap(in) (PLINT n, const PLFLT *Array) (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } $1 = Alen = (PLINT)(_dim($input, 0)); temp = $input.matrix_value(); $2 = &temp(0,0); } -%typemap(freearg) (PLINT n, PLFLT *Array) {} +%typemap(freearg) (PLINT n, const PLFLT *Array) {} // With trailing count and check consistency with previous -%typemap(in) (PLFLT *ArrayCk, PLINT n) (Matrix temp) { +%typemap(in) (const PLFLT *ArrayCk, PLINT n) (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( _dim($input, 0) != Alen ) @@ -299,10 +299,10 @@ $1 = &temp(0,0); $2 = (PLINT)(_dim($input, 0)); } -%typemap(freearg) (PLFLT *ArrayCk, PLINT n) {} +%typemap(freearg) (const PLFLT *ArrayCk, PLINT n) {} // No count but check consistency with previous -%typemap(in) PLFLT *ArrayCk (Matrix temp) { +%typemap(in) const PLFLT *ArrayCk (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( _dim($input, 0) != Alen ) @@ -310,10 +310,22 @@ temp = $input.matrix_value(); $1 = &temp(0,0); } -%typemap(freearg) PLFLT *ArrayCk {} +%typemap(freearg) const PLFLT *ArrayCk {} +// Special version to handle my_* non-const tr arguments. +// No count but check that has length of 6. +%typemap(in) PLFLT *Array6 (Matrix temp) { + if ( _n_dims($input) > 1 ) + { error("argument must be a scalar or vector"); SWIG_fail; } + if ( _dim($input, 0) != 6 ) + { error("argument vectors must have length of 6"); SWIG_fail; } + temp = $input.matrix_value(); + $1 = &temp(0,0); +} +%typemap(freearg) PLFLT *Array6 {} + // No count but check consistency with previous or NULL -%typemap(in) PLFLT *ArrayCkNull (Matrix temp) { +%typemap(in) const PLFLT *ArrayCkNull (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( ! $input.is_empty() ) { @@ -326,27 +338,27 @@ $1 = NULL; } } -%typemap(freearg) PLFLT *ArrayCkNull {} +%typemap(freearg) const PLFLT *ArrayCkNull {} // No count but remember size to check others -%typemap(in) PLFLT *Array (Matrix temp) { +%typemap(in) const PLFLT *Array (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } Alen = (PLINT)(_dim($input, 0)); temp = $input.matrix_value(); $1 = &temp(0,0); } -%typemap(freearg) (PLFLT *Array) {} +%typemap(freearg) (const PLFLT *Array) {} // With trailing count but remember size to check others -%typemap(in) (PLFLT *Array, PLINT n) (Matrix temp) { +%typemap(in) (const PLFLT *Array, PLINT n) (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } temp = $input.matrix_value(); $1 = &temp(0,0); $2 = Alen = (PLINT)(_dim($input, 0)); } -%typemap(freearg) (PLFLT *Array, PLINT n) {} +%typemap(freearg) (const PLFLT *Array, PLINT n) {} // The Matrix typemaps below here are a special form (with **Matrix // replaced by *Matrix) that is only suitable for special octave @@ -354,7 +366,7 @@ // PLplot functions that use **Matrix are %ignored. // No X count but check consistency with previous -%typemap(in) PLFLT *ArrayCkX (Matrix temp) { +%typemap(in) const PLFLT *ArrayCkX (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( _dim($input, 0) != Xlen ) @@ -362,10 +374,10 @@ temp = $input.matrix_value(); $1 = &temp(0,0); } -%typemap(freearg) PLFLT *ArrayCkX {} +%typemap(freearg) const PLFLT *ArrayCkX {} // No Y count but check consistency with previous -%typemap(in) PLFLT *ArrayCkY (Matrix temp) { +%typemap(in) const PLFLT *ArrayCkY (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } if ( _dim($input, 0) != Ylen ) @@ -373,50 +385,50 @@ temp = $input.matrix_value(); $1 = &temp(0,0); } -%typemap(freearg) PLFLT *ArrayCkY {} +%typemap(freearg) const PLFLT *ArrayCkY {} // With trailing X count but remember X size to check others -%typemap(in) (PLFLT *ArrayX, PLINT nx) (Matrix temp) { +%typemap(in) (const PLFLT *ArrayX, PLINT nx) (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } temp = $input.matrix_value(); $1 = &temp(0,0); $2 = Xlen = (PLINT)(_dim($input, 0)); } -%typemap(freearg) (PLFLT *ArrayX, PLINT nx) {} +%typemap(freearg) (const PLFLT *ArrayX, PLINT nx) {} // No X count but remember X size to check others -%typemap(in) PLFLT *ArrayX (Matrix temp) { +%typemap(in) const PLFLT *ArrayX (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } temp = $input.matrix_value(); $1 = &temp(0,0); Xlen = (PLINT)(_dim($input, 0)); } -%typemap(freearg) PLFLT *ArrayX {} +%typemap(freearg) const PLFLT *ArrayX {} // With trailing Y count but remember Y size to check others -%typemap(in) (PLFLT *ArrayY, PLINT ny) (Matrix temp) { +%typemap(in) (const PLFLT *ArrayY, PLINT ny) (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } temp = $input.matrix_value(); $1 = &temp(0,0); $2 = Ylen = (PLINT)(_dim($input, 0)); } -%typemap(freearg) (PLFLT *ArrayY, PLINT ny) {} +%typemap(freearg) (const PLFLT *ArrayY, PLINT ny) {} // No Y count but remember Y size to check others -%typemap(in) PLFLT *ArrayY (Matrix temp) { +%typemap(in) const PLFLT *ArrayY (Matrix temp) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } temp = $input.matrix_value(); $1 = &temp(0,0); Ylen = (PLINT)(_dim($input, 0)); } -%typemap(freearg) (PLFLT *ArrayY) {} +%typemap(freearg) (const PLFLT *ArrayY) {} // 2D array with trailing dimensions, check consistency with previous -%typemap(in) (PLFLT *MatrixCk, PLINT nx, PLINT ny) (Matrix temp) { +%typemap(in) (const PLFLT *MatrixCk, PLINT nx, PLINT ny) (Matrix temp) { if ( _n_dims($input) >2 ) { error("argument must be a scalar, vector, or 2D matrix."); SWIG_fail; } if ( _dim($input, 0) != Xlen ) @@ -428,10 +440,10 @@ $2 = (PLINT)(_dim($input, 0)); $3 = (PLINT)(_dim($input, 1)); } -%typemap(freearg) (PLFLT *MatrixCk, PLINT nx, PLINT ny) {} +%typemap(freearg) (const PLFLT *MatrixCk, PLINT nx, PLINT ny) {} // 2D array with trailing dimensions but set the X, Y size for later checking -%typemap(in) (PLFLT *Matrix, PLINT nx, PLINT ny) (Matrix temp) { +%typemap(in) (const PLFLT *Matrix, PLINT nx, PLINT ny) (Matrix temp) { if ( _n_dims($input) > 2 ) { error("argument must be a scalar, vector, or 2D matrix."); SWIG_fail; } temp = $input.matrix_value(); @@ -439,11 +451,11 @@ $2 = Xlen = (PLINT)(_dim($input, 0)); $3 = Ylen = (PLINT)(_dim($input, 1)); } -%typemap(freearg) (PLFLT *Matrix, PLINT nx, PLINT ny) {} +%typemap(freearg) (const PLFLT *Matrix, PLINT nx, PLINT ny) {} // 2D array with no count but set the X, Y size for later checking -%typemap(in) PLFLT *Matrix (Matrix temp) { +%typemap(in) const PLFLT *Matrix (Matrix temp) { if ( _n_dims($input) > 2 ) { error("argument must be a scalar, vector, or 2D matrix."); SWIG_fail; } temp = $input.matrix_value(); @@ -451,11 +463,11 @@ Xlen = (PLINT)(_dim($input, 0)); Ylen = (PLINT)(_dim($input, 1)); } -%typemap(freearg) PLFLT *Matrix {} +%typemap(freearg) const PLFLT *Matrix {} // 2D array with no count but check for consistency -%typemap(in) PLFLT *MatrixCk (Matrix temp) { +%typemap(in) const PLFLT *MatrixCk (Matrix temp) { if ( _n_dims($input) > 2 ) { error("argument must be a scalar, vector, or 2D matrix."); SWIG_fail; } if ( _dim($input, 0) != Xlen ) @@ -465,12 +477,12 @@ temp = $input.matrix_value(); $1 = &temp(0,0); } -%typemap(freearg) PLFLT *MatrixCk {} +%typemap(freearg) const PLFLT *MatrixCk {} // 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, octave_value_list retval) { +%typemap(in) (const PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) (Matrix temp, octave_value_list retval) { if ( _n_dims($input) > 1 ) { error("argument must be a scalar or vector"); SWIG_fail; } temp = $input.matrix_value(); @@ -480,10 +492,10 @@ $3 = (PLFLT *)retval(0).matrix_value().data(); } -%typemap(argout) (PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) { +%typemap(argout) (const PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) { $result = SWIG_Octave_AppendOutput($result, retval$argnum(0)); } -%typemap(freearg) (PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) {} +%typemap(freearg) (const PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) {} //----------------------------------------------------------------------------- @@ -504,7 +516,7 @@ } typedef PLINT (*defined_func)(PLFLT, PLFLT); -typedef void (*fill_func)(PLINT, PLFLT*, PLFLT*); +typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT*, PLFLT*); typedef PLFLT (*f2eval_func)(PLINT, PLINT, PLPointer); @@ -512,7 +524,7 @@ %{ typedef PLINT (*defined_func)(PLFLT, PLFLT); -typedef void (*fill_func)(PLINT, PLFLT*, PLFLT*); +typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT *, PLFLT*); typedef PLFLT (*f2eval_func)(PLINT, PLINT, PLPointer); @@ -597,7 +609,7 @@ PLFLT xlpos, PLFLT ylpos, PLBOOL y_ascl, PLBOOL acc, PLINT colbox, PLINT collab, - PLINT *colline, PLINT *styline, + const PLINT *colline, const PLINT *styline, const char *legline1, const char *legline2, const char *legline3, const char *legline4, const char *labx, const char *laby, const char *labtop ) { @@ -615,7 +627,7 @@ PLFLT xlpos, PLFLT ylpos, PLBOOL y_ascl, PLBOOL acc, PLINT colbox, PLINT collab, - PLINT *Array, PLINT *ArrayCk, + const PLINT *Array, const PLINT *ArrayCk, const char *legline1, const char *legline2, const char *legline3, const char *legline4, const char *labx, const char *laby, const char *labtop ); @@ -650,7 +662,7 @@ // convert from Fortran like arrays (one vector), to C like 2D arrays #define f2c( f, ff, nx, ny ) \ - PLFLT * *ff; \ + PLFLT **ff; \ ff = (PLFLT **) alloca( nx * sizeof ( PLFLT * ) ); \ for ( int i = 0; i < nx; i++ ) { \ ff[i] = (PLFLT *) alloca( ny * sizeof ( PLFLT ) ); \ @@ -659,78 +671,78 @@ // simpler plcont() for use with xform() -void my_plcont( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *clevel, PLINT nlevel, PLFLT *tr ) +void my_plcont( const PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *clevel, PLINT nlevel, PLFLT *tr ) { f2c( f, ff, nx, ny ); - c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, xform, tr ); + c_plcont( (const PLFLT **) ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, xform, tr ); } // plcont() for use with pltr0() NOT TESTED -void my_plcont0( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *clevel, PLINT nlevel ) +void my_plcont0( const PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *clevel, PLINT nlevel ) { f2c( f, ff, nx, ny ); - c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr0, NULL ); + c_plcont( (const PLFLT **) ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr0, NULL ); } // plcont() for use with pltr1() -void my_plcont1( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *clevel, PLINT nlevel, PLFLT *xg, PLFLT *yg ) +void my_plcont1( const PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *clevel, PLINT nlevel, const PLFLT *xg, const PLFLT *yg ) { PLcGrid grid1; grid1.nx = nx; grid1.ny = ny; - grid1.xg = xg; grid1.yg = yg; + grid1.xg = (PLFLT *) xg; grid1.yg = (PLFLT *) yg; f2c( f, ff, nx, ny ); - c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr1, &grid1 ); + c_plcont( (const PLFLT **) ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr1, &grid1 ); } // plcont() for use with pltr2() -void my_plcont2( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *clevel, PLINT nlevel, PLFLT *xg, PLFLT *yg ) +void my_plcont2( const PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *clevel, PLINT nlevel, const PLFLT *xg, const 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( f, ff, nx, ny ); - c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr2, &grid2 ); + c_plcont( (const PLFLT **) ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr2, &grid2 ); } // plcont() for use with pltr2p() -void my_plcont2p( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *clevel, PLINT nlevel, PLFLT *xg, PLFLT *yg ) +void my_plcont2p( const PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *clevel, PLINT nlevel, const PLFLT *xg, const 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( f, ff, nx, ny ); - c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr2, &grid2 ); + c_plcont( (const PLFLT **) ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr2, &grid2 ); } %} -void my_plcont( PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *Array, PLINT n, PLFLT *Array ); -void my_plcont0( PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *Array, PLINT n ); -void my_plcont1( PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *Array, PLINT n, PLFLT *ArrayCkX, PLFLT *ArrayCkY ); -void my_plcont2( PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, - PLINT ly, PLFLT *Array, PLINT n, PLFLT *MatrixCk, PLFLT *MatrixCk ); -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 ); +void my_plcont( const PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *Array, PLINT n, PLFLT *Array6 ); +void my_plcont0( const PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *Array, PLINT n ); +void my_plcont1( const PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *Array, PLINT n, const PLFLT *ArrayCkX, const PLFLT *ArrayCkY ); +void my_plcont2( const PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *Array, PLINT n, const PLFLT *MatrixCk, const PLFLT *MatrixCk ); +void my_plcont2p( const PLFLT *Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, + PLINT ly, const PLFLT *Array, PLINT n, const PLFLT *MatrixCk, const 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, +void my_plgriddata( const PLFLT *x, const PLFLT *y, const PLFLT *z, int npts, + const PLFLT *xg, int nptsx, const PLFLT *yg, int nptsy, PLFLT *zg, int type, PLFLT data ) { f2c( zg, zgg, nptsx, nptsy ); @@ -741,8 +753,8 @@ } %} -void my_plgriddata( PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLINT n, - PLFLT *ArrayX, PLINT nx, PLFLT *ArrayY, PLINT ny, +void my_plgriddata( const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk, PLINT n, + const PLFLT *ArrayX, PLINT nx, const PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk, PLINT type, PLFLT data ); // plmesh-related wrappers. @@ -754,26 +766,26 @@ %{ // 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 ) +void my_plmesh( const PLFLT *x, const PLFLT *y, const PLFLT *z, PLINT nx, PLINT ny, PLINT opt ) { f2c( z, zz, nx, ny ); - c_plmesh( x, y, zz, nx, ny, opt ); + c_plmesh( x, y, (const PLFLT **) 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 ) +void my_plmeshc( const PLFLT *x, const PLFLT *y, const PLFLT *z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel ) { f2c( z, zz, nx, ny ); - c_plmeshc( x, y, zz, nx, ny, opt, clevel, nlevel ); + c_plmeshc( x, y, (const PLFLT **) zz, nx, ny, opt, clevel, nlevel ); } %} -void my_plmesh( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT *MatrixCk, +void my_plmesh( const PLFLT *ArrayX, const PLFLT *ArrayY, const 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 ); +void my_plmeshc( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT *MatrixCk, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n ); // plot3d-related wrappers. @@ -786,28 +798,28 @@ %{ // Plots a 3-d representation of the function z[x][y]. -void my_plot3d( PLFLT *x, PLFLT *y, PLFLT *z, +void my_plot3d( const PLFLT *x, const PLFLT *y, const PLFLT *z, PLINT nx, PLINT ny, PLINT opt, PLINT side ) { f2c( z, zz, nx, ny ) - c_plot3d( x, y, zz, nx, ny, opt, side ); + c_plot3d( x, y, (const PLFLT **) zz, nx, ny, opt, side ); } // Plots a 3-d representation of the function z[x][y] with contour -void my_plot3dc( PLFLT *x, PLFLT *y, PLFLT *z, +void my_plot3dc( const PLFLT *x, const PLFLT *y, const PLFLT *z, PLINT nx, PLINT ny, PLINT opt, - PLFLT *clevel, PLINT nlevel ) + const PLFLT *clevel, PLINT nlevel ) { f2c( z, zz, nx, ny ) - c_plot3dc( x, y, zz, nx, ny, opt, clevel, nlevel ); + c_plot3dc( x, y, (const PLFLT **) zz, nx, ny, opt, clevel, nlevel ); } %} -void my_plot3d( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT *MatrixCk, +void my_plot3d( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT *MatrixCk, PLINT nx, PLINT ny, PLINT opt, PLBOOL side ); -void my_plot3dc( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT *MatrixCk, - PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); +void my_plot3dc( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT *MatrixCk, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n ); // plsurf3d-related wrappings: %ignore plsurf3d; @@ -816,16 +828,16 @@ //unimplemented: %rename(plsurf3d) my_plsurf3d; %{ -void my_plsurf3d( PLFLT *x, PLFLT *y, PLFLT *z, - PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel ) +void my_plsurf3d( const PLFLT *x, const PLFLT *y, const PLFLT *z, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel ) { f2c( z, zz, nx, ny ) - c_plsurf3d( x, y, zz, nx, ny, opt, clevel, nlevel ); + c_plsurf3d( x, y, (const PLFLT **) zz, nx, ny, opt, clevel, nlevel ); } %} -void my_plsurf3d( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT *MatrixCk, - PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); +void my_plsurf3d( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT *MatrixCk, + PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n ); // plshade-related wrappers. @@ -842,7 +854,7 @@ // // the simpler plshade() -void my_plshade( PLFLT *a, PLINT nx, PLINT ny, PLFLT *defined, +void my_plshade( const PLFLT *a, PLINT nx, PLINT ny, const PLFLT *defined, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, @@ -851,46 +863,46 @@ PLINT rectangular, PLFLT *tr ) { f2c( a, aa, nx, ny ); - c_plshade( aa, nx, ny, NULL, left, right, bottom, top, + c_plshade( (const PLFLT **) aa, nx, ny, NULL, left, right, bottom, top, shade_min, shade_max, sh_cmap, sh_color, sh_width, min_color, min_width, max_color, max_width, plfill, rectangular, xform, tr ); } // plshade() for use with pltr1 -void my_plshade1( PLFLT *a, PLINT nx, PLINT ny, const char *defined, +void my_plshade1( const PLFLT *a, PLINT nx, PLINT ny, const char *defined, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, PLINT max_width, - PLINT rectangular, PLFLT *xg, PLFLT *yg ) + PLINT rectangular, const PLFLT *xg, const PLFLT *yg ) { PLcGrid grid1; grid1.nx = nx; grid1.ny = ny; - grid1.xg = xg; grid1.yg = yg; + grid1.xg = (PLFLT *) xg; grid1.yg = (PLFLT *) yg; f2c( a, aa, nx, ny ); - c_plshade( aa, nx, ny, NULL, left, right, bottom, top, + c_plshade( (const PLFLT **) aa, nx, ny, NULL, left, right, bottom, top, shade_min, shade_max, sh_cmap, sh_color, sh_width, min_color, min_width, max_color, max_width, plfill, rectangular, pltr1, &grid1 ); } // plshade() for use with pltr2 -void my_plshade2( PLFLT *a, PLINT nx, PLINT ny, const char *defined, +void my_plshade2( const PLFLT *a, PLINT nx, PLINT ny, const char *defined, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, PLINT max_width, - PLINT rectangular, PLFLT *xg, PLFLT *yg ) + PLINT rectangular, const PLFLT *xg, const 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( a, aa, nx, ny ); - c_plshade( aa, nx, ny, NULL, left, right, bottom, top, + c_plshade( (const PLFLT **) aa, nx, ny, NULL, left, right, bottom, top, shade_min, shade_max, sh_cmap, sh_color, sh_width, min_color, min_width, max_color, max_width, plfill, rectangular, pltr2, &grid2 ); @@ -900,36 +912,36 @@ // The defined functionality is completely unused, but through // a historical anomaly is typed differently between my_plshade and -// my_plshade1 (or my_plshade2) which is why we use PLFLT *Array for +// my_plshade1 (or my_plshade2) which is why we use const PLFLT *Array for // the fourth argument of my_plshade, but const char * defined // for the other fourth arguments. FIXME. I (AWI) recommend an API break // with this fourth (unused) argument completely eliminated, but // that needs discussion. // my_plshade1 and my_plshade2 are completely untested by the standard examples. -void my_plshade( PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT *Array, +void my_plshade( const PLFLT *Matrix, PLINT nx, PLINT ny, const PLFLT *Array, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, PLINT max_width, - PLBOOL rectangular, PLFLT *Array ); + PLBOOL rectangular, PLFLT *Array6 ); -void my_plshade1( PLFLT *Matrix, PLINT nx, PLINT ny, const char *defined, +void my_plshade1( const PLFLT *Matrix, PLINT nx, PLINT ny, const char *defined, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, PLINT max_width, - PLBOOL rectangular, PLFLT *ArrayCkX, PLFLT *ArrayCkY); + PLBOOL rectangular, const PLFLT *ArrayCkX, const PLFLT *ArrayCkY); -void my_plshade2( PLFLT *Matrix, PLINT nx, PLINT ny, const char *defined, +void my_plshade2( const PLFLT *Matrix, PLINT nx, PLINT ny, const char *defined, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, PLINT max_width, - PLBOOL rectangular, PLFLT *Matrix, PLFLT *Matrix); + PLBOOL rectangular, const PLFLT *Matrix, const PLFLT *Matrix); // plshades-related wrappers. @@ -941,86 +953,86 @@ %rename(plshades2) my_plshades2; %{ -void my_plshades( PLFLT *a, PLINT nx, PLINT ny, +void my_plshades( const PLFLT *a, PLINT nx, PLINT ny, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, - PLFLT *clevel, PLINT nlevel, PLINT fill_width, + const PLFLT *clevel, PLINT nlevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, PLINT rectangular ) { f2c( a, aa, nx, ny ); - c_plshades( aa, nx, ny, NULL, left, right, bottom, top, + c_plshades( (const PLFLT **) aa, nx, ny, NULL, left, right, bottom, top, clevel, nlevel, fill_width, cont_color, cont_width, plfill, rectangular, NULL, NULL ); } -void my_plshadesx( PLFLT *a, PLINT nx, PLINT ny, +void my_plshadesx( const PLFLT *a, PLINT nx, PLINT ny, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, - PLFLT *clevel, PLINT nlevel, PLINT fill_width, + const PLFLT *clevel, PLINT nlevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, PLINT rectangular, PLFLT *tr ) { f2c( a, aa, nx, ny ); - c_plshades( aa, nx, ny, NULL, left, right, bottom, top, + c_plshades( (const PLFLT **) aa, nx, ny, NULL, left, right, bottom, top, clevel, nlevel, fill_width, cont_color, cont_width, plfill, rectangular, xform, tr ); } -void my_plshades1( PLFLT *a, PLINT nx, PLINT ny, +void my_plshades1( const PLFLT *a, PLINT nx, PLINT ny, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, - PLFLT *clevel, PLINT nlevel, PLINT fill_width, + const PLFLT *clevel, PLINT nlevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, - PLINT rectangular, PLFLT *xg, PLFLT *yg ) + PLINT rectangular, const PLFLT *xg, const PLFLT *yg ) { PLcGrid grid1; grid1.nx = nx; grid1.ny = ny; - grid1.xg = xg; grid1.yg = yg; + grid1.xg = (PLFLT *) xg; grid1.yg = (PLFLT *) yg; f2c( a, aa, nx, ny ); - c_plshades( aa, nx, ny, NULL, left, right, bottom, top, + c_plshades( (const PLFLT **) aa, nx, ny, NULL, left, right, bottom, top, clevel, nlevel, fill_width, cont_color, cont_width, plfill, rectangular, pltr1, &grid1 ); } -void my_plshades2( PLFLT *a, PLINT nx, PLINT ny, +void my_plshades2( const PLFLT *a, PLINT nx, PLINT ny, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, - PLFLT *clevel, PLINT nlevel, PLINT fill_width, + const PLFLT *clevel, PLINT nlevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, - PLINT rectangular, PLFLT *xg, PLFLT *yg ) + PLINT rectangular, const PLFLT *xg, const 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( a, aa, nx, ny ); - c_plshades( aa, nx, ny, NULL, left, right, bottom, top, + c_plshades( (const PLFLT **) aa, nx, ny, NULL, left, right, bottom, top, clevel, nlevel, fill_width, cont_color, cont_width, plfill, rectangular, pltr2, &grid2 ); } %} -void my_plshades( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plshades( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, - PLFLT *Array, PLINT n, PLINT fill_width, + const PLFLT *Array, PLINT n, PLINT fill_width, PLINT cont_color, PLINT cont_width, PLBOOL rectangular); -void my_plshadesx( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plshadesx( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, - PLFLT *Array, PLINT n, PLINT fill_width, + const PLFLT *Array, PLINT n, PLINT fill_width, PLINT cont_color, PLINT cont_width, - PLBOOL rectangular, PLFLT *Array); + PLBOOL rectangular, PLFLT *Array6 ); -void my_plshades1( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plshades1( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, - PLFLT *Array, PLINT n, PLINT fill_width, + const PLFLT *Array, PLINT n, PLINT fill_width, PLINT cont_color, PLINT cont_width, - PLBOOL rectangular, PLFLT *ArrayCkX, PLFLT *ArrayCkY); + PLBOOL rectangular, const PLFLT *ArrayCkX, const PLFLT *ArrayCkY); -void my_plshades2( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plshades2( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, - PLFLT *Array, PLINT n, PLINT fill_width, + const PLFLT *Array, PLINT n, PLINT fill_width, PLINT cont_color, PLINT cont_width, - PLBOOL rectangular, PLFLT *Matrix, PLFLT *Matrix); + PLBOOL rectangular, const PLFLT *Matrix, const PLFLT *Matrix); // plvect-related wrappers. @@ -1034,26 +1046,26 @@ // 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 ) +void my_plvect( const PLFLT *u, const 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 ); + c_plvect( (const PLFLT **) uu, (const PLFLT **) vv, nx, ny, scale, xform, tr ); } // plvect() for use with pltr1 -void my_plvect1( PLFLT *u, PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, PLFLT *xg, PLFLT *yg ) +void my_plvect1( const PLFLT *u, const PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, const PLFLT *xg, const PLFLT *yg ) { PLcGrid grid1; grid1.nx = nx; grid1.ny = ny; - grid1.xg = xg; grid1.yg = yg; + grid1.xg = (PLFLT *) xg; grid1.yg = (PLFLT *) yg; f2c( u, uu, nx, ny ); f2c( v, vv, nx, ny ); - c_plvect( uu, vv, nx, ny, scale, pltr1, &grid1 ); + c_plvect( (const PLFLT **) uu, (const PLFLT **) vv, nx, ny, scale, pltr1, &grid1 ); } // plvect() for use with pltr2 -void my_plvect2( PLFLT *u, PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, PLFLT *xg, PLFLT *yg ) +void my_plvect2( const PLFLT *u, const PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, const PLFLT *xg, const PLFLT *yg ) { PLcGrid2 grid2; f2c( xg, xgg, nx, ny ); f2c( yg, ygg, nx, ny ); @@ -1061,18 +1073,18 @@ 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 ); + c_plvect( (const PLFLT **) uu, (const PLFLT **) vv, nx, ny, scale, pltr2, &grid2 ); } %} -void my_plvect( PLFLT *Matrix, PLFLT *MatrixCk, PLINT nx, PLINT ny, PLFLT scale, - PLFLT *Array ); +void my_plvect( const PLFLT *Matrix, const PLFLT *MatrixCk, PLINT nx, PLINT ny, PLFLT scale, + PLFLT *Array6 ); -void my_plvect1( PLFLT *Matrix, PLFLT *MatrixCk, PLINT nx, PLINT ny, PLFLT scale, - PLFLT *ArrayCkX, PLFLT *ArrayCkY ); +void my_plvect1( const PLFLT *Matrix, const PLFLT *MatrixCk, PLINT nx, PLINT ny, PLFLT scale, + const PLFLT *ArrayCkX, const PLFLT *ArrayCkY ); -void my_plvect2( PLFLT *Matrix, PLFLT *MatrixCk, PLINT nx, PLINT ny, PLFLT scale, - PLFLT *Matrix, PLFLT *Matrix); +void my_plvect2( const PLFLT *Matrix, const PLFLT *MatrixCk, PLINT nx, PLINT ny, PLFLT scale, + const PLFLT *Matrix, const PLFLT *Matrix); // plimage-related wrappers. %ignore plimage; @@ -1085,83 +1097,83 @@ %{ // Plot an image with distortion - uses the same function pointer -void my_plimage( PLFLT *a, PLINT nx, PLINT ny, +void my_plimage( const PLFLT *a, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT dxmin, PLFLT dxmax, PLFLT dymin, PLFLT dymax ) { f2c( a, aa, nx, ny ); - plimage( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, dxmin, dxmax, dymin, dymax ); + plimage( (const PLFLT **) aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, dxmin, dxmax, dymin, dymax ); } // Plot an image with distortion - uses the same function pointer // convention as plcont -void my_plimagefr( PLFLT *a, PLINT nx, PLINT ny, +void my_plimagefr( const PLFLT *a, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax ) { f2c( a, aa, nx, ny ); - plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, NULL, NULL ); + plimagefr( (const PLFLT **) aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, NULL, NULL ); } -void my_plimagefrx( PLFLT *a, PLINT nx, PLINT ny, +void my_plimagefrx( const PLFLT *a, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, PLFLT *tr ) { f2c( a, aa, nx, ny ); - plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, xform, tr ); + plimagefr( (const PLFLT **) aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, xform, tr ); } // plimagefr() for use with pltr1 -void my_plimagefr1( PLFLT *a, PLINT nx, PLINT ny, +void my_plimagefr1( const PLFLT *a, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, - PLFLT valuemin, PLFLT valuemax, PLFLT *xg, PLFLT *yg ) + PLFLT valuemin, PLFLT valuemax, const PLFLT *xg, const PLFLT *yg ) { PLcGrid grid1; grid1.nx = nx + 1; grid1.ny = ny + 1; - grid1.xg = xg; grid1.yg = yg; + grid1.xg = (PLFLT *) xg; grid1.yg = (PLFLT *) yg; f2c( a, aa, nx, ny ); - c_plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr1, &grid1 ); + c_plimagefr( (const PLFLT **) aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr1, &grid1 ); } // plimagefr() for use with pltr2 -void my_plimagefr2( PLFLT *a, PLINT nx, PLINT ny, +void my_plimagefr2( const PLFLT *a, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, - PLFLT valuemin, PLFLT valuemax, PLFLT *xg, PLFLT *yg ) + PLFLT valuemin, PLFLT valuemax, const PLFLT *xg, const PLFLT *yg ) { PLcGrid2 grid2; f2c( xg, xgg, ( nx + 1 ), ( ny + 1 ) ); f2c( yg, ygg, ( nx + 1 ), ( ny + 1 ) ); grid2.nx = nx + 1; grid2.ny = ny + 1; grid2.xg = xgg; grid2.yg = ygg; f2c( a, aa, nx, ny ); - c_plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr2, &grid2 ); + c_plimagefr( (const PLFLT **) aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr2, &grid2 ); } %} -void my_plimage( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plimage( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax ); -void my_plimagefr( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plimagefr( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax ); -void my_plimagefrx( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plimagefrx( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, - PLFLT valuemin, PLFLT valuemax, PLFLT *Array ); + PLFLT valuemin, PLFLT valuemax, PLFLT *Array6 ); -void my_plimagefr1( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plimagefr1( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, - PLFLT valuemin, PLFLT valuemax, PLFLT *ArrayCkX, PLFLT * ArrayCkY ); + PLFLT valuemin, PLFLT valuemax, const PLFLT *ArrayCkX, const PLFLT *ArrayCkY ); -void my_plimagefr2( PLFLT *Matrix, PLINT nx, PLINT ny, +void my_plimagefr2( const PLFLT *Matrix, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, - PLFLT valuemin, PLFLT valuemax, PLFLT *Matrix, PLFLT *Matrix ); + PLFLT valuemin, PLFLT valuemax, const PLFLT *Matrix, const PLFLT *Matrix ); // This test function should be removed when we are confident of our // dealings with all types of octave string arrays. @@ -1178,7 +1190,7 @@ %} // No count but check consistency with previous -%typemap(in) char **ArrayCk { +%typemap(in) const char **ArrayCk { charMatrix temp_matrix; Cell temp_cell; char *tmp_cstring; @@ -1264,7 +1276,7 @@ } } -%typemap(freearg) char **ArrayCk { +%typemap(freearg) const char **ArrayCk { int i; if ($1 != NULL) { for(i=0; i<Alen; i++) { Modified: trunk/cmake/modules/octave.cmake =================================================================== --- trunk/cmake/modules/octave.cmake 2011-03-11 18:53:31 UTC (rev 11620) +++ trunk/cmake/modules/octave.cmake 2011-03-13 20:01:09 UTC (rev 11621) @@ -23,7 +23,7 @@ if(DEFAULT_NO_BINDINGS) option(ENABLE_octave "Enable Octave bindings" OFF) else(DEFAULT_NO_BINDINGS) - option(ENABLE_octave "Enable Octave bindings" OFF) + option(ENABLE_octave "Enable Octave bindings" ON) endif(DEFAULT_NO_BINDINGS) if(ENABLE_octave AND NOT CMAKE_CXX_COMPILER_WORKS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-13 20:47:50
|
Revision: 11622 http://plplot.svn.sourceforge.net/plplot/?rev=11622&view=rev Author: airwin Date: 2011-03-13 20:47:44 +0000 (Sun, 13 Mar 2011) Log Message: ----------- Retire matwrapped version of octave bindings (by forcing their disablement although we will leave the files around for a while) because the swig-generated octave bindings are much better, and I doubt anybody wants to maintain the matwrapped versions (e.g., for the recent large "const" modifier change to our API). Modified Paths: -------------- trunk/README.release trunk/cmake/modules/octave.cmake Modified: trunk/README.release =================================================================== --- trunk/README.release 2011-03-13 20:01:09 UTC (rev 11621) +++ trunk/README.release 2011-03-13 20:47:44 UTC (rev 11622) @@ -339,21 +339,15 @@ Octave is a powerful platform that demands a first-class PLplot solution, but we were finding it difficult to realize that goal -because we were running up against some limitations of the (now -deprecated) matwrap-generated Octave bindings. Accordingly, a -swig-generated version of the Octave bindings has now been implemented -that builds on the prior matwrapped bindings effort but also extends -it with, e.g., bindings for plstring, plstring3, pllegend, and -plcolbar which now make it possible to run examples 4, 18, 26, and 33 -(all of which have now have been updated to use those functions) and -get consistent results with the corresponding C examples. The -swig-generated bindings for Octave are used by default, but the build -system falls back to the legacy matwrapped bindings if swig is not -available. For now, users can force the legacy matwrapped bindings by -using the -DENABLE_matwrapped_octave=ON cmake command-line option for -comparison purposes, but in the near future we plan to remove the -matwrapped octave bindings because the swig-generated alternative is -more complete and easier to maintain. +because we were running up against limitations of the previous +matwrap-generated Octave bindings. Accordingly, a swig-generated +version of the Octave bindings has now been implemented that builds on +the prior matwrapped bindings effort but also extends it with, e.g., +bindings for plstring, plstring3, pllegend, and plcolbar. These new +octave bindings (which now completely replace the prior matwrapped +bindings) make it possible to run examples 4, 18, 26, and 33 (all of +which have now have been updated to use those functions) and get +consistent results with the corresponding C examples. Like the matwrapped bindings before it, the new swig-generated octave bindings currently do not have a number of the PLplot functions @@ -1164,21 +1158,15 @@ Octave is a powerful platform that demands a first-class PLplot solution, but we were finding it difficult to realize that goal -because we were running up against some limitations of the (now -deprecated) matwrap-generated Octave bindings. Accordingly, a -swig-generated version of the Octave bindings has now been implemented -that builds on the prior matwrapped bindings effort but also extends -it with, e.g., bindings for plstring, plstring3, pllegend, and -plcolbar which now make it possible to run examples 4, 18, 26, and 33 -(all of which have now have been updated to use those functions) and -get consistent results with the corresponding C examples. The -swig-generated bindings for Octave are used by default, but the build -system falls back to the legacy matwrapped bindings if swig is not -available. For now, users can force the legacy matwrapped bindings by -using the -DENABLE_matwrapped_octave=ON cmake command-line option for -comparison purposes, but in the near future we plan to remove the -matwrapped octave bindings because the swig-generated alternative is -more complete and easier to maintain. +because we were running up against limitations of the previous +matwrap-generated Octave bindings. Accordingly, a swig-generated +version of the Octave bindings has now been implemented that builds on +the prior matwrapped bindings effort but also extends it with, e.g., +bindings for plstring, plstring3, pllegend, and plcolbar. These new +octave bindings (which now completely replace the prior matwrapped +bindings) make it possible to run examples 4, 18, 26, and 33 (all of +which have now have been updated to use those functions) and get +consistent results with the corresponding C examples. Like the matwrapped bindings before it, the new swig-generated octave bindings currently do not have a number of the PLplot functions Modified: trunk/cmake/modules/octave.cmake =================================================================== --- trunk/cmake/modules/octave.cmake 2011-03-13 20:01:09 UTC (rev 11621) +++ trunk/cmake/modules/octave.cmake 2011-03-13 20:47:44 UTC (rev 11622) @@ -32,6 +32,12 @@ set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE) endif(ENABLE_octave AND NOT CMAKE_CXX_COMPILER_WORKS) +if(ENABLE_octave AND NOT SWIG_FOUND) + message(STATUS "WARNING: " + "swig not found. Disabling Octave bindings") + set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE) +endif(ENABLE_octave AND NOT SWIG_FOUND) + if(ENABLE_octave AND NOT BUILD_SHARED_LIBS) message(STATUS "WARNING: " "Octave requires shared libraries. Disabling octave bindings") @@ -263,11 +269,13 @@ if(PL_DOUBLE) set(DEFINE_PL_DOUBLE "#define PL_DOUBLE") endif(PL_DOUBLE) - option(ENABLE_matwrapped_octave "Enable legacy Octave bindings generated by matwrap" OFF) - if(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave) - message(STATUS "WARNING: " - "SWIG not found. Falling back to deprecated matwrapped Octave bindings.") - set(ENABLE_matwrapped_octave ON CACHE BOOL "Enable legacy Octave bindings generated by matwrap" FORCE) - endif(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave) +# option(ENABLE_matwrapped_octave "Enable legacy Octave bindings generated by matwrap" OFF) +# if(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave) +# message(STATUS "WARNING: " +# "SWIG not found. Falling back to deprecated matwrapped Octave bindings.") +# set(ENABLE_matwrapped_octave ON CACHE BOOL "Enable legacy Octave bindings generated by matwrap" FORCE) +# endif(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave) + # Force disabling of matwrapped bindings which are no longer maintained. + set(ENABLE_matwrapped_octave OFF CACHE BOOL "Enable legacy Octave bindings generated by matwrap" FORCE) endif(ENABLE_octave) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-14 03:24:30
|
Revision: 11623 http://plplot.svn.sourceforge.net/plplot/?rev=11623&view=rev Author: airwin Date: 2011-03-14 03:24:23 +0000 (Mon, 14 Mar 2011) Log Message: ----------- Clean up const-related warnings for doubly dimensioned arrays. There is probably a better way to do this since singly dimensioned arrays do not generated these (gcc) warnings. Modified Paths: -------------- trunk/bindings/tcl/tclAPI.c trunk/examples/c/x08c.c trunk/examples/c/x09c.c trunk/examples/c/x11c.c trunk/examples/c/x14c.c trunk/examples/c/x16c.c trunk/examples/c/x20c.c trunk/examples/c/x21c.c trunk/examples/c/x22c.c trunk/examples/c/x28c.c Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/bindings/tcl/tclAPI.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -1164,7 +1164,7 @@ // contour the data. - plcont( zused, nx, ny, + plcont( (const PLFLT **) zused, nx, ny, kx, lx, ky, ly, matclev->fdata, nclev, pltr, pltr_data ); @@ -1497,7 +1497,7 @@ // plot the vector data. - plvect( uused, vused, nx, ny, + plvect( (const PLFLT **) uused, (const PLFLT **) vused, nx, ny, scaling, pltr, pltr_data ); // Now free up any space which got allocated for our coordinate trickery. @@ -1642,7 +1642,7 @@ return TCL_ERROR; } - plmesh( x, y, z, nx, ny, opt ); + plmesh( x, y, (const PLFLT **) z, nx, ny, opt ); if ( argc == 7 ) { @@ -1881,7 +1881,7 @@ return TCL_ERROR; } - plmeshc( x, y, z, nx, ny, opt, clev, nlev ); + plmeshc( x, y, (const PLFLT **) z, nx, ny, opt, clev, nlev ); if ( argc == 7 ) { @@ -2018,7 +2018,7 @@ return TCL_ERROR; } - plot3d( x, y, z, nx, ny, opt, side ); + plot3d( x, y, (const PLFLT **) z, nx, ny, opt, side ); if ( argc == 8 ) { @@ -2257,7 +2257,7 @@ return TCL_ERROR; } - plot3dc( x, y, z, nx, ny, opt, clev, nlev ); + plot3dc( x, y, (const PLFLT **) z, nx, ny, opt, clev, nlev ); if ( argc == 7 ) { @@ -2496,7 +2496,7 @@ return TCL_ERROR; } - plsurf3d( x, y, z, nx, ny, opt, clev, nlev ); + plsurf3d( x, y, (const PLFLT **) z, nx, ny, opt, clev, nlev ); if ( argc == 7 ) { @@ -2851,7 +2851,7 @@ // Now go make the plot. - plshade( zused, nx, ny, NULL, + plshade( (const PLFLT **) zused, nx, ny, NULL, xmin, xmax, ymin, ymax, sh_min, sh_max, sh_cmap, sh_col, sh_wid, min_col, min_wid, max_col, max_wid, @@ -3176,7 +3176,7 @@ // Now go make the plot. - plshades( zused, nx, ny, NULL, + plshades( (const PLFLT **) zused, nx, ny, NULL, xmin, xmax, ymin, ymax, matclevel->fdata, nlevel, fill_width, cont_color, cont_width, plfill, rect, pltr, pltr_data ); @@ -3688,7 +3688,7 @@ // fprintf(stderr,"Dymin, Dymax: %.17g %.17g\n", Dymin, Dymax); // - c_plimage( pidata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, + c_plimage( (const PLFLT **) pidata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, Dxmin, Dxmax, Dymin, Dymax ); plFree2dGrid( pidata, nx, ny ); @@ -3794,12 +3794,12 @@ cgrid2.yg[i][j] = yg->fdata[j + i * ( ny + 1 )]; } } - c_plimagefr( pidata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, + c_plimagefr( (const PLFLT **) pidata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr2, (void *) &cgrid2 ); } else { - c_plimagefr( pidata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, + c_plimagefr( (const PLFLT **) pidata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr0, NULL ); } Modified: trunk/examples/c/x08c.c =================================================================== --- trunk/examples/c/x08c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x08c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -202,7 +202,7 @@ } } - plMinMax2dGrid( z, XPTS, YPTS, &zmax, &zmin ); + plMinMax2dGrid( (const PLFLT **) z, XPTS, YPTS, &zmax, &zmin ); step = ( zmax - zmin ) / ( nlevel + 1 ); for ( i = 0; i < nlevel; i++ ) clevel[i] = zmin + step + step * i; Modified: trunk/examples/c/x09c.c =================================================================== --- trunk/examples/c/x09c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x09c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -101,7 +101,7 @@ } plcol0( 2 ); - plcont( z, RPTS, THETAPTS, 1, RPTS, 1, THETAPTS, lev, 10, + plcont( (const PLFLT **) z, RPTS, THETAPTS, 1, RPTS, 1, THETAPTS, lev, 10, pltr2, (void *) &cgrid2 ); plcol0( 1 ); pllab( "", "", "Polar Contour Plot" ); @@ -248,7 +248,7 @@ { // Negative contours pllsty( 2 ); - plcont( z, PRPTS, PTHETAPTS, 1, PRPTS, 1, PTHETAPTS, + plcont( (const PLFLT **) z, PRPTS, PTHETAPTS, 1, PRPTS, 1, PTHETAPTS, clevelneg, nlevelneg, pltr2, (void *) &cgrid2 ); } @@ -256,7 +256,7 @@ { // Positive contours pllsty( 1 ); - plcont( z, PRPTS, PTHETAPTS, 1, PRPTS, 1, PTHETAPTS, + plcont( (const PLFLT **) z, PRPTS, PTHETAPTS, 1, PRPTS, 1, PTHETAPTS, clevelpos, nlevelpos, pltr2, (void *) &cgrid2 ); } @@ -368,10 +368,10 @@ pl_setcontlabelparam( 0.006, 0.3, 0.1, 1 ); plenv( -1.0, 1.0, -1.0, 1.0, 0, 0 ); plcol0( 2 ); - plcont( z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL ); + plcont( (const PLFLT **) z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL ); plstyl( 1, &mark, &space ); plcol0( 3 ); - plcont( w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL ); + plcont( (const PLFLT **) w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL ); plstyl( 0, &mark, &space ); plcol0( 1 ); pllab( "X Coordinate", "Y Coordinate", "Streamlines of flow" ); @@ -381,12 +381,12 @@ plenv( -1.0, 1.0, -1.0, 1.0, 0, 0 ); plcol0( 2 ); - plcont( z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, + plcont( (const PLFLT **) z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, pltr1, (void *) &cgrid1 ); plstyl( 1, &mark, &space ); plcol0( 3 ); - plcont( w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, + plcont( (const PLFLT **) w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, pltr1, (void *) &cgrid1 ); plstyl( 0, &mark, &space ); plcol0( 1 ); @@ -395,12 +395,12 @@ // pl_setcontlabelparam(0.006, 0.3, 0.1, 1); // plenv(-1.0, 1.0, -1.0, 1.0, 0, 0); // plcol0(2); - // plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, + // plcont((const PLFLT **) z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, // pltr1, (void *) &cgrid1); // // plstyl(1, &mark, &space); // plcol0(3); - // plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, + // plcont((const PLFLT **) w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, // pltr1, (void *) &cgrid1); // plstyl(0, &mark, &space); // plcol0(1); @@ -411,12 +411,12 @@ plenv( -1.0, 1.0, -1.0, 1.0, 0, 0 ); plcol0( 2 ); - plcont( z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, + plcont( (const PLFLT **) z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, pltr2, (void *) &cgrid2 ); plstyl( 1, &mark, &space ); plcol0( 3 ); - plcont( w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, + plcont( (const PLFLT **) w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, pltr2, (void *) &cgrid2 ); plstyl( 0, &mark, &space ); plcol0( 1 ); @@ -425,12 +425,12 @@ // pl_setcontlabelparam(0.006, 0.3, 0.1, 1); // plenv(-1.0, 1.0, -1.0, 1.0, 0, 0); // plcol0(2); - // plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, + // plcont((const PLFLT **) z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, // pltr2, (void *) &cgrid2); // // plstyl(1, &mark, &space); // plcol0(3); - // plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, + // plcont((const PLFLT **) w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, // pltr2, (void *) &cgrid2); // plstyl(0, &mark, &space); // plcol0(1); Modified: trunk/examples/c/x11c.c =================================================================== --- trunk/examples/c/x11c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x11c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -114,7 +114,7 @@ } } - plMinMax2dGrid( z, XPTS, YPTS, &zmax, &zmin ); + plMinMax2dGrid( (const PLFLT **) z, XPTS, YPTS, &zmax, &zmin ); step = ( zmax - zmin ) / ( nlevel + 1 ); for ( i = 0; i < nlevel; i++ ) clevel[i] = zmin + step + step * i; @@ -137,19 +137,19 @@ // wireframe plot if ( i == 0 ) - plmesh( x, y, z, XPTS, YPTS, opt[k] ); + plmesh( x, y, (const PLFLT **) z, XPTS, YPTS, opt[k] ); // magnitude colored wireframe plot else if ( i == 1 ) - plmesh( x, y, z, XPTS, YPTS, opt[k] | MAG_COLOR ); + plmesh( x, y, (const PLFLT **) z, XPTS, YPTS, opt[k] | MAG_COLOR ); // magnitude colored wireframe plot with sides else if ( i == 2 ) - plot3d( x, y, z, XPTS, YPTS, opt[k] | MAG_COLOR, 1 ); + plot3d( x, y, (const PLFLT **) z, XPTS, YPTS, opt[k] | MAG_COLOR, 1 ); // magnitude colored wireframe plot with base contour else if ( i == 3 ) - plmeshc( x, y, z, XPTS, YPTS, opt[k] | MAG_COLOR | BASE_CONT, + plmeshc( x, y, (const PLFLT **) z, XPTS, YPTS, opt[k] | MAG_COLOR | BASE_CONT, clevel, nlevel ); plcol0( 3 ); Modified: trunk/examples/c/x14c.c =================================================================== --- trunk/examples/c/x14c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x14c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -419,10 +419,10 @@ plenv( -1.0, 1.0, -1.0, 1.0, 0, 0 ); plcol0( 2 ); - plcont( z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL ); + plcont( (const PLFLT **) z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL ); plstyl( 1, &mark, &space ); plcol0( 3 ); - plcont( w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL ); + plcont( (const PLFLT **) w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL ); plcol0( 1 ); pllab( "X Coordinate", "Y Coordinate", "Streamlines of flow" ); plflush(); Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x16c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -216,7 +216,7 @@ plpsty( 0 ); - plshades( z, nx, ny, NULL, -1., 1., -1., 1., + plshades( (const PLFLT **) z, nx, ny, NULL, -1., 1., -1., 1., shedge, ns + 1, fill_width, cont_color, cont_width, plfill, 1, NULL, NULL ); @@ -225,7 +225,7 @@ plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); plcol0( 2 ); // -// plcont(w, nx, ny, 1, nx, 1, ny, clevel, ns, mypltr, NULL); +// plcont((const PLFLT **) w, nx, ny, 1, nx, 1, ny, clevel, ns, mypltr, NULL); // pllab( "distance", "altitude", "Bogon density" ); @@ -243,7 +243,7 @@ plpsty( 0 ); - plshades( z, nx, ny, NULL, -1., 1., -1., 1., + plshades( (const PLFLT **) z, nx, ny, NULL, -1., 1., -1., 1., shedge, ns + 1, fill_width, cont_color, cont_width, plfill, 1, pltr1, (void *) &cgrid1 ); @@ -252,7 +252,7 @@ plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); plcol0( 2 ); // -// plcont(w, nx, ny, 1, nx, 1, ny, clevel, ns, pltr1, (void *) &cgrid1); +// plcont((const PLFLT **) w, nx, ny, 1, nx, 1, ny, clevel, ns, pltr1, (void *) &cgrid1); // pllab( "distance", "altitude", "Bogon density" ); @@ -270,7 +270,7 @@ plpsty( 0 ); - plshades( z, nx, ny, NULL, -1., 1., -1., 1., + plshades( (const PLFLT **) z, nx, ny, NULL, -1., 1., -1., 1., shedge, ns + 1, fill_width, cont_color, cont_width, plfill, 0, pltr2, (void *) &cgrid2 ); @@ -278,7 +278,7 @@ plcol0( 1 ); plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); plcol0( 2 ); - plcont( w, nx, ny, 1, nx, 1, ny, clevel, ns, pltr2, (void *) &cgrid2 ); + plcont( (const PLFLT **) w, nx, ny, 1, nx, 1, ny, clevel, ns, pltr2, (void *) &cgrid2 ); pllab( "distance", "altitude", "Bogon density, with streamlines" ); @@ -296,7 +296,7 @@ plpsty( 0 ); - plshades( z, nx, ny, NULL, -1., 1., -1., 1., + plshades( (const PLFLT **) z, nx, ny, NULL, -1., 1., -1., 1., shedge, ns + 1, fill_width, 2, 3, plfill, 0, pltr2, (void *) &cgrid2 ); @@ -304,7 +304,7 @@ plcol0( 1 ); plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); plcol0( 2 ); -// plcont(w, nx, ny, 1, nx, 1, ny, clevel, ns, pltr2, (void *) &cgrid2); +// plcont((const PLFLT **) w, nx, ny, 1, nx, 1, ny, clevel, ns, pltr2, (void *) &cgrid2); pllab( "distance", "altitude", "Bogon density" ); @@ -326,7 +326,7 @@ plpsty( 0 ); - plshades( z, nx, ny, zdefined, -1., 1., -1., 1., + plshades( (const PLFLT **) z, nx, ny, zdefined, -1., 1., -1., 1., shedge, ns + 1, fill_width, cont_color, cont_width, plfill, 0, pltr2, (void *) &cgrid2 ); @@ -373,7 +373,7 @@ shedge[i] = zmin + ( zmax - zmin ) * (PLFLT) i / (PLFLT) ns; // Now we can shade the interior region. - plshades( z, nx, ny, NULL, -1., 1., -1., 1., + plshades( (const PLFLT **) z, nx, ny, NULL, -1., 1., -1., 1., shedge, ns + 1, fill_width, cont_color, cont_width, plfill, 0, pltr2, (void *) &cgrid2 ); Modified: trunk/examples/c/x20c.c =================================================================== --- trunk/examples/c/x20c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x20c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -140,7 +140,7 @@ pllab( "...around a blue square.", " ", "A red border should appear..." ); - plimage( z, XDIM, YDIM, + plimage( (const PLFLT **) z, XDIM, YDIM, 1., (PLFLT) XDIM, 1., (PLFLT) YDIM, 0., 0., 1., (PLFLT) XDIM, 1., (PLFLT) YDIM ); } @@ -166,7 +166,7 @@ pllab( "No, an amplitude clipped \"sombrero\"", "", "Saturn?" ); plptex( 2., 2., 3., 4., 0., "Transparent image" ); - plimage( z, XDIM, YDIM, 0., 2. * M_PI, 0., 3. * M_PI, 0.05, 1., + plimage( (const PLFLT **) z, XDIM, YDIM, 0., 2. * M_PI, 0., 3. * M_PI, 0.05, 1., 0., 2. * M_PI, 0., 3. * M_PI ); plFree2dGrid( r, XDIM, YDIM ); @@ -201,7 +201,7 @@ else pllab( "", " ", "Lena..." ); - plimage( img_f, width, height, 1., width, 1., height, 0., 0., + plimage( (const PLFLT **) img_f, width, height, 1., width, 1., height, 0., 0., 1., width, 1., height ); // plend();exit(0); @@ -242,24 +242,24 @@ pladv( 0 ); // display selection only - plimage( img_f, width, height, 1., width, 1., height, 0., 0., xi, xe, ye, yi ); + plimage( (const PLFLT **) img_f, width, height, 1., width, 1., height, 0., 0., xi, xe, ye, yi ); plspause( 1 ); // zoom in selection plenv( xi, xe, ye, yi, 1, -1 ); - plimage( img_f, width, height, 1., width, 1., height, 0., 0., xi, xe, ye, yi ); + plimage( (const PLFLT **) img_f, width, height, 1., width, 1., height, 0., 0., xi, xe, ye, yi ); } // Base the dynamic range on the image contents. - plMinMax2dGrid( img_f, width, height, &img_max, &img_min ); + plMinMax2dGrid( (const PLFLT **) img_f, width, height, &img_max, &img_min ); // Draw a saturated version of the original image. Only use the middle 50% // of the image's full dynamic range. plcol0( 2 ); plenv( 0, width, 0, height, 1, -1 ); pllab( "", "", "Reduced dynamic range image example" ); - plimagefr( img_f, width, height, 0., width, 0., height, 0., 0., img_min + img_max * 0.25, img_max - img_max * 0.25, NULL, NULL ); + plimagefr( (const PLFLT **) img_f, width, height, 0., width, 0., height, 0., 0., img_min + img_max * 0.25, img_max - img_max * 0.25, NULL, NULL ); // Draw a distorted version of the original image, showing its full dynamic range. plenv( 0, width, 0, height, 1, -1 ); @@ -275,7 +275,7 @@ // mypltr. For compatibilty with other language bindings the same effect // can be achieved by generating the transformed grid first and then // using pltr2. - // plimagefr(img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, mypltr, (PLPointer) &stretch); + // plimagefr((const PLFLT **) img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, mypltr, (PLPointer) &stretch); plAlloc2dGrid( &cgrid2.xg, width + 1, height + 1 ); plAlloc2dGrid( &cgrid2.yg, width + 1, height + 1 ); @@ -292,7 +292,7 @@ } } - plimagefr( img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, pltr2, &cgrid2 ); + plimagefr( (const PLFLT **) img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, pltr2, &cgrid2 ); plFree2dGrid( cgrid2.xg, width + 1, height + 1 ); plFree2dGrid( cgrid2.yg, width + 1, height + 1 ); Modified: trunk/examples/c/x21c.c =================================================================== --- trunk/examples/c/x21c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x21c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -261,7 +261,7 @@ } } - plMinMax2dGrid( zg, xp, yp, &lzM, &lzm ); + plMinMax2dGrid( (const PLFLT **) zg, xp, yp, &lzM, &lzm ); lzm = MIN( lzm, zmin ); lzM = MAX( lzM, zmax ); @@ -283,7 +283,7 @@ plenv0( xm, xM, ym, yM, 2, 0 ); plcol0( 15 ); pllab( "X", "Y", title[alg - 1] ); - plshades( zg, xp, yp, NULL, xm, xM, ym, yM, + plshades( (const PLFLT **) zg, xp, yp, NULL, xm, xM, ym, yM, clev, nl, 1, 0, 1, plfill, 1, NULL, NULL ); plcol0( 2 ); } @@ -309,7 +309,7 @@ "bcdfntu", "Z", 0.5, 0 ); plcol0( 15 ); pllab( "", "", title[alg - 1] ); - plot3dc( xg, yg, zg, xp, yp, DRAW_LINEXY | MAG_COLOR | BASE_CONT, clev, nl ); + plot3dc( xg, yg, (const PLFLT **) zg, xp, yp, DRAW_LINEXY | MAG_COLOR | BASE_CONT, clev, nl ); } } } Modified: trunk/examples/c/x22c.c =================================================================== --- trunk/examples/c/x22c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x22c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -85,7 +85,7 @@ plenv( xmin, xmax, ymin, ymax, 0, 0 ); pllab( "(x)", "(y)", "#frPLplot Example 22 - circulation" ); plcol0( 2 ); - plvect( u, v, nx, ny, 0.0, pltr2, (void *) &cgrid2 ); + plvect( (const PLFLT **) u, (const PLFLT **) v, nx, ny, 0.0, pltr2, (void *) &cgrid2 ); plcol0( 1 ); plFree2dGrid( cgrid2.xg, nx, ny ); @@ -153,7 +153,7 @@ plenv( xmin, xmax, ymin, ymax, 0, 0 ); pllab( "(x)", "(y)", "#frPLplot Example 22 - constriction" ); plcol0( 2 ); - plvect( u, v, nx, ny, -0.5, pltr2, (void *) &cgrid2 ); + plvect( (const PLFLT **) u, (const PLFLT **) v, nx, ny, -0.5, pltr2, (void *) &cgrid2 ); plcol0( 1 ); plFree2dGrid( cgrid2.xg, nx, ny ); @@ -275,13 +275,13 @@ } plcol0( 3 ); pllsty( 2 ); - plcont( z, nr, ntheta, 1, nr, 1, ntheta, clevel, nlevel, pltr2, (void *) &cgrid2 ); + plcont( (const PLFLT **) z, nr, ntheta, 1, nr, 1, ntheta, clevel, nlevel, pltr2, (void *) &cgrid2 ); pllsty( 1 ); plcol0( 1 ); // Plot the vectors of the gradient of the potential plcol0( 2 ); - plvect( u, v, nr, ntheta, 25.0, pltr2, (void *) &cgrid2 ); + plvect( (const PLFLT **) u, (const PLFLT **) v, nr, ntheta, 25.0, pltr2, (void *) &cgrid2 ); plcol0( 1 ); // Plot the perimeter of the cylinder Modified: trunk/examples/c/x28c.c =================================================================== --- trunk/examples/c/x28c.c 2011-03-13 20:47:44 UTC (rev 11622) +++ trunk/examples/c/x28c.c 2011-03-14 03:24:23 UTC (rev 11623) @@ -163,7 +163,7 @@ 0.0, " revolution" ); } // Draw minimal 3D grid to finish defining the 3D box. - plmesh( x, y, z, XPTS, YPTS, DRAW_LINEXY ); + plmesh( x, y, (const PLFLT **) z, XPTS, YPTS, DRAW_LINEXY ); // Page 2: Demonstrate rotation of string around its axis. pladv( 0 ); @@ -240,7 +240,7 @@ 0.5, "rotation for z = z#dmin#u" ); } // Draw minimal 3D grid to finish defining the 3D box. - plmesh( x, y, z, XPTS, YPTS, DRAW_LINEXY ); + plmesh( x, y, (const PLFLT **) z, XPTS, YPTS, DRAW_LINEXY ); // Page 3: Demonstrate shear of string along its axis. // Work around xcairo and pngcairo (but not pscairo) problems for @@ -321,7 +321,7 @@ 0.5, "shear for z = z#dmin#u" ); } // Draw minimal 3D grid to finish defining the 3D box. - plmesh( x, y, z, XPTS, YPTS, DRAW_LINEXY ); + plmesh( x, y, (const PLFLT **) z, XPTS, YPTS, DRAW_LINEXY ); // Page 4: Demonstrate drawing a string on a 3D path. pladv( 0 ); @@ -372,7 +372,7 @@ omega += domega; } // Draw minimal 3D grid to finish defining the 3D box. - plmesh( x, y, z, XPTS, YPTS, DRAW_LINEXY ); + plmesh( x, y, (const PLFLT **) z, XPTS, YPTS, DRAW_LINEXY ); // Page 5: Demonstrate plmtex3 axis labelling capability pladv( 0 ); @@ -400,7 +400,7 @@ plmtex3( "zs", -2.5, 0.5, 0.5, "Arbitrarily displaced" ); plmtex3( "zs", -1.0, 0.5, 0.5, "secondary Z-axis label" ); // Draw minimal 3D grid to finish defining the 3D box. - plmesh( x, y, z, XPTS, YPTS, DRAW_LINEXY ); + plmesh( x, y, (const PLFLT **) z, XPTS, YPTS, DRAW_LINEXY ); // Clean up. free( (void *) x ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-16 08:18:25
|
Revision: 11628 http://plplot.svn.sourceforge.net/plplot/?rev=11628&view=rev Author: airwin Date: 2011-03-16 08:18:19 +0000 (Wed, 16 Mar 2011) Log Message: ----------- Replace HAVE_PTHREAD ==> PL_HAVE_PTHREAD HAVE_QHULL ==> PL_HAVE_QHULL everywhere to avoid nameclash with HAVE_PTHREAD and HAVE_QHULL macros defined in the Octave headers. This change gets rid of two compiler warning messages. Modified Paths: -------------- trunk/README.release trunk/bindings/python/plplotcmodule.i trunk/bindings/tk/tkMain.c trunk/cmake/modules/csiro.cmake trunk/cmake/modules/summary.cmake trunk/cmake/modules/xwin.cmake trunk/config.h.cmake trunk/drivers/xwin.c trunk/include/plxwd.h trunk/lib/nn/CMakeLists.txt trunk/src/CMakeLists.txt trunk/src/plgridd.c Modified: trunk/README.release =================================================================== --- trunk/README.release 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/README.release 2011-03-16 08:18:19 UTC (rev 11628) @@ -41,9 +41,10 @@ results if you use these stream variables directly (only possible in C/C++) or use plgvpw. -IV. As of release 5.9.2 we have set HAVE_PTHREAD to ON by default for all -platforms other than Darwin. Darwin will follow later once it appears the -Apple version of X supports it. +IV. As of release 5.9.2 we have set HAVE_PTHREAD (now called +PL_HAVE_PTHREAD as of release 5.9.8) to ON by default for all +platforms other than Darwin. Darwin will follow later once it appears +the Apple version of X supports it. V. As of release 5.9.3 our build system requires CMake version 2.6.0 or higher. Modified: trunk/bindings/python/plplotcmodule.i =================================================================== --- trunk/bindings/python/plplotcmodule.i 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/bindings/python/plplotcmodule.i 2011-03-16 08:18:19 UTC (rev 11628) @@ -926,7 +926,7 @@ /* grab the Global Interpreter Lock to be sure threads don't mess us up */ MY_BLOCK_THREADS /* build the argument list */ -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD px = PyArray_SimpleNewFromData(1, &nn, NPY_PLFLT,(void *)x); py = PyArray_SimpleNewFromData(1, &nn, NPY_PLFLT,(void *)y); #else Modified: trunk/bindings/tk/tkMain.c =================================================================== --- trunk/bindings/tk/tkMain.c 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/bindings/tk/tkMain.c 2011-03-16 08:18:19 UTC (rev 11628) @@ -185,7 +185,7 @@ char buf[20]; int code; -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD XInitThreads(); #endif Modified: trunk/cmake/modules/csiro.cmake =================================================================== --- trunk/cmake/modules/csiro.cmake 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/cmake/modules/csiro.cmake 2011-03-16 08:18:19 UTC (rev 11628) @@ -19,14 +19,14 @@ # Module for determining all configuration variables for the CSIRO libraries. -option(HAVE_QHULL "Enable use of the Qhull library" ON) +option(PL_HAVE_QHULL "Enable use of the Qhull library" ON) option(WITH_CSA "Enable use of the csa library" ON) # This logic copied verbatim from csiro.ac for ix86 systems and alpha systems # with two possible compilers. In future, this logic will need to be # expanded to a lot more cases as we gain platform experience. set(NAN_CFLAGS ${CMAKE_C_FLAGS}) -if(HAVE_QHULL OR WITH_CSA) +if(PL_HAVE_QHULL OR WITH_CSA) if(CMAKE_SYSTEM_PROCESSOR MATCHES "i[0-9]86") set(NAN_CFLAGS "${NAN_CFLAGS} -mieee-fp") else(CMAKE_SYSTEM_PROCESSOR MATCHES "i[0-9]86") @@ -57,8 +57,8 @@ ) else(NaNAwareCCompiler) message(STATUS "Check for NaN awareness in C compiler - not found") - message(STATUS "WARNING: Setting HAVE_QHULL and WITH_CSA to OFF.") - set(HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) + message(STATUS "WARNING: Setting PL_HAVE_QHULL and WITH_CSA to OFF.") + set(PL_HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) set(WITH_CSA OFF CACHE BOOL "Enable use of the csa library" FORCE) file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining whether C compiler is NaN aware failed with " @@ -66,9 +66,9 @@ ) endif(NaNAwareCCompiler) endif(NOT DEFINED NaNAwareCCompiler) -endif(HAVE_QHULL OR WITH_CSA) +endif(PL_HAVE_QHULL OR WITH_CSA) -if(HAVE_QHULL) +if(PL_HAVE_QHULL) find_package(QHULL) if(QHULL_FOUND) include(CheckFunctionExists) @@ -82,13 +82,13 @@ filter_rpath(QHULL_RPATH) message(STATUS "QHULL_RPATH = ${QHULL_RPATH}") else(QH_NEW_EXIST) - message(STATUS "WARNING: function qh_new_qhull not found. Setting HAVE_QHULL to OFF.") - set(HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) + message(STATUS "WARNING: function qh_new_qhull not found. Setting PL_HAVE_QHULL to OFF.") + set(PL_HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) endif(QH_NEW_EXIST) else(QHULL_FOUND) message(STATUS - "WARNING: qhull library not found. Setting HAVE_QHULL to OFF." + "WARNING: qhull library not found. Setting PL_HAVE_QHULL to OFF." ) - set(HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) + set(PL_HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) endif(QHULL_FOUND) -endif(HAVE_QHULL) +endif(PL_HAVE_QHULL) Modified: trunk/cmake/modules/summary.cmake =================================================================== --- trunk/cmake/modules/summary.cmake 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/cmake/modules/summary.cmake 2011-03-16 08:18:19 UTC (rev 11628) @@ -105,8 +105,8 @@ BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS} PL_DOUBLE: ${PL_DOUBLE} Optional libraries: -HAVE_QHULL: ${HAVE_QHULL} WITH_CSA: ${WITH_CSA} -HAVE_FREETYPE: ${HAVE_FREETYPE} HAVE_PTHREAD: ${HAVE_PTHREAD} +PL_HAVE_QHULL: ${PL_HAVE_QHULL} WITH_CSA: ${WITH_CSA} +HAVE_FREETYPE: ${HAVE_FREETYPE} PL_HAVE_PTHREAD: ${PL_HAVE_PTHREAD} HAVE_AGG: ${HAVE_AGG} Language Bindings: Modified: trunk/cmake/modules/xwin.cmake =================================================================== --- trunk/cmake/modules/xwin.cmake 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/cmake/modules/xwin.cmake 2011-03-16 08:18:19 UTC (rev 11628) @@ -25,26 +25,26 @@ # device. # xwin_LINK_FLAGS - individual LINK_FLAGS for dynamic xwin device. # DRIVERS_LINK_FLAGS - list of LINK_FLAGS for all static devices. -# HAVE_PTHREAD - ON means use pthreads with xwin driver. +# PL_HAVE_PTHREAD - ON means use pthreads with xwin driver. # PLPLOT_MUTEX_RECURSIVE - Portable definition for PTHREAD_MUTEX_RECURSIVE if(PLD_xwin) if(X11_FOUND) set(xwin_COMPILE_FLAGS "${X11_COMPILE_FLAGS}") set(xwin_LINK_FLAGS "${X11_LIBRARIES}") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # turn HAVE_PTHREAD OFF by default for Mac OS X since it doesn't + # turn PL_HAVE_PTHREAD OFF by default for Mac OS X since it doesn't # work for Mac OS X 10.4. Werner says it does work for vanilla # XQuartz X11, but the official Apple version of X(Quartz) for 10.5 # doesn't have all the fixes of the vanilla version so he doesn't trust # it. This his advice for now is to be conservative until we can # get a clear report that official X works for 10.5. - option(HAVE_PTHREAD "Use pthreads with the xwin driver" OFF) + option(PL_HAVE_PTHREAD "Use pthreads with the xwin driver" OFF) else(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # Turn HAVE_PTHREAD ON by default for other platforms now that + # Turn PL_HAVE_PTHREAD ON by default for other platforms now that # the tk segmentation fault has been cured. - option(HAVE_PTHREAD "Use pthreads with the xwin driver" ON) + option(PL_HAVE_PTHREAD "Use pthreads with the xwin driver" ON) endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - if(HAVE_PTHREAD) + if(PL_HAVE_PTHREAD) find_package(Threads) if(CMAKE_USE_PTHREADS_INIT) set(xwin_LINK_FLAGS ${xwin_LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT}) @@ -60,9 +60,9 @@ # I am being super-careful here to follow the autotools model. In # fact, it is possible other thread systems will work as well as # pthreads. So something to investigate for later. - set(HAVE_PTHREAD OFF) + set(PL_HAVE_PTHREAD OFF) endif(CMAKE_USE_PTHREADS_INIT) - endif(HAVE_PTHREAD) + endif(PL_HAVE_PTHREAD) set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${xwin_LINK_FLAGS}) else(X11_FOUND) set(PLD_xwin OFF CACHE BOOL "Enable xwin device" FORCE) Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/config.h.cmake 2011-03-16 08:18:19 UTC (rev 11628) @@ -125,10 +125,10 @@ #cmakedefine HAVE_NSGETARGC // Define if pthreads is available -#cmakedefine HAVE_PTHREAD +#cmakedefine PL_HAVE_PTHREAD // Define if Qhull is available -#cmakedefine HAVE_QHULL +#cmakedefine PL_HAVE_QHULL // Define to 1 if you have the <stdlib.h> header file. #cmakedefine HAVE_STDLIB_H 1 Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/drivers/xwin.c 2011-03-16 08:18:19 UTC (rev 11628) @@ -35,7 +35,7 @@ #include "drivers.h" #include "plevent.h" -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD #include <pthread.h> #include <signal.h> int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int kind ); @@ -259,13 +259,13 @@ pls->dev_fastimg = 1; // is a fast image device pls->dev_xor = 1; // device support xor mode -#ifndef HAVE_PTHREAD +#ifndef PL_HAVE_PTHREAD usepthreads = 0; #endif plParseDrvOpts( xwin_options ); -#ifndef HAVE_PTHREAD +#ifndef PL_HAVE_PTHREAD if ( usepthreads ) plwarn( "You said you want pthreads, but they are not available." ); #endif @@ -304,7 +304,7 @@ plP_setpxl( pxlx, pxly ); plP_setphy( xmin, xmax, ymin, ymax ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) { pthread_mutexattr_t mutexatt; @@ -363,7 +363,7 @@ dbug_enter( "plD_line_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -384,7 +384,7 @@ if ( dev->write_to_pixmap ) XDrawLine( xwd->display, dev->pixmap, dev->gc, x1, y1, x2, y2 ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -435,7 +435,7 @@ dbug_enter( "plD_polyline_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -456,7 +456,7 @@ XDrawLines( xwd->display, dev->pixmap, dev->gc, pts, npts, CoordModeOrigin ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -481,7 +481,7 @@ dbug_enter( "plD_eop_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -493,7 +493,7 @@ if ( dev->is_main && !pls->nopause ) WaitForPage( pls ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -513,7 +513,7 @@ dbug_enter( "plD_bop_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -532,7 +532,7 @@ XSync( xwd->display, 0 ); pls->page++; -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -552,7 +552,7 @@ dbug_enter( "plD_tidy_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) { pthread_mutex_lock( &events_mutex ); @@ -603,7 +603,7 @@ dbug_enter( "plD_state_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -676,7 +676,7 @@ break; } -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -717,7 +717,7 @@ { dbug_enter( "plD_esc_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -788,7 +788,7 @@ break; } -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -976,7 +976,7 @@ xwd->nstreams = 1; // Open display -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) if ( !XInitThreads() ) plexit( "xwin: XInitThreads() not successful." ); @@ -1310,7 +1310,7 @@ // //-------------------------------------------------------------------------- -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD static void events_thread( void *pls ) { Modified: trunk/include/plxwd.h =================================================================== --- trunk/include/plxwd.h 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/include/plxwd.h 2011-03-16 08:18:19 UTC (rev 11628) @@ -9,7 +9,7 @@ #include "plplot.h" #include "plstrm.h" -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD #include <pthread.h> #endif @@ -104,7 +104,7 @@ XPoint xhair_x[2], xhair_y[2]; // Crosshair lines void ( *MasterEH )( PLStream *, XEvent * ); // Master X event handler -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD pthread_t updater; // The X events updater thread id #endif } XwDev; Modified: trunk/lib/nn/CMakeLists.txt =================================================================== --- trunk/lib/nn/CMakeLists.txt 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/lib/nn/CMakeLists.txt 2011-03-16 08:18:19 UTC (rev 11628) @@ -19,7 +19,7 @@ # along with PLplot; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -if(HAVE_QHULL) +if(PL_HAVE_QHULL) set(csironn_LIB_SRCS delaunay.c @@ -61,4 +61,4 @@ install(FILES README DESTINATION ${DOC_DIR} RENAME README.nn) install(FILES README.1st DESTINATION ${DOC_DIR} RENAME README.1st.nn) -endif(HAVE_QHULL) +endif(PL_HAVE_QHULL) Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/src/CMakeLists.txt 2011-03-16 08:18:19 UTC (rev 11628) @@ -220,7 +220,7 @@ ) endif(WITH_CSA) -if(HAVE_QHULL) +if(PL_HAVE_QHULL) set( libplplot${LIB_TAG}_LINK_LIBRARIES ${libplplot${LIB_TAG}_LINK_LIBRARIES} @@ -244,7 +244,7 @@ # Needed by the traditional pkg-config approach for installed examples # as well as the new CMake-based build system for the installed examples. set(LIB_INSTALL_RPATH ${LIB_INSTALL_RPATH} ${QHULL_RPATH}) -endif(HAVE_QHULL) +endif(PL_HAVE_QHULL) if(NOT ENABLE_DYNDRIVERS AND PLD_cgm) list(APPEND libplplot${LIB_TAG}_LINK_LIBRARIES nistcd) Modified: trunk/src/plgridd.c =================================================================== --- trunk/src/plgridd.c 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/src/plgridd.c 2011-03-16 08:18:19 UTC (rev 11628) @@ -30,7 +30,7 @@ #endif #include "../lib/csa/nan.h" // this is handy -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL #include "../lib/nn/nn.h" #include <qhull/qhull_a.h> #endif @@ -58,7 +58,7 @@ PLF2OPS zops, PLPointer zgp ); #endif -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL static void grid_nni( const PLFLT *x, const PLFLT *y, const PLFLT *z, int npts, const PLFLT *xg, int nptsx, const PLFLT *yg, int nptsy, @@ -180,7 +180,7 @@ break; case ( GRID_DTLI ): // Delaunay Triangulation Linear Interpolation -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL grid_dtli( x, y, z, npts, xg, nptsx, yg, nptsy, zops, zgp ); #else plwarn( "plgriddata(): you must have the Qhull library installed to use GRID_DTLI.\n Reverting to GRID_NNAIDW." ); @@ -189,7 +189,7 @@ break; case ( GRID_NNI ): // Natural Neighbors -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL grid_nni( x, y, z, npts, xg, nptsx, yg, nptsy, zops, zgp, data ); #else plwarn( "plgriddata(): you must have the Qhull library installed to use GRID_NNI.\n Reverting to GRID_NNAIDW." ); @@ -557,7 +557,7 @@ } } -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL // // Delaunay Triangulation Linear Interpolation using Pavel Sakov's nn package // @@ -715,7 +715,7 @@ free( pin ); free( pgrid ); } -#endif // HAVE_QHULL +#endif // PL_HAVE_QHULL // // this function just calculates the K Nearest Neighbors of grid point This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-03-17 20:05:35
|
Revision: 11639 http://plplot.svn.sourceforge.net/plplot/?rev=11639&view=rev Author: andrewross Date: 2011-03-17 20:05:27 +0000 (Thu, 17 Mar 2011) Log Message: ----------- Tidy up plplot API. Remove plParseOpts, plHLS_RGB, plRGB_HLS, plarrows which were all in src/pldeprecated.c and have been marked for deletion for some time. Move plrgb, plrgb1 and plhls which are marked as obsolete and not to be used into src/pldeprecated.c to formally deprecate them. The functions in pldeprecated.c are now wrapped with #ifdef PL_DEPRECATED statements. Add -DPL_DEPRECATED=ON to the cmake command line to enable support for these. Remove the compatibility macros for plcol, plpage, plclr, plcontf, Alloc2dGrid, Free2dGrid, MinMax2dGrid, plP_gvpd, plP_gvpw, plotsh3d. These versions have been hanging around for a long time and are marked as obsolete. Update bindings to remove mentions of the above. For C, C++, f77, f90 the deprecated functions are #ifdef'd out. For swig generated langauges the support was already disabled. For ada it is commented out in the code. Update plplot code and examples to remove all mentions of plcol, plrgb, plrgb1, plhls, plParseOpt. Update documentation accordingly. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/bindings/c++/plstream.cc trunk/bindings/c++/plstream.h trunk/bindings/f77/plstubs.h trunk/bindings/f77/scstubs.c trunk/bindings/f95/plstubs.h trunk/bindings/f95/scstubs.c trunk/bindings/gnome2/lib/plplotcanvas.c trunk/bindings/swig-support/plplotcapi.i trunk/bindings/tcl/plapi.tpl trunk/bindings/tcl/tclAPI.c trunk/bindings/tk/PLWin.itk trunk/bindings/tk/plr.c trunk/bindings/wxwidgets/wxPLplotstream.cpp trunk/config.h.cmake trunk/doc/docbook/src/api-obsolete.xml trunk/examples/tk/xtk01.c trunk/examples/tk/xtk02.c trunk/include/plplot.h trunk/src/plargs.c trunk/src/plcore.c trunk/src/plctrl.c trunk/src/pldeprecated.c trunk/src/plstripc.c Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot.adb 2011-03-17 20:05:27 UTC (rev 11639) @@ -1798,13 +1798,13 @@ -- Set current color (map 0) by hue, lightness, and saturation. -- plhls - procedure Set_Color_HLS - (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. - Lightness_Component : Long_Float_0_1_Type; - Saturation_Component : Long_Float_0_1_Type) is - begin - plhls(Hue_Component, Lightness_Component, Saturation_Component); - end Set_Color_HLS; + -- procedure Set_Color_HLS + -- (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. + -- Lightness_Component : Long_Float_0_1_Type; + -- Saturation_Component : Long_Float_0_1_Type) is + -- begin + -- plhls(Hue_Component, Lightness_Component, Saturation_Component); + -- end Set_Color_HLS; -- Functions for converting between HLS and RGB color space @@ -2165,20 +2165,21 @@ end Replot; + -- This deprecated - commented out -- Set line color by red, green, blue from 0.0 to 1.0 -- plrgb - procedure Set_Line_Color_RGB_0_1(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type) is - begin - plrgb(Red_Component, Blue_Component, Green_Component); - end Set_Line_Color_RGB_0_1; + -- procedure Set_Line_Color_RGB_0_1(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type) is + -- begin + -- plrgb(Red_Component, Blue_Component, Green_Component); + -- end Set_Line_Color_RGB_0_1; -- Set line color by 8 bit RGB values. -- plrgb1 - procedure Set_Line_Color_RGB_0_255(Red_Component, Blue_Component, Green_Component : Integer) is - begin - plrgb1(Red_Component, Blue_Component, Green_Component); - end Set_Line_Color_RGB_0_255; + -- procedure Set_Line_Color_RGB_0_255(Red_Component, Blue_Component, Green_Component : Integer) is + -- begin + -- plrgb1(Red_Component, Blue_Component, Green_Component); + -- end Set_Line_Color_RGB_0_255; -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot.ads 2011-03-17 20:05:27 UTC (rev 11639) @@ -1121,10 +1121,10 @@ -- Set current color (map 0) by hue, lightness, and saturation. -- plhls - procedure Set_Color_HLS - (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. - Lightness_Component : Long_Float_0_1_Type; - Saturation_Component : Long_Float_0_1_Type); + -- procedure Set_Color_HLS + -- (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. + -- Lightness_Component : Long_Float_0_1_Type; + -- Saturation_Component : Long_Float_0_1_Type); -- Functions for converting between HLS and RGB color space @@ -1357,12 +1357,12 @@ -- Set line color by red, green, blue from 0.0 to 1.0 -- plrgb - procedure Set_Line_Color_RGB_0_1(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type); + -- procedure Set_Line_Color_RGB_0_1(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type); -- Set line color by 8 bit RGB values. -- plrgb1 - procedure Set_Line_Color_RGB_0_255(Red_Component, Blue_Component, Green_Component : Integer); + -- procedure Set_Line_Color_RGB_0_255(Red_Component, Blue_Component, Green_Component : Integer); -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot_thin.ads 2011-03-17 20:05:27 UTC (rev 11639) @@ -975,9 +975,9 @@ -- Set current color (map 0) by hue, lightness, and saturation. - procedure - plhls(h : PLFLT; l : PLFLT; s : PLFLT); - pragma Import(C, plhls, "c_plhls"); + -- procedure + -- plhls(h : PLFLT; l : PLFLT; s : PLFLT); + -- pragma Import(C, plhls, "c_plhls"); -- Functions for converting between HLS and RGB color space @@ -1215,16 +1215,16 @@ -- Set line color by red, green, blue from 0. to 1. - procedure - plrgb(r : PLFLT; g : PLFLT; b : PLFLT); - pragma Import(C, plrgb, "c_plrgb"); + -- procedure + -- plrgb(r : PLFLT; g : PLFLT; b : PLFLT); + -- pragma Import(C, plrgb, "c_plrgb"); -- Set line color by 8 bit RGB values. - procedure - plrgb1(r : PLINT; g : PLINT; b : PLINT); - pragma Import(C, plrgb1, "c_plrgb1"); + -- procedure + -- plrgb1(r : PLINT; g : PLINT; b : PLINT); + -- pragma Import(C, plrgb1, "c_plrgb1"); -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot_traditional.adb 2011-03-17 20:05:27 UTC (rev 11639) @@ -1734,13 +1734,13 @@ -- Set current color (map 0) by hue, lightness, and saturation. - procedure plhls - (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. - Lightness_Component : Long_Float_0_1_Type; - Saturation_Component : Long_Float_0_1_Type) is - begin - PLplot_Thin.plhls(Hue_Component, Lightness_Component, Saturation_Component); - end plhls; + -- procedure plhls + -- (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. + -- Lightness_Component : Long_Float_0_1_Type; + -- Saturation_Component : Long_Float_0_1_Type) is + -- begin + -- PLplot_Thin.plhls(Hue_Component, Lightness_Component, Saturation_Component); + -- end plhls; -- Functions for converting between HLS and RGB color space @@ -2075,17 +2075,17 @@ -- Set line color by red, green, blue from 0.0 to 1.0 - procedure plrgb(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type) is - begin - PLplot_Thin.plrgb(Red_Component, Blue_Component, Green_Component); - end plrgb; + -- procedure plrgb(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type) is + -- begin + -- PLplot_Thin.plrgb(Red_Component, Blue_Component, Green_Component); + -- end plrgb; -- Set line color by 8 bit RGB values. - procedure plrgb1(Red_Component, Blue_Component, Green_Component : Integer) is - begin - PLplot_Thin.plrgb1(Red_Component, Blue_Component, Green_Component); - end plrgb1; + -- procedure plrgb1(Red_Component, Blue_Component, Green_Component : Integer) is + -- begin + -- PLplot_Thin.plrgb1(Red_Component, Blue_Component, Green_Component); + -- end plrgb1; -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot_traditional.ads 2011-03-17 20:05:27 UTC (rev 11639) @@ -1052,10 +1052,10 @@ -- Set current color (map 0) by hue, lightness, and saturation. - procedure plhls - (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. - Lightness_Component : Long_Float_0_1_Type; - Saturation_Component : Long_Float_0_1_Type); + -- procedure plhls + -- (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. + -- Lightness_Component : Long_Float_0_1_Type; + -- Saturation_Component : Long_Float_0_1_Type); -- Functions for converting between HLS and RGB color space @@ -1258,11 +1258,11 @@ -- Set line color by red, green, blue from 0.0 to 1.0 - procedure plrgb(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type); + -- procedure plrgb(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type); -- Set line color by 8 bit RGB values. - procedure plrgb1(Red_Component, Blue_Component, Green_Component : Integer); + -- procedure plrgb1(Red_Component, Blue_Component, Green_Component : Integer); -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/c++/plstream.cc 2011-03-17 20:05:27 UTC (rev 11639) @@ -328,6 +328,7 @@ plarc( x, y, a, b, angle1, angle2, fill ); } +#ifdef PL_DEPRECATED void plstream::arrows( const PLFLT *u, const PLFLT *v, const PLFLT *x, const PLFLT *y, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy ) @@ -336,6 +337,7 @@ plarrows( u, v, x, y, n, scale, dx, dy ); } +#endif // PL_DEPRECATED void plstream::vect( const PLFLT * const *u, const PLFLT * const *v, PLINT nx, PLINT ny, PLFLT scale, @@ -953,12 +955,14 @@ // Set current color (map 0) by hue, lightness, and saturation. +#ifdef PL_DEPRECATED void plstream::hls( PLFLT h, PLFLT l, PLFLT s ) { set_stream(); plhls( h, l, s ); } +#endif // PL_DEPRECATED // Initializes PLplot, using preset or default options @@ -1337,21 +1341,25 @@ // Set line color by red, green, blue from 0. to 1. +#ifdef PL_DEPRECATED void plstream::rgb( PLFLT r, PLFLT g, PLFLT b ) { set_stream(); plrgb( r, g, b ); } +#endif // PL_DEPRECATED // Set line color by 8 bit RGB values. +#ifdef PL_DEPRECATED void plstream::rgb( PLINT r, PLINT g, PLINT b ) { set_stream(); plrgb1( r, g, b ); } +#endif // PL_DEPRECATED // Set character height. @@ -2545,21 +2553,25 @@ } // Depreciated version - use setopt instead. +#ifdef PL_DEPRECATED int plstream::SetOpt( const char *opt, const char *optarg ) { set_stream(); return ::plsetopt( opt, optarg ); } +#endif // PL_DEPRECATED // Process options list using current options info. +#ifdef PL_DEPRECATED int plstream::ParseOpts( int *p_argc, const char **argv, PLINT mode ) { set_stream(); return ::plParseOpts( p_argc, argv, mode ); } +#endif // PL_DEPRECATED // Print usage & syntax message. Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/c++/plstream.h 2011-03-17 20:05:27 UTC (rev 11639) @@ -125,8 +125,10 @@ PLBOOL fill ); // Simple arrow plotter +#ifdef PL_DEPRECATED void arrows( const PLFLT *u, const PLFLT *v, const PLFLT *x, const PLFLT *y, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy ); +#endif // PL_DEPRECATED void vect( const PLFLT * const *u, const PLFLT * const *v, PLINT nx, PLINT ny, PLFLT scale, void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), @@ -408,7 +410,9 @@ // Set current color (map 0) by hue, lightness, and saturation. +#ifdef PL_DEPRECATED void hls( PLFLT h, PLFLT l, PLFLT s ); +#endif // PL_DEPRECATED // Initializes PLplot, using preset or default options @@ -574,11 +578,15 @@ // Set line color by red, green, blue from 0. to 1. +#ifdef PL_DEPRECATED void rgb( PLFLT r, PLFLT g, PLFLT b ); +#endif // PL_DEPRECATED // Set line color by 8 bit RGB values. +#ifdef PL_DEPRECATED void rgb( PLINT r, PLINT g, PLINT b ); +#endif // PL_DEPRECATED // Set character height. Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/f77/plstubs.h 2011-03-17 20:05:27 UTC (rev 11639) @@ -235,7 +235,6 @@ #define PLGYAX FNAME( PLGYAX, plgyax ) #define PLGZAX FNAME( PLGZAX, plgzax ) #define PLHIST FNAME( PLHIST, plhist ) -#define PLHLS FNAME( PLHLS, plhls ) #define PLHLSRGB FNAME( PLHLSRGB, plhlsrgb ) #define PLIMAGE FNAME( PLIMAGE, plimage ) #define PLIMAGEFR07 FNAME( PLIMAGEFR07, plimagefr07 ) @@ -273,8 +272,6 @@ #define PLPTEX37 FNAME( PLPTEX37, plptex37 ) #define PLRANDD FNAME( PLRANDD, plrandd ) #define PLREPLOT FNAME( PLREPLOT, plreplot ) -#define PLRGB FNAME( PLRGB, plrgb ) -#define PLRGB1 FNAME( PLRGB1, plrgb1 ) #define PLRGBHLS FNAME( PLRGBHLS, plrgbhls ) #define PLSCHR FNAME( PLSCHR, plschr ) #define PLSCMAP0 FNAME( PLSCMAP0, plscmap0 ) @@ -360,4 +357,13 @@ #define PLWIND FNAME( PLWIND, plwind ) #define PLXORMOD FNAME( PLXORMOD, plxormod ) +// The following are deprecated and will be removed in future versions of plplot +#ifdef PL_DEPRECATED + +#define PLRGB FNAME( PLRGB, plrgb ) +#define PLRGB1 FNAME( PLRGB1, plrgb1 ) +#define PLHLS FNAME( PLHLS, plhls ) + +#endif // PL_DEPRECATED + #endif // __PLSTUBS_H__ Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/f77/scstubs.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -449,11 +449,13 @@ c_plhist( *n, data, *datmin, *datmax, *nbin, *oldwin ); } +#ifdef PL_DEPRECATED void PLHLS( PLFLT *hue, PLFLT *light, PLFLT *sat ) { c_plhls( *hue, *light, *sat ); } +#endif // PL_DEPRECATED void PLHLSRGB( PLFLT *h, PLFLT *l, PLFLT *s, PLFLT *r, PLFLT *g, PLFLT *b ) @@ -748,17 +750,21 @@ c_plreplot(); } +#ifdef PL_DEPRECATED void PLRGB( PLFLT *red, PLFLT *green, PLFLT *blue ) { c_plrgb( *red, *green, *blue ); } +#endif // PL_DEPRECATED +#ifdef PL_DEPRECATED void PLRGB1( PLINT *r, PLINT *g, PLINT *b ) { c_plrgb1( *r, *g, *b ); } +#endif // PL_DEPRECATED void PLRGBHLS( PLFLT *r, PLFLT *g, PLFLT *b, PLFLT *h, PLFLT *l, PLFLT *s ) Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/f95/plstubs.h 2011-03-17 20:05:27 UTC (rev 11639) @@ -235,7 +235,6 @@ #define PLGYAX FNAME( PLGYAX, plgyax ) #define PLGZAX FNAME( PLGZAX, plgzax ) #define PLHIST FNAME( PLHISTF77, plhistf77 ) -#define PLHLS FNAME( PLHLS, plhls ) #define PLHLSRGB FNAME( PLHLSRGB, plhlsrgb ) #define PLIMAGE FNAME( PLIMAGEF77, plimagef77 ) #define PLIMAGEFR07 FNAME( PLIMAGEFR07, plimagefr07 ) @@ -280,8 +279,6 @@ #define PLPTEX37 FNAME( PLPTEX37, plptex37 ) #define PLRANDD FNAME( PLRANDDF77, plranddf77 ) #define PLREPLOT FNAME( PLREPLOT, plreplot ) -#define PLRGB FNAME( PLRGB, plrgb ) -#define PLRGB1 FNAME( PLRGB1, plrgb1 ) #define PLRGBHLS FNAME( PLRGBHLS, plrgbhls ) #define PLSCHR FNAME( PLSCHR, plschr ) #define PLSCMAP0 FNAME( PLSCMAP0F77, plscmap0f77 ) @@ -371,4 +368,10 @@ #define PLWIND FNAME( PLWIND, plwind ) #define PLXORMOD FNAME( PLXORMODF77, plxormodf77 ) +#ifdef PL_DEPRECATE +#define PLRGB FNAME( PLRGB, plrgb ) +#define PLRGB1 FNAME( PLRGB1, plrgb1 ) +#define PLHLS FNAME( PLHLS, plhls ) +#endif // PL_DEPRECATED + #endif // __PLSTUBS_H__ Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/f95/scstubs.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -459,11 +459,13 @@ c_plhist( *n, data, *datmin, *datmax, *nbin, *oldwin ); } +#ifdef PL_DEPRECATED void PLHLS( PLFLT *hue, PLFLT *light, PLFLT *sat ) { c_plhls( *hue, *light, *sat ); } +#endif // PL_DEPRECATED void PLHLSRGB( PLFLT *h, PLFLT *l, PLFLT *s, PLFLT *r, PLFLT *g, PLFLT *b ) @@ -787,17 +789,21 @@ c_plreplot(); } +#ifdef PL_DEPRECATED void PLRGB( PLFLT *red, PLFLT *green, PLFLT *blue ) { c_plrgb( *red, *green, *blue ); } +#endif // PL_DEPRECATED +#ifdef PL_DEPRECATED void PLRGB1( PLINT *r, PLINT *g, PLINT *b ) { c_plrgb1( *r, *g, *b ); } +#endif // PL_DEPRECATED void PLRGBHLS( PLFLT *r, PLFLT *g, PLFLT *b, PLFLT *h, PLFLT *l, PLFLT *s ) Modified: trunk/bindings/gnome2/lib/plplotcanvas.c =================================================================== --- trunk/bindings/gnome2/lib/plplotcanvas.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/gnome2/lib/plplotcanvas.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -199,12 +199,6 @@ // simple arrow plotter. -// deprecated in core so remove this. -// void plplot_canvas_arrows(PlplotCanvas* self, PLFLT *u, PLFLT *v, PLFLT *x, PLFLT *y, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy) { -// plsstrm(self->Nstream); -// plarrows(u, v, x, y, n, scale, dx, dy) ; -// } - void plplot_canvas_vect( PlplotCanvas* self, PLFLT **u, PLFLT **v, PLINT nx, PLINT ny, PLFLT scale, void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), PLPointer pltr_data ) { plsstrm( self->Nstream ); @@ -626,11 +620,13 @@ // Set current color (map 0) by hue, lightness, and saturation. +#ifdef PL_DEPRECATED void plplot_canvas_hls( PlplotCanvas* self, PLFLT h, PLFLT l, PLFLT s ) { plsstrm( self->Nstream ); plhls( h, l, s ); } +#endif // PL_DEPRECATED // /\* Initializes PLplot, using preset or default options *\/ @@ -823,6 +819,7 @@ plreplot(); } +#ifdef PL_DEPRECATED // Set line color by red, green, blue from 0. to 1. void plplot_canvas_rgb( PlplotCanvas* self, PLFLT r, PLFLT g, PLFLT b ) @@ -838,6 +835,7 @@ plsstrm( self->Nstream ); plrgb1( r, g, b ); } +#endif // PL_DEPRECATED // Set character height. Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/swig-support/plplotcapi.i 2011-03-17 20:05:27 UTC (rev 11639) @@ -246,17 +246,7 @@ // Non-common API that are included here because they traditionally // were part of plmodule.c. -#if 0 -// Deprecated function that we no longer want to propagate to the -// python API. - void -plarrows( const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk, const PLFLT *ArrayCk, PLINT n, - PLFLT scale, PLFLT dx, PLFLT dy ); - -#endif - -void plsxwin( PLINT window_id ); #endif // SWIG_PYTHON @@ -456,15 +446,7 @@ plhist( PLINT n, const PLFLT *Array, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT oldwin ); -#if 0 -// Deprecated function that we no longer want to propagate to the -// python API. - void -plhls( PLFLT h, PLFLT l, PLFLT s ); -#endif - -void plhlsrgb( PLFLT h, PLFLT l, PLFLT s, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); void @@ -839,12 +821,6 @@ // propagate them to the python API. void -plrgb( PLFLT r, PLFLT g, PLFLT b ); - -void -plrgb1( PLINT r, PLINT g, PLINT b ); - -void plshade1( const PLFLT *Matrix, PLINT nx, PLINT ny, defined_func df, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/tcl/plapi.tpl 2011-03-17 20:05:27 UTC (rev 11639) @@ -459,10 +459,10 @@ # Set current color (map 0) by hue, lightness, and saturation. -pltclcmd plhls void -h PLFLT -l PLFLT -s PLFLT +#pltclcmd plhls void +#h PLFLT +#l PLFLT +#s PLFLT # Function to transform from HLS to RGB color space. @@ -630,17 +630,17 @@ # Set line color by red, green, blue from 0. to 1. -pltclcmd plrgb void -r PLFLT -g PLFLT -b PLFLT +#pltclcmd plrgb void +#r PLFLT +#g PLFLT +#b PLFLT # Set line color by 8 bit RGB values. -pltclcmd plrgb1 void -r PLINT -g PLINT -b PLINT +#pltclcmd plrgb1 void +#r PLINT +#g PLINT +#b PLINT # Function to transform from RGB to HLS color space. Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/tcl/tclAPI.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -97,7 +97,6 @@ static CmdInfo Cmds[] = { { "loopback", loopbackCmd }, #include "tclgen_s.h" - { "plcol", plcol0Cmd }, { "plcont", plcontCmd }, { "pllegend", pllegendCmd }, { "plmap", plmapCmd }, Modified: trunk/bindings/tk/PLWin.itk =================================================================== --- trunk/bindings/tk/PLWin.itk 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/tk/PLWin.itk 2011-03-17 20:05:27 UTC (rev 11639) @@ -50,12 +50,6 @@ eval $plwin db $args } -# A useful convenience which is similar to what is done in C. - - method plcol {args} { - eval $plwin cmd plcol0 $args - } - # Command which aren't generated by pltclgen, and so aren't done by # plitclgen either. Modified: trunk/bindings/tk/plr.c =================================================================== --- trunk/bindings/tk/plr.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/tk/plr.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -436,11 +436,11 @@ plr_rd( pdf_rd_1byte( plr->pdfs, &r ) ); plr_rd( pdf_rd_1byte( plr->pdfs, &g ) ); plr_rd( pdf_rd_1byte( plr->pdfs, &b ) ); - plrgb1( r, g, b ); + plscol0( icol0, r, g, b ); } else { - plcol( icol0 ); + plcol0( icol0 ); } break; } Modified: trunk/bindings/wxwidgets/wxPLplotstream.cpp =================================================================== --- trunk/bindings/wxwidgets/wxPLplotstream.cpp 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/wxwidgets/wxPLplotstream.cpp 2011-03-17 20:05:27 UTC (rev 11639) @@ -80,7 +80,7 @@ backend ); strncat( drvopt, buffer, bufferSize - strlen( drvopt ) ); - SetOpt( "-drvopt", drvopt ); + setopt( "-drvopt", drvopt ); init(); Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/config.h.cmake 2011-03-17 20:05:27 UTC (rev 11639) @@ -35,6 +35,9 @@ // Name of the default cmap1 palette to use #define PL_DEFAULT_CMAP1_FILE "@DEFAULT_CMAP1_FILE@" +// Define if support for deprecated plplot functions should be compiled +#cmakedefine PL_DEPRECATED + // Define if there is support for dynamically loaded drivers #cmakedefine ENABLE_DYNDRIVERS Modified: trunk/doc/docbook/src/api-obsolete.xml =================================================================== --- trunk/doc/docbook/src/api-obsolete.xml 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/doc/docbook/src/api-obsolete.xml 2011-03-17 20:05:27 UTC (rev 11639) @@ -65,7 +65,7 @@ </para> <para> - Deprecated. Use the new name, &pleop;, for this function instead. + Removed. Use the new name, &pleop;, for this function instead. </para> </sect1> @@ -87,7 +87,7 @@ </para> <para> - Deprecated. Use the new name, &plcol0;, for this function instead. + Removed. Use the new name, &plcol0;, for this function instead. </para> <variablelist> @@ -128,7 +128,7 @@ <para> Set current color by hue, lightness, and saturation. Convert hls color coordinates to rgb, then call plrgb. - Do <emphasis>not</emphasis> use this. Only retained for backward compatibility. + This function has been removed. Use &plhlsrgb; and &plscol0; instead. </para> <!-- TODO: find out what to do exactly --> @@ -193,8 +193,7 @@ </para> <para> - Use &plhlsrgb; from the common API instead of this deprecated C-only - function. + Removed. Use &plhlsrgb; from the common API instead. </para> <variablelist> @@ -287,7 +286,7 @@ </para> <para> - Deprecated. Use the new name, &plbop;, for this function instead. + Removed. Use the new name, &plbop;, for this function instead. </para> </sect1> @@ -312,9 +311,7 @@ <para> Set line color by red, green, blue from 0. to 1. Do - <emphasis>not</emphasis> use this. - Only retained for backward compatibility. Use the function &plscol0; - instead. + Removed. Use the function &plscol0; instead. </para> <variablelist> @@ -375,8 +372,7 @@ <para> Set line color by 8-bit RGB values. Do <emphasis>not</emphasis> use this. - Only retained for backward compatibility. Use the function &plscol0; - instead. + Removed. Use the function &plscol0; instead. </para> <variablelist> Modified: trunk/examples/tk/xtk01.c =================================================================== --- trunk/examples/tk/xtk01.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/examples/tk/xtk01.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -204,19 +204,19 @@ // scaled separately (just = 0), and we just draw a labelled // box (axis = 0). - plcol( 1 ); + plcol0( 1 ); plenv( xmin, xmax, ymin, ymax, 0, 0 ); - plcol( 6 ); + plcol0( 6 ); pllab( "(x)", "(y)", "#frPLplot Example 1 - y=x#u2" ); // Plot the data points - plcol( 9 ); + plcol0( 9 ); plpoin( 6, xs1, ys1, 9 ); // Draw the line through the data - plcol( 4 ); + plcol0( 4 ); plline( 60, x, y ); } @@ -231,9 +231,9 @@ // 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately // (just = 0), and we draw a box with axes (axis = 1). - plcol( 1 ); + plcol0( 1 ); plenv( (PLFLT) -2.0, (PLFLT) 10.0, (PLFLT) -0.4, (PLFLT) 1.2, 0, 1 ); - plcol( 2 ); + plcol0( 2 ); pllab( "(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function" ); // Fill up the arrays @@ -248,7 +248,7 @@ // Draw the line - plcol( 3 ); + plcol0( 3 ); plline( 100, x, y ); } @@ -272,18 +272,18 @@ // Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. - plcol( 1 ); + plcol0( 1 ); plbox( "bcnst", (PLFLT) 60.0, 2, "bcnstv", (PLFLT) 0.2, 2 ); // Superimpose a dashed line grid, with 1.5 mm marks and spaces. plstyl // expects a pointer!! plstyl( 1, &mark1, &space1 ); - plcol( 2 ); + plcol0( 2 ); plbox( "g", (PLFLT) 30.0, 0, "g", (PLFLT) 0.2, 0 ); plstyl( 0, &mark0, &space0 ); - plcol( 3 ); + plcol0( 3 ); pllab( "Angle (degrees)", "sine", "#frPLplot Example 1 - Sine function" ); for ( i = 0; i < 101; i++ ) @@ -292,7 +292,7 @@ y[i] = sin( x[i] * 3.141592654 / 180.0 ); } - plcol( 4 ); + plcol0( 4 ); plline( 101, x, y ); } @@ -440,9 +440,9 @@ plfill, 1, NULL, NULL ); } - plcol( 1 ); + plcol0( 1 ); plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); - plcol( 2 ); + plcol0( 2 ); // // plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, NCONTR, mypltr, NULL); // Modified: trunk/examples/tk/xtk02.c =================================================================== --- trunk/examples/tk/xtk02.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/examples/tk/xtk02.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -240,19 +240,19 @@ // scaled separately (just = 0), and we just draw a labelled // box (axis = 0). - plcol( 1 ); + plcol0( 1 ); plenv( xmin, xmax, ymin, ymax, 0, 0 ); - plcol( 6 ); + plcol0( 6 ); pllab( "(x)", "(y)", "#frPLplot Example 1 - y=x#u2" ); // Plot the data points - plcol( 9 ); + plcol0( 9 ); plpoin( 6, xs, ys, 9 ); // Draw the line through the data - plcol( 4 ); + plcol0( 4 ); plline( 60, x, y ); } @@ -267,9 +267,9 @@ // 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately // (just = 0), and we draw a box with axes (axis = 1). - plcol( 1 ); + plcol0( 1 ); plenv( -2.0, 10.0, -0.4, 1.2, 0, 1 ); - plcol( 2 ); + plcol0( 2 ); pllab( "(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function" ); // Fill up the arrays @@ -284,7 +284,7 @@ // Draw the line - plcol( 3 ); + plcol0( 3 ); plline( 100, x, y ); } @@ -308,18 +308,18 @@ // Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. - plcol( 1 ); + plcol0( 1 ); plbox( "bcnst", 60.0, 2, "bcnstv", 0.2, 2 ); // Superimpose a dashed line grid, with 1.5 mm marks and spaces. plstyl // expects a pointer!! plstyl( 1, &mark1, &space1 ); - plcol( 2 ); + plcol0( 2 ); plbox( "g", 30.0, 0, "g", 0.2, 0 ); plstyl( 0, &mark0, &space0 ); - plcol( 3 ); + plcol0( 3 ); pllab( "Angle (degrees)", "sine", "#frPLplot Example 1 - Sine function" ); for ( i = 0; i < 101; i++ ) @@ -328,7 +328,7 @@ y[i] = sin( x[i] * 3.141592654 / 180.0 ); } - plcol( 4 ); + plcol0( 4 ); plline( 101, x, y ); } Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/include/plplot.h 2011-03-17 20:05:27 UTC (rev 11639) @@ -314,10 +314,16 @@ #define PL_FCI_MEDIUM 0x0 #define PL_FCI_BOLD 0x1 +#ifdef PL_DEPRECATED + // Obsolete names #define plParseInternalOpts( a, b, c ) c_plparseopts( a, b, c ) #define plSetInternalOpt( a, b ) plSetOpt( a, b ) + +#endif // PL_DEPRECATED + + // Option table definition typedef struct @@ -799,6 +805,8 @@ #ifndef __PLSTUBS_H__ // i.e. do not expand this in the stubs +#ifdef PL_DEPRECATED + #define plclr pleop #define plpage plbop #define plcol plcol0 @@ -810,6 +818,8 @@ #define plP_gvpw plgvpw #define plotsh3d( x, y, z, nx, ny, opt ) plsurf3d( x, y, z, nx, ny, opt, NULL, 0 ) +#endif // PL_DEPRECATED + #endif // __PLSTUBS_H__ //-------------------------------------------------------------------------- @@ -2196,9 +2206,13 @@ PLDLLIMPEXP int c_plsetopt( const char *opt, const char *optarg ); +#ifdef PL_DEPRECATED + PLDLLIMPEXP int plSetOpt( const char *opt, const char *optarg ); +#endif // PL_DEPRECATED + // Process options list using current options info. PLDLLIMPEXP int @@ -2284,22 +2298,8 @@ PLDLLIMPEXP int plTranslateCursor( PLGraphicsIn *gin ); -// Deprecated function names which are handled as wrappers for strict -// backwards compatibility of the library API +#ifdef PL_DEPRECATED -PLDLLIMPEXP int -plParseOpts( int *p_argc, const char **argv, PLINT mode ); - -PLDLLIMPEXP void -plHLS_RGB( PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b ); - -PLDLLIMPEXP void -plRGB_HLS( PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s ); - -PLDLLIMPEXP void -plarrows( const PLFLT *u, const PLFLT *v, const PLFLT *x, const PLFLT *y, PLINT n, - PLFLT scale, PLFLT dx, PLFLT dy ); - // These functions are depreciated and only retained for backwards // compatibility - do not use in new code. @@ -2318,7 +2318,9 @@ PLDLLIMPEXP void c_plrgb1( PLINT r, PLINT g, PLINT b ); +#endif // PL_DEPRECATED + #ifdef __cplusplus } #endif Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/plargs.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -150,7 +150,6 @@ static int opt_plserver( const char *, const char *, void * ); static int opt_plwindow( const char *, const char *, void * ); -static int opt_tcl_cmd( const char *, const char *, void * ); static int opt_auto_path( const char *, const char *, void * ); static int opt_bufmax( const char *, const char *, void * ); static int opt_server_name( const char *, const char *, void * ); @@ -566,15 +565,6 @@ "Name of PLplot container window (tk driver)" }, { - "tcl_cmd", // TCL initialization command - opt_tcl_cmd, - NULL, - NULL, - PL_OPT_FUNC | PL_OPT_ARG | PL_OPT_INVISIBLE, - "-tcl_cmd command", - "Depreciated - use -drvopt tcl_cmd= instead" - }, - { "auto_path", // Additional directory(s) to autoload opt_auto_path, NULL, @@ -2170,35 +2160,6 @@ } //-------------------------------------------------------------------------- -// opt_tcl_cmd() -// -// Performs appropriate action for option "tcl_cmd": -// Sets TCL command(s) to eval on startup -// Depreciated - just bounce on to -drvopt tcl_cmd= -//-------------------------------------------------------------------------- - -static int -opt_tcl_cmd( const char *opt, const char *optarg, void *client_data ) -{ - char *newcmd; - - if ( ( newcmd = (char *) malloc( (size_t) ( strlen( optarg ) + 9 ) * sizeof ( char ) ) ) == NULL ) - { - plexit( "opt_tcl_cmd: Insufficient memory" ); - } - - strcpy( newcmd, "tcl_cmd=" ); - strcat( newcmd, optarg ); - - fprintf( stderr, "-tcl_cmd <cmd> is obsolete. Please use -drvopt tcl_cmd=<cmd> instead\n" ); - - opt_drvopt( "drvopt", newcmd, NULL ); - free( newcmd ); - - return 0; -} - -//-------------------------------------------------------------------------- // opt_auto_path() // // Performs appropriate action for option "auto_path": Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/plcore.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -2319,7 +2319,7 @@ // Switch to graphics mode and set color and arrow style plgra(); - plcol( 1 ); + plcol0( 1 ); pllsty( 1 ); plpat( 1, &inc, &del ); Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/plctrl.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -1046,78 +1046,6 @@ } //-------------------------------------------------------------------------- -// plrgb() -// -// Set line color by red, green, blue from 0. to 1. -// Do NOT use this. Only retained for backward compatibility -//-------------------------------------------------------------------------- - -void -c_plrgb( PLFLT r, PLFLT g, PLFLT b ) -{ - if ( plsc->level < 1 ) - { - plabort( "plrgb: Please call plinit first" ); - return; - } - - plsc->icol0 = PL_RGB_COLOR; - plsc->curcolor.r = MAX( 0, MIN( 255, (int) ( 256. * r ) ) ); - plsc->curcolor.g = MAX( 0, MIN( 255, (int) ( 256. * g ) ) ); - plsc->curcolor.b = MAX( 0, MIN( 255, (int) ( 256. * b ) ) ); - - plsc->curcmap = 0; - plP_state( PLSTATE_COLOR0 ); -} - -//-------------------------------------------------------------------------- -// plrgb1() -// -// Set line color by 8 bit RGB values. -// Do NOT use this. Only retained for backward compatibility -//-------------------------------------------------------------------------- - -void -c_plrgb1( PLINT r, PLINT g, PLINT b ) -{ - if ( plsc->level < 1 ) - { - plabort( "plrgb1: Please call plinit first" ); - return; - } - if ( ( r < 0 || r > 255 ) || ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) ) - { - plabort( "plrgb1: Invalid color" ); - return; - } - - plsc->icol0 = PL_RGB_COLOR; - plsc->curcolor.r = r; - plsc->curcolor.g = g; - plsc->curcolor.b = b; - - plsc->curcmap = 0; - plP_state( PLSTATE_COLOR0 ); -} - -//-------------------------------------------------------------------------- -// void plhls() -// -// Set current color by hue, lightness, and saturation. -// Convert hls color coordinates to rgb, then call plrgb. -// Do NOT use this. Only retained for backward compatibility -//-------------------------------------------------------------------------- - -void -c_plhls( PLFLT h, PLFLT l, PLFLT s ) -{ - PLFLT r, g, b; - - c_plhlsrgb( h, l, s, &r, &g, &b ); - plrgb( r, g, b ); -} - -//-------------------------------------------------------------------------- // void value() // // Auxiliary function used by c_plhlsrgb(). Modified: trunk/src/pldeprecated.c =================================================================== --- trunk/src/pldeprecated.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/pldeprecated.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -25,150 +25,102 @@ // is explicitly commented. // +#ifdef PL_DEPRECATED + #define NEED_PLDEBUG #include "plplotP.h" -//-------------------------------------------------------------------------- -// Use plparseopts instead. -//-------------------------------------------------------------------------- -int -plParseOpts( int *p_argc, const char **argv, PLINT mode ) -{ - plwarn( "plParseOpts: function deprecated. Use plparseopts instead" ); - return c_plparseopts( p_argc, argv, mode ); -} +// The following functions have been removed from plplot ahead of the 5.9.8 +// release. They have long been advertised as deprecated. +// plParseOpts +// plHLS_RGB +// plRGB_HLS +// plarrows -//-------------------------------------------------------------------------- -// Use plhlsrgb instead. -//-------------------------------------------------------------------------- -void -plHLS_RGB( PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b ) -{ - plwarn( "plHLS_RGB: function deprecated. Use plhlsrgb instead" ); - c_plhlsrgb( h, l, s, p_r, p_g, p_b ); -} +// The following functions have been marked as obsolete for some time, +// but were formally deprecated as of version 5.9.8 +// plrgb +// plrgb1 +// plhls //-------------------------------------------------------------------------- -// Use plrgbhls instead. +// plrgb() +// +// Set line color by red, green, blue from 0. to 1. +// Do NOT use this. Only retained for backward compatibility //-------------------------------------------------------------------------- + void -plRGB_HLS( PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s ) +c_plrgb( PLFLT r, PLFLT g, PLFLT b ) { - plwarn( "plRGB_HLS: function deprecated. Use plrgbhls instead" ); - c_plrgbhls( r, g, b, p_h, p_l, p_s ); + plwarn( "plrgb: function deprecated. Use plscol instead" ); + + if ( plsc->level < 1 ) + { + plabort( "plrgb: Please call plinit first" ); + return; + } + + plsc->icol0 = PL_RGB_COLOR; + plsc->curcolor.r = MAX( 0, MIN( 255, (int) ( 256. * r ) ) ); + plsc->curcolor.g = MAX( 0, MIN( 255, (int) ( 256. * g ) ) ); + plsc->curcolor.b = MAX( 0, MIN( 255, (int) ( 256. * b ) ) ); + + plsc->curcmap = 0; + plP_state( PLSTATE_COLOR0 ); } //-------------------------------------------------------------------------- -// Use plvect / plsvect instead. -// void plarrows() +// plrgb1() // -// simple arrow plotter -// copyright 1993 Wesley Ebisuzaki -// -// an arrow is defined by its location (x, y) and its direction (u, v) -// -// inputs: -// u[i], v[i] arrow's horizontal and vertical projection -// x[i], y[i] arrow's location (world coordinates) -// n number of arrows to draw -// scale > 0 scaling factor for arrows -// 0 default scaling factor -// < 0 default scaling factor * (-scale) -// dx, dy distance between arrows -// used when calculating the default arrow scaling -// so that arrows don't overlap -// +// Set line color by 8 bit RGB values. +// Do NOT use this. Only retained for backward compatibility //-------------------------------------------------------------------------- -#define SCALE0 2.0 - -// definition of original arrow: 2 line segments - -static PLFLT arrow_x[4] = { 0.5, -0.5, -0.27, -0.5 }; -static PLFLT arrow_y[4] = { 0.0, 0.0, 0.0, 0.20 }; - void -plarrows( const PLFLT *u, const PLFLT *v, const PLFLT *x, const PLFLT *y, PLINT n, - PLFLT scale, PLFLT dx, PLFLT dy ) +c_plrgb1( PLINT r, PLINT g, PLINT b ) { - PLFLT uu, vv; - PLINT i, j, npts = 4; - PLINT px0, py0, dpx, dpy; - PLINT a_x[4], a_y[4]; - PLFLT max_u, max_v; - double t; + plwarn( "plrgb1: function deprecated. Use plscol instead" ); - plwarn( "plarrows: function deprecated. Use plvect instead" ); - - if ( n <= 0 ) + if ( plsc->level < 1 ) + { + plabort( "plrgb1: Please call plinit first" ); return; - - if ( scale <= 0.0 ) + } + if ( ( r < 0 || r > 255 ) || ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) ) { - // automatic scaling - // find max / min values of data - - max_u = u[0]; - max_v = v[0]; - for ( i = 1; i < n; i++ ) - { - t = fabs( (double) u[i] ); - max_u = t > max_u ? t : max_u; - t = fabs( (double) v[i] ); - max_v = t > max_v ? t : max_v; - } - - // measure distance in grid boxs - - max_u = max_u / fabs( (double) dx ); - max_v = max_v / fabs( (double) dy ); - - t = ( max_u > max_v ? max_u : max_v ); - t = SCALE0 / t; - if ( scale < 0 ) - { - scale = -scale * t; - } - else - { - scale = t; - } + plabort( "plrgb1: Invalid color" ); + return; } - pldebug( "plarrows", "scale factor=%lf n=%d\n", scale, n ); - for ( i = 0; i < n; i++ ) - { - uu = scale * u[i]; - vv = scale * v[i]; - if ( uu == 0.0 && uu == 0.0 ) - continue; + plsc->icol0 = PL_RGB_COLOR; + plsc->curcolor.r = r; + plsc->curcolor.g = g; + plsc->curcolor.b = b; - // conversion to physical coordinates + plsc->curcmap = 0; + plP_state( PLSTATE_COLOR0 ); +} - px0 = plP_wcpcx( x[i] ); - py0 = plP_wcpcy( y[i] ); +//-------------------------------------------------------------------------- +// void plhls() +// +// Set current color by hue, lightness, and saturation. +// Convert hls color coordinates to rgb, then call plrgb. +// Do NOT use this. Only retained for backward compatibility +//-------------------------------------------------------------------------- - pldebug( "plarrows", "%f %f %d %d\n", x[i], y[i], px0, py0 ); +void +c_plhls( PLFLT h, PLFLT l, PLFLT s ) +{ + PLFLT r, g, b; - dpx = plP_wcpcx( x[i] + 0.5 * uu ) - px0; - dpy = plP_wcpcy( y[i] + 0.5 * vv ) - py0; + plwarn( "plhls: function deprecated. Use plhlsrgb / plscol instead" ); - // transform arrow -> a - - for ( j = 0; j < npts; j++ ) - { - a_x[j] = (PLINT) ( arrow_x[j] * dpx - - arrow_y[j] * dpy + px0 ); - a_y[j] = (PLINT) ( arrow_x[j] * dpy + - arrow_y[j] * dpx + py0 ); - } - - // draw the arrow - plP_movphy( a_x[0], a_y[0] ); - plP_draphy( a_x[1], a_y[1] ); - plP_movphy( a_x[2], a_y[2] ); - plP_draphy( a_x[3], a_y[3] ); - } + c_plhlsrgb( h, l, s, &r, &g, &b ); + plrgb( r, g, b ); } + +#endif // PL_DEPRECATED Modified: trunk/src/plstripc.c =================================================================== --- trunk/src/plstripc.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/plstripc.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -159,9 +159,9 @@ { if ( stripc->npts[i] || first ) { - plcol( stripc->colline[i] ); pllsty( stripc->styline[i] ); + plcol0( stripc->colline[i] ); pllsty( stripc->styline[i] ); pljoin( stripc->xlpos, stripc->ylpos - sc, stripc->xlpos + 0.1, stripc->ylpos - sc ); - plcol( stripc->collab ); + plcol0( stripc->collab ); plptex( stripc->xlpos + 0.11, stripc->ylpos - sc, 0., 0., 0, stripc->legline[i] ); sc += dy; } } @@ -184,7 +184,7 @@ plvpor( 0, 1, 0, 1 ); plwind( 0, 1, 0, 1 ); - plcol( 0 ); plpsty( 0 ); + plcol0( 0 ); plpsty( 0 ); plclear(); plvsta(); @@ -195,17 +195,17 @@ plwind( strip->xmin, strip->xmax, strip->ymin, strip->ymax ); pllsty( 1 ); - plcol( strip->colbox ); + plcol0( strip->colbox ); plbox( strip->xspec, 0.0, 0, strip->yspec, 0.0, 0 ); - plcol( strip->collab ); + plcol0( strip->collab ); pllab( strip->labx, strip->laby, strip->labtop ); for ( i = 0; i < PEN; i++ ) { if ( strip->npts[i] > 0 ) { - plcol( strip->colline[i] ); pllsty( strip->styline[i] ); + plcol0( strip->colline[i] ); pllsty( strip->styline[i] ); plline( strip->npts[i], strip->x[i], strip->y[i] ); } } @@ -274,7 +274,7 @@ // If user has changed subwindow, make shure we have the correct one plvsta(); plwind( stripc->wxmin, stripc->wxmax, stripc->wymin, stripc->wymax ); // FIXME - can exist some redundancy here - plcol( stripc->colline[p] ); pllsty( stripc->styline[p] ); + plcol0( stripc->colline[p] ); pllsty( stripc->styline[p] ); if ( ( stripc->npts[p] - 2 ) < 0 ) plP_movwor( stripc->x[p][stripc->npts[p] - 1], stripc->y[p][stripc->npts[p] - 1] ); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2011-03-18 07:23:11
|
Revision: 11643 http://plplot.svn.sourceforge.net/plplot/?rev=11643&view=rev Author: jbauck Date: 2011-03-18 07:23:05 +0000 (Fri, 18 Mar 2011) Log Message: ----------- Ada: Update Example 18 for plstring3. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/examples/ada/x18a.adb trunk/examples/ada/xthick18a.adb Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2011-03-18 06:22:15 UTC (rev 11642) +++ trunk/bindings/ada/plplot.adb 2011-03-18 07:23:05 UTC (rev 11643) @@ -83,7 +83,6 @@ -- Can be used directly or as part of a "simple" plotter -- such as those that follow or which are made by the user. -- fixme Add capability for labels, legends. - -- fixme Add capability for labels, legends. procedure Multiplot_Pairs (x1 : Real_Vector := Dont_Plot_This; y1 : Real_Vector := Dont_Plot_This; Modified: trunk/examples/ada/x18a.adb =================================================================== --- trunk/examples/ada/x18a.adb 2011-03-18 06:22:15 UTC (rev 11642) +++ trunk/examples/ada/x18a.adb 2011-03-18 07:23:05 UTC (rev 11643) @@ -2,7 +2,7 @@ -- 3-d line and point plot demo. Adapted from x08c.c. --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2008 - 2011 Jerry Bauck -- This file is part of PLplot. @@ -36,8 +36,6 @@ PLplot_Auxiliary, PLplot_Traditional; - - procedure x18a is ---------------------------------------------------------------------------- -- Does a series of 3-d plots for a given data set, with different @@ -113,7 +111,6 @@ plmtex("t", 1.0, 0.5, 0.5, "unit radius sphere" ); end test_poly; - begin -- Parse and process command line arguments plparseopts(PL_PARSE_FULL); @@ -150,7 +147,8 @@ if opt(k) then plline3(x, y, z); else - plpoin3(x, y, z, 1); + -- U+22C5 DOT OPERATOR. + plstring3(x, y, z, "⋅"); end if; plcol0(3); Modified: trunk/examples/ada/xthick18a.adb =================================================================== --- trunk/examples/ada/xthick18a.adb 2011-03-18 06:22:15 UTC (rev 11642) +++ trunk/examples/ada/xthick18a.adb 2011-03-18 07:23:05 UTC (rev 11643) @@ -2,7 +2,7 @@ -- 3-d line and point plot demo. Adapted from x08c.c. --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2008 - 2011 Jerry Bauck -- This file is part of PLplot. @@ -36,8 +36,6 @@ PLplot_Auxiliary, PLplot; - - procedure xthick18a is ---------------------------------------------------------------------------- -- Does a series of 3-d plots for a given data set, with different @@ -113,7 +111,6 @@ Write_Text_Viewport("t", 1.0, 0.5, 0.5, "unit radius sphere" ); end test_poly; - begin -- Parse and process command line arguments Parse_Command_Line_Arguments(Parse_Full); @@ -150,7 +147,7 @@ if opt(k) then Draw_Curve_3D(x, y, z); else - Draw_Points_3D(x, y, z, 1); + Draw_String_3D(x, y, z, "⋅"); end if; Set_Pen_Color(Green); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-19 21:14:17
|
Revision: 11653 http://plplot.svn.sourceforge.net/plplot/?rev=11653&view=rev Author: airwin Date: 2011-03-19 21:14:10 +0000 (Sat, 19 Mar 2011) Log Message: ----------- Remove long-deprecated plcol from Fortran 77 and Fortran 95 API. Use plcol0 instead. Modified Paths: -------------- trunk/bindings/f77/plstubs.h trunk/bindings/f77/scstubs.c trunk/bindings/f95/plstubs.h trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubsf95.f90 trunk/examples/f77/x16af.fm4 trunk/examples/f77/x20f.fm4 trunk/examples/f95/x16af.f90 trunk/examples/f95/x20f.f90 Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/bindings/f77/plstubs.h 2011-03-19 21:14:10 UTC (rev 11653) @@ -183,7 +183,6 @@ #define PLCALC_WORLDa FNAME( PLCALC_WORLD_, plcalc_world_ ) #define PLCLEAR FNAME( PLCLEAR, plclear ) #define PLCLR FNAME( PLCLR, plclr ) -#define PLCOL FNAME( PLCOL, plcol ) #define PLCOL0 FNAME( PLCOL0, plcol0 ) #define PLCOL1 FNAME( PLCOL1, plcol1 ) #define PLCOLORBAR FNAME( PLCOLORBAR7, plcolorbar7 ) Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/bindings/f77/scstubs.c 2011-03-19 21:14:10 UTC (rev 11653) @@ -167,15 +167,7 @@ c_plcol1( *col ); } -// The old way, same as plcol0 - void -PLCOL( PLINT *icol ) -{ - c_plcol0( *icol ); -} - -void PLCOLORBAR( PLINT *position, PLINT *opt, PLFLT *x, PLFLT *y, PLFLT *length, PLFLT *width, PLINT *cont_color, PLINT *cont_width, PLFLT *ticks, PLINT *sub_ticks, char *axis_opts, char *label, PLINT *n_colors, PLFLT *colors, PLFLT *values ) Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/bindings/f95/plstubs.h 2011-03-19 21:14:10 UTC (rev 11653) @@ -183,7 +183,6 @@ #define PLCALC_WORLDa FNAME( PLCALC_WORLD_, plcalc_world_ ) #define PLCLEAR FNAME( PLCLEAR, plclear ) #define PLCLR FNAME( PLCLR, plclr ) -#define PLCOL FNAME( PLCOL, plcol ) #define PLCOL0 FNAME( PLCOL0, plcol0 ) #define PLCOL1 FNAME( PLCOL1, plcol1 ) #define PLCONFIGTIME FNAME( PLCONFIGTIME, plconfigtime ) Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/bindings/f95/scstubs.c 2011-03-19 21:14:10 UTC (rev 11653) @@ -168,15 +168,7 @@ c_plcol1( *col ); } -// The old way, same as plcol0 - void -PLCOL( PLINT *icol ) -{ - c_plcol0( *icol ); -} - -void PLCONFIGTIME( PLFLT *scale, PLFLT *offset1, PLFLT *offset2, PLINT *ccontrol, PLBOOL *ifbtime_offset, PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec ) { c_plconfigtime( *scale, *offset1, *offset2, *ccontrol, *ifbtime_offset, *year, *month, *day, *hour, *min, *sec ); Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/bindings/f95/sfstubsf95.f90 2011-03-19 21:14:10 UTC (rev 11653) @@ -177,12 +177,6 @@ end interface interface - subroutine plcol( icol ) - integer :: icol - end subroutine plcol - end interface - - interface subroutine plcol1( col ) use plplot_flt real(kind=plflt) :: col Modified: trunk/examples/f77/x16af.fm4 =================================================================== --- trunk/examples/f77/x16af.fm4 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/examples/f77/x16af.fm4 2011-03-19 21:14:10 UTC (rev 11653) @@ -110,9 +110,9 @@ & min_color, min_width, max_color, max_width, xdim) enddo - call plcol(1) + call plcol0(1) call plbox('bcnst', 0.0d0, 0, 'bcnstv', 0.0d0, 0) - call plcol(2) + call plcol0(2) call pllab('distance', 'altitude', 'Bogon flux') end @@ -234,7 +234,7 @@ ncollab = 2 call pladv(0) - call plcol(ncolbox) + call plcol0(ncolbox) c Scale window to user coordinates. c Make a bit larger so the boundary does not get clipped. @@ -282,10 +282,10 @@ xtm(i) = x0 + rmax * cos(theta) ytm(i) = y0 + rmax * sin(theta) enddo - call plcol(ncolbox) + call plcol0(ncolbox) call plline(NBDRY, xtm, ytm) - call plcol(ncollab) + call plcol0(ncollab) call pllab(' ', ' ', &'Shielded potential of charges in a conducting sphere') Modified: trunk/examples/f77/x20f.fm4 =================================================================== --- trunk/examples/f77/x20f.fm4 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/examples/f77/x20f.fm4 2011-03-19 21:14:10 UTC (rev 11653) @@ -272,7 +272,7 @@ call a2mnmx(img_f,width,height,img_min,img_max,WDIM) - call plcol(2) + call plcol0(2) call plenv(0.d0, width_r, 0.d0, height_r, 1, -1) call pllab("", "", "Reduced dynamic range image example") call plimagefr0(img_f, width, height, 0.d0, width_r, 0.d0, Modified: trunk/examples/f95/x16af.f90 =================================================================== --- trunk/examples/f95/x16af.f90 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/examples/f95/x16af.f90 2011-03-19 21:14:10 UTC (rev 11653) @@ -111,9 +111,9 @@ min_color, min_width, max_color, max_width ) enddo - call plcol(1) + call plcol0(1) call plbox('bcnst', 0.0_plflt, 0, 'bcnstv', 0.0_plflt, 0) - call plcol(2) + call plcol0(2) call pllab('distance', 'altitude', 'Bogon flux') end @@ -235,7 +235,7 @@ ncollab = 2 call pladv(0) - call plcol(ncolbox) + call plcol0(ncolbox) ! Scale window to user coordinates. ! Make a bit larger so the boundary does not get clipped. @@ -284,10 +284,10 @@ xtm(i) = x0 + rmax * cos(theta) ytm(i) = y0 + rmax * sin(theta) enddo - call plcol(ncolbox) + call plcol0(ncolbox) call plline(xtm, ytm) - call plcol(ncollab) + call plcol0(ncollab) call pllab(' ', ' ', & 'Shielded potential of charges in a conducting sphere') Modified: trunk/examples/f95/x20f.f90 =================================================================== --- trunk/examples/f95/x20f.f90 2011-03-19 19:41:45 UTC (rev 11652) +++ trunk/examples/f95/x20f.f90 2011-03-19 21:14:10 UTC (rev 11653) @@ -261,7 +261,7 @@ call a2mnmx(img_f,width,height,img_min,img_max,width) - call plcol(2) + call plcol0(2) call plenv(0._plflt, width_r, 0._plflt, height_r, 1, -1) call pllab("", "", "Reduced dynamic range image example") call plimagefr(img_f, 0._plflt, width_r, 0._plflt, & This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-19 23:57:06
|
Revision: 11659 http://plplot.svn.sourceforge.net/plplot/?rev=11659&view=rev Author: airwin Date: 2011-03-19 23:56:59 +0000 (Sat, 19 Mar 2011) Log Message: ----------- Untested changes to get rid of plcol (and replace it with plcol0 when appropriate). Modified Paths: -------------- trunk/bindings/python/Plframe.py trunk/bindings/tk-x-plat/Plwindow.tcl trunk/bindings/tk-x-plat/plbarchart.tcl trunk/bindings/tk-x-plat/pltimeseries.tcl trunk/utils/plrender.c Modified: trunk/bindings/python/Plframe.py =================================================================== --- trunk/bindings/python/Plframe.py 2011-03-19 22:31:10 UTC (rev 11658) +++ trunk/bindings/python/Plframe.py 2011-03-19 23:56:59 UTC (rev 11659) @@ -52,9 +52,6 @@ ## on the Numeric extensions cannot work this way, so for those we ## call straight to the Python compiled interface to the PLplot API. - def plcol(s,c): - s.cmd( 'plcol', c ) - def plenv( s, xmin, xmax, ymin, ymax, i, j ): s.cmd( 'plenv', xmin, xmax, ymin, ymax, i, j ) @@ -1101,11 +1098,8 @@ yopt, ylabel, ytick, nsuby, zopt, zlabel, ztick, nsubz ) - def plcol(s,c): - s.cmd( 'plcol', c ) - def plcol0( s, col0 ): - s.plcol( col0 ) + s.cmd( 'plcol0', col0 ) def plcol1( s, col1 ): s.cmd( 'plcol1', col1 ) Modified: trunk/bindings/tk-x-plat/Plwindow.tcl =================================================================== --- trunk/bindings/tk-x-plat/Plwindow.tcl 2011-03-19 22:31:10 UTC (rev 11658) +++ trunk/bindings/tk-x-plat/Plwindow.tcl 2011-03-19 23:56:59 UTC (rev 11659) @@ -47,10 +47,6 @@ uplevel 1 $itk_interior.plwin cmd $args } - method plcol {color} { - cmd plcol0 $color - } - method plcont {data clev} { upvar $data d upvar $clev c Modified: trunk/bindings/tk-x-plat/plbarchart.tcl =================================================================== --- trunk/bindings/tk-x-plat/plbarchart.tcl 2011-03-19 22:31:10 UTC (rev 11658) +++ trunk/bindings/tk-x-plat/plbarchart.tcl 2011-03-19 23:56:59 UTC (rev 11659) @@ -80,17 +80,17 @@ itcl::body Plbarchart::datapoints {data} { if {[info commands _pp$nn] == "_pp$nn"} { - cmd plcol 0 + cmd plcol0 0 cmd plhist [_pp$nn info] _pp$nn $minbin $maxbin $bins 0 rename _pp$nn {} } matrix -persist _pp$nn f [llength $data] = $data - cmd plcol 1 + cmd plcol0 1 cmd plhist [_pp$nn info] _pp$nn $minbin $maxbin $bins 0 } itcl::body Plbarchart::drawAxes {} { - cmd plcol 15 + cmd plcol0 15 cmd plenv [expr {[lindex $V 0] -0.7*$step}] \ [expr {[lindex $V end] +0.7*$step}] \ 0 $ymax 0 0 Modified: trunk/bindings/tk-x-plat/pltimeseries.tcl =================================================================== --- trunk/bindings/tk-x-plat/pltimeseries.tcl 2011-03-19 22:31:10 UTC (rev 11658) +++ trunk/bindings/tk-x-plat/pltimeseries.tcl 2011-03-19 23:56:59 UTC (rev 11659) @@ -90,10 +90,10 @@ } itcl::body Pltimeseries::initialise {} { - cmd plcol 15 + cmd plcol0 15 cmd plenv $min_time $max_time $y_min $y_max 0 1 cmd pllab $itk_option(-xname) $itk_option(-yname) $itk_option(-title) - cmd plcol 1 + cmd plcol0 1 } itcl::body Pltimeseries::destructor {} { @@ -115,7 +115,7 @@ } } foreach trace [array names _points] { - cmd plcol [expr {1 + int($trace * $colour_increment) % 15}] + cmd plcol0 [expr {1 + int($trace * $colour_increment) % 15}] plotline [lrange $_ticks $l end] [lrange $_points($trace) $l end] } return @@ -130,16 +130,16 @@ set _ticks [lrange $_ticks $i end] plotaxes foreach trace [array names _points] { - cmd plcol [expr {1 + int($trace * $colour_increment) % 15}] + cmd plcol0 [expr {1 + int($trace * $colour_increment) % 15}] plotline $_ticks $_points($trace) } } itcl::body Pltimeseries::plotaxes {} { - cmd plcol 15 + cmd plcol0 15 cmd plenv $min_time $max_time $y_min $y_max 0 1 cmd pllab $itk_option(-xname) $itk_option(-yname) $itk_option(-title) - cmd plcol 1 + cmd plcol0 1 } itcl::body Pltimeseries::plotpoint {t y} { Modified: trunk/utils/plrender.c =================================================================== --- trunk/utils/plrender.c 2011-03-19 22:31:10 UTC (rev 11658) +++ trunk/utils/plrender.c 2011-03-19 23:56:59 UTC (rev 11659) @@ -986,7 +986,7 @@ } else { - plcol( icol0 ); + plcol0( icol0 ); } } else if ( strcmp( mf_version, "1993a" ) >= 0 ) @@ -1004,14 +1004,14 @@ } else { - plcol( icol0 ); + plcol0( icol0 ); } } else { U_SHORT icol; plm_rd( pdf_rd_2bytes( pdfs, &icol ) ); - plcol( icol ); + plcol0( icol ); } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-03-20 22:44:51
|
Revision: 11662 http://plplot.svn.sourceforge.net/plplot/?rev=11662&view=rev Author: andrewross Date: 2011-03-20 22:44:44 +0000 (Sun, 20 Mar 2011) Log Message: ----------- Add support for some callbacks in octave so plslabelfunc, plmap, plmeridians and plstransform now work. Implement example 19 for octave. Modified Paths: -------------- trunk/bindings/octave/plplot_octave.i trunk/bindings/swig-support/plplotcapi.i trunk/examples/octave/x19c.m trunk/plplot_test/test_octave.sh.in Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2011-03-20 04:45:35 UTC (rev 11661) +++ trunk/bindings/octave/plplot_octave.i 2011-03-20 22:44:44 UTC (rev 11662) @@ -498,6 +498,7 @@ %typemap(freearg) (const PLFLT *ArrayY, PLINT ny, PLFLT *OutMatrixCk) {} + //----------------------------------------------------------------------------- // String returning functions //----------------------------------------------------------------------------- @@ -518,6 +519,7 @@ typedef PLINT (*defined_func)(PLFLT, PLFLT); typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); +typedef void (*ct_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT*, PLFLT*); typedef PLFLT (*f2eval_func)(PLINT, PLINT, PLPointer); typedef void (*label_func)(PLINT, PLFLT, char*, PLINT, PLPointer); @@ -526,10 +528,186 @@ typedef PLINT (*defined_func)(PLFLT, PLFLT); typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); +typedef void (*ct_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT *, PLFLT*); typedef PLFLT (*f2eval_func)(PLINT, PLINT, PLPointer); typedef void (*label_func)(PLINT, PLFLT, char*, PLINT, PLPointer); %} + +%{ +#include <iostream> + + octave_function *fcnMapForm; + std::string nameMapForm; + + void mapform_octave(PLINT n, PLFLT *x, PLFLT *y) { + octave_idx_type i; + octave_value_list functionArguments; + octave_value_list retval; + + Matrix xin(n,1); + Matrix yin(n,1); + Matrix xout; + Matrix yout; + + for (i=0;i<n;i++) { + xin(i,0) = x[i]; + yin(i,0) = y[i]; + } + + functionArguments(0) = xin; + functionArguments(1) = yin; + + if (fcnMapForm != NULL) + retval = feval(fcnMapForm, functionArguments, 1); + else + retval = feval(nameMapForm, functionArguments, 1); + + + if (retval.length() >= 2) { + xout = retval(0).matrix_value(); + yout = retval(1).matrix_value(); + + for (i=0;i<n;i++) { + x[i] = xout(i,0); + y[i] = yout(i,0); + } + } + + } +%} + +/* Handle function pointers to mapform function */ +%typemap(in) mapform_func mapform { + + octave_value obj = $input; + if (! obj.is_empty() ) { + if ( obj.is_function_handle() || obj.is_inline_function() ) + { + fcnMapForm = obj.function_value(); + } + else if ( obj.is_string() ) + { + nameMapForm = obj.string_value(); + fcnMapForm = NULL; + } + $1 = mapform_octave; + } + else { + $1 = NULL; + } + +} + +%{ + + octave_function *fcnLabelFunc; + std::string nameLabelFunc; + + void labelfunc_octave(PLINT axis, PLFLT value, char *label, PLINT length, PLPointer data) { + int i; + octave_value_list functionArguments; + octave_value_list retval; + + Matrix inAxis(1,1); + Matrix inValue(1,1); + inAxis(0,0) = axis; + inValue(0,0) = value; + + functionArguments(0) = inAxis; + functionArguments(1) = inValue; + + if (fcnLabelFunc != NULL) + retval = feval(fcnLabelFunc, functionArguments, 1); + else + retval = feval(nameLabelFunc, functionArguments, 1); + + strncpy(label,retval(0).string_value().c_str(),length); + } +%} + +/* Handle function pointers to mapform function */ +%typemap(in) label_func lf { + + octave_value obj = $input; + if (! obj.is_empty() ) { + if ( obj.is_function_handle() || obj.is_inline_function() ) + { + fcnLabelFunc = obj.function_value(); + } + else if ( obj.is_string() ) + { + nameLabelFunc = obj.string_value(); + fcnLabelFunc = NULL; + } + $1 = labelfunc_octave; + } + else { + $1 = NULL; + } + +} + +%{ + + octave_function *fcnCoordTrans; + std::string nameCoordTrans; + + void ct_octave(PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data) { + octave_idx_type i; + octave_value_list functionArguments; + octave_value_list retval; + + Matrix xin(1,1); + Matrix yin(1,1); + Matrix xout; + Matrix yout; + + xin(0,0) = x; + yin(0,0) = y; + + functionArguments(0) = xin; + functionArguments(1) = yin; + + if (fcnCoordTrans != NULL) + retval = feval(fcnCoordTrans, functionArguments, 1); + else + retval = feval(nameCoordTrans, functionArguments, 1); + + + if (retval.length() >= 2) { + xout = retval(0).matrix_value(); + yout = retval(1).matrix_value(); + + *xt = xout(0,0); + *yt = yout(0,0); + } + + } +%} + +/* Handle function pointers to mapform function */ +%typemap(in) ct_func ctf { + + octave_value obj = $input; + if (! obj.is_empty() ) { + if ( obj.is_function_handle() || obj.is_inline_function() ) + { + fcnCoordTrans = obj.function_value(); + } + else if ( obj.is_string() ) + { + nameCoordTrans = obj.string_value(); + fcnCoordTrans = NULL; + } + $1 = ct_octave; + } + else { + $1 = NULL; + } + +} + // The octave bindings started out as an independent project with a // historical API that does not match up that well with the PLplot API // function names and numbers and types of arguments. So there are a Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-03-20 04:45:35 UTC (rev 11661) +++ trunk/bindings/swig-support/plplotcapi.i 2011-03-20 22:44:44 UTC (rev 11662) @@ -731,7 +731,7 @@ void plstart( const char *devname, PLINT nx, PLINT ny ); -#if !defined ( SWIG_LUA ) && !defined ( SWIG_OCTAVE ) +#if !defined ( SWIG_LUA ) void plstransform( ct_func ctf, PLPointer data ); #endif Modified: trunk/examples/octave/x19c.m =================================================================== --- trunk/examples/octave/x19c.m 2011-03-20 04:45:35 UTC (rev 11661) +++ trunk/examples/octave/x19c.m 2011-03-20 22:44:44 UTC (rev 11662) @@ -13,8 +13,151 @@ ## This file is part of plplot_octave. ## It is based on the corresponding demo function of PLplot. -printf("\n\n\ -This demo can't run in Octave, as a pointer to an Octave function is necessary,\n\ - and, even if Matwrap did support it, it would be very inefficient anyway.\n\n"); -fflush(stdout); -kbhit; +1; + +## Shows two views of the world map. + +function ix19c + ## Parse and process command line arguments + + ## (void) plparseopts( &argc, argv, PL_PARSE_FULL ); + + ## Longitude (x) and latitude (y) + + miny = -70; + maxy = 80; + + plinit(); + + ## Cartesian plots + ## Most of world + + minx = 190; + maxx = 190 + 360; + + ## Setup a custom latitude and longitude-based scaling function. + plslabelfunc( @geolocation_labeler, [] ); + + plcol0( 1 ); + plenv( minx, maxx, miny, maxy, 1, 70 ); + plmap( [], "usaglobe", minx, maxx, miny, maxy ); + + ## The Americas + + minx = 190; + maxx = 340; + + plcol0( 1 ); + plenv( minx, maxx, miny, maxy, 1, 70 ); + plmap( [], "usaglobe", minx, maxx, miny, maxy ); + + ## Clear the labeling function + plslabelfunc( [], [] ); + + ## Polar, Northern hemisphere + + minx = 0; + maxx = 360; + + plenv( -75., 75., -75., 75., 1, -1 ); + plmap( @mapform19, "globe", minx, maxx, miny, maxy ); + + pllsty( 2 ); + plmeridians( @mapform19, 10.0, 10.0, 0.0, 360.0, -10.0, 80.0 ); + + ## Polar, Northern hemisphere, this time with a PLplot-wide transform + + minx = 0; + maxx = 360; + + plstransform( @map_transform, [] ); + + pllsty( 1 ); + plenv( -75., 75., -75., 75., 1, -1 ); + ## No need to set the map transform here as the global transform will be + ## used. + plmap( [], "globe", minx, maxx, miny, maxy ); + + pllsty( 2 ); + plmeridians( [], 10.0, 10.0, 0.0, 360.0, -10.0, 80.0 ); + + ## Show Baltimore, MD on the map + plcol0( 2 ); + plssym( 0.0, 2.0 ); + x = -76.6125; + y = 39.2902778; + plpoin( x, y, 18 ); + plssym( 0.0, 1.0 ); + plptex( -76.6125, 43.0, 0.0, 0.0, 0.0, "Baltimore, MD" ); + + ## For C, this is how the global transform is cleared + plstransform( [], [] ); + + plend1(); +endfunction + +function [xt, yt] = map_transform( x, y, data ) + radius = 90.0 - y; + xt = radius .* cos( x * pi / 180.0 ); + yt = radius .* sin( x * pi / 180.0 ); +endfunction + +##-------------------------------------------------------------------------- +## mapform19 +## +## Defines specific coordinate transformation for example 19. +## Not to be confused with mapform in src/plmap.c. +## x[], y[] are the coordinates to be plotted. +##-------------------------------------------------------------------------- + +function [xp, yp] = mapform19( x, y ) + [xp, yp] = map_transform( x, y, [] ); +endfunction + +## "Normalize" longitude values so that they always fall between -180.0 and +## 180.0 +function norm = normalize_longitude( lon ) + if ( lon >= -180.0 && lon <= 180.0 ) + norm = lon; + else + times = floor( ( abs( lon ) + 180.0 ) / 360.0 ); + if ( lon < 0.0 ) + norm = lon + 360.0 * times; + else + norm = lon - 360.0 * times; + endif + endif +endfunction + +## A custom axis labeling function for longitudes and latitudes. +function label = geolocation_labeler( axis, value, data ) + + global PL_X_AXIS PL_Y_AXIS + if ( axis == PL_Y_AXIS ) + label_val = value; + if ( label_val > 0.0 ) + direction_label = " N"; + elseif ( label_val < 0.0 ) + direction_label = " S"; + else + direction_label = "Eq"; + endif + elseif ( axis == PL_X_AXIS ) + label_val = normalize_longitude( value ); + if ( label_val > 0.0 ) + direction_label = " E"; + elseif ( label_val < 0.0 ) + direction_label = " W"; + else + direction_label = ""; + endif + endif + if ( axis == PL_Y_AXIS && value == 0.0 ) + ## A special case for the equator + label = sprintf( "%s", direction_label ); + else + label = sprintf( "%.0f%s", abs( label_val ), direction_label ); + endif +endfunction + +ix19c Modified: trunk/plplot_test/test_octave.sh.in =================================================================== --- trunk/plplot_test/test_octave.sh.in 2011-03-20 04:45:35 UTC (rev 11661) +++ trunk/plplot_test/test_octave.sh.in 2011-03-20 22:44:44 UTC (rev 11662) @@ -73,7 +73,7 @@ # Example 32 not implemented because there has been no call for propagation # and it exercises no new API. failed = [] ; -@swig_octave_comment@for i=[1:18 20:31 33] ; +@swig_octave_comment@for i=[1:18 19 20:31 33] ; # Drop 4, 18, 26, and 33 because deprecated matwrap does not include plstring, # plstring3, pllegend, or plcolorbar. @matwrap_octave_comment@for i=[1:3 5:17 20:25 27:31 ] ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |