From: <arj...@us...> - 2009-12-03 12:50:53
|
Revision: 10672 http://plplot.svn.sourceforge.net/plplot/?rev=10672&view=rev Author: arjenmarkus Date: 2009-12-03 12:50:44 +0000 (Thu, 03 Dec 2009) Log Message: ----------- Description of the linker definition files added Modified Paths: -------------- trunk/bindings/f77/README.f77API trunk/bindings/f95/readme_f95.txt Modified: trunk/bindings/f77/README.f77API =================================================================== --- trunk/bindings/f77/README.f77API 2009-12-02 20:38:28 UTC (rev 10671) +++ trunk/bindings/f77/README.f77API 2009-12-03 12:50:44 UTC (rev 10672) @@ -1,5 +1,5 @@ The following files work together to define the fortran API for PLplot. -The general rule is +The general rule is * use sfstubs.fm4 for routines that have character strings; @@ -55,3 +55,36 @@ * scstubs.c contains all the simple (non-3D, non-cont, non-shade) API plus some 7-suffix routines that have a special wrapper in sfstubs.f(m4). + + +Linking DLLs on Windows +----------------------- +On Windows it is necessary to specify which routines and functions in +a DLL should be exported, i.e. made visible to external programs. While +there compiler-specific ways to do that within the source code we prefer +to do it via so-called linker definition files (.def). + +Basically, these files contain a list of all the subroutines and functions +that need to be exported, one name per line. The difficulty is, however, +that these names are the names as constructed by the compiler. Each compiler +is free to use its own scheme for turning the name found in the Fortran code +into a "linker" name". + +For the Compaq Visual Fortran the scheme is this: + +subroutine/function Name( a, b ) ==> _NAME@8 + +where the @8 represents the number of bytes in the argument list (the +hidden argument representing the length of string arguments must be +included in that count) + +For the MinGW gfortran compiler the scheme is somewhat simpler: + +subroutine/function Name( a, b ) ==> name_ +subroutine/function My_Name( a, b ) ==> my_name__ + +For the Cygwin gfortran compiler all symbols are automatically exported. There +is no need for a linker definition file. + +One way to find out what the internally produced names are is to examine the +object file (.obj) that is produced by the compiler. Modified: trunk/bindings/f95/readme_f95.txt =================================================================== --- trunk/bindings/f95/readme_f95.txt 2009-12-02 20:38:28 UTC (rev 10671) +++ trunk/bindings/f95/readme_f95.txt 2009-12-03 12:50:44 UTC (rev 10672) @@ -116,3 +116,77 @@ Method 2 is preferred, as it is most "Fortran 95" in character. + + +Linking DLLs on Windows +----------------------- +On Windows it is necessary to specify which routines and functions in +a DLL should be exported, i.e. made visible to external programs. While +there compiler-specific ways to do that within the source code we prefer +to do it via so-called linker definition files (.def). + +Basically, these files contain a list of all the subroutines and functions +that need to be exported, one name per line. The difficulty is, however, +that these names are the names as constructed by the compiler. Each compiler +is free to use its own scheme for turning the name found in the Fortran code +into a "linker" name". + +For the Compaq Visual Fortran the scheme is this: + +subroutine/function Name( a, b ) ==> _NAME@8 + + module plplotp + contains + subroutine/function Name( a, b ) ==> _PLPLOTP_mp_NAME@8 + end module + +where the @8 represents the number of bytes in the argument list (the +hidden argument representing the length of string arguments must be +included in that count) + +For the MinGW gfortran compiler the scheme is somewhat simpler: + + subroutine/function Name( a, b ) ==> name_ + subroutine/function My_Name( a, b ) ==> my_name__ + + module plplotp + contains + subroutine/function Name( a, b ) ==> __plplotp_MOD_name + subroutine/function My_Name( a, b ) ==> __plplotp_MOD_my_name + end module + +For the Cygwin gfortran compiler all symbols are automatically exported. There +is no need for a linker definition file. + +One way to find out what the internally produced names are is to examine the +object file (.obj) that is produced by the compiler. + +Notes: +- The compiler adds the name of the module to the name of the routine +- The MinGW compiler does not append underscores for routines living + in a module, but it does for routines outside a module +- All routines that are mentioned in an interface block must be exported: + + The four routines in this fragment must all be exported via the + linker definition file, even though only the interface name is useable + in the Fortran code (the routines themselves are not visible to a + Fortran program because of the private clause): + + interface plvect + module procedure plvectors_0 + module procedure plvectors_1 + module procedure plvectors_2 + module procedure plvectors_tr + end interface + private :: plvectors_0, plvectors_1, plvectors_2, plvectors_tr + + So the definition file has these lines: + + __plplotp_MOD_plvectors_0 + __plplotp_MOD_plvectors_1 + __plplotp_MOD_plvectors_2 + __plplotp_MOD_plvectors_tr + + (but no line for the interface name as that is stored in the + module intermediate file used by the compiler) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-01-30 06:18:58
|
Revision: 10782 http://plplot.svn.sourceforge.net/plplot/?rev=10782&view=rev Author: airwin Date: 2010-01-30 06:18:52 +0000 (Sat, 30 Jan 2010) Log Message: ----------- More embedded blank fixes. Modified Paths: -------------- trunk/bindings/tcl/pkgIndex.tcl.in trunk/bindings/tk/pkgIndex.tcl.in trunk/bindings/tk-x-plat/pkgIndex.tcl.in Modified: trunk/bindings/tcl/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tcl/pkgIndex.tcl.in 2010-01-30 04:39:29 UTC (rev 10781) +++ trunk/bindings/tcl/pkgIndex.tcl.in 2010-01-30 06:18:52 UTC (rev 10782) @@ -34,7 +34,7 @@ if {$tcl_platform(platform) == "unix"} { set thisDir [pwd] - set buildDir @BUILD_DIR@ + set buildDir "@BUILD_DIR@" set bLen [string length $buildDir] if {![string compare -length $bLen $buildDir $thisDir]} then { set searchdirs ".libs"} else { Modified: trunk/bindings/tk/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tk/pkgIndex.tcl.in 2010-01-30 04:39:29 UTC (rev 10781) +++ trunk/bindings/tk/pkgIndex.tcl.in 2010-01-30 06:18:52 UTC (rev 10782) @@ -35,7 +35,7 @@ if {$tcl_platform(platform) == "unix"} { set stem tk set thisDir [pwd] - set buildDir @BUILD_DIR@ + set buildDir "@BUILD_DIR@" set bLen [string length $buildDir] if {![string compare -length $bLen $buildDir $thisDir]} then { set searchdirs "../../drivers/.libs"} else { Modified: trunk/bindings/tk-x-plat/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tk-x-plat/pkgIndex.tcl.in 2010-01-30 04:39:29 UTC (rev 10781) +++ trunk/bindings/tk-x-plat/pkgIndex.tcl.in 2010-01-30 06:18:52 UTC (rev 10782) @@ -35,7 +35,7 @@ if {$tcl_platform(platform) == "unix"} { set stem tkwin set thisDir [pwd] - set buildDir @BUILD_DIR@ + set buildDir "@BUILD_DIR@" set bLen [string length $buildDir] if {![string compare -length $bLen $buildDir $thisDir]} then { set searchdirs "../../drivers/.libs"} else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hba...@us...> - 2010-01-31 23:59:11
|
Revision: 10790 http://plplot.svn.sourceforge.net/plplot/?rev=10790&view=rev Author: hbabcock Date: 2010-01-31 23:59:04 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Windows specific changes to the Python and PyQt4 build: (1) _plplotcmodule.dll is installed as _plplotc.pyd (2) plplot_pyqt4.dll is installed as plplot_pyqt4.pyd On Windows Python versions 2.5+ will only import ".pyd" files and not ".dll" files. Modified Paths: -------------- trunk/bindings/python/CMakeLists.txt trunk/bindings/qt_gui/pyqt4/CMakeLists.txt Modified: trunk/bindings/python/CMakeLists.txt =================================================================== --- trunk/bindings/python/CMakeLists.txt 2010-01-31 20:07:21 UTC (rev 10789) +++ trunk/bindings/python/CMakeLists.txt 2010-01-31 23:59:04 UTC (rev 10790) @@ -88,6 +88,15 @@ ) endif(USE_RPATH) + if(WIN32) + set_target_properties( + _plplotcmodule + PROPERTIES + SUFFIX ".pyd" + OUTPUT_NAME "_plplotc" + ) + endif(WIN32) + add_library(plplot_widgetmodule MODULE plplot_widgetmodule.c) set_target_properties(plplot_widgetmodule PROPERTIES PREFIX "") set_source_files_properties( Modified: trunk/bindings/qt_gui/pyqt4/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/pyqt4/CMakeLists.txt 2010-01-31 20:07:21 UTC (rev 10789) +++ trunk/bindings/qt_gui/pyqt4/CMakeLists.txt 2010-01-31 23:59:04 UTC (rev 10790) @@ -69,7 +69,16 @@ ${plplot_pyqt4_SRC} ) - set_target_properties(plplot_pyqt4 PROPERTIES PREFIX "") + if(WIN32) + set_target_properties( + plplot_pyqt4 + PROPERTIES + PREFIX "" + SUFFIX ".pyd" + ) + else(WIN32) + set_target_properties(plplot_pyqt4 PROPERTIES PREFIX "") + endif(WIN32) target_link_libraries( plplot_pyqt4 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2010-02-06 20:35:31
|
Revision: 10794 http://plplot.svn.sourceforge.net/plplot/?rev=10794&view=rev Author: andrewross Date: 2010-02-06 20:35:25 +0000 (Sat, 06 Feb 2010) Log Message: ----------- Fix (due to Arjen Markus) which allows blank spaces to be used in build / install path names. Modified Paths: -------------- trunk/bindings/tcl/pkgIndex.tcl.in trunk/bindings/tcl/tclAPI.c trunk/bindings/tk/pkgIndex.tcl.in trunk/bindings/tk/plserver.c Modified: trunk/bindings/tcl/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tcl/pkgIndex.tcl.in 2010-02-06 01:48:39 UTC (rev 10793) +++ trunk/bindings/tcl/pkgIndex.tcl.in 2010-02-06 20:35:25 UTC (rev 10794) @@ -38,10 +38,10 @@ set bLen [string length $buildDir] if {![string compare -length $bLen $buildDir $thisDir]} then { set searchdirs ".libs"} else { - set searchdirs "@LIB_HARDDIR@"} + set searchdirs [list "@LIB_HARDDIR@"]} #puts $searchdirs # prefer double precision version - set dlnames "@DLNAME_LIBPLPLOTTCLTKD@ @DLNAME_LIBPLPLOTTCLTK@"; + set dlnames [list "@DLNAME_LIBPLPLOTTCLTKD@" "@DLNAME_LIBPLPLOTTCLTK@"] set file "" foreach reldir $searchdirs { foreach dlname $dlnames { Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2010-02-06 01:48:39 UTC (rev 10793) +++ trunk/bindings/tcl/tclAPI.c 2010-02-06 20:35:25 UTC (rev 10794) @@ -651,7 +651,7 @@ #ifdef TCL_DIR Tcl_SetVar( interp, "dir", TCL_DIR, TCL_GLOBAL_ONLY ); - if ( tcl_cmd( interp, "set auto_path \"$dir $auto_path\"" ) == TCL_ERROR ) + if ( tcl_cmd( interp, "set auto_path [list $dir $auto_path]" ) == TCL_ERROR ) { return_code = TCL_ERROR; goto finish; @@ -669,7 +669,7 @@ { plGetName( dn, "tcl", "", &ptr ); Tcl_SetVar( interp, "dir", ptr, 0 ); - if ( tcl_cmd( interp, "set auto_path \"$dir $auto_path\"" ) == TCL_ERROR ) + if ( tcl_cmd( interp, "set auto_path [list $dir $auto_path]" ) == TCL_ERROR ) { return_code = TCL_ERROR; goto finish; @@ -688,7 +688,7 @@ { plGetName( dn, "", "", &ptr ); Tcl_SetVar( interp, "dir", ptr, 0 ); - if ( tcl_cmd( interp, "set auto_path \"$dir $auto_path\"" ) == TCL_ERROR ) + if ( tcl_cmd( interp, "set auto_path [list $dir $auto_path]" ) == TCL_ERROR ) { return_code = TCL_ERROR; goto finish; @@ -708,7 +708,7 @@ { plGetName( dn, "tcl", "", &ptr ); Tcl_SetVar( interp, "dir", ptr, 0 ); - if ( tcl_cmd( interp, "set auto_path \"$dir $auto_path\"" ) == TCL_ERROR ) + if ( tcl_cmd( interp, "set auto_path [list $dir $auto_path]" ) == TCL_ERROR ) { return_code = TCL_ERROR; goto finish; @@ -732,7 +732,7 @@ } } Tcl_SetVar( interp, "dir", buf, 0 ); - if ( tcl_cmd( interp, "set auto_path \"$dir $auto_path\"" ) == TCL_ERROR ) + if ( tcl_cmd( interp, "set auto_path [list $dir $auto_path]" ) == TCL_ERROR ) { return_code = TCL_ERROR; goto finish; @@ -741,7 +741,7 @@ if ( plInBuildTree() ) { Tcl_SetVar( interp, "dir", BUILD_DIR "/bindings/tk", TCL_GLOBAL_ONLY ); - if ( tcl_cmd( interp, "set auto_path \"$dir $auto_path\"" ) == TCL_ERROR ) + if ( tcl_cmd( interp, "set auto_path [list $dir $auto_path]" ) == TCL_ERROR ) { return_code = TCL_ERROR; goto finish; Modified: trunk/bindings/tk/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tk/pkgIndex.tcl.in 2010-02-06 01:48:39 UTC (rev 10793) +++ trunk/bindings/tk/pkgIndex.tcl.in 2010-02-06 20:35:25 UTC (rev 10794) @@ -39,7 +39,7 @@ set bLen [string length $buildDir] if {![string compare -length $bLen $buildDir $thisDir]} then { set searchdirs "../../drivers/.libs"} else { - set searchdirs "@DRV_HARDDIR@"} + set searchdirs [list "@DRV_HARDDIR@"]} #puts $searchdirs set suf [info sharedlibextension] @@ -55,9 +55,9 @@ } if { $file == "" } { # Dynamic driver location failed, now try static driver location. - set searchdirs "@LIB_HARDDIR@"; + set searchdirs [list "@LIB_HARDDIR@"] # prefer double precision version - set dlnames "@DLNAME_LIBPLPLOTD@ @DLNAME_LIBPLPLOT@"; + set dlnames [list "@DLNAME_LIBPLPLOTD@" "@DLNAME_LIBPLPLOT@"] set file "" foreach reldir $searchdirs { foreach dlname $dlnames { Modified: trunk/bindings/tk/plserver.c =================================================================== --- trunk/bindings/tk/plserver.c 2010-02-06 01:48:39 UTC (rev 10793) +++ trunk/bindings/tk/plserver.c 2010-02-06 20:35:25 UTC (rev 10794) @@ -225,7 +225,7 @@ if ( auto_path != NULL ) { Tcl_SetVar( interp, "dir", auto_path, 0 ); - tcl_cmd( interp, "set auto_path \"$dir $auto_path\"" ); + tcl_cmd( interp, "set auto_path [list $dir $auto_path]" ); } /* Rename "exit" to "tkexit", and insert custom exit handler */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2010-02-21 13:08:28
|
Revision: 10808 http://plplot.svn.sourceforge.net/plplot/?rev=10808&view=rev Author: arjenmarkus Date: 2010-02-21 12:15:23 +0000 (Sun, 21 Feb 2010) Log Message: ----------- Adding exports for plspal0 and plspal1 Modified Paths: -------------- trunk/bindings/f77/plplotf77.def trunk/bindings/f77/plplotf77_mingw.def trunk/bindings/f95/plplotf95.def trunk/bindings/f95/plplotf95_mingw.def Modified: trunk/bindings/f77/plplotf77.def =================================================================== --- trunk/bindings/f77/plplotf77.def 2010-02-21 10:48:08 UTC (rev 10807) +++ trunk/bindings/f77/plplotf77.def 2010-02-21 12:15:23 UTC (rev 10808) @@ -33,6 +33,8 @@ _PLSHADES1@68 _PLSHADES2@68 _PLSHADES@60 + _PLSPAL0@8 + _PLSPAL1@12 _PLSPAUSE@4 _PLSTART@16 _PLSTRC2F@16 Modified: trunk/bindings/f77/plplotf77_mingw.def =================================================================== --- trunk/bindings/f77/plplotf77_mingw.def 2010-02-21 10:48:08 UTC (rev 10807) +++ trunk/bindings/f77/plplotf77_mingw.def 2010-02-21 12:15:23 UTC (rev 10808) @@ -35,6 +35,8 @@ plshades1_ plshades2_ plshades_ + plspal0_ + plspal1_ plstart_ plstrc2f_ plstripc_ Modified: trunk/bindings/f95/plplotf95.def =================================================================== --- trunk/bindings/f95/plplotf95.def 2010-02-21 10:48:08 UTC (rev 10807) +++ trunk/bindings/f95/plplotf95.def 2010-02-21 12:15:23 UTC (rev 10808) @@ -31,6 +31,8 @@ _PLPLOTP_mp_PLSHADES_MULTIPLE_1@52 _PLPLOTP_mp_PLSHADES_MULTIPLE_2@52 _PLPLOTP_mp_PLSHADES_MULTIPLE_TR@48 + _PLPLOTP_mp_PLSPAL0@8 + _PLPLOTP_mp_PLSPAL1@12 _PLPLOTP_mp_PLLAB@24 _PLPLOTP_mp_PLMTEX@28 _PLPLOTP_mp_PLMTEX3@28 Modified: trunk/bindings/f95/plplotf95_mingw.def =================================================================== --- trunk/bindings/f95/plplotf95_mingw.def 2010-02-21 10:48:08 UTC (rev 10807) +++ trunk/bindings/f95/plplotf95_mingw.def 2010-02-21 12:15:23 UTC (rev 10808) @@ -38,6 +38,8 @@ __plplotp_MOD_plshades_multiple_1 __plplotp_MOD_plshades_multiple_2 __plplotp_MOD_plshades_multiple_tr + __plplotp_MOD_plspal0 + __plplotp_MOD_plspal1 __plplotp_MOD_plstart __plplotp_MOD_pltimefmt __plplotp_MOD_plvectors_0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-07-23 16:49:47
|
Revision: 11103 http://plplot.svn.sourceforge.net/plplot/?rev=11103&view=rev Author: airwin Date: 2010-07-23 16:49:41 +0000 (Fri, 23 Jul 2010) Log Message: ----------- plplotcapi.i should be reserved strictly to define the PLplot API covered by swig. Thus, move PYTHON_HAVE_PYBUFFER non-API statements out of plplotcapi.i to plplotcmodule.i. Modified Paths: -------------- trunk/bindings/python/plplotcmodule.i trunk/bindings/swig-support/plplotcapi.i Modified: trunk/bindings/python/plplotcmodule.i =================================================================== --- trunk/bindings/python/plplotcmodule.i 2010-07-23 16:45:43 UTC (rev 11102) +++ trunk/bindings/python/plplotcmodule.i 2010-07-23 16:49:41 UTC (rev 11103) @@ -1241,5 +1241,11 @@ resultobj = t_output_helper(resultobj, o); } #endif + +#ifdef PYTHON_HAVE_PYBUFFER +%include <pybuffer.i> +%pybuffer_mutable_string(void * plotmem) +#endif + /* swig compatible PLplot API definitions from here on. */ %include plplotcapi.i Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2010-07-23 16:45:43 UTC (rev 11102) +++ trunk/bindings/swig-support/plplotcapi.i 2010-07-23 16:49:41 UTC (rev 11103) @@ -774,11 +774,8 @@ void plsmaj(PLFLT def, PLFLT scale); -#ifdef PYTHON_HAVE_PYBUFFER +#if defined ( PYTHON_HAVE_PYBUFFER ) && defined ( SWIG_PYTHON ) -%include <pybuffer.i> -%pybuffer_mutable_string(void * plotmem) - %feature("autodoc", "Set the memory area to be plotted (with the 'mem' driver).") plsmem; void plsmem(PLINT maxx, PLINT maxy, void *plotmem); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2010-08-17 06:42:31
|
Revision: 11137 http://plplot.svn.sourceforge.net/plplot/?rev=11137&view=rev Author: arjenmarkus Date: 2010-08-17 06:42:25 +0000 (Tue, 17 Aug 2010) Log Message: ----------- Add .def files for Intel Fortran (and corresponding support in CMakeLists.txt file) Add a few missing subroutines for Fortran 77 to the .def file (must still be checked for CVF) - similiarly for Fortran 95 Add a new linkage macro for Intel Fortran Some questions though: why does gfortran not need the entries for plmap1/2 and plmeridians1/2? Note that while Intel Fortran now gives nice results (as does gfortran under MinGW) when using makefiles, there is a problem with VS2008 solutions. This needs to be sorted out. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt trunk/bindings/f77/plplotf77.def trunk/bindings/f77/plplotf77_mingw.def trunk/bindings/f77/plstubs.h trunk/bindings/f95/CMakeLists.txt trunk/bindings/f95/plstubs.h trunk/bindings/f95/sfstubsf95.f90 Added Paths: ----------- trunk/bindings/f77/plplotf77_ifort.def trunk/bindings/f95/plplotf95_ifort.def Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2010-08-17 06:36:08 UTC (rev 11136) +++ trunk/bindings/f77/CMakeLists.txt 2010-08-17 06:42:25 UTC (rev 11137) @@ -47,8 +47,10 @@ # Set the flags for the C compiler. The C stubs need to have the # correction case and calling convention for the Fortran compiler IF(TARGET_FORTRAN MATCHES "IVF") + SET(DEFFILE "_ifort") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DIVF") ELSEIF(TARGET_FORTRAN MATCHES "CVF") + SET(DEFFILE "") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF") ENDIF(TARGET_FORTRAN MATCHES "IVF") endif(WIN32) @@ -144,7 +146,7 @@ if(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) - SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77.def) + SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77${DEFFILE}.def) endif(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) add_library(plplotf77${LIB_TAG} ${plplotf77${LIB_TAG}_LIB_SRCS}) Modified: trunk/bindings/f77/plplotf77.def =================================================================== --- trunk/bindings/f77/plplotf77.def 2010-08-17 06:36:08 UTC (rev 11136) +++ trunk/bindings/f77/plplotf77.def 2010-08-17 06:42:25 UTC (rev 11137) @@ -17,7 +17,9 @@ _PLIMAGEFR@48 _PLLAB@24 _PLMAP@28 + _PLMAP_NONE@24 _PLMERIDIANS@28 + _PLMERIDIANS_NONE@24 _PLMTEX3@28 _PLMTEX@28 _PLPARSEOPTS@4 Added: trunk/bindings/f77/plplotf77_ifort.def =================================================================== --- trunk/bindings/f77/plplotf77_ifort.def (rev 0) +++ trunk/bindings/f77/plplotf77_ifort.def 2010-08-17 06:42:25 UTC (rev 11137) @@ -0,0 +1,47 @@ +EXPORTS + PLABORT + PLAXES + PLBOX3 + PLBOX + PLCON0 + PLCON1 + PLCON2 + PLCONT + PLGDEV + PLGFNAM + PLSFNAM + PLGVER + PLIMAGEFR0 + PLIMAGEFR1 + PLIMAGEFR2 + PLIMAGEFR + PLLAB + PLMAP + PLMAP_NONE + PLMERIDIANS + PLMERIDIANS_NONE + PLMTEX3 + PLMTEX + PLPARSEOPTS + PLPTEX3 + PLPTEX + PLSDEV + PLSETOPT + PLSHADE0 + PLSHADE1 + PLSHADE2 + PLSHADE + PLSHADES0 + PLSHADES1 + PLSHADES2 + PLSHADES + PLSPAL0 + PLSPAL1 + PLSPAUSE + PLSTART + PLSTRC2F + PLSTRIPC + PLTIMEFMT + PLVEC0 + PLVEC1 + PLVEC2 Modified: trunk/bindings/f77/plplotf77_mingw.def =================================================================== --- trunk/bindings/f77/plplotf77_mingw.def 2010-08-17 06:36:08 UTC (rev 11136) +++ trunk/bindings/f77/plplotf77_mingw.def 2010-08-17 06:42:25 UTC (rev 11137) @@ -18,7 +18,9 @@ plimagefr_ pllab_ plmap_ + plmap_none_ plmeridians_ + plmeridians_none_ plmtex3_ plmtex_ plparseopts_ Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2010-08-17 06:36:08 UTC (rev 11136) +++ trunk/bindings/f77/plstubs.h 2010-08-17 06:42:25 UTC (rev 11137) @@ -54,6 +54,7 @@ #define STUB_FORTRAN 4 #define STUB_STDCALL 5 #define STUB_MINGW 6 +#define STUB_IVF 7 #ifndef STUB_LINKAGE @@ -91,9 +92,9 @@ #endif #endif -#ifdef WIN32 /* Windows 32-bit */ -#ifdef IVF /* Intel Visual Fortran */ -#define STUB_LINKAGE STUB_U +#if defined( WIN32 ) /* Windows 32-bit */ +#if defined( IVF ) /* Intel Visual Fortran */ +#define STUB_LINKAGE STUB_IVF #elif defined ( CVF ) /* MSVC/CVF */ #define STUB_LINKAGE STUB_U #elif defined ( MSDOS ) /* MS-DOS based */ @@ -143,6 +144,10 @@ #define FNAME( x, y ) PLDLLIMPEXP_F77C y ## _ #define FNAME_( x, y ) y +#elif STUB_LINKAGE == STUB_IVF +#define FNAME( x, y ) PLDLLIMPEXP_F77C x +#define FNAME_( x, y ) x + #else #error "Illegal setting for STUB_LINKAGE" #endif Modified: trunk/bindings/f95/CMakeLists.txt =================================================================== --- trunk/bindings/f95/CMakeLists.txt 2010-08-17 06:36:08 UTC (rev 11136) +++ trunk/bindings/f95/CMakeLists.txt 2010-08-17 06:42:25 UTC (rev 11137) @@ -49,8 +49,10 @@ # Set the flags for the C compiler. The C stubs need to have the # correct case and calling convention for the Fortran compiler IF(TARGET_FORTRAN MATCHES "IVF") + SET(DEFFILE "_ifort") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DIVF") ELSEIF(TARGET_FORTRAN MATCHES "CVF") + SET(DEFFILE "") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF") ENDIF(TARGET_FORTRAN MATCHES "IVF") endif(WIN32) @@ -95,7 +97,7 @@ RUNTIME DESTINATION ${BIN_DIR} ) - # Build fortran part of F95 bindings. + # Build fortran part of F95 bindings. # Notes: # configurable.f90 is actually not currently configurable. @@ -124,7 +126,7 @@ endif(STATIC_OPTS) if(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT CYGWIN) - SET(plplotf95${LIB_TAG}_LIB_SRCS ${plplotf95${LIB_TAG}_LIB_SRCS} plplotf95.def) + SET(plplotf95${LIB_TAG}_LIB_SRCS ${plplotf95${LIB_TAG}_LIB_SRCS} plplotf95${DEFFILE}.def) endif(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT CYGWIN) add_library(plplotf95${LIB_TAG} ${plplotf95${LIB_TAG}_LIB_SRCS}) Added: trunk/bindings/f95/plplotf95_ifort.def =================================================================== --- trunk/bindings/f95/plplotf95_ifort.def (rev 0) +++ trunk/bindings/f95/plplotf95_ifort.def 2010-08-17 06:42:25 UTC (rev 11137) @@ -0,0 +1,83 @@ +LIBRARY plplotf95d.dll +EXPORTS + PLPARSEOPTS + PLPLOTP_mp_PLSETOPT + PLPLOTP_mp_PLSDEV + PLPLOTP_mp_PLGDEV + PLPLOTP_mp_PLSFNAM + PLPLOTP_mp_PLGFNAM + PLPLOTP_mp_PLGVER + PLPLOTP_mp_PLAXES + PLPLOTP_mp_PLBOX + PLPLOTP_mp_PLBOX3 + PLPLOTP_mp_PLCONTOUR_0 + PLPLOTP_mp_PLCONTOUR_1 + PLPLOTP_mp_PLCONTOUR_2 + PLPLOTP_mp_PLCONTOUR_TR + PLPLOTP_mp_PLCONTOUR_0_ALL + PLPLOTP_mp_PLCONTOUR_1_ALL + PLPLOTP_mp_PLCONTOUR_2_ALL + PLPLOTP_mp_PLCONTOUR_TR_ALL + PLPLOT_mp_PLGRADIENT + PLPLOTP_mp_PLVECTORS_0 + PLPLOTP_mp_PLVECTORS_1 + PLPLOTP_mp_PLVECTORS_2 + PLPLOTP_mp_PLVECTORS_TR + PLPLOTP_mp_PLSHADE_SINGLE_0 + PLPLOTP_mp_PLSHADE_SINGLE_1 + PLPLOTP_mp_PLSHADE_SINGLE_2 + PLPLOTP_mp_PLSHADE_SINGLE_TR + PLPLOTP_mp_PLSHADES_MULTIPLE_0 + PLPLOTP_mp_PLSHADES_MULTIPLE_1 + PLPLOTP_mp_PLSHADES_MULTIPLE_2 + PLPLOTP_mp_PLSHADES_MULTIPLE_TR + PLPLOTP_mp_PLSPAL0 + PLPLOTP_mp_PLSPAL1 + PLPLOTP_mp_PLLAB + PLPLOTP_mp_PLMTEX + PLPLOTP_mp_PLMTEX3 + PLPLOTP_mp_PLPTEX + PLPLOTP_mp_PLPTEX3 + PLPLOTP_mp_PLSTART + PLPLOT_mp_PLMAP1 + PLPLOT_mp_PLMAP2 + PLPLOT_mp_PLMERIDIANS1 + PLPLOT_mp_PLMERIDIANS2 + PLPLOTP_mp_PLTIMEFMT + PLPLOT_mp_PLBIN + PLPLOT_mp_PLCPSTRM + PLPLOT_mp_PLERRX + PLPLOT_mp_PLERRY + PLPLOT_mp_PLFILL + PLPLOT_mp_PLFILL3 + PLPLOT_mp_PLGRIDDATA + PLPLOT_mp_PLHIST + PLPLOT_mp_PLIMAGE + PLPLOTP_mp_PLIMAGEFR_0 + PLPLOTP_mp_PLIMAGEFR_1 + PLPLOTP_mp_PLIMAGEFR_2 + PLPLOTP_mp_PLIMAGEFR_TR + PLPLOT_mp_PLLINE + PLPLOT_mp_PLLINE3 + PLPLOT_mp_PLMESH + PLPLOT_mp_PLMESHC + PLPLOT_mp_PLOT3D + PLPLOT_mp_PLOT3DC + PLPLOT_mp_PLRANDD + PLPLOT_mp_PLSPAUSE + PLPLOT_mp_PLSURF3D + PLPLOT_mp_PLPOIN + PLPLOT_mp_PLPOIN3 + PLPLOT_mp_PLPOLY3 + PLPLOT_mp_PLSCMAP0 + PLPLOT_mp_PLSCMAP0A + PLPLOT_mp_PLSCMAP1 + PLPLOT_mp_PLSCMAP1A + PLPLOT_mp_PLSCMAP1L + PLPLOT_mp_PLSCMAP1LA + PLPLOT_mp_PLSCMAP1LA2 + PLPLOT_mp_PLSCMAP1L2 + PLPLOT_mp_PLSTRIPC + PLPLOT_mp_PLSVECT + PLPLOT_mp_PLSYM + PLPLOT_mp_PLXORMOD Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2010-08-17 06:36:08 UTC (rev 11136) +++ trunk/bindings/f95/plstubs.h 2010-08-17 06:42:25 UTC (rev 11137) @@ -54,6 +54,7 @@ #define STUB_FORTRAN 4 #define STUB_STDCALL 5 #define STUB_MINGW 6 +#define STUB_IVF 7 #ifndef STUB_LINKAGE @@ -93,7 +94,7 @@ #ifdef WIN32 /* MS-DOS based */ #ifdef IVF /* Intel Visual Fortran */ -#define STUB_LINKAGE STUB_U +#define STUB_LINKAGE STUB_IVF #elif defined ( CVF ) #define STUB_LINKAGE STUB_U #elif defined ( MSDOS ) @@ -143,6 +144,10 @@ #define FNAME( x, y ) PLDLLIMPEXP_F95C y ## _ #define FNAME_( x, y ) y +#elif STUB_LINKAGE == STUB_IVF +#define FNAME( x, y ) PLDLLIMPEXP_F95C x +#define FNAME_( x, y ) x + #else #error "Illegal setting for STUB_LINKAGE" #endif Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2010-08-17 06:36:08 UTC (rev 11136) +++ trunk/bindings/f95/sfstubsf95.f90 2010-08-17 06:42:25 UTC (rev 11137) @@ -1110,37 +1110,37 @@ call plline3f77( size(x), x, y, z ) end subroutine plline3 - subroutine plmap1(mapform,mapname,minx,maxx,miny,maxy) + subroutine plmap1(mapform,mapname,minx,maxx,miny,maxy) use plplot_flt implicit none real(kind=plflt) minx, maxx, miny, maxy character*(*) mapname external mapform - + include 'sfstubs.h' - + call plstrf2c(mapname, string1, maxlen) - + call plsetmapformc(mapform) s1 = transfer( string1, s1 ) call plmap7(s1,minx,maxx,miny,maxy) - + end subroutine plmap1 - + subroutine plmap2(mapname,minx,maxx,miny,maxy) use plplot_flt implicit none real(kind=plflt) minx, maxx, miny, maxy character*(*) mapname - + include 'sfstubs.h' - + call plstrf2c(mapname, string1, maxlen) - + call plclearmapformc() s1 = transfer( string1, s1 ) call plmap7(s1,minx,maxx,miny,maxy) - + end subroutine plmap2 subroutine plmeridians1(mapform,dlong,dlat,minlong,maxlong, & @@ -1162,7 +1162,6 @@ implicit none real(kind=plflt) dlong, dlat, minlong, maxlong, minlat, maxlat - external mapform include 'sfstubs.h' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-05 08:14:23
|
Revision: 11439 http://plplot.svn.sourceforge.net/plplot/?rev=11439&view=rev Author: airwin Date: 2011-01-05 08:14:16 +0000 (Wed, 05 Jan 2011) Log Message: ----------- Deal with decisions about ignoring pllegend at the bindings/<language>/*.i level rather than at the bindings/swig-support/plplotcapi.i level. Modified Paths: -------------- trunk/bindings/java/plplotjavac.i trunk/bindings/lua/plplotluac.i trunk/bindings/swig-support/plplotcapi.i Modified: trunk/bindings/java/plplotjavac.i =================================================================== --- trunk/bindings/java/plplotjavac.i 2011-01-05 08:12:42 UTC (rev 11438) +++ trunk/bindings/java/plplotjavac.i 2011-01-05 08:14:16 UTC (rev 11439) @@ -1739,5 +1739,8 @@ } #endif +// Not implemented yet. +%ignore pllegend; + /* swig compatible PLplot API definitions from here on. */ %include plplotcapi.i Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2011-01-05 08:12:42 UTC (rev 11438) +++ trunk/bindings/lua/plplotluac.i 2011-01-05 08:14:16 UTC (rev 11439) @@ -1156,6 +1156,9 @@ %rename(abort) plabort; %rename(MinMax2dGrid) plMinMax2dGrid; +// Not implemented yet. +%ignore pllegend; + /* swig compatible PLplot API definitions from here on. */ %include plplotcapi.i Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-01-05 08:12:42 UTC (rev 11438) +++ trunk/bindings/swig-support/plplotcapi.i 2011-01-05 08:14:16 UTC (rev 11439) @@ -526,7 +526,6 @@ void pllab( const char *xlabel, const char *ylabel, const char *tlabel ); -#ifdef SWIG_PYTHON %feature( "autodoc", "Create a discrete annotated legend using boxes, lines, and/or lines of symbols." ) pllegend; void pllegend( PLFLT *OUTPUT, PLFLT *OUTPUT, @@ -545,7 +544,6 @@ const PLINT *ArrayCk, const char **ArrayCk ); %feature( "autodoc", "Set position of the light source." ) pllightsource; -#endif void pllightsource( PLFLT x, PLFLT y, PLFLT z ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-11 23:14:15
|
Revision: 11483 http://plplot.svn.sourceforge.net/plplot/?rev=11483&view=rev Author: airwin Date: 2011-01-11 23:14:08 +0000 (Tue, 11 Jan 2011) Log Message: ----------- Implement check_swig_documentation (Unix) target that uses doc/docbook/bin/api2swigdoc.pl to parse doc/docbook/src/api.xml to generate bindings/swig-support/swig_documentation.i_compare in the build tree, and compares that result with bindings/swig-support/swig_documentation.i in the source tree to make sure that latter file is consistent with api.xml. Modified Paths: -------------- trunk/bindings/CMakeLists.txt Added Paths: ----------- trunk/bindings/swig-support/CMakeLists.txt Modified: trunk/bindings/CMakeLists.txt =================================================================== --- trunk/bindings/CMakeLists.txt 2011-01-11 23:07:30 UTC (rev 11482) +++ trunk/bindings/CMakeLists.txt 2011-01-11 23:14:08 UTC (rev 11483) @@ -19,6 +19,9 @@ # along with PLplot; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# swig-support has to come before swig-generated bindings (currently +# python, java, lua, and octave). +add_subdirectory(swig-support) add_subdirectory(c++) add_subdirectory(f77) add_subdirectory(f95) Added: trunk/bindings/swig-support/CMakeLists.txt =================================================================== --- trunk/bindings/swig-support/CMakeLists.txt (rev 0) +++ trunk/bindings/swig-support/CMakeLists.txt 2011-01-11 23:14:08 UTC (rev 11483) @@ -0,0 +1,47 @@ +# bindings/swig-support/CMakeLists.txt for PLplot +### +### Process this file with cmake to produce Makefile +### +# Copyright (C) 2010 Alan W. 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 Library General Public License as published +# by the Free Software Foundation; version 2 of the License. +# +# 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 + +# Add (Unix) custom target to check that swig_documentation.i is up to +# date with our DocBook api chapter +if(PERL_XML_DOM AND PERL_XML_PARSER) + add_custom_target( + check_swig_documentation + COMMAND ${CMAKE_COMMAND} -E remove -f + ${CMAKE_CURRENT_BINARY_DIR}/swig_documentation.i_compare + COMMAND ${PERL_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/doc/docbook/bin/api2swigdoc.pl + ${CMAKE_SOURCE_DIR}/doc/docbook/src/plplotdoc.xml.in + ${CMAKE_SOURCE_DIR}/doc/docbook/src/api.xml + ${CMAKE_CURRENT_BINARY_DIR}/swig_documentation.i_compare + COMMAND cmp + ${CMAKE_CURRENT_SOURCE_DIR}/swig_documentation.i + ${CMAKE_CURRENT_BINARY_DIR}/swig_documentation.i_compare + ) + + set(make_documentation_DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/plplot_octave_txt/${rep_doc} + ) +else(PERL_XML_DOM AND PERL_XML_PARSER) + message(STATUS + "WARNING: Perl modules XML::Parser and/or XML::DOM not available\n" + " so cannot check that swig_documentation.i is up to date." + ) +endif(PERL_XML_DOM AND PERL_XML_PARSER) Property changes on: trunk/bindings/swig-support/CMakeLists.txt ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-12 00:56:11
|
Revision: 11486 http://plplot.svn.sourceforge.net/plplot/?rev=11486&view=rev Author: airwin Date: 2011-01-12 00:56:04 +0000 (Wed, 12 Jan 2011) Log Message: ----------- Remove all docstring %feature's from plplotcapi.i. Use separate file, swig_documentation.i (which has much more complete information derived from api.xml) instead. N.B. This gives excellent results on Octave, but the separate file approach may need further tweaking to work on Python. It has been a long time since I have looked at the Python generated help strings so I may be doing something incorrectly, but when I attempt to do that now using, e.g., pllegend.__doc__ I get no errors but also no help results. Modified Paths: -------------- trunk/bindings/octave/CMakeLists.txt trunk/bindings/octave/plplot_octave.i trunk/bindings/python/CMakeLists.txt trunk/bindings/python/plplotcmodule.i trunk/bindings/swig-support/plplotcapi.i Modified: trunk/bindings/octave/CMakeLists.txt =================================================================== --- trunk/bindings/octave/CMakeLists.txt 2011-01-12 00:22:44 UTC (rev 11485) +++ trunk/bindings/octave/CMakeLists.txt 2011-01-12 00:56:04 UTC (rev 11486) @@ -179,7 +179,9 @@ ) set(SWIG_MODULE_plplot_octave_EXTRA_DEPS - ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i) + ${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) Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2011-01-12 00:22:44 UTC (rev 11485) +++ trunk/bindings/octave/plplot_octave.i 2011-01-12 00:56:04 UTC (rev 11486) @@ -1280,5 +1280,7 @@ // Probably never deal with this one. %ignore plMinMax2dGrid; +// %feature commands supporting swig-generated documentation for the bindings. +%include swig_documentation.i // swig-compatible common PLplot API definitions from here on. %include plplotcapi.i Modified: trunk/bindings/python/CMakeLists.txt =================================================================== --- trunk/bindings/python/CMakeLists.txt 2011-01-12 00:22:44 UTC (rev 11485) +++ trunk/bindings/python/CMakeLists.txt 2011-01-12 00:56:04 UTC (rev 11486) @@ -71,7 +71,9 @@ set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}) set(SWIG_MODULE_plplotcmodule_EXTRA_DEPS - ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i) + ${CMAKE_SOURCE_DIR}/bindings/swig-support/swig_documentation.i + ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i + ) set_source_files_properties(plplotcmodule.i PROPERTIES SWIG_MODULE_NAME plplotc Modified: trunk/bindings/python/plplotcmodule.i =================================================================== --- trunk/bindings/python/plplotcmodule.i 2011-01-12 00:22:44 UTC (rev 11485) +++ trunk/bindings/python/plplotcmodule.i 2011-01-12 00:56:04 UTC (rev 11486) @@ -1293,5 +1293,7 @@ %pybuffer_mutable_string(void * plotmem) #endif -/* swig compatible PLplot API definitions from here on. */ +/* %feature commands supporting swig-generated documentation for the bindings. *. +%include swig_documentation.i +/* swig-compatible PLplot API definitions from here on. */ %include plplotcapi.i Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-01-12 00:22:44 UTC (rev 11485) +++ trunk/bindings/swig-support/plplotcapi.i 2011-01-12 00:56:04 UTC (rev 11486) @@ -240,8 +240,6 @@ #define SWIG_OBJECT_DATA_img OBJECT_DATA_img #endif -%feature( "autodoc", "1" ); - #ifdef SWIG_PYTHON // Non-common API that are included here because they traditionally @@ -251,14 +249,12 @@ // Deprecated function that we no longer want to propagate to the // python API. -%feature( "docstring", "Plot an arrow." ) plarrows; void plarrows( PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLFLT *ArrayCk, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy ); #endif -%feature( "docstring", "Set inferior X window." ) plsxwin; void plsxwin( PLINT window_id ); @@ -266,73 +262,56 @@ // Complete list of common API (has "c_" suffix version defined in plplot.h) -%feature( "docstring", "Set the format of the contour labels." ) -pl_setcontlabelformat; void pl_setcontlabelformat( PLINT lexp, PLINT sigdig ); -%feature( "docstring", "Set offset and spacing of contour labels." ) pl_setcontlabelparam; void pl_setcontlabelparam( PLFLT offset, PLFLT size, PLFLT spacing, PLINT active ); -%feature( "docstring", "Advance to subpage \"page\", or to the next one if \"page\" = 0." ) pladv; void pladv( PLINT page ); -%feature( "docstring", "Plot an arc" ) plarc; void plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLBOOL fill ); -%feature( "docstring", "This functions similarly to plbox() except that the origin of the axes is placed at the user-specified point (x0, y0)." ) plaxes; void plaxes( PLFLT x0, PLFLT y0, const char *xopt, PLFLT xtick, PLINT nxsub, const char *yopt, PLFLT ytick, PLINT nysub ); -%feature( "docstring", "Plot a histogram using x to store data values and y to store frequencies." ) plbin; void plbin( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLINT center ); -%feature( "docstring", "Calculate broken-down time from continuous time for current stream." ) plbtime; void plbtime( PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLFLT *OUTPUT, PLFLT ctime ); -%feature( "docstring", "Start new page. Should only be used with pleop()." ) plbop; void plbop( void ); -%feature( "docstring", "Draw a box around the current viewport." ) plbox; void plbox( const char *xopt, PLFLT xtick, PLINT nxsub, const char *yopt, PLFLT ytick, PLINT nysub ); -%feature( "docstring", "This is the 3-d analogue of plbox()." ) plbox3; void plbox3( const char *xopt, const char *xlabel, PLFLT xtick, PLINT nsubx, const char *yopt, const char *ylabel, PLFLT ytick, PLINT nsuby, const char *zopt, const char *zlabel, PLFLT ztick, PLINT nsubz ); -%feature( "docstring", "Calculate world coordinates and subpage from relative device coordinates." ) plcalc_world; void plcalc_world( PLFLT rx, PLFLT ry, PLFLT *OUTPUT, PLFLT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Clear current subpage." ) plclear; void plclear( void ); -%feature( "docstring", "Set color, map 0. Argument is integer between 0 and 15." ) plcol0; void plcol0( PLINT icol0 ); -%feature( "docstring", "Set color, map 1. Argument is a float between 0. and 1." ) plcol1; void plcol1( PLFLT col1 ); -%feature( "docstring", "Configure transformation between continuous and broken-down time (and vice versa) for current stream." ) plconfigtime; 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 ); -%feature( "docstring", "Draw a contour plot." ) plcont; void plcont( PLFLT **Matrix, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT *Array, PLINT n, @@ -340,181 +319,138 @@ PLPointer SWIG_OBJECT_DATA ); -%feature( "docstring", "Calculate continuous time from broken-down time for current stream." ) plctime; void plctime( PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec, PLFLT *OUTPUT ); -%feature( "docstring", "Copy state parameters from the reference stream to the current stream." ) plcpstrm; void plcpstrm( PLINT iplsr, PLBOOL flags ); -%feature( "docstring", "End a plotting session for all open streams." ) plend; void plend( void ); -%feature( "docstring", "End a plotting session for the current stream only." ) plend1; void plend1( void ); -%feature( "docstring", "Simple interface for defining viewport and window." ) plenv; void plenv( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis ); -%feature( "docstring", "Simple interface for defining viewport and window." ) plenv0; void plenv0( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis ); -%feature( "docstring", "End current page. Should only be used with plbop()." ) pleop; void pleop( void ); -%feature( "docstring", "Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i))." ) plerrx; void plerrx( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk ); -%feature( "docstring", "Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i))." ) plerry; void plerry( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk ); -%feature( "docstring", "Advance to the next family file on the next new page." ) plfamadv; void plfamadv( void ); -%feature( "docstring", "Pattern fills the polygon bounded by the input points." ) plfill; void plfill( PLINT n, PLFLT *Array, PLFLT *ArrayCk ); -%feature( "docstring", "Pattern fills the 3d polygon bounded by the input points." ) plfill3; void plfill3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk ); -%feature( "docstring", "Renders linear gradient for the polygon bounded by the input points." ) plgradient; void plgradient( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT angle ); -%feature( "docstring", "Flush the output stream. Use sparingly, if at all." ) plflush; void plflush( void ); -%feature( "docstring", "Set the global font flag to 'ifont'." ) plfont; void plfont( PLINT ifont ); -%feature( "docstring", "Load specified font set." ) plfontld; void plfontld( PLINT fnt ); -%feature( "docstring", "Get character default height and current (scaled) height." ) plgchr; void plgchr( PLFLT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Get 8 bit RGB values for given color from color map 0." ) plgcol0; void plgcol0( PLINT icol0, PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Get 8 bit RGB + alpha values for given color from color map 0." ) plgcol0a; void plgcol0a( PLINT icol0, PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Get 8-bit RGB background color." ) plgcolbg; void plgcolbg( PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Get 8-bit RGB + alpha background color." ) plgcolbga; void plgcolbga( PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Get the current compression setting." ) plgcompression; void plgcompression( PLINT *OUTPUT ); -%feature( "docstring", "Get the current device (keyword) name." ) plgdev; void plgdev( char *OUTPUT ); -%feature( "docstring", "Retrieve current window into device space." ) plgdidev; void plgdidev( PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Get plot orientation." ) plgdiori; void plgdiori( PLFLT *OUTPUT ); -%feature( "docstring", "Retrieve current window into plot space." ) plgdiplt; void plgdiplt( PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Get family file parameters." ) plgfam; void plgfam( PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Get FCI (font characterization integer)." ) plgfci; void plgfci( PLUNICODE *OUTPUT ); -%feature( "docstring", "Get the (current) output file name." ) plgfnam; void plgfnam( char *OUTPUT ); -%feature( "docstring", "Get the current font family, style and weight." ) plgfont; void plgfont( PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Get the (current) run level." ) plglevel; void plglevel( PLINT *OUTPUT ); -%feature( "docstring", "Get output device parameters." ) plgpage; void plgpage( PLFLT *OUTPUT, PLFLT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Switch to graphics screen." ) plgra; void plgra( void ); -%feature( "docstring", "Grid irregular sample data." ) plgriddata; void plgriddata( PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLINT n, PLFLT *ArrayX, PLINT nx, PLFLT *ArrayY, PLINT ny, PLFLT **OutMatrixCk, PLINT type, PLFLT data ); -%feature( "docstring", "Get subpage boundaries in absolute coordinates." ) plgspa; void plgspa( PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Get current stream number." ) plgstrm; void plgstrm( PLINT *OUTPUT ); -%feature( "docstring", "Get current library version number." ) plgver; void plgver( char *OUTPUT ); -%feature( "docstring", "Get viewport boundaries in normalized device coordinates." ) plgvpd; void plgvpd( PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Get viewport boundaries in world coordinates." ) plgvpw; void plgvpw( PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Get x axis labeling parameters." ) plgxax; void plgxax( PLINT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Get y axis labeling parameters." ) plgyax; void plgyax( PLINT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Get z axis labeling parameters." ) plgzax; void plgzax( PLINT *OUTPUT, PLINT *OUTPUT ); -%feature( "docstring", "Draw histogram." ) plhist; void plhist( PLINT n, PLFLT *Array, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT oldwin ); @@ -523,28 +459,22 @@ // Deprecated function that we no longer want to propagate to the // python API. -%feature( "docstring", "Set current color (map 0) by hue, lightness, and saturation." ) plhls; void plhls( PLFLT h, PLFLT l, PLFLT s ); #endif -%feature( "docstring", "Transform from HLS to RGB form of colours." ) plhlsrgb; void plhlsrgb( PLFLT h, PLFLT l, PLFLT s, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Initialize PLplot, using preset or default options." ) plinit; void plinit( void ); -%feature( "docstring", "Draw a line segment from (x1, y1) to (x2, y2)." ) pljoin; void pljoin( PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2 ); -%feature( "docstring", "Label graphs." ) pllab; void pllab( const char *xlabel, const char *ylabel, const char *tlabel ); -%feature( "docstring", "Create a discrete annotated legend using boxes, lines, and/or lines of symbols." ) pllegend; void pllegend( PLFLT *OUTPUT, PLFLT *OUTPUT, PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, @@ -561,249 +491,191 @@ const PLINT *ArrayCkNull, const PLFLT *ArrayCkNull, const PLINT *ArrayCkNull, const char **ArrayCk ); -%feature( "docstring", "Create a continous colorbar using an image, shade, or gradient with an optional axis label." ) plcolorbar; void 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 ); -%feature( "docstring", "Set position of the light source." ) pllightsource; void pllightsource( PLFLT x, PLFLT y, PLFLT z ); -%feature( "docstring", "Draw line segments connecting a series of points." ) plline; void plline( PLINT n, PLFLT *Array, PLFLT *ArrayCk ); -%feature( "docstring", "Draw a line in 3 space." ) plline3; void plline3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk ); -%feature( "docstring", "Set line style." ) pllsty; void pllsty( PLINT lin ); -%feature( "docstring", "Plot a 3-d mesh representation of z[x][y]." ) plmesh; void plmesh( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, PLINT nx, PLINT ny, PLINT opt ); -%feature( "docstring", "Plot a 3-d contoured mesh representation of the function z[x][y]." ) plmeshc; void plmeshc( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); -%feature( "docstring", "Create a new stream and makes it the default." ) plmkstrm; void plmkstrm( PLINT *OUTPUT ); -%feature( "docstring", "Print \"text\" at specified position relative to viewport." ) plmtex; void plmtex( const char *side, PLFLT disp, PLFLT pos, PLFLT just, const char *text ); -%feature( "docstring", "Print \"text\" at specified position relative to 3D viewport." ) plmtex3; void plmtex3( const char *side, PLFLT disp, PLFLT pos, PLFLT just, const char *text ); -%feature( "docstring", "Plot a 3-d representation of the function z[x][y]." ) plot3d; void plot3d( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, PLINT nx, PLINT ny, PLINT opt, PLBOOL side ); -%feature( "docstring", "Plot a 3-d contoured representation of the function z[x][y]." ) plot3dc; void plot3dc( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); -%feature( "docstring", "Plot a 3-d contoured representation of the function z[x][y] with limits on the y index." ) plot3dcl; 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 ); -%feature( "docstring", "Plot a 3-d contoured surface representation of the function z[x][y]." ) plsurf3d; void plsurf3d( PLFLT *ArrayX, PLFLT *ArrayY, PLFLT **MatrixCk, PLINT nx, PLINT ny, PLINT opt, PLFLT *Array, PLINT n ); -%feature( "docstring", "Plot a 3-d contoured surface representation of the function z[x][y] with limits on the y index." ) plsurf3dl; 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 ); -%feature( "docstring", "Process options list using current options info." ) plparseopts; PLINT plparseopts( int *p_argc, const char **argv, PLINT mode ); -%feature( "docstring", "Set fill pattern directly." ) plpat; void plpat( PLINT n, PLINT *Array, PLINT *ArrayCk ); -%feature( "docstring", "Plot array y against x for n points using ASCII code \"code\"." ) plpoin; void plpoin( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLINT code ); -%feature( "docstring", "Draw a series of points in 3 space." ) plpoin3; void plpoin3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLINT code ); -%feature( "docstring", "Draw a polygon in 3 space." ) plpoly3; void plpoly3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLBOOL *ArrayCkMinus1, PLBOOL flag ); -%feature( "docstring", "Set the floating point precision (in number of places) in numeric labels." ) plprec; void plprec( PLINT setp, PLINT prec ); -%feature( "docstring", "Set fill pattern, using one of the predefined patterns." ) plpsty; void plpsty( PLINT patt ); -%feature( "docstring", "Print \"text\" at world cooordinates (x,y)." ) plptex; void plptex( PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, const char *text ); -%feature( "docstring", "Print \"text\" at world cooordinates (x,y,z)." ) plptex3; void plptex3( PLFLT x, PLFLT y, PLFLT z, PLFLT dx, PLFLT dy, PLFLT dz, PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, const char *text ); -%feature( "docstring", "Return a random number in the range [0,1]." ) plrandd; PLFLT plrandd(); -%feature( "docstring", "Replay contents of plot buffer to current device/file." ) plreplot; void plreplot( void ); -%feature( "docstring", "Transform from RGB to HLS form of colours." ) plrgbhls; void plrgbhls( PLFLT r, PLFLT g, PLFLT b, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); -%feature( "docstring", "Set character height." ) plschr; void plschr( PLFLT def, PLFLT scale ); -%feature( "docstring", "Set color map 0 colors by 8 bit RGB values." ) plscmap0; void plscmap0( PLINT *Array, PLINT *ArrayCk, PLINT *ArrayCk, PLINT n ); -%feature( "docstring", "Set color map 0 colors by 8 bit RGB + alpha values." ) plscmap0a; void plscmap0a( PLINT *Array, PLINT *ArrayCk, PLINT *ArrayCk, PLFLT *ArrayCk, PLINT n ); -%feature( "docstring", "Set number of colors in cmap 0." ) plscmap0n; void plscmap0n( PLINT ncol0 ); -%feature( "docstring", "Set color map 1 colors by 8 bit RGB values." ) plscmap1; void plscmap1( PLINT *Array, PLINT *ArrayCk, PLINT *ArrayCk, PLINT n ); -%feature( "docstring", "Set color map 1 colors by 8 bit RGB + alpha values." ) plscmap1a; void plscmap1a( PLINT *Array, PLINT *ArrayCk, PLINT *ArrayCk, PLFLT *ArrayCk, PLINT n ); -%feature( "docstring", "Set color map 1 colors using a piece-wise linear relationship between intensity [0,1] (cmap 1 index) and position in HLS or -RGB color space." ) plscmap1l; void plscmap1l( PLBOOL itype, PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLFLT *ArrayCk, PLBOOL *ArrayCkMinus1Null ); -%feature( "docstring", "Set color map 1 colors using a piece-wise linear relationship between intensity [0,1] (cmap 1 index) and position in HLS or -RGB color space + alpha value." ) plscmap1la; void plscmap1la( PLBOOL itype, PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, PLFLT *ArrayCk, PLFLT *ArrayCk, PLBOOL *ArrayCkMinus1Null ); -%feature( "docstring", "Set number of colors in cmap 1." ) plscmap1n; void plscmap1n( PLINT ncol1 ); -%feature( "docstring", "Set 8-bit RGB value in cmap 0." ) plscol0; void plscol0( PLINT icol0, PLINT r, PLINT g, PLINT b ); -%feature( "docstring", "Set 8-bit RGB + alpha value in cmap 0." ) plscol0a; void plscol0a( PLINT icol0, PLINT r, PLINT g, PLINT b, PLFLT a ); -%feature( "docstring", "Set the background color using 8-bit RGB value." ) plscolbg; void plscolbg( PLINT r, PLINT g, PLINT b ); -%feature( "docstring", "Set the background color using 8-bit RGB + alpha value." ) plscolbga; void plscolbga( PLINT r, PLINT g, PLINT b, PLFLT a ); -%feature( "docstring", "Globally turn color output on/off." ) plscolor; void plscolor( PLINT color ); -%feature( "docstring", "Set the compression level." ) plscompression; void plscompression( PLINT compression ); -%feature( "docstring", "Set the device (keyword) name." ) plsdev; void plsdev( const char *devname ); -%feature( "docstring", "Set window into device space using margin, aspect ratio, and justification." ) plsdidev; void plsdidev( PLFLT mar, PLFLT aspect, PLFLT jx, PLFLT jy ); -%feature( "docstring", "Set up transformation from metafile coordinates." ) plsdimap; void plsdimap( PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax, PLFLT dimxpmm, PLFLT dimypmm ); -%feature( "docstring", "Set plot orientation, specifying rotation in units of pi/2." ) plsdiori; void plsdiori( PLFLT rot ); -%feature( "docstring", "Set window into plot space." ) plsdiplt; void plsdiplt( PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax ); -%feature( "docstring", "Set window into plot space incrementally (zoom)." ) plsdiplz; void plsdiplz( PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax ); -%feature( "docstring", "Seed the random number generator." ) plseed; void plseed( unsigned int s ); -%feature( "docstring", "Set the escape character for text strings." ) plsesc; void plsesc( char esc ); -%feature( "docstring", "Process input strings, treating them as an option and argument pair. The first is for the external API, the second the work routine declared here for backward compatibility." ) plsetopt; PLINT plsetopt( const char *opt, const char *optarg ); -%feature( "docstring", "Set family file parameters." ) plsfam; void plsfam( PLINT fam, PLINT num, PLINT bmax ); -%feature( "docstring", "Set FCI (font characterization integer)." ) plsfci; void plsfci( PLUNICODE fci ); -%feature( "docstring", "Set the output file name." ) plsfnam; void plsfnam( const char *fnam ); -%feature( "docstring", "Set the current font family, style and weight." ) plsfont; void plsfont( PLINT family, PLINT style, PLINT weight ); -%feature( "docstring", "Shade regions with continuous range of colours." ) plshades; void plshades( PLFLT **Matrix, PLINT nx, PLINT ny, defined_func df, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, @@ -813,7 +685,6 @@ pltr_func pltr, PLPointer SWIG_OBJECT_DATA ); -%feature( "docstring", "Shade region with discrete colour, pattern fill." ) plshade; void plshade( PLFLT **Matrix, PLINT nx, PLINT ny, defined_func df, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, @@ -825,90 +696,70 @@ pltr_func pltr, PLPointer SWIG_OBJECT_DATA ); -%feature( "docstring", "Set up a user-provided custom labeling function" ) plslabelfunc; void plslabelfunc( label_func lf, PLPointer data ); -%feature( "docstring", "Set up lengths of major tick marks." ) plsmaj; void plsmaj( PLFLT def, PLFLT scale ); #if defined ( PYTHON_HAVE_PYBUFFER ) && defined ( SWIG_PYTHON ) -%feature( "docstring", "Set the RGB memory area to be plotted (with the 'mem' or 'memcairo' drivers)." ) plsmem; void plsmem( PLINT maxx, PLINT maxy, void *plotmem ); -%feature( "docstring", "Set the RGBA memory area to be plotted (with the 'memcairo' driver)." ) plsmema; void plsmema( PLINT maxx, PLINT maxy, void *plotmem ); #endif -%feature( "docstring", "Set up lengths of minor tick marks." ) plsmin; void plsmin( PLFLT def, PLFLT scale ); -%feature( "docstring", "Set orientation. Must be done before calling plinit." ) plsori; void plsori( PLINT ori ); -%feature( "docstring", "Set output device parameters. Usually ignored by the driver." ) plspage; void plspage( PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng, PLINT xoff, PLINT yoff ); -%feature( "docstring", "Set the color map 0 colors using a cmap0 color palette file." ) plspal0; void plspal0( const char *filename ); -%feature( "docstring", "Set the color map 1 colors using a cmap1 color palette file." ) plspal1; void plspal1( const char *filename, PLBOOL interpolate ); -%feature( "docstring", "Set the pause (on end-of-page) status." ) plspause; void plspause( PLBOOL pause ); -%feature( "docstring", "Set stream number." ) plsstrm; void plsstrm( PLINT strm ); -%feature( "docstring", "Set the number of subwindows in x and y." ) plssub; void plssub( PLINT nx, PLINT ny ); -%feature( "docstring", "Set symbol height." ) plssym; void plssym( PLFLT def, PLFLT scale ); -%feature( "docstring", "Initialize PLplot, passing in the windows/page settings." ) plstar; void plstar( PLINT nx, PLINT ny ); -%feature( "docstring", "Initialize PLplot, passing the device name and windows/page settings." ) plstart; void plstart( const char *devname, PLINT nx, PLINT ny ); #if !defined ( SWIG_LUA ) && !defined ( SWIG_OCTAVE ) -%feature( "docstring", "Set the coordinate transform." ) plstransform; void plstransform( ct_func ctf, PLPointer data ); #endif -%feature( "docstring", "Prints out the same string repeatedly at the n points in world coordinates given by the x and y arrays. Supersedes plpoin and plsymbol for the case where text refers to a unicode glyph either directly as UTF-8 or indirectly via the standard text escape sequences allowed for PLplot input strings." ) plstring; void plstring( PLINT n, PLFLT *Array, PLFLT *ArrayCk, const char *string ); -%feature( "docstring", "Prints out the same string repeatedly at the n 3D points in world coordinates given by the x, y, and z arrays. Supersedes plpoin3 for the case where text refers to a unicode glyph either directly as UTF-8 or indirectly via the standard text escape sequences allowed for PLplot input strings." ) plstring3; void plstring3( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLFLT *ArrayCk, const char *string ); -%feature( "docstring", "Add a point to a stripchart." ) plstripa; void plstripa( PLINT id, PLINT pen, PLFLT x, PLFLT y ); -%feature( "docstring", "Create 1d stripchart." ) plstripc; void plstripc( PLINT *OUTPUT, const char *xspec, const char *yspec, PLFLT xmin, PLFLT xmax, PLFLT xjump, PLFLT ymin, PLFLT ymax, @@ -918,83 +769,64 @@ PLINT *Array, PLINT *ArrayCk, const char *legline[4], const char *labx, const char *laby, const char *labtop ); -%feature( "docstring", "Deletes and releases memory used by a stripchart." ) plstripd; void plstripd( PLINT id ); -%feature( "docstring", "Set up a new line style." ) plstyl; void plstyl( PLINT n, PLINT *Array, PLINT *ArrayCk ); -%feature( "docstring", "Set vector arrow style." ) plsvect; void plsvect( PLFLT *Array, PLFLT *ArrayCk, PLINT n, PLBOOL fill ); -%feature( "docstring", "Set the edges of the viewport to the specified absolute coordinates." ) plsvpa; void plsvpa( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); -%feature( "docstring", "Set x axis labeling parameters." ) plsxax; void plsxax( PLINT digmax, PLINT digits ); -%feature( "docstring", "Set y axis labeling parameters." ) plsyax; void plsyax( PLINT digmax, PLINT digits ); -%feature( "docstring", "Plot array y against x for n points using Hershey symbol \"code\"." ) plsym; void plsym( PLINT n, PLFLT *Array, PLFLT *ArrayCk, PLINT code ); -%feature( "docstring", "Set z axis labeling parameters." ) plszax; void plszax( PLINT digmax, PLINT digits ); -%feature( "docstring", "Switch to text screen." ) pltext; void pltext( void ); -%feature( "docstring", "Set the format for date / time labels" ) pltimefmt; void pltimefmt( const char *fmt ); -%feature( "docstring", "Sets the edges of the viewport with the given aspect ratio, leaving room for labels." ) plvasp; void plvasp( PLFLT aspect ); -%feature( "docstring", "Plot vectors." ) plvect; void plvect( PLFLT **Matrix, PLFLT **MatrixCk, PLINT nx, PLINT ny, PLFLT scale, pltr_func pltr, PLPointer SWIG_OBJECT_DATA ); -%feature( "docstring", "Create the largest viewport of the specified aspect ratio that fits within the specified normalized subpage coordinates." ) plvpas; void plvpas( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT aspect ); -%feature( "docstring", "Create a viewport with the specified normalized subpage coordinates." ) plvpor; void plvpor( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); -%feature( "docstring", "Define a \"standard\" viewport with seven character heights for the left margin and four character heights everywhere else." ) plvsta; void plvsta( void ); -%feature( "docstring", "Set up a window for three-dimensional plotting." ) plw3d; void plw3d( PLFLT basex, PLFLT basey, PLFLT height, PLFLT xmin0, PLFLT xmax0, PLFLT ymin0, PLFLT ymax0, PLFLT zmin0, PLFLT zmax0, PLFLT alt, PLFLT az ); -%feature( "docstring", "Set pen width." ) plwid; void plwid( PLINT width ); -%feature( "docstring", "Set up world coordinates of the viewport boundaries (2d plots)." ) plwind; void plwind( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); -%feature( "docstring", "Set xor mode; mode = 1-enter, 0-leave, status = 0 if not interactive device." ) plxormod; void plxormod( PLBOOL mode, PLBOOL *OUTPUT ); @@ -1003,11 +835,9 @@ // Deprecated functions that are in common API, but we don't want to // propagate them to the python API. -%feature( "docstring", "Set line color by red, green, blue values in range from 0. to 1." ) plrgb; void plrgb( PLFLT r, PLFLT g, PLFLT b ); -%feature( "docstring", "Set line color by 8 bit RGB values." ) plrgb1; void plrgb1( PLINT r, PLINT g, PLINT b ); @@ -1132,7 +962,6 @@ #if 0 // Cannot get this to work since plsError is not simply an output // of an internal integer and character string. -%feature( "docstring", "Set the variables to be used for storing error info." ) plsError; void plsError( PLINT *OUTPUT, char *OUTPUT ); #endif @@ -1286,7 +1115,6 @@ // Wait for graphics input event and translate to world coordinates -%feature( "docstring", "Wait for graphics input event and translate to world coordinates." ) plGetCursor; PLINT plGetCursor( PLGraphicsIn *gin ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-14 05:51:48
|
Revision: 11625 http://plplot.svn.sourceforge.net/plplot/?rev=11625&view=rev Author: airwin Date: 2011-03-14 05:51:42 +0000 (Mon, 14 Mar 2011) Log Message: ----------- Clean up const-related warnings for doubly dimensioned arrays in the fortran 77 and 95 bindings. There is probably a better way to do this since singly dimensioned arrays do not generate these (gcc) warnings. Modified Paths: -------------- trunk/bindings/f77/sc3d.c trunk/bindings/f77/sccont.c trunk/bindings/f77/scstubs.c trunk/bindings/f95/sc3d.c trunk/bindings/f95/sccont.c Modified: trunk/bindings/f77/sc3d.c =================================================================== --- trunk/bindings/f77/sc3d.c 2011-03-14 05:45:14 UTC (rev 11624) +++ trunk/bindings/f77/sc3d.c 2011-03-14 05:51:42 UTC (rev 11625) @@ -42,7 +42,7 @@ } } - c_plot3dc( x, y, a, *nx, *ny, *opt, clevel, *nlevel ); + c_plot3dc( x, y, (const PLFLT **) a, *nx, *ny, *opt, clevel, *nlevel ); // Clean up memory allocated for a plFree2dGrid( a, *nx, *ny ); @@ -93,7 +93,7 @@ for ( j = 0; j < *ny; j++ ) temp[i][j] = *( z + j * *lx + i ); - c_plsurf3d( x, y, temp, *nx, *ny, *opt, clevel, *nlevel ); + c_plsurf3d( x, y, (const PLFLT **) temp, *nx, *ny, *opt, clevel, *nlevel ); for ( i = 0; i < *nx; i++ ) free( (void *) temp[i] ); Modified: trunk/bindings/f77/sccont.c =================================================================== --- trunk/bindings/f77/sccont.c 2011-03-14 05:45:14 UTC (rev 11624) +++ trunk/bindings/f77/sccont.c 2011-03-14 05:51:42 UTC (rev 11625) @@ -565,7 +565,7 @@ } } - c_plimagefr( pidata, *nx, *ny, + c_plimagefr( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *valuemin, *valuemax, pltr0, NULL ); @@ -597,7 +597,7 @@ } } - c_plimagefr( pidata, *nx, *ny, + c_plimagefr( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *valuemin, *valuemax, pltr1, (void *) &cgrid ); @@ -637,7 +637,7 @@ } } - c_plimagefr( pidata, *nx, *ny, + c_plimagefr( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *valuemin, *valuemax, pltr2, (void *) &cgrid2 ); @@ -665,7 +665,7 @@ } } - c_plimagefr( pidata, *nx, *ny, + c_plimagefr( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *valuemin, *valuemax, pltr, (void *) ftr ); Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-03-14 05:45:14 UTC (rev 11624) +++ trunk/bindings/f77/scstubs.c 2011-03-14 05:51:42 UTC (rev 11625) @@ -479,7 +479,7 @@ } } - c_plimage( pidata, *nx, *ny, + c_plimage( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *Dxmin, *Dxmax, *Dymin, *Dymax ); Modified: trunk/bindings/f95/sc3d.c =================================================================== --- trunk/bindings/f95/sc3d.c 2011-03-14 05:45:14 UTC (rev 11624) +++ trunk/bindings/f95/sc3d.c 2011-03-14 05:51:42 UTC (rev 11625) @@ -42,7 +42,7 @@ } } - c_plot3dc( x, y, a, *nx, *ny, *opt, clevel, *nlevel ); + c_plot3dc( x, y, (const PLFLT **) a, *nx, *ny, *opt, clevel, *nlevel ); // Clean up memory allocated for a plFree2dGrid( a, *nx, *ny ); @@ -93,7 +93,7 @@ for ( j = 0; j < *ny; j++ ) temp[i][j] = *( z + j * *lx + i ); - c_plsurf3d( x, y, temp, *nx, *ny, *opt, clevel, *nlevel ); + c_plsurf3d( x, y, (const PLFLT **) temp, *nx, *ny, *opt, clevel, *nlevel ); for ( i = 0; i < *nx; i++ ) free( (void *) temp[i] ); Modified: trunk/bindings/f95/sccont.c =================================================================== --- trunk/bindings/f95/sccont.c 2011-03-14 05:45:14 UTC (rev 11624) +++ trunk/bindings/f95/sccont.c 2011-03-14 05:51:42 UTC (rev 11625) @@ -287,7 +287,7 @@ } } - c_plshade( a, *nx, *ny, NULL, + c_plshade( (const PLFLT **) a, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, *shade_min, *shade_max, *sh_cmap, *sh_color, *sh_width, @@ -329,7 +329,7 @@ cgrid.ny = *ny; cgrid.xg = xg1; cgrid.yg = yg1; - c_plshade( a, *nx, *ny, NULL, + c_plshade( (const PLFLT **) a, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, *shade_min, *shade_max, *sh_cmap, *sh_color, *sh_width, @@ -372,7 +372,7 @@ } } - c_plshade( a, *nx, *ny, NULL, + c_plshade( (const PLFLT **) a, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, *shade_min, *shade_max, *sh_cmap, *sh_color, *sh_width, @@ -407,7 +407,7 @@ } } - c_plshade( a, *nx, *ny, NULL, + c_plshade( (const PLFLT **) a, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, *shade_min, *shade_max, *sh_cmap, *sh_color, *sh_width, @@ -448,7 +448,7 @@ } } - c_plshades( a, *nx, *ny, NULL, + c_plshades( (const PLFLT **) a, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, clevel, *nlevel, *fill_width, *cont_color, *cont_width, @@ -485,7 +485,7 @@ cgrid.xg = xg1; cgrid.yg = yg1; - c_plshades( a, *nx, *ny, NULL, + c_plshades( (const PLFLT **) a, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, clevel, *nlevel, *fill_width, *cont_color, *cont_width, @@ -523,7 +523,7 @@ } } - c_plshades( a, *nx, *ny, NULL, + c_plshades( (const PLFLT **) a, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, clevel, *nlevel, *fill_width, *cont_color, *cont_width, @@ -555,7 +555,7 @@ } } - c_plshades( a, *nx, *ny, NULL, + c_plshades( (const PLFLT **) a, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, clevel, *nlevel, *fill_width, *cont_color, *cont_width, @@ -608,7 +608,7 @@ } } - c_plimagefr( pidata, *nx, *ny, + c_plimagefr( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *valuemin, *valuemax, pltr0, NULL ); @@ -640,7 +640,7 @@ } } - c_plimagefr( pidata, *nx, *ny, + c_plimagefr( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *valuemin, *valuemax, pltr1, (void *) &cgrid ); @@ -680,7 +680,7 @@ } } - c_plimagefr( pidata, *nx, *ny, + c_plimagefr( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *valuemin, *valuemax, pltr2, (void *) &cgrid2 ); @@ -708,7 +708,7 @@ } } - c_plimagefr( pidata, *nx, *ny, + c_plimagefr( (const PLFLT **) pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *valuemin, *valuemax, pltr, (void *) ftr ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2011-03-17 07:53:30
|
Revision: 11635 http://plplot.svn.sourceforge.net/plplot/?rev=11635&view=rev Author: arjenmarkus Date: 2011-03-17 07:53:24 +0000 (Thu, 17 Mar 2011) Log Message: ----------- Consistently add the hidden argument to the plslabelfunc() function for both Fortran 77 and 95 bindings. Modified Paths: -------------- trunk/bindings/f77/scstubs.c trunk/bindings/f95/scstubs.c Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-03-16 21:48:33 UTC (rev 11634) +++ trunk/bindings/f77/scstubs.c 2011-03-17 07:53:24 UTC (rev 11635) @@ -479,7 +479,7 @@ } } - c_plimage( (const PLFLT **) pidata, *nx, *ny, + c_plimage( pidata, *nx, *ny, *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *Dxmin, *Dxmax, *Dymin, *Dymax ); @@ -958,7 +958,7 @@ } void -PLSLABELFUNC( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT * ) ) +PLSLABELFUNC( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) ) { pllabelfunc = labelfunc; // N.B. neglect pointer to additional data for f77 Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-03-16 21:48:33 UTC (rev 11634) +++ trunk/bindings/f95/scstubs.c 2011-03-17 07:53:24 UTC (rev 11635) @@ -38,7 +38,8 @@ // (*mapform)! // Slightly different to (*label_func) as we don't support PLPointer for // additional data in f77. -static void ( STDCALL *pllabelfunc )( PLINT *, PLFLT *, char *, PLINT * ); +// Note the hidden argument! +static void ( STDCALL *pllabelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ); // Slightly different to C version as we don't support PLPointer for additional data static void ( STDCALL *pltransform )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ); @@ -547,7 +548,10 @@ { int i; - ( *pllabelfunc )( &axis, &value, label, &length ); + // (AM) Note the hidden argument "length" - it ensures that the string "label" + // is recognised to have that length + // + ( *pllabelfunc )( &axis, &value, label, &length, length ); // Ensure string is null terminated i = length - 1; @@ -1006,18 +1010,18 @@ } void -PLSLABELFUNC_ON( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT * ) ) +PLSLABELFUNC_ON( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) ) { pllabelfunc = labelfunc; - // N.B. neglect pointer to additional data for f77 + // N.B. neglect pointer to additional data for f95 c_plslabelfunc( pllabelfuncf2c, NULL ); } void -PLSLABELFUNC_ONa( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT * ) ) +PLSLABELFUNC_ONa( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) ) { pllabelfunc = labelfunc; - // N.B. neglect pointer to additional data for f77 + // N.B. neglect pointer to additional data for f95 c_plslabelfunc( pllabelfuncf2c, NULL ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-04-13 05:24:08
|
Revision: 11701 http://plplot.svn.sourceforge.net/plplot/?rev=11701&view=rev Author: airwin Date: 2011-04-13 05:24:00 +0000 (Wed, 13 Apr 2011) Log Message: ----------- Initial styling (done automatically with recently revised scripts/style_source.sh) for swig *.i configuration files. This cleans up bad styling issues that appeared in these files before, and the results of the test_diff_psc target continue to be good with these changes. Modified Paths: -------------- trunk/bindings/java/plplotjavac.i trunk/bindings/lua/plplotluac.i trunk/bindings/octave/plplot_octave.i trunk/bindings/python/plplotcmodule.i trunk/bindings/swig-support/plplotcapi.i Modified: trunk/bindings/java/plplotjavac.i =================================================================== --- trunk/bindings/java/plplotjavac.i 2011-04-13 05:20:14 UTC (rev 11700) +++ trunk/bindings/java/plplotjavac.i 2011-04-13 05:24:00 UTC (rev 11701) @@ -1,38 +1,38 @@ -/* -Copyright (C) 2002 Gary Bishop -Copyright (C) 2002, 2004 Alan W. Irwin -Copyright (C) 2004-2010 Andrew Ross -This file is part of PLplot. +// +//Copyright (C) 2002 Gary Bishop +//Copyright (C) 2002, 2004 Alan W. Irwin +//Copyright (C) 2004-2010 Andrew Ross +//This file is part of PLplot. +// +//PLplot is free software; you can redistribute it and/or modify +//it under the terms of the GNU Library General Public License as published by +//the Free Software Foundation; version 2 of the License. +// +//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 the file PLplot; if not, write to the Free Software +//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// -PLplot is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published by -the Free Software Foundation; version 2 of the License. - -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 the file PLplot; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -/* -A SWIG interface to PLplot for Java. This wrapper does the following: - - 1) it strictly provides the C-API with the usual change of not - requiring lengths for arrays, - - 2) it attempts to provide the entire API *excluding* callbacks for - plcont and plshade(s) (for now). - - 3) it works both with the single and double-precision versions of the - PLplot library. - -This is known to work with swig-1.3.21. - -*/ +// +//A SWIG interface to PLplot for Java. This wrapper does the following: +// +// 1) it strictly provides the C-API with the usual change of not +// requiring lengths for arrays, +// +// 2) it attempts to provide the entire API *excluding* callbacks for +// plcont and plshade(s) (for now). +// +// 3) it works both with the single and double-precision versions of the +// PLplot library. +// +//This is known to work with swig-1.3.21. +// +// %module plplotjavac %include typemaps.i @@ -41,1798 +41,1919 @@ %} #ifdef PL_DOUBLE_INTERFACE -typedef double PLFLT; +typedef double PLFLT; #else -typedef float PLFLT; +typedef float PLFLT; #endif -/* This assumes that C int is 32-bit - swig doesn't know about int32_t */ -/* Ideally we should have a typemap for it */ -typedef int PLINT; -typedef unsigned int PLUNICODE; -typedef PLINT PLBOOL; +// This assumes that C int is 32-bit - swig doesn't know about int32_t +// Ideally we should have a typemap for it +typedef int PLINT; +typedef unsigned int PLUNICODE; +typedef PLINT PLBOOL; -/* Set jni version and cache JVM - needed for callbacks */ +// Set jni version and cache JVM - needed for callbacks %{ -static JavaVM *cached_jvm = NULL; - -SWIGEXPORT JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) { - cached_jvm = jvm; - return JNI_VERSION_1_2; -} -%} + static JavaVM *cached_jvm = NULL; -/* Simple (input) PLBOOL arguments */ -/* Use macro style similar to INPUT_TYPEMAP defined in typemaps.i, but - * actually follow what is done in java.swg for bool C type except - * change action of typemap(in) from "? true : false;" to "? 1 : 0;" to - * be consistent with actual C type of PLBOOL which is PLINT. If C type - * of PLBOOL ever changed to bool, none of this would be necessary, but - * such a change would demand using the c99 standard for PLplot which is - * not widely implemented yet. - */ -%define PLBOOL_INPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JNIDESC) -%typemap(jni) TYPE "JNITYPE" -%typemap(jtype) TYPE "JTYPE" -%typemap(jstype) TYPE "JTYPE" + SWIGEXPORT JNIEXPORT jint JNICALL JNI_OnLoad( JavaVM *jvm, void *reserved ) + { + cached_jvm = jvm; + return JNI_VERSION_1_2; + } +%} -%typemap(in) TYPE -%{ $1 = $input ? 1 : 0; %} +// Simple (input) PLBOOL arguments +// Use macro style similar to INPUT_TYPEMAP defined in typemaps.i, but +// actually follow what is done in java.swg for bool C type except +// change action of typemap(in) from "? true : false;" to "? 1 : 0;" to +// be consistent with actual C type of PLBOOL which is PLINT. If C type +// of PLBOOL ever changed to bool, none of this would be necessary, but +// such a change would demand using the c99 standard for PLplot which is +// not widely implemented yet. +// +%define PLBOOL_INPUT_TYPEMAP( TYPE, JNITYPE, JTYPE, JNIDESC ) +%typemap( jni ) TYPE "JNITYPE" +%typemap( jtype ) TYPE "JTYPE" +%typemap( jstype ) TYPE "JTYPE" -%typemap(javadirectorin) TYPE "$jniinput" -%typemap(javadirectorout) TYPE "$javacall" +%typemap( in ) TYPE +%{ + $1 = $input ? 1 : 0; +%} -%typemap(directorin,descriptor=JNIDESC) TYPE -%{$input = (JNITYPE *) $1; %} +%typemap( javadirectorin ) TYPE "$jniinput" +%typemap( javadirectorout ) TYPE "$javacall" -%typemap(javain) TYPE "$javainput" +%typemap( directorin, descriptor = JNIDESC ) TYPE +%{ + $input = (JNITYPE *) $1; +%} + +%typemap( javain ) TYPE "$javainput" %enddef -PLBOOL_INPUT_TYPEMAP(PLBOOL, jboolean, boolean, "Z"); +PLBOOL_INPUT_TYPEMAP( PLBOOL, jboolean, boolean, "Z" ); -/* This renamed macro copied exactly from OUTPUT_TYPEMAP macro - * in typemaps.i which handles *OUTPUT types. */ +// This renamed macro copied exactly from OUTPUT_TYPEMAP macro +// in typemaps.i which handles *OUTPUT types. -%define PLBOOL_OUTPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) -%typemap(jni) TYPE *OUTPUT, TYPE &OUTPUT %{JNITYPE##Array%} -%typemap(jtype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" -%typemap(jstype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" -%typemap(javain) TYPE *OUTPUT, TYPE &OUTPUT "$javainput" -%typemap(javadirectorin) TYPE *OUTPUT, TYPE &OUTPUT "$jniinput" -%typemap(javadirectorout) TYPE *OUTPUT, TYPE &OUTPUT "$javacall" +%define PLBOOL_OUTPUT_TYPEMAP( TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE ) +%typemap( jni ) TYPE * OUTPUT, TYPE & OUTPUT +%{ + JNITYPE ## Array +%} +%typemap( jtype ) TYPE * OUTPUT, TYPE & OUTPUT "JTYPE[]" +%typemap( jstype ) TYPE * OUTPUT, TYPE & OUTPUT "JTYPE[]" +%typemap( javain ) TYPE * OUTPUT, TYPE & OUTPUT "$javainput" +%typemap( javadirectorin ) TYPE * OUTPUT, TYPE & OUTPUT "$jniinput" +%typemap( javadirectorout ) TYPE * OUTPUT, TYPE & OUTPUT "$javacall" -%typemap(in) TYPE *OUTPUT($*1_ltype temp), TYPE &OUTPUT($*1_ltype temp) +%typemap( in ) TYPE * OUTPUT( $*1_ltype temp ), TYPE &OUTPUT( $*1_ltype temp ) %{ - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - $1 = &temp; + if ( !$input ) + { + SWIG_JavaThrowException( jenv, SWIG_JavaNullPointerException, "array null" ); + return $null; + } + if ( JCALL1( GetArrayLength, jenv, $input ) == 0 ) + { + SWIG_JavaThrowException( jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element" ); + return $null; + } + $1 = &temp; %} -%typemap(directorin,descriptor=JNIDESC) TYPE &OUTPUT -%{ *(($&1_ltype) $input) = &$1; %} +%typemap( directorin, descriptor = JNIDESC ) TYPE & OUTPUT +%{ + *( ( $&1_ltype )$input ) = &$1; +%} -%typemap(directorin,descriptor=JNIDESC,warning="Need to provide TYPE *OUTPUT directorin typemap, TYPE array length is unknown") TYPE *OUTPUT +%typemap( directorin, descriptor = JNIDESC, warning = "Need to provide TYPE *OUTPUT directorin typemap, TYPE array length is unknown" ) TYPE * OUTPUT %{ %} -%typemap(freearg) TYPE *OUTPUT, TYPE &OUTPUT "" +%typemap( freearg ) TYPE * OUTPUT, TYPE & OUTPUT "" -%typemap(argout) TYPE *OUTPUT, TYPE &OUTPUT +%typemap( argout ) TYPE * OUTPUT, TYPE & OUTPUT %{ - JNITYPE jvalue = (JNITYPE)temp$argnum; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &jvalue); + JNITYPE jvalue = (JNITYPE) temp$argnum; + JCALL4( Set ## JAVATYPE ## ArrayRegion, jenv, $input, 0, 1, &jvalue ); %} -%typemap(typecheck) TYPE *INOUT = TYPECHECKTYPE; -%typemap(typecheck) TYPE &INOUT = TYPECHECKTYPE; +%typemap( typecheck ) TYPE * INOUT = TYPECHECKTYPE; +%typemap( typecheck ) TYPE &INOUT = TYPECHECKTYPE; %enddef -/* Copy what is done for C bool type, only use PLBOOL instead. */ -PLBOOL_OUTPUT_TYPEMAP(PLBOOL, jboolean, boolean, Boolean, "[Ljava/lang/Boolean;", jbooleanArray); +// Copy what is done for C bool type, only use PLBOOL instead. +PLBOOL_OUTPUT_TYPEMAP( PLBOOL, jboolean, boolean, Boolean, "[Ljava/lang/Boolean;", jbooleanArray ); -/*************************** - A trick for docstrings -****************************/ +//************************** +// A trick for docstrings +//*************************** -%define DOC(func, string) -%wrapper %{#define _doc_ ## func string %} +%define DOC( func, string ) +%wrapper +%{ + # define _doc_ ## func string +%} %enddef -/* Infrastructure for handling swig compatible plplot API definitions. */ +// Infrastructure for handling swig compatible plplot API definitions. #ifdef PL_DOUBLE_INTERFACE -#define setup_array_1d_PLFLT setup_array_1d_d -#define setup_array_2d_PLFLT setup_array_2d_d -#define jPLFLTArray "jdoubleArray" -#define jPLFLTbracket "double[]" -#define jPLFLTbracket2 "double[][]" -#define GetPLFLTArrayElements GetDoubleArrayElements -#define ReleasePLFLTArrayElements ReleaseDoubleArrayElements -#define jPLFLT jdouble +#define setup_array_1d_PLFLT setup_array_1d_d +#define setup_array_2d_PLFLT setup_array_2d_d +#define jPLFLTArray "jdoubleArray" +#define jPLFLTbracket "double[]" +#define jPLFLTbracket2 "double[][]" +#define GetPLFLTArrayElements GetDoubleArrayElements +#define ReleasePLFLTArrayElements ReleaseDoubleArrayElements +#define jPLFLT jdouble #else -#define setup_array_1d_PLFLT setup_array_1d_f -#define setup_array_2d_PLFLT setup_array_2d_f -#define jPLFLTArray "jfloatArray" -#define jPLFLTbracket "float[]" -#define jPLFLTbracket2 "float[][]" -#define GetPLFLTArrayElements GetFloatArrayElements -#define ReleasePLFLTArrayElements ReleaseFloatArrayElements -#define jPLFLT jfloat +#define setup_array_1d_PLFLT setup_array_1d_f +#define setup_array_2d_PLFLT setup_array_2d_f +#define jPLFLTArray "jfloatArray" +#define jPLFLTbracket "float[]" +#define jPLFLTbracket2 "float[][]" +#define GetPLFLTArrayElements GetFloatArrayElements +#define ReleasePLFLTArrayElements ReleaseFloatArrayElements +#define jPLFLT jfloat #endif %{ -/*--------------------------------------------------------------------------- - * Array allocation & copy helper routines. Note because of swig limitations - * it is necessary to release the java array memory right after calling these - * routines. Thus it is necessary to allocate and copy the arrays even if - * the java and plplot arrays are of the same type. Note, because of this - * change to Geoffrey's original versions, caller must always free memory - * afterwards. Thus, the must_free_buffers logic is gone as well. - *---------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Array allocation & copy helper routines. Note because of swig limitations +// it is necessary to release the java array memory right after calling these +// routines. Thus it is necessary to allocate and copy the arrays even if +// the java and plplot arrays are of the same type. Note, because of this +// change to Geoffrey's original versions, caller must always free memory +// afterwards. Thus, the must_free_buffers logic is gone as well. +//-------------------------------------------------------------------------- -/* 1d array of jbooleans */ +// 1d array of jbooleans -static void -setup_array_1d_b( PLBOOL **pa, jboolean *adat, int n ) -{ - int i; - *pa = (PLBOOL *) malloc( n * sizeof(PLBOOL) ); - for( i=0; i < n; i++ ) { - (*pa)[i] = adat[i] ? 1 : 0; - } -} + static void + setup_array_1d_b( PLBOOL **pa, jboolean *adat, int n ) + { + int i; + *pa = (PLBOOL *) malloc( n * sizeof ( PLBOOL ) ); + for ( i = 0; i < n; i++ ) + { + ( *pa )[i] = adat[i] ? 1 : 0; + } + } -/* 1d array of jints */ +// 1d array of jints -static void -setup_array_1d_i( PLINT **pa, jint *adat, int n ) -{ - int i; - *pa = (PLINT *) malloc( n * sizeof(PLINT) ); - for( i=0; i < n; i++ ) { - (*pa)[i] = adat[i]; - } -} + static void + setup_array_1d_i( PLINT **pa, jint *adat, int n ) + { + int i; + *pa = (PLINT *) malloc( n * sizeof ( PLINT ) ); + for ( i = 0; i < n; i++ ) + { + ( *pa )[i] = adat[i]; + } + } -/* 1d array of jfloats */ +// 1d array of jfloats -static void -setup_array_1d_f( PLFLT **pa, jfloat *adat, int n ) -{ - int i; - *pa = (PLFLT *) malloc( n * sizeof(PLFLT) ); - for( i=0; i < n; i++ ) { - (*pa)[i] = adat[i]; - } -} + static void + setup_array_1d_f( PLFLT **pa, jfloat *adat, int n ) + { + int i; + *pa = (PLFLT *) malloc( n * sizeof ( PLFLT ) ); + for ( i = 0; i < n; i++ ) + { + ( *pa )[i] = adat[i]; + } + } -/* 1d array of jdoubles */ +// 1d array of jdoubles -static void -setup_array_1d_d( PLFLT **pa, jdouble *adat, int n ) -{ - int i; - *pa = (PLFLT *) malloc( n * sizeof(PLFLT) ); - for( i=0; i < n; i++ ) { - (*pa)[i] = adat[i]; - } -} + static void + setup_array_1d_d( PLFLT **pa, jdouble *adat, int n ) + { + int i; + *pa = (PLFLT *) malloc( n * sizeof ( PLFLT ) ); + for ( i = 0; i < n; i++ ) + { + ( *pa )[i] = adat[i]; + } + } -/* 2d array of floats */ -/* Here caller must free(a[0]) and free(a) (in that order) afterward */ +// 2d array of floats +// Here caller must free(a[0]) and free(a) (in that order) afterward -static void -setup_array_2d_f( PLFLT ***pa, jfloat **adat, int nx, int ny ) -{ - int i, j; + static void + setup_array_2d_f( PLFLT ***pa, jfloat **adat, int nx, int ny ) + { + int i, j; - *pa = (PLFLT **) malloc( nx * sizeof(PLFLT *) ); - (*pa)[0] = (PLFLT *) malloc( nx * ny * sizeof(PLFLT) ); + *pa = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + ( *pa )[0] = (PLFLT *) malloc( nx * ny * sizeof ( PLFLT ) ); - for( i=0; i < nx; i++ ) - { - (*pa)[i] = (*pa)[0] + i*ny; - for( j=0; j < ny; j++ ) - (*pa)[i][j] = adat[i][j]; - } + for ( i = 0; i < nx; i++ ) + { + ( *pa )[i] = ( *pa )[0] + i * ny; + for ( j = 0; j < ny; j++ ) + ( *pa )[i][j] = adat[i][j]; + } + } -} +// 2d array of doubles +// Here caller must free(a[0]) and free(a) (in that order) afterward -/* 2d array of doubles */ -/* Here caller must free(a[0]) and free(a) (in that order) afterward */ + static void + setup_array_2d_d( PLFLT ***pa, jdouble **adat, int nx, int ny ) + { + int i, j; -static void -setup_array_2d_d( PLFLT ***pa, jdouble **adat, int nx, int ny ) -{ - int i, j; + *pa = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + ( *pa )[0] = (PLFLT *) malloc( nx * ny * sizeof ( PLFLT ) ); - *pa = (PLFLT **) malloc( nx * sizeof(PLFLT *) ); - (*pa)[0] = (PLFLT *) malloc( nx * ny * sizeof(PLFLT) ); + for ( i = 0; i < nx; i++ ) + { + ( *pa )[i] = ( *pa )[0] + i * ny; + for ( j = 0; j < ny; j++ ) + ( *pa )[i][j] = adat[i][j]; + } + } - for( i=0; i < nx; i++ ) - { - (*pa)[i] = (*pa)[0] + i*ny; - for( j=0; j < ny; j++ ) - (*pa)[i][j] = adat[i][j]; - } +// Setup java arrays (for callback functions) -} - -/* Setup java arrays (for callback functions) */ - -/* Create a jdoubleArray and fill it from the C PLFLT array dat */ -static jdoubleArray -setup_java_array_1d_PLFLT( JNIEnv *jenv, PLFLT *dat, PLINT n) -{ - double *x; - jdoubleArray jadat; +// Create a jdoubleArray and fill it from the C PLFLT array dat + static jdoubleArray + setup_java_array_1d_PLFLT( JNIEnv *jenv, PLFLT *dat, PLINT n ) + { + double *x; + jdoubleArray jadat; #ifdef PL_DOUBLE - x = (double *) dat; + x = (double *) dat; #else - x = (double *) malloc( n * sizeof(double) ); - for (i=0;i<n;i++) { - x[i] = (double) dat[i]; - } + x = (double *) malloc( n * sizeof ( double ) ); + for ( i = 0; i < n; i++ ) + { + x[i] = (double) dat[i]; + } #endif - jadat = (*jenv)->NewDoubleArray(jenv, n); - (*jenv)->SetDoubleArrayRegion(jenv, jadat, 0, n, x); + jadat = ( *jenv )->NewDoubleArray( jenv, n ); + ( *jenv )->SetDoubleArrayRegion( jenv, jadat, 0, n, x ); #ifndef PL_DOUBLE - free(x); + free( x ); #endif - return jadat; -} + return jadat; + } -/* Copy back data from jdoubleArray to C PLFLT array then release java array */ -static void -release_java_array_1d_PLFLT(JNIEnv *jenv, jdoubleArray jadat, PLFLT *dat, PLINT n) -{ - PLINT i; - jdouble *jdata = (*jenv)->GetDoubleArrayElements( jenv, jadat, 0 ); - for (i=0;i<n;i++) { - dat[i] = (PLFLT) jdata[i]; - } - (*jenv)->ReleaseDoubleArrayElements( jenv, jadat, jdata, 0 ); -} +// Copy back data from jdoubleArray to C PLFLT array then release java array + static void + release_java_array_1d_PLFLT( JNIEnv *jenv, jdoubleArray jadat, PLFLT *dat, PLINT n ) + { + PLINT i; + jdouble *jdata = ( *jenv )->GetDoubleArrayElements( jenv, jadat, 0 ); + for ( i = 0; i < n; i++ ) + { + dat[i] = (PLFLT) jdata[i]; + } + ( *jenv )->ReleaseDoubleArrayElements( jenv, jadat, jdata, 0 ); + } %} -/* I hate global variables but this is the best way I can think of to manage consistency - checking among function arguments. */ +// I hate global variables but this is the best way I can think of to manage consistency +// checking among function arguments. %{ - static PLINT Alen = 0; - static PLINT Xlen = 0, Ylen = 0; - static PLFLT **xg; - static PLFLT **yg; - %} + static PLINT Alen = 0; + static PLINT Xlen = 0, Ylen = 0; + static PLFLT **xg; + static PLFLT **yg; +%} -/* The following typemaps take care of marshaling values into and out of PLplot functions. The -Array rules are trickly because of the need for length checking. These rules manage -some global variables (above) to handle consistency checking amoung parameters. +// The following typemaps take care of marshaling values into and out of PLplot functions. The +//Array rules are trickly because of the need for length checking. These rules manage +//some global variables (above) to handle consistency checking amoung parameters. +// +//Naming rules: +// Array (sets Alen to dim[0]) +// ArrayCk (tests that dim[0] == Alen) +// ArrayCkNull (tests that dim[0] == Alen or array is null) +// ArrayX (sets Xlen to dim[0] +// ArrayCkX (tests dim[0] == Xlen) +// ArrayY (sets Ylen to dim[1]) +// ArrayCkY (tests dim[1] == Ylen) +// Matrix (sets Xlen to dim[0], Ylen to dim[1]) +// MatrixCk (test Xlen == dim[0] && Ylen == dim[1]) +// -Naming rules: - Array (sets Alen to dim[0]) - ArrayCk (tests that dim[0] == Alen) - ArrayCkNull (tests that dim[0] == Alen or array is null) - ArrayX (sets Xlen to dim[0] - ArrayCkX (tests dim[0] == Xlen) - ArrayY (sets Ylen to dim[1]) - ArrayCkY (tests dim[1] == Ylen) - Matrix (sets Xlen to dim[0], Ylen to dim[1]) - MatrixCk (test Xlen == dim[0] && Ylen == dim[1]) -*/ +//-------------------------------------------------------------------------- +// PLINT arrays +//-------------------------------------------------------------------------- -/********************************************************************************** - PLINT arrays -**********************************************************************************/ - -/* with preceding count */ -%typemap(in) (PLINT n, const PLINT *Array) { - jint *jxdata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); - $1 = (*jenv)->GetArrayLength( jenv, $input); - Alen = $1; - setup_array_1d_i( &$2, jxdata, Alen); - /* Could find no easy way to do this as part of freearg so I modified - * the previous function so it ALWAYS mallocs and copies so that - * the java array can be released immediately. */ - (*jenv)->ReleaseIntArrayElements( jenv, $input, jxdata, 0 ); +// with preceding count +%typemap( in ) ( PLINT n, const PLINT * Array ) +{ + jint *jxdata = ( *jenv )->GetIntArrayElements( jenv, $input, 0 ); + $1 = ( *jenv )->GetArrayLength( jenv, $input ); + Alen = $1; + setup_array_1d_i( &$2, jxdata, Alen ); + // Could find no easy way to do this as part of freearg so I modified + // the previous function so it ALWAYS mallocs and copies so that + // the java array can be released immediately. + ( *jenv )->ReleaseIntArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) (PLINT n, const PLINT *Array) { - free($2); +%typemap( freearg ) ( PLINT n, const PLINT * Array ) +{ + free( $2 ); } -%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; +%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) (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"); - return; - } - $2 = (*jenv)->GetArrayLength( jenv, $input ); - setup_array_1d_i( &$1, jydata, Alen); - (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); +// Trailing count and check consistency with previous +%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" ); + return; + } + $2 = ( *jenv )->GetArrayLength( jenv, $input ); + setup_array_1d_i( &$1, jydata, Alen ); + ( *jenv )->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) (const PLINT *ArrayCk, PLINT n) { - free($1); +%typemap( freearg ) ( const PLINT * ArrayCk, PLINT n ) +{ + free( $1 ); } -%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; +%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) const PLINT *ArrayCk { - jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); - if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { - printf("Vectors must be same length.\n"); - return; - } - setup_array_1d_i( &$1, jydata, Alen); - (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); +// no count but check consistency with previous +%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" ); + return; + } + setup_array_1d_i( &$1, jydata, Alen ); + ( *jenv )->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) const PLINT *ArrayCk { - free($1); +%typemap( freearg ) const PLINT * ArrayCk { + free( $1 ); } -%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; +%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) const PLINT *ArrayCkNull { - if ( $input != NULL ) { - jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); - if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { - printf("Vectors must be same length.\n"); - return; - } - setup_array_1d_i( &$1, jydata, Alen); - (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); - } - else { - $1 == NULL; - } +// no count but check consistency with previous or is null +%typemap( in ) const PLINT * ArrayCkNull { + if ( $input != NULL ) + { + jint *jydata = ( *jenv )->GetIntArrayElements( jenv, $input, 0 ); + if ( ( *jenv )->GetArrayLength( jenv, $input ) != Alen ) + { + printf( "Vectors must be same length.\n" ); + return; + } + setup_array_1d_i( &$1, jydata, Alen ); + ( *jenv )->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); + } + else + { + $1 == NULL; + } } -%typemap(freearg) const PLINT *ArrayCkNull { - if ($1 != NULL) - free($1); +%typemap( freearg ) const PLINT * ArrayCkNull { + if ( $1 != NULL ) + free( $1 ); } -%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; +%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; } -/* Weird case to allow argument to be one shorter than others */ -/* This case is used both for PLBOOL and PLINT. Define PLBOOL version - * first. (AWI thinks this may be necessary because of the above - * typedef PLINT PLBOOL;) - * Also add version which must be one shorter than others or null. - */ -%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"); - return; - } - setup_array_1d_b( &$1, jydata, Alen); - (*jenv)->ReleaseBooleanArrayElements( jenv, $input, jydata, 0 ); +// Weird case to allow argument to be one shorter than others +// This case is used both for PLBOOL and PLINT. Define PLBOOL version +// first. (AWI thinks this may be necessary because of the above +// typedef PLINT PLBOOL;) +// Also add version which must be one shorter than others or null. +// +%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" ); + return; + } + setup_array_1d_b( &$1, jydata, Alen ); + ( *jenv )->ReleaseBooleanArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) const PLBOOL *ArrayCkMinus1 { - free($1); +%typemap( freearg ) const PLBOOL * ArrayCkMinus1 { + free( $1 ); } -%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( 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) const PLBOOL *ArrayCkMinus1Null { - if ($input != NULL) { - 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"); - return; - } - setup_array_1d_b( &$1, jydata, Alen); - (*jenv)->ReleaseBooleanArrayElements( jenv, $input, jydata, 0 ); - } - else { - $1 = NULL; - } +%typemap( in ) const PLBOOL * ArrayCkMinus1Null { + if ( $input != NULL ) + { + 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" ); + return; + } + setup_array_1d_b( &$1, jydata, Alen ); + ( *jenv )->ReleaseBooleanArrayElements( jenv, $input, jydata, 0 ); + } + else + { + $1 = NULL; + } } -%typemap(freearg) const PLBOOL *ArrayCkMinus1Null { - if ($1 != NULL) - free($1); +%typemap( freearg ) const PLBOOL * ArrayCkMinus1Null { + if ( $1 != NULL ) + free( $1 ); } -%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( 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) 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"); - return; - } - setup_array_1d_i( &$1, jydata, Alen); - (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); +%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" ); + return; + } + setup_array_1d_i( &$1, jydata, Alen ); + ( *jenv )->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) const PLINT *ArrayCkMinus1 { - free($1); +%typemap( freearg ) const PLINT * ArrayCkMinus1 { + free( $1 ); } -%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( 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) const PLINT *ArrayCkMinus1Null { - if ($input != NULL) { - 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"); - return; - } - setup_array_1d_i( &$1, jydata, Alen); - (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); - } - else { - $1 = NULL; - } +%typemap( in ) const PLINT * ArrayCkMinus1Null { + if ( $input != NULL ) + { + 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" ); + return; + } + setup_array_1d_i( &$1, jydata, Alen ); + ( *jenv )->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); + } + else + { + $1 = NULL; + } } -%typemap(freearg) const PLINT *ArrayCkMinus1Null { - if ($1 != NULL) - free($1); +%typemap( freearg ) const PLINT * ArrayCkMinus1Null { + if ( $1 != NULL ) + free( $1 ); } -%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; +%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) 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 ); +// No length but remember size to check others +%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) const PLINT *Array { - free($1); +%typemap( freearg ) const PLINT * Array { + free( $1 ); } -%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; +%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; } -/****************************************************************************** - PLFLT Arrays -******************************************************************************/ +//-------------------------------------------------------------------------- +// PLFLT Arrays +//-------------------------------------------------------------------------- //temporary #if 0 #ifndef PL_DOUBLE -%wrapper %{ -/* some really twisted stuff to allow calling a single precision library from python */ -PyArrayObject* myArray_ContiguousFromObject(PyObject* in, int type, int mindims, int maxdims) -{ - PyArrayObject* tmp = (PyArrayObject*)PyArray_ContiguousFromObject(in, PyArray_FLOAT, - mindims, maxdims); - if (!tmp) { - /* could be an incoming double array which can't be "safely" converted, do it anyway */ - if(PyArray_Check(in)) { - PyErr_Clear(); - tmp = (PyArrayObject*)PyArray_Cast((PyArrayObject*)in, PyArray_FLOAT); +%wrapper +%{ +// some really twisted stuff to allow calling a single precision library from python + PyArrayObject* myArray_ContiguousFromObject( PyObject* in, int type, int mindims, int maxdims ) + { + PyArrayObject* tmp = (PyArrayObject*) PyArray_ContiguousFromObject( in, PyArray_FLOAT, + mindims, maxdims ); + if ( !tmp ) + { + // could be an incoming double array which can't be "safely" converted, do it anyway + if ( PyArray_Check( in ) ) + { + PyErr_Clear(); + tmp = (PyArrayObject*) PyArray_Cast( (PyArrayObject*) in, PyArray_FLOAT ); + } + } + return tmp; } - } - return tmp; -} - %} +%} #else -%wrapper %{ -#define myArray_ContiguousFromObject PyArray_ContiguousFromObject - %} +%wrapper +%{ +#define myArray_ContiguousFromObject PyArray_ContiguousFromObject +%} #endif -/* temporary*/ +// temporary #endif -/* with preceding count */ -%typemap(in) (PLINT n, const PLFLT *Array) { - jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); - $1 = (*jenv)->GetArrayLength( jenv, $input); - Alen = $1; - setup_array_1d_PLFLT( &$2, jxdata, Alen ); - /* Could find no easy way to do this as part of freearg so I modified - * the previous function so it ALWAYS mallocs and copies so that - * the java array can be released immediately. */ - (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); +// with preceding count +%typemap( in ) ( PLINT n, const PLFLT * Array ) +{ + jPLFLT *jxdata = ( *jenv )->GetPLFLTArrayElements( jenv, $input, 0 ); + $1 = ( *jenv )->GetArrayLength( jenv, $input ); + Alen = $1; + setup_array_1d_PLFLT( &$2, jxdata, Alen ); + // Could find no easy way to do this as part of freearg so I modified + // the previous function so it ALWAYS mallocs and copies so that + // the java array can be released immediately. + ( *jenv )->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) (PLINT n, const PLFLT *Array) { - free($2); +%typemap( freearg ) ( PLINT n, const PLFLT * Array ) +{ + free( $2 ); } -%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; +%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) (const PLFLT *ArrayCk, PLINT n) { - jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); - $2 = (*jenv)->GetArrayLength( jenv, $input ); - if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { - printf("Vectors must be same length.\n"); - return; - } - setup_array_1d_PLFLT( &$1, jydata, Alen ); - (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); +// trailing count, and check consistency with previous +%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 ) + { + printf( "Vectors must be same length.\n" ); + return; + } + setup_array_1d_PLFLT( &$1, jydata, Alen ); + ( *jenv )->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) (const PLFLT *ArrayCk, PLINT n) { - free($1); +%typemap( freearg ) ( const PLFLT * ArrayCk, PLINT n ) +{ + free( $1 ); } -%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; +%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) const PLFLT *ArrayCk { - jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); - if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { - printf("Vectors must be same length.\n"); - return; - } - setup_array_1d_PLFLT( &$1, jydata, Alen ); - (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); +// no count, but check consistency with previous +%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" ); + return; + } + setup_array_1d_PLFLT( &$1, jydata, Alen ); + ( *jenv )->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) const PLFLT *ArrayCk { - free($1); +%typemap( freearg ) const PLFLT * ArrayCk { + free( $1 ); } -%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; +%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) const PLFLT *ArrayCkNull { - if ( $input != NULL ) { - jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); - if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { - printf("Vectors must be same length.\n"); - return; - } - setup_array_1d_PLFLT( &$1, jydata, Alen ); - (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); - } - else { - $1 = NULL; - } +// no count, but check consistency with previous or NULL +%typemap( in ) const PLFLT * ArrayCkNull { + if ( $input != NULL ) + { + jPLFLT *jydata = ( *jenv )->GetPLFLTArrayElements( jenv, $input, 0 ); + if ( ( *jenv )->GetArrayLength( jenv, $input ) != Alen ) + { + printf( "Vectors must be same length.\n" ); + return; + } + setup_array_1d_PLFLT( &$1, jydata, Alen ); + ( *jenv )->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); + } + else + { + $1 = NULL; + } } -%typemap(freearg) const PLFLT *ArrayCkNull { - if ($1 != NULL) - free($1); +%typemap( freearg ) const PLFLT * ArrayCkNull { + if ( $1 != NULL ) + free( $1 ); } -%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; +%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) (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 ); +// set X length for later consistency checking +%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) (const PLFLT *ArrayX, PLINT nx) { - free($1); +%typemap( freearg ) ( const PLFLT * ArrayX, PLINT nx ) +{ + free( $1 ); } -%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( 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) 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( 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) const PLFLT *ArrayX { - free($1); +%typemap( freearg ) const PLFLT * ArrayX { + free( $1 ); } -%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; +%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) (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 ); +// set Y length for later consistency checking +%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) (const PLFLT *ArrayY, PLINT ny) { - free($1); +%typemap( freearg ) ( const PLFLT * ArrayY, PLINT ny ) +{ + free( $1 ); } -%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( 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) 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( 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) const PLFLT *ArrayY { - free($1); +%typemap( freearg ) const PLFLT * ArrayY { + free( $1 ); } -%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; +%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) (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 ); +// with trailing count +%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) (const PLFLT *Array, PLINT n) { - free($1); +%typemap( freearg ) ( const PLFLT * Array, PLINT n ) +{ + free( $1 ); } -%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; +%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) 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 ); +// with no trailing count +%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) const PLFLT *Array { - free($1); +%typemap( freearg ) const PLFLT * Array { + free( $1 ); } -%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; +%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) const PLFLT *ArrayCkX { - jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); - if((*jenv)->GetArrayLength( jenv, $input ) != Xlen) { - printf("Vectors must be same length.\n"); - return; - } - setup_array_1d_PLFLT( &$1, jxdata, Xlen ); - (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); +// check consistency with X dimension of previous +%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" ); + return; + } + setup_array_1d_PLFLT( &$1, jxdata, Xlen ); + ( *jenv )->ReleasePLFLTArrayElements( jenv, $input, jxdata, 0 ); } -%typemap(freearg) const PLFLT *ArrayCkX { - free($1); +%typemap( freearg ) const PLFLT * ArrayCkX { + free( $1 ); } -%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; +%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) const PLFLT *ArrayCkY { - jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); - if((*jenv)->GetArrayLength( jenv, $input ) != Ylen) { - printf("Vectors must be same length.\n"); - return; - } - setup_array_1d_PLFLT( &$1, jydata, Ylen ); - (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); +// check consistency with Y dimension of previous +%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" ); + return; + } + setup_array_1d_PLFLT( &$1, jydata, Ylen ); + ( *jenv )->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); } -%typemap(freearg) const PLFLT *ArrayCkY { - free($1); +%typemap( freearg ) const PLFLT * ArrayCkY { + free( $1 ); } -%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; +%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) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) { - jPLFLT **adat; - jobject *ai; - int nx = (*jenv)->GetArrayLength( jenv, $input ); - int ny = -1; - int i, j; - ai = (jobject *) malloc( nx * sizeof(jobject) ); - adat = (jPLFLT **) malloc( nx * sizeof(jPLFLT *) ); +// 2D array with trailing dimensions, check consistency with previous +%typemap( in ) ( const PLFLT * *MatrixCk, PLINT nx, PLINT ny ) +{ + jPLFLT **adat; + jobject *ai; + int nx = ( *jenv )->GetArrayLength( jenv, $input ); + int ny = -1; + int i, j; + ai = (jobject *) malloc( nx * sizeof ( jobject ) ); + adat = (jPLFLT **) malloc( nx * sizeof ( jPLFLT * ) ); - (*jenv)->EnsureLocalCapacity( jenv, nx ); + ( *jenv )->EnsureLocalCapacity( jenv, nx ); - for( i=0; i < nx; i++ ) - { - ai[i] = (*jenv)->GetObjectArrayElement( jenv, $input, i ); - adat[i] = (*jenv)->GetPLFLTArrayElements( jenv, ai[i], 0 ); + for ( i = 0; i < nx; i++ ) + { + ai[i] = ( *jenv )->GetObjectArrayElement( jenv, $input, i ); + adat[i] = ( *jenv )->GetPLFLTArrayElements( jenv, ai[i], 0 ); - if (ny == -1) - ny = (*jenv)->GetArrayLength( jenv, ai[i] ); - else if (ny != (*jenv)->GetArrayLength( jenv, ai[i] )) { - printf( "Misshapen a array.\n" ); - for( j=0; j <= i; j++ ) - (*jenv)->ReleasePLFLTArrayElements( jenv, ai[j], adat[j], 0 ); - free(adat); - free(ai); - return; - } - } + if ( ny == -1 ) + ny = ( *jenv )->GetArrayLength( jenv, ai[i] ); + else if ( ny != ( *jenv )->GetArrayLength( jenv, ai[i] ) ) + { + printf( "Misshapen a array.\n" ); + for ( j = 0; j <= i; j++ ) + ( *jenv )->ReleasePLFLTArrayElements( jenv, ai[j], adat[j], 0 ); + free( adat ); + free( ai ); + return; + } + } - if( nx != Xlen || ny != Ylen ) { - printf( "Vectors must match matrix.\n" ); - for( i=0; i < nx; i++ ) - (*jenv)->ReleasePLFLTArrayElements( jenv, ai[i], adat[i], 0 ); - free(adat); - free(ai); - return; - } - setup_array_2d_PLFLT( &$1, adat, nx, ny ); - $2 = nx; - $3 = ny; - for( i=0; i < nx; i++ ) { - (*jenv)->ReleasePLFLTArrayElements( jenv, ai[i], adat[i], 0 ); - (*jenv)->DeleteLocalRef(jenv, ai[i]); - } - + if ( nx != Xlen || ny != Ylen ) + { + printf( "Vectors must match matrix.\n" ); + for ( i = 0; i < nx; i++ ) + ( *jenv )->ReleasePLFLTArrayElements( jenv, ai[i], adat[i], 0 ); + free( adat ); + free( ai ); + return; + } + setup_array_2d_PLFLT( &$1, adat, nx, ny ); + $2 = nx; + $3 = ny; + for ( i = 0; i < nx; i++ ) + { + ( *jenv )->ReleasePLFLTArrayElements( jenv, ai[i], adat[i], 0 ); + ( *jenv )->DeleteLocalRef( jenv, ai[i] ); + } - free(adat); - free(ai); + free( adat ); + free( ai ); } -%typemap(freearg) (const PLFLT **MatrixCk, PLINT nx, PLINT ny) { - free($1[0]); - free($1); +%typemap( freearg ) ( const PLFLT * *MatrixCk, PLINT nx, P... [truncated message content] |
From: <and...@us...> - 2011-09-07 11:45:35
|
Revision: 11915 http://plplot.svn.sourceforge.net/plplot/?rev=11915&view=rev Author: andrewross Date: 2011-09-07 11:45:29 +0000 (Wed, 07 Sep 2011) Log Message: ----------- Add plsmema to f77 and f95 bindings. Add plsmem and plsmema to the C++ bindings. Propagation of these two API functions seems inconsistent, and the only example to test them is a python script. Needs a standard example which uses them. Closes plplot bug 3324339. Modified Paths: -------------- 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/f95/sfstubsf95.f90 Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2011-09-07 09:52:13 UTC (rev 11914) +++ trunk/bindings/c++/plstream.cc 2011-09-07 11:45:29 UTC (rev 11915) @@ -1949,6 +1949,24 @@ plsmaj( def, scale ); } +// Set the RGB memory area to be plotted (with the 'mem' or 'memcairo' drivers) + +void plstream::smem( PLINT maxx, PLINT maxy, void *plotmem) +{ + set_stream(); + + plsmem( maxx, maxy, plotmem ); +} + +// Set the RGBA memory area to be plotted (with the 'memcairo' drivers) + +void plstream::smema( PLINT maxx, PLINT maxy, void *plotmem) +{ + set_stream(); + + plsmema( maxx, maxy, plotmem ); +} + // Set up lengths of minor tick marks. void plstream::smin( PLFLT def, PLFLT scale ) Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2011-09-07 09:52:13 UTC (rev 11914) +++ trunk/bindings/c++/plstream.h 2011-09-07 11:45:29 UTC (rev 11915) @@ -785,6 +785,14 @@ void smaj( PLFLT def, PLFLT scale ); +// Set the RGB memory area to be plotted (with the 'mem' or 'memcairo' drivers) + + void smem( PLINT maxx, PLINT maxy, void *plotmem ); + +// Set the RGBA memory area to be plotted (with the 'memcairo' driver) + + void smema( PLINT maxx, PLINT maxy, void *plotmem ); + // Set up lengths of minor tick marks. void smin( PLFLT def, PLFLT scale ); Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2011-09-07 09:52:13 UTC (rev 11914) +++ trunk/bindings/f77/plstubs.h 2011-09-07 11:45:29 UTC (rev 11915) @@ -313,6 +313,7 @@ #define PLSLABELFUNC_NONEa FNAME( PLSLABELFUNC_NONE_, plslabelfunc_none_ ) #define PLSMAJ FNAME( PLSMAJ, plsmaj ) #define PLSMEM FNAME( PLSMEM, plsmem ) +#define PLSMEMA FNAME( PLSMEMA, plsmema ) #define PLSMIN FNAME( PLSMIN, plsmin ) #define PLSORI FNAME( PLSORI, plsori ) #define PLSPAGE FNAME( PLSPAGE, plspage ) Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-09-07 09:52:13 UTC (rev 11914) +++ trunk/bindings/f77/scstubs.c 2011-09-07 11:45:29 UTC (rev 11915) @@ -990,6 +990,12 @@ } void +PLSMEMA( PLINT *maxx, PLINT *maxy, void *plotmem ) +{ + c_plsmema( *maxx, *maxy, plotmem ); +} + +void PLSMIN( PLFLT *def, PLFLT *scale ) { c_plsmin( *def, *scale ); Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2011-09-07 09:52:13 UTC (rev 11914) +++ trunk/bindings/f95/plstubs.h 2011-09-07 11:45:29 UTC (rev 11915) @@ -325,6 +325,7 @@ #define PLSLABELFUNC_NONEa FNAME( PLSLABELFUNC_NONE_, plslabelfunc_none_ ) #define PLSMAJ FNAME( PLSMAJ, plsmaj ) #define PLSMEM FNAME( PLSMEM, plsmem ) +#define PLSMEMA FNAME( PLSMEMA, plsmema ) #define PLSMIN FNAME( PLSMIN, plsmin ) #define PLSORI FNAME( PLSORI, plsori ) #define PLSPAGE FNAME( PLSPAGE, plspage ) Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-09-07 09:52:13 UTC (rev 11914) +++ trunk/bindings/f95/scstubs.c 2011-09-07 11:45:29 UTC (rev 11915) @@ -1064,6 +1064,12 @@ } void +PLSMEMA( PLINT *maxx, PLINT *maxy, void *plotmem ) +{ + c_plsmema( *maxx, *maxy, plotmem ); +} + +void PLSMIN( PLFLT *def, PLFLT *scale ) { c_plsmin( *def, *scale ); Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2011-09-07 09:52:13 UTC (rev 11914) +++ trunk/bindings/f95/sfstubsf95.f90 2011-09-07 11:45:29 UTC (rev 11915) @@ -752,6 +752,7 @@ end interface ! plsmem: void * argument tricky - TODO + ! plsmema: void * argument tricky - TODO interface subroutine plsmin( def, scale ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-09-13 12:06:36
|
Revision: 11919 http://plplot.svn.sourceforge.net/plplot/?rev=11919&view=rev Author: andrewross Date: 2011-09-13 12:06:24 +0000 (Tue, 13 Sep 2011) Log Message: ----------- Remove references in bindings to deprecated functions which have been removed from the core library so that compiling with -DPL_DEPRECATED=ON works again. Modified Paths: -------------- trunk/bindings/c++/plstream.cc trunk/bindings/ocaml/plplot_h trunk/bindings/octave/plplot_octave.h.in trunk/bindings/tcl/plapi.tpl Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2011-09-12 12:09:52 UTC (rev 11918) +++ trunk/bindings/c++/plstream.cc 2011-09-13 12:06:24 UTC (rev 11919) @@ -328,18 +328,7 @@ plarc( x, y, a, b, angle1, angle2, rotate, 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 ) -{ - set_stream(); - - 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, void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), PLPointer pltr_data ) @@ -2580,17 +2569,6 @@ } #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. void plstream::OptUsage() Modified: trunk/bindings/ocaml/plplot_h =================================================================== --- trunk/bindings/ocaml/plplot_h 2011-09-12 12:09:52 UTC (rev 11918) +++ trunk/bindings/ocaml/plplot_h 2011-09-13 12:06:24 UTC (rev 11919) @@ -897,12 +897,4 @@ int plTranslateCursor(PLGraphicsIn *gin); - int -plParseOpts(int *p_argc, const char **argv, PLINT mode); - - void -plHLS_RGB(PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b); - - void -plRGB_HLS(PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s); */ Modified: trunk/bindings/octave/plplot_octave.h.in =================================================================== --- trunk/bindings/octave/plplot_octave.h.in 2011-09-12 12:09:52 UTC (rev 11918) +++ trunk/bindings/octave/plplot_octave.h.in 2011-09-13 12:06:24 UTC (rev 11919) @@ -1809,14 +1809,6 @@ c_plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr2, &grid2 ); } //%name plimagefr2 //%input a(nx,ny), xg(nx+1,ny+1), yg(nx+1,ny+1) -// Depreciated functions - retained for backwards compatibility - -// simple arrow plotter. - -void plarrows( PLFLT *u, PLFLT *v, PLFLT *x, PLFLT *y, PLINT n, - PLFLT scale, PLFLT dx, PLFLT dy ); //%name plarrows //%input u(n), v(n), x(n), y(n) - - #ifdef __cplusplus } #endif Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2011-09-12 12:09:52 UTC (rev 11918) +++ trunk/bindings/tcl/plapi.tpl 2011-09-13 12:06:24 UTC (rev 11919) @@ -1201,11 +1201,6 @@ # int # plsetopt(char *opt, char *optarg); -# Process options list using current options info. - -# int -# plParseOpts(int *p_argc, char **argv, PLINT mode); - # Print usage & syntax message. # void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-14 07:11:24
|
Revision: 11967 http://plplot.svn.sourceforge.net/plplot/?rev=11967&view=rev Author: andrewross Date: 2011-10-14 07:11:18 +0000 (Fri, 14 Oct 2011) Log Message: ----------- Fix some -std=99 -pedantic warnings related to incomplete prototypes and missing const attributes. Modified Paths: -------------- trunk/bindings/c++/plstream.h trunk/bindings/tcl/tclAPI.c trunk/bindings/tk/plserver.c Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2011-10-14 07:10:05 UTC (rev 11966) +++ trunk/bindings/c++/plstream.h 2011-10-14 07:11:18 UTC (rev 11967) @@ -97,10 +97,10 @@ plstream& operator=( const plstream& ); protected: - virtual void set_stream() { ::c_plsstrm( stream ); } + virtual void set_stream( void ) { ::c_plsstrm( stream ); } public: - plstream(); + plstream( void ); plstream( plstream * pls ); plstream( PLS::stream_id sid, PLINT strm = 0 ); plstream( PLINT _stream ) : stream( _stream ) {} @@ -109,7 +109,7 @@ plstream( PLINT nx /*=1*/, PLINT ny /*=1*/, PLINT r, PLINT g, PLINT b, const char *driver = NULL, const char *file = NULL ); - virtual ~plstream(); + virtual ~plstream( void ); // Now start miroring the PLplot C API. @@ -149,7 +149,7 @@ // Start new page. Should only be used with pleop(). - void bop(); + void bop( void ); // This draws a box around the current viewport. @@ -173,7 +173,7 @@ // Clear the current subpage. - void clear(); + void clear( void ); // Set color, map 0. Argument is integer between 0 and 15. @@ -260,7 +260,7 @@ // End current page. Should only be used with plbop(). - void eop(); + void eop( void ); // Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i)). @@ -272,7 +272,7 @@ // Advance to the next family file on the next new page. - void famadv(); + void famadv( void ); // Pattern fills the polygon bounded by the input points. @@ -284,7 +284,7 @@ // Flushes the output stream. Use sparingly, if at all. - void flush(); + void flush( void ); // Sets the global font flag to 'ifont'. @@ -357,7 +357,7 @@ // Switches to graphics screen. - void gra(); + void gra( void ); // Draw gradient in polygon. @@ -416,7 +416,7 @@ // Initializes PLplot, using preset or default options - void init(); + void init( void ); // Draws a line segment from (x1, y1) to (x2, y2). @@ -574,7 +574,7 @@ // Replays contents of plot buffer to current device/file. - void replot(); + void replot( void ); // Set line color by red, green, blue from 0. to 1. @@ -921,7 +921,7 @@ // Switches to text screen. - void text(); + void text( void ); // Set the format for date / time labels @@ -944,7 +944,7 @@ // Defines a "standard" viewport with seven character heights for // the left margin and four character heights everywhere else. - void vsta(); + void vsta( void ); // Set up a window for three-dimensional plotting. @@ -1055,11 +1055,11 @@ // Clear internal option table info structure. - void ClearOpts(); + void ClearOpts( void ); // Reset internal option table info structure. - void ResetOpts(); + void ResetOpts( void ); // Merge user option table into internal info structure. @@ -1083,7 +1083,7 @@ // Print usage & syntax message. - void OptUsage(); + void OptUsage( void ); // Miscellaneous Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-10-14 07:10:05 UTC (rev 11966) +++ trunk/bindings/tcl/tclAPI.c 2011-10-14 07:11:18 UTC (rev 11967) @@ -152,7 +152,7 @@ // Evals the specified command, aborting on an error. static int -tcl_cmd( Tcl_Interp *interp, char *cmd ); +tcl_cmd( Tcl_Interp *interp, const char *cmd ); //-------------------------------------------------------------------------- // Append_Cmdlist @@ -786,7 +786,7 @@ //-------------------------------------------------------------------------- static int -tcl_cmd( Tcl_Interp *interp, char *cmd ) +tcl_cmd( Tcl_Interp *interp, const char *cmd ) { int result; Modified: trunk/bindings/tk/plserver.c =================================================================== --- trunk/bindings/tk/plserver.c 2011-10-14 07:10:05 UTC (rev 11966) +++ trunk/bindings/tk/plserver.c 2011-10-14 07:11:18 UTC (rev 11967) @@ -74,7 +74,7 @@ // Evals the specified command, aborting on an error. static void -tcl_cmd( Tcl_Interp *interp, char *cmd ); +tcl_cmd( Tcl_Interp *interp, const char *cmd ); // Application-specific startup @@ -291,7 +291,7 @@ //-------------------------------------------------------------------------- static void -tcl_cmd( Tcl_Interp *interp, char *cmd ) +tcl_cmd( Tcl_Interp *interp, const char *cmd ) { int result; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-01-30 01:06:10
|
Revision: 12287 http://plplot.svn.sourceforge.net/plplot/?rev=12287&view=rev Author: airwin Date: 2013-01-30 01:06:02 +0000 (Wed, 30 Jan 2013) Log Message: ----------- Consistency updates created by copying generated files for the check_plplot_octave_def and check_swig_documentation targets back to the source tree. Modified Paths: -------------- trunk/bindings/octave/plplot_octave_def trunk/bindings/swig-support/swig_documentation.i Modified: trunk/bindings/octave/plplot_octave_def =================================================================== --- trunk/bindings/octave/plplot_octave_def 2013-01-29 23:36:01 UTC (rev 12286) +++ trunk/bindings/octave/plplot_octave_def 2013-01-30 01:06:02 UTC (rev 12287) @@ -80,6 +80,22 @@ PL_HIST_NOEXPAND = 8; global PL_HIST_NOEMPTY PL_HIST_NOEMPTY = 16; +global PL_POSITION_LEFT +PL_POSITION_LEFT = 1; +global PL_POSITION_RIGHT +PL_POSITION_RIGHT = 2; +global PL_POSITION_TOP +PL_POSITION_TOP = 4; +global PL_POSITION_BOTTOM +PL_POSITION_BOTTOM = 8; +global PL_POSITION_INSIDE +PL_POSITION_INSIDE = 16; +global PL_POSITION_OUTSIDE +PL_POSITION_OUTSIDE = 32; +global PL_POSITION_VIEWPORT +PL_POSITION_VIEWPORT = 64; +global PL_POSITION_SUBPAGE +PL_POSITION_SUBPAGE = 128; global PL_LEGEND_NONE PL_LEGEND_NONE = 1; global PL_LEGEND_COLOR_BOX @@ -96,46 +112,26 @@ PL_LEGEND_BOUNDING_BOX = 64; global PL_LEGEND_ROW_MAJOR PL_LEGEND_ROW_MAJOR = 128; -global PL_LEGEND_LEFT -PL_LEGEND_LEFT = 256; -global PL_LEGEND_RIGHT -PL_LEGEND_RIGHT = 512; -global PL_LEGEND_UPPER -PL_LEGEND_UPPER = 1024; -global PL_LEGEND_LOWER -PL_LEGEND_LOWER = 2048; -global PL_LEGEND_INSIDE -PL_LEGEND_INSIDE = 4096; -global PL_LEGEND_OUTSIDE -PL_LEGEND_OUTSIDE = 8192; -global PL_POSITION_LEFT -PL_POSITION_LEFT = 1; -global PL_POSITION_RIGHT -PL_POSITION_RIGHT = 2; -global PL_POSITION_TOP -PL_POSITION_TOP = 4; -global PL_POSITION_BOTTOM -PL_POSITION_BOTTOM = 8; global PL_COLORBAR_LABEL_LEFT -PL_COLORBAR_LABEL_LEFT = 16; +PL_COLORBAR_LABEL_LEFT = 1; global PL_COLORBAR_LABEL_RIGHT -PL_COLORBAR_LABEL_RIGHT = 32; +PL_COLORBAR_LABEL_RIGHT = 2; global PL_COLORBAR_LABEL_TOP -PL_COLORBAR_LABEL_TOP = 64; +PL_COLORBAR_LABEL_TOP = 4; global PL_COLORBAR_LABEL_BOTTOM -PL_COLORBAR_LABEL_BOTTOM = 128; +PL_COLORBAR_LABEL_BOTTOM = 8; global PL_COLORBAR_IMAGE -PL_COLORBAR_IMAGE = 256; +PL_COLORBAR_IMAGE = 16; global PL_COLORBAR_SHADE -PL_COLORBAR_SHADE = 512; +PL_COLORBAR_SHADE = 32; global PL_COLORBAR_GRADIENT -PL_COLORBAR_GRADIENT = 1024; +PL_COLORBAR_GRADIENT = 64; global PL_COLORBAR_CAP_LOW -PL_COLORBAR_CAP_LOW = 2048; +PL_COLORBAR_CAP_LOW = 128; global PL_COLORBAR_CAP_HIGH -PL_COLORBAR_CAP_HIGH = 4096; +PL_COLORBAR_CAP_HIGH = 256; global PL_COLORBAR_SHADE_LABEL -PL_COLORBAR_SHADE_LABEL = 8192; +PL_COLORBAR_SHADE_LABEL = 512; global PLSWIN_DEVICE PLSWIN_DEVICE = 1; # device coordinates global PLSWIN_WORLD Modified: trunk/bindings/swig-support/swig_documentation.i =================================================================== --- trunk/bindings/swig-support/swig_documentation.i 2013-01-29 23:36:01 UTC (rev 12286) +++ trunk/bindings/swig-support/swig_documentation.i 2013-01-30 01:06:02 UTC (rev 12287) @@ -98,13 +98,14 @@ DESCRIPTION: - Draw a possible filled arc centered at x, y with semimajor axis a and + Draw a possibly filled arc centered at x, y with semimajor axis a and semiminor axis b, starting at angle1 and ending at angle2. - Redacted form: General: plarc(x, y, a, b, angle1, angle2, rotate, fill) + Redacted form: General: plarc(x, y, a, b, angle1, angle2, rotate, + fill) - This function is used in example 3. + This function is used in examples 3 and 27. @@ -122,11 +123,14 @@ b (PLFLT, input) : Length of the semiminor axis of the arc. - angle1 (PLFLT, input) : Starting angle of the arc. + angle1 (PLFLT, input) : Starting angle of the arc relative to the + semimajor axis. - angle2 (PLFLT, input) : Ending angle of the arc. + angle2 (PLFLT, input) : Ending angle of the arc relative to the + semimajor axis. - rotate (PLFLT, input) : Rotation of arc + rotate (PLFLT, input) : Angle of the semimajor axis relative to the + X-axis. fill (PLBOOL, input) : Draw a filled arc. ") @@ -354,6 +358,8 @@ s: Enables subticks between major ticks, only valid if t is also specified. t: Draws major ticks. + u: Exactly like \"b\" except don't draw edge line. + w: Exactly like \"c\" except don't draw edge line. xtick (PLFLT, input) : World coordinate interval between major @@ -616,6 +622,7 @@ 13 magenta 14 salmon 15 white + Use plscmap0 to change the entire map0 color palette and plscol0 to change an individual color in the map0 color palette. ") @@ -629,7 +636,7 @@ Redacted form: plcol1(col1) - This function is used in example 12. + This function is used in examples 12 and 21. @@ -1099,10 +1106,10 @@ Fills the polygon defined by the n points ( x[i], - y[i]) using the pattern defined by plpsty or plpat. The routine will - automatically close the polygon between the last and first vertices. - If multiple closed polygons are passed in x and y then plfill will - fill in between them. + y[i]) using the pattern defined by plpsty or plpat. The default fill + style is a solid fill. The routine will automatically close the + polygon between the last and first vertices. If multiple closed + polygons are passed in x and y then plfill will fill in between them. Redacted form: plfill(x,y) @@ -1667,7 +1674,7 @@ Redacted form: plgpage(xp, yp, xleng, yleng, xoff, yoff) - This function is used in example 31. + This function is used in examples 14 and 31. @@ -1777,6 +1784,7 @@ Redacted form: General: plgriddata(x, y, z, xg, yg, zg, type, data) Perl/PDL: Not available? + Python: zg=plgriddata(x, y, z, xg, yg, type, data) This function is used in example 21. @@ -2199,8 +2207,8 @@ nx, ny (PLINT, input) : Dimensions of idata - xmin, xmax, ymin, ymax (PLFLT, input) : Plot coordinates to strecth - the image data to. idata[0][0] corresponds to (xmin, ymin) and + xmin, xmax, ymin, ymax (PLFLT, input) : Stretch image data to these + Plot coordinates. idata[0][0] corresponds to (xmin, ymin) and idata[nx - 1][ny - 1] corresponds to (xmax, ymax). zmin, zmax (PLFLT, input) : Only data between zmin and zmax @@ -2358,18 +2366,18 @@ ") pllab; -%feature( "docstring", "Create a discrete annotated legend using boxes, lines, and/or lines of symbols +%feature( "docstring", "Plot legend using discretely annotated filled boxes, lines, and/or lines of symbols DESCRIPTION: - (N.B. This is an experimental API that may be subject to further - change as we gain more experience with it.) Routine for creating a - discrete plot legend with a plotted box, line, and/or line of symbols - for each annotated legend entry. The arguments of pllegend provide - control over the location and size of the legend within the current - subpage as well as the location and characteristics of the elements + Routine for creating a discrete plot legend with a plotted filled box, + line, and/or line of symbols for each annotated legend entry. The + arguments of pllegend provide control over the location and size of + the legend as well as the location and characteristics of the elements (most of which are optional) within that legend. The resulting legend - is clipped at the boundaries of the current subpage + is clipped at the boundaries of the current subpage. (N.B. the adopted + coordinate system used for some of the parameters is defined in the + documentation of the position parameter.) Redacted form: pllegend(opt, x, y, plot_width, bg_color, opt_array, text_offset, text_scale, text_spacing, test_justification, @@ -2383,43 +2391,94 @@ SYNOPSIS: -pllegend(opt, x, y, plot_width, bg_color, nlegend, opt_array, text_offset, text_scale, text_spacing, test_justification, text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols) +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, test_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) ARGUMENTS: + p_legend_width (PLFLT *, output) : Pointer to a location which + contains (after the call) the legend width in adopted coordinates. + This quantity is calculated from plot_width, text_offset, ncolumn + (possibly modified inside the routine depending on nlegend and + nrow), and the length (calculated internally) of the longest text + string. + + p_legend_height (PLFLT *, output) : Pointer to a location which + contains (after the call) the legend height in adopted + coordinates. This quantity is calculated from text_scale, + text_spacing, and nrow (possibly modified inside the routine + depending on nlegend and nrow). + + position (PLINT, input) : position contains bits controlling the + overall position of the legend and the definition of the adopted + coordinates used for positions. The combination of the + PL_POSITION_LEFT, PL_POSITION_RIGHT, PL_POSITION_TOP, + PL_POSITION_BOTTOM, PL_POSITION_INSIDE, and PL_POSITION_OUTSIDE + bits specifies one of the 16 possible standard positions (the 4 + corners and 4 side centers for both the inside and outside cases) + of the legend relative to the adopted coordinate system. The + adopted coordinates are normalized viewport coordinates if the + PL_POSITION_VIEWPORT bit is set or normalized subpage coordinates + if the PL_POSITION_SUBPAGE bit is set. Default position bits: If + none of PL_POSITION_LEFT, PL_POSITION_RIGHT, PL_POSITION_TOP, or + PL_POSITION_BOTTOM are set, then use the combination of + PL_POSITION_RIGHT and PL_POSITION_TOP. If neither of + PL_POSITION_INSIDE or PL_POSITION_OUTSIDE is set, use + PL_POSITION_INSIDE. If neither of PL_POSITION_VIEWPORT or + PL_POSITION_SUBPAGE is set, use PL_POSITION_VIEWPORT. + opt (PLINT, input) : opt contains bits controlling the overall - legend. If the - PL_LEGEND_BACKGROUND bit is set, plot a (semi-transparent) background - for the legend. If the - PL_LEGEND_TEXT_LEFT bit is set, put the text area on the left of the - legend and the plotted area on the right. Otherwise, put the text - area on the right of the legend and the plotted area on the left. + legend. If the PL_LEGEND_TEXT_LEFT bit is set, put the text area + on the left of the legend and the plotted area on the right. + Otherwise, put the text area on the right of the legend and the + plotted area on the left. If the PL_LEGEND_BACKGROUND bit is set, + plot a (semi-transparent) background for the legend. If the + PL_LEGEND_BOUNDING_BOX bit is set, plot a bounding box for the + legend. If the PL_LEGEND_ROW_MAJOR bit is set and (both of the + possibly internally transformed) nrow > 1 and ncolumn > 1, then + plot the resulting array of legend entries in row-major order. + Otherwise, plot the legend entries in column-major order. - x (PLFLT, input) : Normalized sub-page X position of the upper-left - corner of the legend. + x (PLFLT, input) : X offset of the legend position in adopted + coordinates from the specified standard position of the legend. + For positive x, the direction of motion away from the standard + position is inward/outward from the standard corner positions or + standard left or right positions if the + PL_POSITION_INSIDE/PL_POSITION_OUTSIDE bit is set in position. + For the standard top or bottom positions, the direction of motion + is toward positive X. - y (PLFLT, input) : Normalized sub-page Y position of the upper-left - corner of the legend. + y (PLFLT, input) : Y offset of the legend position in adopted + coordinates from the specified standard position of the legend. + For positive y, the direction of motion away from the standard + position is inward/outward from the standard corner positions or + standard top or bottom positions if the + PL_POSITION_INSIDE/PL_POSITION_OUTSIDE bit is set in position. + For the standard left or right positions, the direction of motion + is toward positive Y. - plot_width (PLFLT, input) : Horizontal width in normalized subpage - units of the plot area (where the rectangular boxes, lines, and/or - lines of symbols are drawn) of the legend. N.B. The total - horizontal width of the legend in normalized subpage coordinates - is calculated internally from - plot_width, - text_offset (see below), and length (calculated internally) of the - longest text string. + plot_width (PLFLT, input) : Horizontal width in adopted coordinates + of the plot area (where the colored boxes, lines, and/or lines of + symbols are drawn) of the legend. bg_color (PLINT, input) : The cmap0 index of the background color - for the legend ( - PL_LEGEND_BACKGROUND). + for the legend (PL_LEGEND_BACKGROUND). + bb_color (PLINT, input) : The cmap0 index of the color of the + bounding-box line for the legend (PL_LEGEND_BOUNDING_BOX). + + bb_style (PLINT, input) : The cmap0 index of the background color + for the legend (PL_LEGEND_BACKGROUND). + + nrow (PLINT, input) : The cmap0 index of the background color for + the legend (PL_LEGEND_BACKGROUND). + + ncolumn (PLINT, input) : The cmap0 index of the background color + for the legend (PL_LEGEND_BACKGROUND). + nlegend (PLINT, input) : Number of legend entries. N.B. The total - vertical height of the legend in normalized subpage coordinates is - calculated internally from - nlegend, - text_scale (see below), and - text_spacing (see below). + vertical height of the legend in adopted coordinates is calculated + internally from nlegend, text_scale (see below), and text_spacing + (see below). opt_array (const PLINT *, input) : Array of nlegend values of options to control each individual plotted area corresponding to a @@ -2434,23 +2493,23 @@ text_offset (PLFLT, input) : Offset of the text area from the plot area in units of character width. N.B. The total horizontal - width of the legend in normalized subpage coordinates is - calculated internally from + width of the legend in adopted coordinates is calculated + internally from plot_width (see above), text_offset, and length (calculated internally) of the longest text string. text_scale (PLFLT, input) : Character height scale for text annotations. N.B. The total vertical height of the legend in - normalized subpage coordinates is calculated internally from + adopted coordinates is calculated internally from nlegend (see above), text_scale, and text_spacing (see below). text_spacing (PLFLT, input) : Vertical spacing in units of the character height from one legend entry to the next. N.B. The - total vertical height of the legend in normalized subpage - coordinates is calculated internally from + total vertical height of the legend in adopted coordinates is + calculated internally from nlegend (see above), text_scale (see above), and text_spacing. @@ -2480,6 +2539,11 @@ colored boxes ( PL_LEGEND_COLOR_BOX). + box_line_widths (const PLINT *, input) : Array of nlegend scales + (units of fraction of character height) for the height of the + discrete colored boxes ( + PL_LEGEND_COLOR_BOX). + line_colors (const PLINT *, input) : Array of nlegend line colors (cmap0 indices) ( PL_LEGEND_LINE). @@ -2503,7 +2567,7 @@ symbols to be drawn across the width of the plotted area ( PL_LEGEND_SYMBOL). - symbols (const PLINT *, input) : Array of nlegend symbols (plpoin + symbols (const char **, input) : Array of nlegend symbols (plpoin indices) ( PL_LEGEND_SYMBOL). ") @@ -3101,7 +3165,6 @@ Does not show \"invisible\" options in usage or help messages. Assumes the program name is contained in argv[0]. - These behaviors may be controlled through the mode argument. @@ -3216,17 +3279,24 @@ ") plpath; -%feature( "docstring", "Plots a character at the specified points +%feature( "docstring", "Plot a glyph at the specified points DESCRIPTION: - Marks a set of n points in x and y using the symbol defined by code. - If code is between 32 and 127, the symbol is simply the corresponding - printable ASCII character in the default font. + Plot a glyph at the specified points. (This function is largely + superseded by plstring which gives access to many[!] more glyphs.) + code=-1 means try to just draw a point. Right now it's just a move + and a draw at the same place. Not ideal, since a sufficiently + intelligent output device may optimize it away, or there may be faster + ways of doing it. This is OK for now, though, and offers a 4X speedup + over drawing a Hershey font \"point\" (which is actually diamond shaped + and therefore takes 4 strokes to draw). If 0 < code < 32, then a + useful (but small subset) of Hershey symbols is plotted. If 32 <= + code <= 127 the corresponding printable ASCII character is plotted. Redacted form: plpoin(x, y, code) - This function is used in examples 1,6,14,18,21,29. + This function is used in examples 1,6,14,29. @@ -3236,30 +3306,39 @@ ARGUMENTS: - n (PLINT, input) : Number of points to be marked. + n (PLINT, input) : Number of points in the x and y arrays. - x (PLFLT *, input) : Pointer to array with x coordinates of the + x (PLFLT *, input) : Pointer to an array with X coordinates of points. - y (PLFLT *, input) : Pointer to array with y coordinates of the + y (PLFLT *, input) : Pointer to an array with Y coordinates of points. - code (PLINT, input) : Code number for the symbol to be plotted. + code (PLINT, input) : Hershey symbol code (in \"ascii-indexed\" form + with -1 <= code <= 127) corresponding to a glyph to be plotted at + each of the n points. ") plpoin; -%feature( "docstring", " Plots a character at the specified points in 3 space +%feature( "docstring", "Plot a glyph at the specified 3D points DESCRIPTION: - Marks a set of n points in x, y, and z using the symbol defined by - code. If code is between 32 and 127, the symbol is simply the - corresponding printable ASCII character in the default font. Setup - similar to plline3. + Plot a glyph at the specified 3D points. (This function is largely + superseded by plstring3 which gives access to many[!] more glyphs.) + Set up the call to this function similar to what is done for plline3. + code=-1 means try to just draw a point. Right now it's just a move + and a draw at the same place. Not ideal, since a sufficiently + intelligent output device may optimize it away, or there may be faster + ways of doing it. This is OK for now, though, and offers a 4X speedup + over drawing a Hershey font \"point\" (which is actually diamond shaped + and therefore takes 4 strokes to draw). If 0 < code < 32, then a + useful (but small subset) of Hershey symbols is plotted. If 32 <= + code <= 127 the corresponding printable ASCII character is plotted. Redacted form: plpoin3(x, y, z, code) - This function is used in example 18. + This function is not used in any example. @@ -3269,18 +3348,20 @@ ARGUMENTS: - n (PLINT, input) : Number of points to be marked. + n (PLINT, input) : Number of points in the x and y arrays. - x (PLFLT *, input) : Pointer to array with x coordinates of the + x (PLFLT *, input) : Pointer to an array with X coordinates of points. - y (PLFLT *, input) : Pointer to array with y coordinates of the + y (PLFLT *, input) : Pointer to an array with Y coordinates of points. - z (PLFLT *, input) : Pointer to array with z coordinates of the + z (PLFLT *, input) : Pointer to an array with Z coordinates of points. - code (PLINT, input) : Code number for the symbol to be plotted. + code (PLINT, input) : Hershey symbol code (in \"ascii-indexed\" form + with -1 <= code <= 127) corresponding to a glyph to be plotted at + each of the n points. ") plpoin3; @@ -3373,7 +3454,7 @@ DESCRIPTION: Select one of eight predefined area fill patterns to use (also see - plpat). + plpat). Setting the fill style to 0 gives a solid fill. Redacted form: plpsty(n) @@ -3813,7 +3894,7 @@ time. The idea here is to specify a number of control points that define the - mapping between palette 1 input positions (intensities) and HLS (or + mapping between palette 1 input positions (intensities) and HLS (or RGB). Between these points, linear interpolation is used which gives a smooth variation of color with input position. Any number of control points may be specified, located at arbitrary positions, @@ -3833,17 +3914,28 @@ three coordinates in HLS or RGB space. The first point must correspond to position = 0, and the last to position = 1. - The hue is interpolated around the \"front\" of the color wheel - (red<->green<->blue<->red) unless the \"rev\" flag is set to true, in - which case interpolation (between the i and i + 1 control point for - rev[i]) proceeds around the back (reverse) side. Specifying rev=NULL - is equivalent to setting rev[]= false for every control point. + The default behaviour is for the hue to be linearly interpolated + between the control points. Since the hue lies in the range [0, 360] + this corresponds to interpolation around the \"front\" of the color + wheel (red<->green<->blue<->red). If alt_hue_path[i] is true, then an + alternative interpolation is used between control points i and i+1. If + hue[i+1]-hue[i] > 0 then interpolation is between hue[i] and + hue[i+1] - 360, otherwise between hue[i] and hue[i+1] + 360. You can + consider this as interpolation around the \"back\" or \"reverse\" of the + color wheel. Specifying alt_hue_path=NULL is equivalent to setting + alt_hue_path[] = false for every control point. + Examples of interpolation Huealt_hue_pathcolor scheme[120 + 240]falsegreen-cyan-blue[240 120]falseblue-cyan-green[120 + 240]truegreen-yellow-red-magenta-blue[240 + 120]trueblue-magenta-red-yellow-green + Bounds on coordinatesRGBR[0, 1]magnitudeRGBG[0, 1]magnitudeRGBB[0, 1]magnitudeHLShue[0, 360]degreesHLSlightness[0, 1]magnitudeHLSsaturation[0, 1]magnitude - Redacted form: plscmap1l(itype, pos, coord1, coord2, coord3, rev) + Redacted form: plscmap1l(itype, pos, coord1, coord2, coord3, + alt_hue_path) This function is used in examples 8,11,12,15,20,21. @@ -3851,7 +3943,7 @@ SYNOPSIS: -plscmap1l(itype, npts, pos, coord1, coord2, coord3, rev) +plscmap1l(itype, npts, pos, coord1, coord2, coord3, alt_hue_path) ARGUMENTS: @@ -3871,9 +3963,9 @@ coord3 (PLFLT *, input) : third coordinate (S or B) for each control point - rev (PLBOOL: *, input) : reverse flag for each control point. - (rev[i] refers to the interpolation interval between the i and i + - 1 control points). + alt_hue_path (PLBOOL: *, input) : alternative interpolation method + flag for each control point. (alt_hue_path[i] refers to the + interpolation interval between the i and i + 1 control points). ") plscmap1l; @@ -3893,7 +3985,7 @@ SYNOPSIS: -plscmap1la(itype, npts, pos, coord1, coord2, coord3, coord4, rev) +plscmap1la(itype, npts, pos, coord1, coord2, coord3, coord4, alt_hue_path) ARGUMENTS: @@ -3916,9 +4008,9 @@ coord4 (PLFLT *, input) : fourth coordinate, the alpha value for each control point - rev (PLBOOL: *, input) : reverse flag for each control point. - (rev[i] refers to the interpolation interval between the i and i + - 1 control points). + alt_hue_path (PLBOOL: *, input) : alternative interpolation method + flag for each control point. (alt_hue_path[i] refers to the + interpolation interval between the i and i + 1 control points). ") plscmap1la; @@ -4797,7 +4889,10 @@ shade_max (PLFLT, input) : Defines the upper end of the interval to be shaded. If shade_max <= shade_min, plshade1 does nothing. - sh_cmap (PLINT, input) : Defines color map. + sh_cmap (PLINT, input) : Defines color map. If sh_cmap=0, then + sh_color is interpreted as a color map 0 (integer) index. If + sh_cmap=1, then sh_color is interpreted as a color map 1 + floating-point index which ranges from 0. to 1. sh_color (PLFLT, input) : Defines color map index if cmap0 or color map input value (ranging from 0. to 1.) if cmap1. @@ -5060,7 +5155,7 @@ Redacted form: plspage(xp, yp, xleng, yleng, xoff, yoff) - This function is used in example 31. + This function is used in examples 14 and 31. @@ -5336,6 +5431,88 @@ ") plstransform; +%feature( "docstring", "Plot a glyph at the specified points + +DESCRIPTION: + + Plot a glyph at the specified points. (Supersedes plpoin and plsym + because many[!] more glyphs are accessible with plstring.) The glyph + is specified with a PLplot user string. Note that the user string is + not actually limited to one glyph so it is possible (but not normally + useful) to plot more than one glyph at the specified points with this + function. As with plmtex and plptex, the user string can contain FCI + escapes to determine the font, UTF-8 code to determine the glyph or + else PLplot escapes for Hershey or unicode text to determine the + glyph. + + Redacted form: plstring(x, y, string) + + This function is used in examples 4, 21 and 26. + + + +SYNOPSIS: + +plstring(n, x, y, string) + +ARGUMENTS: + + n (PLINT, input) : Number of points in the x and y arrays. + + x (PLFLT *, input) : Pointer to an array with X coordinates of + points. + + y (PLFLT *, input) : Pointer to an array with Y coordinates of + points. + + string (const char *, input) : PLplot user string corresponding to + the glyph to be plotted at each of the n points. +") +plstring; + +%feature( "docstring", "Plot a glyph at the specified 3D points + +DESCRIPTION: + + Plot a glyph at the specified 3D points. (Supersedes plpoin3 because + many[!] more glyphs are accessible with plstring3.) Set up the call to + this function similar to what is done for plline3. The glyph is + specified with a PLplot user string. Note that the user string is not + actually limited to one glyph so it is possible (but not normally + useful) to plot more than one glyph at the specified points with this + function. As with plmtex and plptex, the user string can contain FCI + escapes to determine the font, UTF-8 code to determine the glyph or + else PLplot escapes for Hershey or unicode text to determine the + glyph. + + Redacted form: plstring3(x, y, z, string) + + This function is used in example 18. + + + +SYNOPSIS: + +plstring3(n, x, y, z, string) + +ARGUMENTS: + + n (PLINT, input) : Number of points in the x, y, and z arrays. + + x (PLFLT *, input) : Pointer to an array with X coordinates of + points. + + y (PLFLT *, input) : Pointer to an array with Y coordinates of + points. + + z (PLFLT *, input) : Pointer to an array with Z coordinates of + points. + + string (const char *, input) : PLplot user string corresponding to + the glyph to be plotted at each of the n points. +") +plstring3; + %feature( "docstring", "Add a point to a stripchart DESCRIPTION: @@ -5776,14 +5953,12 @@ ") plsyax; -%feature( "docstring", "Plots a symbol at the specified points +%feature( "docstring", "Plot a glyph at the specified points DESCRIPTION: - Marks out a set of n points at positions ( - x[i], - y[i]), using the symbol defined by code. The code is interpreted as - an index in the Hershey font tables. + Plot a glyph at the specified points. (This function is largely + superseded by plstring which gives access to many[!] more glyphs.) Redacted form: plsym(x, y, code) @@ -5797,15 +5972,16 @@ ARGUMENTS: - n (PLINT, input) : Number of points to be marked. + n (PLINT, input) : Number of points in the x and y arrays. - x (PLFLT *, input) : Pointer to array with set of x coordinate - values for the points. + x (PLFLT *, input) : Pointer to an array with X coordinates of + points. - y (PLFLT *, input) : Pointer to array with set of y coordinate - values for the points. + y (PLFLT *, input) : Pointer to an array with Y coordinates of + points. - code (PLINT, input) : Code number for the symbol to be plotted. + code (PLINT, input) : Hershey symbol code corresponding to a glyph + to be plotted at each of the n points. ") plsym; @@ -6150,7 +6326,7 @@ Sets the pen width. - Redacted form: plwid(width) + Redacted form: plwidth(width) This function is used in examples 1,2. @@ -6158,7 +6334,7 @@ SYNOPSIS: -plwid(width) +plwidth(width) ARGUMENTS: @@ -6168,7 +6344,7 @@ device. The interpretation of positive width values is also device dependent. ") -plwid; +plwidth; %feature( "docstring", "Specify world coordinates of viewport boundaries This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-06-12 20:55:07
|
Revision: 12381 http://sourceforge.net/p/plplot/code/12381 Author: andrewross Date: 2013-06-12 20:55:04 +0000 (Wed, 12 Jun 2013) Log Message: ----------- Style recent changes. Modified Paths: -------------- trunk/bindings/f95/scstubs.c trunk/bindings/lua/plplotluac.i Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2013-06-12 20:53:18 UTC (rev 12380) +++ trunk/bindings/f95/scstubs.c 2013-06-12 20:55:04 UTC (rev 12381) @@ -74,16 +74,16 @@ void PLCLEAR( void ); void PLCOL0( PLINT *icol ); void PLCOL1( PLFLT *col ); -void PLCOLORBAR(PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, - PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, - PLFLT *x_length, PLFLT *y_length, - PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, - PLFLT *low_cap_color, PLFLT *high_cap_color, - PLINT *cont_color, PLFLT *cont_width, - PLINT *n_labels, const PLINT *label_opts, - PLINT *n_axes, - const PLFLT *ticks, const PLINT *sub_ticks, - const PLINT *n_values, const PLFLT *values); +void PLCOLORBAR( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, + PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, + PLFLT *x_length, PLFLT *y_length, + PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, + PLFLT *low_cap_color, PLFLT *high_cap_color, + PLINT *cont_color, PLFLT *cont_width, + PLINT *n_labels, const PLINT *label_opts, + PLINT *n_axes, + const PLFLT *ticks, const PLINT *sub_ticks, + const PLINT *n_values, const PLFLT *values ); 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 ); void PLCPSTRM( PLINT *iplsr, PLBOOL *flags ); void PLCTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime ); @@ -398,49 +398,49 @@ void PLCOLORBAR( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, - PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, - PLFLT *x_length, PLFLT *y_length, - PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, - PLFLT *low_cap_color, PLFLT *high_cap_color, - PLINT *cont_color, PLFLT *cont_width, - PLINT *n_labels, const PLINT *label_opts, - PLINT *n_axes, - const PLFLT *ticks, const PLINT *sub_ticks, - const PLINT *n_values, const PLFLT *values ) + PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, + PLFLT *x_length, PLFLT *y_length, + PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, + PLFLT *low_cap_color, PLFLT *high_cap_color, + PLINT *cont_color, PLFLT *cont_width, + PLINT *n_labels, const PLINT *label_opts, + PLINT *n_axes, + const PLFLT *ticks, const PLINT *sub_ticks, + const PLINT *n_values, const PLFLT *values ) { // Need to allocate 2d C array for values PLFLT **a; - int i,j; - - a = (PLFLT **) malloc( sizeof(PLFLT *) * (*n_axes) ); - for (i=0;i<*n_axes;i++) + int i, j; + + a = (PLFLT **) malloc( sizeof ( PLFLT * ) * ( *n_axes ) ); + for ( i = 0; i < *n_axes; i++ ) { - a[i] = (PLFLT *) malloc( sizeof(PLFLT)*n_values[i] ); - for (j=0;j<n_values[i];j++) - { - a[i][j] = values[i + j * (*n_axes)]; - } + a[i] = (PLFLT *) malloc( sizeof ( PLFLT ) * n_values[i] ); + for ( j = 0; j < n_values[i]; j++ ) + { + a[i][j] = values[i + j * ( *n_axes )]; + } } - c_plcolorbar(p_colorbar_width, p_colorbar_height, - *opt, *position, *x, *y, - *x_length, *y_length, - *bg_color, *bb_color, *bb_style, - *low_cap_color, *high_cap_color, - *cont_color, *cont_width, - *n_labels, label_opts, (const char * const *) plcolorbar_labels, - *n_axes, (const char * const *) plcolorbar_axisopts, - ticks, sub_ticks, - n_values, (const PLFLT * const *)a); + c_plcolorbar( p_colorbar_width, p_colorbar_height, + *opt, *position, *x, *y, + *x_length, *y_length, + *bg_color, *bb_color, *bb_style, + *low_cap_color, *high_cap_color, + *cont_color, *cont_width, + *n_labels, label_opts, (const char * const *) plcolorbar_labels, + *n_axes, (const char * const *) plcolorbar_axisopts, + ticks, sub_ticks, + n_values, (const PLFLT * const *) a ); free( *plcolorbar_labels ); free( plcolorbar_labels ); free( *plcolorbar_axisopts ); free( plcolorbar_axisopts ); - for (i=0;i<*n_axes;i++) + for ( i = 0; i < *n_axes; i++ ) { - free(a[i]); + free( a[i] ); } - free(a); + free( a ); } void @@ -861,24 +861,25 @@ p_string[j][i + 1] = '\0'; } - switch( *id ) { + switch ( *id ) + { case 1: - pllegend_text = p_string; - break; + pllegend_text = p_string; + break; case 2: - pllegend_symbols = p_string; - break; + pllegend_symbols = p_string; + break; case 3: - plcolorbar_labels = p_string; - break; + plcolorbar_labels = p_string; + break; case 4: - plcolorbar_axisopts = p_string; - break; + plcolorbar_axisopts = p_string; + break; default: - // Unknown - free(data); - free(p_string); - break; + // Unknown + free( data ); + free( p_string ); + break; } } Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2013-06-12 20:53:18 UTC (rev 12380) +++ trunk/bindings/lua/plplotluac.i 2013-06-12 20:55:04 UTC (rev 12381) @@ -238,7 +238,7 @@ $1 = (PLINT *) LUA_get_int_num_array_var( L, $input, &temp ); if ( !$1 ) SWIG_fail; - if (temp != Alen) + if ( temp != Alen ) { lua_pushfstring( L, "Tables must be of same length." ); SWIG_fail; @@ -247,8 +247,8 @@ Xlen = temp; Ylen = -1; for ( i = 0; i < Xlen; i++ ) - if ( $1[i] > Ylen ) Ylen = $1[i]; - + if ( $1[i] > Ylen ) + Ylen = $1[i]; } %typemap( freearg ) ( const PLINT * ArrayN ) { @@ -1268,7 +1268,7 @@ %typemap( in ) ( PLINT n, const char **Array ) { int i; - $1 = SWIG_table_size( L, $input ); + $1 = SWIG_table_size( L, $input ); Alen = $1; $2 = malloc( sizeof ( char* ) * Alen ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-11-05 14:23:10
|
Revision: 12656 http://sourceforge.net/p/plplot/code/12656 Author: andrewross Date: 2013-11-05 14:23:03 +0000 (Tue, 05 Nov 2013) Log Message: ----------- Add plpath to C++, and all swig-generated bindings. Modified Paths: -------------- trunk/bindings/c++/plstream.cc trunk/bindings/c++/plstream.h trunk/bindings/swig-support/plplotcapi.i Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2013-11-05 14:21:38 UTC (rev 12655) +++ trunk/bindings/c++/plstream.cc 2013-11-05 14:23:03 UTC (rev 12656) @@ -1232,6 +1232,15 @@ plpat( nlin, inc, del ); } +// Draw a line connecting two points, accounting for coordinate transforms + +void plstream::path( PLINT n, PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2 ) +{ + set_stream(); + + plpath( n, x1, y1, x2, y2 ); +} + // Plots array y against x for n points using ASCII code "code". void plstream::poin( PLINT n, const PLFLT *x, const PLFLT *y, PLINT code ) Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2013-11-05 14:21:38 UTC (rev 12655) +++ trunk/bindings/c++/plstream.h 2013-11-05 14:23:03 UTC (rev 12656) @@ -547,6 +547,10 @@ void pat( PLINT nlin, const PLINT *inc, const PLINT *del ); +// Draw a line connecting two points, accounting for coordinate transforms + + void path( PLINT n, PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2 ); + // Plots array y against x for n points using ASCII code "code". void poin( PLINT n, const PLFLT *x, const PLFLT *y, PLINT code ); Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2013-11-05 14:21:38 UTC (rev 12655) +++ trunk/bindings/swig-support/plplotcapi.i 2013-11-05 14:23:03 UTC (rev 12656) @@ -553,6 +553,9 @@ plpat( PLINT n, const PLINT *Array, const PLINT *ArrayCk ); void +plpath( PLINT n, PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2 ); + +void plpoin( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, PLINT code ); void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-13 23:53:48
|
Revision: 12695 http://sourceforge.net/p/plplot/code/12695 Author: airwin Date: 2013-11-13 23:53:45 +0000 (Wed, 13 Nov 2013) Log Message: ----------- Make Tcl constants in the PLPLOT namespace properly accessible from all environments including tclsh and wish. Modified Paths: -------------- trunk/bindings/tcl/tclAPI.c trunk/bindings/tk/plserver.c Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2013-11-13 22:53:37 UTC (rev 12694) +++ trunk/bindings/tcl/tclAPI.c 2013-11-13 23:53:45 UTC (rev 12695) @@ -386,7 +386,7 @@ //-------------------------------------------------------------------------- // PlbasicInit // -// Used by both Pltcl and Pltk. Ensures we have been correctly loaded +// Used by Pltcl_Init, Pltk_Init(.c), and Plplotter_Init(.c). Ensures we have been correctly loaded // into a Tcl/Tk interpreter, that the plplot.tcl startup file can be // found and sourced, and that the Matrix library can be found and used, // and that it correctly exports a stub table. @@ -593,6 +593,9 @@ Tcl_CreateCommand( interp, "wait_until", (Tcl_CmdProc *) plWait_Until, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL ); +// Define the flags as variables in the PLPLOT namespace + set_plplot_parameters( interp ); + return TCL_OK; } @@ -630,10 +633,6 @@ (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 Modified: trunk/bindings/tk/plserver.c =================================================================== --- trunk/bindings/tk/plserver.c 2013-11-13 22:53:37 UTC (rev 12694) +++ trunk/bindings/tk/plserver.c 2013-11-13 23:53:45 UTC (rev 12695) @@ -38,7 +38,6 @@ #define NEED_PLDEBUG #include "plserver.h" -#include "plplot_parameters.h" // Application-specific command-line options // Variable declarations @@ -235,10 +234,6 @@ Tcl_CreateCommand( interp, "exit", (Tcl_CmdProc *) plExitCmd, (ClientData) mainWindow, (Tcl_CmdDeleteProc *) NULL ); -// Define the flags as variables in the PLPLOT namespace - - set_plplot_parameters( interp ); - return TCL_OK; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-17 00:45:38
|
Revision: 12709 http://sourceforge.net/p/plplot/code/12709 Author: airwin Date: 2013-11-17 00:45:35 +0000 (Sun, 17 Nov 2013) Log Message: ----------- Make Tcl logic much more robust for discovering whether the path to the relevant pkgIndex.tcl file is a subdirectory of the build tree. This fixes an issue with the old logic which was based on whether the current directory was a subdirectory of the build tree. That old logic obviously failed for the common case when the build tree for the installed examples was actually a subdirectory of the core build tree. The new logic is independent of the current directory which is a good thing. Modified Paths: -------------- trunk/bindings/tcl/pkgIndex.tcl.in trunk/bindings/tk/pkgIndex.tcl.in trunk/bindings/tk-x-plat/pkgIndex.tcl.in Modified: trunk/bindings/tcl/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tcl/pkgIndex.tcl.in 2013-11-16 22:21:59 UTC (rev 12708) +++ trunk/bindings/tcl/pkgIndex.tcl.in 2013-11-17 00:45:35 UTC (rev 12709) @@ -34,9 +34,14 @@ if {$tcl_platform(platform) == "unix"} { set thisDir [pwd] + # Find absolute path of $dir + cd $dir + set pkgIndexDir [pwd] + cd $thisDir set buildDir "@BUILD_DIR@" set bLen [string length $buildDir] - if {![string compare -length $bLen $buildDir $thisDir]} then { + # If pkgIndexDir is in the build tree... + if {![string compare -length $bLen $buildDir $pkgIndexDir]} then { set searchdirs "."} else { set searchdirs [list "@LIB_HARDDIR@"]} #puts $searchdirs Modified: trunk/bindings/tk/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tk/pkgIndex.tcl.in 2013-11-16 22:21:59 UTC (rev 12708) +++ trunk/bindings/tk/pkgIndex.tcl.in 2013-11-17 00:45:35 UTC (rev 12709) @@ -35,9 +35,14 @@ if {$tcl_platform(platform) == "unix"} { set stem tk set thisDir [pwd] + # Find absolute path of $dir + cd $dir + set pkgIndexDir [pwd] + cd $thisDir set buildDir "@BUILD_DIR@" set bLen [string length $buildDir] - if {![string compare -length $bLen $buildDir $thisDir]} then { + # If pkgIndexDir is in the build tree... + if {![string compare -length $bLen $buildDir $pkgIndexDir]} then { set searchdirs "../../drivers"} else { set searchdirs [list "@DRV_HARDDIR@"]} #puts $searchdirs Modified: trunk/bindings/tk-x-plat/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tk-x-plat/pkgIndex.tcl.in 2013-11-16 22:21:59 UTC (rev 12708) +++ trunk/bindings/tk-x-plat/pkgIndex.tcl.in 2013-11-17 00:45:35 UTC (rev 12709) @@ -35,9 +35,14 @@ if {$tcl_platform(platform) == "unix"} { set stem tkwin set thisDir [pwd] + # Find absolute path of $dir + cd $dir + set pkgIndexDir [pwd] + cd $thisDir set buildDir "@BUILD_DIR@" set bLen [string length $buildDir] - if {![string compare -length $bLen $buildDir $thisDir]} then { + # If pkgIndexDir is in the build tree... + if {![string compare -length $bLen $buildDir $pkgIndexDir]} then { set searchdirs "../../drivers"} else { set searchdirs [list "@DRV_HARDDIR@"]} #puts $searchdirs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-28 06:00:50
|
Revision: 12773 http://sourceforge.net/p/plplot/code/12773 Author: airwin Date: 2013-11-28 06:00:42 +0000 (Thu, 28 Nov 2013) Log Message: ----------- Document and rearrange order of initializing members of plPlotterPtr and plFramePtr structures in same order as the members of the structures are defined to help keep track of what is initialized and what not. There is no change in initialization of plFramePtr, but this analysis showed that both plPlotterPtr->double_buffer and plPlotterPtr->pldis (and several other members which were also not initialized in the working plFramePtr case) were unitialized. The double_buffer initialization quiets a valgrind warning about an uninitialized variable. The pldis initialization may not be necessary (because valgrind did not complain about it), but it does follow what is done in the plFramePtr case. These plPlotterPtr initialization changes made no difference to the erratic on-again off-again issue with test_wish_runAllDemos where sometimes the examples run at the touch of the button consistently for one particular compilation of plplotter.c, and other times they error out consistently for a different compilation of plplotter.c with messages like invalid command name "x00" So it appears some other issue is the source of the complete change in behaviour of the plplotter Tcl/Tk extension package from one compilation of plplotter.c to the next. Modified Paths: -------------- trunk/bindings/tk/plframe.c trunk/bindings/tk-x-plat/plplotter.c Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2013-11-27 20:22:18 UTC (rev 12772) +++ trunk/bindings/tk/plframe.c 2013-11-28 06:00:42 UTC (rev 12773) @@ -383,43 +383,58 @@ } plFramePtr = (PlFrame *) ckalloc( sizeof ( PlFrame ) ); + + // Initialize in the same order as the members of the struct just + // to keep track of what is initialized and what not. + plFramePtr->tkwin = new; plFramePtr->display = Tk_Display( new ); plFramePtr->interp = interp; - plFramePtr->xorGC = NULL; + //plFramePtr->widgetCMD = <initialized below for HAVE_ITCL case> plFramePtr->border = NULL; + //plFramePtr->borderWidth = <uninitialized> + //plFramePtr->relief = <uninitialized> + plFramePtr->width = Tk_Width( plFramePtr->tkwin ); + plFramePtr->height = Tk_Height( plFramePtr->tkwin ); plFramePtr->cursor = None; - plFramePtr->xhair_cursor = None; plFramePtr->flags = 0; - plFramePtr->width = Tk_Width( plFramePtr->tkwin ); - plFramePtr->height = Tk_Height( plFramePtr->tkwin ); + plFramePtr->tkwin_initted = 0; + // Associate new PLplot stream with this widget + plmkstrm( &plFramePtr->ipls ); + plgpls( &plFramePtr->pls ); + plFramePtr->ipls_save = 0; + plFramePtr->plr = (PLRDev *) ckalloc( sizeof ( PLRDev ) ); + plFramePtr->bgColor = NULL; + plFramePtr->plpr_cmd = NULL; + plFramePtr->pldis.x = 0; + plFramePtr->pldis.y = 0; + plFramePtr->pldis.width = 0; + plFramePtr->pldis.height = 0; plFramePtr->prevWidth = 0; plFramePtr->prevHeight = 0; + plFramePtr->SaveFnam = NULL; + // plFramePtr->devDesc = <uninitialized, to be malloced?>; + // plFramePtr->devName = <uninitialized, to be malloced?>; + plFramePtr->xorGC = NULL; + // plFram Ptr->pts = <uninitialized array>; plFramePtr->continue_draw = 0; - plFramePtr->ipls = 0; - plFramePtr->ipls_save = 0; - plFramePtr->tkwin_initted = 0; - plFramePtr->bgColor = NULL; - plFramePtr->plpr_cmd = NULL; + plFramePtr->xhair_cursor = None; + plFramePtr->xl = 0.; + plFramePtr->yl = 0.; + plFramePtr->xr = 1.; + plFramePtr->yr = 1.; + plFramePtr->xScrollCmd = NULL; + plFramePtr->yScrollCmd = NULL; plFramePtr->bopCmd = NULL; plFramePtr->eopCmd = NULL; plFramePtr->xhairs = 0; plFramePtr->drawing_xhairs = 0; + // plFram Ptr->xhair_x = <uninitialized array>; + // plFram Ptr->xhair_y = <uninitialized array>; plFramePtr->rband = 0; plFramePtr->drawing_rband = 0; - plFramePtr->xScrollCmd = NULL; - plFramePtr->yScrollCmd = NULL; - plFramePtr->xl = 0.; - plFramePtr->yl = 0.; - plFramePtr->xr = 1.; - plFramePtr->yr = 1.; - plFramePtr->SaveFnam = NULL; - plFramePtr->pldis.x = 0; - plFramePtr->pldis.y = 0; - plFramePtr->pldis.width = 0; - plFramePtr->pldis.height = 0; + // plFram Ptr->rband_pt = <uninitialized array>; - plFramePtr->plr = (PLRDev *) ckalloc( sizeof ( PLRDev ) ); plr = plFramePtr->plr; plr->pdfs = NULL; plr->at_bop = 0; @@ -427,11 +442,6 @@ plr->iodev = (PLiodev *) ckalloc( sizeof ( PLiodev ) ); plr_start( plr ); -// Associate new PLplot stream with this widget - - plmkstrm( &plFramePtr->ipls ); - plgpls( &plFramePtr->pls ); - // Set up stuff for rubber-band drawing plFramePtr->xhair_cursor = Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2013-11-27 20:22:18 UTC (rev 12772) +++ trunk/bindings/tk-x-plat/plplotter.c 2013-11-28 06:00:42 UTC (rev 12773) @@ -372,6 +372,9 @@ Tk_SetClass( tkwin, "Plframe" ); plPlotterPtr = (PlPlotter *) malloc( sizeof ( PlPlotter ) ); + + // Initialize in the same order as the members of the struct just + // to keep track of what is initialized and what not. plPlotterPtr->tkwin = tkwin; plPlotterPtr->display = Tk_Display( tkwin ); plPlotterPtr->interp = interp; @@ -379,46 +382,57 @@ Tcl_CreateCommand( interp, Tk_PathName( plPlotterPtr->tkwin ), (Tcl_CmdProc *) PlPlotterWidgetCmd, (ClientData) plPlotterPtr, (Tcl_CmdDeleteProc *) NULL ); - plPlotterPtr->xorGC = NULL; plPlotterPtr->border = NULL; + //plPlotterPtr->borderWidth = <uninitialized>; + //plPlotterPtr->relief = <uninitialized>; + plPlotterPtr->width = Tk_Width( plPlotterPtr->tkwin ); + plPlotterPtr->height = Tk_Height( plPlotterPtr->tkwin ); plPlotterPtr->cursor = None; - plPlotterPtr->xhair_cursor = None; plPlotterPtr->flags = 0; - plPlotterPtr->width = Tk_Width( plPlotterPtr->tkwin ); - plPlotterPtr->height = Tk_Height( plPlotterPtr->tkwin ); + plPlotterPtr->tkwin_initted = 0; + // Associate new PLplot stream with this widget + plmkstrm( &plPlotterPtr->ipls ); + plgpls( &plPlotterPtr->pls ); + plPlotterPtr->ipls_save = 0; + plPlotterPtr->plr = (PLRDev *) malloc( sizeof ( PLRDev ) ); + plPlotterPtr->plpr_cmd = NULL; + plPlotterPtr->active_plot = 1; + plPlotterPtr->isActive = 0; + plPlotterPtr->pldis.x = 0; + plPlotterPtr->pldis.y = 0; + plPlotterPtr->pldis.width = 0; + plPlotterPtr->pldis.height = 0; plPlotterPtr->prevWidth = 0; plPlotterPtr->prevHeight = 0; + plPlotterPtr->SaveFnam = NULL; + // plPlotterPtr->devDesc = <uninitialized, to be malloced?>; + // plPlotterPtr->devName = <uninitialized, to be malloced?>; + plPlotterPtr->xorGC = NULL; + // plPlotterPtr->pts = <uninitialized array>; plPlotterPtr->continue_draw = 0; - plPlotterPtr->ipls = 0; - plPlotterPtr->ipls_save = 0; - plPlotterPtr->tkwin_initted = 0; - plPlotterPtr->plpr_cmd = NULL; + plPlotterPtr->xhair_cursor = None; + plPlotterPtr->xl = 0.; + plPlotterPtr->yl = 0.; + plPlotterPtr->xr = 1.; + plPlotterPtr->yr = 1.; + plPlotterPtr->xScrollCmd = NULL; + plPlotterPtr->yScrollCmd = NULL; plPlotterPtr->bopCmd = NULL; plPlotterPtr->eopCmd = NULL; plPlotterPtr->xhairs = 0; - plPlotterPtr->active_plot = 1; - plPlotterPtr->isActive = 0; plPlotterPtr->drawing_xhairs = 0; + // plPlotterPtr->xhair_x = <uninitialized array>; + // plPlotterPtr->xhair_y = <uninitialized array>; plPlotterPtr->rband = 0; plPlotterPtr->drawing_rband = 0; - plPlotterPtr->xScrollCmd = NULL; - plPlotterPtr->yScrollCmd = NULL; - plPlotterPtr->xl = 0.; - plPlotterPtr->yl = 0.; - plPlotterPtr->xr = 1.; - plPlotterPtr->yr = 1.; - plPlotterPtr->SaveFnam = NULL; + // plPlotterPtr->rband_pt = <uninitialized array>; + plPlotterPtr->double_buffer = 1; - plPlotterPtr->plr = (PLRDev *) malloc( sizeof ( PLRDev ) ); plr = plPlotterPtr->plr; plr->pdfs = NULL; plr->iodev = (PLiodev *) malloc( sizeof ( PLiodev ) ); plr_start( plr ); -// Associate new PLplot stream with this widget - - plmkstrm( &plPlotterPtr->ipls ); - plgpls( &plPlotterPtr->pls ); // Tell the stream about myself plPlotterPtr->pls->plPlotterPtr = plPlotterPtr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-03-04 21:09:32
|
Revision: 13038 http://sourceforge.net/p/plplot/code/13038 Author: airwin Date: 2014-03-04 21:09:29 +0000 (Tue, 04 Mar 2014) Log Message: ----------- Propagate plot3dcl and plsurf3dcl to Octave binding for PLplot. Build tested on Linux, and I also demonstrated with interactive octave use that "help plot3dcl" and "help plsurf3dcl" give the expected (because of the Octave help string bug for UTF-8) truncated result. There were no run time tests of these functions since they are not (yet) used in any examples. Modified Paths: -------------- trunk/bindings/octave/plplot_octave.i trunk/bindings/swig-support/swig_documentation.i Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2014-03-04 20:42:19 UTC (rev 13037) +++ trunk/bindings/octave/plplot_octave.i 2014-03-04 21:09:29 UTC (rev 13038) @@ -1182,8 +1182,8 @@ } } -// %feature commands supporting swig-generated documentation for the bindings. -// Must occur before any %ignore directives or %rename directives. +//%feature commands supporting swig-generated documentation for the bindings. +// Must occur before any%ignore directives or%rename directives. %include swig_documentation.i // This test function should be removed when we are confident of our @@ -1364,7 +1364,8 @@ 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 ); + 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 ); @@ -1377,7 +1378,8 @@ 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 ); + 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 ); @@ -1454,14 +1456,14 @@ %ignore plot3dc; %rename( plot3dc ) my_plot3dc; %ignore plot3dcl; -//unimplemented:%rename(plot3dcl) my_plot3dcl; +%rename( plot3dcl ) my_plot3dcl; %{ // Plots a 3-d representation of the function z[x][y]. 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 ) + f2c( z, zz, nx, ny ); c_plot3d( x, y, (const PLFLT **) zz, nx, ny, opt, side ); } @@ -1470,9 +1472,20 @@ PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel ) { - f2c( z, zz, nx, ny ) + f2c( z, zz, nx, ny ); c_plot3dc( x, y, (const PLFLT **) zz, nx, ny, opt, clevel, nlevel ); } +// Plots a 3-d representation of the function z[x][y] with contour with y +// index limits + void my_plot3dcl( const PLFLT * x, const PLFLT * y, const PLFLT * z, + PLINT nx, PLINT ny, PLINT opt, + const PLFLT * clevel, PLINT nlevel, + PLINT indexxmin, PLINT indexxmax, const PLINT * indexymin, const PLINT * indexymax ) + { + f2c( z, zz, nx, ny ); + c_plot3dcl( x, y, (const PLFLT **) zz, nx, ny, opt, clevel, nlevel, + indexxmin, indexxmax, indexymin, indexymax ); + } %} void my_plot3d( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT *MatrixCk, @@ -1481,24 +1494,41 @@ void my_plot3dc( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT *MatrixCk, PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n ); +void my_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 ); + // plsurf3d-related wrappings: %ignore plsurf3d; %rename( plsurf3d ) my_plsurf3d; %ignore plsurf3dl; -//unimplemented:%rename(plsurf3d) my_plsurf3d; +%rename( plsurf3dl ) my_plsurf3dl; %{ 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 ) + f2c( z, zz, nx, ny ); c_plsurf3d( x, y, (const PLFLT **) zz, nx, ny, opt, clevel, nlevel ); } + + void my_plsurf3dl( const PLFLT * x, const PLFLT * y, const PLFLT * z, + PLINT nx, PLINT ny, PLINT opt, const PLFLT * clevel, PLINT nlevel, + PLINT indexxmin, PLINT indexxmax, const PLINT * indexymin, const PLINT * indexymax ) + { + f2c( z, zz, nx, ny ); + c_plsurf3dl( x, y, (const PLFLT **) zz, nx, ny, opt, clevel, nlevel, + indexxmin, indexxmax, indexymin, indexymax ); + } %} void my_plsurf3d( const PLFLT *ArrayX, const PLFLT *ArrayY, const PLFLT *MatrixCk, PLINT nx, PLINT ny, PLINT opt, const PLFLT *Array, PLINT n ); +void my_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 ); + // plshade-related wrappers. %ignore plshade; @@ -1558,7 +1588,8 @@ PLINT rectangular, const PLFLT *xg, const PLFLT *yg ) { PLcGrid2 grid2; - f2c( xg, xgg, nx, ny ); f2c( yg, ygg, nx, ny ); + 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 ); @@ -1660,7 +1691,8 @@ PLINT rectangular, const PLFLT *xg, const PLFLT *yg ) { PLcGrid2 grid2; - f2c( xg, xgg, nx, ny ); f2c( yg, ygg, nx, ny ); + 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 ); @@ -1728,7 +1760,8 @@ 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 ); + f2c( xg, xgg, nx, ny ); + f2c( yg, ygg, nx, ny ); grid2.nx = nx; grid2.ny = ny; grid2.xg = xgg; grid2.yg = ygg; f2c( u, uu, nx, ny ); @@ -1806,7 +1839,8 @@ 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 ) ); + 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 ); Modified: trunk/bindings/swig-support/swig_documentation.i =================================================================== --- trunk/bindings/swig-support/swig_documentation.i 2014-03-04 20:42:19 UTC (rev 13037) +++ trunk/bindings/swig-support/swig_documentation.i 2014-03-04 21:09:29 UTC (rev 13038) @@ -3749,7 +3749,11 @@ index in the range from indexxmin to indexxmax - 1. The dimension of indexymax is indexxmax. ") +#ifdef SWIG_OCTAVE +my_plot3dcl; +#else plot3dcl; +#endif %feature( "docstring", "Parse command-line arguments @@ -6566,7 +6570,11 @@ index in the range from indexxmin to indexxmax - 1. The dimension of indexymax is indexxmax. ") +#ifdef SWIG_OCTAVE +my_plsurf3dl; +#else plsurf3dl; +#endif %feature( "docstring", "Plot shaded 3-d surface plot This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |