Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(33) |
Jun
|
Jul
(30) |
Aug
(2) |
Sep
|
Oct
(30) |
Nov
(136) |
Dec
(59) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(255) |
Feb
(169) |
Mar
(322) |
Apr
(185) |
May
(33) |
Jun
(89) |
Jul
(47) |
Aug
(59) |
Sep
(40) |
Oct
(31) |
Nov
(74) |
Dec
(84) |
2002 |
Jan
(163) |
Feb
(78) |
Mar
(23) |
Apr
(5) |
May
(22) |
Jun
(75) |
Jul
(143) |
Aug
(48) |
Sep
(111) |
Oct
(58) |
Nov
(124) |
Dec
(278) |
2003 |
Jan
(106) |
Feb
(276) |
Mar
(354) |
Apr
(97) |
May
(14) |
Jun
(3) |
Jul
(7) |
Aug
(21) |
Sep
(83) |
Oct
(110) |
Nov
(3) |
Dec
(119) |
2004 |
Jan
(318) |
Feb
(409) |
Mar
(68) |
Apr
(23) |
May
(105) |
Jun
(147) |
Jul
(69) |
Aug
(53) |
Sep
(23) |
Oct
(14) |
Nov
(15) |
Dec
(63) |
2005 |
Jan
(146) |
Feb
(69) |
Mar
(157) |
Apr
(127) |
May
(166) |
Jun
(8) |
Jul
(5) |
Aug
(3) |
Sep
(8) |
Oct
(17) |
Nov
(29) |
Dec
(34) |
2006 |
Jan
(3) |
Feb
(4) |
Mar
(1) |
Apr
(70) |
May
(241) |
Jun
(82) |
Jul
(344) |
Aug
(196) |
Sep
(87) |
Oct
(57) |
Nov
(121) |
Dec
(86) |
2007 |
Jan
(60) |
Feb
(67) |
Mar
(102) |
Apr
(28) |
May
(13) |
Jun
(29) |
Jul
(38) |
Aug
(56) |
Sep
(91) |
Oct
(89) |
Nov
(50) |
Dec
(68) |
2008 |
Jan
(87) |
Feb
(47) |
Mar
(100) |
Apr
(34) |
May
(65) |
Jun
(54) |
Jul
(98) |
Aug
(128) |
Sep
(109) |
Oct
(141) |
Nov
(40) |
Dec
(206) |
2009 |
Jan
(176) |
Feb
(226) |
Mar
(134) |
Apr
(84) |
May
(152) |
Jun
(85) |
Jul
(91) |
Aug
(153) |
Sep
(141) |
Oct
(59) |
Nov
(87) |
Dec
(75) |
2010 |
Jan
(58) |
Feb
(41) |
Mar
(51) |
Apr
(74) |
May
(81) |
Jun
(39) |
Jul
(30) |
Aug
(43) |
Sep
(76) |
Oct
(59) |
Nov
(62) |
Dec
(52) |
2011 |
Jan
(125) |
Feb
(41) |
Mar
(96) |
Apr
(53) |
May
(21) |
Jun
(23) |
Jul
(48) |
Aug
(71) |
Sep
(37) |
Oct
(81) |
Nov
(60) |
Dec
(32) |
2012 |
Jan
(51) |
Feb
(23) |
Mar
|
Apr
(8) |
May
(2) |
Jun
|
Jul
(8) |
Aug
(25) |
Sep
(4) |
Oct
(32) |
Nov
(17) |
Dec
(2) |
2013 |
Jan
(8) |
Feb
(2) |
Mar
(9) |
Apr
(9) |
May
(37) |
Jun
(48) |
Jul
(63) |
Aug
(42) |
Sep
(59) |
Oct
(83) |
Nov
(141) |
Dec
(133) |
2014 |
Jan
(57) |
Feb
(58) |
Mar
(58) |
Apr
(25) |
May
(14) |
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
(2) |
3
(7) |
4
(3) |
5
(3) |
6
(2) |
7
(4) |
8
(2) |
9
(4) |
10
|
11
(2) |
12
(4) |
13
(13) |
14
(6) |
15
(9) |
16
(1) |
17
(7) |
18
(17) |
19
(12) |
20
(10) |
21
(2) |
22
(1) |
23
(1) |
24
(6) |
25
(17) |
26
(7) |
27
(5) |
28
(3) |
29
(3) |
30
|
31
|
|
|
|
|
|
From: <airwin@us...> - 2009-08-13 23:49:07
|
Revision: 10247 http://plplot.svn.sourceforge.net/plplot/?rev=10247&view=rev Author: airwin Date: 2009-08-13 23:48:59 +0000 (Thu, 13 Aug 2009) Log Message: ----------- To avoid contamination of all builds with qt flags, use CMake include(${QT_USE_FILE}) command only for subdirectories and conditions where it is needed rather than (implicitly) in the top-level directory. Modified Paths: -------------- trunk/bindings/qt_gui/CMakeLists.txt trunk/cmake/modules/qt.cmake trunk/drivers/CMakeLists.txt trunk/src/CMakeLists.txt Modified: trunk/bindings/qt_gui/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/CMakeLists.txt 2009-08-13 20:01:31 UTC (rev 10246) +++ trunk/bindings/qt_gui/CMakeLists.txt 2009-08-13 23:48:59 UTC (rev 10247) @@ -19,6 +19,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if(ENABLE_qt) + # Set up Qt4-based build environment. + include(${QT_USE_FILE}) + if(NOT QT_LIBRARIES) + message(FATAL_ERROR "include(${QT_USE_FILE}) failed in bindings/qt_gui subdirectory.") + endif(NOT QT_LIBRARIES) set(qt_SOURCE plqt.cpp) include_directories( ${CMAKE_SOURCE_DIR}/include @@ -46,12 +51,11 @@ else(ANY_QT_DEVICE) message(FATAL_ERROR "Internal build system inconsistency between ENABLE_qt true and ANY_QT_DEVICE false.") endif(ANY_QT_DEVICE) - #message("qt_LINK_FLAGS = ${qt_LINK_FLAGS}") target_link_libraries( plplotqt${LIB_TAG} plplot${LIB_TAG} ${MATH_LIB} - ${qt_LINK_FLAGS} + ${QT_LIBRARIES} ) # qt_RPATH set in cmake/modules/qt.cmake. This is only used for the # install-tree rpath since cmake handles the build-tree rpath @@ -91,11 +95,10 @@ FILE export_plplotqt.cmake ) - # Transform "${qt_LINK_FLAGS}" to the - # standard pkg-config form. + # Transform "${QT_LIBRARIES}" to the standard pkg-config form. pkg_config_link_flags( libplplotqt${LIB_TAG}_LINK_FLAGS - "${qt_LINK_FLAGS}" + "${QT_LIBRARIES}" ) # Configure pkg-config *.pc file corresponding to the compile and link @@ -120,7 +123,7 @@ # Also used to determine PC_LINK_FLAGS and # PC_COMPILE_FLAGS used in *.pc Libs: and Cflags: # fields. - set(PC_DATA "qt:QT:QT4 bindings, :plplotqt${LIB_TAG}") + set(PC_DATA "qt:Qt:Qt4 bindings, :plplotqt${LIB_TAG}") string(REGEX REPLACE "^(.*):.*:.*:.*$" "\\1" BINDING ${PC_DATA}) set(PC_FILE_SUFFIX "-${BINDING}") Modified: trunk/cmake/modules/qt.cmake =================================================================== --- trunk/cmake/modules/qt.cmake 2009-08-13 20:01:31 UTC (rev 10246) +++ trunk/cmake/modules/qt.cmake 2009-08-13 23:48:59 UTC (rev 10247) @@ -69,24 +69,19 @@ if(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2) set(QT_USE_QTSVG 1) endif(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2) - include(${QT_USE_FILE}) - endif(QT4_FOUND) - if(QT4_FOUND AND QT_LIBRARIES) + # Do not include(${QT_USE_FILE}) here because it contaminates ALL + # build environments with Qt flags from the top-level directory on + # down. Instead include(${QT_USE_FILE}) only in certain subdirectories + # where it is necessary. set(qt_COMPILE_FLAGS) foreach(DIR ${QT_INCLUDES}) set(qt_COMPILE_FLAGS "${qt_COMPILE_FLAGS} -I${DIR}") endforeach(DIR ${QT_INCLUDES}) - message(STATUS "QT_LIBRARIES = ${QT_LIBRARIES}") - - set(qt_LINK_FLAGS ${QT_LIBRARIES}) - #message("qt_LINK_FLAGS = ${qt_LINK_FLAGS}") + set(qt_LINK_FLAGS) set(qt_RPATH ${QT_LIBRARY_DIR}) #message("qt_LIBRARY_DIR = ${qt_LIBRARY_DIR}") - else(QT4_FOUND AND QT_LIBRARIES) - message(STATUS "QT_LIBRARIES not found so disabling all qt devices") - set(ANY_QT_DEVICE OFF) - endif(QT4_FOUND AND QT_LIBRARIES) + endif(QT4_FOUND) endif(ANY_QT_DEVICE) if(NOT ANY_QT_DEVICE) Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2009-08-13 20:01:31 UTC (rev 10246) +++ trunk/drivers/CMakeLists.txt 2009-08-13 23:48:59 UTC (rev 10247) @@ -82,34 +82,50 @@ PROPERTIES COMPILE_FLAGS "-DUSINGDLL" ) endif(${SOURCE_ROOT_NAME}_COMPILE_FLAGS) + + # ${SOURCE_ROOT_NAME}_LINK_FLAGS is ideally a list of the full path names + # to libraries determined with find_library. However, the list can also + # include link flags such as the -L and -l form of specifying libraries, + # but that way of doing things only works on Unix, and even for Unix, + # cmake does not correctly set the rpath for the build tree results + # for non-standard locations with the -L and -l forms. + #message("${SOURCE_ROOT_NAME}_LINK_FLAGS = ${${SOURCE_ROOT_NAME}_LINK_FLAGS}") + # ${SOURCE_ROOT_NAME}_TARGETS is a list of PLplot CMake targets that the + # device driver depends on. + #message("${SOURCE_ROOT_NAME}_TARGETS = ${${SOURCE_ROOT_NAME}_TARGETS}") + if(SOURCE_ROOT_NAME STREQUAL "qt" AND NOT ENABLE_qt) if(ANY_QT_DEVICE) add_library(${SOURCE_ROOT_NAME} MODULE ${${SOURCE_ROOT_NAME}_SOURCE}) add_dependencies(${SOURCE_ROOT_NAME} moc_outfile_generated) + # Set up Qt4-based build environment. + include(${QT_USE_FILE}) + if(NOT QT_LIBRARIES) + message(FATAL_ERROR "include(${QT_USE_FILE}) failed in drivers subdirectory.") + endif(NOT QT_LIBRARIES) + + target_link_libraries( + ${SOURCE_ROOT_NAME} + plplot${LIB_TAG} + ${MATH_LIB} + ${${SOURCE_ROOT_NAME}_LINK_FLAGS} + ${${SOURCE_ROOT_NAME}_TARGETS} + ${QT_LIBRARIES} + ) else(ANY_QT_DEVICE) message(FATAL_ERROR "Internal build system inconsistency. Attempt to build dynamic qt device when ANY_QT_DEVICE is false.") endif(ANY_QT_DEVICE) else(SOURCE_ROOT_NAME STREQUAL "qt" AND NOT ENABLE_qt) add_library(${SOURCE_ROOT_NAME} MODULE ${${SOURCE_ROOT_NAME}_SOURCE}) + target_link_libraries( + ${SOURCE_ROOT_NAME} + plplot${LIB_TAG} + ${MATH_LIB} + ${${SOURCE_ROOT_NAME}_LINK_FLAGS} + ${${SOURCE_ROOT_NAME}_TARGETS} + ) endif(SOURCE_ROOT_NAME STREQUAL "qt" AND NOT ENABLE_qt) - # ${SOURCE_ROOT_NAME}_LINK_FLAGS is ideally a list of the full path names - # to libraries determined with find_library. However, the list can also - # include link flags such as the -L and -l form of specifying libraries, - # but that way of doing things only works on Unix, and even for Unix, - # cmake does not correctly set the rpath for the build tree results - # for non-standard locations with the -L and -l forms. - #message("${SOURCE_ROOT_NAME}_LINK_FLAGS = ${${SOURCE_ROOT_NAME}_LINK_FLAGS}") - # ${SOURCE_ROOT_NAME}_TARGETS is a list of PLplot CMake targets that the - # device driver depends on. - #message("${SOURCE_ROOT_NAME}_TARGETS = ${${SOURCE_ROOT_NAME}_TARGETS}") - target_link_libraries( - ${SOURCE_ROOT_NAME} - plplot${LIB_TAG} - ${MATH_LIB} - ${${SOURCE_ROOT_NAME}_LINK_FLAGS} - ${${SOURCE_ROOT_NAME}_TARGETS} - ) # ${SOURCE_ROOT_NAME}_RPATH originally set in cmake/modules files for # each driver in ${DRIVERS_LIST}. This is only used for the # install-tree rpath since cmake handles the build-tree rpath Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2009-08-13 20:01:31 UTC (rev 10246) +++ trunk/src/CMakeLists.txt 2009-08-13 23:48:59 UTC (rev 10247) @@ -106,6 +106,14 @@ # For this case libplot must have a target dependency on the # moc files generated in the binary include directory. set(qt_dependency moc_outfile_generated) + + # Set up Qt4-based build environment. + include(${QT_USE_FILE}) + if(NOT QT_LIBRARIES) + message(FATAL_ERROR "include(${QT_USE_FILE}) failed in src subdirectory.") + endif(NOT QT_LIBRARIES) + set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${QT_LIBRARIES}) + else(ANY_QT_DEVICE) message(FATAL_ERROR "Internal build system inconsistency. Attempt to build static qt device when ANY_QT_DEVICE is false.") endif(ANY_QT_DEVICE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <airwin@us...> - 2009-08-13 20:01:37
|
Revision: 10246 http://plplot.svn.sourceforge.net/plplot/?rev=10246&view=rev Author: airwin Date: 2009-08-13 20:01:31 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Temporarily exclude plslabelfunc from lua bindings until that function is enabled properly in those bindings. Modified Paths: -------------- trunk/bindings/swig-support/plplotcapi.i Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2009-08-13 19:57:21 UTC (rev 10245) +++ trunk/bindings/swig-support/plplotcapi.i 2009-08-13 20:01:31 UTC (rev 10246) @@ -762,9 +762,11 @@ pltr_func pltr, PLPointer SWIG_OBJECT_DATA); +#if !defined(SWIG_LUA) %feature("autodoc", "Set up a user-provided custom labeling function") plslabelfunc; void plslabelfunc(label_func lf, PLPointer data); +#endif %feature("autodoc", "Set up lengths of major tick marks.") plsmaj; void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 19:57:34
|
Revision: 10245 http://plplot.svn.sourceforge.net/plplot/?rev=10245&view=rev Author: smekal Date: 2009-08-13 19:57:21 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Added plarc() to D bindings. Fixed D examples 2 and 3. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/x02d.d trunk/examples/d/x03d.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2009-08-13 19:16:56 UTC (rev 10244) +++ trunk/bindings/d/plplot.d 2009-08-13 19:57:21 UTC (rev 10245) @@ -1156,6 +1156,7 @@ //alias c_plbox plbox; //alias c_plbox3 plbox3; alias c_plcalc_world plcalc_world; +alias c_plarc plarc; alias c_plclear plclear; alias c_plcol0 plcol0; alias c_plcol1 plcol1; @@ -1359,11 +1360,17 @@ void c_plbox(char *xopt, PLFLT xtick, PLINT nxsub, char *yopt, PLFLT ytick, PLINT nysub); /* This is the 3-d analogue of plbox(). */ -void c_plbox3(char *xopt, char *xlabel, PLFLT xtick, PLINT nsubx, char *yopt, char *ylabel, PLFLT ytick, PLINT nsuby, char *zopt, char *zlabel, PLFLT ztick, PLINT nsubz); +void c_plbox3(char *xopt, char *xlabel, PLFLT xtick, PLINT nsubx, char *yopt, + char *ylabel, PLFLT ytick, PLINT nsuby, char *zopt, char *zlabel, + PLFLT ztick, PLINT nsubz); /* Calculate world coordinates and subpage from relative device coordinates. */ void c_plcalc_world(PLFLT rx, PLFLT ry, PLFLT *wx, PLFLT *wy, PLINT *window); +/* Plot an arc */ +void c_plarc(PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, + PLBOOL fill); + /* Clear current subpage. */ void c_plclear(); Modified: trunk/examples/d/x02d.d =================================================================== --- trunk/examples/d/x02d.d 2009-08-13 19:16:56 UTC (rev 10244) +++ trunk/examples/d/x02d.d 2009-08-13 19:57:21 UTC (rev 10245) @@ -79,7 +79,7 @@ PLFLT h = (360./10.)*(i%10); /* Vary lightness uniformly from top to bottom, between min & max */ - PLFLT l = lmin + (lmax-lmin)*(i/10)/9.; + PLFLT l = lmin + (lmax-lmin)*(i/10)/9.0; /* Use max saturation */ PLFLT s = 1.0; @@ -87,9 +87,10 @@ PLFLT r1, g1, b1; plhlsrgb(h, l, s, &r1, &g1, &b1); - r[i+16] = cast(PLINT)(r1*255); - g[i+16] = cast(PLINT)(g1*255); - b[i+16] = cast(PLINT)(b1*255); + /* Use 255.001 to avoid close truncation decisions in this example. */ + r[i+16] = cast(PLINT)(r1*255.001); + g[i+16] = cast(PLINT)(g1*255.001); + b[i+16] = cast(PLINT)(b1*255.001); } /* Load default cmap0 colors into our custom set */ Modified: trunk/examples/d/x03d.d =================================================================== --- trunk/examples/d/x03d.d 2009-08-13 19:16:56 UTC (rev 10244) +++ trunk/examples/d/x03d.d 2009-08-13 19:57:21 UTC (rev 10245) @@ -16,7 +16,8 @@ int main(char[][] args) { PLFLT dtr = PI/180.0; - PLFLT[361] x0, y0; + PLFLT[] x0, y0; + x0.length = y0.length = 361; for(size_t i=0; i<x0.length; i++) { x0[i] = cos(dtr*i); y0[i] = sin(dtr*i); @@ -35,17 +36,10 @@ /* Set up viewport and window, but do not draw box */ plenv(-1.3, 1.3, -1.3, 1.3, 1, -2); - PLFLT[361] x, y; - for(size_t i=1; i<=10; i++) { - for(size_t j=0; j<x.length; j++) { - x[j] = 0.1*i*x0[j]; - y[j] = 0.1*i*y0[j]; - } + /* Draw circles for polar grid */ + for(size_t i=1; i<11; i++) + plarc(0.0, 0.0, 0.1*i, 0.1*i, 0.0, 360.0, 0); - /* Draw circles for polar grid */ - plline(x, y); - } - plcol0(2); for(size_t i=0; i<=11; i++) { PLFLT theta = 30.0*i; @@ -75,6 +69,8 @@ /* Draw the graph */ PLFLT r; + PLFLT[] x, y; + x.length = y.length = 361; for(size_t i=0; i<x.length; i++) { r = sin(dtr*(5*i)); x[i] = x0[i]*r; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 19:17:04
|
Revision: 10244 http://plplot.svn.sourceforge.net/plplot/?rev=10244&view=rev Author: smekal Date: 2009-08-13 19:16:56 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fixed D example 14. Fixed memory bugs in plplot.d introduced in the last commits regarding plgver(), etc. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/x14d.d trunk/plplot_test/test_d.sh.in Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2009-08-13 18:25:21 UTC (rev 10243) +++ trunk/bindings/d/plplot.d 2009-08-13 19:16:56 UTC (rev 10244) @@ -2,7 +2,6 @@ module plplot; private import std.string; -private import std.c.stdlib; // improved D interface @@ -251,19 +250,17 @@ /* Get the current device (keyword) name */ void plgdev(out string p_dev) { - char* temp = cast(char*)malloc(1024); - c_plgdev(temp); - p_dev=toString(temp); - free(temp); + p_dev.length = 1024; + c_plgdev(p_dev.ptr); + p_dev=toString(p_dev.ptr); } /* Get the (current) output file name. Must be preallocated to >80 bytes */ void plgfnam(out string fnam) { - char* temp = cast(char*)malloc(1024); - c_plgfnam(temp); - fnam=toString(temp); - free(temp); + fnam.length = 1024; + c_plgfnam(fnam.ptr); + fnam=toString(fnam.ptr); } /* grid irregularly sampled data */ @@ -284,10 +281,9 @@ /* Get the current library version number */ void plgver(out string p_ver) { - char* temp = cast(char*)malloc(1024); - c_plgver(temp); - p_ver=toString(temp); - free(temp); + p_ver.length = 1024; + c_plgver(p_ver.ptr); + p_ver=toString(p_ver.ptr); } /* Draws a histogram of n values of a variable in array data[0..n-1] */ Modified: trunk/examples/d/x14d.d =================================================================== --- trunk/examples/d/x14d.d 2009-08-13 18:25:21 UTC (rev 10243) +++ trunk/examples/d/x14d.d 2009-08-13 19:16:56 UTC (rev 10244) @@ -140,18 +140,28 @@ } +/* special variables for plot5() and mypltr */ +const int XPTS=35; +const int YPTS=46; +const double XSPA=2.0/(XPTS-1); +const double YSPA=2.0/(YPTS-1); + +/* Transformation function */ +extern (C) { + PLFLT[] tr = [ XSPA, 0.0, -1.0, 0.0, YSPA, -1.0 ]; + + void mypltr(PLFLT x, PLFLT y, PLFLT* tx, PLFLT* ty, void* pltr_data) + { + *tx = tr[0]*x + tr[1]*y + tr[2]; + *ty = tr[3]*x + tr[4]*y + tr[5]; + } +} + class plot { private PLFLT[] x, y, x0, y0; private PLFLT[6] xs, ys; private PLINT[1] space1 = [ 1500 ], mark1 = [ 1500 ]; - // special variables for plot5() and mypltr - private const int XPTS=35; - private const int YPTS=46; - private const double XSPA=2.0/(XPTS-1); - private const double YSPA=2.0/(YPTS-1); - private PLFLT[6] tr = [ XSPA, 0.0, -1.0, 0.0, YSPA, -1.0 ]; - public void plot1(PLFLT xscale, PLFLT yscale, PLFLT xoff, PLFLT yoff) { x.length=60; @@ -316,15 +326,9 @@ /* =============================================================== */ /* Demonstration of contour plotting */ - private void mypltr(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data) - { - *tx = tr[0]*x + tr[1]*y + tr[2]; - *ty = tr[3]*x + tr[4]*y + tr[5]; - } - public void plot5() { - PLFLT[11] clevel = [ -1., -.8, -.6, -.4, -.2, 0, .2, .4, .6, .8, 1. ]; + PLFLT[] clevel = [ -1., -.8, -.6, -.4, -.2, 0, .2, .4, .6, .8, 1. ]; /* Set up function arrays */ PLFLT[][] z, w; @@ -343,10 +347,10 @@ plenv(-1.0, 1.0, -1.0, 1.0, 0, 0); plcol0(2); - //plcont(z, 1, XPTS, 1, YPTS, clevel, mypltr, null); + plcont(z, 1, XPTS, 1, YPTS, clevel, &mypltr); plstyl(mark1, space1); plcol0(3); - //plcont(w, 1, XPTS, 1, YPTS, clevel, mypltr, null); + plcont(w, 1, XPTS, 1, YPTS, clevel, &mypltr); plcol0(1); pllab("X Coordinate", "Y Coordinate", "Streamlines of flow"); plflush(); Modified: trunk/plplot_test/test_d.sh.in =================================================================== --- trunk/plplot_test/test_d.sh.in 2009-08-13 18:25:21 UTC (rev 10243) +++ trunk/plplot_test/test_d.sh.in 2009-08-13 19:16:56 UTC (rev 10244) @@ -31,7 +31,7 @@ # 20-22, 28, and 31 not implemented yet. # example 14 excluded until plgdev fixed since the bad driver information # causes run-time errors. -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 17 18 19 23 24 25 26 27 29 30; do +for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 23 24 25 26 27 29 30; do if [ "$verbose_test" ] ; then echo "x${index}${lang}" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 18:25:29
|
Revision: 10243 http://plplot.svn.sourceforge.net/plplot/?rev=10243&view=rev Author: smekal Date: 2009-08-13 18:25:21 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fixed D examples 13 and 17. Modified Paths: -------------- trunk/examples/d/x13d.d trunk/examples/d/x17d.d Modified: trunk/examples/d/x13d.d =================================================================== --- trunk/examples/d/x13d.d 2009-08-13 13:24:19 UTC (rev 10242) +++ trunk/examples/d/x13d.d 2009-08-13 18:25:21 UTC (rev 10243) @@ -1,13 +1,15 @@ -/* +/* $Id$ Pie chart demo. */ -import plplot; import std.string; +import std.stdio; import std.math; -char[] text[] = [ "Maurice", +import plplot; + +string[] text = [ "Maurice", "Geoffrey", "Alan", "Rafael", @@ -20,55 +22,66 @@ \*--------------------------------------------------------------------------*/ int main( char[][] args ) { - int dthet, theta0, theta1, theta; - PLFLT just, dx, dy; - PLFLT[500] x, y; - PLFLT[5] per = [ 10.0, 32.0, 12.0, 30.0, 16.0 ]; - /* Parse and process command line arguments */ plparseopts(args, PL_PARSE_FULL); /* Initialize plplot */ plinit(); - plenv( 0., 10., 0., 10., 1, -2 ); + pladv( 0 ); + + /* Ensure window has aspect ratio of one so circle is + * plotted as a circle. */ + plvasp( 1.0 ); + plwind( 0.0, 10.0, 0.0, 10.0 ); plcol0( 2 ); + /* n.b. all theta quantities scaled by 2*M_PI/500 to be integers to avoid * floating point logic problems. */ - theta0 = 0; - dthet = 1; - for( size_t i=0; i<=4; i++ ) { + int theta0 = 0; + int dthet = 1; + int theta1, theta; + PLFLT just, dx, dy; + PLFLT[] per = [ 10.0, 32.0, 12.0, 30.0, 16.0 ]; + PLFLT[] x, y; + for( size_t i=0; i<5; i++ ) { size_t j = 0; - x[j] = 5.; - y[j++] = 5.; + /* n.b. the theta quantities multiplied by 2*M_PI/500 afterward so * in fact per is interpreted as a percentage. */ theta1 = cast(int)(theta0+5.0*per[i]); if( i==4 ) theta1 = 500; + + // set size of data arrays + x.length = y.length = (theta1-theta0)/dthet+2; + x[j] = 5.0; + y[j++] = 5.0; + for( theta=theta0; theta<=theta1; theta+=dthet ) { - x[j] = 5+3*cos((2.*PI/500.)*theta); - y[j++] = 5+3*sin((2.*PI/500.)*theta); + x[j] = 5.0+3.0*cos((2.0*PI/500.)*theta); + y[j++] = 5.0+3.0*sin((2.0*PI/500.)*theta); } + plcol0( i+1 ); plpsty( (i+3)%8+1 ); - plfill(x, y); + plfill( x, y ); plcol0( 1 ); - plline(x, y); - just = (2.*PI/500.)*(theta0 + theta1)/2.; - dx = .25*cos(just); - dy = .25*sin(just); + plline( x, y ); + just = (2.0*PI/500.0)*(theta0 + theta1)/2.0; + dx = 0.25*cos(just); + dy = 0.25*sin(just); if( (theta0+theta1)<250 || (theta0+theta1)>750 ) - just = 0.; + just = 0.0; else - just = 1.; + just = 1.0; - plptex((x[j/2]+dx), (y[j/2]+dy), 1.0, 0.0, just, text[i]); + plptex( x[j/2]+dx, y[j/2]+dy, 1.0, 0.0, just, text[i]); theta0 = theta-dthet; } plfont( 2 ); plschr( 0., 1.3 ); - plptex(5.0, 9.0, 1.0, 0.0, 0.5, "Percentage of Sales"); + plptex( 5.0, 9.0, 1.0, 0.0, 0.5, "Percentage of Sales" ); /* Don't forget to call PLEND to finish off! */ plend(); Modified: trunk/examples/d/x17d.d =================================================================== --- trunk/examples/d/x17d.d 2009-08-13 13:24:19 UTC (rev 10242) +++ trunk/examples/d/x17d.d 2009-08-13 18:25:21 UTC (rev 10243) @@ -20,8 +20,8 @@ /* If db is used the plot is much more smooth. However, because of the async X behaviour, one does not have a real-time scripcharter. */ - plsetopt("db", ""); - plsetopt("np", ""); + /* plsetopt("db", ""); */ + /* plsetopt("np", ""); */ /* User sets up plot completely except for window and data * Eventually settings in place when strip chart is created will be @@ -67,7 +67,7 @@ /* From here on, we're handling all errors here */ PLINT pl_errcode; char[160] errmsg; - plsError( &pl_errcode, cast(char*)errmsg ); + plsError( &pl_errcode, errmsg.ptr ); PLINT id1; plstripc(&id1, "bcnst", "bcnstv", @@ -79,7 +79,7 @@ "t", "", "Strip chart demo"); if(pl_errcode) { - writefln("%s\n", errmsg); // TODO: to stderr + writefln("%s", errmsg); // TODO: to stderr return 1; } @@ -116,7 +116,8 @@ plstripa( id1, 2, t, y3 ); if( n%5 ) plstripa( id1, 3, t, y4 ); - pleop(); /* use double buffer (-db on command line) */ + + /* pleop(); */ /* use double buffer (-db on command line) */ } /* Destroy strip chart and it's memory */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 13:24:27
|
Revision: 10242 http://plplot.svn.sourceforge.net/plplot/?rev=10242&view=rev Author: smekal Date: 2009-08-13 13:24:19 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fixed D examples x01 and x12. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/x12d.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2009-08-13 13:04:38 UTC (rev 10241) +++ trunk/bindings/d/plplot.d 2009-08-13 13:24:19 UTC (rev 10242) @@ -2,6 +2,7 @@ module plplot; private import std.string; +private import std.c.stdlib; // improved D interface @@ -250,17 +251,19 @@ /* Get the current device (keyword) name */ void plgdev(out string p_dev) { - char[1024] temp; - c_plgdev(temp.ptr); - p_dev=toString(temp.ptr); + char* temp = cast(char*)malloc(1024); + c_plgdev(temp); + p_dev=toString(temp); + free(temp); } /* Get the (current) output file name. Must be preallocated to >80 bytes */ void plgfnam(out string fnam) { - char[1024] temp; - c_plgfnam(temp.ptr); - fnam=toString(temp.ptr); + char* temp = cast(char*)malloc(1024); + c_plgfnam(temp); + fnam=toString(temp); + free(temp); } /* grid irregularly sampled data */ @@ -281,9 +284,10 @@ /* Get the current library version number */ void plgver(out string p_ver) { - char[1024] temp; - c_plgver(temp.ptr); - p_ver=toString(temp.ptr); + char* temp = cast(char*)malloc(1024); + c_plgver(temp); + p_ver=toString(temp); + free(temp); } /* Draws a histogram of n values of a variable in array data[0..n-1] */ Modified: trunk/examples/d/x12d.d =================================================================== --- trunk/examples/d/x12d.d 2009-08-13 13:04:38 UTC (rev 10241) +++ trunk/examples/d/x12d.d 2009-08-13 13:24:19 UTC (rev 10242) @@ -1,4 +1,4 @@ -/* +/* $Id:$ Bar chart demo. */ @@ -16,7 +16,6 @@ int main(char[][] args) { string text; - PLFLT[10] y0; /* Parse and process command line arguments */ plparseopts(args, PL_PARSE_FULL); @@ -31,10 +30,15 @@ plcol0( 2 ); pllab( "Year", "Widget Sales (millions)", "#frPLplot Example 12" ); - y0[] = [5.0, 15.0, 12.0, 24.0, 28.0, 30.0, 20.0, 8.0, 12.0, 3.0]; + PLFLT[] pos = [ 0.0, 0.25, 0.5, 0.75, 1.0 ]; + PLFLT[] red = [ 0.0, 0.25, 0.5, 1.0, 1.0 ]; + PLFLT[] green = [ 1.0, 0.5, 0.5, 0.5, 1.0 ]; + PLFLT[] blue = [ 1.0, 1.0, 0.5, 0.25, 0.0 ]; + plscmap1l( 1, pos, red, green, blue ); + PLFLT[] y0 = [ 5.0, 15.0, 12.0, 24.0, 28.0, 30.0, 20.0, 8.0, 12.0, 3.0 ]; for( size_t i=0; i<10; i++ ) { - plcol0( i+1 ); + plcol1( i/9.0 ); plpsty( 0 ); plfbox( (1980.+i), y0[i] ); text = format( "%.0f", y0[i] ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andrewross@us...> - 2009-08-13 13:04:57
|
Revision: 10241 http://plplot.svn.sourceforge.net/plplot/?rev=10241&view=rev Author: andrewross Date: 2009-08-13 13:04:38 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Update java bindings to add all the infrastructure for plslabelfunc. The actual call to the callback function is disabled for now since this causes a crash on my jvm. I will investigate. Update java example 19 to illustrate changes Add PL_[XYZ]_AXIS constants for python / java bindings and change python example 19 to use these. Modified Paths: -------------- trunk/bindings/java/CMakeLists.txt trunk/bindings/java/PLStream.java trunk/bindings/java/plplotjavac.i trunk/bindings/swig-support/plplotcapi.i trunk/examples/java/x19.java trunk/examples/python/xw19.py Added Paths: ----------- trunk/bindings/java/PLCallbackLabel.java trunk/bindings/java/PLCallbackMapform.java Removed Paths: ------------- trunk/bindings/java/PLCallback.java Modified: trunk/bindings/java/CMakeLists.txt =================================================================== --- trunk/bindings/java/CMakeLists.txt 2009-08-13 09:53:27 UTC (rev 10240) +++ trunk/bindings/java/CMakeLists.txt 2009-08-13 13:04:38 UTC (rev 10241) @@ -53,7 +53,8 @@ JAVA_FILES_FULL ${JAVA_GEN_FILES_FULL} ${CMAKE_CURRENT_SOURCE_DIR}/PLStream.java -${CMAKE_CURRENT_SOURCE_DIR}/PLCallback.java +${CMAKE_CURRENT_SOURCE_DIR}/PLCallbackMapform.java +${CMAKE_CURRENT_SOURCE_DIR}/PLCallbackLabel.java ) @@ -70,7 +71,8 @@ set( ${class_root}/plplotjavacJNI.class_DEPENDS -${class_root}/PLCallback.class +${class_root}/PLCallbackMapform.class +${class_root}/PLCallbackLabel.class ) set( @@ -88,7 +90,8 @@ ${class_root}/plplotjavacConstants.class ${class_root}/PLGraphicsIn.class ${class_root}/plplotjavacJNI.class -${class_root}/PLCallback.class +${class_root}/PLCallbackMapform.class +${class_root}/PLCallbackLabel.class ) set( @@ -96,7 +99,8 @@ ${class_root}/plplotjavacConstants.class ${class_root}/config.class ${class_root}/plplotjavac.class -${class_root}/PLCallback.class +${class_root}/PLCallbackMapform.class +${class_root}/PLCallbackLabel.class ) # This is currently the include list for swig, the C wrapper and the Deleted: trunk/bindings/java/PLCallback.java =================================================================== --- trunk/bindings/java/PLCallback.java 2009-08-13 09:53:27 UTC (rev 10240) +++ trunk/bindings/java/PLCallback.java 2009-08-13 13:04:38 UTC (rev 10241) @@ -1,8 +0,0 @@ - -package plplot.core; - -public interface PLCallback -{ - public void mapform(double[] x, double[] y); - public String label(int axis, double value); -}; Added: trunk/bindings/java/PLCallbackLabel.java =================================================================== --- trunk/bindings/java/PLCallbackLabel.java (rev 0) +++ trunk/bindings/java/PLCallbackLabel.java 2009-08-13 13:04:38 UTC (rev 10241) @@ -0,0 +1,7 @@ + +package plplot.core; + +public interface PLCallbackLabel +{ + public String label(int axis, double value); +}; Copied: trunk/bindings/java/PLCallbackMapform.java (from rev 10234, trunk/bindings/java/PLCallback.java) =================================================================== --- trunk/bindings/java/PLCallbackMapform.java (rev 0) +++ trunk/bindings/java/PLCallbackMapform.java 2009-08-13 13:04:38 UTC (rev 10241) @@ -0,0 +1,7 @@ + +package plplot.core; + +public interface PLCallbackMapform +{ + public void mapform(double[] x, double[] y); +}; Property changes on: trunk/bindings/java/PLCallbackMapform.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2009-08-13 09:53:27 UTC (rev 10240) +++ trunk/bindings/java/PLStream.java 2009-08-13 13:04:38 UTC (rev 10241) @@ -450,12 +450,12 @@ plplotjavac.pllsty(lin); } -public void map(PLCallback mapform, String type, double minlong, double maxlong, double minlat, double maxlat) { +public void map(PLCallbackMapform mapform, String type, double minlong, double maxlong, double minlat, double maxlat) { if (set_stream() == -1) return; plplotjavac.plmap(mapform, type, minlong, maxlong, minlat, maxlat); } -public void meridians(PLCallback mapform, double dlong, double dlat, double minlong, double maxlong, double minlat, double maxlat) { +public void meridians(PLCallbackMapform mapform, double dlong, double dlat, double minlong, double maxlong, double minlat, double maxlat) { if (set_stream() == -1) return; plplotjavac.plmeridians(mapform, dlong, dlat, minlong, maxlong, minlat, maxlat); } @@ -749,6 +749,16 @@ max_color, max_width, rectangular, pltr, OBJECT_DATA); } +public void slabelfunc(PLCallbackLabel label, Object obj) { + if (set_stream() == -1) return; + plplotjavac.plslabelfunc(label,obj); +} + +public void slabelfunc(PLCallbackLabel label) { + if (set_stream() == -1) return; + plplotjavac.plslabelfunc(label,null); +} + public void smaj(double def, double scale) { if (set_stream() == -1) return; plplotjavac.plsmaj(def, scale); Modified: trunk/bindings/java/plplotjavac.i =================================================================== --- trunk/bindings/java/plplotjavac.i 2009-08-13 09:53:27 UTC (rev 10240) +++ trunk/bindings/java/plplotjavac.i 2009-08-13 13:04:38 UTC (rev 10241) @@ -1149,7 +1149,7 @@ JNIEnv *cbenv; /* C mapform callback function which calls the java - * mapform function in a PLCallback object. */ + * mapform function in a PLCallbackMapform object. */ void mapform_java(PLINT n, PLFLT *x, PLFLT *y) { jdoubleArray jx = setup_java_array_1d_PLFLT(cbenv,x,n); jdoubleArray jy = setup_java_array_1d_PLFLT(cbenv,y,n); @@ -1178,8 +1178,8 @@ } %typemap(jni) mapform_func "jobject" -%typemap(jtype) mapform_func "PLCallback" -%typemap(jstype) mapform_func "PLCallback" +%typemap(jtype) mapform_func "PLCallbackMapform" +%typemap(jstype) mapform_func "PLCallbackMapform" %typemap(javain) mapform_func mapform "$javainput" %{ @@ -1189,43 +1189,54 @@ JNIEnv *cbenv; /* C label plotting callback function which calls the java - * label function in a PLCallback object. */ + * label function in a PLCallbackLabel object. */ void label_java(PLINT axis, PLFLT value, char *string, PLINT len, PLPointer data) { jstring javaString; const char *nativeString; + jint jaxis; + jdouble jvalue; - javaString = (*cbenv)->CallObjectMethod(cbenv,labelClass, labelID, axis, value); + jaxis = (jint) axis; + jvalue = (jdouble) value; + /* javaString = (jstring)(*cbenv)->CallObjectMethod(cbenv,labelClass, labelID, jaxis, jvalue); nativeString = (*cbenv)->GetStringUTFChars(cbenv,javaString,0); strncpy(string,nativeString,len); - (*cbenv)->ReleaseStringUTFChars(cbenv,javaString,nativeString); + (*cbenv)->ReleaseStringUTFChars(cbenv,javaString,nativeString);*/ + strncpy(string,"",len); } %} /* Handle function pointers to label function using an java class */ -%typemap(in) (label_func lf, PLPointer data) { +%typemap(in) label_func lf { jobject obj = $input; if (obj != NULL) { jclass cls = (*jenv)->GetObjectClass(jenv,obj); - labelID = (*jenv)->GetMethodID(jenv,cls, "label","([I[D)Ljava/lang/String" ); + labelID = (*jenv)->GetMethodID(jenv,cls, "label","(ID)Ljava/lang/String;" ); labelClass = obj; cbenv = jenv; $1 = label_java; - $2 = NULL; } else { $1 = NULL; - $2 = NULL; } } -%typemap(jni) (label_func lf, PLPointer data) "jobject" -%typemap(jtype) (label_func lf, PLPointer data) "PLCallback" -%typemap(jstype) (label_func lf, PLPointer data) "PLCallback" -%typemap(javain) (label_func lf, PLPointer data) "$javainput" +%typemap(jni) label_func lf "jobject" +%typemap(jtype) label_func lf "PLCallbackLabel" +%typemap(jstype) label_func lf "PLCallbackLabel" +%typemap(javain) label_func lf "$javainput" +%typemap(in) PLPointer data { + $1 = NULL; +} +%typemap(jni) PLPointer data "jobject" +%typemap(jtype) PLPointer data "Object" +%typemap(jstype) PLPointer data "Object" +%typemap(javain) PLPointer data "$javainput" + /* Second of two object arrays, where we check X and Y with previous object. */ %typemap(in) PLPointer OBJECT_DATA { jPLFLT **adat; Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2009-08-13 09:53:27 UTC (rev 10240) +++ trunk/bindings/swig-support/plplotcapi.i 2009-08-13 13:04:38 UTC (rev 10241) @@ -100,6 +100,11 @@ #define PLSWIN_DEVICE 1 /* device coordinates */ #define PLSWIN_WORLD 2 /* world coordinates */ +/* Axis label tags */ +#define PL_X_AXIS 1 /* The x-axis */ +#define PL_Y_AXIS 2 /* The y-axis */ +#define PL_Z_AXIS 3 /* The z-axis */ + /* PLplot Option table & support constants */ /* Option-specific settings */ Modified: trunk/examples/java/x19.java =================================================================== --- trunk/examples/java/x19.java 2009-08-13 09:53:27 UTC (rev 10240) +++ trunk/examples/java/x19.java 2009-08-13 13:04:38 UTC (rev 10241) @@ -31,7 +31,7 @@ import java.lang.Math; -class Mapform19 implements PLCallback { +class Mapform19 implements PLCallbackMapform { public void mapform(double[] x, double[] y) { int i; @@ -49,6 +49,70 @@ } +class LabelFunc19 implements PLCallbackLabel { + + // A custom axis labeling function for longitudes and latitudes. + public String label(int axis, double value) { + String label = ""; + String direction_label = ""; + double label_val = 0.0; + + System.err.println("Entered callback function"); + if (axis == PLStream.PL_Y_AXIS) { + label_val = value; + if (label_val > 0.0) { + direction_label = " N"; + } + else if (label_val < 0.0) { + direction_label = " S"; + } + else { + direction_label = "Eq"; + } + } + else if (axis == PLStream.PL_X_AXIS) { + label_val = normalize_longitude(value); + if (label_val > 0.0) { + direction_label = " E"; + } + else if (label_val < 0.0) { + direction_label = " W"; + } + else { + direction_label = ""; + } + } + if (axis == PLStream.PL_Y_AXIS && value == 0.0) { + /* A special case for the equator */ + label = direction_label; + } + else { + label = ""+((int)Math.abs(label_val))+direction_label; + } + return label; + } + + // "Normalize" longitude values so that they always fall between -180.0 + // and 180.0 + double normalize_longitude(double lon) { + double times; + + if (lon >= -180.0 && lon <= 180.0) { + return(lon); + } + else { + times = Math.floor ((Math.abs(lon) + 180.0) / 360.0); + if (lon < 0.0) { + return(lon + 360.0 * times); + } + else { + return(lon - 360.0 * times); + } + } + } + +} + class x19 { PLStream pls = new PLStream(); @@ -61,7 +125,9 @@ public x19 (String[] args) { double minx, maxx, miny,maxy; - PLCallback nullCallback = null; + PLCallbackMapform nullCallback = null; + PLCallbackLabel nullLabelCallback = null; + LabelFunc19 geolocation_labeler = new LabelFunc19(); // Parse and process command line arguments. pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); @@ -79,8 +145,11 @@ minx = 190; maxx = 190+360; + // Setup a custom latitude and longitude-based scaling function. + pls.slabelfunc(geolocation_labeler); + pls.col0(1); - pls.env(minx, maxx, miny, maxy, 1, -1); + pls.env(minx, maxx, miny, maxy, 1, 70); pls.map(nullCallback, "usaglobe", minx, maxx, miny, maxy); // The Americas @@ -89,9 +158,12 @@ maxx = 340; pls.col0(1); - pls.env(minx, maxx, miny, maxy, 1, -1); + pls.env(minx, maxx, miny, maxy, 1, 70); pls.map(nullCallback, "usaglobe", minx, maxx, miny, maxy); + // Clear the labelling function. + pls.slabelfunc(nullLabelCallback); + // Polar, Northern hemisphere // Create callback object containing mapform function Modified: trunk/examples/python/xw19.py =================================================================== --- trunk/examples/python/xw19.py 2009-08-13 09:53:27 UTC (rev 10240) +++ trunk/examples/python/xw19.py 2009-08-13 13:04:38 UTC (rev 10241) @@ -53,7 +53,7 @@ ## A custom axis labeling function for longitudes and latitudes. def geolocation_labeler(axis, value, data): - if (axis == 2) : + if (axis == PL_Y_AXIS) : label_val = value if (label_val > 0.0) : direction_label = " N" @@ -62,7 +62,7 @@ else : direction_label = "Eq" - elif (axis == 1) : + elif (axis == PL_X_AXIS) : label_val = normalize_longitude(value) if (label_val > 0.0) : direction_label = " E" @@ -71,7 +71,7 @@ else : direction_label = "" - if (axis == 2 and value == 0.0) : + if (axis == PL_Y_AXIS and value == 0.0) : # A special case for the equator label = direction_label else : This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andrewross@us...> - 2009-08-13 09:53:38
|
Revision: 10240 http://plplot.svn.sourceforge.net/plplot/?rev=10240&view=rev Author: andrewross Date: 2009-08-13 09:53:27 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fix up python support for plslabelfunc properly so example 19 works identically to the C version. Modified Paths: -------------- trunk/bindings/python/plplotcmodule.i trunk/examples/python/xw19.py Modified: trunk/bindings/python/plplotcmodule.i =================================================================== --- trunk/bindings/python/plplotcmodule.i 2009-08-13 09:17:49 UTC (rev 10239) +++ trunk/bindings/python/plplotcmodule.i 2009-08-13 09:53:27 UTC (rev 10240) @@ -768,7 +768,10 @@ PLFLT fresult = 0.0; /* the data argument is acutally a pointer to a python object */ - pdata = (PyObject*)data; + if (data) + pdata = (PyObject*)data; + else + pdata = Py_None; if(python_label) { /* if not something is terribly wrong */ /* hold a reference to the data object */ Py_XINCREF(pdata); @@ -776,16 +779,20 @@ MY_BLOCK_THREADS /* build the argument list */ #ifdef PL_DOUBLE - arglist = Py_BuildValue("(idO)", axis, value, pdata); + arglist = Py_BuildValue("(ldO)", axis, value, pdata); #else - arglist = Py_BuildValue("(ifO)", axis, value, pdata); + arglist = Py_BuildValue("(lfO)", axis, value, pdata); #endif /* call the python function */ result = PyEval_CallObject(python_label, arglist); /* release the argument list */ - Py_DECREF(arglist); + //Py_DECREF(arglist); /* check and unpack the result */ - if(!PyFloat_Check(result)) { + if (result == NULL) { + fprintf(stderr, "label callback failed with 3 arguments\n"); + PyErr_SetString(PyExc_RuntimeError, "label callback must take 3 arguments."); + } + else if(!PyString_Check(result)) { fprintf(stderr, "label callback must return a string\n"); PyErr_SetString(PyExc_RuntimeError, "label callback must return a string."); } else { @@ -1054,6 +1061,11 @@ } /* marshall the label function pointer argument */ %typemap(in) label_func lf { + /* Release reference to previous function if applicable */ + if (python_label) { + Py_XDECREF(python_label); + python_label = 0; + } /* it must be a callable or None */ if($input == Py_None) { $1 = NULL; @@ -1070,10 +1082,6 @@ $1 = do_label_callback; } } -%typemap(freearg) label_func lf { - Py_XDECREF(python_label); - python_label = 0; -} %typemap(in, numinputs=0) defined_func df { $1 = NULL; } Modified: trunk/examples/python/xw19.py =================================================================== --- trunk/examples/python/xw19.py 2009-08-13 09:17:49 UTC (rev 10239) +++ trunk/examples/python/xw19.py 2009-08-13 09:53:27 UTC (rev 10240) @@ -53,7 +53,7 @@ ## A custom axis labeling function for longitudes and latitudes. def geolocation_labeler(axis, value, data): - if (axis == PL_Y_AXIS) : + if (axis == 2) : label_val = value if (label_val > 0.0) : direction_label = " N" @@ -62,7 +62,7 @@ else : direction_label = "Eq" - elif (axis == PL_X_AXIS) : + elif (axis == 1) : label_val = normalize_longitude(value) if (label_val > 0.0) : direction_label = " E" @@ -71,11 +71,11 @@ else : direction_label = "" - if (axis == PL_Y_AXIS and value == 0.0) : + if (axis == 2 and value == 0.0) : # A special case for the equator - snprintf(label, length, "%s", direction_label) + label = direction_label else : - snprintf(label, length, "%.0f%s", fabs(label_val), direction_label) + label = ""+`abs(label_val)` + direction_label return label This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 09:18:05
|
Revision: 10239 http://plplot.svn.sourceforge.net/plplot/?rev=10239&view=rev Author: smekal Date: 2009-08-13 09:17:49 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Added Darwin-dmd.cmake which should set all specific options for dmd on Mac OS X. Maybe not necessary, but needed later anyways. Added Paths: ----------- trunk/cmake/modules/Platform/Darwin-dmd.cmake Added: trunk/cmake/modules/Platform/Darwin-dmd.cmake =================================================================== --- trunk/cmake/modules/Platform/Darwin-dmd.cmake (rev 0) +++ trunk/cmake/modules/Platform/Darwin-dmd.cmake 2009-08-13 09:17:49 UTC (rev 10239) @@ -0,0 +1,35 @@ +# +# CMakeD - CMake module for D Language +# +# Copyright (c) 2007, Selman Ulug <selman.ulug@...> +# Tim Burrell <tim.burrell@...> +# +# All rights reserved. +# +# See Copyright.txt for details. +# +# Modified from CMake 2.6.5 gcc.cmake +# See http://www.cmake.org/HTML/Copyright.html for details +# + +IF(CMAKE_D_USE_TANGO) + SET(DSTDLIB_FLAGS "-version=Tango") +ENDIF(CMAKE_D_USE_TANGO) +IF(CMAKE_D_USE_PHOBOS) + SET(DSTDLIB_FLAGS "-version=Phobos") +ENDIF(CMAKE_D_USE_PHOBOS) +IF(CMAKE_D_BUILD_DOCS) + SET(DDOC_FLAGS "-D -Dddocumentation") + #FOREACH(item ${CMAKE_D_DDOC_FILES}) + # SET(DDOC_FLAGS "${DDOC_FLAGS} ${item}") + #ENDFOREACH(item) +ENDIF(CMAKE_D_BUILD_DOCS) + +SET (CMAKE_D_FLAGS_INIT "-version=Posix ${DSTDLIB_FLAGS} -I$ENV{D_PATH}/include -I$ENV{D_PATH}/import") +SET (CMAKE_D_FLAGS_DEBUG_INIT "-g ${DDOC_FLAGS}") +# SET (CMAKE_D_FLAGS_MINSIZEREL_INIT "-Os ${DDOC_FLAGS}") +SET (CMAKE_D_FLAGS_RELEASE_INIT "-O -release -inline ${DDOC_FLAGS}") +SET (CMAKE_D_FLAGS_RELWITHDEBINFO_INIT "-O -g ${DDOC_FLAGS}") +# SET (CMAKE_D_CREATE_PREPROCESSED_SOURCE "<CMAKE_D_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +SET (CMAKE_D_CREATE_ASSEMBLY_SOURCE "<CMAKE_D_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") +# SET (CMAKE_INCLUDE_SYSTEM_FLAG_D "-isystem ") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 09:16:55
|
Revision: 10238 http://plplot.svn.sourceforge.net/plplot/?rev=10238&view=rev Author: smekal Date: 2009-08-13 09:16:42 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Changed the logic to determine the link/compile command line for the dmd compiler. Before, these command lines were determined depending if the system is Linux or not. So for Mac OS X the same command line as for Windows was used, but Mac OS X needs the same command line as Linux. Therefore the if clause now checks for a Windows system and sets Linux command lines otherwise (which also work for Mac OS X). These files seem to take too much compiler specific actions and therefore only work for gdc and dmd compiler. There is already another D compiler (lvv) which wouldn't work with these files, even if there is a Darwin-lvv.cmake file or similar. This needs to be worked on. Modified Paths: -------------- trunk/cmake/modules/CMakeDInformation.cmake Modified: trunk/cmake/modules/CMakeDInformation.cmake =================================================================== --- trunk/cmake/modules/CMakeDInformation.cmake 2009-08-13 09:08:43 UTC (rev 10237) +++ trunk/cmake/modules/CMakeDInformation.cmake 2009-08-13 09:16:42 UTC (rev 10238) @@ -129,7 +129,7 @@ IF(CMAKE_D_STANDARD_LIBRARIES_INIT) SET(CMAKE_D_STANDARD_LIBRARIES "${CMAKE_D_STANDARD_LIBRARIES_INIT}" - CACHE STRING "Libraries linked by defalut with all D applications.") + CACHE STRING "Libraries linked by default with all D applications.") MARK_AS_ADVANCED(CMAKE_D_STANDARD_LIBRARIES) ENDIF(CMAKE_D_STANDARD_LIBRARIES_INIT) @@ -255,14 +255,14 @@ ) ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ELSE(CMAKE_COMPILER_IS_GDC) - IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") SET(CMAKE_D_CREATE_STATIC_LIBRARY + "${DMD_LIBRARIAN} -c -p256 <TARGET> <OBJECTS>") + ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + SET(CMAKE_D_CREATE_STATIC_LIBRARY "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>" "<CMAKE_RANLIB> <TARGET>") - ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - SET(CMAKE_D_CREATE_STATIC_LIBRARY - "${DMD_LIBRARIAN} -c -p256 <TARGET> <OBJECTS>") - ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ENDIF(CMAKE_COMPILER_IS_GDC) ENDIF(NOT CMAKE_D_CREATE_STATIC_LIBRARY) @@ -277,13 +277,13 @@ SET(CMAKE_D_LINK_EXECUTABLE "<CMAKE_D_COMPILER> <FLAGS> <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> ${CMAKE_OUTPUT_D_FLAG}<TARGET> <LINK_LIBRARIES> ${DSTDLIB_FLAGS} ${DSTDLIB_TYPE}") ELSE(CMAKE_COMPILER_IS_GDC) - IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") SET(CMAKE_D_LINK_EXECUTABLE + "<CMAKE_D_COMPILER> <FLAGS> <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> ${CMAKE_OUTPUT_D_FLAG}<TARGET> <LINK_LIBRARIES>") + ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + SET(CMAKE_D_LINK_EXECUTABLE "gcc ${DLINK_FLAGS} <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -lpthread -lm ${DSTDLIB_FLAGS}") - ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - SET(CMAKE_D_LINK_EXECUTABLE - "<CMAKE_D_COMPILER> <FLAGS> <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> ${CMAKE_OUTPUT_D_FLAG}<TARGET> <LINK_LIBRARIES>") - ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ENDIF(CMAKE_COMPILER_IS_GDC) ENDIF(NOT CMAKE_D_LINK_EXECUTABLE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 09:08:49
|
Revision: 10237 http://plplot.svn.sourceforge.net/plplot/?rev=10237&view=rev Author: smekal Date: 2009-08-13 09:08:43 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Added the plrand() function to the D bindings. Modified Paths: -------------- trunk/bindings/d/plplot.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2009-08-13 09:07:43 UTC (rev 10236) +++ trunk/bindings/d/plplot.d 2009-08-13 09:08:43 UTC (rev 10237) @@ -1232,6 +1232,7 @@ alias c_plpsty plpsty; //alias c_plptex plptex; //alias c_plptex3 plptex3; +alias c_plrandd plrandd; alias c_plreplot plreplot; alias c_plrgb plrgb; alias c_plrgb1 plrgb1; @@ -1657,10 +1658,13 @@ /* Prints out "text" at world cooordinate (x,y,z). */ void c_plptex3(PLFLT wx, PLFLT wy, PLFLT wz, PLFLT dx, PLFLT dy, PLFLT dz, PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, char *text); +/* Random number generator based on Mersenne Twister. + Obtain real random number in range [0,1]. */ +PLFLT c_plrandd(); + /* Replays contents of plot buffer to current device/file. */ +void c_plreplot(); -void c_plreplot(); - /* Set line color by red, green, blue from 0. to 1. */ void c_plrgb(PLFLT r, PLFLT g, PLFLT b); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 09:07:52
|
Revision: 10236 http://plplot.svn.sourceforge.net/plplot/?rev=10236&view=rev Author: smekal Date: 2009-08-13 09:07:43 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Explicitly tell cmake to use the phobos library. This library is used in plplot.d and the D examples since it's provided with the standard D compiler install. This may become a problem if a user wants to use the "competing" tango library, but first make everything run with the phobos library and then take care about Tango. Modified Paths: -------------- trunk/cmake/modules/d.cmake Modified: trunk/cmake/modules/d.cmake =================================================================== --- trunk/cmake/modules/d.cmake 2009-08-13 09:00:37 UTC (rev 10235) +++ trunk/cmake/modules/d.cmake 2009-08-13 09:07:43 UTC (rev 10236) @@ -38,6 +38,7 @@ if(ENABLE_d) # Find and check D compiler + set(CMAKE_D_USE_PHOBOS ON) enable_language(D OPTIONAL) if(NOT CMAKE_D_COMPILER_WORKS) message(STATUS "WARNING: no working D compiler so disabling D bindings and examples.") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <smekal@us...> - 2009-08-13 09:00:48
|
Revision: 10235 http://plplot.svn.sourceforge.net/plplot/?rev=10235&view=rev Author: smekal Date: 2009-08-13 09:00:37 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Replace rand() function with plrand() provided by plplot. Modified Paths: -------------- trunk/examples/d/x17d.d Modified: trunk/examples/d/x17d.d =================================================================== --- trunk/examples/d/x17d.d 2009-08-12 21:24:48 UTC (rev 10234) +++ trunk/examples/d/x17d.d 2009-08-13 09:00:37 UTC (rev 10235) @@ -100,7 +100,7 @@ // todo: usleep? // todo: poll? t = n*dt; - noise = (rand()/(RAND_MAX+1.0))-0.5; + noise = plrandd() - 0.5; y1 += noise; y2 = sin(t*PI/18.); y3 = y2*noise; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |