From: <ai...@us...> - 2010-10-11 22:34:27
|
Revision: 11257 http://plplot.svn.sourceforge.net/plplot/?rev=11257&view=rev Author: airwin Date: 2010-10-11 22:34:18 +0000 (Mon, 11 Oct 2010) Log Message: ----------- Change from traditional /* ... */ style of commentary to c99 // style of commentary for our core library code. Results tested well with "cmake", "make test_noninteractive", and "make test_interactive" in the build tree. ToDo: extend this style change to further chunks of our C code. Modified Paths: -------------- trunk/config.h.cmake trunk/src/ltdl_win32.c trunk/src/mt19937ar.c trunk/src/mt19937ar.h trunk/src/pdfutils.c trunk/src/plaffine.c trunk/src/plarc.c trunk/src/plargs.c trunk/src/plbox.c trunk/src/plbuf.c trunk/src/plcont.c trunk/src/plcore.c trunk/src/plctrl.c trunk/src/plcvt.c trunk/src/pldeprecated.c trunk/src/pldtik.c trunk/src/plf2ops.c trunk/src/plfill.c trunk/src/plfreetype.c trunk/src/plgradient.c trunk/src/plgridd.c trunk/src/plgset.c trunk/src/plhist.c trunk/src/plimage.c trunk/src/plline.c trunk/src/plmap.c trunk/src/plot3d.c trunk/src/plsdef.c trunk/src/plshade.c trunk/src/plstdio.c trunk/src/plstripc.c trunk/src/plsym.c trunk/src/pltick.c trunk/src/pltime.c trunk/src/plvect.c trunk/src/plvpor.c trunk/src/plwind.c Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2010-10-11 21:41:06 UTC (rev 11256) +++ trunk/config.h.cmake 2010-10-11 22:34:18 UTC (rev 11257) @@ -1,303 +1,303 @@ -/* Configured (by CMake) macros for PLplot that are required for the - * core build but _not_ required for the build of the installed - * examples (and presumably any user applications). Therefore, the - * configured config.h should not be installed. In contrast, - * include/plConfig.h.cmake (note, plConfig.h #includes config.h for - * the core build because HAVE_CONFIG_H is #defined in that case) - * contains configured macros that are required for the core build, - * installed examples build, and build of user applications. - * Therefore, in contrast to config.h, plConfig.h should be installed. - * - * Maintenance issue: in makes no sense to configure duplicate macros - * for both config.h and plConfig.h. Therefore, when adding a macro - * decide which file to put it in depending on whether the result is - * needed for the installed examples build or not. Furthermore, move - * configured macros from one file to the other as needed depending on - * that criterion, but do not copy them. - * - */ +// Configured (by CMake) macros for PLplot that are required for the +// core build but _not_ required for the build of the installed +// examples (and presumably any user applications). Therefore, the +// configured config.h should not be installed. In contrast, +// include/plConfig.h.cmake (note, plConfig.h #includes config.h for +// the core build because HAVE_CONFIG_H is #defined in that case) +// contains configured macros that are required for the core build, +// installed examples build, and build of user applications. +// Therefore, in contrast to config.h, plConfig.h should be installed. +// +// Maintenance issue: in makes no sense to configure duplicate macros +// for both config.h and plConfig.h. Therefore, when adding a macro +// decide which file to put it in depending on whether the result is +// needed for the installed examples build or not. Furthermore, move +// configured macros from one file to the other as needed depending on +// that criterion, but do not copy them. +// +// -/* Location of executables */ +// Location of executables #define BIN_DIR "@BIN_DIR@" -/* Location of Build tree */ +// Location of Build tree #define BUILD_DIR "@BUILD_DIR@" -/* Location of package data files */ +// Location of package data files #define DATA_DIR "@DATA_DIR@" -/* Location of dynamically loaded drivers */ +// Location of dynamically loaded drivers #define DRV_DIR "@DRV_DIR@" -/* Name of the default cmap0 palette to use */ +// Name of the default cmap0 palette to use #define PL_DEFAULT_CMAP0_FILE "@DEFAULT_CMAP0_FILE@" -/* Name of the default cmap1 palette to use */ +// Name of the default cmap1 palette to use #define PL_DEFAULT_CMAP1_FILE "@DEFAULT_CMAP1_FILE@" -/* Define if there is support for dynamically loaded drivers */ +// Define if there is support for dynamically loaded drivers #cmakedefine ENABLE_DYNDRIVERS -/* Define to 1 if you have the <cmath> header file. */ +// Define to 1 if you have the <cmath> header file. #cmakedefine HAVE_CMATH 1 -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. - */ +// Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. +// #cmakedefine HAVE_DIRENT_H 1 -/* Define to 1 if you have the <dlfcn.h> header file. */ +// Define to 1 if you have the <dlfcn.h> header file. #cmakedefine HAVE_DLFCN_H 1 -/* Define if finite is available */ +// Define if finite is available #cmakedefine PL_HAVE_FINITE -/* Define if _finite is available */ +// Define if _finite is available #cmakedefine PL__HAVE_FINITE -/* Define if [freetype] is available */ +// Define if [freetype] is available #cmakedefine HAVE_FREETYPE -/* Define if [agg] is available */ +// Define if [agg] is available #cmakedefine HAVE_AGG -/* Define to 1 if you have the <glib.h> header file. */ +// Define to 1 if you have the <glib.h> header file. #cmakedefine HAVE_GLIB_H 1 -/* Define to 1 if you have the <glib-object.h> header file. */ +// Define to 1 if you have the <glib-object.h> header file. #cmakedefine HAVE_GLIB_OBJECT_H 1 -/* Define to 1 if you have the <gtk/gtk.h> header file. */ +// Define to 1 if you have the <gtk/gtk.h> header file. #cmakedefine HAVE_GTK_GTK_H 1 -/* Define to 1 if you have the <inttypes.h> header file. */ +// Define to 1 if you have the <inttypes.h> header file. #cmakedefine HAVE_INTTYPES_H 1 -/* Define if [incr], [Tcl] is available */ +// Define if [incr], [Tcl] is available #cmakedefine HAVE_ITCL -/* Define to 1 if you have the <itclDecls.h> header file. */ +// Define to 1 if you have the <itclDecls.h> header file. #cmakedefine HAVE_ITCLDECLS_H 1 -/* Define if Tk is available */ +// Define if Tk is available #cmakedefine ENABLE_tk -/* Define if [incr], [Tk] is available */ +// Define if [incr], [Tk] is available #cmakedefine HAVE_ITK -/* Define to 1 if you have the <jni.h> header file. */ +// Define to 1 if you have the <jni.h> header file. #cmakedefine HAVE_JNI_H 1 -/* Define to 1 if you have the <libart_lgpl/libart.h> header file. */ +// Define to 1 if you have the <libart_lgpl/libart.h> header file. #cmakedefine HAVE_LIBART_LGPL_LIBART_H 1 -/* Define to 1 if you have the <libgnomecanvas/libgnomecanvas.h> header file. - */ +// Define to 1 if you have the <libgnomecanvas/libgnomecanvas.h> header file. +// #cmakedefine HAVE_LIBGNOMECANVAS_LIBGNOMECANVAS_H 1 -/* Define to 1 if you have the <libgnomeprint/gnome-print.h> header file. */ +// Define to 1 if you have the <libgnomeprint/gnome-print.h> header file. #cmakedefine HAVE_LIBGNOMEPRINT_GNOME_PRINT_H 1 -/* Define if libunicode is available */ +// Define if libunicode is available #cmakedefine HAVE_LIBUNICODE -/* Define to 1 if you have the <math.h> header file. */ +// Define to 1 if you have the <math.h> header file. #cmakedefine HAVE_MATH_H 1 -/* Define to 1 if you have the <memory.h> header file. */ +// Define to 1 if you have the <memory.h> header file. #cmakedefine HAVE_MEMORY_H 1 -/* Define to 1 if the function mkstemp is available. */ +// Define to 1 if the function mkstemp is available. #cmakedefine PL_HAVE_MKSTEMP 1 -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ +// Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. #cmakedefine HAVE_NDIR_H 1 -/* Define if python numpy is available */ +// Define if python numpy is available #cmakedefine HAVE_NUMPY -/* Define if libpango is available */ +// Define if libpango is available #cmakedefine HAVE_PANGO -/* Define if popen is available */ +// Define if popen is available #cmakedefine HAVE_POPEN -/* Define if _NSGetArgc is available */ +// Define if _NSGetArgc is available #cmakedefine HAVE_NSGETARGC -/* Define if pthreads is available */ +// Define if pthreads is available #cmakedefine HAVE_PTHREAD -/* Define if Qhull is available */ +// Define if Qhull is available #cmakedefine HAVE_QHULL -/* Define to 1 if you have the <stdlib.h> header file. */ +// Define to 1 if you have the <stdlib.h> header file. #cmakedefine HAVE_STDLIB_H 1 -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ +// Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. +// #cmakedefine HAVE_SYS_DIR_H 1 -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ +// Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. +// #cmakedefine HAVE_SYS_NDIR_H 1 -/* Define to 1 if you have the <sys/stat.h> header file. */ +// Define to 1 if you have the <sys/stat.h> header file. #cmakedefine HAVE_SYS_STAT_H 1 -/* Define to 1 if you have the <sys/types.h> header file. */ +// Define to 1 if you have the <sys/types.h> header file. #cmakedefine HAVE_SYS_TYPES_H 1 -/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ +// Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. #cmakedefine HAVE_SYS_WAIT_H 1 -/* Define to 1 if you have the <termios.h> header file. */ +// Define to 1 if you have the <termios.h> header file. #cmakedefine HAVE_TERMIOS_H 1 -/* Define to 1 if you have the <crt_externs.h> header file. */ +// Define to 1 if you have the <crt_externs.h> header file. #cmakedefine HAVE_CRT_EXTERNS_H 1 -/* Define to 1 if the function unlink is available */ +// Define to 1 if the function unlink is available #cmakedefine PL_HAVE_UNLINK 1 -/* Define to 1 if you have the `vfork' function. */ +// Define to 1 if you have the `vfork' function. #cmakedefine HAVE_VFORK 1 -/* Define to 1 if you have the <vfork.h> header file. */ +// Define to 1 if you have the <vfork.h> header file. #cmakedefine HAVE_VFORK_H 1 -/* Include sys/type.h if needed */ +// Include sys/type.h if needed #cmakedefine NEED_SYS_TYPE_H -/* Name of package */ +// Name of package #define PACKAGE "@PACKAGE@" -/* Define if the win32 ltdl implementation should be used */ +// Define if the win32 ltdl implementation should be used #cmakedefine LTDL_WIN32 -/* Portable definition for PTHREAD_MUTEX_RECURSIVE */ +// Portable definition for PTHREAD_MUTEX_RECURSIVE #define PLPLOT_MUTEX_RECURSIVE @PLPLOT_MUTEX_RECURSIVE@ -/* Directory containing fonts that are accessible from freetype */ +// Directory containing fonts that are accessible from freetype #define PL_FREETYPE_FONT_DIR "@PL_FREETYPE_FONT_DIR@" -/* MONO font accessible from freetype */ +// MONO font accessible from freetype #define PL_FREETYPE_MONO "@PL_FREETYPE_MONO@" -/* MONO_BOLD font accessible from freetype */ +// MONO_BOLD font accessible from freetype #define PL_FREETYPE_MONO_BOLD "@PL_FREETYPE_MONO_BOLD@" -/* MONO_BOLD_ITALIC font accessible from freetype */ +// MONO_BOLD_ITALIC font accessible from freetype #define PL_FREETYPE_MONO_BOLD_ITALIC "@PL_FREETYPE_MONO_BOLD_ITALIC@" -/* MONO_BOLD_OBLIQUE font accessible from freetype */ +// MONO_BOLD_OBLIQUE font accessible from freetype #define PL_FREETYPE_MONO_BOLD_OBLIQUE "@PL_FREETYPE_MONO_BOLD_OBLIQUE@" -/* MONO_ITALIC font accessible from freetype */ +// MONO_ITALIC font accessible from freetype #define PL_FREETYPE_MONO_ITALIC "@PL_FREETYPE_MONO_ITALIC@" -/* MONO_OBLIQUE font accessible from freetype */ +// MONO_OBLIQUE font accessible from freetype #define PL_FREETYPE_MONO_OBLIQUE "@PL_FREETYPE_MONO_OBLIQUE@" -/* SANS font accessible from freetype */ +// SANS font accessible from freetype #define PL_FREETYPE_SANS "@PL_FREETYPE_SANS@" -/* SANS_BOLD font accessible from freetype */ +// SANS_BOLD font accessible from freetype #define PL_FREETYPE_SANS_BOLD "@PL_FREETYPE_SANS_BOLD@" -/* SANS_BOLD_ITALIC font accessible from freetype */ +// SANS_BOLD_ITALIC font accessible from freetype #define PL_FREETYPE_SANS_BOLD_ITALIC "@PL_FREETYPE_SANS_BOLD_ITALIC@" -/* SANS_BOLD_OBLIQUE font accessible from freetype */ +// SANS_BOLD_OBLIQUE font accessible from freetype #define PL_FREETYPE_SANS_BOLD_OBLIQUE "@PL_FREETYPE_SANS_BOLD_OBLIQUE@" -/* SANS_ITALIC font accessible from freetype */ +// SANS_ITALIC font accessible from freetype #define PL_FREETYPE_SANS_ITALIC "@PL_FREETYPE_SANS_ITALIC@" -/* SANS_OBLIQUE font accessible from freetype */ +// SANS_OBLIQUE font accessible from freetype #define PL_FREETYPE_SANS_OBLIQUE "@PL_FREETYPE_SANS_OBLIQUE@" -/* SCRIPT font accessible from freetype */ +// SCRIPT font accessible from freetype #define PL_FREETYPE_SCRIPT "@PL_FREETYPE_SCRIPT@" -/* SCRIPT_BOLD font accessible from freetype */ +// SCRIPT_BOLD font accessible from freetype #define PL_FREETYPE_SCRIPT_BOLD "@PL_FREETYPE_SCRIPT_BOLD@" -/* SCRIPT_BOLD_ITALIC font accessible from freetype */ +// SCRIPT_BOLD_ITALIC font accessible from freetype #define PL_FREETYPE_SCRIPT_BOLD_ITALIC "@PL_FREETYPE_SCRIPT_BOLD_ITALIC@" -/* SCRIPT_BOLD_OBLIQUE font accessible from freetype */ +// SCRIPT_BOLD_OBLIQUE font accessible from freetype #define PL_FREETYPE_SCRIPT_BOLD_OBLIQUE "@PL_FREETYPE_SCRIPT_BOLD_OBLIQUE@" -/* SCRIPT_ITALIC font accessible from freetype */ +// SCRIPT_ITALIC font accessible from freetype #define PL_FREETYPE_SCRIPT_ITALIC "@PL_FREETYPE_SCRIPT_ITALIC@" -/* SCRIPT_OBLIQUE font accessible from freetype */ +// SCRIPT_OBLIQUE font accessible from freetype #define PL_FREETYPE_SCRIPT_OBLIQUE "@PL_FREETYPE_SCRIPT_OBLIQUE@" -/* SERIF font accessible from freetype */ +// SERIF font accessible from freetype #define PL_FREETYPE_SERIF "@PL_FREETYPE_SERIF@" -/* SERIF_BOLD font accessible from freetype */ +// SERIF_BOLD font accessible from freetype #define PL_FREETYPE_SERIF_BOLD "@PL_FREETYPE_SERIF_BOLD@" -/* SERIF_BOLD_ITALIC font accessible from freetype */ +// SERIF_BOLD_ITALIC font accessible from freetype #define PL_FREETYPE_SERIF_BOLD_ITALIC "@PL_FREETYPE_SERIF_BOLD_ITALIC@" -/* SERIF_BOLD_OBLIQUE font accessible from freetype */ +// SERIF_BOLD_OBLIQUE font accessible from freetype #define PL_FREETYPE_SERIF_BOLD_OBLIQUE "@PL_FREETYPE_SERIF_BOLD_OBLIQUE@" -/* SERIF_ITALIC font accessible from freetype */ +// SERIF_ITALIC font accessible from freetype #define PL_FREETYPE_SERIF_ITALIC "@PL_FREETYPE_SERIF_ITALIC@" -/* SERIF_OBLIQUE font accessible from freetype */ +// SERIF_OBLIQUE font accessible from freetype #define PL_FREETYPE_SERIF_OBLIQUE "@PL_FREETYPE_SERIF_OBLIQUE@" -/* Symbol font accessible from freetype */ +// Symbol font accessible from freetype #define PL_FREETYPE_SYMBOL "@PL_FREETYPE_SYMBOL@" -/* SYMBOL_BOLD font accessible from freetype */ +// SYMBOL_BOLD font accessible from freetype #define PL_FREETYPE_SYMBOL_BOLD "@PL_FREETYPE_SYMBOL_BOLD@" -/* SYMBOL_BOLD_ITALIC font accessible from freetype */ +// SYMBOL_BOLD_ITALIC font accessible from freetype #define PL_FREETYPE_SYMBOL_BOLD_ITALIC "@PL_FREETYPE_SYMBOL_BOLD_ITALIC@" -/* SYMBOL_BOLD_OBLIQUE font accessible from freetype */ +// SYMBOL_BOLD_OBLIQUE font accessible from freetype #define PL_FREETYPE_SYMBOL_BOLD_OBLIQUE "@PL_FREETYPE_SYMBOL_BOLD_OBLIQUE@" -/* SYMBOL_ITALIC font accessible from freetype */ +// SYMBOL_ITALIC font accessible from freetype #define PL_FREETYPE_SYMBOL_ITALIC "@PL_FREETYPE_SYMBOL_ITALIC@" -/* SYMBOL_OBLIQUE font accessible from freetype */ +// SYMBOL_OBLIQUE font accessible from freetype #define PL_FREETYPE_SYMBOL_OBLIQUE "@PL_FREETYPE_SYMBOL_OBLIQUE@" -/* Define as the return type of signal handlers (`int' or `void'). */ +// Define as the return type of signal handlers (`int' or `void'). #define RETSIGTYPE @RETSIGTYPE@ -/* Location of Source tree */ +// Location of Source tree #define SOURCE_DIR "@SOURCE_DIR@" -/* Define to 1 if you have the ANSI C header files. */ +// Define to 1 if you have the ANSI C header files. #cmakedefine STDC_HEADERS 1 -/* Location of Tcl stuff */ +// Location of Tcl stuff #define TCL_DIR "@TCL_DIR@" -/* Version number of package */ +// Version number of package #define VERSION "@VERSION@" -/* Define if csa is desired */ +// Define if csa is desired #cmakedefine WITH_CSA -/* Define if want to use general fill_intersection_polygon approach - * rather than the traditional code to fill the intersection of a polygon with - * the clipping limits. */ +// Define if want to use general fill_intersection_polygon approach +// rather than the traditional code to fill the intersection of a polygon with +// the clipping limits. #cmakedefine USE_FILL_INTERSECTION_POLYGON -/* Define to `char *' if <sys/types.h> does not define. */ +// Define to `char *' if <sys/types.h> does not define. #cmakedefine caddr_t -/* Define to `int' if <sys/types.h> does not define. */ +// Define to `int' if <sys/types.h> does not define. #cmakedefine pid_t -/* Define as `fork' if `vfork' does not work. */ +// Define as `fork' if `vfork' does not work. #cmakedefine vfork Modified: trunk/src/ltdl_win32.c =================================================================== --- trunk/src/ltdl_win32.c 2010-10-11 21:41:06 UTC (rev 11256) +++ trunk/src/ltdl_win32.c 2010-10-11 22:34:18 UTC (rev 11257) @@ -1,47 +1,47 @@ -/* $Id$ - * - * Contains all prototypes for driver functions. - * - * Copyright (C) 2008 Werner Smekal - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// $Id$ +// +// Contains all prototypes for driver functions. +// +// Copyright (C) 2008 Werner Smekal +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// #include <windows.h> #include <stdlib.h> #include "ltdl_win32.h" -/* (static) pointer to the last handle, which contains a pointer - * to a possible previous handle */ +// (static) pointer to the last handle, which contains a pointer +// to a possible previous handle lt_dlhandle lastHandle = NULL; -/* buffer for error messages */ +// buffer for error messages char errortext[512]; -/* initialise variables */ +// initialise variables void lt_dlinit( void ) { lastHandle = NULL; } -/* on exit free library handles and release allocate memory */ +// on exit free library handles and release allocate memory void lt_dlexit( void ) { lt_dlhandle prev; @@ -57,9 +57,9 @@ } -/* try to open shared library with given dllname. If there is - * no extension given LoadLibrary() assumes .dll. The library - * must be somewhere in the path or in the current directory. */ +// try to open shared library with given dllname. If there is +// no extension given LoadLibrary() assumes .dll. The library +// must be somewhere in the path or in the current directory. lt_dlhandle lt_dlopenext( char* dllname ) { lt_dlhandle dlhandle = malloc( sizeof ( struct __dlhandle ) ); @@ -79,7 +79,7 @@ } -/* return last error occured. Needs some work :). */ +// return last error occured. Needs some work :). const char* lt_dlerror() { strncpy( errortext, "No error information", 512 ); @@ -88,7 +88,7 @@ } -/* load symbol from library */ +// load symbol from library void* lt_dlsym( lt_dlhandle dlhandle, const char* symbol ) { if ( dlhandle->hinstLib ) Modified: trunk/src/mt19937ar.c =================================================================== --- trunk/src/mt19937ar.c 2010-10-11 21:41:06 UTC (rev 11256) +++ trunk/src/mt19937ar.c 2010-10-11 22:34:18 UTC (rev 11257) @@ -1,62 +1,62 @@ -/* - * A C-program for MT19937, with initialization improved 2002/1/26. - * Coded by Takuji Nishimura and Makoto Matsumoto. - * - * Before using, initialize the state by using init_genrand(seed) - * or init_by_array(init_key, key_length). - * - * Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - * All rights reserved. - * Copyright (C) 2005, Mutsuo Saito, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. The names of its contributors may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Any feedback is very welcome. - * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - * email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) - */ +// +// A C-program for MT19937, with initialization improved 2002/1/26. +// Coded by Takuji Nishimura and Makoto Matsumoto. +// +// Before using, initialize the state by using init_genrand(seed) +// or init_by_array(init_key, key_length). +// +// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, +// All rights reserved. +// Copyright (C) 2005, Mutsuo Saito, +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The names of its contributors may not be used to endorse or promote +// products derived from this software without specific prior written +// permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// +// Any feedback is very welcome. +// http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html +// email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) +// #include <stdio.h> #include "mt19937ar.h" -/* Period parameters */ +// Period parameters #define N 624 #define M 397 -#define MATRIX_A 0x9908b0dfUL /* constant vector a */ -#define UPPER_MASK 0x80000000UL /* most significant w-r bits */ -#define LOWER_MASK 0x7fffffffUL /* least significant r bits */ +#define MATRIX_A 0x9908b0dfUL // constant vector a +#define UPPER_MASK 0x80000000UL // most significant w-r bits +#define LOWER_MASK 0x7fffffffUL // least significant r bits -static unsigned long mt[N]; /* the array for the state vector */ -static int mti = N + 1; /* mti==N+1 means mt[N] is not initialized */ +static unsigned long mt[N]; // the array for the state vector +static int mti = N + 1; // mti==N+1 means mt[N] is not initialized -/* initializes mt[N] with a seed */ +// initializes mt[N] with a seed void init_genrand( unsigned long s ) { mt[0] = s & 0xffffffffUL; @@ -64,19 +64,19 @@ { mt[mti] = ( 1812433253UL * ( mt[mti - 1] ^ ( mt[mti - 1] >> 30 ) ) + mti ); - /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ - /* In the previous versions, MSBs of the seed affect */ - /* only MSBs of the array mt[]. */ - /* 2002/01/09 modified by Makoto Matsumoto */ + // See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. + // In the previous versions, MSBs of the seed affect + // only MSBs of the array mt[]. + // 2002/01/09 modified by Makoto Matsumoto mt[mti] &= 0xffffffffUL; - /* for >32 bit machines */ + // for >32 bit machines } } -/* initialize by an array with array-length */ -/* init_key is the array for initializing keys */ -/* key_length is its length */ -/* slight change for C++, 2004/2/26 */ +// initialize by an array with array-length +// init_key is the array for initializing keys +// key_length is its length +// slight change for C++, 2004/2/26 void init_by_array( unsigned long init_key[], int key_length ) { int i, j, k; @@ -86,8 +86,8 @@ for (; k; k-- ) { mt[i] = ( mt[i] ^ ( ( mt[i - 1] ^ ( mt[i - 1] >> 30 ) ) * 1664525UL ) ) - + init_key[j] + j; /* non linear */ - mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ + + init_key[j] + j; // non linear + mt[i] &= 0xffffffffUL; // for WORDSIZE > 32 machines i++; j++; if ( i >= N ) { @@ -99,8 +99,8 @@ for ( k = N - 1; k; k-- ) { mt[i] = ( mt[i] ^ ( ( mt[i - 1] ^ ( mt[i - 1] >> 30 ) ) * 1566083941UL ) ) - - i; /* non linear */ - mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ + - i; // non linear + mt[i] &= 0xffffffffUL; // for WORDSIZE > 32 machines i++; if ( i >= N ) { @@ -108,22 +108,22 @@ } } - mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ + mt[0] = 0x80000000UL; // MSB is 1; assuring non-zero initial array } -/* generates a random number on [0,0xffffffff]-interval */ +// generates a random number on [0,0xffffffff]-interval unsigned long genrand_int32( void ) { unsigned long y; static unsigned long mag01[2] = { 0x0UL, MATRIX_A }; - /* mag01[x] = x * MATRIX_A for x=0,1 */ + // mag01[x] = x * MATRIX_A for x=0,1 - if ( mti >= N ) /* generate N words at one time */ + if ( mti >= N ) // generate N words at one time { int kk; - if ( mti == N + 1 ) /* if init_genrand() has not been called, */ - init_genrand( 5489UL ); /* a default initial seed is used */ + if ( mti == N + 1 ) // if init_genrand() has not been called, + init_genrand( 5489UL ); // a default initial seed is used for ( kk = 0; kk < N - M; kk++ ) { @@ -143,7 +143,7 @@ y = mt[mti++]; - /* Tempering */ + // Tempering y ^= ( y >> 11 ); y ^= ( y << 7 ) & 0x9d2c5680UL; y ^= ( y << 15 ) & 0xefc60000UL; @@ -152,37 +152,37 @@ return y; } -/* generates a random number on [0,0x7fffffff]-interval */ +// generates a random number on [0,0x7fffffff]-interval long genrand_int31( void ) { return (long) ( genrand_int32() >> 1 ); } -/* generates a random number on [0,1]-real-interval */ +// generates a random number on [0,1]-real-interval double genrand_real1( void ) { return genrand_int32() * ( 1.0 / 4294967295.0 ); - /* divided by 2^32-1 */ + // divided by 2^32-1 } -/* generates a random number on [0,1)-real-interval */ +// generates a random number on [0,1)-real-interval double genrand_real2( void ) { return genrand_int32() * ( 1.0 / 4294967296.0 ); - /* divided by 2^32 */ + // divided by 2^32 } -/* generates a random number on (0,1)-real-interval */ +// generates a random number on (0,1)-real-interval double genrand_real3( void ) { return ( ( (double) genrand_int32() ) + 0.5 ) * ( 1.0 / 4294967296.0 ); - /* divided by 2^32 */ + // divided by 2^32 } -/* generates a random number on [0,1) with 53-bit resolution*/ +// generates a random number on [0,1) with 53-bit resolution double genrand_res53( void ) { unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6; return ( a * 67108864.0 + b ) * ( 1.0 / 9007199254740992.0 ); } -/* These real versions are due to Isaku Wada, 2002/01/09 added */ +// These real versions are due to Isaku Wada, 2002/01/09 added Modified: trunk/src/mt19937ar.h =================================================================== --- trunk/src/mt19937ar.h 2010-10-11 21:41:06 UTC (rev 11256) +++ trunk/src/mt19937ar.h 2010-10-11 22:34:18 UTC (rev 11257) @@ -1,72 +1,72 @@ -/* - * A C-program for MT19937, with initialization improved 2002/1/26. - * Coded by Takuji Nishimura and Makoto Matsumoto. - * - * Before using, initialize the state by using init_genrand(seed) - * or init_by_array(init_key, key_length). - * - * Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - * All rights reserved. - * Copyright (C) 2005, Mutsuo Saito - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. The names of its contributors may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Any feedback is very welcome. - * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - * email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) - */ +// +// A C-program for MT19937, with initialization improved 2002/1/26. +// Coded by Takuji Nishimura and Makoto Matsumoto. +// +// Before using, initialize the state by using init_genrand(seed) +// or init_by_array(init_key, key_length). +// +// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, +// All rights reserved. +// Copyright (C) 2005, Mutsuo Saito +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The names of its contributors may not be used to endorse or promote +// products derived from this software without specific prior written +// permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// +// Any feedback is very welcome. +// http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html +// email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) +// -/* initializes mt[N] with a seed */ +// initializes mt[N] with a seed void init_genrand( unsigned long s ); -/* initialize by an array with array-length */ -/* init_key is the array for initializing keys */ -/* key_length is its length */ -/* slight change for C++, 2004/2/26 */ +// initialize by an array with array-length +// init_key is the array for initializing keys +// key_length is its length +// slight change for C++, 2004/2/26 void init_by_array( unsigned long init_key[], int key_length ); -/* generates a random number on [0,0xffffffff]-interval */ +// generates a random number on [0,0xffffffff]-interval unsigned long genrand_int32( void ); -/* generates a random number on [0,0x7fffffff]-interval */ +// generates a random number on [0,0x7fffffff]-interval long genrand_int31( void ); -/* These real versions are due to Isaku Wada, 2002/01/09 added */ -/* generates a random number on [0,1]-real-interval */ +// These real versions are due to Isaku Wada, 2002/01/09 added +// generates a random number on [0,1]-real-interval double genrand_real1( void ); -/* generates a random number on [0,1)-real-interval */ +// generates a random number on [0,1)-real-interval double genrand_real2( void ); -/* generates a random number on (0,1)-real-interval */ +// generates a random number on (0,1)-real-interval double genrand_real3( void ); -/* generates a random number on [0,1) with 53-bit resolution*/ +// generates a random number on [0,1) with 53-bit resolution double genrand_res53( void ); Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2010-10-11 21:41:06 UTC (rev 11256) +++ trunk/src/pdfutils.c 2010-10-11 22:34:18 UTC (rev 11257) @@ -1,36 +1,36 @@ -/* $Id$ - * - * pdf_utils.c - * - * Copyright (C) 1992, 1993, 1994, 1995 - * Maurice LeBrun mj...@di... - * Institute for Fusion Studies University of Texas at Austin - * - * Copyright (C) 2004 Joao Cardoso - * Copyright (C) 2004 Alan W. Irwin - * Copyright (C) 2004 Andrew Ross - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * These functions do the low-level reading/writing of portable data files. - * Data can be written to/read from either a file handle or memory buffer. - */ +// $Id$ +// +// pdf_utils.c +// +// Copyright (C) 1992, 1993, 1994, 1995 +// Maurice LeBrun mj...@di... +// Institute for Fusion Studies University of Texas at Austin +// +// Copyright (C) 2004 Joao Cardoso +// Copyright (C) 2004 Alan W. Irwin +// Copyright (C) 2004 Andrew Ross +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +// +// These functions do the low-level reading/writing of portable data files. +// Data can be written to/read from either a file handle or memory buffer. +// #define NEED_PLDEBUG #include "plplotP.h" @@ -40,11 +40,11 @@ static int debug = 0; -/*--------------------------------------------------------------------------*\ - * void pdf_set (string, value) - * - * Set an option. Pretty sparse right now but you never know. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// void pdf_set (string, value) +// +// Set an option. Pretty sparse right now but you never know. +//-------------------------------------------------------------------------- void pdf_set( char *option, int value ) @@ -53,12 +53,12 @@ debug = value; } -/*--------------------------------------------------------------------------*\ - * pdf_fopen() - * - * Initializes a PDFstrm for a file oriented device. - * Used exactly like fopen(). - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_fopen() +// +// Initializes a PDFstrm for a file oriented device. +// Used exactly like fopen(). +//-------------------------------------------------------------------------- PDFstrm * pdf_fopen( const char *filename, const char *mode ) @@ -82,7 +82,7 @@ int binary = 0; char *m, *p; - /* Copy over the mode, removing 'b' if needed */ + // Copy over the mode, removing 'b' if needed for ( m = mode, p = new_mode; *m != 0; m++ ) { if ( *m == 'b' ) @@ -125,12 +125,12 @@ return pdfs; } -/*--------------------------------------------------------------------------*\ - * pdf_bopen() - * - * Initializes a PDFstrm for reading/writing to a memory buffer. - * If buffer is NULL, a standard buffer is allocated. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_bopen() +// +// Initializes a PDFstrm for reading/writing to a memory buffer. +// If buffer is NULL, a standard buffer is allocated. +//-------------------------------------------------------------------------- PDFstrm * pdf_bopen( U_CHAR *buffer, long bufmax ) @@ -173,12 +173,12 @@ return pdfs; } -/*--------------------------------------------------------------------------*\ - * pdf_finit() - * - * Initializes a PDFstrm for a file oriented device. - * Like pdf_fopen() but an existing file handle is specified. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_finit() +// +// Initializes a PDFstrm for a file oriented device. +// Like pdf_fopen() but an existing file handle is specified. +//-------------------------------------------------------------------------- PDFstrm * pdf_finit( FILE *file ) @@ -202,12 +202,12 @@ return pdfs; } -/*--------------------------------------------------------------------------*\ - * pdf_close() - * - * Closes a PDFstrm. - * Used exactly like fclose(). - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_close() +// +// Closes a PDFstrm. +// Used exactly like fclose(). +//-------------------------------------------------------------------------- int pdf_close( PDFstrm *pdfs ) @@ -235,11 +235,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * int pdf_putc() - * - * Writes a single character. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_putc() +// +// Writes a single character. +//-------------------------------------------------------------------------- int pdf_putc( int c, PDFstrm *pdfs ) @@ -279,11 +279,11 @@ return result; } -/*--------------------------------------------------------------------------*\ - * int pdf_getc() - * - * Reads a single character. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_getc() +// +// Reads a single character. +//-------------------------------------------------------------------------- int pdf_getc( PDFstrm *pdfs ) @@ -313,11 +313,11 @@ return result; } -/*--------------------------------------------------------------------------*\ - * int pdf_ungetc() - * - * Push back the last command read. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_ungetc() +// +// Push back the last command read. +//-------------------------------------------------------------------------- int pdf_ungetc( int c, PDFstrm *pdfs ) @@ -352,11 +352,11 @@ return result; } -/*--------------------------------------------------------------------------*\ - * int pdf_wrx() - * - * Writes a record. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_wrx() +// +// Writes a record. +//-------------------------------------------------------------------------- static int pdf_wrx( const U_CHAR *x, long nitems, PDFstrm *pdfs ) @@ -398,11 +398,11 @@ return result; } -/*--------------------------------------------------------------------------*\ - * int pdf_rdx() - * - * Reads a record. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_rdx() +// +// Reads a record. +//-------------------------------------------------------------------------- int pdf_rdx( U_CHAR *x, long nitems, PDFstrm *pdfs ) @@ -435,13 +435,13 @@ return result; } -/*--------------------------------------------------------------------------*\ - * pdf_wr_header() - * - * Writes a header string. Input string must be NULL-terminated. The - * written string is terminated by a new-line, not a NULL. This is done - * so you can type e.g. "% strings <file> | head" and get sensible output. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_wr_header() +// +// Writes a header string. Input string must be NULL-terminated. The +// written string is terminated by a new-line, not a NULL. This is done +// so you can type e.g. "% strings <file> | head" and get sensible output. +//-------------------------------------------------------------------------- int pdf_wr_header( PDFstrm *pdfs, char *header ) @@ -463,12 +463,12 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * int pdf_rd_header - * - * Reads a newline-terminated header string from PDFstrm *pdfs, and - * converts to a usual NULL-terminated string. 80 chars maximum assumed. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_rd_header +// +// Reads a newline-terminated header string from PDFstrm *pdfs, and +// converts to a usual NULL-terminated string. 80 chars maximum assumed. +//-------------------------------------------------------------------------- int pdf_rd_header( PDFstrm *pdfs, char *header ) @@ -486,15 +486,15 @@ if ( header[i] == '\n' ) break; } - header[i] = '\0'; /* NULL terminate */ + header[i] = '\0'; // NULL terminate return 0; } -/*--------------------------------------------------------------------------*\ - * pdf_wr_string() - * - * Writes a null-terminated string. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_wr_string() +// +// Writes a null-terminated string. +//-------------------------------------------------------------------------- int pdf_wr_string( PDFstrm *pdfs, const char *string ) @@ -512,12 +512,12 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * int pdf_rd_string - * - * Reads a null-terminated string from PDFstrm *pdfs. - * A max of nmax chars are read. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_rd_string +// +// Reads a null-terminated string from PDFstrm *pdfs. +// A max of nmax chars are read. +//-------------------------------------------------------------------------- int pdf_rd_string( PDFstrm *pdfs, char *string, int nmax ) @@ -535,15 +535,15 @@ if ( c == '\0' ) break; } - string[i] = '\0'; /* handle boundary case */ + string[i] = '\0'; // handle boundary case return 0; } -/*--------------------------------------------------------------------------*\ - * int pdf_wr_1byte() - * - * Writes a U_CHAR as a single byte. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_wr_1byte() +// +// Writes a U_CHAR as a single byte. +//-------------------------------------------------------------------------- int pdf_wr_1byte( PDFstrm *pdfs, U_CHAR s ) @@ -557,11 +557,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * int pdf_rd_1byte() - * - * Reads a single byte, storing into a U_CHAR. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_rd_1byte() +// +// Reads a single byte, storing into a U_CHAR. +//-------------------------------------------------------------------------- int pdf_rd_1byte( PDFstrm *pdfs, U_CHAR *ps ) @@ -575,11 +575,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * pdf_wr_2bytes() - * - * Writes a U_SHORT as two single bytes, low end first. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_wr_2bytes() +// +// Writes a U_SHORT as two single bytes, low end first. +//-------------------------------------------------------------------------- int pdf_wr_2bytes( PDFstrm *pdfs, U_SHORT s ) @@ -595,11 +595,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * pdf_rd_2bytes() - * - * Reads a U_SHORT from two single bytes, low end first. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_rd_2bytes() +// +// Reads a U_SHORT from two single bytes, low end first. +//-------------------------------------------------------------------------- int pdf_rd_2bytes( PDFstrm *pdfs, U_SHORT *ps ) @@ -616,11 +616,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * pdf_wr_2nbytes() - * - * Writes n U_SHORT's as 2n single bytes, low end first. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_wr_2nbytes() +// +// Writes n U_SHORT's as 2n single bytes, low end first. +//-------------------------------------------------------------------------- int pdf_wr_2nbytes( PDFstrm *pdfs, U_SHORT *s, PLINT n ) @@ -639,11 +639,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * pdf_rd_2nbytes() - * - * Reads n U_SHORT's from 2n single bytes, low end first. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_rd_2nbytes() +// +// Reads n U_SHORT's from 2n single bytes, low end first. +//-------------------------------------------------------------------------- int pdf_rd_2nbytes( PDFstrm *pdfs, U_SHORT *s, PLINT n ) @@ -663,11 +663,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * pdf_wr_4bytes() - * - * Writes an unsigned long as four single bytes, low end first. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_wr_4bytes() +// +// Writes an unsigned long as four single bytes, low end first. +//-------------------------------------------------------------------------- int pdf_wr_4bytes( PDFstrm *pdfs, U_LONG s ) @@ -685,11 +685,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * pdf_rd_4bytes() - * - * Reads an unsigned long from 4 single bytes, low end first. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pdf_rd_4bytes() +// +// Reads an unsigned long from 4 single bytes, low end first. +//-------------------------------------------------------------------------- int pdf_rd_4bytes( PDFstrm *pdfs, U_LONG *ps ) @@ -708,66 +708,66 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * Here is the IEEE floating point specification in both 32 bit and 64 bit - * precisions, from page 9 of "IEEE Standard for Binary Floating-Point - * Arithmetic", copyright 1985, IEEE Std 754-1985: - * - * - * Single Format - * - * msb means most significant bit - * lsb means least significant bit - * - * 1 8 23 - * _____________________________________________________________________ - * | | | | - * | s | e | f | - * |___|________________|______________________________________________| - * msb lsb msb lsb - * - * - * - * Double Format - * - * msb means most significant bit - * lsb means least significant bit - * - * 1 11 52 - * _____________________________________________________________________ - * | | | | - * | s | e | f | - * |___|________________|______________________________________________| - * msb lsb msb lsb - * - * - * (Thanks to: Andy Mai (ma...@nc...)) - * - * - * According to "inmos: Transputer instruction set" the IEEE standard - * specifies the floating format as: - * - * s exp frac - * - * Where: s = sign bit (1 bit) - * exp = exponent (8 bits for 32 bit float / 11 bits for 64 bit float) - * frac = fraction (23 bits for 32 bit float / 52 bits for 64 bit float) - * - * value of (s exp frac) = (-1)^s * 1.frac * 2^(exp-bias) ; if exp not 0 - * (-1)^s * 0.frac * 2^(1-bias) ; if exp = 0 - * - * where bias = 127 for 32 bit float - * bias = 1023 for 64 bit float - * - * (Thanks to: Tom Bjorkholm(TBJ...@ab...)) - * - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Here is the IEEE floating point specification in both 32 bit and 64 bit +// precisions, from page 9 of "IEEE Standard for Binary Floating-Point +// Arithmetic", copyright 1985, IEEE Std 754-1985: +// +// +// Single Format +// +// msb means most significant bit +// lsb means least significant bit +// +// 1 8 23 +// _____________________________________________________________________ +// | | | | +// | s | e | f | +// |___|________________|______________________________________________| +// msb lsb msb lsb +// +// +// +// Double Format +// +// msb means most significant bit +// lsb means least significant bit +// +// 1 11 52 +// _____________________________________________________________________ +// | | | | +// | s | e | f | +// |___|________________|______________________________________________| +// msb lsb msb lsb +// +// +// (Thanks to: Andy Mai (ma...@nc...)) +// +// +// According to "inmos: Transputer instruction set" the IEEE standard +// specifies the floating format as: +// +// s exp frac +// +// Where: s = sign bit (1 bit) +// exp = exponent (8 bits for 32 bit float / 11 bits for 64 bit float) +// frac = fraction (23 bits for 32 bit float / 52 bits for 64 bit float) +// +// value of (s exp frac) = (-1)^s * 1.frac * 2^(exp-bias) ; if exp not 0 +// (-1)^s * 0.frac * 2^(1-bias) ; if exp = 0 +// +// where bias = 127 for 32 bit float +// bias = 1023 for 64 bit float +// +// (Thanks to: Tom Bjorkholm(TBJ...@ab...)) +// +//-------------------------------------------------------------------------- -/*--------------------------------------------------------------------------*\ - * int pdf_wr_ieeef() - * - * Writes a float in IEEE single precision (32 bit) format. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_wr_ieeef() +// +// Writes a float in IEEE single precision (32 bit) format. +//-------------------------------------------------------------------------- int pdf_wr_ieeef( PDFstrm *pdfs, float f ) @@ -806,7 +806,7 @@ e_ieee = e_new + bias; f_tmp = (float) ( f_new - 1 ); } - f_ieee = (U_LONG) ( f_tmp * 8388608 ); /* multiply by 2^23 */ + f_ieee = (U_LONG) ( f_tmp * 8388608 ); // multiply by 2^23 if ( e_ieee > 255 ) { @@ -832,11 +832,11 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * int pdf_rd_ieeef() - * - * Reads a float from a IEEE single precision (32 bit) format. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// int pdf_rd_ieeef() +// +// Reads a float from a IEEE single precision (32 bit) format. +//-------------------------------------------------------------------------- int pdf_rd_ieeef( PDFstrm *pdfs, float *pf ) @@ -853,7 +853,7 @@ e_ieee = ( value & (U_LONG) 0x7F800000 ) >> 23; f_ieee = ( value & (U_LONG) 0x007FFFFF ); - f_tmp = (double) f_ieee / 8388608.0; /* divide by 2^23 */ + f_tmp = (double) f_ieee / 8388608.0; // divide by 2^23 if ( e_ieee == 0 ) { @@ -881,14 +881,14 @@ return 0; } -/*--------------------------------------------------------------------------*\ - * print_ieeef() - * - * Prints binary representation for numbers pointed to by arguments. - * The first argument is the original float, the second is the - * IEEE representation. They should be the same on any machine that - * uses IEEE floats. - \*------------------------... [truncated message content] |
From: <hez...@us...> - 2010-10-17 18:42:01
|
Revision: 11262 http://plplot.svn.sourceforge.net/plplot/?rev=11262&view=rev Author: hezekiahcarty Date: 2010-10-17 18:41:53 +0000 (Sun, 17 Oct 2010) Log Message: ----------- Add pllegend to the OCaml bindings; Update OCaml examples 4, 26 "make test_diff_psc" now shows OCaml passing for all of the standard examples Modified Paths: -------------- trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_h trunk/bindings/ocaml/plplot_h.inc trunk/bindings/ocaml/plplot_impl.c trunk/examples/ocaml/x04.ml trunk/examples/ocaml/x26.ml Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2010-10-15 21:35:09 UTC (rev 11261) +++ trunk/bindings/ocaml/plplot.mli 2010-10-17 18:41:53 UTC (rev 11262) @@ -29,6 +29,14 @@ | PL_Y_AXIS | PL_Z_AXIS +type plplot_legend_option_type = + PL_LEGEND_NONE + | PL_LEGEND_COLOR_BOX + | PL_LEGEND_LINE + | PL_LEGEND_SYMBOL + | PL_LEGEND_TEXT_LEFT + | PL_LEGEND_BACKGROUND + (** {3 A higher-level OCaml interface to PLplot} *) module Plot : sig @@ -655,6 +663,12 @@ = "camlidl_plplot_core_c_pljoin" external pllab : string -> string -> string -> unit = "camlidl_plplot_core_c_pllab" +external pllegend : plplot_legend_option_type list -> float -> float -> + float -> int -> plplot_legend_option_type list array -> float -> float -> + float -> float -> int array -> string array -> int array -> int array -> + float array -> int array -> int array -> int array -> int array -> + float array -> int array -> int array -> unit + = "ml_pllegend_byte" "ml_pllegend" external pllightsource : float -> float -> float -> unit = "camlidl_plplot_core_c_pllightsource" external plline : float array -> float array -> unit Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2010-10-15 21:35:09 UTC (rev 11261) +++ trunk/bindings/ocaml/plplot_core.idl 2010-10-17 18:41:53 UTC (rev 11262) @@ -212,6 +212,15 @@ PL_Y_AXIS | \ PL_Z_AXIS"); +// Hand-translated PL_LEGEND_* flags for use with pllegend +quote(mlmli, "type plplot_legend_option_type = \ + PL_LEGEND_NONE | \ + PL_LEGEND_COLOR_BOX | \ + PL_LEGEND_LINE | \ + PL_LEGEND_SYMBOL | \ + PL_LEGEND_TEXT_LEFT | \ + PL_LEGEND_BACKGROUND"); + // Custom axis labeling quote(ml, "external ml_plslabelfunc : unit -> unit = \"ml_plslabelfunc\""); quote(ml, @@ -253,4 +262,5 @@ RAW_ML(external plgriddata : float array -> float array -> float array -> float array -> float array -> plplot_grid_method_type -> float -> float array array = "ml_plgriddata_bytecode" "ml_plgriddata") RAW_ML(external plparseopts : string array -> plplot_parse_method_type list -> unit = "ml_plparseopts") +RAW_ML(external pllegend : plplot_legend_option_type list -> float -> float -> float -> int -> plplot_legend_option_type list array -> float -> float -> float -> float -> int array -> string array -> int array -> int array -> float array -> int array -> int array -> int array -> int array -> float array -> int array -> int array -> unit = "ml_pllegend_byte" "ml_pllegend") Modified: trunk/bindings/ocaml/plplot_h =================================================================== --- trunk/bindings/ocaml/plplot_h 2010-10-15 21:35:09 UTC (rev 11261) +++ trunk/bindings/ocaml/plplot_h 2010-10-17 18:41:53 UTC (rev 11262) @@ -232,7 +232,19 @@ void c_pllab(const char *xlabel, const char *ylabel, const char *tlabel); +/* void +c_pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, + PLINT nlegend, PLINT *opt_array, + PLFLT text_offset, PLFLT text_scale, PLFLT text_spacing, + PLFLT text_justification, PLINT *text_colors, char **text, + PLINT *box_colors, PLINT *box_patterns, PLFLT *box_scales, + PLINT *line_colors, PLINT *line_styles, PLINT *line_widths, + PLINT *symbol_colors, PLFLT *symbol_scales, + PLINT *symbol_numbers, PLINT *symbols ); +*/ + + void c_pllightsource(PLFLT x, PLFLT y, PLFLT z); void Modified: trunk/bindings/ocaml/plplot_h.inc =================================================================== --- trunk/bindings/ocaml/plplot_h.inc 2010-10-15 21:35:09 UTC (rev 11261) +++ trunk/bindings/ocaml/plplot_h.inc 2010-10-17 18:41:53 UTC (rev 11262) @@ -71,7 +71,7 @@ [mlname(plot3d)] void c_plot3d ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt, boolean side ); [mlname(plot3dc)] void c_plot3dc ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt, [size_is(nlevel), in] double * clevel, int nlevel ); [mlname(plpat)] void c_plpat ( int nlin, [in, size_is(nlin)] int * inc, [in, size_is(nlin)] int * del ); -[mlname(plpath)] void c_plpath ( int n, double x1, double y1, double x2, double y2); +[mlname(plpath)] void c_plpath ( int n, double x1, double y1, double x2, double y2 ); [mlname(plpoin)] void c_plpoin ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, int code ); [mlname(plpoin3)] void c_plpoin3 ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, [in, size_is(n)] double * z, int code ); [mlname(plprec)] void c_plprec ( int setp, int prec ); Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2010-10-15 21:35:09 UTC (rev 11261) +++ trunk/bindings/ocaml/plplot_impl.c 2010-10-17 18:41:53 UTC (rev 11262) @@ -46,6 +46,7 @@ typedef PLINT ( *ML_DEFINED_FUNC )( PLFLT, PLFLT ); typedef void ( *ML_MAPFORM_FUNC )( PLINT, PLFLT*, PLFLT* ); typedef void ( *ML_LABEL_FUNC )( PLINT, PLFLT, char*, PLINT, PLPointer ); +typedef PLINT ( *ML_VARIANT_FUNC )( PLINT ); /* * @@ -639,31 +640,50 @@ return translated_option; } +// Copy a string array +#define INIT_STRING_ARRAY( o ) \ + int o##_length; \ + o##_length = Wosize_val( o ); \ + const char *c_##o[o##_length]; \ + for ( i = 0; i < o##_length; i++ ) { c_##o[i] = String_val( Field( o, i ) ); } + +// Copy an int array, o, of n element to the C array c +#define INIT_INT_ARRAY( o ) \ + int o##_length; \ + o##_length = Wosize_val( o ); \ + int c_##o[o##_length]; \ + for ( i = 0; i < (o##_length); i++ ) { (c_##o)[i] = Int_val( Field( (o), i ) ); } + +int lor_ml_list( value list, ML_VARIANT_FUNC variant_f ) +{ + CAMLparam1( list ); + int result; + + result = 0; + while ( list != Val_emptylist ) + { + // Accumulate the elements of the list + result = result | variant_f( Int_val( Field( list, 0 ) ) ); + // Point to the tail of the list for the next loop + list = Field( list, 1 ); + } + + CAMLreturn( result ); +} + value ml_plparseopts( value argv, value parse_method ) { CAMLparam2( argv, parse_method ); int i; int result; - int argv_length; int combined_parse_method; - argv_length = Wosize_val( argv ); // Make a copy of the command line argument strings - const char* argv_copy[argv_length]; - for ( i = 0; i < argv_length; i++ ) - { - argv_copy[i] = String_val( Field( argv, i ) ); - } + INIT_STRING_ARRAY( argv ) + // OR the elements of the parse_method list together - combined_parse_method = 0; - while ( parse_method != Val_emptylist ) - { - combined_parse_method = - combined_parse_method | - translate_parse_option( Int_val( Field( parse_method, 0 ) ) ); - // Point to the tail of the list for the next loop - parse_method = Field( parse_method, 1 ); - } - result = plparseopts( &argv_length, argv_copy, combined_parse_method ); + combined_parse_method = lor_ml_list( parse_method, translate_parse_option ); + + result = plparseopts( &argv_length, c_argv, combined_parse_method ); if ( result != 0 ) { char exception_message[MAX_EXCEPTION_MESSAGE_LENGTH]; @@ -715,6 +735,96 @@ argv[15], argv[16], argv[17], argv[18] ); } +int translate_legend_option( int legend_option ) +{ + int translated_option; + switch ( legend_option ) + { + case 0: translated_option = PL_LEGEND_NONE; break; + case 1: translated_option = PL_LEGEND_COLOR_BOX; break; + case 2: translated_option = PL_LEGEND_LINE; break; + case 3: translated_option = PL_LEGEND_SYMBOL; break; + case 4: translated_option = PL_LEGEND_TEXT_LEFT; break; + case 5: translated_option = PL_LEGEND_BACKGROUND; break; + default: translated_option = -1; + } + return translated_option; +} + +value ml_pllegend( value opt, value x, value y, value plot_width, + value bg_color, value opt_array, + value text_offset, value text_scale, value text_spacing, + value text_justification, value text_colors, value text, + value box_colors, value box_patterns, value box_scales, + value line_colors, value line_styles, value line_widths, + value symbol_colors, value symbol_scales, + value symbol_numbers, value symbols ) +{ + CAMLparam5( opt, x, y, plot_width, bg_color ); + CAMLxparam5( opt_array, text_offset, text_scale, text_spacing, + text_justification ); + CAMLxparam5( text_colors, text, box_colors, box_patterns, box_scales ); + CAMLxparam5( line_colors, line_styles, line_widths, symbol_colors, + symbol_scales ); + CAMLxparam2( symbol_numbers, symbols ); + + // Counter + int i; + // General legend options + int c_opt; + // Number of legend entries + int n_legend; + n_legend = Wosize_val( opt_array ); + // Options for each legend entry + int c_opt_array[n_legend]; + + // Assume that the dimensions all line up on the OCaml side, so we don't + // need to do any further dimension checks. + + // Define and initialize all of the C arrays to pass in to pllegend + INIT_STRING_ARRAY( text ) + INIT_INT_ARRAY( text_colors ) + INIT_INT_ARRAY( box_colors ) + INIT_INT_ARRAY( box_patterns ) + INIT_INT_ARRAY( line_colors ) + INIT_INT_ARRAY( line_styles ) + INIT_INT_ARRAY( line_widths ) + INIT_INT_ARRAY( symbol_colors ) + INIT_INT_ARRAY( symbol_numbers ) + INIT_INT_ARRAY( symbols ) + + // Translate the legend configuration options + c_opt = lor_ml_list( opt, translate_legend_option ); + + for ( i = 0; i < n_legend; i++ ) + { + c_opt_array[i] = + lor_ml_list( Field( opt_array, i ), translate_legend_option ); + } + + pllegend( c_opt, Double_val( x ), Double_val( y ), + Double_val( plot_width ), Int_val( bg_color ), n_legend, + c_opt_array, + Double_val( text_offset ), Double_val( text_scale ), + Double_val( text_spacing ), Double_val( text_justification ), + c_text_colors, c_text, + c_box_colors, c_box_patterns, (double *)box_scales, + c_line_colors, c_line_styles, c_line_widths, + c_symbol_colors, (double *)symbol_scales, c_symbol_numbers, + c_symbols ); + + CAMLreturn( Val_unit ); +} + +value ml_pllegend_byte( value* argv, int argn ) +{ + return ml_pllegend( argv[0], argv[1], argv[2], argv[3], argv[4], + argv[5], argv[6], argv[7], argv[8], argv[9], + argv[10], argv[11], argv[12], argv[13], argv[14], + argv[15], argv[16], argv[17], argv[18], argv[19], + argv[20], argv[21] ); +} + /* pltr* function implementations */ void ml_pltr0( double x, double y, double* tx, double* ty ) { Modified: trunk/examples/ocaml/x04.ml =================================================================== --- trunk/examples/ocaml/x04.ml 2010-10-15 21:35:09 UTC (rev 11261) +++ trunk/examples/ocaml/x04.ml 2010-10-17 18:41:53 UTC (rev 11262) @@ -14,11 +14,6 @@ \*--------------------------------------------------------------------------*) let plot1 plot_type = - (* - int i; - static PLFLT freql[101], ampl[101], phase[101]; - PLFLT f0, freq; - *) pladv 0; (* Set up data for log plot *) @@ -51,7 +46,7 @@ (* Plot ampl vs freq *) plcol0 2; plline freql ampl; - plcol0 1; + plcol0 2; plptex 1.6 (-30.0) 1.0 (-20.0) 0.5 "-20 dB/decade"; (* Put labels on *) @@ -68,12 +63,62 @@ plbox "" 0.0 0 "cmstv" 30.0 3; plcol0 3; plline freql phase; + plpoin freql phase 3; plcol0 3; plmtex "r" 5.0 0.5 0.5 "Phase shift (degrees)"; + + (* Draw a legend *) + (* First legend entry. *) + let opt_array = [| [PL_LEGEND_LINE]; [PL_LEGEND_LINE; PL_LEGEND_SYMBOL] |] in + let text_colors = [| 2; 3 |] in + let text = [| "Amplitude"; "Phase shift" |] in + let line_colors = [| 2; 3 |] in + let line_styles = [| 1; 1 |] in + let line_widths = [| 1; 1 |] in + (* note from the above opt_array the first symbol (and box) indices + do not matter *) + + (* Second legend entry. *) + let symbol_colors = [| 0; 3 |] in + let symbol_scales = [| 0.0; 1.0 |] in + let symbol_numbers = [| 0; 4 |] in + let symbols = [| 0; 3 |] in + (* from the above opt_arrays we can completely ignore everything + to do with boxes *) + + plscol0a 15 32 32 32 0.90; + pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array + 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols; () ) - else + else if plot_type = 1 then ( + (* Draw a legend *) + (* First legend entry. *) + let opt_array = [| [PL_LEGEND_LINE] |] in + let text_colors = [| 2 |] in + let text = [| "Amplitude" |] in + let line_colors = [| 2 |] in + let line_styles = [| 1 |] in + let line_widths = [| 1 |] in + (* note from the above opt_array the first symbol (and box) indices + do not matter *) + + (* from the above opt_arrays we can completely ignore everything + to do with boxes and symbols *) + + plscol0a 15 32 32 32 0.90; + pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array + 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] + line_colors line_styles line_widths + [||] [||] [||] [||]; () + ) (*--------------------------------------------------------------------------*\ * Illustration of logarithmic axes, and redefinition of window. Modified: trunk/examples/ocaml/x26.ml =================================================================== --- trunk/examples/ocaml/x26.ml 2010-10-15 21:35:09 UTC (rev 11261) +++ trunk/examples/ocaml/x26.ml 2010-10-17 18:41:53 UTC (rev 11262) @@ -89,6 +89,12 @@ "-20 dB/десяток"; |] +(* Short rearranged versions of y_label and alty_label. *) +let legend_text = [| + [|"Amplitude"; "Phase shift"|]; + [|"Амплитуда"; "Фазовый сдвиг"|]; +|] + let pi = atan 1.0 *. 4.0 (*--------------------------------------------------------------------------*\ @@ -96,13 +102,7 @@ * * Log-linear plot. \*--------------------------------------------------------------------------*) -let plot1 label_type x_label y_label alty_label title_label line_label = - (* - int i; - static PLFLT freql[101], ampl[101], phase[101]; - PLFLT f0, freq; - *) - +let plot1 label_type x_label y_label alty_label legend_text title_label line_label = pladv 0; (* Set up data for log plot *) @@ -141,7 +141,7 @@ plcol0 2; plline freql ampl; - plcol0 1; + plcol0 2; plptex 1.6 (-30.0) 1.0 (-20.0) 0.5 line_label; (* Put labels on *) @@ -152,19 +152,44 @@ plmtex "l" 5.0 0.5 0.5 y_label; (* For the gridless case, put phase vs freq on same plot *) + if label_type = 0 then ( + plcol0 1; + plwind (-2.0) 3.0 (-100.0) 0.0; + plbox "" 0.0 0 "cmstv" 30.0 3; + plcol0 3; + plline freql phase; + plpoin freql phase 3; + plcol0 3; + plmtex "r" 5.0 0.5 0.5 alty_label; + ); - if label_type = 0 then ( - plcol0 1; - plwind (-2.0) 3.0 (-100.0) 0.0; - plbox "" 0.0 0 "cmstv" 30.0 3; - plcol0 3; - plline freql phase; - plcol0 3; - plmtex "r" 5.0 0.5 0.5 alty_label; - ) - else - () + (* Draw a legend *) + (* First legend entry. *) + let opt_array = [| [PL_LEGEND_LINE]; [PL_LEGEND_LINE; PL_LEGEND_SYMBOL] |] in + let text_colors = [| 2; 3 |] in + let line_colors = [| 2; 3 |] in + let line_styles = [| 1; 1 |] in + let line_widths = [| 1; 1 |] in + (* note from the above opt_array the first symbol (and box) indices + do not matter *) + (* Second legend entry. *) + let symbol_colors = [| 0; 3 |] in + let symbol_scales = [| 0.0; 1.0 |] in + let symbol_numbers = [| 0; 4 |] in + let symbols = [| 0; 3 |] in + (* from the above opt_arrays we can completely ignore everything + to do with boxes *) + + plscol0a 15 32 32 32 0.90; + pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array + 1.0 1.0 2.0 + 1.0 text_colors legend_text + [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols; + () + (*--------------------------------------------------------------------------*\ * Illustration of logarithmic axes, and redefinition of window. \*--------------------------------------------------------------------------*) @@ -179,7 +204,7 @@ (* Make log plots using two different styles. *) Array.iteri ( fun i xl -> - plot1 0 xl y_label.(i) alty_label.(i) title_label.(i) line_label.(i) + plot1 0 xl y_label.(i) alty_label.(i) legend_text.(i) title_label.(i) line_label.(i) ) x_label; plend (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-10-23 17:28:15
|
Revision: 11271 http://plplot.svn.sourceforge.net/plplot/?rev=11271&view=rev Author: airwin Date: 2010-10-23 17:28:04 +0000 (Sat, 23 Oct 2010) Log Message: ----------- Add source files in the lib subtree to those who have been converted from old- to new-style comments. Modified Paths: -------------- trunk/lib/csa/csa.c trunk/lib/csa/csa.h trunk/lib/csa/csadll.h trunk/lib/csa/nan.h trunk/lib/csa/version.h trunk/lib/nistcd/cd.c trunk/lib/nistcd/cd.h trunk/lib/nistcd/cddll.h trunk/lib/nistcd/cdexpert.c trunk/lib/nistcd/cdmulti.c trunk/lib/nistcd/cdsimple.c trunk/lib/nistcd/cdtest.c trunk/lib/nistcd/cdtext.c trunk/lib/nistcd/color16.c trunk/lib/nistcd/defines.h trunk/lib/nn/delaunay.c trunk/lib/nn/delaunay.h trunk/lib/nn/hash.c trunk/lib/nn/hash.h trunk/lib/nn/istack.c trunk/lib/nn/istack.h trunk/lib/nn/lpi.c trunk/lib/nn/nan.h trunk/lib/nn/nn.h trunk/lib/nn/nnai.c trunk/lib/nn/nncommon.c trunk/lib/nn/nndll.h trunk/lib/nn/nnpi.c trunk/lib/nn/version.h trunk/lib/qsastime/bhunt_search_test.c trunk/lib/qsastime/deltaT-gen.c trunk/lib/qsastime/deltaT_test.c trunk/lib/qsastime/dspline.c trunk/lib/qsastime/dsplint.c trunk/lib/qsastime/qsastime.c trunk/lib/qsastime/qsastime.h trunk/lib/qsastime/qsastimeP.h.in trunk/lib/qsastime/qsastime_extra.c trunk/lib/qsastime/qsastime_extra.h trunk/lib/qsastime/qsastime_test.c trunk/lib/qsastime/qsastime_testlib.c trunk/lib/qsastime/qsastimedll.h trunk/lib/qsastime/tai-utc-gen.c trunk/scripts/style_source.sh Modified: trunk/lib/csa/csa.c =================================================================== --- trunk/lib/csa/csa.c 2010-10-23 17:25:22 UTC (rev 11270) +++ trunk/lib/csa/csa.c 2010-10-23 17:28:04 UTC (rev 11271) @@ -1,29 +1,29 @@ -/****************************************************************************** - * - * File: csa.c - * - * Created: 16/10/2002 - * - * Author: Pavel Sakov - * CSIRO Marine Research - * - * Purpose: 2D data approximation with bivariate C1 cubic spline. - * A set of library functions + standalone utility. - * - * Description: See J. Haber, F. Zeilfelder, O.Davydov and H.-P. Seidel, - * Smooth approximation and rendering of large scattered data - * sets, in ``Proceedings of IEEE Visualization 2001'' - * (Th.Ertl, K.Joy and A.Varshney, Eds.), pp.341-347, 571, - * IEEE Computer Society, 2001. - * http://www.uni-giessen.de/www-Numerische-Mathematik/ - * davydov/VIS2001.ps.gz - * http://www.math.uni-mannheim.de/~lsmath4/paper/ - * VIS2001.pdf.gz - * - * Revisions: 09/04/2003 PS: Modified points_read() to read from a - * file specified by name, not by handle. - * - *****************************************************************************/ +//***************************************************************************** +// +// File: csa.c +// +// Created: 16/10/2002 +// +// Author: Pavel Sakov +// CSIRO Marine Research +// +// Purpose: 2D data approximation with bivariate C1 cubic spline. +// A set of library functions + standalone utility. +// +// Description: See J. Haber, F. Zeilfelder, O.Davydov and H.-P. Seidel, +// Smooth approximation and rendering of large scattered data +// sets, in ``Proceedings of IEEE Visualization 2001'' +// (Th.Ertl, K.Joy and A.Varshney, Eds.), pp.341-347, 571, +// IEEE Computer Society, 2001. +// http://www.uni-giessen.de/www-Numerische-Mathematik/ +// davydov/VIS2001.ps.gz +// http://www.math.uni-mannheim.de/~lsmath4/paper/ +// VIS2001.pdf.gz +// +// Revisions: 09/04/2003 PS: Modified points_read() to read from a +// file specified by name, not by handle. +// +//*************************************************************************** #include <stdlib.h> #include <stdio.h> @@ -40,10 +40,10 @@ int csa_verbose = 0; -#define NPASTART 5 /* Number of Points Allocated at Start */ -#define SVD_NMAX 30 /* Maximal number of iterations in svd() */ +#define NPASTART 5 // Number of Points Allocated at Start +#define SVD_NMAX 30 // Maximal number of iterations in svd() -/* default algorithm parameters */ +// default algorithm parameters #define NPMIN_DEF 3 #define NPMAX_DEF 40 #define K_DEF 140 @@ -55,41 +55,41 @@ typedef struct { square * parent; - int index; /* index within parent square; 0 <= index <= - * 3 */ + int index; // index within parent square; 0 <= index <= + // 3 point vertices[3]; - point middle; /* barycenter */ - double h; /* parent square edge length */ - double r; /* data visibility radius */ + point middle; // barycenter + double h; // parent square edge length + double r; // data visibility radius - /* - * points used -- in primary triangles only - */ + // + // points used -- in primary triangles only + // int nallocated; int npoints; point** points; - int primary; /* flag -- whether calculate spline - * coefficients directly (by least squares - * method) (primary = 1) or indirectly (from - * C1 smoothness conditions) (primary = 0) */ - int hascoeffs; /* flag -- whether there are no NaNs among - * the spline coefficients */ - int order; /* spline order -- for primary triangles only - */ + int primary; // flag -- whether calculate spline + // coefficients directly (by least squares + // method) (primary = 1) or indirectly (from + // C1 smoothness conditions) (primary = 0) + int hascoeffs; // flag -- whether there are no NaNs among + // the spline coefficients + int order; // spline order -- for primary triangles only + // } triangle; struct square { csa * parent; - int i, j; /* indices */ + int i, j; // indices int nallocated; int npoints; point ** points; - int primary; /* flag -- whether this square contains a - * primary triangle */ + int primary; // flag -- whether this square contains a + // primary triangle triangle* triangles[4]; double coeffs[25]; @@ -106,38 +106,38 @@ int npoints; point ** points; - /* - * squarization - */ + // + // squarization + // int ni; int nj; double h; - square *** squares; /* square* [j][i] */ + square *** squares; // square* [j][i] - int npt; /* Number of Primary Triangles */ - triangle** pt; /* Primary Triangles -- triangle* [npt] */ + int npt; // Number of Primary Triangles + triangle** pt; // Primary Triangles -- triangle* [npt] - /* - * algorithm parameters - */ - int npmin; /* minimal number of points locally involved - * in * spline calculation (normally = 3) */ - int npmax; /* maximal number of points locally involved - * in * spline calculation (required > 10, * - * recommended 20 < npmax < 60) */ - double k; /* relative tolerance multiple in fitting - * spline coefficients: the higher this - * value, the higher degree of the locally - * fitted spline (recommended 80 < k < 200) */ - int nppc; /* average number of points per square */ + // + // algorithm parameters + // + int npmin; // minimal number of points locally involved + // in * spline calculation (normally = 3) + int npmax; // maximal number of points locally involved + // in * spline calculation (required > 10, * + // recommended 20 < npmax < 60) + double k; // relative tolerance multiple in fitting + // spline coefficients: the higher this + // value, the higher degree of the locally + // fitted spline (recommended 80 < k < 200) + int nppc; // average number of points per square }; static void csa_quit( char* format, ... ) { va_list args; - fflush( stdout ); /* just in case -- to have the exit message - * last */ + fflush( stdout ); // just in case -- to have the exit message + // last fprintf( stderr, "error: csa: " ); va_start( args, format ); @@ -147,12 +147,12 @@ exit( 1 ); } -/* Allocates n1xn2 matrix of something. Note that it will be accessed as - * [n2][n1]. - * @param n1 Number of columns - * @param n2 Number of rows - * @return Matrix - */ +// Allocates n1xn2 matrix of something. Note that it will be accessed as +// [n2][n1]. +// @param n1 Number of columns +// @param n2 Number of rows +// @return Matrix +// static void* alloc2d( int n1, int n2, size_t unitsize ) { unsigned int size; @@ -179,9 +179,9 @@ return pp; } -/* Destroys n1xn2 matrix. - * @param pp Matrix - */ +// Destroys n1xn2 matrix. +// @param pp Matrix +// static void free2d( void* pp ) { void* p; @@ -242,12 +242,12 @@ free( t ); } -/* Calculates barycentric coordinates of a point. - * Takes into account that possible triangles are rectangular, with the right - * angle at t->vertices[0], the vertices[1] vertex being in - * (-3*PI/4) + (PI/2) * t->index direction from vertices[0], and - * vertices[2] being at (-5*PI/4) + (PI/2) * t->index. - */ +// Calculates barycentric coordinates of a point. +// Takes into account that possible triangles are rectangular, with the right +// angle at t->vertices[0], the vertices[1] vertex being in +// (-3*PI/4) + (PI/2) * t->index direction from vertices[0], and +// vertices[2] being at (-5*PI/4) + (PI/2) * t->index. +// static void triangle_calculatebc( triangle* t, point* p, double bc[] ) { double dx = p->x - t->vertices[0].x; @@ -293,19 +293,19 @@ s->primary = 0; - /* - * create 4 triangles formed by diagonals - */ + // + // create 4 triangles formed by diagonals + // for ( ii = 0; ii < 4; ++ii ) { point vertices[3]; vertices[0].x = xmin + h / 2.0; vertices[0].y = ymin + h / 2.0; - vertices[1].x = xmin + h * ( ( ( ii + 1 ) % 4 ) / 2 ); /* 0 1 1 0 */ - vertices[1].y = ymin + h * ( ( ( ii + 2 ) % 4 ) / 2 ); /* 1 1 0 0 */ - vertices[2].x = xmin + h * ( ii / 2 ); /* 0 0 1 1 */ - vertices[2].y = ymin + h * ( ( ( ii + 1 ) % 4 ) / 2 ); /* 0 1 1 0 */ + vertices[1].x = xmin + h * ( ( ( ii + 1 ) % 4 ) / 2 ); // 0 1 1 0 + vertices[1].y = ymin + h * ( ( ( ii + 2 ) % 4 ) / 2 ); // 1 1 0 0 + vertices[2].x = xmin + h * ( ii / 2 ); // 0 0 1 1 + vertices[2].y = ymin + h * ( ( ( ii + 1 ) % 4 ) / 2 ); // 0 1 1 0 s->triangles[ii] = triangle_create( s, vertices, ii ); } @@ -399,9 +399,9 @@ int i; assert( a->squares == NULL ); - /* - * (can be called prior to squarization only) - */ + // + // (can be called prior to squarization only) + // while ( na < a->npoints + n ) na *= 2; @@ -429,9 +429,9 @@ } } -/* Marks the squares containing "primary" triangles by setting "primary" flag - * to 1. - */ +// Marks the squares containing "primary" triangles by setting "primary" flag +// to 1. +// static void csa_setprimaryflag( csa* a ) { square*** squares = a->squares; @@ -465,12 +465,12 @@ } } -/* Splits the data domain in a number of squares. - */ +// Splits the data domain in a number of squares. +// static void csa_squarize( csa* a ) { - int nps[7] = { 0, 0, 0, 0, 0, 0 }; /* stats on number of points per - * square */ + int nps[7] = { 0, 0, 0, 0, 0, 0 }; // stats on number of points per + // square double dx = a->xmax - a->xmin; double dy = a->ymax - a->ymin; int npoints = a->npoints; @@ -484,11 +484,11 @@ } assert( a->squares == NULL ); - /* - * (can be done only once) - */ + // + // (can be done only once) + // - h = sqrt( dx * dy * a->nppc / npoints ); /* square edge size */ + h = sqrt( dx * dy * a->nppc / npoints ); // square edge size if ( dx < h ) h = dy * a->nppc / npoints; if ( dy < h ) @@ -504,17 +504,17 @@ fflush( stderr ); } - /* - * create squares - */ + // + // create squares + // a->squares = alloc2d( a->ni, a->nj, sizeof ( void* ) ); for ( j = 0; j < a->nj; ++j ) for ( i = 0; i < a->ni; ++i ) a->squares[j][i] = square_create( a, a->xmin + h * ( i - 1 ), a->ymin + h * ( j - 1 ), i, j ); - /* - * map points to squares - */ + // + // map points to squares + // for ( ii = 0; ii < npoints; ++ii ) { point* p = a->points[ii]; @@ -524,16 +524,16 @@ square_addpoint( a->squares[j][i], p ); } - /* - * mark relevant squares with no points - */ + // + // mark relevant squares with no points + // csa_setprimaryflag( a ); - /* - * Create a list of "primary" triangles, for which spline coefficients - * will be calculated directy (by least squares method), without using - * C1 smoothness conditions. - */ + // + // Create a list of "primary" triangles, for which spline coefficients + // will be calculated directy (by least squares method), without using + // C1 smoothness conditions. + // a->pt = malloc( ( a->ni / 2 + 1 ) * a->nj * sizeof ( triangle* ) ); for ( j = 0, ii = 0, nadj = 0; j < a->nj; ++j ) { @@ -602,9 +602,9 @@ fflush( stderr ); } -/* Returns all squares intersecting with a square with center in t->middle - * and edges of length 2*t->r parallel to X and Y axes. - */ +// Returns all squares intersecting with a square with center in t->middle +// and edges of length 2*t->r parallel to X and Y axes. +// static void getsquares( csa* a, triangle* t, int* n, square*** squares ) { int imin = (int) floor( ( t->middle.x - t->r - a->xmin ) / t->h ); @@ -645,14 +645,14 @@ return hypot( p1->x - p2->x, p1->y - p2->y ); } -/* Thins data by creating an auxiliary regular grid and for leaving only - * the most central point within each grid cell. - * (I follow the paper here. It is possible that taking average -- in terms of - * both value and position -- of all points within a cell would be a bit more - * robust. However, because of keeping only shallow copies of input points, - * this would require quite a bit of structural changes. So, leaving it as is - * for now.) - */ +// Thins data by creating an auxiliary regular grid and for leaving only +// the most central point within each grid cell. +// (I follow the paper here. It is possible that taking average -- in terms of +// both value and position -- of all points within a cell would be a bit more +// robust. However, because of keeping only shallow copies of input points, +// this would require quite a bit of structural changes. So, leaving it as is +// for now.) +// static void thindata( triangle* t, int npmax ) { csa * a = t->parent->parent; @@ -677,7 +677,7 @@ if ( s->npoints == 0 ) square_addpoint( s, p ); - else /* npoints == 1 */ + else // npoints == 1 { point pmiddle; @@ -707,9 +707,9 @@ imax++; } -/* Finds data points to be used in calculating spline coefficients for each - * primary triangle. - */ +// Finds data points to be used in calculating spline coefficients for each +// primary triangle. +// static void csa_attachpoints( csa* a ) { int npmin = a->npmin; @@ -779,11 +779,11 @@ break; else { - /* - * Sometimes you have too much data, you thin it and -- - * oops -- you have too little. This is not a frequent - * event, so let us not bother to put a new subdivision. - */ + // + // Sometimes you have too much data, you thin it and -- + // oops -- you have too little. This is not a frequent + // event, so let us not bother to put a new subdivision. + // t->r *= 1.25; t->npoints = 0; } @@ -808,20 +808,20 @@ return 3; else if ( n >= 6 ) return 2; - else /* n == 3 */ + else // n == 3 return 1; } -/** Singular value decomposition. - * Borrowed from EISPACK (1972-1973). - * Presents input matrix A as A = U.W.V'. - * - * @param a Input matrix A = U.W[0..m-1][0..n-1]; output matrix U - * @param n Number of columns - * @param m Number of rows - * @param w Ouput vector that presents diagonal matrix W - * @param V output matrix V - */ +//* Singular value decomposition. +// Borrowed from EISPACK (1972-1973). +// Presents input matrix A as A = U.W.V'. +// +// @param a Input matrix A = U.W[0..m-1][0..n-1]; output matrix U +// @param n Number of columns +// @param m Number of rows +// @param w Ouput vector that presents diagonal matrix W +// @param V output matrix V +// static void svd( double** a, int n, int m, double* w, double** v ) { double * rv1; @@ -832,9 +832,9 @@ rv1 = malloc( n * sizeof ( double ) ); - /* - * householder reduction to bidiagonal form - */ + // + // householder reduction to bidiagonal form + // g = 0.0; scale = 0.0; tst1 = 0.0; @@ -916,9 +916,9 @@ } } - /* - * accumulation of right-hand transformations - */ + // + // accumulation of right-hand transformations + // for ( i = n - 1; i >= 0; i-- ) { if ( i < n - 1 ) @@ -926,9 +926,9 @@ if ( g != 0.0 ) { for ( j = l; j < n; j++ ) - /* - * double division avoids possible underflow - */ + // + // double division avoids possible underflow + // v[j][i] = ( a[i][j] / a[i][l] ) / g; for ( j = l; j < n; j++ ) { @@ -950,9 +950,9 @@ l = i; } - /* - * accumulation of left-hand transformations - */ + // + // accumulation of left-hand transformations + // for ( i = ( m < n ) ? m - 1 : n - 1; i >= 0; i-- ) { l = i + 1; @@ -967,9 +967,9 @@ s = 0.0; for ( k = l; k < m; k++ ) s += a[k][i] * a[k][j]; - /* - * double division avoids possible underflow - */ + // + // double division avoids possible underflow + // f = ( s / a[i][i] ) / g; for ( k = i; k < m; k++ ) a[k][j] += f * a[k][i]; @@ -983,9 +983,9 @@ a[i][i] += 1.0; } - /* - * diagonalization of the bidiagonal form - */ + // + // diagonalization of the bidiagonal form + // for ( k = n - 1; k >= 0; k-- ) { int k1 = k - 1; @@ -1001,7 +1001,7 @@ if ( its > SVD_NMAX ) csa_quit( "svd(): no convergence in %d iterations", SVD_NMAX ); - for ( l = k; l >= 0; l-- ) /* test for splitting */ + for ( l = k; l >= 0; l-- ) // test for splitting { double tst2 = fabs( rv1[l] ) + tst1; @@ -1011,17 +1011,17 @@ break; } l1 = l - 1; - /* - * rv1(1) is always zero, so there is no exit through the - * bottom of the loop - */ + // + // rv1(1) is always zero, so there is no exit through the + // bottom of the loop + // tst2 = fabs( w[l - 1] ) + tst1; if ( tst2 == tst1 ) break; } - /* - * cancellation of rv1[l] if l > 1 - */ + // + // cancellation of rv1[l] if l > 1 + // if ( docancellation ) { c = 0.0; @@ -1048,17 +1048,17 @@ } } } - /* - * test for convergence - */ + // + // test for convergence + // z = w[k]; if ( l != k ) { int i1; - /* - * shift from bottom 2 by 2 minor - */ + // + // shift from bottom 2 by 2 minor + // x = w[l]; y = w[k1]; g = rv1[k1]; @@ -1066,9 +1066,9 @@ f = 0.5 * ( ( ( g + z ) / h ) * ( ( g - z ) / y ) + y / h - h / y ); g = hypot( f, 1.0 ); f = x - ( z / x ) * z + ( h / x ) * ( y / ( f + copysign( g, f ) ) - h ); - /* - * next qr transformation - */ + // + // next qr transformation + // c = 1.0; s = 1.0; for ( i1 = l; i1 < k; i1++ ) @@ -1095,9 +1095,9 @@ } z = hypot( f, h ); w[i1] = z; - /* - * rotation can be arbitrary if z = 0 - */ + // + // rotation can be arbitrary if z = 0 + // if ( z != 0.0 ) { c = f / z; @@ -1119,9 +1119,9 @@ } else { - /* - * w[k] is made non-negative - */ + // + // w[k] is made non-negative + // if ( z < 0.0 ) { w[k] = -z; @@ -1136,8 +1136,8 @@ free( rv1 ); } -/* Least squares fitting via singular value decomposition. - */ +// Least squares fitting via singular value decomposition. +// static void lsq( double** A, int ni, int nj, double* z, double* w, double* sol ) { double** V = alloc2d( ni, ni, sizeof ( double ) ); @@ -1172,23 +1172,23 @@ free2d( V ); } -/* - * square->coeffs[]: - * - * --------------------- - * | 3 10 17 24 | - * | 6 13 20 | - * | 2 9 16 23 | - * | 5 12 19 | - * | 1 8 15 22 | - * | 4 11 18 | - * | 0 7 14 21 | - * --------------------- - */ +// +// square->coeffs[]: +// +// --------------------- +// | 3 10 17 24 | +// | 6 13 20 | +// | 2 9 16 23 | +// | 5 12 19 | +// | 1 8 15 22 | +// | 4 11 18 | +// | 0 7 14 21 | +// --------------------- +// -/* Calculates spline coefficients in each primary triangle by least squares - * fitting to data attached by csa_attachpoints(). - */ +// Calculates spline coefficients in each primary triangle by least squares +// fitting to data attached by csa_attachpoints(). +// static void csa_findprimarycoeffs( csa* a ) { int n[4] = { 0, 0, 0, 0 }; @@ -1240,10 +1240,10 @@ triangle_calculatebc( t, points[ii], bc ); - /* - * 0 1 2 3 4 5 6 7 8 9 - * 300 210 201 120 111 102 030 021 012 003 - */ + // + // 0 1 2 3 4 5 6 7 8 9 + // 300 210 201 120 111 102 030 021 012 003 + // tmp = bc[0] * bc[0]; aii[0] = tmp * bc[0]; tmp *= 3.0; @@ -1289,10 +1289,10 @@ triangle_calculatebc( t, points[ii], bc ); - /* - * 0 1 2 3 4 5 - * 200 110 101 020 011 002 - */ + // + // 0 1 2 3 4 5 + // 200 110 101 020 011 002 + // aii[0] = bc[0] * bc[0]; aii[1] = bc[0] * bc[1] * 2.0; @@ -1315,7 +1315,7 @@ } if ( wmin < wmax / a->k ) ok = 0; - else /* degree raising */ + else // degree raising { ok = 1; b[0] = b1[0]; @@ -1361,7 +1361,7 @@ } if ( wmin < wmax / a->k ) ok = 0; - else /* degree raising */ + else // degree raising { ok = 1; b[0] = b1[0]; @@ -1460,9 +1460,9 @@ } } -/* Finds spline coefficients in (adjacent to primary triangles) secondary - * triangles from C1 smoothness conditions. - */ +// Finds spline coefficients in (adjacent to primary triangles) secondary +// triangles from C1 smoothness conditions. +// static void csa_findsecondarycoeffs( csa* a ) { square*** squares = a->squares; @@ -1476,9 +1476,9 @@ fflush( stderr ); } - /* - * red - */ + // + // red + // for ( ii = 0; ii < a->npt; ++ii ) { triangle* t = a->pt[ii]; @@ -1554,9 +1554,9 @@ } } - /* - * blue - */ + // + // blue + // for ( ii = 0; ii < a->npt; ++ii ) { triangle* t = a->pt[ii]; @@ -1578,9 +1578,9 @@ cr[5] = c[22] + c[23] - c[19]; } - /* - * green & yellow - */ + // + // green & yellow + // for ( ii = 0; ii < a->npt; ++ii ) { triangle* t = a->pt[ii]; @@ -1735,7 +1735,7 @@ case 2: p->z = c[12] * bc1 * tmp1 + c[21] * bc2 * tmp2 + c[24] * bc3 * tmp3 + 3.0 * ( c[15] * tmp1 * bc2 + c[22] * tmp2 * bc3 + c[20] * tmp3 * bc1 + c[18] * bc1 * tmp2 + c[23] * bc2 * tmp3 + c[16] * tmp1 * bc3 ) + 6.0 * c[19] * bc1 * bc2 * bc3; break; - default: /* 3 */ + default: // 3 p->z = c[12] * bc1 * tmp1 + c[0] * bc2 * tmp2 + c[21] * bc3 * tmp3 + 3.0 * ( c[8] * tmp1 * bc2 + c[7] * tmp2 * bc3 + c[18] * tmp3 * bc1 + c[4] * bc1 * tmp2 + c[14] * bc2 * tmp3 + c[15] * tmp1 * bc3 ) + 6.0 * c[11] * bc1 * bc2 * bc3; } } @@ -1838,13 +1838,13 @@ #define NALLOCATED_START 1024 -/* Reads array of points from a columnar file. - * - * @param fname File name (can be "stdin" or "-" for standard input) - * @param dim Number of dimensions (must be 2 or 3) - * @param n Pointer to number of points (output) - * @param points Pointer to array of points [*n] (output) (to be freed) - */ +// Reads array of points from a columnar file. +// +// @param fname File name (can be "stdin" or "-" for standard input) +// @param dim Number of dimensions (must be 2 or 3) +// @param n Pointer to number of points (output) +// @param points Pointer to array of points [*n] (output) (to be freed) +// void points_read( char* fname, int dim, int* n, point** points ) { FILE * f = NULL; @@ -2238,4 +2238,4 @@ return 0; } -#endif /* STANDALONE */ +#endif // STANDALONE Modified: trunk/lib/csa/csa.h =================================================================== --- trunk/lib/csa/csa.h 2010-10-23 17:25:22 UTC (rev 11270) +++ trunk/lib/csa/csa.h 2010-10-23 17:28:04 UTC (rev 11271) @@ -1,23 +1,23 @@ -/****************************************************************************** - * - * File: csa.h - * - * Created: 16/10/2002 - * - * Author: Pavel Sakov - * CSIRO Marine Research - * - * Purpose: A header for csa library (2D data approximation with - * bivariate C1 cubic spline) - * - * Revisions: None - * - *****************************************************************************/ +//***************************************************************************** +// +// File: csa.h +// +// Created: 16/10/2002 +// +// Author: Pavel Sakov +// CSIRO Marine Research +// +// Purpose: A header for csa library (2D data approximation with +// bivariate C1 cubic spline) +// +// Revisions: None +// +//*************************************************************************** #if !defined ( _CSA_H ) #define _CSA_H -/* include header file for dll definitions */ +// include header file for dll definitions #include "csadll.h" #if _MSC_VER > 1309 Modified: trunk/lib/csa/csadll.h =================================================================== --- trunk/lib/csa/csadll.h 2010-10-23 17:25:22 UTC (rev 11270) +++ trunk/lib/csa/csadll.h 2010-10-23 17:28:04 UTC (rev 11271) @@ -3,7 +3,7 @@ #ifdef USINGDLL #if defined ( WIN32 ) -/* Visual C/C++, Borland, MinGW and Watcom */ +// Visual C/C++, Borland, MinGW and Watcom #if defined ( __VISUALC__ ) || defined ( _MSC_VER ) || defined ( __BORLANDC__ ) || defined ( __GNUC__ ) || defined ( __WATCOMC__ ) #define CSADLLEXPORT __declspec( dllexport ) #define CSADLLIMPORT __declspec( dllimport ) @@ -15,24 +15,24 @@ #define CSADLLEXPORT __declspec( dllexport ) #define CSADLLIMPORT __declspec( dllimport ) #elif defined ( __GNUC__ ) && __GNUC__ > 3 -/* Follow ideas in http://gcc.gnu.org/wiki/Visibility for GCC version 4.x - * The following forces exported symbols specifically designated with - * CSADLLEXPORT to be visible. */ +// Follow ideas in http://gcc.gnu.org/wiki/Visibility for GCC version 4.x +// The following forces exported symbols specifically designated with +// CSADLLEXPORT to be visible. #define CSADLLEXPORT __attribute__ ( ( visibility( "default" ) ) ) #define CSADLLIMPORT #endif #endif -/* For an unknown compiler or static built we clear the macros */ +// For an unknown compiler or static built we clear the macros #ifndef CSADLLEXPORT # define CSADLLEXPORT # define CSADLLIMPORT #endif -/* The IMPEXP macros will always be set to DLLIMPORT (even for - * the static library, but DLLIMPORT is empty in this case). If - * cmake sets the corresponding macro xxxx_EXPORTS if the - * corresponding library is built DLLIMPEXP is set to DLLEXPORT */ +// The IMPEXP macros will always be set to DLLIMPORT (even for +// the static library, but DLLIMPORT is empty in this case). If +// cmake sets the corresponding macro xxxx_EXPORTS if the +// corresponding library is built DLLIMPEXP is set to DLLEXPORT #if defined ( csirocsa_EXPORTS ) #define CSADLLIMPEXP CSADLLEXPORT #define CSADLLIMPEXP_DATA( type ) CSADLLEXPORT type @@ -41,4 +41,4 @@ #define CSADLLIMPEXP_DATA( type ) CSADLLIMPORT type #endif -#endif /* __CSA_DLL_H */ +#endif // __CSA_DLL_H Modified: trunk/lib/csa/nan.h =================================================================== --- trunk/lib/csa/nan.h 2010-10-23 17:25:22 UTC (rev 11270) +++ trunk/lib/csa/nan.h 2010-10-23 17:28:04 UTC (rev 11271) @@ -1,20 +1,20 @@ -/****************************************************************************** - * - * File: nan.h - * - * Created: 18/10/2001 - * - * Author: Pavel Sakov - * CSIRO Marine Research - * - * Purpose: NaN definition - * - * Description: Should cover machines with 64 bit doubles or other machines - * with GCC - * - * Revisions: None - * - *****************************************************************************/ +//***************************************************************************** +// +// File: nan.h +// +// Created: 18/10/2001 +// +// Author: Pavel Sakov +// CSIRO Marine Research +// +// Purpose: NaN definition +// +// Description: Should cover machines with 64 bit doubles or other machines +// with GCC +// +// Revisions: None +// +//*************************************************************************** #if !defined ( _NAN_H ) #define _NAN_H @@ -38,9 +38,9 @@ #else -/* MSVC/C++ 6.0 reports a version 1200, - * MSVC/C++ 2003 reports a version 1300 - */ +// MSVC/C++ 6.0 reports a version 1200, +// MSVC/C++ 2003 reports a version 1300 +// #include <float.h> #include <ymath.h> #undef NaN Modified: trunk/lib/csa/version.h =================================================================== --- trunk/lib/csa/version.h 2010-10-23 17:25:22 UTC (rev 11270) +++ trunk/lib/csa/version.h 2010-10-23 17:28:04 UTC (rev 11271) @@ -1,15 +1,15 @@ -/****************************************************************************** - * - * File: version.h - * - * Created: 16/10/2002 - * - * Author: Pavel Sakov - * CSIRO Marine Research - * - * Purpose: Version string for csa library - * - *****************************************************************************/ +//***************************************************************************** +// +// File: version.h +// +// Created: 16/10/2002 +// +// Author: Pavel Sakov +// CSIRO Marine Research +// +// Purpose: Version string for csa library +// +//*************************************************************************** #if !defined ( _VERSION_H ) #define _VERSION_H Modified: trunk/lib/nistcd/cd.c =================================================================== --- trunk/lib/nistcd/cd.c 2010-10-23 17:25:22 UTC (rev 11270) +++ trunk/lib/nistcd/cd.c 2010-10-23 17:28:04 UTC (rev 11271) @@ -1,19 +1,19 @@ -/* cd.c main file for cgmdraw module. - * - * Written by G. Edward Johnson <mailto:lo...@ni...> - * Date: April 1996 - * Copyright: cd software produced by NIST, an agency of the - * U.S. government, is by statute not subject to copyright - * in the United States. Recipients of this software assume all - * responsibilities associated with its operation, modification - * and maintenance. - * - * Portions of this package are from the gd package written by - * Thomas Boutell and are copyright 1994, 1995, Quest Protein - * Database Center, Cold Spring Harbor Labs. They are marked in the - * source code. - */ +// cd.c main file for cgmdraw module. +// +// Written by G. Edward Johnson <mailto:lo...@ni...> +// Date: April 1996 +// Copyright: cd software produced by NIST, an agency of the +// U.S. government, is by statute not subject to copyright +// in the United States. Recipients of this software assume all +// responsibilities associated with its operation, modification +// and maintenance. +// +// Portions of this package are from the gd package written by +// Thomas Boutell and are copyright 1994, 1995, Quest Protein +// Database Center, Cold Spring Harbor Labs. They are marked in the +// source code. +// #ifndef NOMALLOCH #include <malloc.h> @@ -29,14 +29,14 @@ static int cdImageAddColor( cdImagePtr im, int si, int ei ); cdImagePtr cdImageCreate( int sx, int sy ) -/* Creates a new image of size (sx,sy). Most people should always - * start by calling this function */ +// Creates a new image of size (sx,sy). Most people should always +// start by calling this function { cdImagePtr im; im = cdImageStartCgm(); if ( !im ) - return 0; /* memory allocation failed */ + return 0; // memory allocation failed if ( !cdImageSetSize( im, sx, sy ) ) { free( im ); return 0; @@ -60,8 +60,8 @@ static int cdAppNull( unsigned char *es, int x ) { -/* put x nulls in the string. - * return value is number of octets added (1) */ +// put x nulls in the string. +// return value is number of octets added (1) int y; for ( y = 0; y < x; y++ ) @@ -74,20 +74,20 @@ static int cdAppByte( unsigned char *es, short int addme ) { -/* Append an octet to the end of es - * Return value is number of octets added - * for internal cd functions only, do not call - */ +// Append an octet to the end of es +// Return value is number of octets added +// for internal cd functions only, do not call +// *es = (unsigned char) addme & 0377; return 1; } static int cdAppShort( unsigned char *es, short int addme ) { -/* Append a short to the end of es - * return value is number of octets added - * For internal cd functions only, do not call! - */ +// Append a short to the end of es +// return value is number of octets added +// For internal cd functions only, do not call! +// short int temp; temp = addme >> 8; @@ -97,43 +97,43 @@ return 2; } -/* static int cdAppWord(unsigned char *es, int addme){ */ -/* Append an word to es - * Return value is number of octets added - * For internal cd functions only, do not call! - */ -/* - * int temp; - * temp = addme >> 24; - *es = (unsigned char) temp & 0377; - * es++; - * temp = addme >> 16; - *es = (unsigned char) temp & 0377; - * es++; - * temp = addme >> 8; - *es = (unsigned char) temp & 0377; - * es++; - *es = (unsigned char) addme & 0377; - * es++; - * return 4; - * } - */ +// static int cdAppWord(unsigned char *es, int addme){ +// Append an word to es +// Return value is number of octets added +// For internal cd functions only, do not call! +// +// +// int temp; +// temp = addme >> 24; +//es = (unsigned char) temp & 0377; +// es++; +// temp = addme >> 16; +//es = (unsigned char) temp & 0377; +// es++; +// temp = addme >> 8; +//es = (unsigned char) temp & 0377; +// es++; +//es = (unsigned char) addme & 0377; +// es++; +// return 4; +// } +// static int cdcomhead( unsigned char *es, int elemclass, int id, int len ) { -/* sets the command header in the first two bytes of string es - * element class is in bits 15-12 - * element id is in bits 11-5 - * parameter list length is in bits 4-0 - */ +// sets the command header in the first two bytes of string es +// element class is in bits 15-12 +// element id is in bits 11-5 +// parameter list length is in bits 4-0 +// int temp; if ( !es ) - return 0; /* the string must be allocated first */ + return 0; // the string must be allocated first - /* set the element class */ + // set the element class *es = (unsigned char) elemclass << 4; - /* set the element id */ + // set the element id temp = 0177 & id; temp = temp >> 3; *es = *es | temp; @@ -147,60 +147,60 @@ static int cdcomheadlong( unsigned char *es, int elemclass, int id, int len ) { -/* sets the command header for the long form. - * first 16 bits: - * element class is in bits 15-12 - * element id is in bits 11-5 - * parameter list length is in bits 4-0 = 31 - * second 16 bits: - * bit 15 = 0 (for last partition) - * bit 14-0 param list len - */ +// sets the command header for the long form. +// first 16 bits: +// element class is in bits 15-12 +// element id is in bits 11-5 +// parameter list length is in bits 4-0 = 31 +// second 16 bits: +// bit 15 = 0 (for last partition) +// bit 14-0 param list len +// - /* I'm lazy, call cdcomhead to set the first two bytes */ + // I'm lazy, call cdcomhead to set the first two bytes if ( !cdcomhead( es, elemclass, id, 31 ) ) return 0; es += 2; - /* now set the second two bytes */ + // now set the second two bytes cdAppShort( es, (short int) len ); - *es = *es & 0177; /* make bit 15 = 0 */ + *es = *es & 0177; // make bit 15 = 0 es += 2; return 1; } static int cdAddElem( cdImagePtr im, unsigned char *es, int octet_count ) -/* adds a string, which is a CGM element to the elemlist. - * This function is called by other functions in this library and - * should NOT be called by users of the library - * For internal cd functions only, do not call! - */ +// adds a string, which is a CGM element to the elemlist. +// This function is called by other functions in this library and +// should NOT be called by users of the library +// For internal cd functions only, do not call! +// { - unsigned char *newlist; /* in case memory allocation fails */ - int x; /* counter */ + unsigned char *newlist; // in case memory allocation fails + int x; // counter while ( ( octet_count + 1 ) >= im->bytestoend ) { - /* not enough space, must grow elemlist */ + // not enough space, must grow elemlist im->listlen = im->listlen + CDGROWLISTSIZE; newlist = (unsigned char *) realloc( im->elemlist, SIZEOF( unsigned char ) * im->listlen ); if ( newlist ) { - /* successfully allocated memory */ + // successfully allocated memory im->elemlist = newlist; im->bytestoend = im->bytestoend + CDGROWLISTSIZE; im->curelemlist = im->elemlist + ( im->listlen - im->bytestoend ); } else { - /* memory allocation failed, save yurself */ + // memory allocation failed, save yurself im->listlen = im->listlen - CDGROWLISTSIZE; return 0; } } - /* ok, if we get to here, there is enough space, so add it. */ + // ok, if we get to here, there is enough space, so add it. for ( x = 0; x < octet_count; x++ ) { *im->curelemlist = (unsigned char) *es; @@ -213,30 +213,30 @@ int cdCgmHeader( cdImagePtr im ) { -/* add the cgm header to the imagepointer's element list - * do it all in a string than call cdAddElem on it - * For internal cd functions only, do not call! - */ +// add the cgm header to the imagepointer's element list +// do it all in a string than call cdAddElem on it +// For internal cd functions only, do not call! +// unsigned char *headerp; unsigned char *head; const unsigned char *buf, *buf2; int octet_count = 0; - int blen; /* length of buf */ + int blen; // length of buf int curly; - int fontlistlen; /* each font in the font list is stored as a string, - * with a single octet in front of the string - * giving its length, fontlistlen is the sum of - * the lengths of all the font strings + the - * length octets. */ + int fontlistlen; // each font in the font list is stored as a string, + // with a single octet in front of the string + // giving its length, fontlistlen is the sum of + // the lengths of all the font strings + the + // length octets. if ( im->state != 0 ) return 0; headerp = (unsigned char *) calloc( 1024, SIZEOF( unsigned char ) ); if ( !headerp ) - return 0; /* memory allocation failed */ + return 0; // memory allocation failed head = headerp; - /*** Attribute: BegMF; Elem Class 0; Elem ID 1 */ + //** Attribute: BegMF; Elem Class 0; Elem ID 1 buf = (const unsigned char *) "cd: CgmDraw Library"; blen = strlen( (const char *) buf ); cdcomhead( head, 0, 1, blen + 1 ); @@ -255,13 +255,13 @@ head += cdAppNull( head, curly ); } - /*** Attribute: MFVersion; Elem Class 1; Elem ID 1 */ + //** Attribute: MFVersion; Elem Class 1; Elem ID 1 cdcomhead( head, 1, 1, 2 ); head += 2; head += cdAppShort( head, (short int) 1 ); octet_count += 4; - /*** Attribute: MFDesc; Elem Class 1; Elem ID 2 */ + //** Attribute: MFDesc; Elem Class 1; Elem ID 2 blen = strlen( (char *) im->desc ); cdcomheadlong( head, 1, 2, blen + 1 ); head += 4; @@ -279,27 +279,27 @@ head += cdAppNull( head, curly ); } - /*** Attribute: ColrPrec; Elem Class 1; Elem ID 7 */ + //** Attribute: ColrPrec; Elem Class 1; Elem ID 7 cdcomhead( head, 1, 7, 2 ); head += 2; head += cdAppShort( head, (short int) 8 ); octet_count += 4; - /*** Attribute: ColrIndexPrec; Elem Class 1; Elem ID 8 */ + //** Attribute: ColrIndexPrec; Elem Class 1; Elem ID 8 cdcomhead( head, 1, 8, 2 ); head += 2; head += cdAppShort( head, (short int) 8 ); octet_count += 4; - /*** Attribute: MaxColrIndex; Elem Class 1; Elem ID 9 */ + //** Attribute: MaxColrIndex; Elem Class 1; Elem ID 9 cdcomhead( head, 1, 9, 1 ); head += 2; head += cdAppByte( head, (short int) 255 ); octet_count += 4; head++; - /*** Attribute: MFElemList; Elem Class 1; Elem ID 11 */ - /* shorthand here. 1 means 1 element specified, (-1,1) - * means drawing-plus-control set */ + //** Attribute: MFElemList; Elem Class 1; Elem ID 11 + // shorthand here. 1 means 1 element specified, (-1,1) + // means drawing-plus-control set cdcomhead( head, 1, 11, 6 ); head += 2; head += cdAppShort( head, (short int) 1 ); @@ -307,14 +307,14 @@ head += cdAppShort( head, (short int) 1 ); octet_count += 8; - /*** Attribute: FontList; Elem Class 1; Elem ID 13 */ - /* im->fontlist contains a comma separated list of font names - * since we don't need the commas, and every font except one has - * a comma, and we do need a length octet, that means that - * taking the string length will give us one less than the - * correct length. */ + //** Attribute: FontList; Elem Class 1; Elem ID 13 + // im->fontlist contains a comma separated list of font names + // since we don't need the commas, and every font except one has + // a comma, and we do need a length octet, that means that + // taking the string length will give us one less than the + // correct length. buf = im->fontlist; - if ( buf ) /* don't do this if there aren't any fonts */ + if ( buf ) // don't do this if there aren't any fonts { fontlistlen = strlen( (const char *) buf ) + 1; cdcomheadlong( head, 1, 13, fontlistlen ); @@ -346,7 +346,7 @@ octet_count += curly; head += cdAppNull( head, curly ); } - } /* end of check to see if any fonts */ + } // end of check to see if any fonts if ( cdAddElem( im, headerp, octet_count ) ) { @@ -364,40 +364,40 @@ int cdCgmPic( cdImagePtr im, int sticky ) { -/* Start the picture. if the sticky bit is set, set and use the defaults - * of the previous picture. Otherwise, reset all defaults. - * Gej: sticky = 0 reset defaults, 1 dont reset anything, 2 only - * reset the color table - */ +// Start the picture. if the sticky bit is set, set and use the defaults +// of the previous picture. Otherwise, reset all defaults. +// Gej: sticky = 0 reset defaults, 1 dont reset anything, 2 only +// reset the color table +// unsigned char *headerp; unsigned char *head; unsigned char *buf, *buf2; char *tb; int octet_count = 0; - int blen; /* length of buf */ - int x1, x2, x3, x4; /* needed for setting defaults */ + int blen; // length of buf + int x1, x2, x3, x4; // needed for setting defaults if ( ( im->state != 0 ) && ( im->state != 2 ) ) return 0; if ( ( sticky > 2 ) || ( sticky < 0 ) ) - return 0; /* invalid sticky bit */ - /* increment the picture number */ + return 0; // invalid sticky bit + // increment the picture number im->picnum++; tb = (char *) calloc( 4 * 4, SIZEOF( char ) ); if ( !tb ) - return 0; /* memory allocation failed */ + return 0; // memory allocation failed headerp = (unsigned char *) calloc( 1024, SIZEOF( unsigned char ) ); if ( !headerp ) - { /* memory allocation failed */ + { // memory allocation failed free( tb ); return 0; } head = headerp; - /*** Attribute: BegPic; Elem Class 0; Elem ID 3 */ + //** Attribute: BegPic; Elem Class 0; Elem ID 3 sprintf( tb, "picture %d", im->picnum ); buf = (unsigned char*) tb; - /* buf = (unsigned char *) "picture 1"; */ + // buf = (unsigned char *) "picture 1"; blen = strlen( (char *) buf ); cdcomhead( head, 0, 3, blen + 1 ); head += 2; @@ -420,13 +420,13 @@ head += cdAppNull( head, 2 ); } - /*** Attribute: ColrMode; Elem Class 2; Elem ID 2 */ + //** Attribute: ColrMode; Elem Class 2; Elem ID 2 cdcomhead( head, 2, 2, 2 ); head += 2; head += cdAppShort( head, (short int) 0 ); octet_count += 4; - /* Picture Descriptor: Line Width Specification Mode; - * Elem Class 2; Elem ID 3*/ + // Picture Descriptor: Line Width Specification Mode; + // Elem Class 2; Elem ID 3 if ( sticky && ( im->linespec != CDLINESPEC ) ) { cdcomhead( head, 2, 3, 2 ); @@ -434,8 +434,8 @@ head += cdAppShort( head, (short int) im->linespec ); octet_count += 4; } - /* Picture Descriptor: Marker Size Specification Mode; - * Elem Class 2; Elem ID 4*/ + // Picture Descriptor: Marker Size Specification Mode; + // Elem Class 2; Elem ID 4 if ( sticky && ( im->markerspec != CDMARKERSPEC ) ) { cdcomhead( head, 2, 4, 2 ); @@ -443,8 +443,8 @@ head += cdAppShort( head, (short int) im->markerspec ); octet_count += 4; } - /* Picture Descriptor: Edge Width Specification Mode; - * Elem Class 2; Elem ID 5*/ + // Picture Descriptor: Edge Width Specification Mode; + // Elem Class 2; Elem ID 5 if ( sticky && ( im->edgespec != CDEDGESPEC ) ) { cdcomhead( head, 2, 5, 2 ); @@ -453,7 +453,7 @@ octet_count += 4; } - /*** Attribute: VDCExt; Elem Class 2; Elem ID 6 */ + //** Attribute: VDCExt; Elem Class 2; Elem ID 6 cdcomhead( head, 2, 6, 8 ); head += 2; head += cdAppShort( head, (short int) 0 ); @@ -462,7 +462,7 @@ head += cdAppShort( head, (short int) im->sy ); octet_count += 10; - /*** Attribute: Begin Picture Body; Elem Class 0; Elem ID 4 */ + //** Attribute: Begin Picture Body; Elem Class 0; Elem ID 4 cdcomhead( head, 0, 4, 0 ); head += 2; octet_count += 2; @@ -479,19 +479,19 @@ if ( sticky ) { - /* keep defaults the way they are */ + // keep defaults the way they are if ( sticky == 1 ) { - /* keep the color table */ + // keep the color table if ( cdImageAddColor( im, 0, im->colorsTotal - 1 ) == -1 ) { - /* no colortable */ + // no colortable return 1; } } else { - /* Nuke the color table if there is one */ + // Nuke the color table if there is one cdImageColorClear( im ); } im->state = 1; @@ -530,42 +530,42 @@ } else { - /* reset all the defaults */ + // reset all the defaults cdImageSetDefaults( im ); - /* Nuke the color table if there is one */ + // Nuke the color table if there is one cdImageColorClear( im ); - im->state = 1; /* now we are officially in the picture */ + im->state = 1; // now we are officially in the picture } return 1; } int cdCgmNewPic( cdImagePtr im, int sticky ) -/* The CGM standard allows multiple images in a single file. This function - * will close the current picture, then open a new one. - * if sticky is 0 then all attributes will be reset to the defaults - * if sticky is 1 then all attributes will be inherited from the prevous - * picture. - * if sticky is 2 all attributes except the color table will be inherited - * from the previous picture - */ +// The CGM standard allows multiple images in a single file. This function +// will close the current picture, then open a new one. +// if sticky is 0 then all attributes will be reset to the defaults +// if sticky is 1 then all attributes will be inherited from the prevous +// picture. +// if sticky is 2 all attributes except the color table will be inherited +// from the previous picture +// { - /* close the current picture */ + // close the current picture if ( !cdImageEndPic( im ) ) return 0; - /* now start the new picture */ + // now start the new picture return ( cdCgmPic( im, sticky ) ); } int cdImageCgm( cdImagePtr im, FILE *out ) -/* Gej: Write the image to file *out, which must be open already - * does not close the file */ +// Gej: Write the image to file *out, which must be open already +// does not close the file { -/* - * if (out) { - * im->outfile = out; - * } - */ +// +// if (out) { +// im->outfile = out; +// } +// cdImageSetOutput( im, out ); return cdImageEndCgm( im ); } @@ -573,33 +573,33 @@ int cdSetLineType( cdImagePtr im, int lntype ) { -/* Attribute: Line Type; Elem Class 5; Elem ID 2 - * Set the line type. Possible values are: - * 1=solid, 2=dash, 3=dot, 4=dash-dot, 5=dash-dot-dot - * Even though new ones can be defined, I am limiting lntype to these values - * If you really need more, you can make the proper changes. - */ +// Attribute: Line Type; Elem Class 5; Elem ID 2 +// Set the line type. Possible values are: +// 1=solid, 2=dash, 3=dot, 4=dash-dot, 5=dash-dot-dot +// Even though new ones can be defined, I am limiting lntype to these values +// If you really need more, you can make the proper changes. +// unsigned char *es, *esp; int octet_count; - /* First check and see if the user doesn't want any changes, - * if so, just return success */ + // First check and see if the user doesn't want any changes, + // if so, just return success if ( lntype == -1 ) return 1; - /* Check and see if the value it is being set to is the current - * value, if so, don't make any changes, just return 1 */ + // Check and see if the value it is being set to is the current + // value, if so, don't make any changes, just return 1 if ( lntype == im->ltype ) return 1; - /* Make sure that lntype is between 1 and 5 */ + // Make sure that lntype is between 1 and 5 if ( ( lntype < 1 ) || ( lntype > 5 ) ) return 0; - /* allocate sufficent space. should be 32 bits * 4 to be safe */ + // allocate sufficent space. should be 32 bits * 4 to be safe es = (unsigned char *) calloc( 4 * 4, SIZEOF( unsigned char ) ); if ( !es ) - return 0; /* memory allocation failed */ + return 0; // memory allocation failed esp = es; if ( !cdcomhead( es, 5, 2, 2 ) ) @@ -607,14 +607,14 @@ free( esp ); return 0; } es += 2; - /* set Param_List_Len to 2 (signed int at index precision) */ + // set Param_List_Len to 2 (signed int at index precision) - /* add in the value of lntype */ + // add in the value of lntype es += cdAppShort( es, (short int) lntype ); - octet_count = 4; /* we just know this */ + octet_count = 4; // we just know this - /* add it to the buffer */ + // add it to the buffer if ( cdAddElem( im, esp, octet_count ) ) { im->ltype = (short int) lntype; @@ -630,35 +630,35 @@ int cdSetLineWidth( cdImagePtr im, int lnwidth ) { -/* Attribute: Line Width; Elem Class 5; Elem ID 3 - * sets the line width. with an image of height X with line width 1 - * the displayed width will be 1/X%. as an example, if you image is - * x=5, y=10, and you set line width = 1, and draw a vertical line, the - * resulting line will cover 20% of horizontal area. - */ +// Attribute: Line Width; Elem Class 5; Elem ID 3 +// sets the line width. with an image of height X with line width 1 +// the displayed width will be 1/X%. as an example, if you image is +// x=5, y=10, and you set line width = 1, and draw a vertical line, the +// resulting line will cover 20% of horizontal area. +// unsigned char *es, *esp; int octet_count; - /* First check and see if the user doesn't want any changes, - * if so, just return success */ + // First check and see if the user doesn't want any changes, + // if so, just return success if ( lnwidth == -1 ) return 1; - /* Check and see if the value it is being set to is the current - * value, if so, don't make any changes, just return 1 */ + // Check and see if the value it is being set to is the current + // value, if so, don't make any changes, just return 1 if ( lnwidth == im->lwidth ) return 1; - /* allocate sufficent space. should be 32 bits * 4 to be safe */ + // allocate sufficent space. should be 32 bits * 4 to be safe es = (unsigned char *) calloc( 4 * 4, SIZEOF( unsigned char ) ); if ( !es ) - return 0; /* memory allocation failed */ + return 0; // memory allocation failed esp = es; - /*gej: line width is 32 bit floating point number, 16 bits before the - * decimal, 16 bits after if Line Spec is default (1, scaled) - * if Line Spec is 0 (0, absolute) then it is 16 bit SI */ + //gej: line width is 32 bit floating point number, 16 bits before the + // decimal, 16 bits after if Line Spec is default (1, scaled) + // if Line Spec is 0 (0, absolute) then it is 16 bit SI if ( im->linespec ) { if ( !cdcomhead( es, 5, 3, 4 ) ) @@ -669,7 +669,7 @@ octet_count = 2; es += cdAppShort( es, (short int) lnwidth ); octet_count += 2; - /* the next two (after decimal point) will always be zero */ + // the next two (after decimal point) will always be zero es += cdAppNull( es, 2 ); octet_count += 2; } @@ -686,7 +686,7 @@ } - /* add it to the buffer */ + // add it to the buffer if ( cdAddElem( im, esp, octet_count ... [truncated message content] |
From: <ai...@us...> - 2010-10-27 02:00:05
|
Revision: 11278 http://plplot.svn.sourceforge.net/plplot/?rev=11278&view=rev Author: airwin Date: 2010-10-27 01:59:59 +0000 (Wed, 27 Oct 2010) Log Message: ----------- Convert these old files to utf8 encoding so that Jo?\195?\163o Cardoso's first name is rendered correctly for the usual utf8 locales. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-10-27 01:42:53 UTC (rev 11277) +++ trunk/ChangeLog 2010-10-27 01:59:59 UTC (rev 11278) @@ -186,7 +186,7 @@ plplot wrapper library, libplplotjava, java/plplot/core classes, and installing java source for examples in java/plplot/examples. -2002-12-13 "[iso-8859-1] Jo\xE3o Cardoso" <jc...@us...> +2002-12-13 "[iso-8859-1] João Cardoso" <jc...@us...> * Fixed p7 and p15 problem. This finishes the last of the problems with the octave examples. (x example segfaults solved earlier Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2010-10-27 01:42:53 UTC (rev 11277) +++ trunk/NEWS 2010-10-27 01:59:59 UTC (rev 11278) @@ -157,7 +157,7 @@ details). (3) New pstex driver. This is not currently documented, but there is post -from Jo\xE3o Cardoso on plplot_devel +from João Cardoso on plplot_devel (http://www.geocrawler.com/archives/3/10834/2001/4/50/5536095/) that gives the recipe (ignore the configuration stuff and start with the ./x01c command). The idea is to emulate the pstex output of the xfig application This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-10-27 02:45:40
|
Revision: 11280 http://plplot.svn.sourceforge.net/plplot/?rev=11280&view=rev Author: airwin Date: 2010-10-27 02:45:33 +0000 (Wed, 27 Oct 2010) Log Message: ----------- Implement check for parity bits in our non-binary source files. utils/parity_bit_check.c is the C code for an app that checks for parity bits for the stream of bytes coming from stdin. scripts/parity_bit_check.sh is a bash script to check all our source code files for parity bits being set except for the files listed in scripts/parity_bit_check.exclude. The latter list of files includes, e.g., image files and utf8 files which go beyond the ascii subset of utf8. Modified Paths: -------------- trunk/utils/CMakeLists.txt Added Paths: ----------- trunk/scripts/parity_bit_check.exclude trunk/scripts/parity_bit_check.sh trunk/utils/parity_bit_check.c Added: trunk/scripts/parity_bit_check.exclude =================================================================== --- trunk/scripts/parity_bit_check.exclude (rev 0) +++ trunk/scripts/parity_bit_check.exclude 2010-10-27 02:45:33 UTC (rev 11280) @@ -0,0 +1,25 @@ +\.svn +~$ +\.jpg$ +\.gif$ +\.cgm$ +\.map$ +\.fnt$ +x2[46] +xw2[46] +xthick2[46] +lena +README.release +test_hebrew_diacritic.py +test_plplot_encodings.py +NEWS +ChangeLog +simplepie.inc +qsastime.html +qsastime.txt +qsastime.xml +README.deltaT.dat +api2man.pl.in +api2text.pl +docbook/AUTHORS +__pl_pltext.m Property changes on: trunk/scripts/parity_bit_check.exclude ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/scripts/parity_bit_check.sh =================================================================== --- trunk/scripts/parity_bit_check.sh (rev 0) +++ trunk/scripts/parity_bit_check.sh 2010-10-27 02:45:33 UTC (rev 11280) @@ -0,0 +1,65 @@ +#!/bin/bash + +# $Id$ + +# This script will run parity_bit_check on all files in the PLplot +# source tree (except those listed below) to discover which of those +# files have any character with the eighth (parity) bit set. + +# Copyright (C) 2010 Alan W. Irwin +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Library Public License as published +# by the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +which parity_bit_check >/dev/null +parity_bit_check_rc=$? +if [ "$parity_bit_check_rc" != 0 ] ; then + echo " +This script only works when parity_bit_check is on the PATH. +To make this so please run + +make parity_bit_check + +in the build tree and put the utils subdirectory of that build tree +where parity_bit_check will be built by the above command on your +PATH." + exit 1 +fi + +# Find absolute PATH of script without using readlink (since readlink is +# not available on all platforms). Followed advice at +# http://fritzthomas.com/open-source/linux/551-how-to-get-absolute-path-within-shell-script-part2/ +ORIGINAL_PATH="$(pwd)" +cd "$(dirname $0)" +# Absolute Path of the script +SCRIPT_PATH="$(pwd)" + +# Assumption: top-level source tree is parent directory of where script +# is located. +SOURCE_TREE="$(dirname ${SCRIPT_PATH})" +cd "${SOURCE_TREE}" + +#List of all files in source tree other than .svn ones.... +find -type f >| /tmp/temporary_source_tree_list + +for FILE in $(grep -v -f "$SOURCE_TREE"/scripts/parity_bit_check.exclude /tmp/temporary_source_tree_list); do + parity_bit_check <$FILE + parity_bit_check_rc=$? + if [ "$parity_bit_check_rc" -ne 0 ]; then + printf "%s %x\n" $FILE $parity_bit_check_rc + fi +done +rm -f /tmp/temporary_source_tree_list \ No newline at end of file Property changes on: trunk/scripts/parity_bit_check.sh ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/utils/CMakeLists.txt =================================================================== --- trunk/utils/CMakeLists.txt 2010-10-27 02:02:12 UTC (rev 11279) +++ trunk/utils/CMakeLists.txt 2010-10-27 02:45:33 UTC (rev 11280) @@ -94,3 +94,7 @@ DESTINATION ${BIN_DIR} ) endif(ENABLE_tcl) + +# Build simple executable to check parity bits of all characters read +# by stdin. +add_executable(parity_bit_check parity_bit_check.c) \ No newline at end of file Added: trunk/utils/parity_bit_check.c =================================================================== --- trunk/utils/parity_bit_check.c (rev 0) +++ trunk/utils/parity_bit_check.c 2010-10-27 02:45:33 UTC (rev 11280) @@ -0,0 +1,18 @@ + +#include <stdio.h> +#include <ctype.h> + +// Checks whether the eighth (parity) bit is set on any character of stdin. +// Returns the first such character found or zero if no such character +// found. +int +main( int argc, char *argv[] ) +{ + int c; + while ((c=getchar())!= EOF) + { + if(c & 0x80) + return c; + } + return 0; +} Property changes on: trunk/utils/parity_bit_check.c ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-10-28 16:26:22
|
Revision: 11282 http://plplot.svn.sourceforge.net/plplot/?rev=11282&view=rev Author: airwin Date: 2010-10-28 16:26:09 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Comment-style upgrade for C drivers. Modified Paths: -------------- trunk/drivers/aqt.c trunk/drivers/cairo.c trunk/drivers/cgm.c trunk/drivers/dg300.c trunk/drivers/gcw.c trunk/drivers/gd.c trunk/drivers/hpgl.c trunk/drivers/impress.c trunk/drivers/linuxvga.c trunk/drivers/ljii.c trunk/drivers/ljiip.c trunk/drivers/mem.c trunk/drivers/ntk.c trunk/drivers/null.c trunk/drivers/pbm.c trunk/drivers/pdf.c trunk/drivers/plmeta.c trunk/drivers/plplotcanvas-hacktext.c trunk/drivers/ps.c trunk/drivers/pstex.c trunk/drivers/svg.c trunk/drivers/tek.c trunk/drivers/test-drv-info.c trunk/drivers/tk.c trunk/drivers/tkwin.c trunk/drivers/wingcc.c trunk/drivers/xfig.c trunk/drivers/xwin.c trunk/scripts/style_source.sh Modified: trunk/drivers/aqt.c =================================================================== --- trunk/drivers/aqt.c 2010-10-27 06:52:54 UTC (rev 11281) +++ trunk/drivers/aqt.c 2010-10-28 16:26:09 UTC (rev 11282) @@ -1,43 +1,43 @@ -/* March 12, 2005 - * - * PLplot driver for AquaTerm and Mac OS X. - * - * Copyright (C) Per Persson - * Copyright (C) 2005 Hazen Babcock - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// March 12, 2005 +// +// PLplot driver for AquaTerm and Mac OS X. +// +// Copyright (C) Per Persson +// Copyright (C) 2005 Hazen Babcock +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// -/*--------------------------------------------- - * Header files, defines and local variables - * ---------------------------------------------*/ +//--------------------------------------------- +// Header files, defines and local variables +// --------------------------------------------- -/* OS X specific header files */ +// OS X specific header files #import <Foundation/Foundation.h> #import <AquaTerm/AQTAdapter.h> -/* PLplot header files */ +// PLplot header files #include "plplotP.h" #include "drivers.h" -/* constants */ +// constants #define SCALE 0.1 #define AQT_Default_X 720 @@ -46,10 +46,10 @@ #define MAX_STRING_LEN 1000 -/* local variables */ +// local variables -static NSAutoreleasePool *arpool; /* Objective-C autorelease pool */ -static id adapter; /* Adapter object */ +static NSAutoreleasePool *arpool; // Objective-C autorelease pool +static id adapter; // Adapter object PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_aqt = "aqt:AquaTerm (Mac OS X):1:aqt:50:aqt\n"; @@ -62,14 +62,14 @@ static bool hasShear = false; static bool hasAlpha = false; -/* font stuff */ +// font stuff -/* - * AquaTerm font look-up table - * - * The table is initialized with lowest common denominator truetype - * fonts that (I hope) most Macs will have. - */ +// +// AquaTerm font look-up table +// +// The table is initialized with lowest common denominator truetype +// fonts that (I hope) most Macs will have. +// #define AQT_N_FontLookup 30 static FCI_to_FontName_Table AQT_FontLookup[AQT_N_FontLookup] = { @@ -105,29 +105,29 @@ { PL_FCI_MARK | 0x124, (unsigned char *) "LucidaGrande Regular" } }; -/* - * AquaTerm font environment variables - * - * When the driver is initialized it will check to see if - * the user has opted to overide one of the above fonts by - * setting one of the environment variables below. - * - * This list must be in the same order with the same number of - * elements as the above list - * - * These are the same environment variable names as would be used - * on a linux system, but they have a slightly different meaning. - * Since AquaTerm will find the font for us (if it can) given - * just the font name, you should only set the environment - * variable to the font name. You don't need to provide - * a path. If you installed the font using Font Book, AquaTerm - * should not have any trouble finding it. - * - * FIXME: Would it be better to use different environment variable - * names then plfreetype.c? If not, then it probably isn't - * ideal to have two different copies of the same list of - * environment variable names. - */ +// +// AquaTerm font environment variables +// +// When the driver is initialized it will check to see if +// the user has opted to overide one of the above fonts by +// setting one of the environment variables below. +// +// This list must be in the same order with the same number of +// elements as the above list +// +// These are the same environment variable names as would be used +// on a linux system, but they have a slightly different meaning. +// Since AquaTerm will find the font for us (if it can) given +// just the font name, you should only set the environment +// variable to the font name. You don't need to provide +// a path. If you installed the font using Font Book, AquaTerm +// should not have any trouble finding it. +// +// FIXME: Would it be better to use different environment variable +// names then plfreetype.c? If not, then it probably isn't +// ideal to have two different copies of the same list of +// environment variable names. +// const char *aqt_font_env_names[AQT_N_FontLookup] = { "PLPLOT_FREETYPE_SANS_FONT", @@ -162,7 +162,7 @@ "PLPLOT_FREETYPE_SYMBOL_BOLD_OBLIQUE_FONT" }; -/* Debugging extras */ +// Debugging extras static inline void NOOP_( id x, ... ) { @@ -173,13 +173,13 @@ #define LOG NSLog #else #define LOG NOOP_ -#endif /* LOGGING */ +#endif // LOGGING -/*----------------------------------------------- - * function declarations - * -----------------------------------------------*/ +//----------------------------------------------- +// function declarations +// ----------------------------------------------- -/* helper functions */ +// helper functions static void get_cursor( PLStream *, PLGraphicsIn * ); static void proc_str( PLStream *, EscText * ); @@ -187,7 +187,7 @@ static void set_font_and_size( NSMutableAttributedString *, PLUNICODE, PLFLT, int ); static void check_font_environment_variables( void ); -/* PLplot interface functions */ +// PLplot interface functions void plD_dispatch_init_aqt( PLDispatchTable *pdt ); void plD_init_aqt( PLStream * ); @@ -199,11 +199,11 @@ void plD_state_aqt( PLStream *, PLINT ); void plD_esc_aqt( PLStream *, PLINT, void * ); -/*--------------------------------------------------------------------- - * dispatch_init_init() - * - * Initialize device dispatch table - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// dispatch_init_init() +// +// Initialize device dispatch table +// --------------------------------------------------------------------- void plD_dispatch_init_aqt( PLDispatchTable *pdt ) { @@ -223,32 +223,32 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_aqt; } -/*--------------------------------------------------------------------- - * aqt_init() - * - * Initialize device - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// aqt_init() +// +// Initialize device +// --------------------------------------------------------------------- void plD_init_aqt( PLStream *pls ) { - if ( arpool == NULL ) /* Make sure we don't leak mem by allocating every time */ + if ( arpool == NULL ) // Make sure we don't leak mem by allocating every time { arpool = [[NSAutoreleasePool alloc] init]; adapter = [[AQTAdapter alloc] init]; } [adapter setBackgroundColorRed : 0.5 green : 0.5 blue : 0.5]; - pls->termin = 1; /* interactive device */ - pls->dev_flush = 1; /* Handle our own flushes */ - pls->color = 1; /* supports color */ + pls->termin = 1; // interactive device + pls->dev_flush = 1; // Handle our own flushes + pls->color = 1; // supports color pls->width = 1; pls->verbose = 1; pls->bytecnt = 0; pls->debug = 1; - pls->dev_text = 1; /* handles text */ - pls->dev_unicode = 1; /* wants text as unicode */ + pls->dev_text = 1; // handles text + pls->dev_unicode = 1; // wants text as unicode pls->page = 0; - pls->dev_fill0 = 1; /* supports hardware solid fills */ + pls->dev_fill0 = 1; // supports hardware solid fills pls->dev_fill1 = 1; pls->graphx = GRAPHICS_MODE; @@ -256,11 +256,11 @@ if ( !pls->colorset ) pls->color = 1; - /* Set up device parameters */ + // Set up device parameters - plP_setpxl( DPI / 25.4 / SCALE, DPI / 25.4 / SCALE ); /* Pixels/mm. */ + plP_setpxl( DPI / 25.4 / SCALE, DPI / 25.4 / SCALE ); // Pixels/mm. - /* Set the bounds for plotting. default is AQT_Default_X x AQT_Default_Y unless otherwise specified. */ + // Set the bounds for plotting. default is AQT_Default_X x AQT_Default_Y unless otherwise specified. if ( pls->xlength <= 0 || pls->ylength <= 0 ) { @@ -275,12 +275,12 @@ plP_setphy( (PLINT) 0, (PLINT) ( pls->xlength / SCALE ), (PLINT) 0, (PLINT) ( pls->ylength / SCALE ) ); } - /* check font environment variables & update font table as necessary */ + // check font environment variables & update font table as necessary check_font_environment_variables(); - /* Check to see if the users version of aquaterm supports sheared labels. */ - /* If it isn't available 3D plots will look a little strange but things should otherwise be okay. */ + // Check to see if the users version of aquaterm supports sheared labels. + // If it isn't available 3D plots will look a little strange but things should otherwise be okay. if ( !didTests ) { @@ -290,11 +290,11 @@ } } -/*---------------------------------------------------------------------- - * aqt_bop() - * - * Set up for the next page. - * ----------------------------------------------------------------------*/ +//---------------------------------------------------------------------- +// aqt_bop() +// +// Set up for the next page. +// ---------------------------------------------------------------------- void plD_bop_aqt( PLStream *pls ) { @@ -319,11 +319,11 @@ pls->page++; } -/*--------------------------------------------------------------------- - * aqt_line() - * - * Draw a line in the current color from (x1,y1) to (x2,y2). - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// aqt_line() +// +// Draw a line in the current color from (x1,y1) to (x2,y2). +// --------------------------------------------------------------------- void plD_line_aqt( PLStream *pls, short x1a, short y1a, short x2a, short y2a ) { @@ -331,11 +331,11 @@ [adapter addLineToPoint : NSMakePoint( (float) x2a * SCALE, (float) y2a * SCALE )]; } -/*--------------------------------------------------------------------- - * aqt_polyline() - * - * Draw a polyline in the current color. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// aqt_polyline() +// +// Draw a polyline in the current color. +// --------------------------------------------------------------------- void plD_polyline_aqt( PLStream *pls, short *xa, short *ya, PLINT npts ) { @@ -345,36 +345,36 @@ plD_line_aqt( pls, xa[i], ya[i], xa[i + 1], ya[i + 1] ); } -/*--------------------------------------------------------------------- - * aqt_eop() - * - * End of page - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// aqt_eop() +// +// End of page +// --------------------------------------------------------------------- void plD_eop_aqt( PLStream *pls ) { - [arpool release]; /* prevents a memory leak by freeing everything in */ - /* the auto-release pool when the plot is closed. */ + [arpool release]; // prevents a memory leak by freeing everything in + // the auto-release pool when the plot is closed. arpool = [[NSAutoreleasePool alloc] init]; [adapter renderPlot]; } -/*--------------------------------------------------------------------- - * aqt_tidy() - * - * Close graphics file or otherwise clean up. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// aqt_tidy() +// +// Close graphics file or otherwise clean up. +// --------------------------------------------------------------------- void plD_tidy_aqt( PLStream *pls ) { [adapter closePlot]; } -/*--------------------------------------------------------------------- - * plD_state_aqt() - * - * Handle change in PLStream state (color, pen width, fill attribute, etc). - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// plD_state_aqt() +// +// Handle change in PLStream state (color, pen width, fill attribute, etc). +// --------------------------------------------------------------------- void plD_state_aqt( PLStream *pls, PLINT op ) { @@ -387,7 +387,7 @@ [adapter setLinewidth : (float) pls->width]; break; - case PLSTATE_COLOR0: /* this seems to work, but that isn't to say that it is done right... */ + case PLSTATE_COLOR0: // this seems to work, but that isn't to say that it is done right... if ( hasAlpha ) { [adapter setBackgroundColorRed : (float) ( plsc->cmap0[0].r / 255.0 ) @@ -426,38 +426,38 @@ } } -/*--------------------------------------------------------------------- - * aqt_esc() - * - * Escape function. - * - * Functions: - * - * PLESC_EH Handle pending events - * PLESC_EXPOSE Force an expose - * PLESC_FILL Fill polygon - * PLESC_FLUSH Flush X event buffer - * PLESC_GETC Get coordinates upon mouse click - * PLESC_REDRAW Force a redraw - * PLESC_RESIZE Force a resize - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// aqt_esc() +// +// Escape function. +// +// Functions: +// +// PLESC_EH Handle pending events +// PLESC_EXPOSE Force an expose +// PLESC_FILL Fill polygon +// PLESC_FLUSH Flush X event buffer +// PLESC_GETC Get coordinates upon mouse click +// PLESC_REDRAW Force a redraw +// PLESC_RESIZE Force a resize +// --------------------------------------------------------------------- void plD_esc_aqt( PLStream *pls, PLINT op, void *ptr ) { int i; switch ( op ) { - case PLESC_EXPOSE: /* handle window expose */ + case PLESC_EXPOSE: // handle window expose break; - case PLESC_RESIZE: /* handle window resize */ + case PLESC_RESIZE: // handle window resize break; - case PLESC_REDRAW: /* handle window redraw */ + case PLESC_REDRAW: // handle window redraw break; - case PLESC_TEXT: /* switch to text screen */ + case PLESC_TEXT: // switch to text screen break; - case PLESC_GRAPH: /* switch to graphics screen */ + case PLESC_GRAPH: // switch to graphics screen break; - case PLESC_FILL: /* fill polygon */ + case PLESC_FILL: // fill polygon [adapter moveToVertexPoint : NSMakePoint( pls->dev_x[0] * SCALE, pls->dev_y[0] * SCALE )]; for ( i = 1; i < pls->dev_npts; i++ ) { @@ -465,18 +465,18 @@ } ; break; - case PLESC_DI: /* handle DI command */ + case PLESC_DI: // handle DI command break; - case PLESC_FLUSH: /* flush output */ + case PLESC_FLUSH: // flush output [adapter renderPlot]; break; - case PLESC_EH: /* handle Window events */ + case PLESC_EH: // handle Window events break; - case PLESC_GETC: /* get cursor position */ - [adapter renderPlot]; /* needed to give the user something to click on */ + case PLESC_GETC: // get cursor position + [adapter renderPlot]; // needed to give the user something to click on get_cursor( pls, (PLGraphicsIn*) ptr ); break; - case PLESC_SWIN: /* set window parameters */ + case PLESC_SWIN: // set window parameters break; case PLESC_HAS_TEXT: proc_str( pls, (EscText *) ptr ); @@ -484,11 +484,11 @@ } } -/*--------------------------------------------------------------------- - * get_cursor() - * - * returns the location of the next mouse click - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// get_cursor() +// +// returns the location of the next mouse click +// --------------------------------------------------------------------- void get_cursor( PLStream *pls, PLGraphicsIn *gin ) { @@ -500,7 +500,7 @@ temp = [adapter waitNextEvent]; scanned = sscanf([temp cString], "1:{%d, %d}:%d", &x, &y, &button ); - if ( scanned == 3 ) /* check that we did actually get a reasonable event string */ + if ( scanned == 3 ) // check that we did actually get a reasonable event string { gin->button = button; gin->pX = x; @@ -508,7 +508,7 @@ gin->dX = (PLFLT) x / ( (PLFLT) ( pls->xlength ) ); gin->dY = (PLFLT) y / ( (PLFLT) ( pls->ylength ) ); } - else /* just return zeroes if we did not */ + else // just return zeroes if we did not { printf( "AquaTerm did not return a valid mouse location!\n" ); gin->button = 0; @@ -519,12 +519,12 @@ } } -/*--------------------------------------------------------------------- - * proc_str() - * - * Processes strings for display. The actual parsing of the unicode - * string is handled by the sub-routine create_string. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// proc_str() +// +// Processes strings for display. The actual parsing of the unicode +// string is handled by the sub-routine create_string. +// --------------------------------------------------------------------- void proc_str( PLStream *pls, EscText *args ) { @@ -533,7 +533,7 @@ int i, jst, ref; NSMutableAttributedString *str; - /* check that we got unicode, warning message and return if not */ + // check that we got unicode, warning message and return if not if ( args->unicode_array_len == 0 ) { @@ -541,7 +541,7 @@ return; } - /* check that unicode string isn't longer then the max we allow */ + // check that unicode string isn't longer then the max we allow if ( args->unicode_array_len >= MAX_STRING_LEN ) { @@ -549,40 +549,40 @@ return; } - /* set the font height - the 1.2 factor was trial and error */ + // set the font height - the 1.2 factor was trial and error - ft_ht = 1.2 * pls->chrht * DPI / 25.4; /* ft_ht in points. ht is in mm */ + ft_ht = 1.2 * pls->chrht * DPI / 25.4; // ft_ht in points. ht is in mm - /* given transform, calculate rotation angle & shear angle */ + // given transform, calculate rotation angle & shear angle plRotationShear( args->xform, &angle, &shear, &stride ); angle *= 180.0 / PI; shear *= -180.0 / PI; - /* text justification, AquaTerm only supports 3 options, so we round appropriately */ + // text justification, AquaTerm only supports 3 options, so we round appropriately if ( args->just < 0.33 ) - jst = AQTAlignLeft; /* left */ + jst = AQTAlignLeft; // left else if ( args->just > 0.66 ) - jst = AQTAlignRight; /* right */ + jst = AQTAlignRight; // right else - jst = AQTAlignCenter; /* center */ + jst = AQTAlignCenter; // center - /* set the baseline of the string */ - /* Middle and Bottom are set to Middle since this seems to be what PLplot expects - * as judged by where it renders the symbols in example 1. */ + // set the baseline of the string + // Middle and Bottom are set to Middle since this seems to be what PLplot expects + // as judged by where it renders the symbols in example 1. - if ( args->base == 2 ) /* Top */ + if ( args->base == 2 ) // Top ref = AQTAlignTop; - else if ( args->base == 1 ) /* Bottom */ + else if ( args->base == 1 ) // Bottom ref = AQTAlignMiddle; else - ref = AQTAlignMiddle; /* Middle */ + ref = AQTAlignMiddle; // Middle - /* create an appropriately formatted, etc... unicode string */ + // create an appropriately formatted, etc... unicode string str = create_string( args->unicode_array, args->unicode_array_len, ft_ht ); - /* display the string */ + // display the string if ( hasAlpha ) { @@ -617,18 +617,18 @@ [str release]; } -/*--------------------------------------------------------------------- - * create_string() - * - * create a NSMutableAttributedString from the plplot ucs4 string - * - * assumptions : - * 1. font changes are unicode >= PL_FCI_MARK - * 2. we'll never have to deal with a string longer then MAX_STRING_LEN characters - * 3. <esc><esc> means we desired <esc> as a character & not actually as <esc> - * 4. there are no two character <esc> sequences... i.e. <esc>fn is now covered by fci - * - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// create_string() +// +// create a NSMutableAttributedString from the plplot ucs4 string +// +// assumptions : +// 1. font changes are unicode >= PL_FCI_MARK +// 2. we'll never have to deal with a string longer then MAX_STRING_LEN characters +// 3. <esc><esc> means we desired <esc> as a character & not actually as <esc> +// 4. there are no two character <esc> sequences... i.e. <esc>fn is now covered by fci +// +// --------------------------------------------------------------------- NSMutableAttributedString * create_string( const PLUNICODE *ucs4, int ucs4_len, PLFLT font_height ) { @@ -645,31 +645,31 @@ updown = 0; - /* initialize the attributed string */ + // initialize the attributed string for ( i = 0; i < MAX_STRING_LEN; i++ ) dummy[i] = 'i'; dummy[MAX_STRING_LEN] = '\0'; str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithCString:dummy]]; - /* get plplot escape character & current font */ + // get plplot escape character & current font plgesc( &plplot_esc ); plgfci( &fci ); - /* set the font for the string based on the current font & size */ + // set the font for the string based on the current font & size set_font_and_size( str, fci, font_height, 0 ); - /* parse plplot ucs4 string */ + // parse plplot ucs4 string cur_loc = 0; i = 0; while ( i < ucs4_len ) { - if ( ucs4[i] < PL_FCI_MARK ) /* not a font change */ + if ( ucs4[i] < PL_FCI_MARK ) // not a font change { - if ( ucs4[i] != (PLUNICODE) plplot_esc ) /* a character to display */ + if ( ucs4[i] != (PLUNICODE) plplot_esc ) // a character to display { ucs4_to_utf8( ucs4[i], utf8 ); [str replaceCharactersInRange : NSMakeRange( cur_loc, 1 ) @@ -690,19 +690,19 @@ } else { - if ( ucs4[i] == (PLUNICODE) 'f' ) /* font change */ + if ( ucs4[i] == (PLUNICODE) 'f' ) // font change { i++; printf( "hmm, unicode string apparently not following fci convention...\n" ); } - if ( ucs4[i] == (PLUNICODE) 'd' ) /* Subscript */ + if ( ucs4[i] == (PLUNICODE) 'd' ) // Subscript { updown--; [str addAttribute : @ "NSSuperScript" value :[NSNumber numberWithInt : updown] range : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ) )]; } - if ( ucs4[i] == (PLUNICODE) 'u' ) /* Superscript */ + if ( ucs4[i] == (PLUNICODE) 'u' ) // Superscript { updown++; [str addAttribute : @ "NSSuperScript" @@ -712,25 +712,25 @@ i++; } } - else /* a font change */ + else // a font change { set_font_and_size( str, ucs4[i], font_height, cur_loc ); i++; } } - /* trim string to appropriate final length */ + // trim string to appropriate final length [str deleteCharactersInRange : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ) )]; return str; } -/*--------------------------------------------------------------------- - * set_font_and_size - * - * set the font & size of a attributable string object - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// set_font_and_size +// +// set the font & size of a attributable string object +// --------------------------------------------------------------------- void set_font_and_size( NSMutableAttributedString * str, PLUNICODE fci, PLFLT font_height, int cur_loc ) { @@ -738,7 +738,7 @@ font = plP_FCI2FontName( fci, AQT_FontLookup, AQT_N_FontLookup ); - /* check whether that font exists & if not, use standard font instread */ + // check whether that font exists & if not, use standard font instread if ( font == NULL ) { @@ -746,7 +746,7 @@ font = "Helvetica"; } /* font = "FreeSerif"; *//* force the font for debugging purposes */ - /* printf("Font at %d is : %s\n", cur_loc, font); */ + // printf("Font at %d is : %s\n", cur_loc, font); [str addAttribute : @ "AQTFontname" value :[NSString stringWithCString : font] @@ -756,14 +756,14 @@ range : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ) )]; } -/*--------------------------------------------------------------------- - * check_font_environment_variables - * - * Checks to see if any font environment variables are defined. - * If a font environment variable is defined, then the appropriate - * element of the default font table is replaced with the font name - * string specified by the environment variable. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// check_font_environment_variables +// +// Checks to see if any font environment variables are defined. +// If a font environment variable is defined, then the appropriate +// element of the default font table is replaced with the font name +// string specified by the environment variable. +// --------------------------------------------------------------------- void check_font_environment_variables( void ) @@ -777,11 +777,11 @@ { if ( ( new_font = getenv( aqt_font_env_names[i] ) ) != NULL ) { - /* If the user is just blindly following the suggestions in - * the plplot examples then we might get a font name with - * a path and extension. We need to remove that since it - * isn't relevant and will only cause trouble. We warn them - * AquaTerm was not expecting a path or extension. */ + // If the user is just blindly following the suggestions in + // the plplot examples then we might get a font name with + // a path and extension. We need to remove that since it + // isn't relevant and will only cause trouble. We warn them + // AquaTerm was not expecting a path or extension. begin = strrchr( new_font, '/' ); end = strrchr( new_font, '.' ); @@ -797,7 +797,7 @@ new_font = begin + 1; } - /* printf("new font : %s\n", new_font); */ + // printf("new font : %s\n", new_font); AQT_FontLookup[i].pfont = (unsigned char*) new_font; } Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2010-10-27 06:52:54 UTC (rev 11281) +++ trunk/drivers/cairo.c 2010-10-28 16:26:09 UTC (rev 11282) @@ -1,31 +1,31 @@ -/* June 2, 2007 - * - * Graphics drivers that are based on the Cairo / Pango Libraries. - * - * Copyright (C) 2008 Hazen Babcock - * Copyright (C) 2009, 2010 Hezekiah M. Carty - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// June 2, 2007 +// +// Graphics drivers that are based on the Cairo / Pango Libraries. +// +// Copyright (C) 2008 Hazen Babcock +// Copyright (C) 2009, 2010 Hezekiah M. Carty +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// -/*--------------------------------------------------------------------- - * Header files - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// Header files +// --------------------------------------------------------------------- #include <stdio.h> #include <string.h> @@ -34,13 +34,13 @@ #include <cairo.h> #include <pango/pangocairo.h> -/* PLplot header files (must occur before driver-dependent includes) */ +// PLplot header files (must occur before driver-dependent includes) #include "plDevs.h" #include "plplotP.h" #include "drivers.h" -/* Driver-dependent includes */ +// Driver-dependent includes #if defined ( PLD_xcairo ) #include <cairo-xlib.h> #include <X11/X.h> @@ -62,9 +62,9 @@ #include <windows.h> #endif -/*--------------------------------------------------------------------- - * Constants & global (to this file) variables - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// Constants & global (to this file) variables +// --------------------------------------------------------------------- #define DPI 72 #define PLCAIRO_DEFAULT_X 720 @@ -160,10 +160,10 @@ #endif ; -/* - * Structure for passing external drawables to xcairo devices via - * the PLESC_DEVINIT escape function. - */ +// +// Structure for passing external drawables to xcairo devices via +// the PLESC_DEVINIT escape function. +// #if defined ( PLD_xcairo ) typedef struct { @@ -172,10 +172,10 @@ } PLXcairoDrawableInfo; #endif -/*--------------------------------------------------------------------- - * Font style and weight lookup tables (copied - * from the psttf driver). - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// Font style and weight lookup tables (copied +// from the psttf driver). +// --------------------------------------------------------------------- #define NPANGOLOOKUP 5 @@ -212,25 +212,25 @@ }; -/*--------------------------------------------------------------------- - * --------------------------------------------------------------------- - * - * That which is common to all the Cairo Drivers - * - * --------------------------------------------------------------------- - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// --------------------------------------------------------------------- +// +// That which is common to all the Cairo Drivers +// +// --------------------------------------------------------------------- +// --------------------------------------------------------------------- -/*--------------------------------------------------------------------- - * function declarations - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// function declarations +// --------------------------------------------------------------------- -/* General */ +// General PLCairo *stream_and_font_setup( PLStream *, int ); cairo_status_t write_to_stream( void *, unsigned char *, unsigned int ); void set_clip( PLStream *pls ); -/* String processing */ +// String processing static void proc_str( PLStream *, EscText * ); static void text_begin_cairo( PLStream *pls, EscText *args ); @@ -242,7 +242,7 @@ static void close_span_tag( char *, int ); static char *rise_span_tag( int, int ); -/* Graphics */ +// Graphics static void set_current_context( PLStream * ); static void poly_line( PLStream *, short *, short *, PLINT ); @@ -250,13 +250,13 @@ static void gradient( PLStream *pls, short *xa, short *ya, PLINT npts ); static void arc( PLStream *, arc_struct * ); static void rotate_cairo_surface( PLStream *, float, float, float, float, float, float, PLBOOL ); -/* Rasterization of plotted material */ +// Rasterization of plotted material static void start_raster( PLStream* ); static void end_raster( PLStream* ); -/* PLplot interface functions */ +// PLplot interface functions -/* general */ +// general void plD_bop_cairo( PLStream * ); void plD_eop_cairo( PLStream * ); void plD_state_cairo( PLStream *, PLINT ); @@ -265,11 +265,11 @@ void plD_line_cairo( PLStream *, short, short, short, short ); void plD_polyline_cairo( PLStream *, short *, short *, PLINT ); -/*---------------------------------------------------------------------- - * start_raster() - * - * Set up off-screen rasterized rendering - * ----------------------------------------------------------------------*/ +//---------------------------------------------------------------------- +// start_raster() +// +// Set up off-screen rasterized rendering +// ---------------------------------------------------------------------- void start_raster( PLStream *pls ) { @@ -282,41 +282,41 @@ if ( aStream->closed ) return; - /* Do not use the external surface if the user says not to */ + // Do not use the external surface if the user says not to if ( !aStream->rasterize_image ) return; - /* Create an image surface and context for the offscreen rendering */ + // Create an image surface and context for the offscreen rendering aStream->cairoSurface_raster = - /* - * cairo_surface_create_similar( aStream->cairoSurface, - * CAIRO_CONTENT_COLOR, - * pls->xlength, pls->ylength ); - */ + // + // cairo_surface_create_similar( aStream->cairoSurface, + // CAIRO_CONTENT_COLOR, + // pls->xlength, pls->ylength ); + // cairo_image_surface_create( CAIRO_FORMAT_ARGB32, pls->xlength, pls->ylength ); aStream->cairoContext_raster = cairo_create( aStream->cairoSurface_raster ); - /* Disable antialiasing for the raster surface. The output seems to look - * better that way. */ + // Disable antialiasing for the raster surface. The output seems to look + // better that way. cairo_set_antialias( aStream->cairoContext_raster, CAIRO_ANTIALIAS_NONE ); - /* Swap the raster and main plot surfaces and contexts */ + // Swap the raster and main plot surfaces and contexts tmp_sfc = aStream->cairoSurface; tmp_context = aStream->cairoContext; aStream->cairoSurface = aStream->cairoSurface_raster; aStream->cairoContext = aStream->cairoContext_raster; - /* Save the main plot surface and context for when we are finished */ + // Save the main plot surface and context for when we are finished aStream->cairoSurface_raster = tmp_sfc; aStream->cairoContext_raster = tmp_context; } -/*---------------------------------------------------------------------- - * end_raster() - * - * Finish off-screen rasterized rendering and copy the result on to the - * main plot surface. - * ----------------------------------------------------------------------*/ +//---------------------------------------------------------------------- +// end_raster() +// +// Finish off-screen rasterized rendering and copy the result on to the +// main plot surface. +// ---------------------------------------------------------------------- void end_raster( PLStream *pls ) { @@ -329,19 +329,19 @@ if ( aStream->closed ) return; - /* TODO FIXME: This should really only copy the used portion of the - * offscreen pixmap. */ + // TODO FIXME: This should really only copy the used portion of the + // offscreen pixmap. - /* Do not use the external surface if the user says not to */ + // Do not use the external surface if the user says not to if ( !aStream->rasterize_image ) return; - /* Some Cairo devices support delayed device setup (eg: xcairo with - * external drawable and extcairo with an external context). */ + // Some Cairo devices support delayed device setup (eg: xcairo with + // external drawable and extcairo with an external context). if ( aStream->cairoContext == NULL ) plexit( "Can not plot to a Cairo device with no context" ); - /* Restore the main plot surface and context for future plotting */ + // Restore the main plot surface and context for future plotting tmp_sfc = aStream->cairoSurface; tmp_context = aStream->cairoContext; aStream->cairoSurface = aStream->cairoSurface_raster; @@ -349,20 +349,20 @@ aStream->cairoSurface_raster = tmp_sfc; aStream->cairoContext_raster = tmp_context; - /* Blit the raster surface on to the main plot */ + // Blit the raster surface on to the main plot cairo_set_source_surface( aStream->cairoContext, aStream->cairoSurface_raster, 0.0, 0.0 ); cairo_paint( aStream->cairoContext ); - /* Free the now extraneous surface and context */ + // Free the now extraneous surface and context cairo_destroy( aStream->cairoContext_raster ); cairo_surface_destroy( aStream->cairoSurface_raster ); } -/*---------------------------------------------------------------------- - * plD_bop_cairo() - * - * Set up for the next page. - * ----------------------------------------------------------------------*/ +//---------------------------------------------------------------------- +// plD_bop_cairo() +// +// Set up for the next page. +// ---------------------------------------------------------------------- void plD_bop_cairo( PLStream *pls ) { @@ -373,12 +373,12 @@ if ( aStream->closed ) return; - /* Some Cairo devices support delayed device setup (eg: xcairo with - * external drawable and extcairo with an external context). */ + // Some Cairo devices support delayed device setup (eg: xcairo with + // external drawable and extcairo with an external context). if ( aStream->cairoContext == NULL ) return; - /* Fill in the window with the background color. */ + // Fill in the window with the background color. cairo_rectangle( aStream->cairoContext, 0.0, 0.0, pls->xlength, pls->ylength ); if ( (double) pls->cmap0[0].a < 1.0 ) { @@ -393,17 +393,17 @@ cairo_fill( aStream->cairoContext ); } -/*--------------------------------------------------------------------- - * plD_line_cairo() - * - * Draw a line in the current color from (x1,y1) to (x2,y2). - * ----------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// plD_line_cairo() +// +// Draw a line in the current color from (x1,y1) to (x2,y2). +// ---------------------------------------------------------------------- -/*--------------------------------------------------------------------- - * (get|set)_line_properties - * - * (Get|Set) the current Cairo line drawing properties. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// (get|set)_line_properties +// +// (Get|Set) the current Cairo line drawing properties. +// --------------------------------------------------------------------- void get_line_properties( PLCairo *aStream, cairo_line_join_t *join, cairo_line_cap_t *cap ) { *join = cairo_get_line_join( aStream->cairoContext ); @@ -439,11 +439,11 @@ cairo_restore( aStream->cairoContext ); } -/*--------------------------------------------------------------------- - * plD_polyline_cairo() - * - * Draw a polyline in the current color. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// plD_polyline_cairo() +// +// Draw a polyline in the current color. +// --------------------------------------------------------------------- void plD_polyline_cairo( PLStream *pls, short *xa, short *ya, PLINT npts ) { @@ -465,11 +465,11 @@ cairo_restore( aStream->cairoContext ); } -/*--------------------------------------------------------------------- - * plD_eop_cairo() - * - * Generic end of page. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// plD_eop_cairo() +// +// Generic end of page. +// --------------------------------------------------------------------- void plD_eop_cairo( PLStream *pls ) { @@ -483,11 +483,11 @@ cairo_show_page( aStream->cairoContext ); } -/*--------------------------------------------------------------------- - * plD_tidy_cairo() - * - * General: Close graphics file or otherwise clean up. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// plD_tidy_cairo() +// +// General: Close graphics file or otherwise clean up. +// --------------------------------------------------------------------- void plD_tidy_cairo( PLStream *pls ) { @@ -495,31 +495,31 @@ aStream = (PLCairo *) pls->dev; - /* Free the cairo context and surface. */ + // Free the cairo context and surface. cairo_destroy( aStream->cairoContext ); cairo_surface_destroy( aStream->cairoSurface ); plCloseFile( pls ); } -/*--------------------------------------------------------------------- - * plD_state_cairo() - * - * Handle change in PLStream state (color, pen width, fill attribute, etc). - * - * Nothing is done here because these attributes are acquired from - * PLStream for each element that is drawn. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// plD_state_cairo() +// +// Handle change in PLStream state (color, pen width, fill attribute, etc). +// +// Nothing is done here because these attributes are acquired from +// PLStream for each element that is drawn. +// --------------------------------------------------------------------- void plD_state_cairo( PLStream *pls, PLINT op ) { } -/*--------------------------------------------------------------------- - * plD_esc_cairo() - * - * Generic escape function. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// plD_esc_cairo() +// +// Generic escape function. +// --------------------------------------------------------------------- void plD_esc_cairo( PLStream *pls, PLINT op, void *ptr ) { @@ -532,10 +532,10 @@ switch ( op ) { - case PLESC_FILL: /* filled polygon */ + case PLESC_FILL: // filled polygon filled_polygon( pls, pls->dev_x, pls->dev_y, pls->dev_npts ); break; - case PLESC_GRADIENT: /* render a gradient within a polygon. */ + case PLESC_GRADIENT: // render a gradient within a polygon. gradient( pls, pls->dev_x, pls->dev_y, pls->dev_npts ); break; case PLESC_HAS_TEXT: @@ -544,35 +544,35 @@ proc_str( pls, (EscText *) ptr ); } break; - case PLESC_BEGIN_TEXT: /* get ready to get a handle a string of text */ + case PLESC_BEGIN_TEXT: // get ready to get a handle a string of text text_begin_cairo( pls, (EscText *) ptr ); break; - case PLESC_TEXT_CHAR: /* handle a character of text to display */ + case PLESC_TEXT_CHAR: // handle a character of text to display text_char_cairo( pls, (EscText *) ptr ); break; - case PLESC_CONTROL_CHAR: /* handle a control character (super/subscript of fontchange) */ + case PLESC_CONTROL_CHAR: // handle a control character (super/subscript of fontchange) text_esc_cairo( pls, (EscText *) ptr ); break; - case PLESC_END_TEXT: /* finish a string of text */ + case PLESC_END_TEXT: // finish a string of text text_end_cairo( pls, (EscText *) ptr ); break; - case PLESC_START_RASTERIZE: /* Start offscreen/rasterized rendering */ + case PLESC_START_RASTERIZE: // Start offscreen/rasterized rendering start_raster( pls ); break; - case PLESC_END_RASTERIZE: /* End offscreen/rasterized rendering */ + case PLESC_END_RASTERIZE: // End offscreen/rasterized rendering end_raster( pls ); break; - case PLESC_ARC: /* Draw an arc, either filled or outline */ + case PLESC_ARC: // Draw an arc, either filled or outline arc( pls, (arc_struct *) ptr ); break; } } -/*--------------------------------------------------------------------- - * text_begin_cairo() - * - * Begin text. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// text_begin_cairo() +// +// Begin text. +// --------------------------------------------------------------------- void text_begin_cairo( PLStream *pls, EscText *args ) { @@ -590,11 +590,11 @@ open_span_tag( aStream->pangoMarkupString, args->n_fci, aStream->fontSize, 0 ); } -/*--------------------------------------------------------------------- - * text_char_cairo() - * - * Add text. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// text_char_cairo() +// +// Add text. +// --------------------------------------------------------------------- void text_char_cairo( PLStream *pls, EscText *args ) { @@ -602,7 +602,7 @@ PLCairo *aStream; aStream = (PLCairo *) pls->dev; - /* make sure we are not too close to the end of the string */ + // make sure we are not too close to the end of the string if ( strlen( aStream->pangoMarkupString ) < ( MAX_MARKUP_LEN - 50 ) ) { switch ( args->n_char ) @@ -624,11 +624,11 @@ } } -/*--------------------------------------------------------------------- - * text_esc_cairo() - * - * A font change, superscript, subscript, etc... - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// text_esc_cairo() +// +// A font change, superscript, subscript, etc... +// --------------------------------------------------------------------- void text_esc_cairo( PLStream *pls, EscText *args ) { @@ -666,11 +666,11 @@ } } -/*--------------------------------------------------------------------- - * text_end_cairo() - * - * Draw the text and clean up. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// text_end_cairo() +// +// Draw the text and clean up. +// --------------------------------------------------------------------- void text_end_cairo( PLStream *pls, EscText *args ) { @@ -686,22 +686,22 @@ set_current_context( pls ); - /* Close the last span tag. */ + // Close the last span tag. close_span_tag( aStream->pangoMarkupString, aStream->upDown ); - /* Create the Pango text layout so we can figure out how big it is */ + // Create the Pango text layout so we can figure out how big it is layout = pango_cairo_create_layout( aStream->cairoContext ); pango_layout_set_markup( layout, aStream->pangoMarkupString, -1 ); pango_layout_get_pixel_size( layout, &textXExtent, &textYExtent ); - /* If asked, set the string length (in mm) and return */ - if (pls->get_string_length) + // If asked, set the string length (in mm) and return + if ( pls->get_string_length ) { - pls->string_length = (PLFLT)textXExtent * 25.4 / DPI; - return; + pls->string_length = (PLFLT) textXExtent * 25.4 / DPI; + return; } - /* Set font aliasing */ + // Set font aliasing context = pango_layout_get_context( layout ); cairoFontOptions = cairo_font_options_create(); cairo_font_options_set_antialias( cairoFontOptions, aStream->text_anti_aliasing ); @@ -709,25 +709,25 @@ pango_layout_context_changed( layout ); cairo_font_options_destroy( cairoFontOptions ); - /* Save current transform matrix & clipping region */ + // Save current transform matrix & clipping region cairo_save( aStream->cairoContext ); - /* Set up the clipping region if we are doing text clipping */ + // Set up the clipping region if we are doing text clipping if ( aStream->text_clipping ) { set_clip( pls ); } - /* Move to the string reference point */ + // Move to the string reference point cairo_move_to( aStream->cairoContext, aStream->downscale * (double) args->x, aStream->downscale * (double) args->y ); - /* Invert the coordinate system so that the text is drawn right side up */ + // Invert the coordinate system so that the text is drawn right side up cairoTransformMatrix = (cairo_matrix_t *) malloc( sizeof ( cairo_matrix_t ) ); cairo_matrix_init( cairoTransformMatrix, 1.0, 0.0, 0.0, -1.0, 0.0, 0.0 ); cairo_transform( aStream->cairoContext, cairoTransformMatrix ); - /* Extract rotation angle and shear from the PLplot tranformation matrix. - * Compute sines and cosines of the angles as an optimization. */ + // Extract rotation angle and shear from the PLplot tranformation matrix. + // Compute sines and cosines of the angles as an optimization. plRotationShear( args->xform, &rotation, &shear, &stride ); rotation -= pls->diorot * PI / 2.0; cos_rot = cos( rotation ); @@ -735,7 +735,7 @@ cos_shear = cos( shear ); sin_shear = sin( shear ); - /* Apply the transform matrix */ + // Apply the transform matrix cairo_matrix_init( cairoTransformMatrix, cos_rot * stride, -sin_rot * stride, @@ -745,27 +745,27 @@ cairo_transform( aStream->cairoContext, cairoTransformMatrix ); free( cairoTransformMatrix ); - /* Move to the text starting point */ + // Move to the text starting point cairo_rel_move_to( aStream->cairoContext, (double) ( -1.0 * args->just * (double) textXExtent ), (double) ( -0.5 * textYExtent ) ); - /* Render the text */ + // Render the text pango_cairo_show_layout( aStream->cairoContext, layout ); - /* Restore the transform matrix to its state prior to the text transform. */ + // Restore the transform matrix to its state prior to the text transform. cairo_restore( aStream->cairoContext ); - /* Free the layout object and the markup string. */ + // Free the layout object and the markup string. g_object_unref( layout ); free( aStream->pangoMarkupString ); } -/*--------------------------------------------------------------------- - * proc_str() - * - * Processes strings for display. - * ---------------------------------------------------------------------*/ +//--------------------------------------------------------------------- +// proc_str() +// +// Processes strings for display. +// --------------------------------------------------------------------- void proc_str( PLStream *pls, EscText *args ) { @@ -783,32 +783,32 @@ set_current_context( pls ); - /* Check that we got unicode, warning message and return if not */ + // Check that we got unicode, warning message and return if not if ( args->unicode_array_len == 0 ) { printf( "Non unicode string passed to a cairo driver, ignoring\n" ); return; } - /* Check that unicode string isn't longer then the max we allow */ + // Check that unicode string isn't longer then the max we allow if ( args->unicode_array_len >= MAX_STRING_LEN ) { printf( "Sorry, the cairo drivers only handles strings of length < %d\n", MAX_STRING_LEN ); return; } - /* Calculate the font size (in pixels) */ + // Calculate the font size (in pixels) fontSize = pls->chrht * DPI / 25.4; - /* Convert the escape characters into the appropriate Pango markup */ + // Convert the escape characters into the appropriate Pango markup textWithPangoMarkup = ucs4_to_pango_markup_format( args->unicode_array, args->unicode_array_len, fontSize ); - /* Create the Pango text layout so we can figure out how big it is */ + // Create the Pango text layout so we can figure out how big it is layout = pango_cairo_create_layout( aStream->cairoContext ); pango_layout_set_markup( layout, textWithPangoMarkup, -1 ); pango_layout_get_pixel_size( layout, &textXExtent, &textYExtent ); - /* Set font aliasing */ + // Set font aliasing context = pango_layout_get_context( layout ); cairoFontOptions = cairo_font_options_create(); cairo_font_options_set_antialias( cairoFontOptions, aStream->text_anti_aliasing ); @@ -816,25 +816,25 @@ pango_layout_context_changed( layout ); cairo_font_options_destroy( cairoFontOptions ); - /* Save current transform matrix & clipping region */ + // Save current transform matrix & clipping region cairo_save( aStream->cairoContext ); - /* Set up the clipping region if we are doing text clipping */ + // Set up the clipping region if we are doing text clipping if ( aStream->text_clipping ) { set_clip( pls ); } - /* Move to the string reference point */ + // Move to the string reference point cairo_move_to( aStream->cairoContext, aStream->downscale * (double) args->x, aStream->downscale * (double) args->y ); - /* Invert the coordinate system so that the text is drawn right side up */ + // Invert the coordinate system so that the text is drawn right side up cairoTransformMatrix = (cairo_matrix_t *) malloc( sizeof ( cairo_matrix_t ) ); cairo_matrix_init( cairoTransformMatrix, 1.0, 0.0, 0.0, -1.0, 0.0, 0.0 ); cairo_transform( aStream->cairoContext, cairoTransformMatrix ); - /* Extract rotation angle and shear from the PLplot tranformation matrix. - * Compute sines and cosines of the angles as an optimization. */ + // Extract rotation angle and shear from the PLplot tranformation matrix. + // Compute sines and cosines of the angles as an optimization. plRotationShear( args->xform, &rotation, &shear, &stride ); rotation -= pls->diorot * PI / 2.0; cos_rot = cos( rotation ); @@ -842,7 +842,7 @@ cos_shear = cos( shear ); sin_shear = sin( shear ); - /* Apply the transform matrix */ + // Apply the transform matrix cairo_matrix_init( cairoTransformMatrix, cos_rot * stride, -sin_rot * stride, @@ -852,30 +852,30 @@ cairo_transform( aStream->cairoContext, cairoTransformMatri... [truncated message content] |
From: <ai...@us...> - 2010-10-28 22:38:38
|
Revision: 11283 http://plplot.svn.sourceforge.net/plplot/?rev=11283&view=rev Author: airwin Date: 2010-10-28 22:38:29 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Convert variety of forms of long horizontal dividing line of comment to a standard form of this kind of comment, where the standard was chosen to be the majority form of this sort of comment before the change. Modified Paths: -------------- trunk/drivers/aqt.c trunk/drivers/cairo.c trunk/drivers/cgm.c trunk/drivers/gd.c trunk/drivers/pdf.c trunk/drivers/plmeta.c trunk/drivers/ps.c trunk/drivers/svg.c trunk/drivers/tkwin.c trunk/drivers/wingcc.c trunk/drivers/xwin.c trunk/include/plevent.h trunk/include/plplotcanvas-hacktext.h trunk/include/plplotcanvas.h trunk/include/plstrm.h trunk/lib/csa/csa.c trunk/lib/csa/csa.h trunk/lib/csa/nan.h trunk/lib/csa/version.h trunk/lib/nn/delaunay.c trunk/lib/nn/delaunay.h trunk/lib/nn/hash.c trunk/lib/nn/hash.h trunk/lib/nn/istack.c trunk/lib/nn/istack.h trunk/lib/nn/lpi.c trunk/lib/nn/nan.h trunk/lib/nn/nn.h trunk/lib/nn/nnai.c trunk/lib/nn/nncommon.c trunk/lib/nn/nnpi.c trunk/lib/nn/version.h trunk/scripts/convert_comment.py trunk/src/pdfutils.c trunk/src/plarc.c trunk/src/plargs.c trunk/src/plcont.c trunk/src/plctrl.c trunk/src/pldeprecated.c trunk/src/pldtik.c trunk/src/plfill.c trunk/src/plfreetype.c trunk/src/plgradient.c trunk/src/plgridd.c trunk/src/plgset.c trunk/src/plhist.c trunk/src/plimage.c trunk/src/plline.c trunk/src/plmap.c trunk/src/plsdef.c trunk/src/plshade.c trunk/src/plsym.c trunk/src/pltick.c Modified: trunk/drivers/aqt.c =================================================================== --- trunk/drivers/aqt.c 2010-10-28 16:26:09 UTC (rev 11282) +++ trunk/drivers/aqt.c 2010-10-28 22:38:29 UTC (rev 11283) @@ -199,11 +199,11 @@ void plD_state_aqt( PLStream *, PLINT ); void plD_esc_aqt( PLStream *, PLINT, void * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // dispatch_init_init() // // Initialize device dispatch table -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_dispatch_init_aqt( PLDispatchTable *pdt ) { @@ -223,11 +223,11 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_aqt; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // aqt_init() // // Initialize device -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_aqt( PLStream *pls ) { @@ -290,11 +290,11 @@ } } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // aqt_bop() // // Set up for the next page. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_bop_aqt( PLStream *pls ) { @@ -319,11 +319,11 @@ pls->page++; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // aqt_line() // // Draw a line in the current color from (x1,y1) to (x2,y2). -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_line_aqt( PLStream *pls, short x1a, short y1a, short x2a, short y2a ) { @@ -331,11 +331,11 @@ [adapter addLineToPoint : NSMakePoint( (float) x2a * SCALE, (float) y2a * SCALE )]; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // aqt_polyline() // // Draw a polyline in the current color. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_polyline_aqt( PLStream *pls, short *xa, short *ya, PLINT npts ) { @@ -345,11 +345,11 @@ plD_line_aqt( pls, xa[i], ya[i], xa[i + 1], ya[i + 1] ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // aqt_eop() // // End of page -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_eop_aqt( PLStream *pls ) { @@ -359,22 +359,22 @@ [adapter renderPlot]; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // aqt_tidy() // // Close graphics file or otherwise clean up. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_tidy_aqt( PLStream *pls ) { [adapter closePlot]; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_state_aqt() // // Handle change in PLStream state (color, pen width, fill attribute, etc). -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_state_aqt( PLStream *pls, PLINT op ) { @@ -426,7 +426,7 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // aqt_esc() // // Escape function. @@ -440,7 +440,7 @@ // PLESC_GETC Get coordinates upon mouse click // PLESC_REDRAW Force a redraw // PLESC_RESIZE Force a resize -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_esc_aqt( PLStream *pls, PLINT op, void *ptr ) { @@ -484,11 +484,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // get_cursor() // // returns the location of the next mouse click -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void get_cursor( PLStream *pls, PLGraphicsIn *gin ) { @@ -519,12 +519,12 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // proc_str() // // Processes strings for display. The actual parsing of the unicode // string is handled by the sub-routine create_string. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void proc_str( PLStream *pls, EscText *args ) { @@ -617,7 +617,7 @@ [str release]; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // create_string() // // create a NSMutableAttributedString from the plplot ucs4 string @@ -628,7 +628,7 @@ // 3. <esc><esc> means we desired <esc> as a character & not actually as <esc> // 4. there are no two character <esc> sequences... i.e. <esc>fn is now covered by fci // -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- NSMutableAttributedString * create_string( const PLUNICODE *ucs4, int ucs4_len, PLFLT font_height ) { @@ -726,11 +726,11 @@ return str; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // set_font_and_size // // set the font & size of a attributable string object -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void set_font_and_size( NSMutableAttributedString * str, PLUNICODE fci, PLFLT font_height, int cur_loc ) { @@ -756,14 +756,14 @@ range : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ) )]; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // check_font_environment_variables // // Checks to see if any font environment variables are defined. // If a font environment variable is defined, then the appropriate // element of the default font table is replaced with the font name // string specified by the environment variable. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void check_font_environment_variables( void ) Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2010-10-28 16:26:09 UTC (rev 11282) +++ trunk/drivers/cairo.c 2010-10-28 22:38:29 UTC (rev 11283) @@ -23,9 +23,9 @@ // // -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // Header files -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- #include <stdio.h> #include <string.h> @@ -62,9 +62,9 @@ #include <windows.h> #endif -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // Constants & global (to this file) variables -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- #define DPI 72 #define PLCAIRO_DEFAULT_X 720 @@ -172,10 +172,10 @@ } PLXcairoDrawableInfo; #endif -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // Font style and weight lookup tables (copied // from the psttf driver). -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- #define NPANGOLOOKUP 5 @@ -212,17 +212,17 @@ }; -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is common to all the Cairo Drivers // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // function declarations -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- // General @@ -265,11 +265,11 @@ void plD_line_cairo( PLStream *, short, short, short, short ); void plD_polyline_cairo( PLStream *, short *, short *, PLINT ); -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // start_raster() // // Set up off-screen rasterized rendering -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void start_raster( PLStream *pls ) { @@ -311,12 +311,12 @@ aStream->cairoContext_raster = tmp_context; } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // end_raster() // // Finish off-screen rasterized rendering and copy the result on to the // main plot surface. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void end_raster( PLStream *pls ) { @@ -358,11 +358,11 @@ cairo_surface_destroy( aStream->cairoSurface_raster ); } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_bop_cairo() // // Set up for the next page. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_bop_cairo( PLStream *pls ) { @@ -393,17 +393,17 @@ cairo_fill( aStream->cairoContext ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_line_cairo() // // Draw a line in the current color from (x1,y1) to (x2,y2). -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // (get|set)_line_properties // // (Get|Set) the current Cairo line drawing properties. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void get_line_properties( PLCairo *aStream, cairo_line_join_t *join, cairo_line_cap_t *cap ) { *join = cairo_get_line_join( aStream->cairoContext ); @@ -439,11 +439,11 @@ cairo_restore( aStream->cairoContext ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_polyline_cairo() // // Draw a polyline in the current color. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_polyline_cairo( PLStream *pls, short *xa, short *ya, PLINT npts ) { @@ -465,11 +465,11 @@ cairo_restore( aStream->cairoContext ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_eop_cairo() // // Generic end of page. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_eop_cairo( PLStream *pls ) { @@ -483,11 +483,11 @@ cairo_show_page( aStream->cairoContext ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_tidy_cairo() // // General: Close graphics file or otherwise clean up. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_tidy_cairo( PLStream *pls ) { @@ -502,24 +502,24 @@ plCloseFile( pls ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_state_cairo() // // Handle change in PLStream state (color, pen width, fill attribute, etc). // // Nothing is done here because these attributes are acquired from // PLStream for each element that is drawn. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_state_cairo( PLStream *pls, PLINT op ) { } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_esc_cairo() // // Generic escape function. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_esc_cairo( PLStream *pls, PLINT op, void *ptr ) { @@ -568,11 +568,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // text_begin_cairo() // // Begin text. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void text_begin_cairo( PLStream *pls, EscText *args ) { @@ -590,11 +590,11 @@ open_span_tag( aStream->pangoMarkupString, args->n_fci, aStream->fontSize, 0 ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // text_char_cairo() // // Add text. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void text_char_cairo( PLStream *pls, EscText *args ) { @@ -624,11 +624,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // text_esc_cairo() // // A font change, superscript, subscript, etc... -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void text_esc_cairo( PLStream *pls, EscText *args ) { @@ -666,11 +666,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // text_end_cairo() // // Draw the text and clean up. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void text_end_cairo( PLStream *pls, EscText *args ) { @@ -761,11 +761,11 @@ free( aStream->pangoMarkupString ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // proc_str() // // Processes strings for display. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void proc_str( PLStream *pls, EscText *args ) { @@ -868,14 +868,14 @@ free( textWithPangoMarkup ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // ucs4_to_pango_markup_format() // // Converts the plplot string (in ucs4) to a utf8 string that includes // pango markup. // // http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- char *ucs4_to_pango_markup_format( PLUNICODE *ucs4, int ucs4Len, float fontSize ) { @@ -985,14 +985,14 @@ return pangoMarkupString; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // open_span_tag // // 1. Opens a span tag with the appropriate font description given the // current fci. // 2. Add the appropriate number of <sub> or <sup> tags to bring us // back to our current sub/super-script level. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void open_span_tag( char *pangoMarkupString, PLUNICODE fci, float fontSize, int upDown ) { @@ -1034,11 +1034,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // close_span_tag // // Close a span tag & brings us down to zero sub/super-script level. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void close_span_tag( char *pangoMarkupString, int upDown ) { @@ -1062,11 +1062,11 @@ strncat( pangoMarkupString, "</span>", MAX_MARKUP_LEN - 1 - strlen( pangoMarkupString ) ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // rise_span_tag // // Create a rise span tag w/ appropriate font size & baseline offset -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- #define STEPSIZE 7500.0 @@ -1094,12 +1094,12 @@ return ( tag ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // write_to_stream() // // Writes data to a open file stream. This function is passed to the // Cairo file IO devices. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- cairo_status_t write_to_stream( void *filePointer, unsigned char *data, unsigned int length ) { @@ -1116,14 +1116,14 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // stream_and_font_setup() // // Initializes the PLStream structure for the cairo devices. // Initializes the font lookup table. // Checks for cairo specific user options. // Returns a new PLCairo structure. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- PLCairo *stream_and_font_setup( PLStream *pls, int interactive ) { @@ -1220,12 +1220,12 @@ return aStream; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // set_current_context() // // Updates the cairo graphics context with the current values in // PLStream. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void set_current_context( PLStream *pls ) { @@ -1248,13 +1248,13 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // poly_line() // // Draws a multi-segmented line. It is then up to the calling function // to decide whether to just draw the line, or fill in the area // enclosed by the line. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void poly_line( PLStream *pls, short *xa, short *ya, PLINT npts ) { @@ -1272,11 +1272,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // filled_polygon() // // Draws a filled polygon. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void filled_polygon( PLStream *pls, short *xa, short *ya, PLINT npts ) { @@ -1315,11 +1315,11 @@ cairo_restore( aStream->cairoContext ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // gradient() // // Render a gradient within a polygon. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void gradient( PLStream *pls, short *xa, short *ya, PLINT npts ) { @@ -1357,13 +1357,13 @@ cairo_pattern_destroy( linear_gradient ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // set_clip() // // Set the clipping region to the plot window. // NOTE: cairo_save() and cairo_restore() should probably be called before // and after this, respectively. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void set_clip( PLStream *pls ) { @@ -1400,11 +1400,11 @@ cairo_new_path( aStream->cairoContext ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // arc() // // Draws an arc, possibly filled. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void arc( PLStream *pls, arc_struct *arc_info ) { @@ -1456,11 +1456,11 @@ cairo_restore( aStream->cairoContext ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // rotate_cairo_surface() // // Rotates the cairo surface to the appropriate orientation. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void rotate_cairo_surface( PLStream *pls, float x11, float x12, float x21, float x22, float x0, float y0, PLBOOL is_xcairo ) { @@ -1486,21 +1486,21 @@ free( matrix ); } -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is common to all familying Cairo Drivers // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_pngcairo ) || defined ( PLD_svgcairo ) void plD_bop_famcairo( PLStream * ); -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_bop_famcairo() // // Familying Devices: Set up for the next page. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_bop_famcairo( PLStream *pls ) { @@ -1524,13 +1524,13 @@ } #endif -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is specific to the xcairo driver. // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_xcairo ) @@ -1545,11 +1545,11 @@ void plD_esc_xcairo( PLStream *, PLINT, void * ); static void xcairo_get_cursor( PLStream *, PLGraphicsIn * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_dispatch_init_xcairo() // // xcairo dispatch table initialization. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_dispatch_init_xcairo( PLDispatchTable *pdt ) { @@ -1569,7 +1569,7 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_xcairo; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // xcairo_init_cairo() // // Configures Cairo to use whichever X Drawable is set up in the given @@ -1579,7 +1579,7 @@ // // A return value of 0 indicates success. Currently this function only // returns 0. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- static signed int xcairo_init_cairo( PLStream *pls ) { @@ -1630,11 +1630,11 @@ return 0; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_xcairo() // // Initialize Cairo X Windows device. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_xcairo( PLStream *pls ) { @@ -1681,11 +1681,11 @@ aStream->exit_event_loop = 0; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // blit_to_x() // // Blit the offscreen image to the X window. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void blit_to_x( PLCairo *aStream, double x, double y, double w, double h ) { @@ -1699,11 +1699,11 @@ cairo_restore( aStream->cairoContext_X ); } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_bop_xcairo() // // X Windows specific start of page. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_bop_xcairo( PLStream *pls ) { @@ -1722,11 +1722,11 @@ XFlush( aStream->XDisplay ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_eop_xcairo() // // X Windows specific end of page. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_eop_xcairo( PLStream *pls ) { @@ -1797,11 +1797,11 @@ aStream->exit_event_loop = 0; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_tidy_xcairo() // // X Windows: close graphics file or otherwise clean up. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_tidy_xcairo( PLStream *pls ) { @@ -1826,11 +1826,11 @@ XCloseDisplay( aStream->XDisplay ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_esc_xcairo() // // Escape function, specialized for the xcairo driver -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_esc_xcairo( PLStream *pls, PLINT op, void *ptr ) { @@ -1892,11 +1892,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // xcairo_get_cursor() // // X Windows: returns the location of the next mouse click or key press. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void xcairo_get_cursor( PLStream *pls, PLGraphicsIn *gin ) { @@ -1971,24 +1971,24 @@ #endif -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is specific to the cairo PDF driver. // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_pdfcairo ) void plD_dispatch_init_pdfcairo( PLDispatchTable *pdt ); void plD_init_pdfcairo( PLStream * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // dispatch_init_init() // // Initialize device dispatch table -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // pdfcairo void plD_dispatch_init_pdfcairo( PLDispatchTable *pdt ) @@ -2009,11 +2009,11 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_cairo; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_pdfcairo() // // Initialize Cairo PDF device -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_pdfcairo( PLStream *pls ) { @@ -2043,24 +2043,24 @@ #endif -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is specific to the cairo PS driver. // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_pscairo ) void plD_dispatch_init_pscairo( PLDispatchTable *pdt ); void plD_init_pscairo( PLStream * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // dispatch_init_init() // // Initialize device dispatch table -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // pscairo void plD_dispatch_init_pscairo( PLDispatchTable *pdt ) @@ -2081,11 +2081,11 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_cairo; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_pscairo() // // Initialize Cairo PS device -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_pscairo( PLStream *pls ) { @@ -2118,24 +2118,24 @@ #endif -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is specific to the cairo SVG driver. // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_svgcairo ) void plD_dispatch_init_svgcairo( PLDispatchTable *pdt ); void plD_init_svgcairo( PLStream * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // dispatch_init_init() // // Initialize device dispatch table -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // svgcairo void plD_dispatch_init_svgcairo( PLDispatchTable *pdt ) @@ -2156,11 +2156,11 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_cairo; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_svgcairo() // // Initialize Cairo SVG device -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_svgcairo( PLStream *pls ) { @@ -2211,13 +2211,13 @@ #endif -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is specific to the cairo PNG driver. // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_pngcairo ) @@ -2225,11 +2225,11 @@ void plD_init_pngcairo( PLStream * ); void plD_eop_pngcairo( PLStream * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // dispatch_init_init() // // Initialize device dispatch table -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // pngcairo void plD_dispatch_init_pngcairo( PLDispatchTable *pdt ) @@ -2250,11 +2250,11 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_cairo; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_pngcairo() // // Initialize Cairo PNG device -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_pngcairo( PLStream *pls ) { @@ -2302,11 +2302,11 @@ cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_eop_pngcairo() // // PNG: End of page. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_eop_pngcairo( PLStream *pls ) { @@ -2319,13 +2319,13 @@ #endif -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is specific to the cairo memory driver. // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_memcairo ) @@ -2334,11 +2334,11 @@ void plD_eop_memcairo( PLStream * ); void plD_bop_memcairo( PLStream * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // dispatch_init_init() // // Initialize device dispatch table -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // memcairo void plD_dispatch_init_memcairo( PLDispatchTable *pdt ) @@ -2359,22 +2359,22 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_cairo; } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_bop_memcairo() // // Set up for the next page. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_bop_memcairo( PLStream *pls ) { // nothing to do here (we want to preserve the memory as it is) } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_memcairo() // // Initialize Cairo memory device -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_memcairo( PLStream *pls ) { @@ -2490,12 +2490,12 @@ cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_eop_memcairo() // // Memory device specific end of page. This copies the contents // of the cairo surface into the user supplied memory buffer. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_eop_memcairo( PLStream *pls ) { @@ -2555,13 +2555,13 @@ #endif -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is specific to the cairo external context driver. // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_extcairo ) @@ -2573,11 +2573,11 @@ void plD_esc_extcairo( PLStream *, PLINT, void * ); void plD_tidy_extcairo( PLStream * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // extcairo_setbackground() // // Set the background color for the extcairo device -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void extcairo_setbackground( PLStream *pls ) { @@ -2598,11 +2598,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // dispatch_init_init() // // Initialize device dispatch table -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // extcairo void plD_dispatch_init_extcairo( PLDispatchTable *pdt ) @@ -2623,11 +2623,11 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_extcairo; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_extcairo() // // Initialize Cairo external context driver. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_extcairo( PLStream *pls ) { @@ -2640,11 +2640,11 @@ pls->dev = aStream; } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_bop_extcairo() // // Set up for the next page. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_bop_extcairo( PLStream *pls ) { @@ -2659,11 +2659,11 @@ } } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_eop_extcairo() // // End of page. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_eop_extcairo( PLStream *pls ) { @@ -2671,12 +2671,12 @@ // (or not) the update cairo context. } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_esc_extcairo() // // The generic escape function, extended so that user can pass in // an external Cairo context to use for rendering. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_esc_extcairo( PLStream *pls, PLINT op, void *ptr ) { @@ -2709,12 +2709,12 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_tidy_extcairo() // // This is nop, it is up to the calling program to clean up the Cairo // context, etc... -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_tidy_extcairo( PLStream *pls ) { @@ -2723,16 +2723,16 @@ #endif -//--------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // // That which is specific to the cairo microsoft windows driver. // // Much of the Windows specific code here was lifted from the wingcc // driver. // -// --------------------------------------------------------------------- -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- #if defined ( PLD_wincairo ) @@ -2745,11 +2745,11 @@ void plD_esc_wincairo( PLStream *, PLINT, void * ); void plD_tidy_wincairo( PLStream * ); -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // blit_to_win() // // Blit the offscreen image to the Windows window. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void blit_to_win( PLCairo *aStream ) { @@ -2848,11 +2848,11 @@ return DefWindowProc( hwnd, nMsg, wParam, lParam ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // handle_locate() // // Handle getting the cursor location. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void handle_locate( PLStream *pls, PLGraphicsIn *gin ) @@ -2890,11 +2890,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // dispatch_init_init() // // Initialize device dispatch table -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // extcairo void plD_dispatch_init_wincairo( PLDispatchTable *pdt ) @@ -2915,11 +2915,11 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_wincairo; } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_wincairo() // // Initialize Cairo Microsoft Windows driver. -// ---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_wincairo( PLStream *pls ) { @@ -3046,11 +3046,11 @@ cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_eop_wincairo() // // Clean up Cairo Microsoft Windows driver. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_eop_wincairo( PLStream *pls ) @@ -3081,11 +3081,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_tidy_wincairo() // // Clean up Cairo Microsoft Windows driver. -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_tidy_wincairo( PLStream *pls ) { @@ -3105,11 +3105,11 @@ } } -//--------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_esc_wincairo() // // Escape function, specialized for the wincairo driver -// --------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_esc_wincairo( PLStream *pls, PLINT op, void *ptr ) { Modified: trunk/drivers/cgm.c =================================================================== --- trunk/drivers/cgm.c 2010-10-28 16:26:09 UTC (rev 11282) +++ trunk/drivers/cgm.c 2010-10-28 22:38:29 UTC (rev 11283) @@ -208,11 +208,11 @@ dev->last_line_colour = -1; // set to -1 = unallocated } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_cgm() // // Initialize device. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_cgm( PLStream *pls ) { @@ -283,11 +283,11 @@ plP_setphy( 0, dev->scale * dev->cgmx, 0, dev->scale * dev->cgmy ); } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_line_cgm() // // Draw a line in the current color from (x1,y1) to (x2,y2). -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_line_cgm( PLStream *pls, short x1a, short y1a, short x2a, short y2a ) @@ -312,11 +312,11 @@ cdLine( dev->im_out, x1, y1, x2, y2 ); } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_polyline_cgm() // // Draw a polyline in the current color. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_polyline_cgm( PLStream *pls, short *xa, short *ya, PLINT npts ) @@ -353,11 +353,11 @@ } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // fill_polygon() // // Fill polygon described in points pls->dev_x[] and pls->dev_y[]. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- static void fill_polygon( PLStream *pls ) @@ -416,11 +416,11 @@ free( points ); } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // setcmap() // // Sets up color palette. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- static void setcmap( PLStream *pls ) @@ -432,9 +432,9 @@ PLFLT tmp_colour_pos; cdImageColorClear( dev->im_out ); // UNDOCUMENTED FUNCTION TO RESET THE - // INTERNAL COLOUR TABLE OF THE - // CD DRIVER. Seems to work and fix - // the errors + // INTERNAL COLOUR TABLE OF THE + // CD DRIVER. Seems to work and fix + // the errors if ( ncol0 > cdMaxColors / 2 ) // Check for ridiculous number of colours { // in ncol0, and appropriately adjust the @@ -557,11 +557,11 @@ } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_state_cgm() // // Handle change in PLStream state (color, pen width, fill attribute, etc). -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_state_cgm( PLStream *pls, PLINT op ) @@ -624,11 +624,11 @@ } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_esc_cgm() // // Escape function. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_esc_cgm( PLStream *pls, PLINT op, void *ptr ) { @@ -640,12 +640,12 @@ } } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_bop_cgm() // // Set up for the next page. // Advance to next family file if necessary (file output). -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_bop_cgm( PLStream *pls ) { @@ -713,11 +713,11 @@ cdSetLineWidth( dev->im_out, pls->width ); // set initial line width for each page } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_tidy_cgm() // // Close graphics file or otherwise clean up. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_tidy_cgm( PLStream *pls ) { @@ -733,11 +733,11 @@ free_mem( pls->dev ); } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_eop_cgm() // // End of page. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_eop_cgm( PLStream *pls ) { Modified: trunk/drivers/gd.c =================================================================== --- trunk/drivers/gd.c 2010-10-28 16:26:09 UTC (rev 11282) +++ trunk/drivers/gd.c 2010-10-28 22:38:29 UTC (rev 11283) @@ -457,11 +457,11 @@ #endif } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_png() // // Initialize device. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_png( PLStream *pls ) { @@ -612,11 +612,11 @@ #endif } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_init_gif() // // Initialize device. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_init_gif( PLStream *pls ) { @@ -695,11 +695,11 @@ #endif -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_line_png() // // Draw a line in the current color from (x1,y1) to (x2,y2). -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_line_png( PLStream *pls, short x1a, short y1a, short x2a, short y2a ) @@ -724,11 +724,11 @@ #endif } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // plD_polyline_png() // // Draw a polyline in the current color. -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- void plD_polyline_png( PLStream *pls, short *xa, short *ya, PLINT npts ) @@ -740,11 +740,11 @@ } -//---------------------------------------------------------------------- +//-------------------------------------------------------------------------- // fill_polygon() // // Fill polygon described in poi... [truncated message content] |
From: <ai...@us...> - 2010-10-29 20:44:27
|
Revision: 11289 http://plplot.svn.sourceforge.net/plplot/?rev=11289&view=rev Author: airwin Date: 2010-10-29 20:44:17 +0000 (Fri, 29 Oct 2010) Log Message: ----------- Transform to new // style of commentary for fonts/*.c, utils/*.c, examples/c/*.[ch], and examples/tk/*.c. Modified Paths: -------------- trunk/examples/c/extXdrawable_demo.c trunk/examples/c/plcdemos.h trunk/examples/c/plplotcanvas_animation.c trunk/examples/c/plplotcanvas_demo.c trunk/examples/c/test_plend.c trunk/examples/c/tutor.c trunk/examples/c/x01c.c trunk/examples/c/x02c.c trunk/examples/c/x03c.c trunk/examples/c/x04c.c trunk/examples/c/x05c.c trunk/examples/c/x06c.c trunk/examples/c/x07c.c trunk/examples/c/x08c.c trunk/examples/c/x09c.c trunk/examples/c/x10c.c trunk/examples/c/x11c.c trunk/examples/c/x12c.c trunk/examples/c/x13c.c trunk/examples/c/x14c.c trunk/examples/c/x15c.c trunk/examples/c/x16c.c trunk/examples/c/x17c.c trunk/examples/c/x18c.c trunk/examples/c/x19c.c trunk/examples/c/x20c.c trunk/examples/c/x21c.c trunk/examples/c/x22c.c trunk/examples/c/x23c.c trunk/examples/c/x24c.c trunk/examples/c/x25c.c trunk/examples/c/x26c.c trunk/examples/c/x27c.c trunk/examples/c/x28c.c trunk/examples/c/x29c.c trunk/examples/c/x30c.c trunk/examples/c/x31c.c trunk/examples/c/x32c.c trunk/examples/tk/xtk01.c trunk/examples/tk/xtk02.c trunk/examples/tk/xtk04.c trunk/fonts/font01.c trunk/fonts/font02.c trunk/fonts/font03.c trunk/fonts/font04.c trunk/fonts/font05.c trunk/fonts/font06.c trunk/fonts/font07.c trunk/fonts/font08.c trunk/fonts/font09.c trunk/fonts/font10.c trunk/fonts/font11.c trunk/fonts/plhershey-unicode-gen.c trunk/fonts/stndfont.c trunk/fonts/xtndfont.c trunk/scripts/style_source.sh trunk/utils/plrender.c trunk/utils/pltcl.c trunk/utils/pltek.c trunk/utils/tektest.c trunk/utils/xform.c Modified: trunk/examples/c/extXdrawable_demo.c =================================================================== --- trunk/examples/c/extXdrawable_demo.c 2010-10-29 20:39:57 UTC (rev 11288) +++ trunk/examples/c/extXdrawable_demo.c 2010-10-29 20:44:17 UTC (rev 11289) @@ -1,38 +1,38 @@ -/* - * A simple GTK application demonstrating the use of the X Drawable - * functionality of plplot's xcairo driver. - * - * Copyright (C) 2008 Jonathan Woithe <jw...@ph...> - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// +// A simple GTK application demonstrating the use of the X Drawable +// functionality of plplot's xcairo driver. +// +// Copyright (C) 2008 Jonathan Woithe <jw...@ph...> +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// -/* Set to 0 to draw direct to an X Window, 1 to draw via a pixmap */ +// Set to 0 to draw direct to an X Window, 1 to draw via a pixmap #define TO_PIXMAP 1 #include <stdio.h> #include <plplot.h> #include <gtk/gtk.h> -/* Needed for GDK_WINDOW_XID */ +// Needed for GDK_WINDOW_XID #include <gdk/gdkx.h> -/* Main menu structure */ +// Main menu structure static GtkItemFactoryEntry menu_items[] = { { "/_File", NULL, NULL, 0, "<Branch>" }, { "/File/_Quit", "<control>Q", gtk_main_quit, 0, NULL }, @@ -50,7 +50,7 @@ App app; -/* ======================================================================== */ +// ======================================================================== void setup_plot_drawable( App *app ) { @@ -68,11 +68,11 @@ plinit(); #if TO_PIXMAP == 1 - /* Here we set up to draw to a pixmap */ + // Here we set up to draw to a pixmap xinfo.display = GDK_PIXMAP_XDISPLAY( app->plotwindow_pixmap ); xinfo.drawable = GDK_PIXMAP_XID( app->plotwindow_pixmap ); #else - /* Alternatively, we can do direct to a visible X Window */ + // Alternatively, we can do direct to a visible X Window xinfo.display = GDK_WINDOW_XDISPLAY( app->plotwindow->window ); xinfo.drawable = GDK_WINDOW_XID( app->plotwindow->window ); #endif @@ -83,25 +83,25 @@ plline( 3, x, y ); plend(); } -/* ======================================================================== */ +// ======================================================================== static gint ev_plotwindow_conf( GtkWidget *widget, GdkEventConfigure *ev, gpointer *data ) { #if TO_PIXMAP == 1 - /* Allocate pixmap */ + // Allocate pixmap if ( app.plotwindow_pixmap ) gdk_pixmap_unref( app.plotwindow_pixmap ); app.plotwindow_pixmap = gdk_pixmap_new( widget->window, widget->allocation.width, widget->allocation.height, -1 ); - /* Clear the pixmap to a sensible background colour */ + // Clear the pixmap to a sensible background colour gdk_draw_rectangle( app.plotwindow_pixmap, widget->style->black_gc, TRUE, 0, 0, widget->allocation.width, widget->allocation.height ); - /* If drawing to a pixmap we can do a plot from the conf handler since - * the pixmap is now realised (the window widget isn't). - */ + // If drawing to a pixmap we can do a plot from the conf handler since + // the pixmap is now realised (the window widget isn't). + // setup_plot_drawable( &app ); #endif @@ -111,25 +111,25 @@ static gint ev_plotwindow_expose( GtkWidget *widget, GdkEventExpose *ev, gpointer *data ) { #if TO_PIXMAP == 1 - /* Dump the cached plot (created in the conf handler) to the window from - * the pixmap. We don't need to recreate the plot on each expose. - */ + // Dump the cached plot (created in the conf handler) to the window from + // the pixmap. We don't need to recreate the plot on each expose. + // gdk_draw_pixmap( widget->window, widget->style->fg_gc[GTK_WIDGET_STATE( widget )], app.plotwindow_pixmap, ev->area.x, ev->area.y, ev->area.x, ev->area.y, ev->area.width, ev->area.height ); #else - /* If drawing direct to an X Window, ensure GTK's double buffering - * is turned off for that window or else the plot will be overridden - * when the buffer is dumped to the screen. - */ + // If drawing direct to an X Window, ensure GTK's double buffering + // is turned off for that window or else the plot will be overridden + // when the buffer is dumped to the screen. + // setup_plot_drawable( &app ); #endif return ( TRUE ); } -/* ======================================================================== */ +// ======================================================================== void init_app( App *app ) { @@ -140,16 +140,16 @@ GtkWidget *vbox, *hbox; - /* Create the top-level root window */ + // Create the top-level root window app->rootwindow = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_signal_connect( GTK_OBJECT( app->rootwindow ), "delete_event", gtk_main_quit, NULL ); - /* A toplevel box to hold things */ + // A toplevel box to hold things vbox = gtk_vbox_new( FALSE, 0 ); gtk_container_add( GTK_CONTAINER( app->rootwindow ), vbox ); - /* Construct the main menu structure */ + // Construct the main menu structure item_factory = gtk_item_factory_new( GTK_TYPE_MENU_BAR, "<main>", accel_group ); gtk_item_factory_create_items( item_factory, nitems, menu_items, NULL ); gtk_window_add_accel_group( GTK_WINDOW( app->rootwindow ), accel_group ); @@ -157,27 +157,27 @@ gtk_box_pack_start( GTK_BOX( vbox ), menubar, FALSE, FALSE, 0 ); gtk_widget_show( menubar ); - /* Fiddle with boxes to effect an indent from the edges of the root window */ + // Fiddle with boxes to effect an indent from the edges of the root window hbox = gtk_hbox_new( FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, TRUE, TRUE, 10 ); vbox = gtk_vbox_new( FALSE, 10 ); gtk_box_pack_start( GTK_BOX( hbox ), vbox, TRUE, TRUE, 10 ); - /* Add an area to plot into */ + // Add an area to plot into app->plotwindow = gtk_drawing_area_new(); app->plotwindow_pixmap = NULL; #if TO_PIXMAP != 1 - /* Turn off double buffering if we are plotting direct to the plotwindow - * in setup_plot_drawable(). - */ + // Turn off double buffering if we are plotting direct to the plotwindow + // in setup_plot_drawable(). + // GTK_WIDGET_UNSET_FLAGS( app->plotwindow, GTK_DOUBLE_BUFFERED ); #endif - /* By experiment, 3x3 seems to be the smallest size plplot can cope with. - * Here we utilise the side effect that gtk_widget_set_size_request() - * effectively sets the minimum size of the widget. - */ + // By experiment, 3x3 seems to be the smallest size plplot can cope with. + // Here we utilise the side effect that gtk_widget_set_size_request() + // effectively sets the minimum size of the widget. + // gtk_widget_set_size_request( app->plotwindow, 3, 3 ); gtk_box_pack_start( GTK_BOX( vbox ), app->plotwindow, TRUE, TRUE, 0 ); @@ -191,7 +191,7 @@ gtk_widget_show_all( app->rootwindow ); } -/* ======================================================================== */ +// ======================================================================== int main( int argc, char *argv[] ) { @@ -200,4 +200,4 @@ gtk_main(); return 0; } -/* ======================================================================== */ +// ======================================================================== Modified: trunk/examples/c/plcdemos.h =================================================================== --- trunk/examples/c/plcdemos.h 2010-10-29 20:39:57 UTC (rev 11288) +++ trunk/examples/c/plcdemos.h 2010-10-29 20:44:17 UTC (rev 11289) @@ -1,8 +1,8 @@ -/* $Id$ - * - * Everything needed by the C demo programs. - * Created to avoid junking up plplot.h with this stuff. - */ +// $Id$ +// +// Everything needed by the C demo programs. +// Created to avoid junking up plplot.h with this stuff. +// #ifndef __PLCDEMOS_H__ #define __PLCDEMOS_H__ @@ -14,9 +14,9 @@ #include "plConfig.h" #include "plplot.h" -/* define PI if not defined by math.h */ +// define PI if not defined by math.h -/* Actually M_PI seems to be more widely used so we deprecate PI. */ +// Actually M_PI seems to be more widely used so we deprecate PI. #ifndef PI #define PI 3.1415926535897932384 #endif @@ -25,7 +25,7 @@ #define M_PI 3.1415926535897932384 #endif -/* various utility macros */ +// various utility macros #ifndef MAX #define MAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) @@ -39,25 +39,25 @@ #define ROUND( a ) (PLINT) ( ( a ) < 0. ? ( ( a ) - .5 ) : ( ( a ) + .5 ) ) #endif -/* Declarations for save string functions */ +// Declarations for save string functions #ifdef PL_HAVE_SNPRINTF -/* In case only _snprintf is declared (as for Visual C++ and - * Borland compiler toolset) we redefine the function names */ +// In case only _snprintf is declared (as for Visual C++ and +// Borland compiler toolset) we redefine the function names #ifdef _PL_HAVE_SNPRINTF #define snprintf _snprintf #define snscanf _snscanf - #endif /* _PL_HAVE_SNPRINTF */ -#else /* !PL_HAVE_SNPRINTF */ -/* declare dummy functions which just call the unsafe - * functions ignoring the size of the string */ + #endif // _PL_HAVE_SNPRINTF +#else // !PL_HAVE_SNPRINTF +// declare dummy functions which just call the unsafe +// functions ignoring the size of the string int plsnprintf( char *buffer, int n, const char *format, ... ); int plsnscanf( const char *buffer, int n, const char *format, ... ); #define snprintf plsnprintf #define snscanf plsnscanf -#endif /* PL_HAVE_SNPRINTF */ +#endif // PL_HAVE_SNPRINTF -/* Add in missing isnan definition if required */ +// Add in missing isnan definition if required #if defined ( PL__HAVE_ISNAN ) # define isnan _isnan # if defined ( _MSC_VER ) @@ -69,4 +69,4 @@ # define isnan( x ) ( ( x ) != ( x ) ) #endif -#endif /* __PLCDEMOS_H__ */ +#endif // __PLCDEMOS_H__ Modified: trunk/examples/c/plplotcanvas_animation.c =================================================================== --- trunk/examples/c/plplotcanvas_animation.c 2010-10-29 20:39:57 UTC (rev 11288) +++ trunk/examples/c/plplotcanvas_animation.c 2010-10-29 20:44:17 UTC (rev 11289) @@ -1,45 +1,45 @@ -/* - * animation.c - Demonstrates the use of the plplot canvas widget with gtk. - * - * Copyright (C) 2004, 2005 Thomas J. Duck - * All rights reserved. - * - * Thomas J. Duck <tom...@da...> - * Department of Physics and Atmospheric Science, - * Dalhousie University, Halifax, Nova Scotia, Canada, B3H 3J5 - * - * $Author$ - * $Revision$ - * $Date$ - * $Name$ - * - * - * NOTICE - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - * - * - * DESCRIPTION - * - * This program demonstrates the use of the plplot canvas widget with gtk. - * Two graphs are draw in a window. When the Execute button is pressed, - * two different waves progress through the graph in real time. Plotting - * to the two graphs is handled in two different threads. - * - */ +// +// animation.c - Demonstrates the use of the plplot canvas widget with gtk. +// +// Copyright (C) 2004, 2005 Thomas J. Duck +// All rights reserved. +// +// Thomas J. Duck <tom...@da...> +// Department of Physics and Atmospheric Science, +// Dalhousie University, Halifax, Nova Scotia, Canada, B3H 3J5 +// +// $Author$ +// $Revision$ +// $Date$ +// $Name$ +// +// +// NOTICE +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +// MA 02110-1301 USA +// +// +// DESCRIPTION +// +// This program demonstrates the use of the plplot canvas widget with gtk. +// Two graphs are draw in a window. When the Execute button is pressed, +// two different waves progress through the graph in real time. Plotting +// to the two graphs is handled in two different threads. +// +// #include <glib.h> #include <gtk/gtk.h> @@ -49,18 +49,18 @@ #include <math.h> -/* The number of time steps */ +// The number of time steps #define STEPS 300 -/* The number of points and period for the first wave */ +// The number of points and period for the first wave #define NPTS 100 #define PERIOD 30 -/* The width and height for each plot widget */ +// The width and height for each plot widget #define WIDTH 800 #define HEIGHT 300 -/* Run the plots in different threads */ +// Run the plots in different threads GThread* thread0 = NULL; GThread* thread1 = NULL; typedef struct @@ -69,76 +69,76 @@ char * title; } ThreadData; ThreadData data0, data1; -gint Nthreads = 0; /* Count the number of threads */ +gint Nthreads = 0; // Count the number of threads -/* Create two different canvases */ +// Create two different canvases PlplotCanvas *canvas0 = NULL; PlplotCanvas *canvas1 = NULL; -/* Create the x and y array */ +// Create the x and y array static PLFLT x[NPTS], y[NPTS]; -/* Lock on the gtkstate so that we don't try to plot after gtk_main_quit */ +// Lock on the gtkstate so that we don't try to plot after gtk_main_quit #define GTKSTATE_CONTINUE ( TRUE ) #define GTKSTATE_QUIT (FALSE) G_LOCK_DEFINE_STATIC( gtkstate ); static volatile int gtkstate = GTKSTATE_CONTINUE; -/* setup_plot - preparation for plotting an animation to a canvas */ +// setup_plot - preparation for plotting an animation to a canvas void setup_plot( PlplotCanvas *canvas, char* title ) { - /* Set up the viewport and window */ + // Set up the viewport and window plplot_canvas_vsta( canvas ); plplot_canvas_wind( canvas, x[0], x[NPTS - 1], -2., 2. ); - /* Set the pen width */ + // Set the pen width plplot_canvas_wid( canvas, 2 ); - /* The axes should be persistent, so that they don't have to be - * replotted every time (which would slow down the animation) - */ + // The axes should be persistent, so that they don't have to be + // replotted every time (which would slow down the animation) + // plplot_canvas_use_persistence( canvas, TRUE ); - /* Draw the axes */ + // Draw the axes plplot_canvas_col0( canvas, 15 ); plplot_canvas_box( canvas, "bcnst", 0., 0, "bcnstv", 0., 0 ); plplot_canvas_lab( canvas, "(x)", "(y)", title ); - /* Prepare for plotting */ + // Prepare for plotting plplot_canvas_col0( canvas, plplot_canvas_get_stream_number( canvas ) + 8 ); - /* The animated data should not be persistent */ + // The animated data should not be persistent plplot_canvas_use_persistence( canvas, FALSE ); } -/* plot - draws a plot on a canvas */ +// plot - draws a plot on a canvas void plot( PlplotCanvas *canvas, gdouble offset, char* title ) { int i; guint Nstream; gdouble xmin, xmax, ymin, ymax; - /* Get the stream number */ + // Get the stream number Nstream = plplot_canvas_get_stream_number( canvas ); - /* Generate the sinusoid */ + // Generate the sinusoid for ( i = 0; i < NPTS; i++ ) y[i] = sin( 2. * 3.14 * ( x[i] + offset * ( Nstream + 1 ) ) / PERIOD / (PLFLT) ( Nstream + 1 ) ); - /* Draw the line */ + // Draw the line plplot_canvas_line( canvas, NPTS, x, y ); - /* Advance the page to finalize the plot */ + // Advance the page to finalize the plot plplot_canvas_adv( canvas, 0 ); } -/* Delete event callback */ +// Delete event callback gint delete_event_local( GtkWidget *widget, GdkEvent *event, gpointer data ) { return FALSE; } -/* Destroy event calback */ +// Destroy event calback void destroy_local( GtkWidget *widget, gpointer data ) { G_LOCK( gtkstate ); @@ -154,15 +154,15 @@ Nthreads++; - /* Draw STEPS plots in succession */ + // Draw STEPS plots in succession for ( i = 0; i < STEPS; i++ ) { gdk_threads_enter(); - /* Lock the current gtk state */ + // Lock the current gtk state G_LOCK( gtkstate ); - /* Check to make sure gtk hasn't quit */ + // Check to make sure gtk hasn't quit if ( gtkstate == GTKSTATE_QUIT ) { G_UNLOCK( gtkstate ); @@ -170,10 +170,10 @@ g_thread_exit( NULL ); } - /* Draw the plot */ + // Draw the plot plot( data->canvas, i, data->title ); - /* Release the lock */ + // Release the lock G_UNLOCK( gtkstate ); gdk_threads_leave(); } @@ -182,16 +182,16 @@ g_thread_exit( NULL ); } -/* Start threads callback from execute button */ +// Start threads callback from execute button void start_threads( GtkWidget *widget, gpointer data ) { GError **gerror; - /* Ignore call if threads are currently active */ + // Ignore call if threads are currently active if ( Nthreads ) return; - /* Create the two plotting threads */ + // Create the two plotting threads data0.canvas = canvas0; data0.title = "A phase-progressing wave"; if ( ( thread0 = g_thread_create( (GThreadFunc) plot_thread, &data0, TRUE, gerror ) ) \ @@ -226,44 +226,44 @@ GtkBox * vbox; - /* Parse the options */ + // Parse the options plparseopts( &argc, (const char **) argv, PL_PARSE_FULL ); - /* Initialize */ + // Initialize g_thread_init( NULL ); gdk_threads_init(); gtk_init( &argc, &argv ); g_type_init(); - /* Initialize the x array */ + // Initialize the x array for ( i = 0; i < NPTS; i++ ) x[i] = (PLFLT) i; - /* Create the first canvas, set its size, draw some axes on it, and - * place it in a frame - */ + // Create the first canvas, set its size, draw some axes on it, and + // place it in a frame + // canvas0 = plplot_canvas_new( TRUE ); plplot_canvas_set_size( canvas0, WIDTH, HEIGHT ); plplot_canvas_adv( canvas0, 0 ); setup_plot( canvas0, "A phase-progressing wave" ); - plplot_canvas_adv( canvas0, 0 ); /* Advance the page to finalize the plot */ + plplot_canvas_adv( canvas0, 0 ); // Advance the page to finalize the plot canvas0frame = GTK_FRAME( gtk_frame_new( NULL ) ); gtk_frame_set_shadow_type( canvas0frame, GTK_SHADOW_ETCHED_OUT ); gtk_container_add( GTK_CONTAINER( canvas0frame ), GTK_WIDGET( canvas0 ) ); - /* Create the second canvas, set its size, draw some axes on it, and - * place it in a frame - */ + // Create the second canvas, set its size, draw some axes on it, and + // place it in a frame + // canvas1 = plplot_canvas_new( TRUE ); plplot_canvas_set_size( canvas1, WIDTH, HEIGHT ); plplot_canvas_adv( canvas1, 0 ); setup_plot( canvas1, "Another phase-progressing wave" ); - plplot_canvas_adv( canvas1, 0 ); /* Advance the page to finalize the plot */ + plplot_canvas_adv( canvas1, 0 ); // Advance the page to finalize the plot canvas1frame = GTK_FRAME( gtk_frame_new( NULL ) ); gtk_frame_set_shadow_type( canvas1frame, GTK_SHADOW_ETCHED_OUT ); gtk_container_add( GTK_CONTAINER( canvas1frame ), GTK_WIDGET( canvas1 ) ); - /* Create a button and put it in a box */ + // Create a button and put it in a box button = GTK_BUTTON( gtk_button_new_from_stock( GTK_STOCK_EXECUTE ) ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( start_threads ), NULL ); @@ -271,30 +271,30 @@ buttonbox = GTK_BOX( gtk_hbox_new( FALSE, 0 ) ); gtk_box_pack_start( buttonbox, GTK_WIDGET( button ), TRUE, FALSE, 0 ); - /* Create and fill the vbox with the widgets */ + // Create and fill the vbox with the widgets vbox = GTK_BOX( gtk_vbox_new( FALSE, 0 ) ); gtk_box_pack_start( vbox, GTK_WIDGET( canvas0frame ), TRUE, FALSE, 0 ); gtk_box_pack_start( vbox, GTK_WIDGET( canvas1frame ), TRUE, FALSE, 10 ); gtk_box_pack_start( vbox, GTK_WIDGET( buttonbox ), TRUE, FALSE, 0 ); - /* Create a new window */ + // Create a new window window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - /* Set the border width of the window */ + // Set the border width of the window gtk_container_set_border_width( GTK_CONTAINER( window ), 10 ); - /* Connect the signal handlers to the window decorations */ + // Connect the signal handlers to the window decorations g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( delete_event_local ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy_local ), NULL ); - /* Put the vbox into the window */ + // Put the vbox into the window gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) ); - /* Display everything */ + // Display everything gtk_widget_show_all( window ); - /* Start the gtk main loop */ + // Start the gtk main loop gdk_threads_enter(); gtk_main(); gdk_threads_leave(); Modified: trunk/examples/c/plplotcanvas_demo.c =================================================================== --- trunk/examples/c/plplotcanvas_demo.c 2010-10-29 20:39:57 UTC (rev 11288) +++ trunk/examples/c/plplotcanvas_demo.c 2010-10-29 20:44:17 UTC (rev 11289) @@ -1,51 +1,51 @@ -/* - * demo.c - Demonstrates the simplest use of the plplot canvas widget with gtk. - * - * Copyright (C) 2004, 2005 Thomas J. Duck - * All rights reserved. - * - * Thomas J. Duck <tom...@da...> - * Department of Physics and Atmospheric Science, - * Dalhousie University, Halifax, Nova Scotia, Canada, B3H 3J5 - * - * $Author$ - * $Revision$ - * $Date$ - * $Name$ - * - * - * NOTICE - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ +// +// demo.c - Demonstrates the simplest use of the plplot canvas widget with gtk. +// +// Copyright (C) 2004, 2005 Thomas J. Duck +// All rights reserved. +// +// Thomas J. Duck <tom...@da...> +// Department of Physics and Atmospheric Science, +// Dalhousie University, Halifax, Nova Scotia, Canada, B3H 3J5 +// +// $Author$ +// $Revision$ +// $Date$ +// $Name$ +// +// +// NOTICE +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +// MA 02110-1301 USA +// #include <plplotcanvas.h> #include <gtk/gtk.h> -/* The width and height of the plplot canvas widget */ -#define WIDTH 1000 /* 500 */ -#define HEIGHT 600 /* 300 */ +// The width and height of the plplot canvas widget +#define WIDTH 1000 // 500 +#define HEIGHT 600 // 300 -/* Delete event callback */ +// Delete event callback gint delete_event_local( GtkWidget *widget, GdkEvent *event, gpointer data ) { return FALSE; } -/* Destroy event calback */ +// Destroy event calback void destroy_local( GtkWidget *widget, gpointer data ) { gtk_main_quit(); @@ -57,53 +57,53 @@ PlplotCanvas* canvas; GtkWidget *window; - /* Parse the options */ + // Parse the options plparseopts( &argc, (const char **) argv, PL_PARSE_FULL ); - /* The data to plot */ + // The data to plot double x[11] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; double y[11] = { 0, 0.1, 0.4, 0.9, 1.6, 2.6, 3.6, 4.9, 6.4, 8.1, 10 }; - /* Initialize gtk and the glib type system */ + // Initialize gtk and the glib type system gtk_init( &argc, &argv ); g_type_init(); - /* Create the canvas and set its size; during the creation process, - * the gcw driver is loaded into plplot, and plinit() is invoked. - */ + // Create the canvas and set its size; during the creation process, + // the gcw driver is loaded into plplot, and plinit() is invoked. + // canvas = plplot_canvas_new( TRUE ); plplot_canvas_set_size( canvas, WIDTH, HEIGHT ); - /* Create a new window and stuff the canvas into it */ + // Create a new window and stuff the canvas into it window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( canvas ) ); - /* Connect the signal handlers to the window decorations */ + // Connect the signal handlers to the window decorations g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( delete_event_local ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy_local ), NULL ); - /* Display everything */ + // Display everything gtk_widget_show_all( window ); - /* Draw on the canvas with Plplot */ - plplot_canvas_adv( canvas, 0 ); /* Advance to first page */ - plplot_canvas_col0( canvas, 15 ); /* Set color to black */ - plplot_canvas_wid( canvas, 2 ); /* Set the pen width */ - plplot_canvas_vsta( canvas ); /* Set the viewport */ - plplot_canvas_wind( canvas, 0., 10., 0., 10. ); /* Set the window */ - plplot_canvas_box( canvas, "bcnst", 0., 0, "bcnstv", 0., 0 ); /* Set the box */ - plplot_canvas_lab( canvas, "x-axis", "y-axis", "A Simple Plot" ); /* Draw some labels */ + // Draw on the canvas with Plplot + plplot_canvas_adv( canvas, 0 ); // Advance to first page + plplot_canvas_col0( canvas, 15 ); // Set color to black + plplot_canvas_wid( canvas, 2 ); // Set the pen width + plplot_canvas_vsta( canvas ); // Set the viewport + plplot_canvas_wind( canvas, 0., 10., 0., 10. ); // Set the window + plplot_canvas_box( canvas, "bcnst", 0., 0, "bcnstv", 0., 0 ); // Set the box + plplot_canvas_lab( canvas, "x-axis", "y-axis", "A Simple Plot" ); // Draw some labels - /* Draw the line */ - plplot_canvas_col0( canvas, 1 ); /* Set the pen color */ + // Draw the line + plplot_canvas_col0( canvas, 1 ); // Set the pen color plplot_canvas_line( canvas, 11, x, y ); - /* Advancing the page finalizes this plot */ + // Advancing the page finalizes this plot plplot_canvas_adv( canvas, 0 ); - /* Start the gtk main loop */ + // Start the gtk main loop gtk_main(); return 0; } Modified: trunk/examples/c/test_plend.c =================================================================== --- trunk/examples/c/test_plend.c 2010-10-29 20:39:57 UTC (rev 11288) +++ trunk/examples/c/test_plend.c 2010-10-29 20:44:17 UTC (rev 11289) @@ -1,24 +1,24 @@ -/* $Id$ - * - * plend and plend1 testing demo. - */ +// $Id$ +// +// plend and plend1 testing demo. +// #include "plcdemos.h" -/*--------------------------------------------------------------------------*\ - * main - * - * Demonstrates absolute positioning of graphs on a page. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// main +// +// Demonstrates absolute positioning of graphs on a page. +//-------------------------------------------------------------------------- int main( int argc, const char *argv[] ) { -/* Parse and process command line arguments */ +// Parse and process command line arguments (void) plparseopts( &argc, argv, PL_PARSE_FULL ); -/* Initialize plplot */ +// Initialize plplot plinit(); plenv( 0., 1., 0., 1., 1, 0 ); Modified: trunk/examples/c/tutor.c =================================================================== --- trunk/examples/c/tutor.c 2010-10-29 20:39:57 UTC (rev 11288) +++ trunk/examples/c/tutor.c 2010-10-29 20:44:17 UTC (rev 11289) @@ -1,75 +1,75 @@ -/* $Id$ - * - * Tony Richardson - * - * This program is intended to be used as a template for creating simple - * two-dimensional plotting programs which use the PLplot plotting - * library. The program was written with an emphasis on trying to clearly - * illustrate how to use the PLplot library functions. - * - * This program reads data for M lines with N points each from an input - * data file and plots them on the same graph using different symbols. It - * draws axes with labels and places a title at the top of the figure. A - * legend is drawn to the right of the figure. The input data file must - * have the following format: - * - * M N - * x[1] y[1][1] y[1][2] . . . y[1][M] - * x[2] y[2][1] y[2][2] . . . y[2][M] - * x[3] y[3][1] y[3][2] . . . y[3][M] - * . . . . . . . - * . . . . . . . - * . . . . . . . - * x[N] y[N][1] y[N][2] . . . y[N][M] - * - * (The first line contains the integer values M and N. The succeeding - * N lines contain the x-coordinate and the corresponding y-coordinates - * of each of the M lines.) - */ +// $Id$ +// +// Tony Richardson +// +// This program is intended to be used as a template for creating simple +// two-dimensional plotting programs which use the PLplot plotting +// library. The program was written with an emphasis on trying to clearly +// illustrate how to use the PLplot library functions. +// +// This program reads data for M lines with N points each from an input +// data file and plots them on the same graph using different symbols. It +// draws axes with labels and places a title at the top of the figure. A +// legend is drawn to the right of the figure. The input data file must +// have the following format: +// +// M N +// x[1] y[1][1] y[1][2] . . . y[1][M] +// x[2] y[2][1] y[2][2] . . . y[2][M] +// x[3] y[3][1] y[3][2] . . . y[3][M] +// . . . . . . . +// . . . . . . . +// . . . . . . . +// x[N] y[N][1] y[N][2] . . . y[N][M] +// +// (The first line contains the integer values M and N. The succeeding +// N lines contain the x-coordinate and the corresponding y-coordinates +// of each of the M lines.) +// #include "plcdemos.h" static int error( char *str ); -/* - * You can select a different set of symbols to use when plotting the - * lines by changing the value of OFFSET. - */ +// +// You can select a different set of symbols to use when plotting the +// lines by changing the value of OFFSET. +// #define OFFSET 2 int main( int argc, char *argv[] ) { -/* ============== Begin variable definition section. ============= */ +// ============== Begin variable definition section. ============= -/* - * i, j, and k are counting variables used in loops and such. M is the - * number of lines to be plotted and N is the number of sample points - * for each line. - */ +// +// i, j, and k are counting variables used in loops and such. M is the +// number of lines to be plotted and N is the number of sample points +// for each line. +// int i, j, k, M, N, leglen; -/* - * x is a pointer to an array containing the N x-coordinate values. y - * points to an array of M pointers each of which points to an array - * containing the N y-coordinate values for that line. - */ +// +// x is a pointer to an array containing the N x-coordinate values. y +// points to an array of M pointers each of which points to an array +// containing the N y-coordinate values for that line. +// PLFLT *x, **y; -/* Define storage for the min and max values of the data. */ +// Define storage for the min and max values of the data. PLFLT xmin, xmax, ymin, ymax, xdiff, ydiff; -/* Define storage for the filename and define the input file pointer. */ +// Define storage for the filename and define the input file pointer. char filename[80], string[80], tmpstr[80]; FILE *datafile; -/* Here are the character strings that appear in the plot legend. */ +// Here are the character strings that appear in the plot legend. static char *legend[] = { @@ -77,32 +77,32 @@ "Gnus", "Llamas", NULL - }; /* Make sure last element is NULL */ + }; // Make sure last element is NULL -/* ============== Read in data from input file. ============= */ +// ============== Read in data from input file. ============= -/* Parse and process command line arguments */ +// Parse and process command line arguments (void) plparseopts( &argc, argv, PL_PARSE_FULL ); -/* First prompt the user for the input data file name */ +// First prompt the user for the input data file name printf( "Enter input data file name. " ); scanf( "%s", filename ); -/* and open the file. */ +// and open the file. datafile = fopen( filename, "r" ); - if ( datafile == NULL ) /* error opening input file */ + if ( datafile == NULL ) // error opening input file error( "Error opening input file." ); -/* Read in values of M and N */ +// Read in values of M and N k = fscanf( datafile, "%d %d", &M, &N ); - if ( k != 2 ) /* something's wrong */ + if ( k != 2 ) // something's wrong error( "Error while reading data file." ); -/* Allocate memory for all the arrays. */ +// Allocate memory for all the arrays. x = (PLFLT *) malloc( N * sizeof ( PLFLT ) ); if ( x == NULL ) @@ -117,14 +117,14 @@ error( "Out of memory!" ); } -/* Now read in all the data. */ +// Now read in all the data. - for ( i = 0; i < N; i++ ) /* N points */ + for ( i = 0; i < N; i++ ) // N points { k = fscanf( datafile, "%f", &x[i] ); if ( k != 1 ) error( "Error while reading data file." ); - for ( j = 0; j < M; j++ ) /* M lines */ + for ( j = 0; j < M; j++ ) // M lines { k = fscanf( datafile, "%f", &y[j][i] ); if ( k != 1 ) @@ -132,43 +132,43 @@ } } -/* ============== Graph the data. ============= */ +// ============== Graph the data. ============= -/* Set graph to portrait orientation. (Default is landscape.) */ -/* (Portrait is usually desired for inclusion in TeX documents.) */ +// Set graph to portrait orientation. (Default is landscape.) +// (Portrait is usually desired for inclusion in TeX documents.) plsori( 1 ); -/* Initialize plplot */ +// Initialize plplot plinit(); -/* - * We must call pladv() to advance to the first (and only) subpage. - * You might want to use plenv() instead of the pladv(), plvpor(), - * plwind() sequence. - */ +// +// We must call pladv() to advance to the first (and only) subpage. +// You might want to use plenv() instead of the pladv(), plvpor(), +// plwind() sequence. +// pladv( 0 ); -/* - * Set up the viewport. This is the window into which the data is - * plotted. The size of the window can be set with a call to - * plvpor(), which sets the size in terms of normalized subpage - * coordinates. I want to plot the lines on the upper half of the - * page and I want to leave room to the right of the figure for - * labelling the lines. We must also leave room for the title and - * labels with plvpor(). Normally a call to plvsta() can be used - * instead. - */ +// +// Set up the viewport. This is the window into which the data is +// plotted. The size of the window can be set with a call to +// plvpor(), which sets the size in terms of normalized subpage +// coordinates. I want to plot the lines on the upper half of the +// page and I want to leave room to the right of the figure for +// labelling the lines. We must also leave room for the title and +// labels with plvpor(). Normally a call to plvsta() can be used +// instead. +// plvpor( 0.15, 0.70, 0.5, 0.9 ); -/* - * We now need to define the size of the window in user coordinates. - * To do this, we first need to determine the range of the data - * values. - */ +// +// We now need to define the size of the window in user coordinates. +// To do this, we first need to determine the range of the data +// values. +// xmin = xmax = x[0]; ymin = ymax = y[0][0]; @@ -187,34 +187,34 @@ } } -/* - * Now set the size of the window. Leave a small border around the - * data. - */ +// +// Now set the size of the window. Leave a small border around the +// data. +// xdiff = ( xmax - xmin ) / 20.; ydiff = ( ymax - ymin ) / 20.; plwind( xmin - xdiff, xmax + xdiff, ymin - ydiff, ymax + ydiff ); -/* - * Call plbox() to draw the axes (see the PLPLOT manual for - * information about the option strings.) - */ +// +// Call plbox() to draw the axes (see the PLPLOT manual for +// information about the option strings.) +// plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); -/* - * Label the axes and title the graph. The string "#gm" plots the - * Greek letter mu, all the Greek letters are available, see the - * PLplot manual. - */ +// +// Label the axes and title the graph. The string "#gm" plots the +// Greek letter mu, all the Greek letters are available, see the +// PLplot manual. +// pllab( "Time (weeks)", "Height (#gmparsecs)", "Specimen Growth Rate" ); -/* - * Plot the data. plpoin() draws a symbol at each point. plline() - * connects all the points. - */ +// +// Plot the data. plpoin() draws a symbol at each point. plline() +// connects all the points. +// for ( i = 0; i < M; i++ ) { @@ -222,11 +222,11 @@ plline( N, x, y[i] ); } -/* - * Draw legend to the right of the chart. Things get a little messy - * here. You may want to remove this section if you don't want a - * legend drawn. First find length of longest string. - */ +// +// Draw legend to the right of the chart. Things get a little messy +// here. You may want to remove this section if you don't want a +// legend drawn. First find length of longest string. +// leglen = 0; for ( i = 0; i < M; i++ ) @@ -238,11 +238,11 @@ leglen = j; } -/* - * Now build the string. The string consists of an element from the - * legend string array, padded with spaces, followed by one of the - * symbols used in plpoin above. - */ +// +// Now build the string. The string consists of an element from the +// legend string array, padded with spaces, followed by one of the +// symbols used in plpoin above. +// for ( i = 0; i < M; i++ ) { @@ -250,33 +250,33 @@ break; strcpy( string, legend[i] ); j = strlen( string ); - if ( j < leglen ) /* pad string with spaces */ + if ( j < leglen ) // pad string with spaces { for ( k = j; k < leglen; k++ ) string[k] = ' '; string[k] = '\0'; } - /* pad an extra space */ + // pad an extra space strcat( string, " " ); j = strlen( string ); - /* insert the ASCII value of the symbol plotted with plpoin() */ + // insert the ASCII value of the symbol plotted with plpoin() string[j] = i + OFFSET; string[j + 1] = '\0'; - /* plot the string */ + // plot the string plmtex( "rv", 1., 1. - (double) ( i + 1 ) / ( M + 1 ), 0., string ); } -/* Tell plplot we are done with this page. */ +// Tell plplot we are done with this page. - pladv( 0 ); /* advance page */ + pladv( 0 ); // advance page -/* Don't forget to call plend() to finish off! */ +// Don't forget to call plend() to finish off! plend(); exit( 0 ); Modified: trunk/examples/c/x01c.c =================================================================== --- trunk/examples/c/x01c.c 2010-10-29 20:39:57 UTC (rev 11288) +++ trunk/examples/c/x01c.c 2010-10-29 20:44:17 UTC (rev 11289) @@ -1,26 +1,26 @@ -/* $Id$ - * - * Simple line plot and multiple windows demo. - * - * Copyright (C) 2004 Rafael Laboissiere - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// $Id$ +// +// Simple line plot and multiple windows demo. +// +// Copyright (C) 2004 Rafael Laboissiere +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// #include "plcdemos.h" #include "plevent.h" @@ -28,7 +28,7 @@ # include <unistd.h> #endif -/* Variables and data arrays used by plot generators */ +// Variables and data arrays used by plot generators static PLFLT x[101], y[101]; static PLFLT xscale, yscale, xoff, yoff, xs[6], ys[6]; @@ -39,11 +39,11 @@ static int fontset = 1; static char *f_name = NULL; -/* Options data structure definition. */ +// Options data structure definition. static PLOptionTable options[] = { { - "locate", /* Turns on test of API locate function */ + "locate", // Turns on test of API locate function NULL, NULL, &locate_mode, @@ -52,7 +52,7 @@ "Turns on test of API locate function" }, { - "xor", /* Turns on test of xor function */ + "xor", // Turns on test of xor function NULL, NULL, &test_xor, @@ -61,7 +61,7 @@ "Turns on test of XOR" }, { - "font", /* For switching between font set 1 & 2 */ + "font", // For switching between font set 1 & 2 NULL, NULL, &fontset, @@ -70,7 +70,7 @@ "Selects stroke font set (0 or 1, def:1)" }, { - "save", /* For saving in postscript */ + "save", // For saving in postscript NULL, NULL, &f_name, @@ -79,35 +79,35 @@ "Save plot in color postscript `file'" }, { - NULL, /* option */ - NULL, /* handler */ - NULL, /* client data */ - NULL, /* address of variable to set */ - 0, /* mode flag */ - NULL, /* short syntax */ + NULL, // option + NULL, // handler + NULL, // client data + NULL, // address of variable to set + 0, // mode flag + NULL, // short syntax NULL - } /* long syntax */ + } // long syntax }; const char *notes[] = { "Make sure you get it right!", NULL }; -/* Function prototypes */ +// Function prototypes void plot1( int ); void plot2( void ); void plot3( void ); -/*--------------------------------------------------------------------------*\ - * main - * - * Generates several simple line plots. Demonstrates: - * - subwindow capability - * - setting up the window, drawing plot, and labelling - * - changing the color - * - automatic axis rescaling to exponential notation - * - placing the axes in the middle of the box - * - gridded coordinate axes - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// main +// +// Generates several simple line plots. Demonstrates: +// - subwindow capability +// - setting up the window, drawing plot, and labelling +// - changing the color +// - automatic axis rescaling to exponential notation +// - placing the axes in the middle of the box +// - gridded coordinate axes +//-------------------------------------------------------------------------- int main( int argc, const char *argv[] ) @@ -115,49 +115,49 @@ PLINT digmax, cur_strm, new_strm; char ver[80]; -/* plplot initialization */ +// plplot initialization -/* Parse and process command line arguments */ +// Parse and process command line arguments plMergeOpts( options, "x01c options", notes ); plparseopts( &argc, argv, PL_PARSE_FULL ); -/* Get version number, just for kicks */ +// Get version number, just for kicks plgver( ver ); fprintf( stdout, "PLplot library version: %s\n", ver ); -/* Initialize plplot */ -/* Divide page into 2x2 plots */ -/* Note: calling plstar replaces separate calls to plssub and plinit */ +// Initialize plplot +// Divide page into 2x2 plots +// Note: calling plstar replaces separate calls to plssub and plinit plstar( 2, 2 ); -/* Select font set as per input flag */ +// Select font set as per input flag if ( fontset ) plfontld( 1 ); else plfontld( 0 ); -/* Set up the data */ -/* Original case */ +// Set up the data +// Original case xscale = 6.; yscale = 1.; xoff = 0.; yoff = 0.; -/* Do a plot */ +// Do a plot plot1( 0 ); -/* Set up the data */ +// Set up the data xscale = 1.; yscale = 0.0014; yoff = 0.0185; -/* Do a plot */ +// Do a plot digmax = 5; plsyax( digmax, 0 ); @@ -168,30 +168,30 @@ plot3(); - /* - * Show how to save a plot: - * Open a new device, make it current, copy parameters, - * and replay the plot buffer - */ + // + // Show how to save a plot: + // Open a new device, make it current, copy parameters, + // and replay the plot buffer + // - if ( f_name ) /* command line option '-save filename' */ + if ( f_name ) // command line option '-save filename' { printf( "The current plot was saved in color Postscript under the name `%s'.\n", f_name ); - plgstrm( &cur_strm ); /* get current stream */ - plmkstrm( &new_strm ); /* create a new one */ + plgstrm( &cur_strm ); // get current stream + plmkstrm( &new_strm ); // create a new one - plsfnam( f_name ); /* file name */ - plsdev( "psc" ); /* device type */ + plsfnam( f_name ); // file name + plsdev( "psc" ); // device type - plcpstrm( cur_strm, 0 ); /* copy old stream parameters to new stream */ - plreplot(); /* do the save by replaying the plot buffer */ - plend1(); /* finish the device */ + plcpstrm( cur_strm, 0 ); // copy old stream parameters to new stream + plreplot(); // do the save by replaying the plot buffer + plend1(); // finish the device - plsstrm( cur_strm ); /* return to previous stream */ + plsstrm( cur_strm ); // return to previous stream } -/* Let's get some user input */ +// Let's get some user input if ( locate_mode ) { @@ -214,13 +214,13 @@ } } -/* Don't forget to call plend() to finish off! */ +// Don't forget to call plend() to finish off! plend(); exit( 0 ); } -/* =============================================================== */ +// =============================================================== void plot1( int do_test ) @@ -245,44 +245,44 @@ ys[i] = y[i * 10 + 3]; } -/* Set up the viewport and window using PLENV. The range in X is - * 0.0 to 6.0, and the range in Y is 0.0 to 30.0. The axes are - * scaled separately (just = 0), and we just draw a labelled - * box (axis = 0). - */ +// Set up the viewport and window using PLENV. The range in X is +// 0.0 to 6.0, and the range in Y is 0.0 to 30.0. The axes are +// scaled separately (just = 0), and we just draw a labelled +// box (axis = 0). +// plcol0( 1 ); plenv( xmin, xmax, ymin, ymax, 0, 0 ); plcol0( 2 ); pllab( "(x)", "(y)", "#frPLplot Example 1 - y=x#u2" ); -/* Plot the data points */ +// Plot the data points plcol0( 4 ); plpoin( 6, xs, ys, 9 ); -/* Draw the line through the data */ +// Draw the line through the data plcol0( 3 ); plline( 60, x, y ); -/* xor mode enable erasing a line/point/text by replotting it again */ -/* it does not work in double buffering mode, however */ +// xor mode enable erasing a line/point/text by replotting it again +// it does not work in double buffering mode, however if ( do_test && test_xor ) { #ifdef PL_HAVE_USLEEP PLINT st; - plxormod( 1, &st ); /* enter xor mode */ + plxormod( 1, &st ); // enter xor mode if ( st ) { for ( i = 0; i < 60; i++ ) { - plpoin( 1, x + i, y + i, 9 ); /* draw a point */ - usleep( 50000 ); /* wait a little */ - plflush(); /* force an update of the tk driver */ - plpoin( 1, x + i, y + i, 9 ); /* erase point */ + plpoin( 1, x + i, y + i, 9 ); // draw a point + usleep( 50000 ); // wait a little + plflush(); // force an update of the tk driver + plpoin( 1, x + i, y + i, 9 ); // erase point } - plxormod( 0, &st ); /* leave xor mode */ + plxormod( 0, &st ); // leave xor mode } #else printf( "The -xor command line option can only be exercised if your " @@ -291,23 +291,23 @@ } } -/* =============================================================== */ +// =============================================================== void plot2( void ) { int i; -/* Set up the viewport and window using PLENV. The range in X is -2.0 to - * 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately - * (just = 0), and we draw a box with axes (axis = 1). - */ +// Set up the viewport and window using PLENV. The range in X is -2.0 to +// 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately +// (just = 0), and we draw a box with axes (axis = 1). +// plcol0( 1 ); plenv( -2.0, 10.0, -0.4, 1.2, 0, 1 ); plcol0( 2 ); pllab( "(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function" ); -/* Fill up the arrays */ +// Fill up the arrays for ( i = 0; i < 100; i++ ) { @@ -317,7 +317,7 @@ y[i] = sin( x[i] ) / x[i]; } -/* Draw the line */ +// Draw the line plcol0( 3 ); plwid( 2 ); @@ -325,7 +325,7 @@ plwid( 1 ); } -/* =============================================================== */ +// =============================================================== void plot3( void ) @@ -333,25 +333,25 @@ PLINT space0 = 0, mark0 = 0, space1 = 1500, mark1 = 1500; int i; -/* For the final graph we wish to override the default tick intervals, and - * so do not use plenv(). - */ +// For the final graph we wish to override the default tick intervals, and +// so do not use plenv(). +// pladv( 0 ); -/* Use standard viewport, and define X range from 0 to 360 degrees, Y range - * from -1.2 to 1.2. - */ +// Use standard viewport, and define X range from 0 to 360 degrees, Y range +// from -1.2 to 1.2. +// plvsta(); plwind( 0.0, 360.0, -1.2, 1.2 ); -/* Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. */ +// Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. plcol0( 1 ); plbox( "bcnst", 60.0, 2, "bcnstv", 0.2, 2 ); -/* Superimpose a dashed line grid, with 1.5 mm marks and spaces. - * plstyl expects a pointer! - */ +// Superimpose a dashed line grid, with 1.5 mm marks and spaces. +// plstyl expects a pointer! +// plstyl( 1, &mark1, &space1 ); plcol0( 2 ); plbox( "g", 30.0, 0, "g", 0.2, 0 ); Modified: trunk/examples/c/x02c.c =================================================================== --- trunk/examples/c/x02c.c 2010-10-29 20:39:57 UTC (rev 11288) +++ trunk/examples/c/x02c.c 2010-10-29 20:44:17 UTC (rev 11289) @@ -1,16 +1,16 @@ -/* $Id$ - * - * Multiple window and color map 0 demo. - */ +// $Id$ +// +// Multiple window and color map 0 demo. +// #include "plcdemos.h" -/*--------------------------------------------------------------------------*\ - * main - * - * Demonstrates multiple windows and color map 0 palette, both default and - * user-modified. - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// main +// +// Demonstrates multiple windows and color map 0 palette, both default and +// user-modified. +//-------------------------------------------------------------------------- void demo1(); void demo2(); @@ -19,13 +... [truncated message content] |
From: <ai...@us...> - 2010-10-29 20:48:29
|
Revision: 11290 http://plplot.svn.sourceforge.net/plplot/?rev=11290&view=rev Author: airwin Date: 2010-10-29 20:48:22 +0000 (Fri, 29 Oct 2010) Log Message: ----------- Convert non-standard "horizontal rule" comment made with "=" to standard form of "horizontal rule" comment. Modified Paths: -------------- trunk/examples/c/extXdrawable_demo.c trunk/examples/c/x01c.c trunk/examples/c/x14c.c trunk/examples/c/x27c.c trunk/examples/tk/xtk01.c trunk/examples/tk/xtk02.c trunk/include/gcw.h trunk/scripts/convert_comment.py Modified: trunk/examples/c/extXdrawable_demo.c =================================================================== --- trunk/examples/c/extXdrawable_demo.c 2010-10-29 20:44:17 UTC (rev 11289) +++ trunk/examples/c/extXdrawable_demo.c 2010-10-29 20:48:22 UTC (rev 11290) @@ -50,7 +50,7 @@ App app; -// ======================================================================== +//-------------------------------------------------------------------------- void setup_plot_drawable( App *app ) { @@ -83,7 +83,7 @@ plline( 3, x, y ); plend(); } -// ======================================================================== +//-------------------------------------------------------------------------- static gint ev_plotwindow_conf( GtkWidget *widget, GdkEventConfigure *ev, gpointer *data ) { @@ -129,7 +129,7 @@ return ( TRUE ); } -// ======================================================================== +//-------------------------------------------------------------------------- void init_app( App *app ) { @@ -191,7 +191,7 @@ gtk_widget_show_all( app->rootwindow ); } -// ======================================================================== +//-------------------------------------------------------------------------- int main( int argc, char *argv[] ) { @@ -200,4 +200,4 @@ gtk_main(); return 0; } -// ======================================================================== +//-------------------------------------------------------------------------- Modified: trunk/examples/c/x01c.c =================================================================== --- trunk/examples/c/x01c.c 2010-10-29 20:44:17 UTC (rev 11289) +++ trunk/examples/c/x01c.c 2010-10-29 20:48:22 UTC (rev 11290) @@ -220,7 +220,7 @@ exit( 0 ); } -// =============================================================== +//-------------------------------------------------------------------------- void plot1( int do_test ) @@ -291,7 +291,7 @@ } } -// =============================================================== +//-------------------------------------------------------------------------- void plot2( void ) @@ -325,7 +325,7 @@ plwid( 1 ); } -// =============================================================== +//-------------------------------------------------------------------------- void plot3( void ) Modified: trunk/examples/c/x14c.c =================================================================== --- trunk/examples/c/x14c.c 2010-10-29 20:44:17 UTC (rev 11289) +++ trunk/examples/c/x14c.c 2010-10-29 20:48:22 UTC (rev 11290) @@ -173,7 +173,7 @@ exit( 0 ); } -// =============================================================== +//-------------------------------------------------------------------------- void plot1( void ) @@ -221,7 +221,7 @@ } -// =============================================================== +//-------------------------------------------------------------------------- void plot2( void ) @@ -254,7 +254,7 @@ plflush(); } -// =============================================================== +//-------------------------------------------------------------------------- void plot3( void ) @@ -299,7 +299,7 @@ plflush(); } -// =============================================================== +//-------------------------------------------------------------------------- void plot4( void ) @@ -371,7 +371,7 @@ plflush(); } -// =============================================================== +//-------------------------------------------------------------------------- // Demonstration of contour plotting Modified: trunk/examples/c/x27c.c =================================================================== --- trunk/examples/c/x27c.c 2010-10-29 20:44:17 UTC (rev 11289) +++ trunk/examples/c/x27c.c 2010-10-29 20:48:22 UTC (rev 11290) @@ -97,7 +97,7 @@ exit( 0 ); } -// =============================================================== +//-------------------------------------------------------------------------- void cycloid( void ) @@ -105,7 +105,7 @@ // TODO } -// =============================================================== +//-------------------------------------------------------------------------- void spiro( PLFLT params[] ) Modified: trunk/examples/tk/xtk01.c =================================================================== --- trunk/examples/tk/xtk01.c 2010-10-29 20:44:17 UTC (rev 11289) +++ trunk/examples/tk/xtk01.c 2010-10-29 20:48:22 UTC (rev 11290) @@ -116,7 +116,7 @@ return TCL_OK; } -// =============================================================== +//-------------------------------------------------------------------------- // Taken from: // x01c.c @@ -174,7 +174,7 @@ plot3(); } -// =============================================================== +//-------------------------------------------------------------------------- void plot1( void ) @@ -220,7 +220,7 @@ plline( 60, x, y ); } -// =============================================================== +//-------------------------------------------------------------------------- void plot2( void ) @@ -252,7 +252,7 @@ plline( 100, x, y ); } -// =============================================================== +//-------------------------------------------------------------------------- void plot3( void ) @@ -296,7 +296,7 @@ plline( 101, x, y ); } -// =============================================================== +//-------------------------------------------------------------------------- // Taken from: // x16c.c @@ -479,7 +479,7 @@ } } } -// =============================================================== +//-------------------------------------------------------------------------- int myplotCmd( ClientData cd, Tcl_Interp *interp, int argc, char **argv ) { Modified: trunk/examples/tk/xtk02.c =================================================================== --- trunk/examples/tk/xtk02.c 2010-10-29 20:44:17 UTC (rev 11289) +++ trunk/examples/tk/xtk02.c 2010-10-29 20:48:22 UTC (rev 11290) @@ -210,7 +210,7 @@ plot3(); } -// =============================================================== +//-------------------------------------------------------------------------- void plot1( void ) @@ -256,7 +256,7 @@ plline( 60, x, y ); } -// =============================================================== +//-------------------------------------------------------------------------- void plot2( void ) @@ -288,7 +288,7 @@ plline( 100, x, y ); } -// =============================================================== +//-------------------------------------------------------------------------- void plot3( void ) Modified: trunk/include/gcw.h =================================================================== --- trunk/include/gcw.h 2010-10-29 20:44:17 UTC (rev 11289) +++ trunk/include/gcw.h 2010-10-29 20:48:22 UTC (rev 11290) @@ -45,7 +45,7 @@ // #define ASSERT_GCW -//========================================================================= +//-------------------------------------------------------------------------- // GcwPLdev - the PLplot device structure for the GCW driver typedef struct @@ -89,7 +89,7 @@ } GcwPLdev; -//========================================================================= +//-------------------------------------------------------------------------- // Physical dimension constants used by the driver // Virtual coordinate scaling parameter, used to do calculations at @@ -122,7 +122,7 @@ #define ZOOMSTEP ( 1.25 ) -//========================================================================= +//-------------------------------------------------------------------------- // GCW "Gnome Canvas Widget" Library prototypes (see gcw-lib.c) // Public_functions Modified: trunk/scripts/convert_comment.py =================================================================== --- trunk/scripts/convert_comment.py 2010-10-29 20:44:17 UTC (rev 11289) +++ trunk/scripts/convert_comment.py 2010-10-29 20:48:22 UTC (rev 11290) @@ -174,7 +174,7 @@ # Remove "*\" from end of comment lines line = re.sub(r'^//(.*)\*\\$', "//\\1", line) # Convert long "horizontal line" comment forms to standard form. - line = re.sub(r'^// *[-* ]{50,200}$', "//--------------------------------------------------------------------------", line) + line = re.sub(r'^// *[-*= ]{50,200}$', "//--------------------------------------------------------------------------", line) # Look for trailing continuation after comment lines and # complain if you find any. start_special = line.rfind("\\") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-01 19:54:33
|
Revision: 11293 http://plplot.svn.sourceforge.net/plplot/?rev=11293&view=rev Author: airwin Date: 2010-11-01 19:54:24 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Drop INDENT OFF and ON directives to uncrustify where no longer needed. Modified Paths: -------------- trunk/drivers/linuxvga.c trunk/lib/nn/nnai.c trunk/src/plcont.c Modified: trunk/drivers/linuxvga.c =================================================================== --- trunk/drivers/linuxvga.c 2010-10-30 21:21:12 UTC (rev 11292) +++ trunk/drivers/linuxvga.c 2010-11-01 19:54:24 UTC (rev 11293) @@ -22,7 +22,6 @@ // Function prototypes -// INDENT OFF void plD_init_vga( PLStream * ); void plD_line_vga( PLStream *, short, short, short, short ); @@ -37,8 +36,6 @@ static void lxvga_graph( PLStream *pls ); static void lxvga_pause( PLStream *pls ); -// INDENT ON - static PLINT vgax = 639; static PLINT vgay = 479; Modified: trunk/lib/nn/nnai.c =================================================================== --- trunk/lib/nn/nnai.c 2010-10-30 21:21:12 UTC (rev 11292) +++ trunk/lib/nn/nnai.c 2010-11-01 19:54:24 UTC (rev 11293) @@ -196,21 +196,19 @@ - 0.2 * exp( -SQ( x - 4.0 ) - SQ( y - 7.0 ) ); } -// *INDENT-OFF* static void usage() { printf( -"Usage: nn_test [-v|-V] [-n <nin> <nxout>]\n" -"Options:\n" -" -a -- use non-Sibsonian interpolation rule\n" -" -n <nin> <nout>:\n" -" <nin> -- number of input points (default = 10000)\n" -" <nout> -- number of output points per side (default = 64)\n" -" -v -- verbose\n" -" -V -- very verbose\n" -); + "Usage: nn_test [-v|-V] [-n <nin> <nxout>]\n" + "Options:\n" + " -a -- use non-Sibsonian interpolation rule\n" + " -n <nin> <nout>:\n" + " <nin> -- number of input points (default = 10000)\n" + " <nout> -- number of output points per side (default = 64)\n" + " -v -- verbose\n" + " -V -- very verbose\n" + ); } -// *INDENT-ON* int main( int argc, char* argv[] ) { Modified: trunk/src/plcont.c =================================================================== --- trunk/src/plcont.c 2010-10-30 21:21:12 UTC (rev 11292) +++ trunk/src/plcont.c 2010-11-01 19:54:24 UTC (rev 11293) @@ -1458,13 +1458,11 @@ yrl = *( yg + ur + vl * nx ); ylr = *( yg + ul + vr * nx ); yrr = *( yg + ur + vr * nx ); -// INDENT OFF *tx = xll * ( 1 - du ) * ( 1 - dv ) + xlr * ( 1 - du ) * ( dv ) + xrl * ( du ) * ( 1 - dv ) + xrr * ( du ) * ( dv ); *ty = yll * ( 1 - du ) * ( 1 - dv ) + ylr * ( 1 - du ) * ( dv ) + yrl * ( du ) * ( 1 - dv ) + yrr * ( du ) * ( dv ); -// INDENT ON } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-01 22:19:54
|
Revision: 11295 http://plplot.svn.sourceforge.net/plplot/?rev=11295&view=rev Author: airwin Date: 2010-11-01 22:19:45 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Move to new // comment style for C code in bindings. Modified Paths: -------------- trunk/bindings/f77/plstubs.h trunk/bindings/f77/sc3d.c trunk/bindings/f77/sccont.c trunk/bindings/f77/scstubs.c trunk/bindings/f95/plstubs.h trunk/bindings/f95/sc3d.c trunk/bindings/f95/sccont.c trunk/bindings/f95/scstubs.c trunk/bindings/gnome2/lib/gcw-lib.c trunk/bindings/gnome2/lib/plplotcanvas.c trunk/bindings/gnome2/python/cplplotcanvasmodule.c trunk/bindings/gnome2/python/gcwmodule.c trunk/bindings/ocaml/plcairo/plcairo_impl.c trunk/bindings/ocaml/plplot_impl.c trunk/bindings/octave/massage.c trunk/bindings/octave/plplot_octave.h.in trunk/bindings/octave/plplot_octave_rej.h trunk/bindings/python/plplot_widgetmodule.c trunk/bindings/tcl/matrixInit.c trunk/bindings/tcl/pltcl.h trunk/bindings/tcl/tclAPI.c trunk/bindings/tcl/tclMain.c trunk/bindings/tcl/tclMatrix.c trunk/bindings/tcl/tclMatrix.h trunk/bindings/tk/Pltk_Init.c trunk/bindings/tk/plframe.c trunk/bindings/tk/plr.c trunk/bindings/tk/plserver.c trunk/bindings/tk/plserver.h trunk/bindings/tk/pltk.h trunk/bindings/tk/pltkd.h trunk/bindings/tk/tcpip.c trunk/bindings/tk/tcpip.h trunk/bindings/tk/tkMain.c trunk/bindings/tk/tkshell.c trunk/bindings/tk-x-plat/Plplotter_Init.c trunk/bindings/tk-x-plat/plplotter.c trunk/bindings/tk-x-plat/pltkwd.h trunk/scripts/style_source.sh Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2010-11-01 22:15:20 UTC (rev 11294) +++ trunk/bindings/f77/plstubs.h 2010-11-01 22:19:45 UTC (rev 11295) @@ -1,52 +1,52 @@ -/* $Id$ - * - * Maurice LeBrun - * IFS, University of Texas - * - * Header file for plplot Fortran interface stubs. - * THIS FILE IS NOT FOR INCLUSION BY USER CODES!! - * - * The contents of this file are in the public domain. - */ +// $Id$ +// +// Maurice LeBrun +// IFS, University of Texas +// +// Header file for plplot Fortran interface stubs. +// THIS FILE IS NOT FOR INCLUSION BY USER CODES!! +// +// The contents of this file are in the public domain. +// #ifndef __PLSTUBS_H__ #define __PLSTUBS_H__ #include "plplotP.h" -/*----------------------------------------------------------------------*\ - * Select name transformation based on system type. - * - * Define the STUB_LINKAGE flag to get proper C<->Fortran linkage on your - * system. This flag describes what the compiler does to Fortran routine - * names, which we must duplicate on the C stubs so that the Fortran - * routines may call them. You can often set STUB_LINKAGE by the - * construct -DSTUB_LINKAGE=<value> on the C compiler command line, but - * it is best to either rely on the default or explicitly handle your - * system below. - * - * Current choices for STUB_LINKAGE: - * - * STUB_LAU lower-case, append underscore - * STUB_L lower-case - * STUB_U upper-case - * STUB_FORTRAN use "fortran" keyword (MS-DOS convention) - * - * If no choice is made, the default is set to STUB_LAU. This should - * handle most generic Unix boxes not already accounted for. - * - * ** Namespace collision ** - * - * If you use the STUB_L option, the C & Fortran namespaces will collide - * if the Fortran compiler does lower case folding (they usually do). - * The problem is then that the stub names and actual function names will - * be exactly the same, if we insist on the Fortran and C bindings to be - * similar. The solution is to give the externally callable C routines - * unique names, and provide macros to turn the documented entry names in - * to the real ones. This is a horrible kludge, but the alternatives are - * worse. Fortunately it has no effect on the user program, and you can - * forget that you ever read about it here. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Select name transformation based on system type. +// +// Define the STUB_LINKAGE flag to get proper C<->Fortran linkage on your +// system. This flag describes what the compiler does to Fortran routine +// names, which we must duplicate on the C stubs so that the Fortran +// routines may call them. You can often set STUB_LINKAGE by the +// construct -DSTUB_LINKAGE=<value> on the C compiler command line, but +// it is best to either rely on the default or explicitly handle your +// system below. +// +// Current choices for STUB_LINKAGE: +// +// STUB_LAU lower-case, append underscore +// STUB_L lower-case +// STUB_U upper-case +// STUB_FORTRAN use "fortran" keyword (MS-DOS convention) +// +// If no choice is made, the default is set to STUB_LAU. This should +// handle most generic Unix boxes not already accounted for. +// +// ** Namespace collision ** +// +// If you use the STUB_L option, the C & Fortran namespaces will collide +// if the Fortran compiler does lower case folding (they usually do). +// The problem is then that the stub names and actual function names will +// be exactly the same, if we insist on the Fortran and C bindings to be +// similar. The solution is to give the externally callable C routines +// unique names, and provide macros to turn the documented entry names in +// to the real ones. This is a horrible kludge, but the alternatives are +// worse. Fortunately it has no effect on the user program, and you can +// forget that you ever read about it here. +//-------------------------------------------------------------------------- #define STUB_LAU 1 #define STUB_L 2 @@ -58,67 +58,67 @@ #ifndef STUB_LINKAGE -#if defined ( SX ) /* NEC Super-UX (SX-3) */ +#if defined ( SX ) // NEC Super-UX (SX-3) #define STUB_LINKAGE STUB_LAU #endif -#if defined ( _IBMR2 ) && defined ( _AIX ) /* AIX */ +#if defined ( _IBMR2 ) && defined ( _AIX ) // AIX #define STUB_LINKAGE STUB_L #endif -#ifdef __hpux /* HP/UX */ +#ifdef __hpux // HP/UX #define STUB_LINKAGE STUB_L #endif -#ifdef __mips /* IRIX (SGI systems) */ +#ifdef __mips // IRIX (SGI systems) #define STUB_LINKAGE STUB_LAU #endif -#ifdef sun /* Suns */ +#ifdef sun // Suns #define STUB_LINKAGE STUB_LAU #endif -#ifdef CRAY /* Cray/UNICOS */ +#ifdef CRAY // Cray/UNICOS #define STUB_LINKAGE STUB_U #endif -#if defined ( __alpha ) && defined ( __osf__ ) /* DEC Alpha AXP/OSF */ +#if defined ( __alpha ) && defined ( __osf__ ) // DEC Alpha AXP/OSF #define STUB_LINKAGE STUB_LAU #endif -#ifdef __GO32__ /* dos386/djgpp */ +#ifdef __GO32__ // dos386/djgpp #ifdef MSDOS #undef MSDOS #endif #endif -#if defined ( WIN32 ) /* Windows 32-bit */ -#if defined ( IVF ) /* Intel Visual Fortran */ +#if defined ( WIN32 ) // Windows 32-bit +#if defined ( IVF ) // Intel Visual Fortran #define STUB_LINKAGE STUB_IVF -#elif defined ( CVF ) /* MSVC/CVF */ +#elif defined ( CVF ) // MSVC/CVF #define STUB_LINKAGE STUB_U -#elif defined ( MSDOS ) /* MS-DOS based */ +#elif defined ( MSDOS ) // MS-DOS based #define STUB_LINKAGE STUB_FORTRAN #elif defined ( _MSC_VER ) #define STUB_LINKAGE STUB_STDCALL -#elif defined ( __GNUC__ ) /* GNU C with MinGW/Cygwin */ +#elif defined ( __GNUC__ ) // GNU C with MinGW/Cygwin #define STUB_LINKAGE STUB_MINGW #endif -#elif defined ( MSDOS ) /* MS-DOS based */ +#elif defined ( MSDOS ) // MS-DOS based #define STUB_LINKAGE STUB_FORTRAN -#endif /* Windows 32-bit */ +#endif // Windows 32-bit -#ifndef STUB_LINKAGE /* The default */ +#ifndef STUB_LINKAGE // The default #define STUB_LINKAGE STUB_LAU #endif -#endif /* ifndef STUB_LINKAGE */ +#endif // ifndef STUB_LINKAGE -/*----------------------------------------------------------------------*\ - * Define name-translation macro. - * To use, define with x the upper case routine name, y the lower case. - * Should be adoptable to virtually any system. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Define name-translation macro. +// To use, define with x the upper case routine name, y the lower case. +// Should be adoptable to virtually any system. +//-------------------------------------------------------------------------- #if STUB_LINKAGE == STUB_LAU #define FNAME( x, y ) PLDLLIMPEXP_F77C y ## _ @@ -152,19 +152,19 @@ #error "Illegal setting for STUB_LINKAGE" #endif -/*----------------------------------------------------------------------*\ - * Now to actually define the stub names. - * Each stub must have an entry here. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Now to actually define the stub names. +// Each stub must have an entry here. +//-------------------------------------------------------------------------- -/* N.B. By default the g77 compiler appends second underscore to name if - * the original name contains any underscore at all. According to info - * g77, "This is done to ensure compatibility with code produced by many - * UNIX Fortran compilers." However, other fortran compilers do not have - * this default naming scheme so to avoid trouble I have #defined two - * variations of the embedded underscore names, one with and one without - * the extra trailing underscore. - */ +// N.B. By default the g77 compiler appends second underscore to name if +// the original name contains any underscore at all. According to info +// g77, "This is done to ensure compatibility with code produced by many +// UNIX Fortran compilers." However, other fortran compilers do not have +// this default naming scheme so to avoid trouble I have #defined two +// variations of the embedded underscore names, one with and one without +// the extra trailing underscore. +// #define PL_SETCONTLABELFORMAT FNAME( PL_SETCONTLABELFORMAT, pl_setcontlabelformat ) #define PL_SETCONTLABELFORMATa FNAME( PL_SETCONTLABELFORMAT_, pl_setcontlabelformat_ ) @@ -355,4 +355,4 @@ #define PLWIND FNAME( PLWIND, plwind ) #define PLXORMOD FNAME( PLXORMOD, plxormod ) -#endif /* __PLSTUBS_H__ */ +#endif // __PLSTUBS_H__ Modified: trunk/bindings/f77/sc3d.c =================================================================== --- trunk/bindings/f77/sc3d.c 2010-11-01 22:15:20 UTC (rev 11294) +++ trunk/bindings/f77/sc3d.c 2010-11-01 22:19:45 UTC (rev 11295) @@ -1,26 +1,26 @@ -/* $Id$ - * - * Stub routines for 3d plots. - * - * Copyright (C) 2004 Alan W. Irwin - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// $Id$ +// +// Stub routines for 3d plots. +// +// Copyright (C) 2004 Alan W. Irwin +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// #include "plstubs.h" @@ -32,7 +32,7 @@ PLFLT ** a; int i, j; -/* Create a vectored a array from transpose of the fortran z array. */ +// Create a vectored a array from transpose of the fortran z array. plAlloc2dGrid( &a, *nx, *ny ); for ( i = 0; i < *nx; i++ ) { @@ -44,7 +44,7 @@ c_plot3dc( x, y, a, *nx, *ny, *opt, clevel, *nlevel ); -/* Clean up memory allocated for a */ +// Clean up memory allocated for a plFree2dGrid( a, *nx, *ny ); } @@ -64,10 +64,10 @@ int i, j; PLFLT **temp; - /* Create the vectored C matrix from the Fortran matrix */ - /* To make things easy we save a temporary copy of the transpose of the - * Fortran matrix, so that the first dimension of z corresponds to the x - * direction. */ + // Create the vectored C matrix from the Fortran matrix + // To make things easy we save a temporary copy of the transpose of the + // Fortran matrix, so that the first dimension of z corresponds to the x + // direction. if ( !( temp = (PLFLT **) malloc( (size_t) *nx * sizeof ( PLFLT * ) ) ) ) { Modified: trunk/bindings/f77/sccont.c =================================================================== --- trunk/bindings/f77/sccont.c 2010-11-01 22:15:20 UTC (rev 11294) +++ trunk/bindings/f77/sccont.c 2010-11-01 22:19:45 UTC (rev 11295) @@ -1,36 +1,36 @@ -/* $Id$ - * - * Contour plotter front-ends for Fortran. - * - * Copyright (C) 2004 Alan W. Irwin - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// $Id$ +// +// Contour plotter front-ends for Fortran. +// +// Copyright (C) 2004 Alan W. Irwin +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// #include "plstubs.h" -/*----------------------------------------------------------------------*\ - * pltr0f() - * - * Identity transformation for plots from Fortran. - * Only difference from C-language identity function (pltr0) is that the - * Fortran paradigm for array index is used, i.e. starting at 1. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pltr0f() +// +// Identity transformation for plots from Fortran. +// Only difference from C-language identity function (pltr0) is that the +// Fortran paradigm for array index is used, i.e. starting at 1. +//-------------------------------------------------------------------------- void pltr0f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) @@ -39,20 +39,20 @@ *ty = y + 1.0; } -/*----------------------------------------------------------------------*\ - * Contour plotter front-ends. - * These specify the row-dominant function evaluator in the plfcont - * argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: - * - * - plcon0 no transformation - * - plcon1 linear interpolation from singly dimensioned coord arrays - * - plcon2 linear interpolation from doubly dimensioned coord arrays - * - * The latter two work by calling plfcont() with the appropriate grid - * structure for input to pltr2f(). - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Contour plotter front-ends. +// These specify the row-dominant function evaluator in the plfcont +// argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: +// +// - plcon0 no transformation +// - plcon1 linear interpolation from singly dimensioned coord arrays +// - plcon2 linear interpolation from doubly dimensioned coord arrays +// +// The latter two work by calling plfcont() with the appropriate grid +// structure for input to pltr2f(). +//-------------------------------------------------------------------------- -/* no transformation */ +// no transformation void PLCON07( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, @@ -69,7 +69,7 @@ pltr0f, NULL ); } -/* 1-d transformation */ +// 1-d transformation void PLCON17( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, @@ -93,7 +93,7 @@ pltr1, (void *) &cgrid ); } -/* 2-d transformation */ +// 2-d transformation void PLCON27( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, @@ -117,20 +117,20 @@ pltr2f, (void *) &cgrid ); } -/*----------------------------------------------------------------------*\ - * Vector plotter front-ends. - * These specify the row-dominant function evaluator in the plfvect - * argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: - * - * - plvec0 no transformation - * - plvec1 linear interpolation from singly dimensioned coord arrays - * - plvec2 linear interpolation from doubly dimensioned coord arrays - * - * The latter two work by calling plfvect() with the appropriate grid - * structure for input to pltr2f(). - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Vector plotter front-ends. +// These specify the row-dominant function evaluator in the plfvect +// argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: +// +// - plvec0 no transformation +// - plvec1 linear interpolation from singly dimensioned coord arrays +// - plvec2 linear interpolation from doubly dimensioned coord arrays +// +// The latter two work by calling plfvect() with the appropriate grid +// structure for input to pltr2f(). +//-------------------------------------------------------------------------- -/* no transformation */ +// no transformation void PLVEC07( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale ) @@ -149,7 +149,7 @@ *nx, *ny, *scale, pltr0f, NULL ); } -/* 1-d transformation */ +// 1-d transformation void PLVEC17( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, @@ -176,7 +176,7 @@ *nx, *ny, *scale, pltr1, (void *) &cgrid ); } -/* 2-d transformation */ +// 2-d transformation void PLVEC27( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, @@ -203,9 +203,9 @@ *nx, *ny, *scale, pltr2f, (void *) &cgrid ); } -/*----------------------------------------------------------------------*\ - * Here are the old contour plotters. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Here are the old contour plotters. +//-------------------------------------------------------------------------- static void pltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) @@ -251,19 +251,19 @@ pltr, (void *) ftr ); } -/*----------------------------------------------------------------------*\ - * plfshade front-ends. - * These specify the row-dominant function evaluator in the plfshade - * argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: - * - * - plshade0 map indices to xmin, xmax, ymin, ymax. - * The next two work by calling plfshade() with the appropriate grid - * structure for input to pltr2f(). - * - plshade1 linear interpolation from singly dimensioned coord arrays - * - plshade2 linear interpolation from doubly dimensioned coord arrays - * - plshade tr array transformation - * - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// plfshade front-ends. +// These specify the row-dominant function evaluator in the plfshade +// argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: +// +// - plshade0 map indices to xmin, xmax, ymin, ymax. +// The next two work by calling plfshade() with the appropriate grid +// structure for input to pltr2f(). +// - plshade1 linear interpolation from singly dimensioned coord arrays +// - plshade2 linear interpolation from doubly dimensioned coord arrays +// - plshade tr array transformation +// +//-------------------------------------------------------------------------- void PLSHADE07( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, @@ -277,14 +277,14 @@ PLfGrid data; -/* Fill a grid data structure to hold the fortran z array. */ +// Fill a grid data structure to hold the fortran z array. data.f = z; data.nx = *lx; data.ny = *ny; -/* Call plfshade to do the actual work - plf2evalr is the - interface that deals with the fortran data organisation */ +// Call plfshade to do the actual work - plf2evalr is the +// interface that deals with the fortran data organisation plfshade( plf2evalr, &data, NULL, NULL, *nx, *ny, *xmin, *xmax, *ymin, *ymax, @@ -293,14 +293,14 @@ *min_color, *min_width, *max_color, *max_width, c_plfill, rect, NULL, NULL ); -/* Clean up memory allocated for a */ -/* - plFree2dGrid( a, *nx, *ny ); -*/ +// Clean up memory allocated for a +// +// plFree2dGrid( a, *nx, *ny ); +// } -/* 1-d transformation */ +// 1-d transformation void PLSHADE17( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, @@ -315,20 +315,20 @@ PLfGrid data; PLcGrid cgrid; -/* Fill a grid data structure to hold the coordinate arrays. */ +// Fill a grid data structure to hold the coordinate arrays. cgrid.nx = *nx; cgrid.ny = *ny; cgrid.xg = xg1; cgrid.yg = yg1; -/* Fill a grid data structure to hold the fortran z array. */ +// Fill a grid data structure to hold the fortran z array. data.f = z; data.nx = *lx; data.ny = *ny; -/* Call plfshade to do the actual work - plf2evalr is the - interface that deals with the fortran data organisation. */ +// Call plfshade to do the actual work - plf2evalr is the +// interface that deals with the fortran data organisation. plfshade( plf2evalr, &data, NULL, NULL, *nx, *ny, *xmin, *xmax, *ymin, *ymax, @@ -338,7 +338,7 @@ c_plfill, rect, pltr1, ( PLPointer ) & cgrid ); } -/* 2-d transformation */ +// 2-d transformation void PLSHADE27( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, @@ -353,19 +353,19 @@ PLfGrid data; PLcGrid cgrid; -/* Fill a grid data structure to hold the coordinate arrays. */ +// Fill a grid data structure to hold the coordinate arrays. cgrid.nx = *lx; cgrid.ny = *ny; cgrid.xg = xg2; cgrid.yg = yg2; -/* Fill a grid data structure to hold the fortran z array. */ +// Fill a grid data structure to hold the fortran z array. data.f = z; data.nx = *lx; data.ny = *ny; -/* Call plfshade to do the actual work - plf2evalr is the - interface that deals with the fortran data organisation. */ +// Call plfshade to do the actual work - plf2evalr is the +// interface that deals with the fortran data organisation. plfshade( plf2evalr, &data, NULL, NULL, *nx, *ny, *xmin, *xmax, *ymin, *ymax, @@ -386,13 +386,13 @@ PLINT rect = 1; PLfGrid data; -/* Fill a grid data structure to hold the fortran z array. */ +// Fill a grid data structure to hold the fortran z array. data.f = z; data.nx = *lx; data.ny = *ny; -/* Call plfshade to do the actual work - plf2evalr is the - interface that deals with the fortran data organisation. */ +// Call plfshade to do the actual work - plf2evalr is the +// interface that deals with the fortran data organisation. plfshade( plf2evalr, &data, NULL, NULL, *nx, *ny, *xmin, *xmax, *ymin, *ymax, @@ -402,15 +402,15 @@ c_plfill, rect, pltr, ( PLPointer ) ftr ); } -/*----------------------------------------------------------------------*\ - * plshades front-ends. - * - * - plshades0 map indices to xmin, xmax, ymin, ymax - * - plshades1 linear interpolation from singly dimensioned coord arrays - * - plshades2 linear interpolation from doubly dimensioned coord arrays - * - plshades pass tr information with plplot common block (and - * then pass tr as last argument of PLSHADES7) - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// plshades front-ends. +// +// - plshades0 map indices to xmin, xmax, ymin, ymax +// - plshades1 linear interpolation from singly dimensioned coord arrays +// - plshades2 linear interpolation from doubly dimensioned coord arrays +// - plshades pass tr information with plplot common block (and +// then pass tr as last argument of PLSHADES7) +//-------------------------------------------------------------------------- void PLSHADES07( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, @@ -421,13 +421,13 @@ PLINT rect = 1; PLfGrid2 data; -/* Fill a grid data structure to hold the fortran z array. */ +// Fill a grid data structure to hold the fortran z array. data.f = (PLFLT **) z; data.nx = *lx; data.ny = *ny; -/* Call plfshades to do the actual work - plf2ops_col_major() returns a collection - of functions to access the data in fortran style. */ +// Call plfshades to do the actual work - plf2ops_col_major() returns a collection +// of functions to access the data in fortran style. plfshades( plf2ops_grid_col_major(), &data, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, clevel, *nlevel, *fill_width, @@ -446,19 +446,19 @@ PLfGrid2 data; PLcGrid cgrid; -/* Fill a grid data structure to hold the fortran z array. */ +// Fill a grid data structure to hold the fortran z array. data.f = (PLFLT **) z; data.nx = *lx; data.ny = *ny; -/* Fill a grid data structure to hold the coordinate arrays. */ +// Fill a grid data structure to hold the coordinate arrays. cgrid.nx = *nx; cgrid.ny = *ny; cgrid.xg = xg1; cgrid.yg = yg1; -/* Call plfshades to do the actual work - plf2ops_col_major() returns a collection - of functions to access the data in fortran style. */ +// Call plfshades to do the actual work - plf2ops_col_major() returns a collection +// of functions to access the data in fortran style. plfshades( plf2ops_grid_col_major(), &data, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, clevel, *nlevel, *fill_width, @@ -477,19 +477,19 @@ PLfGrid2 data; PLcGrid cgrid; -/* Fill a grid data structure to hold the fortran z array. */ +// Fill a grid data structure to hold the fortran z array. data.f = (PLFLT **) z; data.nx = *lx; data.ny = *ny; -/* Fill a grid data structure to hold the coordinate arrays. */ +// Fill a grid data structure to hold the coordinate arrays. cgrid.nx = *lx; cgrid.ny = *ny; cgrid.xg = xg2; cgrid.yg = yg2; -/* Call plfshades to do the actual work - plf2ops_col_major() returns a collection - of functions to access the data in fortran style. */ +// Call plfshades to do the actual work - plf2ops_col_major() returns a collection +// of functions to access the data in fortran style. plfshades( plf2ops_grid_col_major(), &data, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, clevel, *nlevel, *fill_width, @@ -506,13 +506,13 @@ PLINT rect = 1; PLfGrid2 data; -/* Fill a grid data structure to hold the fortran z array. */ +// Fill a grid data structure to hold the fortran z array. data.f = (PLFLT **) z; data.nx = *lx; data.ny = *ny; -/* Call plfshades to do the actual work - plf2ops_col_major() returns a collection - of functions to access the data in fortran style. */ +// Call plfshades to do the actual work - plf2ops_col_major() returns a collection +// of functions to access the data in fortran style. plfshades( plf2ops_grid_col_major(), &data, *nx, *ny, NULL, *xmin, *xmax, *ymin, *ymax, clevel, *nlevel, *fill_width, @@ -542,7 +542,7 @@ } } -/* Clean up memory allocated for a */ +// Clean up memory allocated for a plFree2dGrid( a, *nptsx, *nptsy ); } Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2010-11-01 22:15:20 UTC (rev 11294) +++ trunk/bindings/f77/scstubs.c 2010-11-01 22:19:45 UTC (rev 11295) @@ -1,31 +1,31 @@ -/* $Id$ - * - * C stub routines. - * - * Copyright (C) 2004 Alan W. Irwin - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * - * The stubs contained here are the ones that are relatively simple, - * i.e. involving only a call convention change or integer-to-string - * conversion. Exceptions are plparseopts and plstripc which have - * a few more complications in them. - */ +// $Id$ +// +// C stub routines. +// +// Copyright (C) 2004 Alan W. Irwin +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// +// The stubs contained here are the ones that are relatively simple, +// i.e. involving only a call convention change or integer-to-string +// conversion. Exceptions are plparseopts and plstripc which have +// a few more complications in them. +// #include "plstubs.h" @@ -34,13 +34,13 @@ #else #define STDCALL #endif -static void ( STDCALL *plmapform )( PLINT *, PLFLT *, PLFLT * ); /* Note: slightly different prototype than - * (*mapform)! */ -/* Slightly different to (*label_func) as we don't support PLPointer for - * additional data in f77. - * Note the hidden argument! */ +static void ( STDCALL *plmapform )( PLINT *, PLFLT *, PLFLT * ); // Note: slightly different prototype than + // (*mapform)! +// Slightly different to (*label_func) as we don't support PLPointer for +// additional data in f77. +// Note the hidden argument! static void ( STDCALL *pllabelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ); -/* Slightly different to C version as we don't support PLPointer for additional data */ +// Slightly different to C version as we don't support PLPointer for additional data static void ( STDCALL *pltransform )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ); static void @@ -164,7 +164,7 @@ c_plcol1( *col ); } -/* The old way, same as plcol0 */ +// The old way, same as plcol0 void PLCOL( PLINT *icol ) @@ -336,9 +336,9 @@ c_plgfam( fam, num, bmax ); } -/* Note: Fortran does not distinguish between unsigned and signed integers - * so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside - * this routine. */ +// Note: Fortran does not distinguish between unsigned and signed integers +// so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside +// this routine. void PLGFCI( PLUNICODE *pfci ) { @@ -497,12 +497,12 @@ { int i; - /* (AM) Note the hidden argument "length" - it ensures that the string "label" - * is recognised to have that length - */ + // (AM) Note the hidden argument "length" - it ensures that the string "label" + // is recognised to have that length + // ( *pllabelfunc )( &axis, &value, label, &length, length ); - /* Ensure string is null terminated */ + // Ensure string is null terminated i = length - 1; while ( ( i >= 0 ) && ( label[i] == ' ' ) ) i--; @@ -582,7 +582,7 @@ void PLPARSEOPTS7( int *numargs, const char *iargs, PLINT *mode, PLINT *maxindex ) { -/* Same as in plparseopts fortran subroutine that calls this one. */ +// Same as in plparseopts fortran subroutine that calls this one. #define MAXARGS 20 if ( *numargs <= MAXARGS ) { @@ -591,7 +591,7 @@ for ( i = 0; i < *numargs; i++ ) { argv[i] = iargs + ( i * *maxindex ); -/* fprintf(stderr, "%d - %s\n", i, argv[i]); */ +// fprintf(stderr, "%d - %s\n", i, argv[i]); } c_plparseopts( numargs, argv, *mode ); } @@ -823,8 +823,8 @@ c_plsesc( (char) *esc ); } -/* Auxiliary routine - not to be used publicly - */ +// Auxiliary routine - not to be used publicly +// #define PLSETMAPFORMC FNAME( PLSETMAPFORMC, plsetmapformc ) #define PLCLEARMAPFORMC FNAME( PLCLEARMAPFORMC, plclearmapformc ) void @@ -851,9 +851,9 @@ c_plsfam( *fam, *num, *bmax ); } -/* Note: Fortran does not distinguish between unsigned and signed integers - * so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside - * this routine. */ +// Note: Fortran does not distinguish between unsigned and signed integers +// so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside +// this routine. void PLSFCI( PLUNICODE *fci ) { @@ -876,7 +876,7 @@ PLSLABELFUNC( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT * ) ) { pllabelfunc = labelfunc; - /* N.B. neglect pointer to additional data for f77 */ + // N.B. neglect pointer to additional data for f77 c_plslabelfunc( pllabelfuncf2c, NULL ); } @@ -977,7 +977,7 @@ PLSTRANSFORM( void ( STDCALL *transformfunc )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ) ) { pltransform = transformfunc; - /* N.B. neglect pointer to additional data for f77 */ + // N.B. neglect pointer to additional data for f77 c_plstransform( pltransformf2c, NULL ); } Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2010-11-01 22:15:20 UTC (rev 11294) +++ trunk/bindings/f95/plstubs.h 2010-11-01 22:19:45 UTC (rev 11295) @@ -1,52 +1,52 @@ -/* $Id$ - * - * Maurice LeBrun - * IFS, University of Texas - * - * Header file for plplot Fortran interface stubs. - * THIS FILE IS NOT FOR INCLUSION BY USER CODES!! - * - * The contents of this file are in the public domain. - */ +// $Id$ +// +// Maurice LeBrun +// IFS, University of Texas +// +// Header file for plplot Fortran interface stubs. +// THIS FILE IS NOT FOR INCLUSION BY USER CODES!! +// +// The contents of this file are in the public domain. +// #ifndef __PLSTUBS_H__ #define __PLSTUBS_H__ #include "plplotP.h" -/*----------------------------------------------------------------------*\ - * Select name transformation based on system type. - * - * Define the STUB_LINKAGE flag to get proper C<->Fortran linkage on your - * system. This flag describes what the compiler does to Fortran routine - * names, which we must duplicate on the C stubs so that the Fortran - * routines may call them. You can often set STUB_LINKAGE by the - * construct -DSTUB_LINKAGE=<value> on the C compiler command line, but - * it is best to either rely on the default or explicitly handle your - * system below. - * - * Current choices for STUB_LINKAGE: - * - * STUB_LAU lower-case, append underscore - * STUB_L lower-case - * STUB_U upper-case - * STUB_FORTRAN use "fortran" keyword (MS-DOS convention) - * - * If no choice is made, the default is set to STUB_LAU. This should - * handle most generic Unix boxes not already accounted for. - * - * ** Namespace collision ** - * - * If you use the STUB_L option, the C & Fortran namespaces will collide - * if the Fortran compiler does lower case folding (they usually do). - * The problem is then that the stub names and actual function names will - * be exactly the same, if we insist on the Fortran and C bindings to be - * similar. The solution is to give the externally callable C routines - * unique names, and provide macros to turn the documented entry names in - * to the real ones. This is a horrible kludge, but the alternatives are - * worse. Fortunately it has no effect on the user program, and you can - * forget that you ever read about it here. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Select name transformation based on system type. +// +// Define the STUB_LINKAGE flag to get proper C<->Fortran linkage on your +// system. This flag describes what the compiler does to Fortran routine +// names, which we must duplicate on the C stubs so that the Fortran +// routines may call them. You can often set STUB_LINKAGE by the +// construct -DSTUB_LINKAGE=<value> on the C compiler command line, but +// it is best to either rely on the default or explicitly handle your +// system below. +// +// Current choices for STUB_LINKAGE: +// +// STUB_LAU lower-case, append underscore +// STUB_L lower-case +// STUB_U upper-case +// STUB_FORTRAN use "fortran" keyword (MS-DOS convention) +// +// If no choice is made, the default is set to STUB_LAU. This should +// handle most generic Unix boxes not already accounted for. +// +// ** Namespace collision ** +// +// If you use the STUB_L option, the C & Fortran namespaces will collide +// if the Fortran compiler does lower case folding (they usually do). +// The problem is then that the stub names and actual function names will +// be exactly the same, if we insist on the Fortran and C bindings to be +// similar. The solution is to give the externally callable C routines +// unique names, and provide macros to turn the documented entry names in +// to the real ones. This is a horrible kludge, but the alternatives are +// worse. Fortunately it has no effect on the user program, and you can +// forget that you ever read about it here. +//-------------------------------------------------------------------------- #define STUB_LAU 1 #define STUB_L 2 @@ -58,42 +58,42 @@ #ifndef STUB_LINKAGE -#if defined ( SX ) /* NEC Super-UX (SX-3) */ +#if defined ( SX ) // NEC Super-UX (SX-3) #define STUB_LINKAGE STUB_LAU #endif -#if defined ( _IBMR2 ) && defined ( _AIX ) /* AIX */ +#if defined ( _IBMR2 ) && defined ( _AIX ) // AIX #define STUB_LINKAGE STUB_L #endif -#ifdef __hpux /* HP/UX */ +#ifdef __hpux // HP/UX #define STUB_LINKAGE STUB_L #endif -#ifdef __mips /* IRIX (SGI systems) */ +#ifdef __mips // IRIX (SGI systems) #define STUB_LINKAGE STUB_LAU #endif -#ifdef sun /* Suns */ +#ifdef sun // Suns #define STUB_LINKAGE STUB_LAU #endif -#ifdef CRAY /* Cray/UNICOS */ +#ifdef CRAY // Cray/UNICOS #define STUB_LINKAGE STUB_U #endif -#if defined ( __alpha ) && defined ( __osf__ ) /* DEC Alpha AXP/OSF */ +#if defined ( __alpha ) && defined ( __osf__ ) // DEC Alpha AXP/OSF #define STUB_LINKAGE STUB_LAU #endif -#ifdef __GO32__ /* dos386/djgpp */ +#ifdef __GO32__ // dos386/djgpp #ifdef MSDOS #undef MSDOS #endif #endif -#ifdef WIN32 /* MS-DOS based */ -#ifdef IVF /* Intel Visual Fortran */ +#ifdef WIN32 // MS-DOS based +#ifdef IVF // Intel Visual Fortran #define STUB_LINKAGE STUB_IVF #elif defined ( CVF ) #define STUB_LINKAGE STUB_U @@ -104,21 +104,21 @@ #elif defined ( __GNUC__ ) #define STUB_LINKAGE STUB_MINGW #endif -#elif defined ( MSDOS ) /* MS-DOS based */ +#elif defined ( MSDOS ) // MS-DOS based #define STUB_LINKAGE STUB_FORTRAN -#endif /* Windows 32-bit */ +#endif // Windows 32-bit -#ifndef STUB_LINKAGE /* The default */ +#ifndef STUB_LINKAGE // The default #define STUB_LINKAGE STUB_LAU #endif -#endif /* ifndef STUB_LINKAGE */ +#endif // ifndef STUB_LINKAGE -/*----------------------------------------------------------------------*\ - * Define name-translation macro. - * To use, define with x the upper case routine name, y the lower case. - * Should be adaptable to virtually any system. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Define name-translation macro. +// To use, define with x the upper case routine name, y the lower case. +// Should be adaptable to virtually any system. +//-------------------------------------------------------------------------- #if STUB_LINKAGE == STUB_LAU #define FNAME( x, y ) PLDLLIMPEXP_F95C y ## _ @@ -152,19 +152,19 @@ #error "Illegal setting for STUB_LINKAGE" #endif -/*----------------------------------------------------------------------*\ - * Now to actually define the stub names. - * Each stub must have an entry here. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Now to actually define the stub names. +// Each stub must have an entry here. +//-------------------------------------------------------------------------- -/* N.B. By default the g77 compiler appends second underscore to name if - * the original name contains any underscore at all. According to info - * g77, "This is done to ensure compatibility with code produced by many - * UNIX Fortran compilers." However, other fortran compilers do not have - * this default naming scheme so to avoid trouble I have #defined two - * variations of the embedded underscore names, one with and one without - * the extra trailing underscore. - */ +// N.B. By default the g77 compiler appends second underscore to name if +// the original name contains any underscore at all. According to info +// g77, "This is done to ensure compatibility with code produced by many +// UNIX Fortran compilers." However, other fortran compilers do not have +// this default naming scheme so to avoid trouble I have #defined two +// variations of the embedded underscore names, one with and one without +// the extra trailing underscore. +// #define PL_SETCONTLABELFORMAT FNAME( PL_SETCONTLABELFORMAT, pl_setcontlabelformat ) #define PL_SETCONTLABELFORMATa FNAME( PL_SETCONTLABELFORMAT_, pl_setcontlabelformat_ ) @@ -367,4 +367,4 @@ #define PLWIND FNAME( PLWIND, plwind ) #define PLXORMOD FNAME( PLXORMODF77, plxormodf77 ) -#endif /* __PLSTUBS_H__ */ +#endif // __PLSTUBS_H__ Modified: trunk/bindings/f95/sc3d.c =================================================================== --- trunk/bindings/f95/sc3d.c 2010-11-01 22:15:20 UTC (rev 11294) +++ trunk/bindings/f95/sc3d.c 2010-11-01 22:19:45 UTC (rev 11295) @@ -1,26 +1,26 @@ -/* $Id$ - * - * Stub routines for 3d plots. - * - * Copyright (C) 2004 Alan W. Irwin - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// $Id$ +// +// Stub routines for 3d plots. +// +// Copyright (C) 2004 Alan W. Irwin +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// #include "plstubs.h" @@ -32,7 +32,7 @@ PLFLT ** a; int i, j; -/* Create a vectored a array from transpose of the fortran z array. */ +// Create a vectored a array from transpose of the fortran z array. plAlloc2dGrid( &a, *nx, *ny ); for ( i = 0; i < *nx; i++ ) { @@ -44,7 +44,7 @@ c_plot3dc( x, y, a, *nx, *ny, *opt, clevel, *nlevel ); -/* Clean up memory allocated for a */ +// Clean up memory allocated for a plFree2dGrid( a, *nx, *ny ); } @@ -64,10 +64,10 @@ int i, j; PLFLT **temp; - /* Create the vectored C matrix from the Fortran matrix */ - /* To make things easy we save a temporary copy of the transpose of the - * Fortran matrix, so that the first dimension of z corresponds to the x - * direction. */ + // Create the vectored C matrix from the Fortran matrix + // To make things easy we save a temporary copy of the transpose of the + // Fortran matrix, so that the first dimension of z corresponds to the x + // direction. if ( !( temp = (PLFLT **) malloc( (size_t) *nx * sizeof ( PLFLT * ) ) ) ) { Modified: trunk/bindings/f95/sccont.c =================================================================== --- trunk/bindings/f95/sccont.c 2010-11-01 22:15:20 UTC (rev 11294) +++ trunk/bindings/f95/sccont.c 2010-11-01 22:19:45 UTC (rev 11295) @@ -1,36 +1,36 @@ -/* $Id$ - * - * Contour plotter front-ends for Fortran. - * - * Copyright (C) 2004 Alan W. Irwin - * - * This file is part of PLplot. - * - * PLplot is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Library Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PLplot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with PLplot; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +// $Id$ +// +// Contour plotter front-ends for Fortran. +// +// Copyright (C) 2004 Alan W. Irwin +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// #include "plstubs.h" -/*----------------------------------------------------------------------*\ - * pltr0f() - * - * Identity transformation for plots from Fortran. - * Only difference from C-language identity function (pltr0) is that the - * Fortran paradigm for array index is used, i.e. starting at 1. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// pltr0f() +// +// Identity transformation for plots from Fortran. +// Only difference from C-language identity function (pltr0) is that the +// Fortran paradigm for array index is used, i.e. starting at 1. +//-------------------------------------------------------------------------- void pltr0f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) @@ -39,20 +39,20 @@ *ty = y + 1.0; } -/*----------------------------------------------------------------------*\ - * Contour plotter front-ends. - * These specify the row-dominant function evaluator in the plfcont - * argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: - * - * - plcon0 no transformation - * - plcon1 linear interpolation from singly dimensioned coord arrays - * - plcon2 linear interpolation from doubly dimensioned coord arrays - * - * The latter two work by calling plfcont() with the appropriate grid - * structure for input to pltr2f(). - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Contour plotter front-ends. +// These specify the row-dominant function evaluator in the plfcont +// argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: +// +// - plcon0 no transformation +// - plcon1 linear interpolation from singly dimensioned coord arrays +// - plcon2 linear interpolation from doubly dimensioned coord arrays +// +// The latter two work by calling plfcont() with the appropriate grid +// structure for input to pltr2f(). +//-------------------------------------------------------------------------- -/* no transformation */ +// no transformation void PLCON07( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, @@ -69,7 +69,7 @@ pltr0f, NULL ); } -/* 1-d transformation */ +// 1-d transformation void PLCON17( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, @@ -93,7 +93,7 @@ pltr1, (void *) &cgrid ); } -/* 2-d transformation */ +// 2-d transformation void PLCON27( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, @@ -117,20 +117,20 @@ pltr2f, (void *) &cgrid ); } -/*----------------------------------------------------------------------*\ - * Vector plotter front-ends. - * These specify the row-dominant function evaluator in the plfvect - * argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: - * - * - plvec0 no transformation - * - plvec1 linear interpolation from singly dimensioned coord arrays - * - plvec2 linear interpolation from doubly dimensioned coord arrays - * - * The latter two work by calling plfvect() with the appropriate grid - * structure for input to pltr2f(). - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Vector plotter front-ends. +// These specify the row-dominant function evaluator in the plfvect +// argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: +// +// - plvec0 no transformation +// - plvec1 linear interpolation from singly dimensioned coord arrays +// - plvec2 linear interpolation from doubly dimensioned coord arrays +// +// The latter two work by calling plfvect() with the appropriate grid +// structure for input to pltr2f(). +//-------------------------------------------------------------------------- -/* no transformation */ +// no transformation void PLVEC07( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale ) @@ -149,7 +149,7 @@ *nx, *ny, *scale, pltr0f, NULL ); } -/* 1-d transformation */ +// 1-d transformation void PLVEC17( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, @@ -176,7 +176,7 @@ *nx, *ny, *scale, pltr1, (void *) &cgrid ); } -/* 2-d transformation */ +// 2-d transformation void PLVEC27( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, @@ -203,9 +203,9 @@ *nx, *ny, *scale, pltr2f, (void *) &cgrid ); } -/*----------------------------------------------------------------------*\ - * Here are the old contour plotters. - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Here are the old contour plotters. +//-------------------------------------------------------------------------- static void pltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) @@ -251,19 +251,19 @@ pltr, (void *) ftr ); } -/*----------------------------------------------------------------------*\ - * plfshade front-ends. - * These specify the row-dominant function evaluator in the plfshade - * argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: - * - * - plshade0 map indices to xmin, xmax, ymin, ymax. - * The next two work by calling plfshade() with the appropriate grid - * structure for input to pltr2f(). - * - plshade1 linear interpolation from singly dimensioned coord arrays - * - plshade2 linear interpolation from doubly dimensioned coord arrays - * - plshade tr array transformation - * - \*----------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// plfshade front-ends. +// These specify the row-dominant function evaluator in the plfshade +// argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: +// +// - plshade0 map indices to xmin, xmax, ymin, ymax. +// The next two work by calling plfshade() with the appropriate grid +// structure for input to pltr2f(). +// - plshade1 linear interpolation from singly dimensioned coord arrays +// - plshade2 linear interpolation from doubly dimensioned coord arrays +// - plshade tr array transformation +// +//-------------------------------------------------------------------------- void PLSHADE07( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, @@ -277,7 +277,7 @@ PLFLT ** a; int i, j; -/* Create a vectored a array from transpose of the fortran z array. */ +// Create a vectored a array from transpose of the fortran z array. plAlloc2dGrid( &a, *nx, *ny ); for ( i = 0; i < *nx; i++ ) { @@ -294,12 +294,12 @@ *min_color, *min_width, *max_color, *max_width, c_plfill, rect, NULL, NULL ); -/* Clean up memory allocated for a */ +// Clean up memory allocated for a plFree2dGrid( a, *nx, *ny ); } -/* 1-d transformation */ +// 1-d transformation void PLSHADE17( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, @@ -315,7 +315,7 @@ int i, j; PLcGrid cgrid; -/* Create a vectored a array from transpose of the fortran z array. */ +// Create a vectored a array from transpose of the fortran z array. plAlloc2dGrid( &a, *nx, *ny ); for ( i = 0; i < *nx; i++ ) { @@ -336,11 +336,11 @@ *min_color, *min_width, *max_color, *max_width, c_plfill, rect, pltr1, ( PLPointer ) & cgrid ); -/* Clean up memory allocated for a */ +// Clean up memory allocated for a plFree2dGrid( a, *nx, *ny ); } -/* 2-d transformation */ +// 2-d transformation void PLSHADE27( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, @@ -356,7 +356,7 @@ int i, j; PLcGrid2 cgrid2; -/* Create a vectored a array from transpose of the fortran z array. */ +// Create a vectored a array from transpose of the fortran z array. plAlloc2dGrid( &a, *nx, *ny ); plAlloc2dGrid( &cgrid2.xg, *nx, *ny ); plAlloc2dGrid( &cgrid2.yg, *nx, *ny ); @@ -379,7 +379,7 @@ *min_color, *min_width, *max_color, *max_width, c_plfill, rect, pltr2, (void *) &cgrid2 ); -/* Clean up memory allocated for a */ +// Clean up memory allocated for a plFree2dGrid( a, *nx, *ny ); plFree2dGrid( cgrid2.xg, *nx, *ny ); plFree2dGrid( cgrid2.yg, *nx, *ny ); @@ -397,7 +397,7 @@ PLFLT ** a; int i, j; -/* Create a vectored a array from transpose of the fortran z array. */ +// Create a vectored a array from transpose of the fortran z array. plAlloc2dGrid( &a, *nx, *ny ); for ( i = 0; i < *nx; i++ ) { @@ -414,19 +414,19 @@ *min_color, *min_width, *max_color, *max_width, c_plfill, rect, pltr, (void *) ftr ); -/* Clean up memory allocated for a */ +// Clean up memory allocated for a plFree2dGrid( a, *nx, *ny ); } -/*----------------------------------------------------------------------*\ - * plshades front-ends. - * - * - plshades0 map indices to xmin, xmax, ymin, ymax - * - plshades1 linear inter... [truncated message content] |
From: <ai...@us...> - 2010-11-01 22:41:58
|
Revision: 11296 http://plplot.svn.sourceforge.net/plplot/?rev=11296&view=rev Author: airwin Date: 2010-11-01 22:41:50 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Add the characters "#", "_", "\", and "+" to the list of those that are considered as special horizontal-rule comment characters that are transformed to standard form. Modified Paths: -------------- trunk/bindings/python/plplot_widgetmodule.c trunk/drivers/xwin.c trunk/scripts/convert_comment.py trunk/src/pdfutils.c Modified: trunk/bindings/python/plplot_widgetmodule.c =================================================================== --- trunk/bindings/python/plplot_widgetmodule.c 2010-11-01 22:19:45 UTC (rev 11295) +++ trunk/bindings/python/plplot_widgetmodule.c 2010-11-01 22:41:50 UTC (rev 11296) @@ -55,7 +55,7 @@ #endif -// ############################################################################## +//-------------------------------------------------------------------------- static PyMethodDef plplot_widget_methods[] = { #ifdef ENABLE_tk Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2010-11-01 22:19:45 UTC (rev 11295) +++ trunk/drivers/xwin.c 2010-11-01 22:41:50 UTC (rev 11296) @@ -1259,7 +1259,7 @@ dev->exit_eventloop = FALSE; } -//------------------------------------------------------------\* +//-------------------------------------------------------------------------- // events_thread() // // This function is being running continously by a tread and is Modified: trunk/scripts/convert_comment.py =================================================================== --- trunk/scripts/convert_comment.py 2010-11-01 22:19:45 UTC (rev 11295) +++ trunk/scripts/convert_comment.py 2010-11-01 22:41:50 UTC (rev 11296) @@ -178,7 +178,7 @@ # Remove "*\" from end of comment lines line = re.sub(r'^//(.*)\*\\$', "//\\1", line) # Convert long "horizontal line" comment forms to standard form. - line = re.sub(r'^// *[-*=/ ]{50,200}$', "//--------------------------------------------------------------------------", line) + line = re.sub(r'^// *[-*=/+_\\# ]{50,200}$', "//--------------------------------------------------------------------------", line) # Look for trailing continuation after comment lines and # complain if you find any. start_special = line.rfind("\\") Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2010-11-01 22:19:45 UTC (rev 11295) +++ trunk/src/pdfutils.c 2010-11-01 22:41:50 UTC (rev 11296) @@ -720,7 +720,7 @@ // lsb means least significant bit // // 1 8 23 -// _____________________________________________________________________ +//-------------------------------------------------------------------------- // | | | | // | s | e | f | // |___|________________|______________________________________________| @@ -734,7 +734,7 @@ // lsb means least significant bit // // 1 11 52 -// _____________________________________________________________________ +//-------------------------------------------------------------------------- // | | | | // | s | e | f | // |___|________________|______________________________________________| This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-02 17:21:16
|
Revision: 11301 http://plplot.svn.sourceforge.net/plplot/?rev=11301&view=rev Author: airwin Date: 2010-11-02 17:21:08 +0000 (Tue, 02 Nov 2010) Log Message: ----------- Complete comments styling for our Java code. This work combined with our previous work for C and C++ comments styling completes all planned comments styling upgrades for PLplot. Modified Paths: -------------- trunk/bindings/java/PLStream.java trunk/examples/java/x01.java trunk/examples/java/x02.java trunk/examples/java/x03.java trunk/examples/java/x04.java trunk/examples/java/x05.java trunk/examples/java/x06.java trunk/examples/java/x07.java trunk/examples/java/x08.java trunk/examples/java/x09.java trunk/examples/java/x10.java trunk/examples/java/x11.java trunk/examples/java/x12.java trunk/examples/java/x13.java trunk/examples/java/x14.java trunk/examples/java/x15.java trunk/examples/java/x16.java trunk/examples/java/x17.java trunk/examples/java/x18.java trunk/examples/java/x19.java trunk/examples/java/x20.java trunk/examples/java/x21.java trunk/examples/java/x22.java trunk/examples/java/x23.java trunk/examples/java/x24.java trunk/examples/java/x25.java trunk/examples/java/x26.java trunk/examples/java/x27.java trunk/examples/java/x28.java trunk/examples/java/x29.java Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/bindings/java/PLStream.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,4 +1,4 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // // Copyright (C) 2004 Andrew Ross // Modified: trunk/examples/java/x01.java =================================================================== --- trunk/examples/java/x01.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x01.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -23,11 +23,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 1 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -288,6 +288,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x01.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x02.java =================================================================== --- trunk/examples/java/x02.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x02.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2002 Alan W. Irwin // Copyright (C) 2004,2005 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 2 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -177,6 +177,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x02.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x03.java =================================================================== --- trunk/examples/java/x03.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x03.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 3 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -134,6 +134,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x03.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x04.java =================================================================== --- trunk/examples/java/x04.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x04.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 4 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -130,6 +130,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x04.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x05.java =================================================================== --- trunk/examples/java/x05.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x05.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 5 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -73,6 +73,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x05.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x06.java =================================================================== --- trunk/examples/java/x06.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x06.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 6 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -121,6 +121,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x06.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x07.java =================================================================== --- trunk/examples/java/x07.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x07.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002 Alan W. Irwin // Copyright (C) 2001 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 7 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -118,6 +118,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x07.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x08.java =================================================================== --- trunk/examples/java/x08.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x08.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002, 2003, 2004 Alan W. Irwin // Copyright (C) 2002 Maurice LeBrun @@ -23,11 +23,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 8 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -81,8 +81,8 @@ } else { - h[0] = 240; /* blue -> green -> yellow -> */ - h[1] = 0; /* -> red */ + h[0] = 240; // blue -> green -> yellow -> + h[1] = 0; // -> red l[0] = 0.6; l[1] = 0.6; @@ -155,11 +155,11 @@ { z[i][j] = Math.pow( 1. - xx, 2. ) + 100 * Math.pow( yy - Math.pow( xx, 2. ), 2. ); - /* The log argument may be zero for just the right grid. */ + // The log argument may be zero for just the right grid. if ( z[i][j] > 0. ) z[i][j] = Math.log( z[i][j] ); else - z[i][j] = -5.; /* -MAXFLOAT would mess-up up the scale */ + z[i][j] = -5.; // -MAXFLOAT would mess-up up the scale } else { @@ -200,24 +200,24 @@ pls.col0( 2 ); - if ( ifshade == 0 ) /* diffuse light surface plot */ + if ( ifshade == 0 ) // diffuse light surface plot { cmap1_init( 1 ); // with new interface haven't yet made null work so have // to put in specific zero-length array. pls.surf3d( x, y, z, 0, clev_null ); } - else if ( ifshade == 1 ) /* magnitude colored plot */ + else if ( ifshade == 1 ) // magnitude colored plot { cmap1_init( 0 ); pls.surf3d( x, y, z, PLStream.MAG_COLOR, clev_null ); } - else if ( ifshade == 2 ) /* magnitude colored plot with faceted squares */ + else if ( ifshade == 2 ) // magnitude colored plot with faceted squares { cmap1_init( 0 ); pls.surf3d( x, y, z, PLStream.MAG_COLOR | PLStream.FACETED, clev_null ); } - else /* magnitude colored plot with contours */ + else // magnitude colored plot with contours { cmap1_init( 0 ); pls.surf3d( x, y, z, PLStream.MAG_COLOR | PLStream.SURF_CONT | PLStream.BASE_CONT, clevel ); @@ -229,6 +229,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x08.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x09.java =================================================================== --- trunk/examples/java/x09.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x09.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001, 2002 Geoffrey Furnish // Copyright (C) 2002, 2003 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 9 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -88,11 +88,11 @@ // Parse and process command line arguments. pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); - /* Initialize plplot */ + // Initialize plplot pls.init(); - /* Set up function arrays */ + // Set up function arrays for ( i = 0; i < XPTS; i++ ) { @@ -105,7 +105,7 @@ } } - /* Set up grids */ + // Set up grids for ( i = 0; i < XPTS; i++ ) @@ -137,17 +137,17 @@ // Plot using scaled identity transform used to create xg0 and yg0 -/* pls.setcontlabelparam(0.006, 0.3, 0.1, 0); - * pls.env(-1.0, 1.0, -1.0, 1.0, 0, 0); - * pls.col0(2); - * pls.cont( z, 1, XPTS, 1, YPTS, clevel, xg0, yg0 ); - * pls.styl(mark, space); - * pls.col0(3); - * pls.cont(w, 1, XPTS, 1, YPTS, clevel, xg0, yg0 ); - * pls.styl(mark0, space0); - * pls.col0(1); - * pls.lab("X Coordinate", "Y Coordinate", "Streamlines of flow"); - */ +// pls.setcontlabelparam(0.006, 0.3, 0.1, 0); +// pls.env(-1.0, 1.0, -1.0, 1.0, 0, 0); +// pls.col0(2); +// pls.cont( z, 1, XPTS, 1, YPTS, clevel, xg0, yg0 ); +// pls.styl(mark, space); +// pls.col0(3); +// pls.cont(w, 1, XPTS, 1, YPTS, clevel, xg0, yg0 ); +// pls.styl(mark0, space0); +// pls.col0(1); +// pls.lab("X Coordinate", "Y Coordinate", "Streamlines of flow"); +// pls.setcontlabelformat( 4, 3 ); pls.setcontlabelparam( 0.006, 0.3, 0.1, 1 ); pls.env( -1.0, 1.0, -1.0, 1.0, 0, 0 ); @@ -172,18 +172,18 @@ pls.col0( 1 ); pls.lab( "X Coordinate", "Y Coordinate", "Streamlines of flow" ); -/* pls.setcontlabelparam(0.006, 0.3, 0.1, 1); - * pls.env(-1.0, 1.0, -1.0, 1.0, 0, 0); - * pls.col0(2); - * pls.cont(z, 1, XPTS, 1, YPTS, clevel, xg1, yg1 ); - * pls.styl(mark, space); - * pls.col0(3); - * pls.cont(w, 1, XPTS, 1, YPTS, clevel, xg1, yg1 ); - * pls.styl(mark0, space0); - * pls.col0(1); - * pls.lab("X Coordinate", "Y Coordinate", "Streamlines of flow"); - * pls.setcontlabelparam(0.006, 0.3, 0.1, 0); - */ +// pls.setcontlabelparam(0.006, 0.3, 0.1, 1); +// pls.env(-1.0, 1.0, -1.0, 1.0, 0, 0); +// pls.col0(2); +// pls.cont(z, 1, XPTS, 1, YPTS, clevel, xg1, yg1 ); +// pls.styl(mark, space); +// pls.col0(3); +// pls.cont(w, 1, XPTS, 1, YPTS, clevel, xg1, yg1 ); +// pls.styl(mark0, space0); +// pls.col0(1); +// pls.lab("X Coordinate", "Y Coordinate", "Streamlines of flow"); +// pls.setcontlabelparam(0.006, 0.3, 0.1, 0); +// // Plot using 2d coordinate transform pls.env( -1.0, 1.0, -1.0, 1.0, 0, 0 ); pls.col0( 2 ); @@ -195,28 +195,28 @@ pls.col0( 1 ); pls.lab( "X Coordinate", "Y Coordinate", "Streamlines of flow" ); -/* pls.setcontlabelparam(0.006, 0.3, 0.1, 1); - * pls.env(-1.0, 1.0, -1.0, 1.0, 0, 0); - * pls.col0(2); - * pls.cont(z, 1, XPTS, 1, YPTS, clevel, xg2, yg2 ); - * pls.styl(mark, space); - * pls.col0(3); - * pls.cont(w, 1, XPTS, 1, YPTS, clevel, xg2, yg2 ); - * pls.styl(mark0, space0); - * pls.col0(1); - * pls.lab("X Coordinate", "Y Coordinate", "Streamlines of flow"); - * pls.setcontlabelparam(0.006, 0.3, 0.1, 0); - */ +// pls.setcontlabelparam(0.006, 0.3, 0.1, 1); +// pls.env(-1.0, 1.0, -1.0, 1.0, 0, 0); +// pls.col0(2); +// pls.cont(z, 1, XPTS, 1, YPTS, clevel, xg2, yg2 ); +// pls.styl(mark, space); +// pls.col0(3); +// pls.cont(w, 1, XPTS, 1, YPTS, clevel, xg2, yg2 ); +// pls.styl(mark0, space0); +// pls.col0(1); +// pls.lab("X Coordinate", "Y Coordinate", "Streamlines of flow"); +// pls.setcontlabelparam(0.006, 0.3, 0.1, 0); +// polar(); -/* pls.setcontlabelparam(0.006, 0.3, 0.1, 1); - * polar(); - * pls.setcontlabelparam(0.006, 0.3, 0.1, 0); - */ +// pls.setcontlabelparam(0.006, 0.3, 0.1, 1); +// polar(); +// pls.setcontlabelparam(0.006, 0.3, 0.1, 0); +// potential(); -/* pls.setcontlabelparam(0.006, 0.3, 0.1, 1); - * potential(); - * pls.setcontlabelparam(0.006, 0.3, 0.1, 0); - */ +// pls.setcontlabelparam(0.006, 0.3, 0.1, 1); +// potential(); +// pls.setcontlabelparam(0.006, 0.3, 0.1, 0); +// pls.end(); } @@ -375,14 +375,14 @@ zmin = fmin; zmax = fmax; - /* printf("%.15g %.15g %.15g %.15g %.15g %.15g %.15g %.15g \n", - * q1, d1, q1i, d1i, q2, d2, q2i, d2i); - * System.out.println(xmin); - * System.out.println(xmax); - * System.out.println(ymin); - * System.out.println(ymax); - * System.out.println(zmin); - * System.out.println(zmax); */ + // printf("%.15g %.15g %.15g %.15g %.15g %.15g %.15g %.15g \n", + // q1, d1, q1i, d1i, q2, d2, q2i, d2i); + // System.out.println(xmin); + // System.out.println(xmax); + // System.out.println(ymin); + // System.out.println(ymax); + // System.out.println(zmin); + // System.out.println(zmax); // Positive and negative contour levels. dz = ( zmax - zmin ) / (double) PNLEVEL; @@ -448,6 +448,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x09.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x10.java =================================================================== --- trunk/examples/java/x10.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x10.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 10 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -63,6 +63,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x10.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x11.java =================================================================== --- trunk/examples/java/x11.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x11.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002, 2003 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 11 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -61,8 +61,8 @@ i[0] = 0.0; // left boundary i[1] = 1.0; // right boundary - h[0] = 240; /* blue -> green -> yellow -> */ - h[1] = 0; /* -> red */ + h[0] = 240; // blue -> green -> yellow -> + h[1] = 0; // -> red l[0] = 0.6; l[1] = 0.6; @@ -123,7 +123,7 @@ z[i][j] = 3. * ( 1. - xx ) * ( 1. - xx ) * Math.exp( -( xx * xx ) - ( yy + 1. ) * ( yy + 1. ) ) - 10. * ( xx / 5. - Math.pow( xx, 3. ) - Math.pow( yy, 5. ) ) * Math.exp( -xx * xx - yy * yy ) - 1. / 3. * Math.exp( -( xx + 1 ) * ( xx + 1 ) - ( yy * yy ) ); - if ( false ) /* Jungfraujoch/Interlaken */ + if ( false ) // Jungfraujoch/Interlaken { if ( z[i][j] < -1. ) z[i][j] = -1.; @@ -157,19 +157,19 @@ pls.col0( 2 ); - /* wireframe plot */ + // wireframe plot if ( i == 0 ) pls.mesh( x, y, z, opt[k] ); - /* magnitude colored wireframe plot */ + // magnitude colored wireframe plot else if ( i == 1 ) pls.mesh( x, y, z, opt[k] | PLStream.MAG_COLOR ); - /* magnitude colored wireframe plot with sides */ + // magnitude colored wireframe plot with sides else if ( i == 2 ) pls.plot3d( x, y, z, opt[k] | PLStream.MAG_COLOR, true ); - /* magnitude colored wireframe plot with base contour */ + // magnitude colored wireframe plot with base contour else if ( i == 3 ) pls.meshc( x, y, z, opt[k] | PLStream.MAG_COLOR | PLStream.BASE_CONT, clevel ); @@ -184,6 +184,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x11.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x12.java =================================================================== --- trunk/examples/java/x12.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x12.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 12 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -106,6 +106,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x12.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x13.java =================================================================== --- trunk/examples/java/x13.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x13.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2001, 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 13 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -109,6 +109,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x13.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x14.java =================================================================== --- trunk/examples/java/x14.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x14.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2004 Alan W. Irwin // Copyright (C) 2004 Andrew Ross // @@ -22,11 +22,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 14 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -383,7 +383,7 @@ final int[] mark0 = {}; final int[] space0 = {}; - /* Set up function arrays */ + // Set up function arrays for ( i = 0; i < XPTS; i++ ) { @@ -396,7 +396,7 @@ } } - /* Set up grids */ + // Set up grids for ( i = 0; i < XPTS; i++ ) @@ -433,6 +433,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x14.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x15.java =================================================================== --- trunk/examples/java/x15.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x15.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001, 2002 Geoffrey Furnish // Copyright (C) 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 15 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -132,7 +132,7 @@ pls.vpor( 0.1, 0.9, 0.1, 0.9 ); pls.wind( -1.0, 1.0, -1.0, 1.0 ); - /* Plot using identity transform */ + // Plot using identity transform shade_min = zmin + ( zmax - zmin ) * 0.4; shade_max = zmin + ( zmax - zmin ) * 0.6; @@ -178,7 +178,7 @@ pls.vpor( 0.1, 0.9, 0.1, 0.9 ); pls.wind( -1.0, 1.0, -1.0, 1.0 ); - /* Plot using identity transform */ + // Plot using identity transform for ( i = 0; i < 10; i++ ) { @@ -234,6 +234,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x15.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x16.java =================================================================== --- trunk/examples/java/x16.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x16.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 16 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -318,7 +318,7 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x16.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x17.java =================================================================== --- trunk/examples/java/x17.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x17.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2004 Andrew Ross <an...@co...> // Copyright (C) 2004 Alan W. Irwin // @@ -20,11 +20,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 17 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -174,6 +174,6 @@ } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x17.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x18.java =================================================================== --- trunk/examples/java/x18.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x18.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // Copyright (C) 2002 Alan W. Irwin // Copyright (C) 2004 Andrew Ross @@ -21,11 +21,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 18 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -181,6 +181,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x18.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x19.java =================================================================== --- trunk/examples/java/x19.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x19.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2001 Geoffrey Furnish // // This file is part of PLplot. @@ -19,11 +19,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 19 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- package plplot.examples; @@ -100,7 +100,7 @@ } if ( axis == PLStream.PL_Y_AXIS && value == 0.0 ) { - /* A special case for the equator */ + // A special case for the equator label = direction_label; } else @@ -237,6 +237,6 @@ } } -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // End of x19.java -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- Modified: trunk/examples/java/x20.java =================================================================== --- trunk/examples/java/x20.java 2010-11-02 17:16:33 UTC (rev 11300) +++ trunk/examples/java/x20.java 2010-11-02 17:21:08 UTC (rev 11301) @@ -1,8 +1,8 @@ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // $Id$ -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Copyright (C) 2004,2006 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // @@ -20,11 +20,11 @@ // You should have received a copy of the GNU Library General Public License // along with PLplot; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // Implementation of PLplot example 20 in Java. -//---------------------------------------------------------------------------// +//-------------------------------------------------------------------------- // // Current user defined command line options are not supported in @@ -115,15 +115,15 @@ double xg[][], yg[][]; - /* - * Bugs in plimage(): - * -at high magnifications, the left and right edge are ragged, try - * ./x20c -dev xwin -wplt 0.3,0.3,0.6,0.6 -ori 0.5 - * - * Bugs in x20c.c: - * -if the window is resized after a selection is made on "lena", when - * making a new selection the old one will re-appear. - */ + // + // Bugs in plimage(): + // -at high magnifications, the left and right edge are ragged, try + // ./x20c -dev xwin -wplt 0.3,0.3,0.6,0.6 -ori 0.5 + // + // Bugs in x20c.c: + // -if the window is resized after a selection is made on "lena", when + // making a new selection the old one will re-appear. + // // plplot initialization @@ -134,21 +134,21 @@ // Initialize PLplot. pls.init(); - /* view image border pixels */ + // view image border pixels if ( dbg ) { - pls.env( 1., (double) XDIM, 1., (double) YDIM, 1, 1 ); /* no plot box */ + pls.env( 1., (double) XDIM, 1., (double) YDIM, 1, 1 ); // no plot box - /* build a one pixel square border, for diagnostics */ + // build a one pixel square border, for diagnostics for ( i = 0; i < XDIM; i++ ) - z[i][YDIM - 1] = 1.; /* right */ + z[i][YDIM - 1] = 1.; // right for ( i = 0; i < XDIM; i++ ) - z[i][0] = 1.; /* left */ + z[i][0] = 1.; // left for ( i = 0; i < YDIM; i++ ) - z[0][i] = 1.; /* top */ + z[0][i] = 1.; // top for ( i = 0; i < YDIM; i++ ) - z[XDIM - 1][i] = 1.; /* botton */ + z[XDIM - 1][i] = 1.; // botton pls.lab( "...around a blue square.", " ", "A red border should appear..." ); @@ -156,11 +156,11 @@ 1., (double) XDIM, 1., (double) YDIM ); } - /* sombrero-like demo */ + // sombrero-like demo if ( !nosombrero ) { r = new double[XDIM][YDIM]; - pls.col0( 2 ); /* draw a yellow plot box, useful for diagnostics! :( */ + pls.col0( 2 ); // draw a yellow plot box, useful for diagnostics! :( pls.env( 0., 2. * Math.PI, 0, 3. * Math.PI, 1, -1 ); for ( i = 0; i < XDIM; i++ ) @@ -180,13 +180,13 @@ pls.image( z, 0., 2. * Math.PI, 0., 3. * Math.PI, 0.05, 1., 0., 2. * Math.PI, 0., 3. * Math.PI ); - /* save the plot */ + // save the plot if ( f_name != null ) save_plot( f_name ); } - /* read Lena image */ + // read Lena image if ( ( img_f = read_img( "lena.pgm", n ) ) == null ) { if ( ( img_f = read_img( "../lena.pgm", n ) ) == null ) @@ -200,10 +200,10 @@ width = img_f.length; height = img_f[0].length; - /* set gray colormap */ + // set gray colormap gray_cmap( num_col ); - /* display Lena */ + // display Lena pls.env( 1., width, 1., height, 1, -1 ); if ( !nointeractive ) @@ -226,25 +226,25 @@ System.exit( 0 ); } - /* - * I'm unable to continue, clearing the plot and advancing to the next - * one, without hiting the enter key, or pressing the button... help! - * - * Forcing the xwin driver to leave locate mode and destroying the - * xhairs (in GetCursorCmd()) solves some problems, but I still have - * to press the enter key or press Button-2 to go to next plot, even - * if a pladv() is not present! Using plbop() solves the problem, but - * it shouldn't be needed! - */ + // + // I'm unable to continue, clearing the plot and advancing to the next + // one, without hiting the enter key, or pressing the button... help! + // + // Forcing the xwin driver to leave locate mode and destroying the + // xhairs (in GetCursorCmd()) solves some problems, but I still have + // to press the enter key or press Button-2 to go to next plot, even + // if a pladv() is not present! Using plbop() solves the problem, but + // it shouldn't be needed! + // - /* pls.bop(); */ + // pls.bop(); - /* - * spause(false), adv(0), spause(true), also works, - * but the above question remains. - * With this approach, the previous pause state is lost, - * as there is no API call to get its current state. - */ + // + // spause(false), adv(0), spause(true), also works, + // but the above question remains. + // With this approach, the previous pause state is lost, + // as there is no API call to get its current state. + // pls.spause( false ); pls.adv( 0 ); @@ -296,11 +296,11 @@ dy = 0.5 * height; stretch = 0.5; - /* In C / C++ the following would work, with plimagefr directly calling - * mypltr. For compatibilty with other language bindings the same effect - * can be achieved by generating the transformed grid first and then - * using pltr2. */ - /* plimagefr(img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, mypltr, (PLPointer) &stretch); */ + // In C / C++ the following would work, with plimagefr directly calling + // mypltr. For compatibilty with other language bindings the same effect + // can be achieved by generating the transformed grid first and then + // using pltr2. + // plimagefr(img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, mypltr, (PLPointer) &stretch); for ( i = 0; i <= width; i++ ) { @@ -326,7 +326,7 @@ StringTokenizer st; int i, j, w, h; - /* naive grayscale binary ppm reading. If you know how to, improve it */ + // naive grayscale binary ppm reading. If you know how to, improve it try { in = new BufferedReader( new FileReader( fname ) ); in2 = new DataInputStream( new DataInputStream( new BufferedInputStream( new FileInputStream( fname ) ) ) ); @@ -339,7 +339,7 @@ try { line = in.readLine(); - if ( line.compareTo( "P5\n" ) == 0 ) /* I only understand this! */ + if ( line.compareTo( "P5\n" ) == 0 ) // I only understand this! { System.out.println( line ); System.out.println( "unknown file format " + fname ); @@ -400,9 +400,9 @@ boolean start = false; boolean[] st = new boolean[1]; - pls.xormod( true, st ); /* enter xor mode to draw a selection rectangle */ ... [truncated message content] |
From: <ai...@us...> - 2010-11-03 06:32:30
|
Revision: 11303 http://plplot.svn.sourceforge.net/plplot/?rev=11303&view=rev Author: airwin Date: 2010-11-03 06:32:24 +0000 (Wed, 03 Nov 2010) Log Message: ----------- Temporarily disable pllegend in both bindings and examples for Python and OCaml to make it easier to do pllegend C API changes. Modified Paths: -------------- trunk/bindings/ocaml/plplot_impl.c trunk/bindings/swig-support/plplotcapi.i trunk/examples/ocaml/x04.ml trunk/examples/ocaml/x26.ml trunk/examples/python/xw04.py trunk/examples/python/xw26.py Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2010-11-02 18:37:50 UTC (rev 11302) +++ trunk/bindings/ocaml/plplot_impl.c 2010-11-03 06:32:24 UTC (rev 11303) @@ -802,7 +802,7 @@ lor_ml_list( Field( opt_array, i ), translate_legend_option ); } - pllegend( c_opt, Double_val( x ), Double_val( y ), + /* pllegend( c_opt, Double_val( x ), Double_val( y ), Double_val( plot_width ), Int_val( bg_color ), n_legend, c_opt_array, Double_val( text_offset ), Double_val( text_scale ), @@ -811,7 +811,7 @@ c_box_colors, c_box_patterns, (double *) box_scales, c_line_colors, c_line_styles, c_line_widths, c_symbol_colors, (double *) symbol_scales, c_symbol_numbers, - c_symbols ); + c_symbols ); */ CAMLreturn( Val_unit ); } Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2010-11-02 18:37:50 UTC (rev 11302) +++ trunk/bindings/swig-support/plplotcapi.i 2010-11-03 06:32:24 UTC (rev 11303) @@ -518,7 +518,8 @@ void pllab( const char *xlabel, const char *ylabel, const char *tlabel ); -#ifdef SWIG_PYTHON +//#ifdef SWIG_PYTHON +#if 0 %feature( "autodoc", "Create a discrete annotated legend using boxes, lines, and/or lines of symbols." ) pllegend; void pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, Modified: trunk/examples/ocaml/x04.ml =================================================================== --- trunk/examples/ocaml/x04.ml 2010-11-02 18:37:50 UTC (rev 11302) +++ trunk/examples/ocaml/x04.ml 2010-11-03 06:32:24 UTC (rev 11303) @@ -87,12 +87,12 @@ to do with boxes *) plscol0a 15 32 32 32 0.90; - pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array + (*pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array 1.0 1.0 2.0 1.0 text_colors text [||] [||] [||] line_colors line_styles line_widths - symbol_colors symbol_scales symbol_numbers symbols; + symbol_colors symbol_scales symbol_numbers symbols; *) () ) else if plot_type = 1 then ( @@ -111,12 +111,12 @@ to do with boxes and symbols *) plscol0a 15 32 32 32 0.90; - pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array + (*pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array 1.0 1.0 2.0 1.0 text_colors text [||] [||] [||] line_colors line_styles line_widths - [||] [||] [||] [||]; + [||] [||] [||] [||];*) () ) Modified: trunk/examples/ocaml/x26.ml =================================================================== --- trunk/examples/ocaml/x26.ml 2010-11-02 18:37:50 UTC (rev 11302) +++ trunk/examples/ocaml/x26.ml 2010-11-03 06:32:24 UTC (rev 11303) @@ -182,12 +182,12 @@ to do with boxes *) plscol0a 15 32 32 32 0.90; - pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array + (*pllegend [PL_LEGEND_BACKGROUND] 0.57 0.85 0.06 15 opt_array 1.0 1.0 2.0 1.0 text_colors legend_text [||] [||] [||] line_colors line_styles line_widths - symbol_colors symbol_scales symbol_numbers symbols; + symbol_colors symbol_scales symbol_numbers symbols;*) () (*--------------------------------------------------------------------------*\ Modified: trunk/examples/python/xw04.py =================================================================== --- trunk/examples/python/xw04.py 2010-11-02 18:37:50 UTC (rev 11302) +++ trunk/examples/python/xw04.py 2010-11-03 06:32:24 UTC (rev 11303) @@ -121,12 +121,12 @@ symbols[1] = 3 plscol0a( 15, 32, 32, 32, 0.90 ) - pllegend( PL_LEGEND_BACKGROUND, 0.57, 0.85, 0.06, 15, - opt_array, - 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ) +# pllegend( PL_LEGEND_BACKGROUND, 0.57, 0.85, 0.06, 15, +# opt_array, +# 1.0, 1.0, 2.0, +# 1., text_colors, text, +# box_colors, box_patterns, box_scales, +# line_colors, line_styles, line_widths, +# symbol_colors, symbol_scales, symbol_numbers, symbols ) main() Modified: trunk/examples/python/xw26.py =================================================================== --- trunk/examples/python/xw26.py 2010-11-02 18:37:50 UTC (rev 11302) +++ trunk/examples/python/xw26.py 2010-11-03 06:32:24 UTC (rev 11303) @@ -191,13 +191,13 @@ symbols[1] = 3 plscol0a( 15, 32, 32, 32, 0.90 ) - pllegend( PL_LEGEND_BACKGROUND, 0.57, 0.85, 0.06, 15, - opt_array, - 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ) +# pllegend( PL_LEGEND_BACKGROUND, 0.57, 0.85, 0.06, 15, +# opt_array, +# 1.0, 1.0, 2.0, +# 1., text_colors, text, +# box_colors, box_patterns, box_scales, +# line_colors, line_styles, line_widths, +# symbol_colors, symbol_scales, symbol_numbers, symbols ) main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-03 06:36:32
|
Revision: 11304 http://plplot.svn.sourceforge.net/plplot/?rev=11304&view=rev Author: airwin Date: 2010-11-03 06:36:26 +0000 (Wed, 03 Nov 2010) Log Message: ----------- Add bounding box and nrow/ncolumn capability to pllegend. Modified Paths: -------------- trunk/examples/c/x04c.c trunk/examples/c/x26c.c trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/examples/c/x04c.c =================================================================== --- trunk/examples/c/x04c.c 2010-11-03 06:32:24 UTC (rev 11303) +++ trunk/examples/c/x04c.c 2010-11-03 06:36:26 UTC (rev 11304) @@ -141,7 +141,9 @@ // to do with boxes. plscol0a( 15, 32, 32, 32, 0.90 ); - pllegend( PL_LEGEND_BACKGROUND, 0.57, 0.85, 0.06, 15, + pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + 0.57, 0.85, 0.06, 15, + 1, 1, 0, 0, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, Modified: trunk/examples/c/x26c.c =================================================================== --- trunk/examples/c/x26c.c 2010-11-03 06:32:24 UTC (rev 11303) +++ trunk/examples/c/x26c.c 2010-11-03 06:36:26 UTC (rev 11304) @@ -240,7 +240,9 @@ // to do with boxes. plscol0a( 15, 32, 32, 32, 0.90 ); - pllegend( PL_LEGEND_BACKGROUND, 0.57, 0.85, 0.06, 15, + pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + 0.57, 0.85, 0.06, 15, + 1, 1, 0, 0, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) legend_text, Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2010-11-03 06:32:24 UTC (rev 11303) +++ trunk/include/plplot.h 2010-11-03 06:36:26 UTC (rev 11304) @@ -1209,15 +1209,19 @@ // Routine for drawing line, symbol, cmap0, or cmap1 legends // Flags for pllegend. -#define PL_LEGEND_NONE 1 -#define PL_LEGEND_COLOR_BOX 2 -#define PL_LEGEND_LINE 4 -#define PL_LEGEND_SYMBOL 8 -#define PL_LEGEND_TEXT_LEFT 16 -#define PL_LEGEND_BACKGROUND 32 +#define PL_LEGEND_NONE 1 +#define PL_LEGEND_COLOR_BOX 2 +#define PL_LEGEND_LINE 4 +#define PL_LEGEND_SYMBOL 8 +#define PL_LEGEND_TEXT_LEFT 16 +#define PL_LEGEND_BACKGROUND 32 +#define PL_LEGEND_BOUNDING_BOX 64 +#define PL_LEGEND_ROW_MAJOR 128 PLDLLIMPEXP void -c_pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, +c_pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, + PLINT bg_color, PLINT bb_color, PLINT bb_style, + PLINT nrow, PLINT ncolumn, PLINT nlegend, const PLINT *opt_array, PLFLT text_offset, PLFLT text_scale, PLFLT text_spacing, PLFLT text_justification, Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2010-11-03 06:32:24 UTC (rev 11303) +++ trunk/src/pllegend.c 2010-11-03 06:36:26 UTC (rev 11304) @@ -164,7 +164,9 @@ //! void -c_pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, +c_pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, + PLINT bg_color, PLINT bb_color, PLINT bb_style, + PLINT nrow, PLINT ncolumn, PLINT nlegend, const PLINT *opt_array, PLFLT text_offset, PLFLT text_scale, PLFLT text_spacing, PLFLT text_justification, @@ -185,8 +187,8 @@ PLFLT text_x, text_y, text_x_world, text_y_world; // Character height (world coordinates) PLFLT character_height, character_width, symbol_width; - // y-position of the current legend entry - PLFLT ty, dty; + // x, y-position of the current legend entry + PLFLT ty, xshift, drow, dcolumn; // Positions of the legend entries PLFLT dxs, *xs, *ys, xl[2], yl[2], xbox[4], ybox[4]; PLINT i, j; @@ -203,11 +205,25 @@ PLFLT xdmin_save, xdmax_save, ydmin_save, ydmax_save; PLFLT x_world_per_mm, y_world_per_mm, text_width0 = 0., text_width; - PLFLT total_width_border, total_width, total_height; + PLFLT width_border, column_separation, total_width, total_height; PLINT some_boxes = 0, some_lines = 0, some_symbols = 0; PLINT max_symbol_numbers = 0; + PLINT irow = 0, icolumn = 0; + // Default nrow, ncolumn. + nrow = MAX( nrow, 1 ); + ncolumn = MAX( ncolumn, 1 ); + if ( nrow * ncolumn < nlegend ) + { + // Make smaller one large enough to accomodate nlegend. + if ( ncolumn < nrow ) + ncolumn = ( nlegend % nrow ) ? ( nlegend / nrow ) + 1 : nlegend / nrow; + else + nrow = ( nlegend % ncolumn ) ? ( nlegend / ncolumn ) + 1 : nlegend / ncolumn; + } + // fprintf(stdout, "nrow, ncolumn = %d, %d\n", nrow, ncolumn); + plgvpd( &xdmin_save, &xdmax_save, &ydmin_save, &ydmax_save ); plgvpw( &xwmin_save, &xwmax_save, &ywmin_save, &ywmax_save ); // viewport corresponds to sub-page so that all legends will @@ -262,9 +278,16 @@ // make small border area where only the background is plotted // for left and right of legend. 0.4 seems to be a reasonable factor // that gives a good-looking result. - total_width_border = 0.4 * character_width; - total_width = 2. * total_width_border + text_width + ( xmax - xmin ) * plot_width; - total_height = nlegend * text_spacing * character_height; + width_border = 0.4 * character_width; + // Separate columns (if any) by 2.0 * character_width. + column_separation = 2.0 * character_width; + total_width = 2. * width_border + ( ncolumn - 1 ) * column_separation + + ncolumn * ( text_width + ( xmax - xmin ) * plot_width ); + total_height = nrow * text_spacing * character_height; + // dcolumn is the spacing from one column to the next and + // drow is the spacing from one row to the next. + dcolumn = column_separation + text_width + ( xmax - xmin ) * plot_width; + drow = text_spacing * character_height; if ( opt & PL_LEGEND_BACKGROUND ) { @@ -286,6 +309,28 @@ plcol0( col0_save ); } + if ( opt & PL_LEGEND_BOUNDING_BOX ) + { + PLFLT xbb[5] = { + plot_x_world, + plot_x_world, + plot_x_world + total_width, + plot_x_world + total_width, + plot_x_world, + }; + PLFLT ybb[5] = { + plot_y_world, + plot_y_world - total_height, + plot_y_world - total_height, + plot_y_world, + plot_y_world, + }; + pllsty( bb_style ); + plcol0( bb_color ); + plline( 5, xbb, ybb ); + plcol0( col0_save ); + } + if ( opt & PL_LEGEND_TEXT_LEFT ) { // text area on left, plot area on right. @@ -294,24 +339,10 @@ plot_x_end_world += text_width; } // adjust border after background is drawn. - plot_x_world += total_width_border; - plot_x_end_world += total_width_border; - text_x_world += total_width_border; + plot_x_world += width_border; + plot_x_end_world += width_border; + text_x_world += width_border; - if ( some_boxes ) - { - xbox[0] = plot_x_world; - xbox[1] = plot_x_world; - xbox[2] = plot_x_end_world; - xbox[3] = plot_x_end_world; - } - - if ( some_lines ) - { - xl[0] = plot_x_world; - xl[1] = plot_x_end_world; - } - if ( some_symbols ) { max_symbol_numbers = MAX( 2, max_symbol_numbers ); @@ -330,16 +361,15 @@ fabs( ( xmax - xmin ) / ( ymax - ymin ) ); } - dty = text_spacing * character_height; - ty = text_y_world + 0.5 * dty; // Draw each legend entry for ( i = 0; i < nlegend; i++ ) { // y position of text, lines, symbols, and/or centre of cmap0 box. - ty = ty - dty; + ty = text_y_world - ( (double) irow + 0.5 ) * drow; + xshift = (double) icolumn * dcolumn; // Label/name for the legend plcol0( text_colors[i] ); - plptex( text_x_world + text_justification * text_width0, ty, 0.1, 0.0, text_justification, text[i] ); + plptex( text_x_world + xshift + text_justification * text_width0, ty, 0.1, 0.0, text_justification, text[i] ); if ( !( opt_array[i] & PL_LEGEND_NONE ) ) { @@ -347,10 +377,14 @@ { plcol0( box_colors[i] ); plpsty( box_patterns[i] ); - ybox[0] = ty + 0.5 * dty * box_scales[i]; - ybox[1] = ty - 0.5 * dty * box_scales[i]; - ybox[2] = ty - 0.5 * dty * box_scales[i]; - ybox[3] = ty + 0.5 * dty * box_scales[i]; + xbox[0] = plot_x_world + xshift; + xbox[1] = xbox[0]; + xbox[2] = plot_x_end_world + xshift; + xbox[3] = xbox[2]; + ybox[0] = ty + 0.5 * drow * box_scales[i]; + ybox[1] = ty - 0.5 * drow * box_scales[i]; + ybox[2] = ty - 0.5 * drow * box_scales[i]; + ybox[3] = ty + 0.5 * drow * box_scales[i]; plfill( 4, xbox, ybox ); } if ( opt_array[i] & PL_LEGEND_LINE ) @@ -358,6 +392,8 @@ plcol0( line_colors[i] ); pllsty( line_styles[i] ); plwid( line_widths[i] ); + xl[0] = plot_x_world + xshift; + xl[1] = plot_x_end_world + xshift; yl[0] = ty; yl[1] = ty; plline( 2, xl, yl ); @@ -372,12 +408,33 @@ dxs = ( plot_x_end_world - plot_x_world - symbol_width ) / (double) ( MAX( symbol_numbers[i], 2 ) - 1 ); for ( j = 0; j < symbol_numbers[i]; j++ ) { - xs[j] = plot_x_world + 0.5 * symbol_width + dxs * (double) j; + xs[j] = plot_x_world + xshift + + 0.5 * symbol_width + dxs * (double) j; ys[j] = ty; } plpoin( symbol_numbers[i], xs, ys, symbols[i] ); } } + + // Set irow, icolumn for next i value. + if ( opt & PL_LEGEND_ROW_MAJOR ) + { + icolumn++; + if ( icolumn >= ncolumn ) + { + icolumn = 0; + irow++; + } + } + else + { + irow++; + if ( irow >= nrow ) + { + irow = 0; + icolumn++; + } + } } if ( some_symbols ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-09 21:59:13
|
Revision: 11310 http://plplot.svn.sourceforge.net/plplot/?rev=11310&view=rev Author: airwin Date: 2010-11-09 21:59:06 +0000 (Tue, 09 Nov 2010) Log Message: ----------- Implement plstring which is designed to supersede plsymbol and plpoin when the glyph(s) you want to plot at each of the points can be expressed with a standard user input string. As with plmtex or plptex the standard input string can be UTF-8, or the ascii subset of UTF-8, or one of the standard PLplot text escape sequences. N.B. the use of plstring highlights that there are some vertical alignment issues with plptex (which is called internally by plstring) depending on the device driver that is being used. Change the API of pllegend to express the symbols (glyphs) used for each legend entry as a standard user input string (which allows pllegend to call plstring internally). Change the 4th and 26th example to use this new pllegend API and to also use plstring to plot the line in the non-legend part of the plot. Also, make the legend background colour more transparent (alpha changed from 0.90 to 0.70). Modified Paths: -------------- trunk/examples/c/x04c.c trunk/examples/c/x26c.c trunk/include/plplot.h trunk/src/pllegend.c trunk/src/plsym.c Modified: trunk/examples/c/x04c.c =================================================================== --- trunk/examples/c/x04c.c 2010-11-06 00:11:25 UTC (rev 11309) +++ trunk/examples/c/x04c.c 2010-11-09 21:59:06 UTC (rev 11310) @@ -47,13 +47,13 @@ static PLFLT freql[101], ampl[101], phase[101]; PLFLT f0, freq; PLINT nlegend; - char *text[2]; + char *text[2], *symbols[2]; PLINT opt_array[2]; PLINT text_colors[2]; PLINT line_colors[2]; PLINT line_styles[2]; PLINT line_widths[2]; - PLINT symbol_numbers[2], symbol_colors[2], symbols[2]; + PLINT symbol_numbers[2], symbol_colors[2]; PLFLT symbol_scales[2]; pladv( 0 ); @@ -110,7 +110,7 @@ plbox( "", 0.0, 0, "cmstv", 30.0, 3 ); plcol0( 3 ); plline( 101, freql, phase ); - plpoin( 101, freql, phase, 3 ); + plstring( 101, freql, phase, "*" ); plcol0( 3 ); plmtex( "r", 5.0, 0.5, 0.5, "Phase shift (degrees)" ); nlegend = 2; @@ -136,18 +136,18 @@ symbol_colors[1] = 3; symbol_scales[1] = 1.; symbol_numbers[1] = 4; - symbols[1] = 3; + symbols[1] = "*"; // from the above opt_arrays we can completely ignore everything // to do with boxes. - plscol0a( 15, 32, 32, 32, 0.90 ); + plscol0a( 15, 32, 32, 32, 0.70 ); pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, - 0.0, 0.0, 0.06, 15, + 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, NULL, NULL, NULL, line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); } Modified: trunk/examples/c/x26c.c =================================================================== --- trunk/examples/c/x26c.c 2010-11-06 00:11:25 UTC (rev 11309) +++ trunk/examples/c/x26c.c 2010-11-09 21:59:06 UTC (rev 11310) @@ -155,8 +155,9 @@ PLINT line_colors[2]; PLINT line_styles[2]; PLINT line_widths[2]; - PLINT symbol_numbers[2], symbol_colors[2], symbols[2]; + PLINT symbol_numbers[2], symbol_colors[2]; PLFLT symbol_scales[2]; + char *symbols[2]; pladv( 0 ); @@ -212,7 +213,7 @@ plbox( "", 0.0, 0, "cmstv", 30.0, 3 ); plcol0( 3 ); plline( 101, freql, phase ); - plpoin( 101, freql, phase, 3 ); + plstring( 101, freql, phase, "*" ); plcol0( 3 ); plmtex( "r", 5.0, 0.5, 0.5, alty_label ); } @@ -235,18 +236,18 @@ symbol_colors[1] = 3; symbol_scales[1] = 1.; symbol_numbers[1] = 4; - symbols[1] = 3; + symbols[1] = "*"; // from the above opt_arrays we can completely ignore everything // to do with boxes. - plscol0a( 15, 32, 32, 32, 0.90 ); + plscol0a( 15, 32, 32, 32, 0.70 ); pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, - 0.0, 0.0, 0.06, 15, + 0.0, 0.0, 0.10, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) legend_text, NULL, NULL, NULL, line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); } Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2010-11-06 00:11:25 UTC (rev 11309) +++ trunk/include/plplot.h 2010-11-09 21:59:06 UTC (rev 11310) @@ -764,6 +764,7 @@ #define plstar c_plstar #define plstart c_plstart #define plstransform c_plstransform +#define plstring c_plstring #define plstripa c_plstripa #define plstripc c_plstripc #define plstripd c_plstripd @@ -1237,7 +1238,7 @@ const PLINT *line_colors, const PLINT *line_styles, const PLINT *line_widths, const PLINT *symbol_colors, const PLFLT *symbol_scales, - const PLINT *symbol_numbers, const PLINT *symbols ); + const PLINT *symbol_numbers, const char **symbols ); // Sets position of the light source PLDLLIMPEXP void @@ -1737,6 +1738,15 @@ PLDLLIMPEXP void c_plstransform( void ( *coordinate_transform )( PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer ), PLPointer coordinate_transform_data ); +// Prints out the same string repeatedly at the n points in world +// coordinates given by the x and y arrays. Supersedes plpoin and +// plsymbol for the case where text refers to a unicode glyph either +// directly as UTF-8 or indirectly via the standard text escape +// sequences allowed for PLplot input strings. + +PLDLLIMPEXP void +c_plstring( PLINT n, PLFLT *x, PLFLT *y, const char *string ); + // Add a point to a stripchart. PLDLLIMPEXP void Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2010-11-06 00:11:25 UTC (rev 11309) +++ trunk/src/pllegend.c 2010-11-09 21:59:06 UTC (rev 11310) @@ -395,7 +395,7 @@ const PLINT *line_colors, const PLINT *line_styles, const PLINT *line_widths, const PLINT *symbol_colors, const PLFLT *symbol_scales, - const PLINT *symbol_numbers, const PLINT *symbols ) + const PLINT *symbol_numbers, const char **symbols ) { // Legend position @@ -414,8 +414,7 @@ line_style_save = plsc->line_style, line_width_save = plsc->width, pattern_save = plsc->patt; - PLFLT text_scale_save = plsc->chrht / plsc->chrdef, - symbol_scale_save = plsc->symht / plsc->symdef; + PLFLT text_scale_save = plsc->chrht / plsc->chrdef; // Saved external world coordinates of viewport. PLFLT xwmin_save, xwmax_save, ywmin_save, ywmax_save; // Saved external normalized coordinates of viewport. @@ -628,7 +627,7 @@ // AWI, no idea why must use 0.5 factor to get ends of symbol lines // to line up approximately correctly with plotted legend lines. // Factor should be unity. - symbol_width = 0.5 * get_character_or_symbol_height( FALSE ); + symbol_width = 0.5 * get_character_or_symbol_height( TRUE ); } // Draw each legend entry @@ -674,7 +673,7 @@ if ( opt_array[i] & PL_LEGEND_SYMBOL ) { plcol0( symbol_colors[i] ); - plssym( 0., symbol_scales[i] ); + plschr( 0., symbol_scales[i] ); dxs = ( plot_x_end_subpage - plot_x_subpage - symbol_width ) / (double) ( MAX( symbol_numbers[i], 2 ) - 1 ); for ( j = 0; j < symbol_numbers[i]; j++ ) { @@ -682,7 +681,7 @@ 0.5 * symbol_width + dxs * (double) j; ys[j] = ty; } - plpoin( symbol_numbers[i], xs, ys, symbols[i] ); + plstring( symbol_numbers[i], xs, ys, symbols[i] ); } } @@ -715,7 +714,6 @@ // Restore plcol0( col0_save ); plschr( 0., text_scale_save ); - plssym( 0., symbol_scale_save ); plpsty( pattern_save ); plvpor( xdmin_save, xdmax_save, ydmin_save, ydmax_save ); plwind( xwmin_save, xwmax_save, ywmin_save, ywmax_save ); Modified: trunk/src/plsym.c =================================================================== --- trunk/src/plsym.c 2010-11-06 00:11:25 UTC (rev 11309) +++ trunk/src/plsym.c 2010-11-09 21:59:06 UTC (rev 11310) @@ -78,6 +78,26 @@ plhrsh2( PLINT ch, PLINT x, PLINT y ); //-------------------------------------------------------------------------- +// void plstring() +// +// Prints out the same string repeatedly at the n points in world +// coordinates given by the x and y arrays. Supersedes plpoin and +// plsymbol for the case where text refers to a unicode glyph either +// directly as UTF-8 or indirectly via the standard text escape +// sequences allowed for PLplot input strings. +//-------------------------------------------------------------------------- + +void +c_plstring( PLINT n, PLFLT *x, PLFLT *y, const char *string ) +{ + PLINT i; + for ( i = 0; i < n; i++ ) + { + c_plptex( x[i], y[i], 1., 0., 0.5, string ); + } +} + +//-------------------------------------------------------------------------- // void plsym() // // Plots array y against x for n points using Hershey symbol "code". This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-10 04:29:00
|
Revision: 11313 http://plplot.svn.sourceforge.net/plplot/?rev=11313&view=rev Author: airwin Date: 2010-11-10 04:28:54 +0000 (Wed, 10 Nov 2010) Log Message: ----------- Finish propagating plstring (but not pllegend) to Java and Lua binding. Update examples 4 and 26 to use plstring (but not pllegend) for Java and Lua. These examples give the same results for Java and Lua, but will need further updating to agree with the corresponding C examples once pllegend is propagated to Java and Lua. Modified Paths: -------------- trunk/bindings/java/PLStream.java trunk/bindings/lua/plplotluac.i trunk/examples/java/x04.java trunk/examples/java/x26.java trunk/examples/lua/x04.lua trunk/examples/lua/x26.lua Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2010-11-10 02:12:35 UTC (rev 11312) +++ trunk/bindings/java/PLStream.java 2010-11-10 04:28:54 UTC (rev 11313) @@ -995,6 +995,12 @@ plplotjavac.plstransform( coordTrans, data ); } + public void string( double[] x, double[] y, String string ) + { + if ( set_stream() == -1 ) return; + plplotjavac.plstring( x, y, string ); + } + public void stripa( int id, int pen, double x, double y ) { if ( set_stream() == -1 ) return; Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2010-11-10 02:12:35 UTC (rev 11312) +++ trunk/bindings/lua/plplotluac.i 2010-11-10 04:28:54 UTC (rev 11313) @@ -1128,6 +1128,7 @@ %rename(ssym) plssym; %rename(star) plstar; %rename(start) plstart; +%rename(string) plstring; %rename(stripa) plstripa; %rename(stripc) plstripc; %rename(stripd) plstripd; Modified: trunk/examples/java/x04.java =================================================================== --- trunk/examples/java/x04.java 2010-11-10 02:12:35 UTC (rev 11312) +++ trunk/examples/java/x04.java 2010-11-10 04:28:54 UTC (rev 11313) @@ -124,6 +124,7 @@ pls.box( "", 0.0, 0, "cmstv", 30.0, 3 ); pls.col0( 3 ); pls.line( freql, phase ); + pls.string( freql, phase, "*" ); pls.col0( 3 ); pls.mtex( "r", 5.0, 0.5, 0.5, "Phase shift (degrees)" ); } Modified: trunk/examples/java/x26.java =================================================================== --- trunk/examples/java/x26.java 2010-11-10 02:12:35 UTC (rev 11312) +++ trunk/examples/java/x26.java 2010-11-10 04:28:54 UTC (rev 11313) @@ -198,6 +198,7 @@ pls.box( "", 0.0, 0, "cmstv", 30.0, 3 ); pls.col0( 3 ); pls.line( freql, phase ); + pls.string( freql, phase, "*" ); pls.col0( 3 ); pls.mtex( "r", 5.0, 0.5, 0.5, alty_label ); } Modified: trunk/examples/lua/x04.lua =================================================================== --- trunk/examples/lua/x04.lua 2010-11-10 02:12:35 UTC (rev 11312) +++ trunk/examples/lua/x04.lua 2010-11-10 04:28:54 UTC (rev 11313) @@ -80,6 +80,7 @@ pl.box("", 0, 0, "cmstv", 30, 3) pl.col0(3) pl.line(freql, phase) + pl.string(freql, phase, "*") pl.col0(3) pl.mtex("r", 5, 0.5, 0.5, "Phase shift (degrees)") end Modified: trunk/examples/lua/x26.lua =================================================================== --- trunk/examples/lua/x26.lua 2010-11-10 02:12:35 UTC (rev 11312) +++ trunk/examples/lua/x26.lua 2010-11-10 04:28:54 UTC (rev 11313) @@ -124,6 +124,7 @@ pl.box("", 0, 0, "cmstv", 30, 3) pl.col0(3) pl.line(freql, phase) + pl.string(freql, phase, "*") pl.col0(3) pl.mtex("r", 5, 0.5, 0.5, alty_label) end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-10 20:07:19
|
Revision: 11318 http://plplot.svn.sourceforge.net/plplot/?rev=11318&view=rev Author: airwin Date: 2010-11-10 20:07:12 +0000 (Wed, 10 Nov 2010) Log Message: ----------- Change pllegend API (for our core library and also for the python bindings) to make the internally calculated legend_width and legend_height accessible to the calling routine. Modified Paths: -------------- trunk/bindings/swig-support/plplotcapi.i trunk/examples/c/x04c.c trunk/examples/c/x26c.c trunk/examples/python/xw04.py trunk/examples/python/xw26.py trunk/examples/python/xw33.py trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2010-11-10 18:14:32 UTC (rev 11317) +++ trunk/bindings/swig-support/plplotcapi.i 2010-11-10 20:07:12 UTC (rev 11318) @@ -529,7 +529,8 @@ #ifdef SWIG_PYTHON %feature( "autodoc", "Create a discrete annotated legend using boxes, lines, and/or lines of symbols." ) pllegend; void -pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, +pllegend( PLFLT *OUTPUT, PLFLT *OUTPUT, + PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, PLINT bb_color, PLINT bb_style, PLINT nrow, PLINT ncolumn, PLINT n, const PLINT *Array, Modified: trunk/examples/c/x04c.c =================================================================== --- trunk/examples/c/x04c.c 2010-11-10 18:14:32 UTC (rev 11317) +++ trunk/examples/c/x04c.c 2010-11-10 20:07:12 UTC (rev 11318) @@ -55,6 +55,7 @@ PLINT line_widths[2]; PLINT symbol_numbers[2], symbol_colors[2]; PLFLT symbol_scales[2]; + PLFLT legend_width, legend_height; pladv( 0 ); @@ -141,7 +142,8 @@ // to do with boxes. plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + pllegend( &legend_width, &legend_height, + PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, Modified: trunk/examples/c/x26c.c =================================================================== --- trunk/examples/c/x26c.c 2010-11-10 18:14:32 UTC (rev 11317) +++ trunk/examples/c/x26c.c 2010-11-10 20:07:12 UTC (rev 11318) @@ -158,6 +158,7 @@ PLINT symbol_numbers[2], symbol_colors[2]; PLFLT symbol_scales[2]; char *symbols[2]; + PLFLT legend_width, legend_height; pladv( 0 ); @@ -241,7 +242,8 @@ // to do with boxes. plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + pllegend( &legend_width, &legend_height, + PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0, 0.10, 15, 1, 1, 0, 0, nlegend, opt_array, Modified: trunk/examples/python/xw04.py =================================================================== --- trunk/examples/python/xw04.py 2010-11-10 18:14:32 UTC (rev 11317) +++ trunk/examples/python/xw04.py 2010-11-10 20:07:12 UTC (rev 11318) @@ -122,6 +122,7 @@ plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, Modified: trunk/examples/python/xw26.py =================================================================== --- trunk/examples/python/xw26.py 2010-11-10 18:14:32 UTC (rev 11317) +++ trunk/examples/python/xw26.py 2010-11-10 20:07:12 UTC (rev 11318) @@ -192,11 +192,11 @@ plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) - main() Modified: trunk/examples/python/xw33.py =================================================================== --- trunk/examples/python/xw33.py 2010-11-10 18:14:32 UTC (rev 11317) +++ trunk/examples/python/xw33.py 2010-11-10 20:07:12 UTC (rev 11318) @@ -1,6 +1,6 @@ # -*- coding: utf-8; -*- # $Id$ -# Copyright (C) 2006-2010 Alan W. Irwin +# Copyright (C) 2010 Alan W. Irwin # Demonstrate most pllegend capability including unicode symbols. @@ -54,8 +54,8 @@ plvpor(0.25, 0.75, 0.25, 0.75) plwind(0.0, 1.0, 0.0, 1.0) plbox("bc", 0.0, 0, "bc", 0.0, 0) - plmtex("t", 7.5, 0.5, 0.5, "The 16 standard legend positions with") - plmtex("t", 6., 0.5, 0.5, "the same (0.05) offset in x and y") + plmtex("t", 8.0, 0.5, 0.5, "The 16 standard legend positions with") + plmtex("t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y") # Set up legend arrays with the correct size, type. nlegend = 1 @@ -94,7 +94,7 @@ line_colors[0] = 1 + (k % 8) symbol_colors[0] = 1 + (k % 8) - pllegend( opt, 0.05, 0.05, + (legend_width, legend_height) = pllegend( opt, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, @@ -106,7 +106,7 @@ plvpor(0.25, 0.75, 0.25, 0.75) plwind(0.0, 1.0, 0.0, 1.0) plbox("bc", 0.0, 0, "bc", 0.0, 0) - plmtex("t", 7.5, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR,") + plmtex("t", 8.0, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR,") plmtex("t", 6.0, 0.5, 0.5, "and position for the same legend data") # Set up legend arrays with the correct size, type. @@ -149,7 +149,7 @@ y = 0.1 nrow = 1 ncolumn = nlegend - pllegend( opt, x, y, + (legend_width, legend_height) = pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, @@ -160,7 +160,7 @@ y = 0.1 nrow = 1 ncolumn = nlegend - pllegend( opt, x, y, + (legend_width, legend_height) = pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, @@ -171,7 +171,7 @@ y = 0. nrow = nlegend ncolumn = 1 - pllegend( opt, x, y, + (legend_width, legend_height) = pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, @@ -182,7 +182,7 @@ y = 0. nrow = nlegend ncolumn = 1 - pllegend( opt, x, y, + (legend_width, legend_height) = pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, @@ -193,7 +193,7 @@ y = 0. nrow = 6 ncolumn = 2 - pllegend( opt, x, y, + (legend_width, legend_height) = pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, @@ -204,7 +204,7 @@ y = 0. nrow = 6 ncolumn = 2 - pllegend( opt, x, y, + (legend_width, legend_height) = pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, @@ -215,7 +215,7 @@ y = 0. nrow = 3 ncolumn = 3 - pllegend( opt, x, y, + (legend_width, legend_height) = pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, box_colors, box_patterns, box_scales, line_colors, line_styles, line_widths, Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2010-11-10 18:14:32 UTC (rev 11317) +++ trunk/include/plplot.h 2010-11-10 20:07:12 UTC (rev 11318) @@ -9,7 +9,7 @@ // affect any user programs in C as long as this file is included. // // Copyright (C) 1992 Maurice J. LeBrun, Geoff Furnish, Tony Richardson. -// Copyright (C) 2004 Alan W. Irwin +// Copyright (C) 2004-2010 Alan W. Irwin // Copyright (C) 2004 Rafael Laboissiere // Copyright (C) 2004 Andrew Ross // @@ -1226,7 +1226,8 @@ #define PL_LEGEND_OUTSIDE 8192 PLDLLIMPEXP void -c_pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, +c_pllegend( PLFLT *p_legend_width, PLFLT *p_legend_height, + PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, PLINT bb_color, PLINT bb_style, PLINT nrow, PLINT ncolumn, PLINT nlegend, const PLINT *opt_array, Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2010-11-10 18:14:32 UTC (rev 11317) +++ trunk/src/pllegend.c 2010-11-10 20:07:12 UTC (rev 11318) @@ -383,7 +383,8 @@ //! void -c_pllegend( PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, +c_pllegend( PLFLT *p_legend_width, PLFLT *p_legend_height, + PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, PLINT bb_color, PLINT bb_style, PLINT nrow, PLINT ncolumn, PLINT nlegend, const PLINT *opt_array, @@ -422,7 +423,7 @@ PLFLT x_subpage_per_mm, y_subpage_per_mm, text_width0 = 0., text_width; PLFLT width_border, column_separation, - total_width, total_height, total_width_vc, total_height_vc; + legend_width, legend_height, legend_width_vc, legend_height_vc; PLFLT x_legend_position, y_legend_position, xsign, ysign; PLINT some_boxes = 0, some_lines = 0, some_symbols = 0; @@ -526,16 +527,18 @@ column_separation = 2.0 * character_width; // Total width and height of legend area in normalized subpage coordinates. - total_width = 2. * width_border + ( ncolumn - 1 ) * column_separation + + legend_width = 2. * width_border + ( ncolumn - 1 ) * column_separation + ncolumn * ( text_width + viewport_to_subpage_x( plot_width ) - viewport_to_subpage_x( 0. ) ); - total_height = nrow * text_spacing * character_height; + legend_height = nrow * text_spacing * character_height; + *p_legend_width = legend_width; + *p_legend_height = legend_height; // Total width and height of legend area in normalized external viewport // coordinates. - total_width_vc = subpage_to_viewport_x( total_width ) - subpage_to_viewport_x( 0. ); - total_height_vc = subpage_to_viewport_y( total_height ) - subpage_to_viewport_y( 0. ); + legend_width_vc = subpage_to_viewport_x( legend_width ) - subpage_to_viewport_x( 0. ); + legend_height_vc = subpage_to_viewport_y( legend_height ) - subpage_to_viewport_y( 0. ); // dcolumn is the spacing from one column to the next and // drow is the spacing from one row to the next. @@ -543,7 +546,7 @@ viewport_to_subpage_x( plot_width ) - viewport_to_subpage_x( 0. ); drow = text_spacing * character_height; - legend_position( opt, total_width_vc, total_height_vc, &x_legend_position, &y_legend_position, &xsign, &ysign ); + legend_position( opt, legend_width_vc, legend_height_vc, &x_legend_position, &y_legend_position, &xsign, &ysign ); plot_x = x * xsign + x_legend_position; plot_y = y * ysign + y_legend_position; plot_x_end = plot_x + plot_width; @@ -564,13 +567,13 @@ PLFLT xbg[4] = { plot_x_subpage, plot_x_subpage, - plot_x_subpage + total_width, - plot_x_subpage + total_width, + plot_x_subpage + legend_width, + plot_x_subpage + legend_width, }; PLFLT ybg[4] = { plot_y_subpage, - plot_y_subpage - total_height, - plot_y_subpage - total_height, + plot_y_subpage - legend_height, + plot_y_subpage - legend_height, plot_y_subpage, }; plpsty( 0 ); @@ -584,14 +587,14 @@ PLFLT xbb[5] = { plot_x_subpage, plot_x_subpage, - plot_x_subpage + total_width, - plot_x_subpage + total_width, + plot_x_subpage + legend_width, + plot_x_subpage + legend_width, plot_x_subpage, }; PLFLT ybb[5] = { plot_y_subpage, - plot_y_subpage - total_height, - plot_y_subpage - total_height, + plot_y_subpage - legend_height, + plot_y_subpage - legend_height, plot_y_subpage, plot_y_subpage, }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-10 20:14:06
|
Revision: 11319 http://plplot.svn.sourceforge.net/plplot/?rev=11319&view=rev Author: airwin Date: 2010-11-10 20:14:00 +0000 (Wed, 10 Nov 2010) Log Message: ----------- Style previous commits. Modified Paths: -------------- trunk/examples/c/x04c.c trunk/examples/c/x26c.c trunk/src/plcore.c trunk/src/pllegend.c trunk/src/plsym.c Modified: trunk/examples/c/x04c.c =================================================================== --- trunk/examples/c/x04c.c 2010-11-10 20:07:12 UTC (rev 11318) +++ trunk/examples/c/x04c.c 2010-11-10 20:14:00 UTC (rev 11319) @@ -55,7 +55,7 @@ PLINT line_widths[2]; PLINT symbol_numbers[2], symbol_colors[2]; PLFLT symbol_scales[2]; - PLFLT legend_width, legend_height; + PLFLT legend_width, legend_height; pladv( 0 ); @@ -143,7 +143,7 @@ plscol0a( 15, 32, 32, 32, 0.70 ); pllegend( &legend_width, &legend_height, - PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, Modified: trunk/examples/c/x26c.c =================================================================== --- trunk/examples/c/x26c.c 2010-11-10 20:07:12 UTC (rev 11318) +++ trunk/examples/c/x26c.c 2010-11-10 20:14:00 UTC (rev 11319) @@ -158,7 +158,7 @@ PLINT symbol_numbers[2], symbol_colors[2]; PLFLT symbol_scales[2]; char *symbols[2]; - PLFLT legend_width, legend_height; + PLFLT legend_width, legend_height; pladv( 0 ); Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2010-11-10 20:07:12 UTC (rev 11318) +++ trunk/src/plcore.c 2010-11-10 20:14:00 UTC (rev 11319) @@ -2785,7 +2785,7 @@ else { // On Windows the first character is the drive letter - it is case-insensitive - if ( strncmp( builddir+1, currdir+1, strlen( builddir+1 ) ) == 0 && + if ( strncmp( builddir + 1, currdir + 1, strlen( builddir + 1 ) ) == 0 && tolower( builddir[0] ) == tolower( currdir[0] ) ) { inBuildTree = 1; Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2010-11-10 20:07:12 UTC (rev 11318) +++ trunk/src/pllegend.c 2010-11-10 20:14:00 UTC (rev 11319) @@ -411,11 +411,11 @@ PLFLT dxs, *xs, *ys, xl[2], yl[2], xbox[4], ybox[4]; PLINT i, j; // Active attributes to be saved and restored afterward. - PLINT col0_save = plsc->icol0, - line_style_save = plsc->line_style, - line_width_save = plsc->width, - pattern_save = plsc->patt; - PLFLT text_scale_save = plsc->chrht / plsc->chrdef; + PLINT col0_save = plsc->icol0, + line_style_save = plsc->line_style, + line_width_save = plsc->width, + pattern_save = plsc->patt; + PLFLT text_scale_save = plsc->chrht / plsc->chrdef; // Saved external world coordinates of viewport. PLFLT xwmin_save, xwmax_save, ywmin_save, ywmax_save; // Saved external normalized coordinates of viewport. @@ -528,10 +528,10 @@ // Total width and height of legend area in normalized subpage coordinates. legend_width = 2. * width_border + ( ncolumn - 1 ) * column_separation + - ncolumn * ( text_width + - viewport_to_subpage_x( plot_width ) - viewport_to_subpage_x( 0. ) ); - legend_height = nrow * text_spacing * character_height; - *p_legend_width = legend_width; + ncolumn * ( text_width + + viewport_to_subpage_x( plot_width ) - viewport_to_subpage_x( 0. ) ); + legend_height = nrow * text_spacing * character_height; + *p_legend_width = legend_width; *p_legend_height = legend_height; // Total width and height of legend area in normalized external viewport Modified: trunk/src/plsym.c =================================================================== --- trunk/src/plsym.c 2010-11-10 20:07:12 UTC (rev 11318) +++ trunk/src/plsym.c 2010-11-10 20:14:00 UTC (rev 11319) @@ -93,7 +93,7 @@ PLINT i; for ( i = 0; i < n; i++ ) { - c_plptex( x[i], y[i], 1., 0., 0.5, string ); + c_plptex( x[i], y[i], 1., 0., 0.5, string ); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-11 11:08:49
|
Revision: 11323 http://plplot.svn.sourceforge.net/plplot/?rev=11323&view=rev Author: airwin Date: 2010-11-11 11:08:42 +0000 (Thu, 11 Nov 2010) Log Message: ----------- Change .rc suffix on driver information files to .driver_info to avoid a potential name clash on Windows where .rc files have a special significance. The result was tested with scripts/comprehensive_test.sh --cmake_added_options -DPLD_pdf=ON \ --build_command 'make -j4' --do_nondynamic no --do_static no \ --do_ctest no --do_test_install_tree yes \ --do_test_traditional_install_tree no --do_test_interactive yes No issues were found during that comprehensive check. Modified Paths: -------------- trunk/cmake/modules/drivers-finish.cmake trunk/doc/docbook/src/deploying.xml trunk/drivers/CMakeLists.txt trunk/drivers/README.drivers trunk/src/plcore.c Added Paths: ----------- trunk/drivers/aqt.driver_info.in trunk/drivers/cairo.driver_info.in trunk/drivers/cgm.driver_info.in trunk/drivers/dg300.driver_info.in trunk/drivers/gcw.driver_info.in trunk/drivers/gd.driver_info.in trunk/drivers/hpgl.driver_info.in trunk/drivers/impress.driver_info.in trunk/drivers/linuxvga.driver_info.in trunk/drivers/ljii.driver_info.in trunk/drivers/ljiip.driver_info.in trunk/drivers/mem.driver_info.in trunk/drivers/ntk.driver_info.in trunk/drivers/null.driver_info.in trunk/drivers/pbm.driver_info.in trunk/drivers/pdf.driver_info.in trunk/drivers/plmeta.driver_info.in trunk/drivers/ps.driver_info.in trunk/drivers/pstex.driver_info.in trunk/drivers/psttf.driver_info.in trunk/drivers/qt.driver_info.in trunk/drivers/svg.driver_info.in trunk/drivers/tek.driver_info.in trunk/drivers/tk.driver_info.in trunk/drivers/tkwin.driver_info.in trunk/drivers/wingcc.driver_info.in trunk/drivers/wxwidgets.driver_info.in trunk/drivers/xfig.driver_info.in trunk/drivers/xwin.driver_info.in Removed Paths: ------------- trunk/drivers/aqt.rc.in trunk/drivers/cairo.rc.in trunk/drivers/cgm.rc.in trunk/drivers/dg300.rc.in trunk/drivers/gcw.rc.in trunk/drivers/gd.rc.in trunk/drivers/hpgl.rc.in trunk/drivers/impress.rc.in trunk/drivers/linuxvga.rc.in trunk/drivers/ljii.rc.in trunk/drivers/ljiip.rc.in trunk/drivers/mem.rc.in trunk/drivers/ntk.rc.in trunk/drivers/null.rc.in trunk/drivers/pbm.rc.in trunk/drivers/pdf.rc.in trunk/drivers/plmeta.rc.in trunk/drivers/ps.rc.in trunk/drivers/pstex.rc.in trunk/drivers/psttf.rc.in trunk/drivers/qt.rc.in trunk/drivers/svg.rc.in trunk/drivers/tek.rc.in trunk/drivers/tk.rc.in trunk/drivers/tkwin.rc.in trunk/drivers/wingcc.rc.in trunk/drivers/wxwidgets.rc.in trunk/drivers/xfig.rc.in trunk/drivers/xwin.rc.in Modified: trunk/cmake/modules/drivers-finish.cmake =================================================================== --- trunk/cmake/modules/drivers-finish.cmake 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/cmake/modules/drivers-finish.cmake 2010-11-11 11:08:42 UTC (rev 11323) @@ -69,12 +69,12 @@ if(APPEND_DRIVER) if(ENABLE_DYNDRIVERS) set(${DRIVER}_INFO) - if(EXISTS ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.rc.in) + if(EXISTS ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.driver_info.in) file(STRINGS - ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.rc.in + ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.driver_info.in ${DRIVER}_INFO ) - endif(EXISTS ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.rc.in) + endif(EXISTS ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.driver_info.in) endif(ENABLE_DYNDRIVERS) list(APPEND DRIVERS_LIST ${DRIVER}) @@ -118,7 +118,7 @@ endforeach(DRIVERS_DEVICE) # Calculate driver information and store it in -# ${CMAKE_BINARY_DIR}/drivers/${DRIVER}.rc for each driver to be compared +# ${CMAKE_BINARY_DIR}/drivers/${DRIVER}.driver_info for each driver to be compared # at run-time with the same information obtained from the actual # driver plug-in by test-drv-info as a check of the validity of # that plug-in (and consistency of the driver code with DRIVERS_DEVICE_LIST @@ -142,7 +142,7 @@ if(DEVICE_INFO_MATCHED) list(REMOVE_ITEM ${DRIVER}_INFO ${DEVICE_INFO_MATCHED}) else(DEVICE_INFO_MATCHED) - message(FATAL_ERROR "${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.rc.in not consistent with ${CMAKE_SOURCE_DIR}/cmake/modules/drivers-init.cmake") + message(FATAL_ERROR "${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.driver_info.in not consistent with ${CMAKE_SOURCE_DIR}/cmake/modules/drivers-init.cmake") endif(DEVICE_INFO_MATCHED) endif(NOT PLD_${DEVICE}) endif(${DRIVER}_INFO) @@ -151,9 +151,9 @@ foreach(DRIVERS_DEVICE ${DRIVERS_DEVICE_LIST}) string(REGEX REPLACE "^.*:(.*):.*:.*:.*$" "\\1" DRIVER ${DRIVERS_DEVICE}) if(${DRIVER}_INFO) - file(WRITE ${CMAKE_BINARY_DIR}/drivers/${DRIVER}.rc "") + file(WRITE ${CMAKE_BINARY_DIR}/drivers/${DRIVER}.driver_info "") foreach(DEVICE_INFO ${${DRIVER}_INFO}) - file(APPEND ${CMAKE_BINARY_DIR}/drivers/${DRIVER}.rc "${DEVICE_INFO}\n") + file(APPEND ${CMAKE_BINARY_DIR}/drivers/${DRIVER}.driver_info "${DEVICE_INFO}\n") endforeach(DEVICE_INFO ${${DRIVER}_INFO}) endif(${DRIVER}_INFO) endforeach(DRIVERS_DEVICE ${DRIVERS_DEVICE_LIST}) Modified: trunk/doc/docbook/src/deploying.xml =================================================================== --- trunk/doc/docbook/src/deploying.xml 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/doc/docbook/src/deploying.xml 2010-11-11 11:08:42 UTC (rev 11323) @@ -287,7 +287,7 @@ <para> When PLplot uses dynamic devices, it first builds up a list of them, by examining a directory which contains files describing those devices: - the <filename>*.rc</filename> files. Each of these files indicates what + the <filename>*.driver_info</filename> files. Each of these files indicates what the relevant properties for the device or devices. Then when the device is actually needed, the corresponding shared object (or plug-in or DLL depending on your terminology) is dynamically loaded. Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/CMakeLists.txt 2010-11-11 11:08:42 UTC (rev 11323) @@ -186,24 +186,24 @@ ) add_custom_command( OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.rc + ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.driver_info COMMAND test-drv-info ${SOURCE_ROOT_NAME} - > ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.rc + > ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.driver_info COMMAND ${CMAKE_COMMAND} -E compare_files - ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.rc - ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ROOT_NAME}.rc + ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.driver_info + ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ROOT_NAME}.driver_info DEPENDS ${${SOURCE_ROOT_NAME}_LOCATION} ${test-drv-info_LOCATION} ) add_custom_target(test_${SOURCE_ROOT_NAME}_dyndriver DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.rc + ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.driver_info ) set_property(GLOBAL PROPERTY FILE_DEPENDS_${SOURCE_ROOT_NAME}_dyndriver - ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.rc + ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.driver_info ) add_dependencies(test_${SOURCE_ROOT_NAME}_dyndriver test-drv-info @@ -217,7 +217,7 @@ DESTINATION ${DRV_DIR} ) install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ROOT_NAME}.rc + FILES ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ROOT_NAME}.driver_info DESTINATION ${DRV_DIR} ) endforeach(SOURCE_ROOT_NAME ${DRIVERS_LIST}) Modified: trunk/drivers/README.drivers =================================================================== --- trunk/drivers/README.drivers 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/README.drivers 2010-11-11 11:08:42 UTC (rev 11323) @@ -13,7 +13,7 @@ The following PLplot source-tree files are affected: -plplot/drivers/<driver>.rc.in +plplot/drivers/<driver>.driver_info.in plplot/cmake/modules/drivers-init.cmake plplot/include/drivers.h plplot/include/plDevs.h.cmake @@ -21,7 +21,7 @@ plplot/plplot-test/plplot-test.sh.cmake plplot/examples/plplot_configure.cmake_installed_examples.in -1. Add a line to plplot/drivers/<driver>.rc.in consisting of the following +1. Add a line to plplot/drivers/<driver>.driver_info.in consisting of the following colon-separated fields: <device>:<description string>:<interactive?>:<driver>:<device number>:<device> Copied: trunk/drivers/aqt.driver_info.in (from rev 11321, trunk/drivers/aqt.rc.in) =================================================================== --- trunk/drivers/aqt.driver_info.in (rev 0) +++ trunk/drivers/aqt.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +aqt:AquaTerm (Mac OS X):1:aqt:50:aqt Deleted: trunk/drivers/aqt.rc.in =================================================================== --- trunk/drivers/aqt.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/aqt.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -aqt:AquaTerm (Mac OS X):1:aqt:50:aqt Copied: trunk/drivers/cairo.driver_info.in (from rev 11321, trunk/drivers/cairo.rc.in) =================================================================== --- trunk/drivers/cairo.driver_info.in (rev 0) +++ trunk/drivers/cairo.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1,8 @@ +xcairo:Cairo X Windows Driver:1:cairo:100:xcairo +pdfcairo:Cairo PDF Driver:0:cairo:101:pdfcairo +pscairo:Cairo PS Driver:0:cairo:102:pscairo +svgcairo:Cairo SVG Driver:0:cairo:103:svgcairo +pngcairo:Cairo PNG Driver:0:cairo:104:pngcairo +memcairo:Cairo Memory Driver:0:cairo:105:memcairo +extcairo:Cairo External Context Driver:0:cairo:106:extcairo +wincairo:Cairo Microscoft Windows Driver:0:cairo:107:wincairo \ No newline at end of file Deleted: trunk/drivers/cairo.rc.in =================================================================== --- trunk/drivers/cairo.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/cairo.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1,8 +0,0 @@ -xcairo:Cairo X Windows Driver:1:cairo:100:xcairo -pdfcairo:Cairo PDF Driver:0:cairo:101:pdfcairo -pscairo:Cairo PS Driver:0:cairo:102:pscairo -svgcairo:Cairo SVG Driver:0:cairo:103:svgcairo -pngcairo:Cairo PNG Driver:0:cairo:104:pngcairo -memcairo:Cairo Memory Driver:0:cairo:105:memcairo -extcairo:Cairo External Context Driver:0:cairo:106:extcairo -wincairo:Cairo Microscoft Windows Driver:0:cairo:107:wincairo \ No newline at end of file Copied: trunk/drivers/cgm.driver_info.in (from rev 11321, trunk/drivers/cgm.rc.in) =================================================================== --- trunk/drivers/cgm.driver_info.in (rev 0) +++ trunk/drivers/cgm.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +cgm:CGM file:0:cgm:44:cgm Deleted: trunk/drivers/cgm.rc.in =================================================================== --- trunk/drivers/cgm.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/cgm.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -cgm:CGM file:0:cgm:44:cgm Copied: trunk/drivers/dg300.driver_info.in (from rev 11321, trunk/drivers/dg300.rc.in) =================================================================== --- trunk/drivers/dg300.driver_info.in (rev 0) +++ trunk/drivers/dg300.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +dg300:DG300 Terminal:0:dg300:25:dg300 Deleted: trunk/drivers/dg300.rc.in =================================================================== --- trunk/drivers/dg300.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/dg300.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -dg300:DG300 Terminal:0:dg300:25:dg300 Copied: trunk/drivers/gcw.driver_info.in (from rev 11321, trunk/drivers/gcw.rc.in) =================================================================== --- trunk/drivers/gcw.driver_info.in (rev 0) +++ trunk/drivers/gcw.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +gcw:Gnome Canvas Widget:1:gcw:10:gcw Deleted: trunk/drivers/gcw.rc.in =================================================================== --- trunk/drivers/gcw.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/gcw.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -gcw:Gnome Canvas Widget:1:gcw:10:gcw Copied: trunk/drivers/gd.driver_info.in (from rev 11321, trunk/drivers/gd.rc.in) =================================================================== --- trunk/drivers/gd.driver_info.in (rev 0) +++ trunk/drivers/gd.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1,3 @@ +png:PNG file:0:gd:39:png +jpeg:JPEG file:0:gd:40:jpeg +gif:GIF file:0:gd:47:gif Deleted: trunk/drivers/gd.rc.in =================================================================== --- trunk/drivers/gd.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/gd.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1,3 +0,0 @@ -png:PNG file:0:gd:39:png -jpeg:JPEG file:0:gd:40:jpeg -gif:GIF file:0:gd:47:gif Copied: trunk/drivers/hpgl.driver_info.in (from rev 11321, trunk/drivers/hpgl.rc.in) =================================================================== --- trunk/drivers/hpgl.driver_info.in (rev 0) +++ trunk/drivers/hpgl.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1,3 @@ +hp7470:HP 7470 Plotter File (HPGL Cartridge, Small Plotter):0:hpgl:34:hp7470 +hp7580:HP 7580 Plotter File (Large Plotter):0:hpgl:35:hp7580 +lj_hpgl:HP Laserjet III, HPGL emulation mode:0:hpgl:36:lj_hpgl Deleted: trunk/drivers/hpgl.rc.in =================================================================== --- trunk/drivers/hpgl.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/hpgl.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1,3 +0,0 @@ -hp7470:HP 7470 Plotter File (HPGL Cartridge, Small Plotter):0:hpgl:34:hp7470 -hp7580:HP 7580 Plotter File (Large Plotter):0:hpgl:35:hp7580 -lj_hpgl:HP Laserjet III, HPGL emulation mode:0:hpgl:36:lj_hpgl Copied: trunk/drivers/impress.driver_info.in (from rev 11321, trunk/drivers/impress.rc.in) =================================================================== --- trunk/drivers/impress.driver_info.in (rev 0) +++ trunk/drivers/impress.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +imp:Impress File:0:impress:37:imp Deleted: trunk/drivers/impress.rc.in =================================================================== --- trunk/drivers/impress.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/impress.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -imp:Impress File:0:impress:37:imp Copied: trunk/drivers/linuxvga.driver_info.in (from rev 11321, trunk/drivers/linuxvga.rc.in) =================================================================== --- trunk/drivers/linuxvga.driver_info.in (rev 0) +++ trunk/drivers/linuxvga.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +linuxvga:Linux VGA driver:0:linuxvga:8:vga Deleted: trunk/drivers/linuxvga.rc.in =================================================================== --- trunk/drivers/linuxvga.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/linuxvga.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -linuxvga:Linux VGA driver:0:linuxvga:8:vga Copied: trunk/drivers/ljii.driver_info.in (from rev 11321, trunk/drivers/ljii.rc.in) =================================================================== --- trunk/drivers/ljii.driver_info.in (rev 0) +++ trunk/drivers/ljii.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +ljii:LaserJet II Bitmap File (150 dpi):0:ljii:33:ljii Deleted: trunk/drivers/ljii.rc.in =================================================================== --- trunk/drivers/ljii.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/ljii.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -ljii:LaserJet II Bitmap File (150 dpi):0:ljii:33:ljii Copied: trunk/drivers/ljiip.driver_info.in (from rev 11321, trunk/drivers/ljiip.rc.in) =================================================================== --- trunk/drivers/ljiip.driver_info.in (rev 0) +++ trunk/drivers/ljiip.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +ljiip:LaserJet IIp/deskjet compressed graphics:0:ljiip:32:ljiip Deleted: trunk/drivers/ljiip.rc.in =================================================================== --- trunk/drivers/ljiip.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/ljiip.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -ljiip:LaserJet IIp/deskjet compressed graphics:0:ljiip:32:ljiip Copied: trunk/drivers/mem.driver_info.in (from rev 11321, trunk/drivers/mem.rc.in) =================================================================== --- trunk/drivers/mem.driver_info.in (rev 0) +++ trunk/drivers/mem.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +mem:User-supplied memory device:-1:mem:46:mem Deleted: trunk/drivers/mem.rc.in =================================================================== --- trunk/drivers/mem.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/mem.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -mem:User-supplied memory device:-1:mem:46:mem Copied: trunk/drivers/ntk.driver_info.in (from rev 11321, trunk/drivers/ntk.rc.in) =================================================================== --- trunk/drivers/ntk.driver_info.in (rev 0) +++ trunk/drivers/ntk.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +ntk:New tk driver:1:ntk:43:ntk Deleted: trunk/drivers/ntk.rc.in =================================================================== --- trunk/drivers/ntk.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/ntk.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -ntk:New tk driver:1:ntk:43:ntk Copied: trunk/drivers/null.driver_info.in (from rev 11321, trunk/drivers/null.rc.in) =================================================================== --- trunk/drivers/null.driver_info.in (rev 0) +++ trunk/drivers/null.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +null:Null device:-1:null:42:null Deleted: trunk/drivers/null.rc.in =================================================================== --- trunk/drivers/null.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/null.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -null:Null device:-1:null:42:null Copied: trunk/drivers/pbm.driver_info.in (from rev 11321, trunk/drivers/pbm.rc.in) =================================================================== --- trunk/drivers/pbm.driver_info.in (rev 0) +++ trunk/drivers/pbm.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +pbm:PDB (PPM) Driver:0:pbm:38:pbm Deleted: trunk/drivers/pbm.rc.in =================================================================== --- trunk/drivers/pbm.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/pbm.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -pbm:PDB (PPM) Driver:0:pbm:38:pbm Copied: trunk/drivers/pdf.driver_info.in (from rev 11321, trunk/drivers/pdf.rc.in) =================================================================== --- trunk/drivers/pdf.driver_info.in (rev 0) +++ trunk/drivers/pdf.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +pdf:Portable Document Format PDF:1:pdf:58:pdf Deleted: trunk/drivers/pdf.rc.in =================================================================== --- trunk/drivers/pdf.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/pdf.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -pdf:Portable Document Format PDF:1:pdf:58:pdf Copied: trunk/drivers/plmeta.driver_info.in (from rev 11321, trunk/drivers/plmeta.rc.in) =================================================================== --- trunk/drivers/plmeta.driver_info.in (rev 0) +++ trunk/drivers/plmeta.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +plmeta:PLplot Native Meta-File:0:plmeta:26:plm Deleted: trunk/drivers/plmeta.rc.in =================================================================== --- trunk/drivers/plmeta.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/plmeta.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -plmeta:PLplot Native Meta-File:0:plmeta:26:plm Copied: trunk/drivers/ps.driver_info.in (from rev 11321, trunk/drivers/ps.rc.in) =================================================================== --- trunk/drivers/ps.driver_info.in (rev 0) +++ trunk/drivers/ps.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1,2 @@ +ps:PostScript File (monochrome):0:ps:29:psm +psc:PostScript File (color):0:ps:30:psc Deleted: trunk/drivers/ps.rc.in =================================================================== --- trunk/drivers/ps.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/ps.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1,2 +0,0 @@ -ps:PostScript File (monochrome):0:ps:29:psm -psc:PostScript File (color):0:ps:30:psc Copied: trunk/drivers/pstex.driver_info.in (from rev 11321, trunk/drivers/pstex.rc.in) =================================================================== --- trunk/drivers/pstex.driver_info.in (rev 0) +++ trunk/drivers/pstex.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +pstex:Combined Postscript/LaTeX files:0:pstex:41:pstex Deleted: trunk/drivers/pstex.rc.in =================================================================== --- trunk/drivers/pstex.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/pstex.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -pstex:Combined Postscript/LaTeX files:0:pstex:41:pstex Copied: trunk/drivers/psttf.driver_info.in (from rev 11321, trunk/drivers/psttf.rc.in) =================================================================== --- trunk/drivers/psttf.driver_info.in (rev 0) +++ trunk/drivers/psttf.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1,2 @@ +psttf:PostScript File (monochrome):0:psttf:55:psttfm +psttfc:PostScript File (color):0:psttf:56:psttfc Deleted: trunk/drivers/psttf.rc.in =================================================================== --- trunk/drivers/psttf.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/psttf.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1,2 +0,0 @@ -psttf:PostScript File (monochrome):0:psttf:55:psttfm -psttfc:PostScript File (color):0:psttf:56:psttfc Copied: trunk/drivers/qt.driver_info.in (from rev 11321, trunk/drivers/qt.rc.in) =================================================================== --- trunk/drivers/qt.driver_info.in (rev 0) +++ trunk/drivers/qt.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1,11 @@ +bmpqt:Qt Windows bitmap driver:0:qt:66:bmpqt +jpgqt:Qt jpg driver:0:qt:67:jpgqt +pngqt:Qt png driver:0:qt:68:pngqt +ppmqt:Qt ppm driver:0:qt:69:ppmqt +tiffqt:Qt tiff driver:0:qt:70:tiffqt +svgqt:Qt SVG driver:0:qt:71:svgqt +qtwidget:Qt Widget:1:qt:72:qtwidget +epsqt:Qt EPS driver:0:qt:73:epsqt +pdfqt:Qt PDF driver:0:qt:74:pdfqt +extqt:External Qt driver:0:qt:75:extqt +memqt:Memory Qt driver:0:qt:76:memqt Deleted: trunk/drivers/qt.rc.in =================================================================== --- trunk/drivers/qt.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/qt.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1,11 +0,0 @@ -bmpqt:Qt Windows bitmap driver:0:qt:66:bmpqt -jpgqt:Qt jpg driver:0:qt:67:jpgqt -pngqt:Qt png driver:0:qt:68:pngqt -ppmqt:Qt ppm driver:0:qt:69:ppmqt -tiffqt:Qt tiff driver:0:qt:70:tiffqt -svgqt:Qt SVG driver:0:qt:71:svgqt -qtwidget:Qt Widget:1:qt:72:qtwidget -epsqt:Qt EPS driver:0:qt:73:epsqt -pdfqt:Qt PDF driver:0:qt:74:pdfqt -extqt:External Qt driver:0:qt:75:extqt -memqt:Memory Qt driver:0:qt:76:memqt Copied: trunk/drivers/svg.driver_info.in (from rev 11321, trunk/drivers/svg.rc.in) =================================================================== --- trunk/drivers/svg.driver_info.in (rev 0) +++ trunk/drivers/svg.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +svg:Scalable Vector Graphics (SVG 1.1):1:svg:57:svg Deleted: trunk/drivers/svg.rc.in =================================================================== --- trunk/drivers/svg.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/svg.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -svg:Scalable Vector Graphics (SVG 1.1):1:svg:57:svg Copied: trunk/drivers/tek.driver_info.in (from rev 11321, trunk/drivers/tek.rc.in) =================================================================== --- trunk/drivers/tek.driver_info.in (rev 0) +++ trunk/drivers/tek.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1,6 @@ +conex:Conex vt320/tek emulator:1:tek:24:conex +mskermit:MS-Kermit emulator:1:tek:21:mskermit +tek4107f:Tektronix File (4105/4107):0:tek:28:tek4107f +versaterm:Versaterm vt100/tek emulator:1:tek:22:versaterm +vlt:VLT vt100/tek emulator:1:tek:23:vlt +xterm:Xterm Window:1:tek:18:xterm Deleted: trunk/drivers/tek.rc.in =================================================================== --- trunk/drivers/tek.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/tek.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1,6 +0,0 @@ -conex:Conex vt320/tek emulator:1:tek:24:conex -mskermit:MS-Kermit emulator:1:tek:21:mskermit -tek4107f:Tektronix File (4105/4107):0:tek:28:tek4107f -versaterm:Versaterm vt100/tek emulator:1:tek:22:versaterm -vlt:VLT vt100/tek emulator:1:tek:23:vlt -xterm:Xterm Window:1:tek:18:xterm Copied: trunk/drivers/tk.driver_info.in (from rev 11321, trunk/drivers/tk.rc.in) =================================================================== --- trunk/drivers/tk.driver_info.in (rev 0) +++ trunk/drivers/tk.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +tk:Tcl/TK Window:1:tk:7:tk Deleted: trunk/drivers/tk.rc.in =================================================================== --- trunk/drivers/tk.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/tk.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -tk:Tcl/TK Window:1:tk:7:tk Copied: trunk/drivers/tkwin.driver_info.in (from rev 11321, trunk/drivers/tkwin.rc.in) =================================================================== --- trunk/drivers/tkwin.driver_info.in (rev 0) +++ trunk/drivers/tkwin.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +tkwin:New tk driver:1:tkwin:45:tkwin Deleted: trunk/drivers/tkwin.rc.in =================================================================== --- trunk/drivers/tkwin.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/tkwin.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -tkwin:New tk driver:1:tkwin:45:tkwin Copied: trunk/drivers/wingcc.driver_info.in (from rev 11321, trunk/drivers/wingcc.rc.in) =================================================================== --- trunk/drivers/wingcc.driver_info.in (rev 0) +++ trunk/drivers/wingcc.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +wingcc:Win32 (GCC):1:wingcc:9:wingcc Deleted: trunk/drivers/wingcc.rc.in =================================================================== --- trunk/drivers/wingcc.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/wingcc.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -wingcc:Win32 (GCC):1:wingcc:9:wingcc Copied: trunk/drivers/wxwidgets.driver_info.in (from rev 11321, trunk/drivers/wxwidgets.rc.in) =================================================================== --- trunk/drivers/wxwidgets.driver_info.in (rev 0) +++ trunk/drivers/wxwidgets.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1,2 @@ +wxwidgets:wxWidgets Driver:1:wxwidgets:51:wxwidgets +wxpng:wxWidgets PNG Driver:0:wxwidgets:52:wxpng Deleted: trunk/drivers/wxwidgets.rc.in =================================================================== --- trunk/drivers/wxwidgets.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/wxwidgets.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1,2 +0,0 @@ -wxwidgets:wxWidgets Driver:1:wxwidgets:51:wxwidgets -wxpng:wxWidgets PNG Driver:0:wxwidgets:52:wxpng Copied: trunk/drivers/xfig.driver_info.in (from rev 11321, trunk/drivers/xfig.rc.in) =================================================================== --- trunk/drivers/xfig.driver_info.in (rev 0) +++ trunk/drivers/xfig.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +xfig:Fig file:0:xfig:31:xfig Deleted: trunk/drivers/xfig.rc.in =================================================================== --- trunk/drivers/xfig.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/xfig.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -xfig:Fig file:0:xfig:31:xfig Copied: trunk/drivers/xwin.driver_info.in (from rev 11321, trunk/drivers/xwin.rc.in) =================================================================== --- trunk/drivers/xwin.driver_info.in (rev 0) +++ trunk/drivers/xwin.driver_info.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -0,0 +1 @@ +xwin:X-Window (Xlib):1:xwin:5:xw Deleted: trunk/drivers/xwin.rc.in =================================================================== --- trunk/drivers/xwin.rc.in 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/drivers/xwin.rc.in 2010-11-11 11:08:42 UTC (rev 11323) @@ -1 +0,0 @@ -xwin:X-Window (Xlib):1:xwin:5:xw Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2010-11-11 10:34:19 UTC (rev 11322) +++ trunk/src/plcore.c 2010-11-11 11:08:42 UTC (rev 11323) @@ -2897,13 +2897,14 @@ while ( ( entry = readdir( dp_drvdir ) ) != NULL ) { char* name = entry->d_name; - int len = strlen( name ) - 3; + // Suffix .driver_info has a length of 12 letters. + int len = strlen( name ) - 12; pldebug( "plInitDispatchTable", "Consider file %s\n", name ); -// Only consider entries that have the ".rc" suffix - if ( ( len > 0 ) && ( strcmp( name + len, ".rc" ) == 0 ) ) +// Only consider entries that have the ".driver_info" suffix + if ( ( len > 0 ) && ( strcmp( name + len, ".driver_info" ) == 0 ) ) { char path[PLPLOT_MAX_PATH]; FILE * fd; @@ -2922,7 +2923,7 @@ return; } -// Each line in the <driver>.rc file corresponds to a specific device. +// Each line in the <driver>.driver_info file corresponds to a specific device. // Write it to the drivers db file and take care of leading newline // character @@ -3072,11 +3073,11 @@ #endif - if ( npldrivers == 0 ) - { - npldynamicdevices = 0; - plexit( "No device drivers found - please check the environment variable PLPLOT_DRV_DIR" ); - } + if ( npldrivers == 0 ) + { + npldynamicdevices = 0; + plexit( "No device drivers found - please check the environment variable PLPLOT_DRV_DIR" ); + } // Finally, we need to sort the list into presentation order, based on the // sequence number in the dispatch ttable entries. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-14 07:20:46
|
Revision: 11328 http://plplot.svn.sourceforge.net/plplot/?rev=11328&view=rev Author: airwin Date: 2010-11-14 07:20:32 +0000 (Sun, 14 Nov 2010) Log Message: ----------- API change for pllegend (implemented both for core C library and python bindings). Add box_line_widths array to arguments. This is required because plshade has an argument to control the line width of pattern fills. It is also required by the new 4th page of example 33 (committed here) which demonstrates most of the different kinds of discrete legends that are possible with pllegend. Modified Paths: -------------- trunk/bindings/swig-support/plplotcapi.i trunk/examples/c/x04c.c trunk/examples/c/x26c.c trunk/examples/python/xw04.py trunk/examples/python/xw26.py trunk/examples/python/xw33.py trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2010-11-14 00:47:13 UTC (rev 11327) +++ trunk/bindings/swig-support/plplotcapi.i 2010-11-14 07:20:32 UTC (rev 11328) @@ -538,7 +538,7 @@ PLFLT text_justification, const PLINT *ArrayCk, const char **ArrayCk, const PLINT *ArrayCk, const PLINT *ArrayCk, - const PLFLT *ArrayCk, + const PLFLT *ArrayCk, const PLINT *ArrayCk, const PLINT *ArrayCk, const PLINT *ArrayCk, const PLINT *ArrayCk, const PLINT *ArrayCk, const PLFLT *ArrayCk, Modified: trunk/examples/c/x04c.c =================================================================== --- trunk/examples/c/x04c.c 2010-11-14 00:47:13 UTC (rev 11327) +++ trunk/examples/c/x04c.c 2010-11-14 07:20:32 UTC (rev 11328) @@ -149,7 +149,7 @@ nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, - NULL, NULL, NULL, + NULL, NULL, NULL, NULL, line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); } Modified: trunk/examples/c/x26c.c =================================================================== --- trunk/examples/c/x26c.c 2010-11-14 00:47:13 UTC (rev 11327) +++ trunk/examples/c/x26c.c 2010-11-14 07:20:32 UTC (rev 11328) @@ -249,7 +249,7 @@ nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) legend_text, - NULL, NULL, NULL, + NULL, NULL, NULL, NULL, line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); } Modified: trunk/examples/python/xw04.py =================================================================== --- trunk/examples/python/xw04.py 2010-11-14 00:47:13 UTC (rev 11327) +++ trunk/examples/python/xw04.py 2010-11-14 07:20:32 UTC (rev 11328) @@ -89,6 +89,7 @@ box_colors = zeros(nlegend, "int") box_patterns = zeros(nlegend, "int") box_scales = zeros(nlegend) + box_line_widths = zeros(nlegend, "int") line_colors = zeros(nlegend, "int") line_styles = zeros(nlegend, "int") line_widths = zeros(nlegend, "int") @@ -125,8 +126,9 @@ (legend_width, legend_height) = \ pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) main() Modified: trunk/examples/python/xw26.py =================================================================== --- trunk/examples/python/xw26.py 2010-11-14 00:47:13 UTC (rev 11327) +++ trunk/examples/python/xw26.py 2010-11-14 07:20:32 UTC (rev 11328) @@ -159,6 +159,7 @@ box_colors = zeros(nlegend, "int") box_patterns = zeros(nlegend, "int") box_scales = zeros(nlegend) + box_line_widths = zeros(nlegend, "int") line_colors = zeros(nlegend, "int") line_styles = zeros(nlegend, "int") line_widths = zeros(nlegend, "int") @@ -195,8 +196,9 @@ (legend_width, legend_height) = \ pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) main() Modified: trunk/examples/python/xw33.py =================================================================== --- trunk/examples/python/xw33.py 2010-11-14 00:47:13 UTC (rev 11327) +++ trunk/examples/python/xw33.py 2010-11-14 07:20:32 UTC (rev 11328) @@ -48,12 +48,21 @@ PL_LEGEND_LEFT | PL_LEGEND_INSIDE, ] +# Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). +special_symbols = [ +"✰", +"✴", +"✱", +"✽", +"✦", +] def main(): # First page illustrating the 16 standard positions. pladv(0) plvpor(0.25, 0.75, 0.25, 0.75) plwind(0.0, 1.0, 0.0, 1.0) plbox("bc", 0.0, 0, "bc", 0.0, 0) + plsfont(PL_FCI_SANS, -1, -1) plmtex("t", 8.0, 0.5, 0.5, "The 16 standard legend positions with") plmtex("t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y") @@ -65,6 +74,7 @@ box_colors = zeros(nlegend, "int") box_patterns = zeros(nlegend, "int") box_scales = zeros(nlegend) + box_line_widths = zeros(nlegend, "int") line_colors = zeros(nlegend, "int") line_styles = zeros(nlegend, "int") line_widths = zeros(nlegend, "int") @@ -97,16 +107,18 @@ (legend_width, legend_height) = \ pllegend( opt, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) - # Secong page illustrating effect of nrow, ncolumn for the same legend + # Second page illustrating effect of nrow, ncolumn for the same legend # data. pladv(0) plvpor(0.25, 0.75, 0.25, 0.75) plwind(0.0, 1.0, 0.0, 1.0) plbox("bc", 0.0, 0, "bc", 0.0, 0) + plsfont(PL_FCI_SANS, -1, -1) plmtex("t", 8.0, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR,") plmtex("t", 6.0, 0.5, 0.5, "and position for the same legend data") @@ -118,6 +130,7 @@ box_colors = zeros(nlegend, "int") box_patterns = zeros(nlegend, "int") box_scales = zeros(nlegend) + box_line_widths = zeros(nlegend, "int") line_colors = zeros(nlegend, "int") line_styles = zeros(nlegend, "int") line_widths = zeros(nlegend, "int") @@ -153,8 +166,9 @@ (legend_width, legend_height) = \ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) opt = opt_base |PL_LEGEND_LOWER|PL_LEGEND_OUTSIDE @@ -165,8 +179,9 @@ (legend_width, legend_height) = \ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) opt = opt_base |PL_LEGEND_LEFT|PL_LEGEND_OUTSIDE @@ -177,8 +192,9 @@ (legend_width, legend_height) = \ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) opt = opt_base |PL_LEGEND_RIGHT|PL_LEGEND_OUTSIDE @@ -189,8 +205,9 @@ (legend_width, legend_height) = \ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) opt = opt_base |PL_LEGEND_LEFT|PL_LEGEND_UPPER|PL_LEGEND_INSIDE @@ -201,8 +218,9 @@ (legend_width, legend_height) = \ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) opt = opt_base |PL_LEGEND_RIGHT|PL_LEGEND_UPPER|PL_LEGEND_INSIDE|PL_LEGEND_ROW_MAJOR @@ -213,8 +231,9 @@ (legend_width, legend_height) = \ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) opt = opt_base |PL_LEGEND_LOWER|PL_LEGEND_INSIDE|PL_LEGEND_ROW_MAJOR @@ -225,14 +244,16 @@ (legend_width, legend_height) = \ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) # Third page demonstrating legend alignment pladv(0) plvpor(0., 1., 0., 1.) plwind(0.0, 1.0, 0.0, 1.0) + plsfont(PL_FCI_SANS, -1, -1) plmtex("t", -2.0, 0.5, 0.5, "Demonstrate legend alignment") x = 0.1 @@ -254,6 +275,7 @@ box_colors = zeros(nlegend, "int") box_patterns = zeros(nlegend, "int") box_scales = zeros(nlegend) + box_line_widths = zeros(nlegend, "int") line_colors = zeros(nlegend, "int") line_styles = zeros(nlegend, "int") line_widths = zeros(nlegend, "int") @@ -284,9 +306,11 @@ ncolumn = 0 (legend_width, legend_height) = \ - pllegend( opt, x, y, 0.025, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 1.5, - 1., text_colors, text, box_colors, box_patterns, - box_scales, line_colors, line_styles, line_widths, + pllegend( opt, x, y, + 0.025, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 1.5, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) if i == nturn: opt = opt_base | PL_LEGEND_RIGHT @@ -296,4 +320,268 @@ x += legend_width y += legend_height + # Fourth page illustrating various kinds of legends + max_height = 0. + xstart = 0.0 + ystart = 0.1 + x = xstart + y = ystart + text_scale = 0.90 + pladv(0) + plvpor(0.0, 1., 0.0, 0.90) + plwind(0.0, 1.0, 0.0, 1.0) + # plbox("bc", 0.0, 0, "bc", 0.0, 0) + plsfont(PL_FCI_SANS, -1, -1) + plmtex("t", 2.0, 0.5, 0.5, "Demonstrate Various Kinds of Legends") + + # Set up legend arrays with the correct size, type. + nlegend = 5 + opt_array = zeros(nlegend, "int") + text_colors = zeros(nlegend, "int") + text = zeros(nlegend, "S200") + box_colors = zeros(nlegend, "int") + box_patterns = zeros(nlegend, "int") + box_scales = zeros(nlegend) + box_line_widths = zeros(nlegend, "int") + line_colors = zeros(nlegend, "int") + line_styles = zeros(nlegend, "int") + line_widths = zeros(nlegend, "int") + symbol_colors = zeros(nlegend, "int") + symbol_scales = zeros(nlegend) + symbol_numbers = zeros(nlegend, "int") + symbols = zeros(nlegend, "S100") + + # Only specify legend data that are required according to the + # value of opt_array for that entry. + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX |PL_LEGEND_LEFT |PL_LEGEND_UPPER |PL_LEGEND_TEXT_LEFT + + # Set up None, Box, Line, Symbol, and Line & Symbol legend entries. + opt_array[0] = PL_LEGEND_NONE + text[0] = "None" + text_colors[0] = 1 + + opt_array[1] = PL_LEGEND_COLOR_BOX + text[1] = "Box" + text_colors[1] = 2 + box_colors[1] = 2 + box_patterns[1] = 0 + box_scales[1] = 0.8 + box_line_widths[1] = 1 + + opt_array[2] = PL_LEGEND_LINE + text[2] = "Line" + text_colors[2] = 3 + line_colors[2] = 3 + line_styles[2] = 1 + line_widths[2] = 1 + + opt_array[3] = PL_LEGEND_SYMBOL + text[3] = "Symbol" + text_colors[3] = 4 + symbol_colors[3] = 4 + symbol_scales[3] = text_scale + symbol_numbers[3] = 4 + symbols[3] = special_symbols[2] + + opt_array[4] = PL_LEGEND_SYMBOL | PL_LEGEND_LINE + text[4] = "L & S" + text_colors[4] = 5 + line_colors[4] = 5 + line_styles[4] = 1 + line_widths[4] = 1 + symbol_colors[4] = 5 + symbol_scales[4] = text_scale + symbol_numbers[4] = 4 + symbols[4] = special_symbols[2] + + opt = opt_base + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + + # Set up symbol legend entries with various symbols. + for i in range(nlegend): + opt_array[i] = PL_LEGEND_SYMBOL + text[i] = "Symbol " + special_symbols[i] + text_colors[i] = i+1 + symbol_colors[i] = i+1 + symbol_scales[i] = text_scale + symbol_numbers[i] = 4 + symbols[i] = special_symbols[i] + + opt = opt_base + x += legend_width + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + + # Set up symbol legend entries with various symbols. + for i in range(nlegend): + opt_array[i] = PL_LEGEND_SYMBOL + text[i] = "Symbol Numbers %d" % (i+2) + text_colors[i] = i+1 + symbol_colors[i] = i+1 + symbol_scales[i] = text_scale + symbol_numbers[i] = i+2 + symbols[i] = special_symbols[2] + + opt = opt_base + x += legend_width + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + + # Set up box legend entries with various colours. + for i in range(nlegend): + opt_array[i] = PL_LEGEND_COLOR_BOX + text[i] = "%s %d" % ("Box Colors",i+1) + text_colors[i] = i+1 + box_colors[i] = i+1 + box_patterns[i] = 0 + box_scales[i] = 0.8 + box_line_widths[i] = 1 + + opt = opt_base + # Use new origin + x = xstart + y += max_height + max_height = 0. + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + + # Set up box legend entries with various patterns. + for i in range(nlegend): + opt_array[i] = PL_LEGEND_COLOR_BOX + text[i] = "%s %d" % ("Box Patterns",i) + text_colors[i] = 2 + box_colors[i] = 2 + box_patterns[i] = i + box_scales[i] = 0.8 + box_line_widths[i] = 1 + + opt = opt_base + x += legend_width + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + + # Set up box legend entries with various box pattern line widths. + for i in range(nlegend): + opt_array[i] = PL_LEGEND_COLOR_BOX + text[i] = "%s %d" % ("Box Line Width",i+1) + text_colors[i] = 2 + box_colors[i] = 2 + box_patterns[i] = 3 + box_scales[i] = 0.8 + box_line_widths[i] = i+1 + + opt = opt_base + x += legend_width + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + + # Set up line legend entries with various colours. + for i in range(nlegend): + opt_array[i] = PL_LEGEND_LINE + text[i] = "%s %d" % ("Line Colors",i+1) + text_colors[i] = i+1 + line_colors[i] = i+1 + line_styles[i] = 1 + line_widths[i] = 1 + + opt = opt_base + # Use new origin + x = xstart + y += max_height + max_height = 0. + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + + # Set up line legend entries with various styles + for i in range(nlegend): + opt_array[i] = PL_LEGEND_LINE + text[i] = "%s %d" % ("Line Styles",i+1) + text_colors[i] = 2 + line_colors[i] = 2 + line_styles[i] = i+1 + line_widths[i] = 1 + + opt = opt_base + x += legend_width + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + + # Set up line legend entries with various widths. + for i in range(nlegend): + opt_array[i] = PL_LEGEND_LINE + text[i] = "%s %d" % ("Line Widths",i+1) + text_colors[i] = 2 + line_colors[i] = 2 + line_styles[i] = 1 + line_widths[i] = i+1 + + opt = opt_base + x += legend_width + plscol0a( 15, 32, 32, 32, 0.70 ) + (legend_width, legend_height) = \ + pllegend( opt, x, y, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) + max_height = max(max_height, legend_height) + main() Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2010-11-14 00:47:13 UTC (rev 11327) +++ trunk/include/plplot.h 2010-11-14 07:20:32 UTC (rev 11328) @@ -1235,7 +1235,7 @@ PLFLT text_justification, const PLINT *text_colors, const char **text, const PLINT *box_colors, const PLINT *box_patterns, - const PLFLT *box_scales, + const PLFLT *box_scales, const PLINT *box_line_widths, const PLINT *line_colors, const PLINT *line_styles, const PLINT *line_widths, const PLINT *symbol_colors, const PLFLT *symbol_scales, Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2010-11-14 00:47:13 UTC (rev 11327) +++ trunk/src/pllegend.c 2010-11-14 07:20:32 UTC (rev 11328) @@ -392,7 +392,7 @@ PLFLT text_justification, const PLINT *text_colors, const char **text, const PLINT *box_colors, const PLINT *box_patterns, - const PLFLT *box_scales, + const PLFLT *box_scales, const PLINT *box_line_widths, const PLINT *line_colors, const PLINT *line_styles, const PLINT *line_widths, const PLINT *symbol_colors, const PLFLT *symbol_scales, @@ -486,8 +486,6 @@ // viewport coordinates which are the same as normalized subpage coordinates. plwind( 0., 1., 0., 1. ); - plschr( 0., text_scale ); - for ( i = 0; i < nlegend; i++ ) { if ( opt_array[i] & PL_LEGEND_COLOR_BOX ) @@ -506,6 +504,7 @@ character_width = character_height; // Calculate maximum width of text area. + plschr( 0., text_scale ); for ( i = 0; i < nlegend; i++ ) { // units are mm. @@ -530,15 +529,15 @@ legend_width = 2. * width_border + ( ncolumn - 1 ) * column_separation + ncolumn * ( text_width + viewport_to_subpage_x( plot_width ) - viewport_to_subpage_x( 0. ) ); - legend_height = nrow * text_spacing * character_height; - *p_legend_width = legend_width; - *p_legend_height = legend_height; + legend_height = nrow * text_spacing * character_height; // Total width and height of legend area in normalized external viewport // coordinates. legend_width_vc = subpage_to_viewport_x( legend_width ) - subpage_to_viewport_x( 0. ); legend_height_vc = subpage_to_viewport_y( legend_height ) - subpage_to_viewport_y( 0. ); + *p_legend_width = legend_width_vc; + *p_legend_height = legend_height_vc; // dcolumn is the spacing from one column to the next and // drow is the spacing from one row to the next. @@ -641,6 +640,7 @@ xshift = (double) icolumn * dcolumn; // Label/name for the legend plcol0( text_colors[i] ); + plschr( 0., text_scale ); plptex( text_x_subpage + xshift + text_justification * text_width0, ty, 0.1, 0.0, text_justification, text[i] ); if ( !( opt_array[i] & PL_LEGEND_NONE ) ) @@ -649,6 +649,7 @@ { plcol0( box_colors[i] ); plpsty( box_patterns[i] ); + plwid( box_line_widths[i] ); xbox[0] = plot_x_subpage + xshift; xbox[1] = xbox[0]; xbox[2] = plot_x_end_subpage + xshift; @@ -658,6 +659,7 @@ ybox[2] = ty - 0.5 * drow * box_scales[i]; ybox[3] = ty + 0.5 * drow * box_scales[i]; plfill( 4, xbox, ybox ); + plwid( line_width_save ); } if ( opt_array[i] & PL_LEGEND_LINE ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-15 10:23:09
|
Revision: 11331 http://plplot.svn.sourceforge.net/plplot/?rev=11331&view=rev Author: airwin Date: 2010-11-15 10:00:58 +0000 (Mon, 15 Nov 2010) Log Message: ----------- Add 33rd C example that gives the same results as the corresponding Python example. Modified Paths: -------------- trunk/examples/c/CMakeLists.txt trunk/examples/c/Makefile.examples.in trunk/plplot_test/test_c.sh.in Added Paths: ----------- trunk/examples/c/x33c.c Modified: trunk/examples/c/CMakeLists.txt =================================================================== --- trunk/examples/c/CMakeLists.txt 2010-11-15 10:00:16 UTC (rev 11330) +++ trunk/examples/c/CMakeLists.txt 2010-11-15 10:00:58 UTC (rev 11331) @@ -57,6 +57,7 @@ "30" "31" "32" + "33" ) if(CORE_BUILD) Modified: trunk/examples/c/Makefile.examples.in =================================================================== --- trunk/examples/c/Makefile.examples.in 2010-11-15 10:00:16 UTC (rev 11330) +++ trunk/examples/c/Makefile.examples.in 2010-11-15 10:00:58 UTC (rev 11331) @@ -71,6 +71,7 @@ x30c$(EXEEXT) \ x31c$(EXEEXT) \ x32c$(EXEEXT) \ + x33c$(EXEEXT) \ $(PLPLOTCANVAS_EXECUTABLES_list) \ $(extXdrawable_EXECUTABLES_list) \ $(extcairo_EXECUTABLES_list) Added: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c (rev 0) +++ trunk/examples/c/x33c.c 2010-11-15 10:00:58 UTC (rev 11331) @@ -0,0 +1,610 @@ +// -*- coding: utf-8; -*- +// +// $Id$ +// +// Demonstrate most pllegend capability including unicode symbols. +// +// Copyright (C) 2010 Alan Irwin +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + +// This example designed just for devices (e.g., the cairo-related and +// qt-related devices) where the best choice of glyph is automatically +// selected by the related libraries (pango/cairo or Qt4) for each +// unicode character depending on what system fonts are installed. Of +// course, you must have the appropriate TrueType fonts installed to +// have access to all the required glyphs. + +#include "plcdemos.h" + +static PLINT position_options[16] = { + PL_LEGEND_LEFT | PL_LEGEND_UPPER | PL_LEGEND_OUTSIDE, + PL_LEGEND_UPPER | PL_LEGEND_OUTSIDE, + PL_LEGEND_RIGHT | PL_LEGEND_UPPER | PL_LEGEND_OUTSIDE, + PL_LEGEND_RIGHT | PL_LEGEND_OUTSIDE, + PL_LEGEND_RIGHT | PL_LEGEND_LOWER | PL_LEGEND_OUTSIDE, + PL_LEGEND_LOWER | PL_LEGEND_OUTSIDE, + PL_LEGEND_LEFT | PL_LEGEND_LOWER | PL_LEGEND_OUTSIDE, + PL_LEGEND_LEFT | PL_LEGEND_OUTSIDE, + PL_LEGEND_LEFT | PL_LEGEND_UPPER | PL_LEGEND_INSIDE, + PL_LEGEND_UPPER | PL_LEGEND_INSIDE, + PL_LEGEND_RIGHT | PL_LEGEND_UPPER | PL_LEGEND_INSIDE, + PL_LEGEND_RIGHT | PL_LEGEND_INSIDE, + PL_LEGEND_RIGHT | PL_LEGEND_LOWER | PL_LEGEND_INSIDE, + PL_LEGEND_LOWER | PL_LEGEND_INSIDE, + PL_LEGEND_LEFT | PL_LEGEND_LOWER | PL_LEGEND_INSIDE, + PL_LEGEND_LEFT | PL_LEGEND_INSIDE +}; + +// Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). +static char *special_symbols[5] = { + "✰", + "✴", + "✱", + "✽", + "✦" +}; + +//-------------------------------------------------------------------------- +// main +// +// Demonstrate most pllegend capability including unicode symbols. +//-------------------------------------------------------------------------- + +#define MAX_NLEGEND 7 + +int +main( int argc, const char *argv[] ) +{ + int i, k; + PLINT opt; + PLINT nlegend, nturn; + PLINT opt_array[MAX_NLEGEND]; + PLINT text_colors[MAX_NLEGEND]; + PLINT box_colors[MAX_NLEGEND]; + PLINT box_patterns[MAX_NLEGEND]; + PLFLT box_scales[MAX_NLEGEND]; + PLINT box_line_widths[MAX_NLEGEND]; + PLINT line_colors[MAX_NLEGEND]; + PLINT line_styles[MAX_NLEGEND]; + PLINT line_widths[MAX_NLEGEND]; + PLINT symbol_numbers[MAX_NLEGEND], symbol_colors[MAX_NLEGEND]; + PLFLT symbol_scales[MAX_NLEGEND]; + char *text[MAX_NLEGEND], *symbols[MAX_NLEGEND]; + PLFLT legend_width, legend_height, x, y, xstart, ystart; + PLFLT max_height, text_scale; + PLINT opt_base, nrow, ncolumn; + + // Create space to contain legend text. + for ( k = 0; k < MAX_NLEGEND; k++ ) + text[k] = (char *) malloc( 200 * sizeof ( char ) ); + + // Parse and process command line arguments + (void) plparseopts( &argc, argv, PL_PARSE_FULL ); + +// Initialize plplot + plinit(); + + // First page illustrating the 16 standard positions. + pladv( 0 ); + plvpor( 0.25, 0.75, 0.25, 0.75 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + plbox( "bc", 0.0, 0, "bc", 0.0, 0 ); + plsfont( PL_FCI_SANS, -1, -1 ); + plmtex( "t", 8.0, 0.5, 0.5, "The 16 standard legend positions with" ); + plmtex( "t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y" ); + + nlegend = 1; + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; + opt_array[0] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL; + line_styles[0] = 1; + line_widths[0] = 1; + symbol_scales[0] = 1.; + symbol_numbers[0] = 4; + symbols[0] = "*"; + + // Use monotype fonts so that all legends are the same size. + plsfont( PL_FCI_MONO, -1, -1 ); + plscol0a( 15, 32, 32, 32, 0.70 ); + + for ( k = 0; k < 16; k++ ) + { + opt = opt_base | position_options[k]; + sprintf( text[0], "%2.2d", k ); + text_colors[0] = 1 + ( k % 8 ); + line_colors[0] = 1 + ( k % 8 ); + symbol_colors[0] = 1 + ( k % 8 ); + + pllegend( &legend_width, &legend_height, opt, 0.05, 0.05, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + } + + // Second page illustrating effect of nrow, ncolumn for the same legend + // data.; + pladv( 0 ); + plvpor( 0.25, 0.75, 0.25, 0.75 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + plbox( "bc", 0.0, 0, "bc", 0.0, 0 ); + plsfont( PL_FCI_SANS, -1, -1 ); + plmtex( "t", 8.0, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR," ); + plmtex( "t", 6.0, 0.5, 0.5, "and position for the same legend data" ); + + nlegend = 7; + + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; + for ( k = 0; k < nlegend; k++ ) + { + opt_array[k] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL; + line_styles[k] = 1; + line_widths[k] = 1; + symbol_scales[k] = 1.; + symbol_numbers[k] = 2; + symbols[k] = "*"; + sprintf( text[k], "%2.2d", k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); + } + + // Use monotype fonts so that all legends are the same size. + plsfont( PL_FCI_MONO, -1, -1 ); + plscol0a( 15, 32, 32, 32, 0.70 ); + + opt = opt_base | PL_LEGEND_UPPER | PL_LEGEND_OUTSIDE; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; + pllegend( &legend_width, &legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + nlegend, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + + opt = opt_base | PL_LEGEND_LOWER | PL_LEGEND_OUTSIDE; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; + pllegend( &legend_width, &legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + nlegend, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + + opt = opt_base | PL_LEGEND_LEFT | PL_LEGEND_OUTSIDE; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; + pllegend( &legend_width, &legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + nlegend, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + + opt = opt_base | PL_LEGEND_RIGHT | PL_LEGEND_OUTSIDE; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; + pllegend( &legend_width, &legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + nlegend, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + + opt = opt_base | PL_LEGEND_LEFT | PL_LEGEND_UPPER | PL_LEGEND_INSIDE; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; + pllegend( &legend_width, &legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + nlegend, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + + opt = opt_base | PL_LEGEND_RIGHT | PL_LEGEND_UPPER | PL_LEGEND_INSIDE | PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; + pllegend( &legend_width, &legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + nlegend, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + + opt = opt_base | PL_LEGEND_LOWER | PL_LEGEND_INSIDE | PL_LEGEND_ROW_MAJOR;; + x = 0.; + y = 0.; + nrow = 3; + ncolumn = 3; + pllegend( &legend_width, &legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + nlegend, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + + // Third page demonstrating legend alignment + pladv( 0 ); + plvpor( 0., 1., 0., 1. ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + plsfont( PL_FCI_SANS, -1, -1 ); + plmtex( "t", -2.0, 0.5, 0.5, "Demonstrate legend alignment" ); + + x = 0.1; + y = 0.1; + nturn = 4; + nlegend = 0; + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX | PL_LEGEND_UPPER; + opt = opt_base | PL_LEGEND_LEFT; + for ( i = 0; i < 9; i++ ) + { + // Set up legend arrays with the correct size, type. + if ( i <= nturn ) + nlegend += 1; + else + nlegend -= 1; + nlegend = MAX( 1, nlegend ); + // nly specify legend data that are required according to the + // value of opt_array for that entry. + for ( k = 0; k < nlegend; k++ ) + { + opt_array[k] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL; + line_styles[k] = 1; + line_widths[k] = 1; + symbol_scales[k] = 1.; + symbol_numbers[k] = 2; + symbols[k] = "*"; + sprintf( text[k], "%2.2d", k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); + } + // Use monotype fonts so that all legends are the same size. + plsfont( PL_FCI_MONO, -1, -1 ); + plscol0a( 15, 32, 32, 32, 0.70 ); + + nrow = MIN( 3, nlegend ); + ncolumn = 0; + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.025, 15, 1, 1, nrow, ncolumn, + nlegend, opt_array, 1.0, 1.0, 1.5, + 1., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + + if ( i == nturn ) + { + opt = opt_base | PL_LEGEND_RIGHT; + x = 1. - x; + y += legend_height; + } + else + { + x += legend_width; + y += legend_height; + } + } + + // Fourth page illustrating various kinds of legends + max_height = 0.; + xstart = 0.0; + ystart = 0.1; + x = xstart; + y = ystart; + text_scale = 0.90; + pladv( 0 ); + plvpor( 0.0, 1., 0.0, 0.90 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + //plbox("bc", 0.0, 0, "bc", 0.0, 0); + plsfont( PL_FCI_SANS, -1, -1 ); + plmtex( "t", 2.0, 0.5, 0.5, "Demonstrate Various Kinds of Legends" ); + + nlegend = 5; + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX | PL_LEGEND_LEFT | PL_LEGEND_UPPER | PL_LEGEND_TEXT_LEFT; + + // Set up None, Box, Line, Symbol, and Line & Symbol legend entries. + opt_array[0] = PL_LEGEND_NONE; + sprintf( text[0], "%s", "None" ); + text_colors[0] = 1; + + opt_array[1] = PL_LEGEND_COLOR_BOX; + sprintf( text[1], "%s", "Box" ); + text_colors[1] = 2; + box_colors[1] = 2; + box_patterns[1] = 0; + box_scales[1] = 0.8; + box_line_widths[1] = 1; + + opt_array[2] = PL_LEGEND_LINE; + sprintf( text[2], "%s", "Line" ); + text_colors[2] = 3; + line_colors[2] = 3; + line_styles[2] = 1; + line_widths[2] = 1; + + opt_array[3] = PL_LEGEND_SYMBOL; + sprintf( text[3], "%s", "Symbol" ); + text_colors[3] = 4; + symbol_colors[3] = 4; + symbol_scales[3] = text_scale; + symbol_numbers[3] = 4; + symbols[3] = special_symbols[2]; + + opt_array[4] = PL_LEGEND_SYMBOL | PL_LEGEND_LINE; + sprintf( text[4], "%s", "L & S" ); + text_colors[4] = 5; + line_colors[4] = 5; + line_styles[4] = 1; + line_widths[4] = 1; + symbol_colors[4] = 5; + symbol_scales[4] = text_scale; + symbol_numbers[4] = 4; + symbols[4] = special_symbols[2]; + + opt = opt_base; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + max_height = MAX( max_height, legend_height ); + + // Set up symbol legend entries with various symbols. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_SYMBOL; + sprintf( text[i], "%s%s", "Symbol ", special_symbols[i] ); + text_colors[i] = i + 1; + symbol_colors[i] = i + 1; + symbol_scales[i] = text_scale; + symbol_numbers[i] = 4; + symbols[i] = special_symbols[i]; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + max_height = MAX( max_height, legend_height ); + + // Set up symbol legend entries with various numbers of symbols. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_SYMBOL; + sprintf( text[i], "%s %d", "Symbol Number", i + 2 ); + text_colors[i] = i + 1; + symbol_colors[i] = i + 1; + symbol_scales[i] = text_scale; + symbol_numbers[i] = i + 2; + symbols[i] = special_symbols[2]; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, + symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); + max_height = MAX( max_height, legend_height ); + + // Set up box legend entries with various colours. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_COLOR_BOX; + sprintf( text[i], "%s %d", "Box Color", i + 1 ); + text_colors[i] = i + 1; + box_colors[i] = i + 1; + box_patterns[i] = 0; + box_scales[i] = 0.8; + box_line_widths[i] = 1; + } + + opt = opt_base; + // Use new origin + x = xstart; + y += max_height; + max_height = 0.; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + box_colors, box_patterns, box_scales, box_line_widths, + NULL, NULL, NULL, + NULL, NULL, NULL, NULL ); + max_height = MAX( max_height, legend_height ); + + // Set up box legend entries with various patterns. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_COLOR_BOX; + sprintf( text[i], "%s %d", "Box Pattern", i ); + text_colors[i] = 2; + box_colors[i] = 2; + box_patterns[i] = i; + box_scales[i] = 0.8; + box_line_widths[i] = 1; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + box_colors, box_patterns, box_scales, box_line_widths, + NULL, NULL, NULL, + NULL, NULL, NULL, NULL ); + max_height = MAX( max_height, legend_height ); + + // Set up box legend entries with various box pattern line widths. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_COLOR_BOX; + sprintf( text[i], "%s %d", "Box Line Width", i + 1 ); + text_colors[i] = 2; + box_colors[i] = 2; + box_patterns[i] = 3; + box_scales[i] = 0.8; + box_line_widths[i] = i + 1; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + box_colors, box_patterns, box_scales, box_line_widths, + NULL, NULL, NULL, + NULL, NULL, NULL, NULL ); + max_height = MAX( max_height, legend_height ); + + // Set up line legend entries with various colours. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_LINE; + sprintf( text[i], "%s %d", "Line Color", i + 1 ); + text_colors[i] = i + 1; + line_colors[i] = i + 1; + line_styles[i] = 1; + line_widths[i] = 1; + } + + opt = opt_base; + // Use new origin + x = xstart; + y += max_height; + max_height = 0.; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + NULL, NULL, NULL, NULL ); + max_height = MAX( max_height, legend_height ); + + // Set up line legend entries with various styles. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_LINE; + sprintf( text[i], "%s %d", "Line Style", i + 1 ); + text_colors[i] = 2; + line_colors[i] = 2; + line_styles[i] = i + 1; + line_widths[i] = 1; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + NULL, NULL, NULL, NULL ); + max_height = MAX( max_height, legend_height ); + + // Set up line legend entries with various widths. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_LINE; + sprintf( text[i], "%s %d", "Line Width", i + 1 ); + text_colors[i] = 2; + line_colors[i] = 2; + line_styles[i] = 1; + line_widths[i] = i + 1; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + nlegend, opt_array, 1.0, text_scale, 2.0, + 0., text_colors, (const char **) text, + NULL, NULL, NULL, NULL, + line_colors, line_styles, line_widths, + NULL, NULL, NULL, NULL ); + max_height = MAX( max_height, legend_height ); + + // Free space that contained legend text. + for ( k = 0; k < MAX_NLEGEND; k++ ) + free( (void *) text[k] ); + plend(); + exit( 0 ); +} Property changes on: trunk/examples/c/x33c.c ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/plplot_test/test_c.sh.in =================================================================== --- trunk/plplot_test/test_c.sh.in 2010-11-15 10:00:16 UTC (rev 11330) +++ trunk/plplot_test/test_c.sh.in 2010-11-15 10:00:58 UTC (rev 11331) @@ -30,7 +30,7 @@ lang="c" export index lang for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 \ - 21 22 23 24 25 26 27 28 30 31 ${critical_examples}; do + 21 22 23 24 25 26 27 28 30 31 33 ${critical_examples}; 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: <ai...@us...> - 2010-11-16 20:33:07
|
Revision: 11334 http://plplot.svn.sourceforge.net/plplot/?rev=11334&view=rev Author: airwin Date: 2010-11-16 20:33:01 +0000 (Tue, 16 Nov 2010) Log Message: ----------- Place values of PL_LEGEND_LEFT and PL_LEGEND_RIGHT in more natural order. Modified Paths: -------------- trunk/bindings/swig-support/plplotcapi.i trunk/include/plplot.h Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2010-11-16 04:52:27 UTC (rev 11333) +++ trunk/bindings/swig-support/plplotcapi.i 2010-11-16 20:33:01 UTC (rev 11334) @@ -104,8 +104,8 @@ #define PL_LEGEND_BACKGROUND 32 #define PL_LEGEND_BOUNDING_BOX 64 #define PL_LEGEND_ROW_MAJOR 128 -#define PL_LEGEND_RIGHT 256 -#define PL_LEGEND_LEFT 512 +#define PL_LEGEND_LEFT 256 +#define PL_LEGEND_RIGHT 512 #define PL_LEGEND_UPPER 1024 #define PL_LEGEND_LOWER 2048 #define PL_LEGEND_INSIDE 4096 Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2010-11-16 04:52:27 UTC (rev 11333) +++ trunk/include/plplot.h 2010-11-16 20:33:01 UTC (rev 11334) @@ -1218,8 +1218,8 @@ #define PL_LEGEND_BACKGROUND 32 #define PL_LEGEND_BOUNDING_BOX 64 #define PL_LEGEND_ROW_MAJOR 128 -#define PL_LEGEND_RIGHT 256 -#define PL_LEGEND_LEFT 512 +#define PL_LEGEND_LEFT 256 +#define PL_LEGEND_RIGHT 512 #define PL_LEGEND_UPPER 1024 #define PL_LEGEND_LOWER 2048 #define PL_LEGEND_INSIDE 4096 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-11-21 20:23:15
|
Revision: 11338 http://plplot.svn.sourceforge.net/plplot/?rev=11338&view=rev Author: airwin Date: 2010-11-21 20:23:09 +0000 (Sun, 21 Nov 2010) Log Message: ----------- Update website generation so that the generated website will include the 33rd standard example which demonstrates legend capabilities. Modified Paths: -------------- trunk/scripts/htdocs-gen_plot-examples.sh trunk/www/examples.php Modified: trunk/scripts/htdocs-gen_plot-examples.sh =================================================================== --- trunk/scripts/htdocs-gen_plot-examples.sh 2010-11-19 22:58:46 UTC (rev 11337) +++ trunk/scripts/htdocs-gen_plot-examples.sh 2010-11-21 20:23:09 UTC (rev 11338) @@ -82,7 +82,7 @@ $CP examples/c/lena.pgm . for exe in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 \ - 23 24 25 26 27 28 29 30 31 32; do + 23 24 25 26 27 28 29 30 31 32 33; do if [ $exe = "08" -o $exe = "16" -o $exe = "20" -o $exe = "30" ] ; then # The default cairo graphics AA looks good for these examples now Modified: trunk/www/examples.php =================================================================== --- trunk/www/examples.php 2010-11-19 22:58:46 UTC (rev 11337) +++ trunk/www/examples.php 2010-11-21 20:23:09 UTC (rev 11338) @@ -105,6 +105,9 @@ \n"), array(32, 1, 1, " <p>Demo of how to draw box-whisker / candlestick plots using PLplot. These are commonly used for financial data.</p> + \n"), + array(33, 4, 1, " + <p>Demo of legends.</p> \n")); ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2010-11-22 08:22:43
|
Revision: 11348 http://plplot.svn.sourceforge.net/plplot/?rev=11348&view=rev Author: arjenmarkus Date: 2010-11-22 08:22:36 +0000 (Mon, 22 Nov 2010) Log Message: ----------- Implement the new function plstring() for FORTRAN 77, Fortran 90/95 and Tcl Modified Paths: -------------- trunk/bindings/f77/plplotf77.def trunk/bindings/f77/plplotf77_ifort.def trunk/bindings/f77/plplotf77_mingw.def trunk/bindings/f77/plstubs.h trunk/bindings/f77/scstubs.c trunk/bindings/f77/sfstubs.fm4 trunk/bindings/f95/plplotf95.def trunk/bindings/f95/plplotf95_ifort.def trunk/bindings/f95/plplotf95_mingw.def trunk/bindings/f95/plstubs.h trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubs.f90 trunk/bindings/tcl/plapi.tpl trunk/examples/f77/x04f.fm4 trunk/examples/f95/x04f.f90 trunk/examples/tcl/x04.tcl Modified: trunk/bindings/f77/plplotf77.def =================================================================== --- trunk/bindings/f77/plplotf77.def 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f77/plplotf77.def 2010-11-22 08:22:36 UTC (rev 11348) @@ -40,6 +40,7 @@ _PLSPAUSE@4 _PLSTART@16 _PLSTRC2F@16 + _PLSTRING@16 _PLSTRIPC@104 _PLTIMEFMT@8 _PLVEC0@20 Modified: trunk/bindings/f77/plplotf77_ifort.def =================================================================== --- trunk/bindings/f77/plplotf77_ifort.def 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f77/plplotf77_ifort.def 2010-11-22 08:22:36 UTC (rev 11348) @@ -40,6 +40,7 @@ PLSPAUSE PLSTART PLSTRC2F + PLSTRING PLSTRIPC PLTIMEFMT PLVEC0 Modified: trunk/bindings/f77/plplotf77_mingw.def =================================================================== --- trunk/bindings/f77/plplotf77_mingw.def 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f77/plplotf77_mingw.def 2010-11-22 08:22:36 UTC (rev 11348) @@ -41,6 +41,7 @@ plspal1_ plstart_ plstrc2f_ + plstring_ plstripc_ pltimefmt_ plvec0_ Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f77/plstubs.h 2010-11-22 08:22:36 UTC (rev 11348) @@ -329,6 +329,7 @@ #define PLSTRANSFORM FNAME( PLSTRANSFORM, plstransform ) #define PLSTRANSFORM_NONE FNAME( PLSTRANSFORM_NONE, plstransform_none ) #define PLSTRANSFORM_NONE_ FNAME( PLSTRANSFORM_NONE_, plstransform_none_ ) +#define PLSTRING7 FNAME( PLSTRING7, plstring7 ) #define PLSTRIPA FNAME( PLSTRIPA, plstripa ) #define PLSTRIPC7 FNAME( PLSTRIPC7, plstripc7 ) #define PLSTRIPD FNAME( PLSTRIPD, plstripd ) Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f77/scstubs.c 2010-11-22 08:22:36 UTC (rev 11348) @@ -996,6 +996,12 @@ } void +PLSTRING7( PLINT *n, PLFLT *x, PLFLT *y, const char *string ) +{ + c_plstring( *n, x, y, string ); +} + +void PLSTRIPA( PLINT *id, PLINT *pen, PLFLT *x, PLFLT *y ) { c_plstripa( *id, *pen, *x, *y ); Modified: trunk/bindings/f77/sfstubs.fm4 =================================================================== --- trunk/bindings/f77/sfstubs.fm4 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f77/sfstubs.fm4 2010-11-22 08:22:36 UTC (rev 11348) @@ -715,7 +715,7 @@ call plsetmapformc(mapform) call plmap7(s1,minx,maxx,miny,maxy) - end subroutine + end c*********************************************************************** @@ -732,7 +732,7 @@ call plclearmapformc() call plmap7(s1,minx,maxx,miny,maxy) - end subroutine + end c*********************************************************************** @@ -748,7 +748,7 @@ call plsetmapformc(mapform) call plmeridians7(dlong,dlat,minlong,maxlong,minlat,maxlat) - end subroutine + end c*********************************************************************** @@ -764,11 +764,28 @@ call plclearmapformc() call plmeridians7(dlong,dlat,minlong,maxlong,minlat,maxlat) - end subroutine + end c*********************************************************************** + subroutine plstring(n,x,y,string) + + implicit none + integer n + real*8 x(n), y(n) + character*(*) string + + include 'sfstubs.h' + + call plstrf2c(string,s1,maxlen) + call plstring7(n,x,y,s1) + + end + + +c*********************************************************************** + subroutine plstripc(id, xspec, yspec, xmin, xmax, xjump, & ymin, ymax, xlpos, ylpos, y_ascl, acc, & colbox, collab, colline, styline, legline, Modified: trunk/bindings/f95/plplotf95.def =================================================================== --- trunk/bindings/f95/plplotf95.def 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f95/plplotf95.def 2010-11-22 08:22:36 UTC (rev 11348) @@ -75,6 +75,7 @@ _PLPLOT_mp_PLSCMAP1LA@28 _PLPLOT_mp_PLSCMAP1LA2@24 _PLPLOT_mp_PLSCMAP1L2@20 + _PLPLOT_mp_PLSTRING@16 _PLPLOT_mp_PLSTRIPC@104 _PLPLOT_mp_PLSVECT@12 _PLPLOT_mp_PLSYM@12 Modified: trunk/bindings/f95/plplotf95_ifort.def =================================================================== --- trunk/bindings/f95/plplotf95_ifort.def 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f95/plplotf95_ifort.def 2010-11-22 08:22:36 UTC (rev 11348) @@ -77,6 +77,7 @@ PLPLOT_mp_PLSCMAP1LA PLPLOT_mp_PLSCMAP1LA2 PLPLOT_mp_PLSCMAP1L2 + PLPLOT_mp_PLSTRING PLPLOT_mp_PLSTRIPC PLPLOT_mp_PLSVECT PLPLOT_mp_PLSYM Modified: trunk/bindings/f95/plplotf95_mingw.def =================================================================== --- trunk/bindings/f95/plplotf95_mingw.def 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f95/plplotf95_mingw.def 2010-11-22 08:22:36 UTC (rev 11348) @@ -75,6 +75,7 @@ __plplot_MOD_plscmap1la __plplot_MOD_plscmap1la2 __plplot_MOD_plscmap1l2 + __plplot_MOD_plstring __plplot_MOD_plstripc __plplot_MOD_plsvect __plplot_MOD_plsym Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f95/plstubs.h 2010-11-22 08:22:36 UTC (rev 11348) @@ -341,6 +341,7 @@ #define PLSTRANSFORM1 FNAME( PLSTRANSFORM1, plstransform1 ) #define PLSTRANSFORM2 FNAME( PLSTRANSFORM2, plstransform2 ) #define PLSTRANSFORM3 FNAME( PLSTRANSFORM3, plstransform3 ) +#define PLSTRING7 FNAME( PLSTRING7, plstring7 ) #define PLSTRIPA FNAME( PLSTRIPA, plstripa ) #define PLSTRIPC FNAME( PLSTRIPCF77, plstripcf77 ) #define PLSTRIPD FNAME( PLSTRIPD, plstripd ) Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f95/scstubs.c 2010-11-22 08:22:36 UTC (rev 11348) @@ -1077,6 +1077,12 @@ } void +PLSTRING7( PLINT *n, PLFLT *x, PLFLT *y, const char *string ) +{ + c_plstring( *n, x, y, string ); +} + +void PLSTRIPA( PLINT *id, PLINT *pen, PLFLT *x, PLFLT *y ) { c_plstripa( *id, *pen, *x, *y ); Modified: trunk/bindings/f95/sfstubs.f90 =================================================================== --- trunk/bindings/f95/sfstubs.f90 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/f95/sfstubs.f90 2010-11-22 08:22:36 UTC (rev 11348) @@ -326,6 +326,26 @@ !*********************************************************************** + subroutine plstring(x,y,string) + + implicit none + real(kind=plflt) x(:), y(:) + character(len=*) string + + include 'sfstubs.h' + + integer n + + n = size(x) + + call plstrf2c(string, string1, maxlen) + s1 = transfer( string1, s1 ) + call plstring7(n,x,y,s1) + + end subroutine + +!*********************************************************************** + subroutine plvectors_0(u, v, scale) implicit none Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/bindings/tcl/plapi.tpl 2010-11-22 08:22:36 UTC (rev 11348) @@ -133,7 +133,7 @@ col1 PLFLT # Configure transformation between continuous and broken-down time (and -# vice versa) for current stream. +# vice versa) for current stream. pltclcmd plconfigtime void scale PLFLT @@ -382,7 +382,7 @@ pltclcmd plgra void -# Draw gradient in polygon. +# Draw gradient in polygon. pltclcmd plgradient void n PLINT @@ -923,6 +923,14 @@ nx PLINT ny PLINT +# Plot the same string at a series of locations (x(i),y(i)) + +pltclcmd plstring void +n PLINT +x PLFLT * +y PLFLT * +string const char * + # Add data to the strip chart pltclcmd plstripa void Modified: trunk/examples/f77/x04f.fm4 =================================================================== --- trunk/examples/f77/x04f.fm4 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/examples/f77/x04f.fm4 2010-11-22 08:22:36 UTC (rev 11348) @@ -80,6 +80,7 @@ call plbox(' ', 0.0d0, 0, 'cmstv', 30.0d0, 3) call plcol0(3) call plline(101,freql,phase) + call plstring(101,freql,phase,'*') call plcol0(3) call plmtex('r', 5.0d0, 0.5d0, 0.5d0, & 'Phase shift (degrees)') Modified: trunk/examples/f95/x04f.f90 =================================================================== --- trunk/examples/f95/x04f.f90 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/examples/f95/x04f.f90 2010-11-22 08:22:36 UTC (rev 11348) @@ -77,7 +77,8 @@ call plwind(-2.0_plflt, 3.0_plflt, -100.0_plflt, 0.0_plflt) call plbox(' ', 0.0_plflt, 0, 'cmstv', 30.0_plflt, 3) call plcol0(3) - call plline(freql,phase) + call plline(freql, phase) + call plstring(freql, phase, '*') call plcol0(3) call plmtex('r', 5.0_plflt, 0.5_plflt, 0.5_plflt, & 'Phase shift (degrees)') Modified: trunk/examples/tcl/x04.tcl =================================================================== --- trunk/examples/tcl/x04.tcl 2010-11-22 08:20:55 UTC (rev 11347) +++ trunk/examples/tcl/x04.tcl 2010-11-22 08:22:36 UTC (rev 11348) @@ -63,6 +63,7 @@ $w cmd plbox "" 0.0 0 "cmstv" 30.0 3 $w cmd plcol0 3 $w cmd plline 101 freql phase + $w cmd plstring 101 freql phase "*" $w cmd plcol0 3 $w cmd plmtex "r" 5.0 0.5 0.5 "Phase shift (degrees)" } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |