From: <and...@us...> - 2008-08-19 19:26:38
|
Revision: 8681 http://plplot.svn.sourceforge.net/plplot/?rev=8681&view=rev Author: andrewross Date: 2008-08-19 19:26:48 +0000 (Tue, 19 Aug 2008) Log Message: ----------- Add tcl support for plgfci, plsfci, plgfont, plsfont, plrandd, plseed, plmtex3 and plptex3. Currently these are untested, but now examples 23, 29 and 30 can be implemented. Modified Paths: -------------- trunk/bindings/tcl/plapi.tpl trunk/bindings/tcl/pltclgen trunk/bindings/tcl/pltclgen.tcl Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2008-08-19 16:13:34 UTC (rev 8680) +++ trunk/bindings/tcl/plapi.tpl 2008-08-19 19:26:48 UTC (rev 8681) @@ -237,11 +237,23 @@ num PLINT& bmax PLINT& +# Get the (FCI) font characterisation integer + +pltclcmd plgfci void +fci PLUNICODE& + # Get the output file name. pltclcmd plgfnam void fnam char * +# Get the current font family, style and weight + +pltclcmd plgfont void +family PLINT& +style PLINT& +weight PLINT& + # Get the current run level. pltclcmd plglevel void @@ -392,6 +404,15 @@ just PLFLT text const char * +# Prints out "text" at specified position relative to viewport (3D). + +pltclcmd plmtex3 void +side const char * +disp PLFLT +pos PLFLT +just PLFLT +text const char * + # Set fill pattern directly. pltclcmd plpat void @@ -449,6 +470,26 @@ just PLFLT text const char * +# Prints out "text" at world cooordinate (x,y,z). + +pltclcmd plptex3 void +wx PLFLT +wy PLFLT +wz PLFLT +dx PLFLT +dy PLFLT +dz PLFLT +sx PLFLT +sy PLFLT +sz PLFLT +just PLFLT +text const char * + +# Random number generator based on Mersenne Twister. +# Obtain real random number in range [0,1]. + +pltclcmd plrandd PLFLT + # Replays contents of plot buffer to current device/file. pltclcmd plreplot void @@ -586,6 +627,12 @@ xmax PLFLT ymax PLFLT +# Set seed for internal random number generator + +pltclcmd plseed void +s unsigned int + + # Set the escape character for text strings. pltclcmd plsesc void @@ -598,11 +645,23 @@ num PLINT bmax PLINT +# Set FCI (font characterization integer) + +pltclcmd plsfci void +fci PLUNICODE + # Set the output file name. pltclcmd plsfnam void fnam const char * +# Set the current font family, style and weight + +pltclcmd plsfont void +family PLINT +style PLINT +weight PLINT + # Set up lengths of major tick marks. pltclcmd plsmaj void Modified: trunk/bindings/tcl/pltclgen =================================================================== --- trunk/bindings/tcl/pltclgen 2008-08-19 16:13:34 UTC (rev 8680) +++ trunk/bindings/tcl/pltclgen 2008-08-19 19:26:48 UTC (rev 8681) @@ -156,6 +156,10 @@ print GENFILE " PLINT $argname[$i];\n"; last argdecl; }; + /PLUNICODE&/ && do { + print GENFILE " PLUNICODE $argname[$i];\n"; + last argdecl; + }; /PLFLT&/ && do { print GENFILE " PLFLT $argname[$i];\n"; last argdecl; @@ -169,6 +173,11 @@ print GENFILE " tclMatrix *mat$argname[$i];\n"; last argdecl; }; + /PLUNICODE \*/ && do { + print GENFILE " PLUNICODE *$argname[$i];\n"; + print GENFILE " tclMatrix *mat$argname[$i];\n"; + last argdecl; + }; /PLFLT \*/ && do { print GENFILE " PLFLT *$argname[$i];\n"; print GENFILE " tclMatrix *mat$argname[$i];\n"; @@ -213,6 +222,12 @@ print GENFILE " $argname[$i] = mat$argname[$i]-\>idata;\n"; last getarg; }; + /PLUNICODE \*/ && do { + print GENFILE " mat$argname[$i] = Tcl_GetMatrixPtr( interp, argv[1+$i] );\n"; + print GENFILE " if (mat$argname[$i] == NULL) return TCL_ERROR;\n"; + print GENFILE " $argname[$i] = mat$argname[$i]-\>idata;\n"; + last getarg; + }; /PLFLT \*/ && do { print GENFILE " mat$argname[$i] = Tcl_GetMatrixPtr( interp, argv[1+$i] );\n"; print GENFILE " if (mat$argname[$i] == NULL) return TCL_ERROR;\n"; @@ -223,6 +238,10 @@ print GENFILE " $argname[$i] = atoi(argv[1+$i]);\n"; last getarg; }; + /PLUNICODE/ && do { + print GENFILE " $argname[$i] = strtoul(argv[1+$i],NULL,10);\n"; + last getarg; + }; /PLFLT/ && do { print GENFILE " $argname[$i] = atof(argv[1+$i]);\n"; last getarg; @@ -290,6 +309,15 @@ last fetch; }; + /PLUNICODE&/ && do { + print GENFILE " sprintf( buf, \"%u\", $argname[$i] );\n"; + print GENFILE " if (argc > 1)\n"; + print GENFILE " Tcl_SetVar( interp, argv[1+$i], buf, 0 );\n"; + print GENFILE " else\n"; + print GENFILE " Tcl_AppendResult( interp, buf, (char *) NULL );\n"; + last fetch; + }; + /char \*/ && do { print GENFILE " if (argc > 1)\n"; print GENFILE " Tcl_SetVar( interp, argv[1+$i], $argname[$i], 0 );\n"; Modified: trunk/bindings/tcl/pltclgen.tcl =================================================================== --- trunk/bindings/tcl/pltclgen.tcl 2008-08-19 16:13:34 UTC (rev 8680) +++ trunk/bindings/tcl/pltclgen.tcl 2008-08-19 19:26:48 UTC (rev 8681) @@ -117,6 +117,9 @@ "PLINT&" { puts $GENFILE " PLINT $argname($i);" } + "PLUNICODE&" { + puts $GENFILE " PLUNICODE $argname($i);" + } "PLFLT&" { puts $GENFILE " PLFLT $argname($i);" } @@ -127,6 +130,10 @@ puts $GENFILE " PLINT *$argname($i);" puts $GENFILE " tclMatrix *mat$argname($i);" } + "PLUNICODE *" { + puts $GENFILE " PLUNICODE *$argname($i);" + puts $GENFILE " tclMatrix *mat$argname($i);" + } "PLFLT *" { puts $GENFILE " PLFLT *$argname($i);" puts $GENFILE " tclMatrix *mat$argname($i);" @@ -166,6 +173,11 @@ puts $GENFILE " if (mat$argname($i) == NULL) return TCL_ERROR;" puts $GENFILE " $argname($i) = mat$argname($i)-\>idata;" } + "PLUNICODE *" { + puts $GENFILE " mat$argname($i) = Tcl_GetMatrixPtr( interp, argv\[1+$i\] );" + puts $GENFILE " if (mat$argname($i) == NULL) return TCL_ERROR;" + puts $GENFILE " $argname($i) = mat$argname($i)-\>idata;" + } "PLFLT \*" { puts $GENFILE " mat$argname($i) = Tcl_GetMatrixPtr( interp, argv\[1+$i\] );" puts $GENFILE " if (mat$argname($i) == NULL) return TCL_ERROR;" @@ -174,6 +186,12 @@ "PLINT" { puts $GENFILE " $argname($i) = atoi(argv\[1+$i\]);" } + "PLUNICODE" { + puts $GENFILE " $argname($i) = strtoul(argv\[1+$i\],NULL,10);" + } + "unsigned int" { + puts $GENFILE " $argname($i) = (unsigned int) strtoul(argv\[1+$i\],NULL,10);" + } "PLFLT" { puts $GENFILE " $argname($i) = atof(argv\[1+$i\]);" } @@ -236,6 +254,14 @@ puts $GENFILE " Tcl_AppendResult( interp, buf, (char *) NULL );" } + "PLUNICODE&" { + puts $GENFILE " sprintf( buf, \"%u\", $argname($i) );" + puts $GENFILE " if (argc > 1)" + puts $GENFILE " Tcl_SetVar( interp, argv\[1+$i\], buf, 0 );" + puts $GENFILE " else" + puts $GENFILE " Tcl_AppendResult( interp, buf, (char *) NULL );" + } + "char *" { puts $GENFILE " if (argc > 1)" puts $GENFILE " Tcl_SetVar( interp, argv\[1+$i\], $argname($i), 0 );" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2008-08-24 10:04:05
|
Revision: 8707 http://plplot.svn.sourceforge.net/plplot/?rev=8707&view=rev Author: arjenmarkus Date: 2008-08-24 10:04:14 +0000 (Sun, 24 Aug 2008) Log Message: ----------- Added error message to Pltcl_Init to indicate "plplot.tcl"was not found Corrected implementation of plrandd - command did not return a value Modified Paths: -------------- trunk/bindings/tcl/plapi.tpl trunk/bindings/tcl/tclAPI.c Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2008-08-23 19:38:14 UTC (rev 8706) +++ trunk/bindings/tcl/plapi.tpl 2008-08-24 10:04:14 UTC (rev 8707) @@ -563,9 +563,10 @@ # Random number generator based on Mersenne Twister. # Obtain real random number in range [0,1]. +# +#pltclcmd plrandd PLFLT +# (AM: does not work, no value return!) -pltclcmd plrandd PLFLT - # Replays contents of plot buffer to current device/file. pltclcmd plreplot void @@ -978,10 +979,10 @@ st PLINT& ############################################################################### -# The rest are kept in as reminders to how Tcl API might be improved +# The rest are kept in as reminders to how Tcl API might be improved # Draws a contour plot from data in f(nx,ny). Is just a front-end to -# plfcont, with a particular choice for f2eval and f2eval_data. +# plfcont, with a particular choice for f2eval and f2eval_data. # void # c_plcont(PLFLT **f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, @@ -991,7 +992,7 @@ # Draws a contour plot using the function evaluator f2eval and data stored # by way of the f2eval_data pointer. This allows arbitrary organizations -# of 2d array data to be used. +# of 2d array data to be used. # void # plfcont(PLFLT (*f2eval) (PLINT, PLINT, PLPointer), @@ -1009,14 +1010,14 @@ # Plot the latitudes and longitudes on the background. -# void -# plmeridians(void (*mapform)(PLINT, PLFLT *, PLFLT *), +# void +# plmeridians(void (*mapform)(PLINT, PLFLT *, PLFLT *), # PLFLT dlong, PLFLT dlat, # PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat); # Shade region. -# void +# void # c_plshade(PLFLT **a, PLINT nx, PLINT ny, const char **defined, # PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, # PLFLT shade_min, PLFLT shade_max, @@ -1027,7 +1028,7 @@ # void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), # PLPointer pltr_data); -# void +# void # plshade1(PLFLT *a, PLINT nx, PLINT ny, const char *defined, # PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, # PLFLT shade_min, PLFLT shade_max, @@ -1038,12 +1039,12 @@ # void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), # PLPointer pltr_data); -# void +# void # plfshade(PLFLT (*f2eval) (PLINT, PLINT, PLPointer), # PLPointer f2eval_data, # PLFLT (*c2eval) (PLINT, PLINT, PLPointer), # PLPointer c2eval_data, -# PLINT nx, PLINT ny, +# PLINT nx, PLINT ny, # PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, # PLFLT shade_min, PLFLT shade_max, # PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, @@ -1128,7 +1129,7 @@ # Return full pathname for given file if executable -# int +# int # plFindName(char *p); # Looks for the specified executable file according to usual search path. @@ -1137,7 +1138,7 @@ # plFindCommand(char *fn); # Gets search name for file by concatenating the dir, subdir, and file -# name, allocating memory as needed. +# name, allocating memory as needed. # void # plGetName(char *dir, char *subdir, char *filename, char **filespec); @@ -1147,7 +1148,7 @@ # int # plGetCursor(PLGraphicsIn *gin); -# Translates relative device coordinates to world coordinates. +# Translates relative device coordinates to world coordinates. # int # plTranslateCursor(PLGraphicsIn *gin); Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2008-08-23 19:38:14 UTC (rev 8706) +++ trunk/bindings/tcl/tclAPI.c 2008-08-24 10:04:14 UTC (rev 8707) @@ -62,6 +62,7 @@ static int plmapCmd (ClientData, Tcl_Interp *, int, const char **); static int plmeridiansCmd (ClientData, Tcl_Interp *, int, const char **); static int plvectCmd (ClientData, Tcl_Interp *, int, const char **); +static int plranddCmd (ClientData, Tcl_Interp *, int, const char **); /* * The following structure defines all of the commands in the PLplot/Tcl @@ -100,6 +101,7 @@ {"plshade", plshadeCmd}, {"plshades", plshadesCmd}, {"plvect", plvectCmd}, + {"plrandd", plranddCmd}, {NULL, NULL} }; @@ -516,6 +518,10 @@ register CmdInfo *cmdInfoPtr; /* This must be before any other Tcl related calls */ if (PlbasicInit(interp) != TCL_OK) { + Tcl_AppendResult(interp, "Could not find plplot.tcl - please set \ +environment variable PL_LIBRARY to the directory containing that file", + (char *) NULL); + return TCL_ERROR; } @@ -2215,6 +2221,26 @@ } /*--------------------------------------------------------------------------*\ + * plranddCmd + * + * Return a random number +\*--------------------------------------------------------------------------*/ + +static int +plranddCmd(ClientData clientData, Tcl_Interp *interp, + int argc, const char **argv) +{ + if (argc != 1) { + Tcl_AppendResult(interp, "wrong # args: ", + argv[0], " takes no arguments", (char *) NULL); + return TCL_ERROR; + } else { + Tcl_SetObjResult(interp, Tcl_NewDoubleObj(plrandd())); + return TCL_OK; + } +} + +/*--------------------------------------------------------------------------*\ * plsetoptCmd * * Processes plsetopt Tcl command. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2008-10-10 20:30:25
|
Revision: 8876 http://plplot.svn.sourceforge.net/plplot/?rev=8876&view=rev Author: airwin Date: 2008-10-10 20:30:22 +0000 (Fri, 10 Oct 2008) Log Message: ----------- Drop PLDLLIMPEXP from source code (except in one case where a function is not declared in a header). Use headers instead for this purpose. Modified Paths: -------------- trunk/bindings/tcl/matrixInit.c trunk/bindings/tcl/tclAPI.c trunk/bindings/tcl/tclMatrix.c Modified: trunk/bindings/tcl/matrixInit.c =================================================================== --- trunk/bindings/tcl/matrixInit.c 2008-10-10 20:27:47 UTC (rev 8875) +++ trunk/bindings/tcl/matrixInit.c 2008-10-10 20:30:22 UTC (rev 8876) @@ -26,7 +26,7 @@ #include "pldll.h" #include "tclMatrix.h" -int PLDLLIMPEXP Matrix_Init( Tcl_Interp *interp ) { +int Matrix_Init( Tcl_Interp *interp ) { /* matrix -- matrix support command */ Tcl_CreateCommand(interp, "matrix", (Tcl_CmdProc *) Tcl_MatrixCmd, Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2008-10-10 20:27:47 UTC (rev 8875) +++ trunk/bindings/tcl/tclAPI.c 2008-10-10 20:30:22 UTC (rev 8876) @@ -126,8 +126,7 @@ #define PL_LIBRARY "" #endif -/* extern char PLDLLIMPEXP * plplotLibDir; */ -extern char PLDLLIMPORT * plplotLibDir; +extern char PLDLLIMPEXP_TCLTK * plplotLibDir; #if (!defined(MAC_TCL) && !defined(__WIN32__)) /* @@ -517,7 +516,7 @@ * interfacing to PLplot. Should not be used in a widget-based system. \*--------------------------------------------------------------------------*/ -int PLDLLIMPEXP +int Pltcl_Init( Tcl_Interp *interp ) { register CmdInfo *cmdInfoPtr; Modified: trunk/bindings/tcl/tclMatrix.c =================================================================== --- trunk/bindings/tcl/tclMatrix.c 2008-10-10 20:27:47 UTC (rev 8875) +++ trunk/bindings/tcl/tclMatrix.c 2008-10-10 20:30:22 UTC (rev 8876) @@ -349,7 +349,7 @@ * \*--------------------------------------------------------------------------*/ -tclMatrix PLDLLIMPEXP * +tclMatrix * Tcl_GetMatrixPtr(Tcl_Interp *interp, const char *matName) { Tcl_HashEntry *hPtr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-08-25 14:36:56
|
Revision: 10328 http://plplot.svn.sourceforge.net/plplot/?rev=10328&view=rev Author: andrewross Date: 2009-08-25 14:36:42 +0000 (Tue, 25 Aug 2009) Log Message: ----------- Use Tcl_PrintDouble to convert doubles to strings. This takes note of the tcl_precision variable and ensures the returned string is always a double (i.e. contains a decimal place or an exponent). Modified Paths: -------------- trunk/bindings/tcl/pltclgen.tcl trunk/bindings/tcl/tclMatrix.c Modified: trunk/bindings/tcl/pltclgen.tcl =================================================================== --- trunk/bindings/tcl/pltclgen.tcl 2009-08-25 13:07:06 UTC (rev 10327) +++ trunk/bindings/tcl/pltclgen.tcl 2009-08-25 14:36:42 UTC (rev 10328) @@ -281,7 +281,7 @@ # precision standard (global var tcl_precision). "PLFLT&" { - puts $GENFILE " sprintf( buf, \"%.20g\", $argname($i) );" + puts $GENFILE " Tcl_PrintDouble( interp, $argname($i), buf );" puts $GENFILE " if (argc > 1)" puts $GENFILE " Tcl_SetVar( interp, argv\[1+$i\], buf, 0 );" puts $GENFILE " else"; Modified: trunk/bindings/tcl/tclMatrix.c =================================================================== --- trunk/bindings/tcl/tclMatrix.c 2009-08-25 13:07:06 UTC (rev 10327) +++ trunk/bindings/tcl/tclMatrix.c 2009-08-25 14:36:42 UTC (rev 10328) @@ -642,7 +642,8 @@ Mat_float max = matPtr->fdata[0]; for (i = 1; i < len; i++) max = MAX(max, matPtr->fdata[i]); - sprintf(tmp, "%.17g", max); + /*sprintf(tmp, "%.17g", max);*/ + Tcl_PrintDouble(interp, max, tmp); Tcl_AppendResult(interp, tmp, (char *) NULL); break; } @@ -678,7 +679,8 @@ Mat_float min = matPtr->fdata[0]; for (i = 1; i < len; i++) min = MIN(min, matPtr->fdata[i]); - sprintf(tmp, "%.17g", min); + /*sprintf(tmp, "%.17g", min);*/ + Tcl_PrintDouble(interp, min, tmp); Tcl_AppendResult(interp, tmp, (char *) NULL); break; } @@ -891,7 +893,8 @@ tclMatrix *matPtr = (tclMatrix *) clientData; double value = matPtr->fdata[index]; - sprintf(string, "%.17g", value); + /*sprintf(string, "%.17g", value);*/ + Tcl_PrintDouble(interp, value, string); } static void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-02-12 20:11:31
|
Revision: 11561 http://plplot.svn.sourceforge.net/plplot/?rev=11561&view=rev Author: airwin Date: 2011-02-12 20:11:25 +0000 (Sat, 12 Feb 2011) Log Message: ----------- Create custom target check_tcl_parameters that uses the sed script bindings/tcl/global_defines.sed to check the consistency of bindings/tcl/plplot_parameters.h with the #defines in bindings/swig-support/plplotcapi.i. Modified Paths: -------------- trunk/bindings/tcl/CMakeLists.txt Added Paths: ----------- trunk/bindings/tcl/global_defines.sed Modified: trunk/bindings/tcl/CMakeLists.txt =================================================================== --- trunk/bindings/tcl/CMakeLists.txt 2011-02-12 18:24:09 UTC (rev 11560) +++ trunk/bindings/tcl/CMakeLists.txt 2011-02-12 20:11:25 UTC (rev 11561) @@ -20,6 +20,22 @@ if(ENABLE_tcl) + # Check consistency of plplot_parameters.h. + add_custom_target( + check_tcl_parameters + COMMAND ${CMAKE_COMMAND} -E remove -f + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h_compare + COMMAND + sed -f ${CMAKE_CURRENT_SOURCE_DIR}/global_defines.sed < + ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i > + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h_compare + COMMAND + ${CMAKE_COMMAND} -E echo "Check that plplot_parameters.h is consistent with the #defines in bindings/swig-support/plplotcapi.i" + COMMAND + cmp ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.h + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h_compare + ) + # tclmatrix set(tclmatrix${LIB_TAG}_LIB_SRCS tclMatrix.c Added: trunk/bindings/tcl/global_defines.sed =================================================================== --- trunk/bindings/tcl/global_defines.sed (rev 0) +++ trunk/bindings/tcl/global_defines.sed 2011-02-12 20:11:25 UTC (rev 11561) @@ -0,0 +1,43 @@ +# sed script specifically designed to parse the #define statements in +# bindings/swig-support/plplotcapi.i into a file that can be used for +# global variable definitions for tcl. + +# Insert text at the start: +1 i\ +// Do not edit this generated file. Instead, check its consistency\ +// with the #defines in bindings/swig-support/plplotcapi.i using the\ +// (Unix) target "check_tcl_parameters". If that target reports an\ +// inconsistency (via a cmp message) between the generated\ +// plplot_parameters.h_compare file in the build tree and\ +// plplot_parameters.h in the source tree, then copy\ +// plplot_parameters.h_compare on top of plplot_parameters.h and\ +// check in that result.\ +\ +// This file contains a function to set the various global variables\ +// used by PLplot\ +\ +static void set_plplot_parameters( Tcl_Interp *interp ) {\ +\ + Tcl_Eval( interp, "namespace eval ::PLPLOT { \\n\\ + +# Append text at the end: +$ a\ +}" );\ +\ +} +# Drop every line that is not a #define +/^#define/! d + +# Drop specific #defines from the file that are not available +# because of specific #if statements. +/^#define ZEROW/ d +/^#define ONEW/ d +/OBJECT_DATA/ d +/^#define pltr_img/ d + +# Translate trailing comment identifier into # trailing comment. +/^#define/ s?//?#? + +# Parse what is left while preserving trailing comments. Watch out +# for parentheses around value as well. +/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(.*\)$?\\n\\\n\3\\n\\\nvariable \1 \2 \\n\\? Property changes on: trunk/bindings/tcl/global_defines.sed ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-11-30 22:09:14
|
Revision: 12078 http://plplot.svn.sourceforge.net/plplot/?rev=12078&view=rev Author: andrewross Date: 2011-11-30 22:09:07 +0000 (Wed, 30 Nov 2011) Log Message: ----------- The char * cmd argument passed to Tcl_MatrixInstallXtns is not modified, so mark it as const. Fixes some compiler warnings. Modified Paths: -------------- trunk/bindings/tcl/tclMatrix.c trunk/bindings/tcl/tclMatrix.h Modified: trunk/bindings/tcl/tclMatrix.c =================================================================== --- trunk/bindings/tcl/tclMatrix.c 2011-11-30 22:04:42 UTC (rev 12077) +++ trunk/bindings/tcl/tclMatrix.c 2011-11-30 22:09:07 UTC (rev 12078) @@ -407,7 +407,7 @@ static tclMatrixXtnsnDescr *tail = (tclMatrixXtnsnDescr *) NULL; int -Tcl_MatrixInstallXtnsn( char *cmd, tclMatrixXtnsnProc proc ) +Tcl_MatrixInstallXtnsn( const char *cmd, tclMatrixXtnsnProc proc ) { // // My goodness how I hate primitive/pathetic C. With C++ this Modified: trunk/bindings/tcl/tclMatrix.h =================================================================== --- trunk/bindings/tcl/tclMatrix.h 2011-11-30 22:04:42 UTC (rev 12077) +++ trunk/bindings/tcl/tclMatrix.h 2011-11-30 22:09:07 UTC (rev 12078) @@ -353,7 +353,7 @@ struct tclMatrixXtnsnDescr *next; } tclMatrixXtnsnDescr; -int PLDLLIMPEXP_TCLMAT Tcl_MatrixInstallXtnsn( char *cmd, tclMatrixXtnsnProc proc ); +int PLDLLIMPEXP_TCLMAT Tcl_MatrixInstallXtnsn( const char *cmd, tclMatrixXtnsnProc proc ); #ifdef __cplusplus } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-13 19:58:59
|
Revision: 12692 http://sourceforge.net/p/plplot/code/12692 Author: airwin Date: 2013-11-13 19:58:55 +0000 (Wed, 13 Nov 2013) Log Message: ----------- For historical reasons ZEROW2B, ZEROW2D, ONEW2B, and ONEW2D were dropped from the Tcl constants, but since those are correctly #defined in plplot.h and not dropped by any other language include those constants. Make important fix for all tcl constants in the PLPLOT namespace which is to process them with expr to convert the hexadecimal form to decimal. It turns out the hexadecimal form never worked previously, but we didn't know that because only constants that were unused in our tcl standard examples were expressed as hexadecimal. But since the recent repropagation effort based on the numerical macros in plplot.h (many of which were in hexadecimal form) a much larger fraction of the tcl constants were in hexadecimal form and this (until the present fix to convert all tcl constants to decimal form) completely screwed up standard example 33 results for tcl. Tested by: Alan W. Irwin <ai...@us...> on Linux using the test_diff_psc target. Modified Paths: -------------- trunk/bindings/tcl/global_defines.sed trunk/bindings/tcl/plplot_parameters.h Modified: trunk/bindings/tcl/global_defines.sed =================================================================== --- trunk/bindings/tcl/global_defines.sed 2013-11-13 19:27:17 UTC (rev 12691) +++ trunk/bindings/tcl/global_defines.sed 2013-11-13 19:58:55 UTC (rev 12692) @@ -29,8 +29,6 @@ # Drop specific #defines from the file that are not available # because of specific #if statements. -/^#define ZEROW/ d -/^#define ONEW/ d /OBJECT_DATA/ d /^#define pltr_img/ d @@ -38,8 +36,9 @@ /^#define/ s?//?#? # Parse what is left while preserving trailing comments. Watch out -# for parentheses around value as well. -/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(.*\)$?\\n\\\n\3\\n\\\nvariable \1 \2\\n\\? +# for parentheses around value as well. Use the expr syntax to +# convert all hexadecimal constants to integers. +/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(.*\)$?\\n\\\n\3\\n\\\nvariable \1 [expr \2]\\n\\? # Append extra constants not #defined in plplotcapi.i after PL_NOTSET # is processed. Modified: trunk/bindings/tcl/plplot_parameters.h =================================================================== --- trunk/bindings/tcl/plplot_parameters.h 2013-11-13 19:27:17 UTC (rev 12691) +++ trunk/bindings/tcl/plplot_parameters.h 2013-11-13 19:58:55 UTC (rev 12692) @@ -15,465 +15,477 @@ Tcl_Eval( interp, "namespace eval ::PLPLOT { \n\ \n\ # obsolete\n\ -variable PLESC_SET_RGB 1\n\ +variable PLESC_SET_RGB [expr 1]\n\ \n\ # obsolete\n\ -variable PLESC_ALLOC_NCOL 2\n\ +variable PLESC_ALLOC_NCOL [expr 2]\n\ \n\ # obsolete\n\ -variable PLESC_SET_LPB 3\n\ +variable PLESC_SET_LPB [expr 3]\n\ \n\ # handle window expose\n\ -variable PLESC_EXPOSE 4\n\ +variable PLESC_EXPOSE [expr 4]\n\ \n\ # handle window resize\n\ -variable PLESC_RESIZE 5\n\ +variable PLESC_RESIZE [expr 5]\n\ \n\ # handle window redraw\n\ -variable PLESC_REDRAW 6\n\ +variable PLESC_REDRAW [expr 6]\n\ \n\ # switch to text screen\n\ -variable PLESC_TEXT 7\n\ +variable PLESC_TEXT [expr 7]\n\ \n\ # switch to graphics screen\n\ -variable PLESC_GRAPH 8\n\ +variable PLESC_GRAPH [expr 8]\n\ \n\ # fill polygon\n\ -variable PLESC_FILL 9\n\ +variable PLESC_FILL [expr 9]\n\ \n\ # handle DI command\n\ -variable PLESC_DI 10\n\ +variable PLESC_DI [expr 10]\n\ \n\ # flush output\n\ -variable PLESC_FLUSH 11\n\ +variable PLESC_FLUSH [expr 11]\n\ \n\ # handle Window events\n\ -variable PLESC_EH 12\n\ +variable PLESC_EH [expr 12]\n\ \n\ # get cursor position\n\ -variable PLESC_GETC 13\n\ +variable PLESC_GETC [expr 13]\n\ \n\ # set window parameters\n\ -variable PLESC_SWIN 14\n\ +variable PLESC_SWIN [expr 14]\n\ \n\ # configure double buffering\n\ -variable PLESC_DOUBLEBUFFERING 15\n\ +variable PLESC_DOUBLEBUFFERING [expr 15]\n\ \n\ # set xor mode\n\ -variable PLESC_XORMOD 16\n\ +variable PLESC_XORMOD [expr 16]\n\ \n\ # AFR: set compression\n\ -variable PLESC_SET_COMPRESSION 17\n\ +variable PLESC_SET_COMPRESSION [expr 17]\n\ \n\ # RL: clear graphics region\n\ -variable PLESC_CLEAR 18\n\ +variable PLESC_CLEAR [expr 18]\n\ \n\ # RL: draw dashed line\n\ -variable PLESC_DASH 19\n\ +variable PLESC_DASH [expr 19]\n\ \n\ # driver draws text\n\ -variable PLESC_HAS_TEXT 20\n\ +variable PLESC_HAS_TEXT [expr 20]\n\ \n\ # handle image\n\ -variable PLESC_IMAGE 21\n\ +variable PLESC_IMAGE [expr 21]\n\ \n\ # plimage related operations\n\ -variable PLESC_IMAGEOPS 22\n\ +variable PLESC_IMAGEOPS [expr 22]\n\ \n\ # convert PLColor to device color\n\ -variable PLESC_PL2DEVCOL 23\n\ +variable PLESC_PL2DEVCOL [expr 23]\n\ \n\ # convert device color to PLColor\n\ -variable PLESC_DEV2PLCOL 24\n\ +variable PLESC_DEV2PLCOL [expr 24]\n\ \n\ # set BG, FG colors\n\ -variable PLESC_SETBGFG 25\n\ +variable PLESC_SETBGFG [expr 25]\n\ \n\ # alternate device initialization\n\ -variable PLESC_DEVINIT 26\n\ +variable PLESC_DEVINIT [expr 26]\n\ \n\ # get used backend of (wxWidgets) driver\n\ -variable PLESC_GETBACKEND 27\n\ +variable PLESC_GETBACKEND [expr 27]\n\ \n\ # get ready to draw a line of text\n\ -variable PLESC_BEGIN_TEXT 28\n\ +variable PLESC_BEGIN_TEXT [expr 28]\n\ \n\ # render a character of text\n\ -variable PLESC_TEXT_CHAR 29\n\ +variable PLESC_TEXT_CHAR [expr 29]\n\ \n\ # handle a text control character (super/subscript, etc.)\n\ -variable PLESC_CONTROL_CHAR 30\n\ +variable PLESC_CONTROL_CHAR [expr 30]\n\ \n\ # finish a drawing a line of text\n\ -variable PLESC_END_TEXT 31\n\ +variable PLESC_END_TEXT [expr 31]\n\ \n\ # start rasterized rendering\n\ -variable PLESC_START_RASTERIZE 32\n\ +variable PLESC_START_RASTERIZE [expr 32]\n\ \n\ # end rasterized rendering\n\ -variable PLESC_END_RASTERIZE 33\n\ +variable PLESC_END_RASTERIZE [expr 33]\n\ \n\ # render an arc\n\ -variable PLESC_ARC 34\n\ +variable PLESC_ARC [expr 34]\n\ \n\ # render a gradient\n\ -variable PLESC_GRADIENT 35\n\ +variable PLESC_GRADIENT [expr 35]\n\ \n\ # set drawing mode\n\ -variable PLESC_MODESET 36\n\ +variable PLESC_MODESET [expr 36]\n\ \n\ # get drawing mode\n\ -variable PLESC_MODEGET 37\n\ +variable PLESC_MODEGET [expr 37]\n\ \n\ # font change in the text stream\n\ -variable PLTEXT_FONTCHANGE 0\n\ +variable PLTEXT_FONTCHANGE [expr 0]\n\ \n\ # superscript in the text stream\n\ -variable PLTEXT_SUPERSCRIPT 1\n\ +variable PLTEXT_SUPERSCRIPT [expr 1]\n\ \n\ # subscript in the text stream\n\ -variable PLTEXT_SUBSCRIPT 2\n\ +variable PLTEXT_SUBSCRIPT [expr 2]\n\ \n\ # back-char in the text stream\n\ -variable PLTEXT_BACKCHAR 3\n\ +variable PLTEXT_BACKCHAR [expr 3]\n\ \n\ # toggle overline in the text stream\n\ -variable PLTEXT_OVERLINE 4\n\ +variable PLTEXT_OVERLINE [expr 4]\n\ \n\ # toggle underline in the text stream\n\ -variable PLTEXT_UNDERLINE 5\n\ +variable PLTEXT_UNDERLINE [expr 5]\n\ \n\ +\n\ +variable ZEROW2B [expr 1]\n\ +\n\ +\n\ +variable ZEROW2D [expr 2]\n\ +\n\ +\n\ +variable ONEW2B [expr 3]\n\ +\n\ +\n\ +variable ONEW2D [expr 4]\n\ +\n\ # device coordinates\n\ -variable PLSWIN_DEVICE 1\n\ +variable PLSWIN_DEVICE [expr 1]\n\ \n\ # world coordinates\n\ -variable PLSWIN_WORLD 2\n\ +variable PLSWIN_WORLD [expr 2]\n\ \n\ # The x-axis\n\ -variable PL_X_AXIS 1\n\ +variable PL_X_AXIS [expr 1]\n\ \n\ # The y-axis\n\ -variable PL_Y_AXIS 2\n\ +variable PL_Y_AXIS [expr 2]\n\ \n\ # The z-axis\n\ -variable PL_Z_AXIS 3\n\ +variable PL_Z_AXIS [expr 3]\n\ \n\ # Obsolete\n\ -variable PL_OPT_ENABLED 0x0001\n\ +variable PL_OPT_ENABLED [expr 0x0001]\n\ \n\ # Option has an argment\n\ -variable PL_OPT_ARG 0x0002\n\ +variable PL_OPT_ARG [expr 0x0002]\n\ \n\ # Don't delete after processing\n\ -variable PL_OPT_NODELETE 0x0004\n\ +variable PL_OPT_NODELETE [expr 0x0004]\n\ \n\ # Make invisible\n\ -variable PL_OPT_INVISIBLE 0x0008\n\ +variable PL_OPT_INVISIBLE [expr 0x0008]\n\ \n\ # Processing is disabled\n\ -variable PL_OPT_DISABLED 0x0010\n\ +variable PL_OPT_DISABLED [expr 0x0010]\n\ \n\ # Call handler function\n\ -variable PL_OPT_FUNC 0x0100\n\ +variable PL_OPT_FUNC [expr 0x0100]\n\ \n\ # Set *var = 1\n\ -variable PL_OPT_BOOL 0x0200\n\ +variable PL_OPT_BOOL [expr 0x0200]\n\ \n\ # Set *var = atoi(optarg)\n\ -variable PL_OPT_INT 0x0400\n\ +variable PL_OPT_INT [expr 0x0400]\n\ \n\ # Set *var = atof(optarg)\n\ -variable PL_OPT_FLOAT 0x0800\n\ +variable PL_OPT_FLOAT [expr 0x0800]\n\ \n\ # Set var = optarg\n\ -variable PL_OPT_STRING 0x1000\n\ +variable PL_OPT_STRING [expr 0x1000]\n\ \n\ # For backward compatibility\n\ -variable PL_PARSE_PARTIAL 0x0000\n\ +variable PL_PARSE_PARTIAL [expr 0x0000]\n\ \n\ # Process fully & exit if error\n\ -variable PL_PARSE_FULL 0x0001\n\ +variable PL_PARSE_FULL [expr 0x0001]\n\ \n\ # Don't issue messages\n\ -variable PL_PARSE_QUIET 0x0002\n\ +variable PL_PARSE_QUIET [expr 0x0002]\n\ \n\ # Don't delete options after\n\ -variable PL_PARSE_NODELETE 0x0004\n\ +variable PL_PARSE_NODELETE [expr 0x0004]\n\ \n\ # Show invisible options\n\ -variable PL_PARSE_SHOWALL 0x0008\n\ +variable PL_PARSE_SHOWALL [expr 0x0008]\n\ \n\ # Obsolete\n\ -variable PL_PARSE_OVERRIDE 0x0010\n\ +variable PL_PARSE_OVERRIDE [expr 0x0010]\n\ \n\ # Program name NOT in *argv[0]..\n\ -variable PL_PARSE_NOPROGRAM 0x0020\n\ +variable PL_PARSE_NOPROGRAM [expr 0x0020]\n\ \n\ # Set if leading dash NOT required\n\ -variable PL_PARSE_NODASH 0x0040\n\ +variable PL_PARSE_NODASH [expr 0x0040]\n\ \n\ # Skip over unrecognized args\n\ -variable PL_PARSE_SKIP 0x0080\n\ +variable PL_PARSE_SKIP [expr 0x0080]\n\ \n\ \n\ -variable PL_FCI_MARK 0x80000000\n\ +variable PL_FCI_MARK [expr 0x80000000]\n\ \n\ \n\ -variable PL_FCI_IMPOSSIBLE 0x00000000\n\ +variable PL_FCI_IMPOSSIBLE [expr 0x00000000]\n\ \n\ \n\ -variable PL_FCI_HEXDIGIT_MASK 0xf\n\ +variable PL_FCI_HEXDIGIT_MASK [expr 0xf]\n\ \n\ \n\ -variable PL_FCI_HEXPOWER_MASK 0x7\n\ +variable PL_FCI_HEXPOWER_MASK [expr 0x7]\n\ \n\ \n\ -variable PL_FCI_HEXPOWER_IMPOSSIBLE 0xf\n\ +variable PL_FCI_HEXPOWER_IMPOSSIBLE [expr 0xf]\n\ \n\ \n\ -variable PL_FCI_FAMILY 0x0\n\ +variable PL_FCI_FAMILY [expr 0x0]\n\ \n\ \n\ -variable PL_FCI_STYLE 0x1\n\ +variable PL_FCI_STYLE [expr 0x1]\n\ \n\ \n\ -variable PL_FCI_WEIGHT 0x2\n\ +variable PL_FCI_WEIGHT [expr 0x2]\n\ \n\ \n\ -variable PL_FCI_SANS 0x0\n\ +variable PL_FCI_SANS [expr 0x0]\n\ \n\ \n\ -variable PL_FCI_SERIF 0x1\n\ +variable PL_FCI_SERIF [expr 0x1]\n\ \n\ \n\ -variable PL_FCI_MONO 0x2\n\ +variable PL_FCI_MONO [expr 0x2]\n\ \n\ \n\ -variable PL_FCI_SCRIPT 0x3\n\ +variable PL_FCI_SCRIPT [expr 0x3]\n\ \n\ \n\ -variable PL_FCI_SYMBOL 0x4\n\ +variable PL_FCI_SYMBOL [expr 0x4]\n\ \n\ \n\ -variable PL_FCI_UPRIGHT 0x0\n\ +variable PL_FCI_UPRIGHT [expr 0x0]\n\ \n\ \n\ -variable PL_FCI_ITALIC 0x1\n\ +variable PL_FCI_ITALIC [expr 0x1]\n\ \n\ \n\ -variable PL_FCI_OBLIQUE 0x2\n\ +variable PL_FCI_OBLIQUE [expr 0x2]\n\ \n\ \n\ -variable PL_FCI_MEDIUM 0x0\n\ +variable PL_FCI_MEDIUM [expr 0x0]\n\ \n\ \n\ -variable PL_FCI_BOLD 0x1\n\ +variable PL_FCI_BOLD [expr 0x1]\n\ \n\ \n\ -variable PL_MAXKEY 16\n\ +variable PL_MAXKEY [expr 16]\n\ \n\ # Max number of windows/page tracked\n\ -variable PL_MAXWINDOWS 64\n\ +variable PL_MAXWINDOWS [expr 64]\n\ \n\ \n\ -variable PL_NOTSET -42\n\ +variable PL_NOTSET [expr -42]\n\ \n\ \n\ variable PL_PI 3.1415926535897932384\n\ \n\ \n\ -variable PLESC_DOUBLEBUFFERING_ENABLE 1\n\ +variable PLESC_DOUBLEBUFFERING_ENABLE [expr 1]\n\ \n\ \n\ -variable PLESC_DOUBLEBUFFERING_DISABLE 2\n\ +variable PLESC_DOUBLEBUFFERING_DISABLE [expr 2]\n\ \n\ \n\ -variable PLESC_DOUBLEBUFFERING_QUERY 3\n\ +variable PLESC_DOUBLEBUFFERING_QUERY [expr 3]\n\ \n\ \n\ -variable PL_BIN_DEFAULT 0x0\n\ +variable PL_BIN_DEFAULT [expr 0x0]\n\ \n\ \n\ -variable PL_BIN_CENTRED 0x1\n\ +variable PL_BIN_CENTRED [expr 0x1]\n\ \n\ \n\ -variable PL_BIN_NOEXPAND 0x2\n\ +variable PL_BIN_NOEXPAND [expr 0x2]\n\ \n\ \n\ -variable PL_BIN_NOEMPTY 0x4\n\ +variable PL_BIN_NOEMPTY [expr 0x4]\n\ \n\ # Bivariate Cubic Spline approximation\n\ -variable GRID_CSA 1\n\ +variable GRID_CSA [expr 1]\n\ \n\ # Delaunay Triangulation Linear Interpolation\n\ -variable GRID_DTLI 2\n\ +variable GRID_DTLI [expr 2]\n\ \n\ # Natural Neighbors Interpolation\n\ -variable GRID_NNI 3\n\ +variable GRID_NNI [expr 3]\n\ \n\ # Nearest Neighbors Inverse Distance Weighted\n\ -variable GRID_NNIDW 4\n\ +variable GRID_NNIDW [expr 4]\n\ \n\ # Nearest Neighbors Linear Interpolation\n\ -variable GRID_NNLI 5\n\ +variable GRID_NNLI [expr 5]\n\ \n\ # Nearest Neighbors Around Inverse Distance Weighted\n\ -variable GRID_NNAIDW 6\n\ +variable GRID_NNAIDW [expr 6]\n\ \n\ \n\ -variable PL_HIST_DEFAULT 0x00\n\ +variable PL_HIST_DEFAULT [expr 0x00]\n\ \n\ \n\ -variable PL_HIST_NOSCALING 0x01\n\ +variable PL_HIST_NOSCALING [expr 0x01]\n\ \n\ \n\ -variable PL_HIST_IGNORE_OUTLIERS 0x02\n\ +variable PL_HIST_IGNORE_OUTLIERS [expr 0x02]\n\ \n\ \n\ -variable PL_HIST_NOEXPAND 0x08\n\ +variable PL_HIST_NOEXPAND [expr 0x08]\n\ \n\ \n\ -variable PL_HIST_NOEMPTY 0x10\n\ +variable PL_HIST_NOEMPTY [expr 0x10]\n\ \n\ \n\ -variable PL_POSITION_LEFT 0x1\n\ +variable PL_POSITION_LEFT [expr 0x1]\n\ \n\ \n\ -variable PL_POSITION_RIGHT 0x2\n\ +variable PL_POSITION_RIGHT [expr 0x2]\n\ \n\ \n\ -variable PL_POSITION_TOP 0x4\n\ +variable PL_POSITION_TOP [expr 0x4]\n\ \n\ \n\ -variable PL_POSITION_BOTTOM 0x8\n\ +variable PL_POSITION_BOTTOM [expr 0x8]\n\ \n\ \n\ -variable PL_POSITION_INSIDE 0x10\n\ +variable PL_POSITION_INSIDE [expr 0x10]\n\ \n\ \n\ -variable PL_POSITION_OUTSIDE 0x20\n\ +variable PL_POSITION_OUTSIDE [expr 0x20]\n\ \n\ \n\ -variable PL_POSITION_VIEWPORT 0x40\n\ +variable PL_POSITION_VIEWPORT [expr 0x40]\n\ \n\ \n\ -variable PL_POSITION_SUBPAGE 0x80\n\ +variable PL_POSITION_SUBPAGE [expr 0x80]\n\ \n\ \n\ -variable PL_LEGEND_NONE 0x1\n\ +variable PL_LEGEND_NONE [expr 0x1]\n\ \n\ \n\ -variable PL_LEGEND_COLOR_BOX 0x2\n\ +variable PL_LEGEND_COLOR_BOX [expr 0x2]\n\ \n\ \n\ -variable PL_LEGEND_LINE 0x4\n\ +variable PL_LEGEND_LINE [expr 0x4]\n\ \n\ \n\ -variable PL_LEGEND_SYMBOL 0x8\n\ +variable PL_LEGEND_SYMBOL [expr 0x8]\n\ \n\ \n\ -variable PL_LEGEND_TEXT_LEFT 0x10\n\ +variable PL_LEGEND_TEXT_LEFT [expr 0x10]\n\ \n\ \n\ -variable PL_LEGEND_BACKGROUND 0x20\n\ +variable PL_LEGEND_BACKGROUND [expr 0x20]\n\ \n\ \n\ -variable PL_LEGEND_BOUNDING_BOX 0x40\n\ +variable PL_LEGEND_BOUNDING_BOX [expr 0x40]\n\ \n\ \n\ -variable PL_LEGEND_ROW_MAJOR 0x80\n\ +variable PL_LEGEND_ROW_MAJOR [expr 0x80]\n\ \n\ \n\ -variable PL_COLORBAR_LABEL_LEFT 0x1\n\ +variable PL_COLORBAR_LABEL_LEFT [expr 0x1]\n\ \n\ \n\ -variable PL_COLORBAR_LABEL_RIGHT 0x2\n\ +variable PL_COLORBAR_LABEL_RIGHT [expr 0x2]\n\ \n\ \n\ -variable PL_COLORBAR_LABEL_TOP 0x4\n\ +variable PL_COLORBAR_LABEL_TOP [expr 0x4]\n\ \n\ \n\ -variable PL_COLORBAR_LABEL_BOTTOM 0x8\n\ +variable PL_COLORBAR_LABEL_BOTTOM [expr 0x8]\n\ \n\ \n\ -variable PL_COLORBAR_IMAGE 0x10\n\ +variable PL_COLORBAR_IMAGE [expr 0x10]\n\ \n\ \n\ -variable PL_COLORBAR_SHADE 0x20\n\ +variable PL_COLORBAR_SHADE [expr 0x20]\n\ \n\ \n\ -variable PL_COLORBAR_GRADIENT 0x40\n\ +variable PL_COLORBAR_GRADIENT [expr 0x40]\n\ \n\ \n\ -variable PL_COLORBAR_CAP_NONE 0x80\n\ +variable PL_COLORBAR_CAP_NONE [expr 0x80]\n\ \n\ \n\ -variable PL_COLORBAR_CAP_LOW 0x100\n\ +variable PL_COLORBAR_CAP_LOW [expr 0x100]\n\ \n\ \n\ -variable PL_COLORBAR_CAP_HIGH 0x200\n\ +variable PL_COLORBAR_CAP_HIGH [expr 0x200]\n\ \n\ \n\ -variable PL_COLORBAR_SHADE_LABEL 0x400\n\ +variable PL_COLORBAR_SHADE_LABEL [expr 0x400]\n\ \n\ \n\ -variable PL_COLORBAR_ORIENT_RIGHT 0x800\n\ +variable PL_COLORBAR_ORIENT_RIGHT [expr 0x800]\n\ \n\ \n\ -variable PL_COLORBAR_ORIENT_TOP 0x1000\n\ +variable PL_COLORBAR_ORIENT_TOP [expr 0x1000]\n\ \n\ \n\ -variable PL_COLORBAR_ORIENT_LEFT 0x2000\n\ +variable PL_COLORBAR_ORIENT_LEFT [expr 0x2000]\n\ \n\ \n\ -variable PL_COLORBAR_ORIENT_BOTTOM 0x4000\n\ +variable PL_COLORBAR_ORIENT_BOTTOM [expr 0x4000]\n\ \n\ \n\ -variable PL_COLORBAR_BACKGROUND 0x8000\n\ +variable PL_COLORBAR_BACKGROUND [expr 0x8000]\n\ \n\ \n\ -variable PL_COLORBAR_BOUNDING_BOX 0x10000\n\ +variable PL_COLORBAR_BOUNDING_BOX [expr 0x10000]\n\ \n\ \n\ -variable PL_DRAWMODE_UNKNOWN 0x0\n\ +variable PL_DRAWMODE_UNKNOWN [expr 0x0]\n\ \n\ \n\ -variable PL_DRAWMODE_DEFAULT 0x1\n\ +variable PL_DRAWMODE_DEFAULT [expr 0x1]\n\ \n\ \n\ -variable PL_DRAWMODE_REPLACE 0x2\n\ +variable PL_DRAWMODE_REPLACE [expr 0x2]\n\ \n\ \n\ -variable PL_DRAWMODE_XOR 0x4\n\ +variable PL_DRAWMODE_XOR [expr 0x4]\n\ \n\ # draw lines parallel to the X axis\n\ -variable DRAW_LINEX 0x001\n\ +variable DRAW_LINEX [expr 0x001]\n\ \n\ # draw lines parallel to the Y axis\n\ -variable DRAW_LINEY 0x002\n\ +variable DRAW_LINEY [expr 0x002]\n\ \n\ # draw lines parallel to both the X and Y axis\n\ -variable DRAW_LINEXY 0x003\n\ +variable DRAW_LINEXY [expr 0x003]\n\ \n\ # draw the mesh with a color dependent of the magnitude\n\ -variable MAG_COLOR 0x004\n\ +variable MAG_COLOR [expr 0x004]\n\ \n\ # draw contour plot at bottom xy plane\n\ -variable BASE_CONT 0x008\n\ +variable BASE_CONT [expr 0x008]\n\ \n\ # draw contour plot at top xy plane\n\ -variable TOP_CONT 0x010\n\ +variable TOP_CONT [expr 0x010]\n\ \n\ # draw contour plot at surface\n\ -variable SURF_CONT 0x020\n\ +variable SURF_CONT [expr 0x020]\n\ \n\ # draw sides\n\ -variable DRAW_SIDES 0x040\n\ +variable DRAW_SIDES [expr 0x040]\n\ \n\ # draw outline for each square that makes up the surface\n\ -variable FACETED 0x080\n\ +variable FACETED [expr 0x080]\n\ \n\ # draw mesh\n\ -variable MESH 0x100\n\ +variable MESH [expr 0x100]\n\ }" ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2009-01-15 18:31:57
|
Revision: 9313 http://plplot.svn.sourceforge.net/plplot/?rev=9313&view=rev Author: arjenmarkus Date: 2009-01-15 18:31:47 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Implementation of the plstrip* functions Modified Paths: -------------- trunk/bindings/tcl/plapi.tpl trunk/bindings/tcl/tclAPI.c Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2009-01-15 16:23:34 UTC (rev 9312) +++ trunk/bindings/tcl/plapi.tpl 2009-01-15 18:31:47 UTC (rev 9313) @@ -855,6 +855,19 @@ nx PLINT ny PLINT +# Add data to the strip chart + +pltclcmd plstripa void +id PLINT +pen PLINT +x PLFLT +y PLFLT + +# Destroy the strip chart + +pltclcmd plstripd void +id PLINT + # Set up a new line style. pltclcmd plstyl void Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2009-01-15 16:23:34 UTC (rev 9312) +++ trunk/bindings/tcl/tclAPI.c 2009-01-15 18:31:47 UTC (rev 9313) @@ -65,6 +65,7 @@ static int plgriddataCmd (ClientData, Tcl_Interp *, int, const char **); static int plimageCmd (ClientData, Tcl_Interp *, int, const char **); static int plimagefrCmd(ClientData, Tcl_Interp *, int, const char **); +static int plstripcCmd (ClientData, Tcl_Interp *, int, const char **); /* * The following structure defines all of the commands in the PLplot/Tcl @@ -107,6 +108,7 @@ {"plgriddata", plgriddataCmd}, {"plimage", plimageCmd}, {"plimagefr", plimagefrCmd}, + {"plstripc", plstripcCmd}, {NULL, NULL} }; @@ -2831,7 +2833,6 @@ mapform(PLINT n, PLFLT *x, PLFLT *y) { int i; - double xp, yp, radius; char *cmd; tclMatrix *xPtr, *yPtr; @@ -2904,7 +2905,6 @@ PLFLT minlong, maxlong, minlat, maxlat; PLINT transform; PLINT idxname; - char cmd[40]; return_code = TCL_OK; if (argc < 6 || argc > 7) { @@ -3270,3 +3270,103 @@ return TCL_OK; } + +/*--------------------------------------------------------------------------*\ + * plstripcCmd + * + * Processes plstripc Tcl command. +\*--------------------------------------------------------------------------*/ +static int +plstripcCmd( ClientData clientData, Tcl_Interp *interp, + int argc, const char *argv[] ) +{ + int i; + int id; + char *xspec; + char *yspec; + char *idName; + tclMatrix *colMat; + tclMatrix *styleMat; + double value; + int ivalue; + PLFLT xmin, xmax, xjump, ymin, ymax, xlpos, ylpos; + PLBOOL y_ascl, acc; + PLINT colbox, collab; + PLINT colline[4], styline[4]; + int nlegend; + char **legline; + char *labx; + char *laby; + char *labtop; + char idvalue[20]; + + if (argc != 21) { + Tcl_AppendResult( interp, "wrong # args: see documentation for ", + argv[0], (char *) NULL); + return TCL_ERROR; + } + + colMat = Tcl_GetMatrixPtr(interp, argv[15]); + styleMat = Tcl_GetMatrixPtr(interp, argv[16]); + + if (colMat == NULL || colMat->dim != 1 || colMat->idata == NULL) { + Tcl_AppendResult(interp, argv[0], ": argument 15 should be a \ +one-dimensional integer matrix - ", argv[15], (char *) NULL); + return TCL_ERROR; + } + + if (styleMat == NULL || styleMat->dim != 1 || styleMat->idata == NULL) { + Tcl_AppendResult(interp, argv[0], ": argument 16 should be a \ +one-dimensional integer matrix - ", argv[16], (char *) NULL); + return TCL_ERROR; + } + + idName = argv[1]; + xspec = argv[2]; + yspec = argv[3]; + + sscanf( argv[4], "%lg", &value); xmin = (PLFLT)value; + sscanf( argv[5], "%lg", &value); xmax = (PLFLT)value; + sscanf( argv[6], "%lg", &value); xjump = (PLFLT)value; + sscanf( argv[7], "%lg", &value); ymin = (PLFLT)value; + sscanf( argv[8], "%lg", &value); ymax = (PLFLT)value; + sscanf( argv[9], "%lg", &value); xlpos = (PLFLT)value; + sscanf( argv[10],"%lg", &value); ylpos = (PLFLT)value; + sscanf( argv[11],"%d", &ivalue); y_ascl = (PLBOOL)ivalue; + sscanf( argv[12],"%d", &ivalue); acc = (PLBOOL)ivalue; + sscanf( argv[13],"%d", &ivalue); colbox = ivalue; + sscanf( argv[14],"%d", &ivalue); collab = ivalue; + + labx = argv[18]; + laby = argv[19]; + labtop = argv[20]; + + for ( i = 0; i < 4; i ++ ) { + colline[i] = colMat->idata[i]; + styline[i] = styleMat->idata[i]; + } + + if ( Tcl_SplitList( interp, argv[17], &nlegend, &legline ) != TCL_OK ) { + return TCL_ERROR; + } + if ( nlegend < 4 ) { + Tcl_AppendResult(interp, argv[0], ": argument 18 should be a \ +list of at least four items - ", argv[17], (char *) NULL); + return TCL_ERROR; + } + + c_plstripc(&id, xspec, yspec, + xmin, xmax, xjump, ymin, ymax, + xlpos, ylpos, + y_ascl, acc, + colbox, collab, + colline, styline, legline, + labx, laby, labtop); + + sprintf( idvalue, "%d", id ); + Tcl_SetVar( interp, idName, idvalue, 0 ); + + Tcl_Free( (char *)legline ); + + return TCL_OK; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-02-12 20:41:55
|
Revision: 11563 http://plplot.svn.sourceforge.net/plplot/?rev=11563&view=rev Author: airwin Date: 2011-02-12 20:41:48 +0000 (Sat, 12 Feb 2011) Log Message: ----------- Define PL_PI that is accessible from tcl. Whitespace tweak. Modified Paths: -------------- trunk/bindings/tcl/global_defines.sed trunk/bindings/tcl/plplot_parameters.h Modified: trunk/bindings/tcl/global_defines.sed =================================================================== --- trunk/bindings/tcl/global_defines.sed 2011-02-12 20:15:53 UTC (rev 11562) +++ trunk/bindings/tcl/global_defines.sed 2011-02-12 20:41:48 UTC (rev 11563) @@ -40,4 +40,12 @@ # Parse what is left while preserving trailing comments. Watch out # for parentheses around value as well. -/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(.*\)$?\\n\\\n\3\\n\\\nvariable \1 \2 \\n\\? +/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(.*\)$?\\n\\\n\3\\n\\\nvariable \1 \2\\n\\? + +# Append extra constants not #defined in plplotcapi.i after PL_NOTSET +# is processed. +/PL_NOTSET/ a\ +\\n\\\ +\\n\\\ +variable PL_PI 3.1415926535897932384\\n\\ + Modified: trunk/bindings/tcl/plplot_parameters.h =================================================================== --- trunk/bindings/tcl/plplot_parameters.h 2011-02-12 20:15:53 UTC (rev 11562) +++ trunk/bindings/tcl/plplot_parameters.h 2011-02-12 20:41:48 UTC (rev 11563) @@ -15,367 +15,370 @@ Tcl_Eval( interp, "namespace eval ::PLPLOT { \n\ \n\ # obsolete\n\ -variable PLESC_SET_RGB 1 \n\ +variable PLESC_SET_RGB 1\n\ \n\ # obsolete\n\ -variable PLESC_ALLOC_NCOL 2 \n\ +variable PLESC_ALLOC_NCOL 2\n\ \n\ # obsolete\n\ -variable PLESC_SET_LPB 3 \n\ +variable PLESC_SET_LPB 3\n\ \n\ # handle window expose\n\ -variable PLESC_EXPOSE 4 \n\ +variable PLESC_EXPOSE 4\n\ \n\ # handle window resize\n\ -variable PLESC_RESIZE 5 \n\ +variable PLESC_RESIZE 5\n\ \n\ # handle window redraw\n\ -variable PLESC_REDRAW 6 \n\ +variable PLESC_REDRAW 6\n\ \n\ # switch to text screen\n\ -variable PLESC_TEXT 7 \n\ +variable PLESC_TEXT 7\n\ \n\ # switch to graphics screen\n\ -variable PLESC_GRAPH 8 \n\ +variable PLESC_GRAPH 8\n\ \n\ # fill polygon\n\ -variable PLESC_FILL 9 \n\ +variable PLESC_FILL 9\n\ \n\ # handle DI command\n\ -variable PLESC_DI 10 \n\ +variable PLESC_DI 10\n\ \n\ # flush output\n\ -variable PLESC_FLUSH 11 \n\ +variable PLESC_FLUSH 11\n\ \n\ # handle Window events\n\ -variable PLESC_EH 12 \n\ +variable PLESC_EH 12\n\ \n\ # get cursor position\n\ -variable PLESC_GETC 13 \n\ +variable PLESC_GETC 13\n\ \n\ # set window parameters\n\ -variable PLESC_SWIN 14 \n\ +variable PLESC_SWIN 14\n\ \n\ # configure PLFLT buffering\n\ -variable PLESC_PLFLTBUFFERING 15 \n\ +variable PLESC_PLFLTBUFFERING 15\n\ \n\ # set xor mode\n\ -variable PLESC_XORMOD 16 \n\ +variable PLESC_XORMOD 16\n\ \n\ # AFR: set compression\n\ -variable PLESC_SET_COMPRESSION 17 \n\ +variable PLESC_SET_COMPRESSION 17\n\ \n\ # RL: clear graphics region\n\ -variable PLESC_CLEAR 18 \n\ +variable PLESC_CLEAR 18\n\ \n\ # RL: draw dashed line\n\ -variable PLESC_DASH 19 \n\ +variable PLESC_DASH 19\n\ \n\ # driver draws text\n\ -variable PLESC_HAS_TEXT 20 \n\ +variable PLESC_HAS_TEXT 20\n\ \n\ # handle image\n\ -variable PLESC_IMAGE 21 \n\ +variable PLESC_IMAGE 21\n\ \n\ # plimage related operations\n\ -variable PLESC_IMAGEOPS 22 \n\ +variable PLESC_IMAGEOPS 22\n\ \n\ # draw lines parallel to the X axis\n\ -variable DRAW_LINEX 0x01 \n\ +variable DRAW_LINEX 0x01\n\ \n\ # draw lines parallel to the Y axis\n\ -variable DRAW_LINEY 0x02 \n\ +variable DRAW_LINEY 0x02\n\ \n\ # draw lines parallel to both the X and Y axes\n\ -variable DRAW_LINEXY 0x03 \n\ +variable DRAW_LINEXY 0x03\n\ \n\ # draw the mesh with a color dependent of the magnitude\n\ -variable MAG_COLOR 0x04 \n\ +variable MAG_COLOR 0x04\n\ \n\ # draw contour plot at bottom xy plane\n\ -variable BASE_CONT 0x08 \n\ +variable BASE_CONT 0x08\n\ \n\ # draw contour plot at top xy plane\n\ -variable TOP_CONT 0x10 \n\ +variable TOP_CONT 0x10\n\ \n\ # draw contour plot at surface\n\ -variable SURF_CONT 0x20 \n\ +variable SURF_CONT 0x20\n\ \n\ # draw sides\n\ -variable DRAW_SIDES 0x40 \n\ +variable DRAW_SIDES 0x40\n\ \n\ # draw outline for each square that makes up the surface\n\ -variable FACETED 0x80 \n\ +variable FACETED 0x80\n\ \n\ # draw mesh\n\ -variable MESH 0x100 \n\ +variable MESH 0x100\n\ \n\ \n\ -variable PL_BIN_DEFAULT 0 \n\ +variable PL_BIN_DEFAULT 0\n\ \n\ \n\ -variable PL_BIN_CENTRED 1 \n\ +variable PL_BIN_CENTRED 1\n\ \n\ \n\ -variable PL_BIN_NOEXPAND 2 \n\ +variable PL_BIN_NOEXPAND 2\n\ \n\ \n\ -variable PL_BIN_NOEMPTY 4 \n\ +variable PL_BIN_NOEMPTY 4\n\ \n\ \n\ -variable PL_HIST_DEFAULT 0 \n\ +variable PL_HIST_DEFAULT 0\n\ \n\ \n\ -variable PL_HIST_NOSCALING 1 \n\ +variable PL_HIST_NOSCALING 1\n\ \n\ \n\ -variable PL_HIST_IGNORE_OUTLIERS 2 \n\ +variable PL_HIST_IGNORE_OUTLIERS 2\n\ \n\ \n\ -variable PL_HIST_NOEXPAND 8 \n\ +variable PL_HIST_NOEXPAND 8\n\ \n\ \n\ -variable PL_HIST_NOEMPTY 16 \n\ +variable PL_HIST_NOEMPTY 16\n\ \n\ \n\ -variable PL_POSITION_LEFT 1 \n\ +variable PL_POSITION_LEFT 1\n\ \n\ \n\ -variable PL_POSITION_RIGHT 2 \n\ +variable PL_POSITION_RIGHT 2\n\ \n\ \n\ -variable PL_POSITION_TOP 4 \n\ +variable PL_POSITION_TOP 4\n\ \n\ \n\ -variable PL_POSITION_BOTTOM 8 \n\ +variable PL_POSITION_BOTTOM 8\n\ \n\ \n\ -variable PL_POSITION_INSIDE 16 \n\ +variable PL_POSITION_INSIDE 16\n\ \n\ \n\ -variable PL_POSITION_OUTSIDE 32 \n\ +variable PL_POSITION_OUTSIDE 32\n\ \n\ \n\ -variable PL_POSITION_VIEWPORT 64 \n\ +variable PL_POSITION_VIEWPORT 64\n\ \n\ \n\ -variable PL_POSITION_SUBPAGE 128 \n\ +variable PL_POSITION_SUBPAGE 128\n\ \n\ \n\ -variable PL_LEGEND_NONE 1 \n\ +variable PL_LEGEND_NONE 1\n\ \n\ \n\ -variable PL_LEGEND_COLOR_BOX 2 \n\ +variable PL_LEGEND_COLOR_BOX 2\n\ \n\ \n\ -variable PL_LEGEND_LINE 4 \n\ +variable PL_LEGEND_LINE 4\n\ \n\ \n\ -variable PL_LEGEND_SYMBOL 8 \n\ +variable PL_LEGEND_SYMBOL 8\n\ \n\ \n\ -variable PL_LEGEND_TEXT_LEFT 16 \n\ +variable PL_LEGEND_TEXT_LEFT 16\n\ \n\ \n\ -variable PL_LEGEND_BACKGROUND 32 \n\ +variable PL_LEGEND_BACKGROUND 32\n\ \n\ \n\ -variable PL_LEGEND_BOUNDING_BOX 64 \n\ +variable PL_LEGEND_BOUNDING_BOX 64\n\ \n\ \n\ -variable PL_LEGEND_ROW_MAJOR 128 \n\ +variable PL_LEGEND_ROW_MAJOR 128\n\ \n\ \n\ -variable PL_COLORBAR_LABEL_LEFT 1 \n\ +variable PL_COLORBAR_LABEL_LEFT 1\n\ \n\ \n\ -variable PL_COLORBAR_LABEL_RIGHT 2 \n\ +variable PL_COLORBAR_LABEL_RIGHT 2\n\ \n\ \n\ -variable PL_COLORBAR_LABEL_TOP 4 \n\ +variable PL_COLORBAR_LABEL_TOP 4\n\ \n\ \n\ -variable PL_COLORBAR_LABEL_BOTTOM 8 \n\ +variable PL_COLORBAR_LABEL_BOTTOM 8\n\ \n\ \n\ -variable PL_COLORBAR_IMAGE 16 \n\ +variable PL_COLORBAR_IMAGE 16\n\ \n\ \n\ -variable PL_COLORBAR_SHADE 32 \n\ +variable PL_COLORBAR_SHADE 32\n\ \n\ \n\ -variable PL_COLORBAR_GRADIENT 64 \n\ +variable PL_COLORBAR_GRADIENT 64\n\ \n\ \n\ -variable PL_COLORBAR_CAP_LOW 128 \n\ +variable PL_COLORBAR_CAP_LOW 128\n\ \n\ \n\ -variable PL_COLORBAR_CAP_HIGH 256 \n\ +variable PL_COLORBAR_CAP_HIGH 256\n\ \n\ \n\ -variable PL_COLORBAR_SHADE_LABEL 512 \n\ +variable PL_COLORBAR_SHADE_LABEL 512\n\ \n\ # device coordinates\n\ -variable PLSWIN_DEVICE 1 \n\ +variable PLSWIN_DEVICE 1\n\ \n\ # world coordinates\n\ -variable PLSWIN_WORLD 2 \n\ +variable PLSWIN_WORLD 2\n\ \n\ # The x-axis\n\ -variable PL_X_AXIS 1 \n\ +variable PL_X_AXIS 1\n\ \n\ # The y-axis\n\ -variable PL_Y_AXIS 2 \n\ +variable PL_Y_AXIS 2\n\ \n\ # The z-axis\n\ -variable PL_Z_AXIS 3 \n\ +variable PL_Z_AXIS 3\n\ \n\ # Obsolete\n\ -variable PL_OPT_ENABLED 0x0001 \n\ +variable PL_OPT_ENABLED 0x0001\n\ \n\ # Option has an argment\n\ -variable PL_OPT_ARG 0x0002 \n\ +variable PL_OPT_ARG 0x0002\n\ \n\ # Don't delete after processing\n\ -variable PL_OPT_NODELETE 0x0004 \n\ +variable PL_OPT_NODELETE 0x0004\n\ \n\ # Make invisible\n\ -variable PL_OPT_INVISIBLE 0x0008 \n\ +variable PL_OPT_INVISIBLE 0x0008\n\ \n\ # Processing is disabled\n\ -variable PL_OPT_DISABLED 0x0010 \n\ +variable PL_OPT_DISABLED 0x0010\n\ \n\ # Call handler function\n\ -variable PL_OPT_FUNC 0x0100 \n\ +variable PL_OPT_FUNC 0x0100\n\ \n\ # Set *var = 1\n\ -variable PL_OPT_BOOL 0x0200 \n\ +variable PL_OPT_BOOL 0x0200\n\ \n\ # Set *var = atoi(optarg)\n\ -variable PL_OPT_INT 0x0400 \n\ +variable PL_OPT_INT 0x0400\n\ \n\ # Set *var = atof(optarg)\n\ -variable PL_OPT_FLOAT 0x0800 \n\ +variable PL_OPT_FLOAT 0x0800\n\ \n\ # Set var = optarg\n\ -variable PL_OPT_STRING 0x1000 \n\ +variable PL_OPT_STRING 0x1000\n\ \n\ # For backward compatibility\n\ -variable PL_PARSE_PARTIAL 0x0000 \n\ +variable PL_PARSE_PARTIAL 0x0000\n\ \n\ # Process fully & exit if error\n\ -variable PL_PARSE_FULL 0x0001 \n\ +variable PL_PARSE_FULL 0x0001\n\ \n\ # Don't issue messages\n\ -variable PL_PARSE_QUIET 0x0002 \n\ +variable PL_PARSE_QUIET 0x0002\n\ \n\ # Don't delete options after\n\ -variable PL_PARSE_NODELETE 0x0004 \n\ +variable PL_PARSE_NODELETE 0x0004\n\ \n\ # Show invisible options\n\ -variable PL_PARSE_SHOWALL 0x0008 \n\ +variable PL_PARSE_SHOWALL 0x0008\n\ \n\ # Obsolete\n\ -variable PL_PARSE_OVERRIDE 0x0010 \n\ +variable PL_PARSE_OVERRIDE 0x0010\n\ \n\ # Program name NOT in *argv[0]..\n\ -variable PL_PARSE_NOPROGRAM 0x0020 \n\ +variable PL_PARSE_NOPROGRAM 0x0020\n\ \n\ # Set if leading dash NOT required\n\ -variable PL_PARSE_NODASH 0x0040 \n\ +variable PL_PARSE_NODASH 0x0040\n\ \n\ # Skip over unrecognized args\n\ -variable PL_PARSE_SKIP 0x0080 \n\ +variable PL_PARSE_SKIP 0x0080\n\ \n\ \n\ -variable PL_FCI_MARK 0x80000000 \n\ +variable PL_FCI_MARK 0x80000000\n\ \n\ \n\ -variable PL_FCI_IMPOSSIBLE 0x00000000 \n\ +variable PL_FCI_IMPOSSIBLE 0x00000000\n\ \n\ \n\ -variable PL_FCI_HEXDIGIT_MASK 0xf \n\ +variable PL_FCI_HEXDIGIT_MASK 0xf\n\ \n\ \n\ -variable PL_FCI_HEXPOWER_MASK 0x7 \n\ +variable PL_FCI_HEXPOWER_MASK 0x7\n\ \n\ \n\ -variable PL_FCI_HEXPOWER_IMPOSSIBLE 0xf \n\ +variable PL_FCI_HEXPOWER_IMPOSSIBLE 0xf\n\ \n\ \n\ -variable PL_FCI_FAMILY 0x0 \n\ +variable PL_FCI_FAMILY 0x0\n\ \n\ \n\ -variable PL_FCI_STYLE 0x1 \n\ +variable PL_FCI_STYLE 0x1\n\ \n\ \n\ -variable PL_FCI_WEIGHT 0x2 \n\ +variable PL_FCI_WEIGHT 0x2\n\ \n\ \n\ -variable PL_FCI_SANS 0x0 \n\ +variable PL_FCI_SANS 0x0\n\ \n\ \n\ -variable PL_FCI_SERIF 0x1 \n\ +variable PL_FCI_SERIF 0x1\n\ \n\ \n\ -variable PL_FCI_MONO 0x2 \n\ +variable PL_FCI_MONO 0x2\n\ \n\ \n\ -variable PL_FCI_SCRIPT 0x3 \n\ +variable PL_FCI_SCRIPT 0x3\n\ \n\ \n\ -variable PL_FCI_SYMBOL 0x4 \n\ +variable PL_FCI_SYMBOL 0x4\n\ \n\ \n\ -variable PL_FCI_UPRIGHT 0x0 \n\ +variable PL_FCI_UPRIGHT 0x0\n\ \n\ \n\ -variable PL_FCI_ITALIC 0x1 \n\ +variable PL_FCI_ITALIC 0x1\n\ \n\ \n\ -variable PL_FCI_OBLIQUE 0x2 \n\ +variable PL_FCI_OBLIQUE 0x2\n\ \n\ \n\ -variable PL_FCI_MEDIUM 0x0 \n\ +variable PL_FCI_MEDIUM 0x0\n\ \n\ \n\ -variable PL_FCI_BOLD 0x1 \n\ +variable PL_FCI_BOLD 0x1\n\ \n\ \n\ -variable PL_MAXKEY 16 \n\ +variable PL_MAXKEY 16\n\ \n\ # Max number of windows/page tracked\n\ -variable PL_MAXWINDOWS 64 \n\ +variable PL_MAXWINDOWS 64\n\ \n\ \n\ -variable PL_NOTSET -42 \n\ +variable PL_NOTSET -42\n\ \n\ \n\ -variable PLESPLFLTBUFFERING_ENABLE 1 \n\ +variable PL_PI 3.1415926535897932384\n\ \n\ \n\ -variable PLESPLFLTBUFFERING_DISABLE 2 \n\ +variable PLESPLFLTBUFFERING_ENABLE 1\n\ \n\ \n\ -variable PLESPLFLTBUFFERING_QUERY 3 \n\ +variable PLESPLFLTBUFFERING_DISABLE 2\n\ \n\ +\n\ +variable PLESPLFLTBUFFERING_QUERY 3\n\ +\n\ # Bivariate Cubic Spline approximation\n\ -variable GRID_CSA 1 \n\ +variable GRID_CSA 1\n\ \n\ # Delaunay Triangulation Linear Interpolation\n\ -variable GRID_DTLI 2 \n\ +variable GRID_DTLI 2\n\ \n\ # Natural Neighbors Interpolation\n\ -variable GRID_NNI 3 \n\ +variable GRID_NNI 3\n\ \n\ # Nearest Neighbors Inverse Distance Weighted\n\ -variable GRID_NNIDW 4 \n\ +variable GRID_NNIDW 4\n\ \n\ # Nearest Neighbors Linear Interpolation\n\ -variable GRID_NNLI 5 \n\ +variable GRID_NNLI 5\n\ \n\ # Nearest Neighbors Around Inverse Distance Weighted\n\ -variable GRID_NNAIDW 6 \n\ +variable GRID_NNAIDW 6\n\ }" ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-12-03 13:03:05
|
Revision: 12805 http://sourceforge.net/p/plplot/code/12805 Author: andrewross Date: 2013-12-03 13:02:59 +0000 (Tue, 03 Dec 2013) Log Message: ----------- Update tcl bindings to plsvect will accept NULL arguments. Modified Paths: -------------- trunk/bindings/tcl/plapi.tpl trunk/bindings/tcl/tclAPI.c Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2013-12-03 11:49:15 UTC (rev 12804) +++ trunk/bindings/tcl/plapi.tpl 2013-12-03 13:02:59 UTC (rev 12805) @@ -983,14 +983,6 @@ mark PLINT * space PLINT * -# Set the vector arrow style - -pltclcmd plsvect void -arrowx PLFLT * -arrowy PLFLT * -npts PLINT -fill PLINT - # Sets the edges of the viewport to the specified absolute coordinates. pltclcmd plsvpa void Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2013-12-03 11:49:15 UTC (rev 12804) +++ trunk/bindings/tcl/tclAPI.c 2013-12-03 13:02:59 UTC (rev 12805) @@ -64,6 +64,7 @@ static int plmapCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plmeridiansCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plstransformCmd( ClientData, Tcl_Interp *, int, const char ** ); +static int plsvectCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plvectCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plranddCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plgriddataCmd( ClientData, Tcl_Interp *, int, const char ** ); @@ -115,6 +116,7 @@ { "plsetopt", plsetoptCmd }, { "plshade", plshadeCmd }, { "plshades", plshadesCmd }, + { "plsvect", plsvectCmd }, { "plvect", plvectCmd }, { "plrandd", plranddCmd }, { "plgriddata", plgriddataCmd }, @@ -1228,6 +1230,69 @@ } //-------------------------------------------------------------------------- +// plsvect +// +// Implement Tcl-side setting of arrow style. +//-------------------------------------------------------------------------- + +static int +plsvectCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, + int argc, const char *argv[] ) +{ + tclMatrix *matx, *maty; + PLINT npts; + PLBOOL fill; + + if ( argc == 1 + || (strcmp( argv[1], "NULL" ) == 0 ) && ( strcmp( argv[2], "NULL" ) == 0 ) ) + { + // The user has requested to clear the transform setting. + plsvect( NULL, NULL, 0, 0 ); + return TCL_OK; + } + else if (argc != 4) + { + Tcl_AppendResult( interp, "wrong # args: see documentation for ", + argv[0], (char *) NULL ); + return TCL_ERROR; + } + + matx = Tcl_GetMatrixPtr( interp, argv[1] ); + if ( matx == NULL ) + return TCL_ERROR; + + if ( matx->dim != 1 ) + { + Tcl_SetResult( interp, "plsvect: Must use 1-d data.", TCL_STATIC ); + return TCL_ERROR; + } + npts = matx->n[0]; + + maty = Tcl_GetMatrixPtr( interp, argv[2] ); + if ( maty == NULL ) + return TCL_ERROR; + + if ( maty->dim != 1 ) + { + Tcl_SetResult( interp, "plsvect: Must use 1-d data.", TCL_STATIC ); + return TCL_ERROR; + } + + if ( maty->n[0] != npts ) + { + Tcl_SetResult( interp, "plsvect: Arrays must be of equal length", TCL_STATIC ); + return TCL_ERROR; + } + + fill = (PLBOOL) atoi(argv[3]); + + plsvect( matx->fdata, maty->fdata, npts, fill ); + + return TCL_OK; +} + + +//-------------------------------------------------------------------------- // plvect implementation (based on plcont above) //-------------------------------------------------------------------------- static int This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |